Skip to content

Commit e4440f2

Browse files
committed
changing .rest folder requests to reflect sample http requests.
1 parent 25c70e3 commit e4440f2

27 files changed

+285
-409
lines changed

.rest/assetsBurn.http

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/xprt/assets/burn
1+
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/assets/burn
22
Content-Type: application/json
33

44
{
5-
"type": "/xprt/assets/burn/request",
5+
"type": "/xprt/assets/github.com/persistenceOne/persistenceSDK/modules/assets/internal/transactions/burn/transactionRequest",
66
"value": {
77
"baseReq": {
88
"from": "{{ACCOUNT_1_ADDRESS}}",
99
"chain_id": "{{CHAIN_ID}}"
1010
},
11-
"fromID":"{{ACCOUNT_1_ID}}",
12-
"assetID":"{{ACCOUNT_1_ASSET_ID}}"
11+
"fromID":"test.XTJ0wkxGAeMlEqfw3Dx9oR6ZlIE=|IWlaJpSQCEHboqlKYYyzLK_Sq2k=",
12+
"assetID":"test.zZN_aVdLtKcK4556f5i6IwFEm7k=|9mK1kvuzV4pXiEvhC6Iy3oDPn-M="
1313
}
1414
}
1515

.rest/assetsDefine.http

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/assets/define
2+
Content-Type: application/json
3+
4+
{
5+
"type": "/xprt/assets/github.com/persistenceOne/persistenceSDK/modules/assets/internal/transactions/define/transactionRequest",
6+
"value": {
7+
"baseReq": {
8+
"from": "{{ACCOUNT_1_ADDRESS}}",
9+
"chain_id": "{{CHAIN_ID}}"
10+
},
11+
"fromID":"test.MgVN53MovlOXmVrFOb6Rk8efEho=|Hi4ALDaDs923R0w64cr02MffbNA=",
12+
"immutableMetaTraits":"ImmutableMetaPropertyName1:S|ImmutableMetaPropertyValue1,ImmutableMetaPropertyName2:I|",
13+
"immutableTraits":"ImmutablePropertyName3:H|,ImmutablePropertyName4:D|",
14+
"mutableMetaTraits":"MutableMetaPropertyName5:S|,MutableMetaPropertyName6:S|,burn:H|,lock:H|",
15+
"mutableTraits":"MutablePropertyName7:S|,MutablePropertyName8:S|"
16+
}
17+
}
18+
19+
> {%
20+
client.test("Request executed successfully", function() {
21+
client.assert(response.status === 200, "Response status is not 200");
22+
});
23+
client.global.set("assetsDefineTxHash", JSON.parse(JSON.stringify(response.body)).txhash)
24+
%}
25+
26+
###
27+
GET http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/txs/{{assetsDefineTxHash}}
28+
Accept: application/json
29+
30+
> {%
31+
client.test("Request executed successfully", function() {
32+
client.assert(response.status === 200, "Response status is not 200");
33+
});
34+
client.test("Response Code Check", function() {
35+
client.assert(!JSON.parse(JSON.stringify(response.body)).hasOwnProperty("code") , "Response Code is not 0");
36+
});
37+
%}
38+
39+
###

.rest/assetsMint.http

+9-50
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/xprt/assets/mint
1+
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/assets/mint
22
Content-Type: application/json
33

44
{
5-
"type": "/xprt/assets/mint/request",
5+
"type": "/xprt/assets/github.com/persistenceOne/persistenceSDK/modules/assets/internal/transactions/mint/transactionRequest",
66
"value": {
77
"baseReq": {
88
"from": "{{ACCOUNT_1_ADDRESS}}",
99
"chain_id": "{{CHAIN_ID}}"
1010
},
11-
"fromID":"{{ACCOUNT_1_ID}}",
12-
"toID":"{{ACCOUNT_1_ID}}",
13-
"maintainersID":"",
14-
"classificationID":"",
15-
"properties": "{{ACCOUNT_1_NAME}}assets{{NONCE}}:{{ACCOUNT_1_NAME}}assets{{NONCE}}, test1:test1",
16-
"lock": "-1",
17-
"burn": "-1"
11+
"fromID":"test.MgVN53MovlOXmVrFOb6Rk8efEho=|Hi4ALDaDs923R0w64cr02MffbNA=",
12+
"toID":"test.MgVN53MovlOXmVrFOb6Rk8efEho=|Hi4ALDaDs923R0w64cr02MffbNA=",
13+
"classificationID":"test.zZN_aVdLtKcK4556f5i6IwFEm7k=",
14+
"immutableMetaProperties":"ImmutableMetaPropertyName1:S|ImmutableMetaPropertyValue1,ImmutableMetaPropertyName2:I|ImmutableMetaPropertyValue2",
15+
"immutableProperties":"ImmutablePropertyName3:H|100,ImmutablePropertyName4:D|0.1010",
16+
"mutableMetaProperties":"MutableMetaPropertyName5:S|MutableMetaPropertyValue5,MutableMetaPropertyName6:S|MutableMetaPropertyValue6,burn:H|10,lock:H|20",
17+
"mutableProperties":"MutablePropertyName7:S|MutablePropertyValue7,MutablePropertyName8:S|MutablePropertyValue8"
1818
}
1919
}
2020

@@ -38,45 +38,4 @@ client.test("Response Code Check", function() {
3838
});
3939
%}
4040

41-
###
42-
GET http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/assets/assets/-
43-
Accept: application/json
44-
45-
> {%
46-
client.test("Request executed successfully", function() {
47-
client.assert(response.status === 200, "Response status is not 200");
48-
});
49-
50-
51-
52-
assets = JSON.parse(JSON.stringify(response.body)).result.value.assets.value.list;
53-
54-
function checkProperty(propertyID, identity){
55-
properties = identity.value.immutables.value.properties.value.propertyList
56-
for(i = 0; i < properties.length; i++) {
57-
if (propertyID === properties[i].value.id.value.idString){
58-
return true;
59-
}
60-
}
61-
return false;
62-
}
63-
function getID(ID){
64-
assetID = [];
65-
for (id in ID.value) {
66-
if (ID.value.hasOwnProperty(id)){
67-
assetID[assetID.length] = ID.value[id].value.idString;
68-
}
69-
}
70-
return assetID.join(".");
71-
}
72-
for (i = 0; i < assets.length; i++) {
73-
if (checkProperty(client.global.get("ACCOUNT_1_NAME")+"assets"+client.global.get("NONCE"), assets[i])) {
74-
client.global.set("ACCOUNT_1_ASSET_ID", getID(assets[i].value.id));
75-
}
76-
}
77-
78-
79-
80-
%}
81-
8241
###

.rest/assetsMutate.http

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ Content-Type: application/json
88
"from": "{{ACCOUNT_1_ADDRESS}}",
99
"chain_id": "{{CHAIN_ID}}"
1010
},
11-
"fromID":"{{ACCOUNT_1_ID}}",
12-
"assetID":"{{ACCOUNT_1_ASSET_ID}}",
13-
"properties": "test1:test2",
14-
"lock": "-1",
15-
"burn": "-1"
16-
}
11+
"fromID":"test.MgVN53MovlOXmVrFOb6Rk8efEho=|Hi4ALDaDs923R0w64cr02MffbNA=",
12+
"assetID":"test.zZN_aVdLtKcK4556f5i6IwFEm7k=|9mK1kvuzV4pXiEvhC6Iy3oDPn-M=",
13+
"mutableMetaProperties":"MutableMetaPropertyName5:S|MutableMetaPropertyValueNew5,MutableMetaPropertyName6:S|MutableMetaPropertyValueNew6",
14+
"mutableProperties":"MutablePropertyName7:S|MutablePropertyValue7,MutablePropertyName8:S|MutablePropertyValueNew8"
15+
}
1716
}
1817

1918
> {%

.rest/assetsQuery.http

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
GET http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/assets/assets/{{ACCOUNT_1_ASSET_ID}}
1+
GET http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/assets/assets/test.zZN_aVdLtKcK4556f5i6IwFEm7k=|9mK1kvuzV4pXiEvhC6Iy3oDPn-M=
2+
23
Content-Type: application/json
34

45
> {%

.rest/coinsSend.http

+3-43
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/bank/accounts/{{ACCOUNT_1_ADDRESS}}/transfers
1+
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/bank/accounts/cosmos1w7gv22gf6xsce3umdayp7qdhq0swqccaxcnt93/transfers
22
Content-Type: application/json
33

44
{
55
"base_req": {
66
"from": "{{TEST_ACCOUNT_ADDRESS}}",
77
"chain_id": "{{CHAIN_ID}}"
88
},
9-
"amount":[{"denom":"stake","amount":"1000"}],
10-
"mode" : "block"
9+
"amount":[{"denom":"stake","amount":"1000"}]
1110
}
1211

1312
> {%
@@ -31,46 +30,7 @@ Content-Type: application/json
3130
"type": "cosmos-sdk/MsgSend",
3231
"value": {
3332
"from_address": "{{TEST_ACCOUNT_ADDRESS}}",
34-
"to_address": "{{ACCOUNT_1_ADDRESS}}",
35-
"amount": [
36-
{
37-
"denom": "stake",
38-
"amount": "1000"
39-
}
40-
]
41-
}
42-
},
43-
{
44-
"type": "cosmos-sdk/MsgSend",
45-
"value": {
46-
"from_address": "{{TEST_ACCOUNT_ADDRESS}}",
47-
"to_address": "{{ACCOUNT_2_ADDRESS}}",
48-
"amount": [
49-
{
50-
"denom": "stake",
51-
"amount": "1000"
52-
}
53-
]
54-
}
55-
},
56-
{
57-
"type": "cosmos-sdk/MsgSend",
58-
"value": {
59-
"from_address": "{{TEST_ACCOUNT_ADDRESS}}",
60-
"to_address": "{{ACCOUNT_3_ADDRESS}}",
61-
"amount": [
62-
{
63-
"denom": "stake",
64-
"amount": "1000"
65-
}
66-
]
67-
}
68-
},
69-
{
70-
"type": "cosmos-sdk/MsgSend",
71-
"value": {
72-
"from_address": "{{TEST_ACCOUNT_ADDRESS}}",
73-
"to_address": "{{ACCOUNT_4_ADDRESS}}",
33+
"to_address": "cosmos1w7gv22gf6xsce3umdayp7qdhq0swqccaxcnt93",
7434
"amount": [
7535
{
7636
"denom": "stake",

.rest/http-client.env.json

+1-16
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@
55
"ASSET_MANTLE_CLIENT_HOST": "localhost",
66
"ASSET_MANTLE_CLIENT_PORT": 1317,
77
"CHAIN_ID": "test",
8-
"TEST_ACCOUNT_NAME": "test",
9-
"TEST_ACCOUNT_ADDRESS": "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c",
10-
"NONCE": "",
11-
"ACCOUNT_1_NAME": "",
12-
"ACCOUNT_2_NAME": "",
13-
"ACCOUNT_3_NAME": "",
14-
"ACCOUNT_4_NAME": "",
15-
"TX_HASH": "",
16-
"ACCOUNT_1_ADDRESS": "",
17-
"ACCOUNT_2_ADDRESS": "",
18-
"ACCOUNT_3_ADDRESS": "",
19-
"ACCOUNT_4_ADDRESS": "",
20-
"ACCOUNT_1_ID": "",
21-
"ACCOUNT_2_ID": "",
22-
"ACCOUNT_3_ID": "",
23-
"ACCOUNT_4_ID": ""
8+
"TEST_ACCOUNT_ADDRESS": "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c"
249
}
2510
}

.rest/http-client.private.env.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"test": {
3-
"ACCOUNT_1_MNEMONIC":"taxi barely trade submit twist unable deposit merit flip ticket soccer budget course like bulb fiber leopard hawk fiction hello muscle trumpet ensure kiss",
4-
"ACCOUNT_2_MNEMONIC": "burger soon exercise clap squirrel off maximum acoustic obscure check trial immune absent coyote cattle excuse choice twin increase fog chair subway metal remind",
5-
"ACCOUNT_3_MNEMONIC": "draft warrior marriage dish table tackle now genius brick vast ridge vendor swap bar expire inner catch title force local kind sausage correct brass",
6-
"ACCOUNT_4_MNEMONIC": "liberty fuel obtain approve will danger ask biology hole bright multiply tobacco wheel poem couple chronic entire case meadow garbage magnet divert surge uncle"
3+
"ACCOUNT_1_MNEMONIC":"taxi barely trade submit twist unable deposit merit flip ticket soccer budget course like bulb fiber leopard hawk fiction hello muscle trumpet ensure kiss"
74
}
85
}

.rest/identitiesDefine.http

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/identities/define
2+
Content-Type: application/json
3+
4+
{
5+
"type": "/xprt/identities/github.com/persistenceOne/persistenceSDK/modules/identities/internal/transactions/define/transactionRequest",
6+
"value": {
7+
"baseReq": {
8+
"from": "{{ACCOUNT_1_ADDRESS}}",
9+
"chain_id": "{{CHAIN_ID}}"
10+
},
11+
"fromID":"test.MgVN53MovlOXmVrFOb6Rk8efEho=|Hi4ALDaDs923R0w64cr02MffbNA=",
12+
"immutableMetaTraits":"ImmutableMetaPropertyName1:S|ImmutableMetaPropertyValue1,ImmutableMetaPropertyName2:I|",
13+
"immutableTraits":"ImmutablePropertyName3:H|,ImmutablePropertyName4:D|",
14+
"mutableMetaTraits":"MutableMetaPropertyName5:S|,MutableMetaPropertyName6:S|",
15+
"mutableTraits":"MutablePropertyName7:S|,MutablePropertyName8:S|"
16+
}
17+
}
18+
19+
> {%
20+
client.test("Request executed successfully", function() {
21+
client.assert(response.status === 200, "Response status is not 200");
22+
});
23+
client.global.set("identitiesDefineTxHash", JSON.parse(JSON.stringify(response.body)).txhash)
24+
%}
25+
26+
###
27+
GET http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/txs/{{identitiesDefineTxHash}}
28+
Accept: application/json
29+
30+
> {%
31+
client.test("Request executed successfully", function() {
32+
client.assert(response.status === 200, "Response status is not 200");
33+
});
34+
client.test("Response Code Check", function() {
35+
client.assert(!JSON.parse(JSON.stringify(response.body)).hasOwnProperty("code") , "Response Code is not 0");
36+
});
37+
%}
38+
39+
###

.rest/identitiesIssue.http

+11-52
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/xprt/identities/issue
1+
POST http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/identities/issue
22
Content-Type: application/json
33

44
{
5-
"type": "/xprt/identities/issue/request",
5+
"type": "/xprt/identities/github.com/persistenceOne/persistenceSDK/modules/identities/internal/transactions/issue/transactionRequest",
66
"value": {
77
"baseReq": {
88
"from": "{{ACCOUNT_1_ADDRESS}}",
99
"chain_id": "{{CHAIN_ID}}"
1010
},
11-
"to": "{{ACCOUNT_1_ADDRESS}}",
12-
"fromID": "",
13-
"maintainersID":"",
14-
"classificationID":"",
15-
"properties": "{{ACCOUNT_1_NAME}}identities{{NONCE}}:{{ACCOUNT_1_NAME}}identities{{NONCE}},test1:test1"
16-
}
11+
"fromID": "test.MgVN53MovlOXmVrFOb6Rk8efEho=|Hi4ALDaDs923R0w64cr02MffbNA=",
12+
"classificationID":"test.UmQ7cvtwX3GGpbh7MpEf2-S6JiU=",
13+
"to": "cosmos14th3gcu50q778wal7fug8h5hf07l8t8dzulghf",
14+
"immutableMetaProperties":"ImmutableMetaPropertyName1:S|ImmutableMetaPropertyValue1,ImmutableMetaPropertyName2:I|ImmutableMetaPropertyValue2",
15+
"immutableProperties":"ImmutablePropertyName3:H|100,ImmutablePropertyName4:D|0.1010",
16+
"mutableMetaProperties":"MutableMetaPropertyName5:S|MutableMetaPropertyValue5,MutableMetaPropertyName6:S|MutableMetaPropertyValue6,burn:H|10,lock:H|20",
17+
"mutableProperties":"MutablePropertyName7:S|MutablePropertyValue7,MutablePropertyName8:S|MutablePropertyValue8"
18+
}
1719
}
1820

1921
> {%
@@ -37,47 +39,4 @@ Accept: application/json
3739
});
3840
%}
3941

40-
###
41-
GET http://{{ASSET_MANTLE_CLIENT_HOST}}:{{ASSET_MANTLE_CLIENT_PORT}}/identities/identities/-
42-
Accept: application/json
43-
44-
> {%
45-
client.test("Request executed successfully", function() {
46-
client.assert(response.status === 200, "Response status is not 200");
47-
});
48-
49-
identities = JSON.parse(JSON.stringify(response.body)).result.value.identities.value.list;
50-
function checkProvisionedAddress(address, identity){
51-
for(i = 0; i < identity.value.provisionedAddressList.length; i++) {
52-
if (address === identity.value.provisionedAddressList[i]){
53-
return true;
54-
}
55-
}
56-
return false;
57-
}
58-
function checkProperty(propertyID, identity){
59-
properties = identity.value.immutables.value.properties.value.propertyList
60-
for(i = 0; i < properties.length; i++) {
61-
if (propertyID === properties[i].value.id.value.idString){
62-
return true;
63-
}
64-
}
65-
return false;
66-
}
67-
function getID(ID){
68-
identitiyID = [];
69-
for (identity in ID.value) {
70-
if (ID.value.hasOwnProperty(identity)){
71-
identitiyID[identitiyID.length] = ID.value[identity].value.idString;
72-
}
73-
}
74-
return identitiyID.join(".");
75-
}
76-
for (i = 0; i < identities.length; i++) {
77-
if (checkProvisionedAddress(client.global.get("ACCOUNT_1_ADDRESS"),identities[i])
78-
&&
79-
checkProperty(client.global.get("ACCOUNT_1_NAME")+"identities"+client.global.get("NONCE"), identities[i])) {
80-
client.global.set("ACCOUNT_1_ID", getID(identities[i].value.id));
81-
}
82-
}
83-
%}
42+
###

0 commit comments

Comments
 (0)