Skip to content

Commit 26c13ed

Browse files
feat(satp): add support for NFTs
Signed-off-by: Tomás Silva <[email protected]>
1 parent a14f896 commit 26c13ed

File tree

111 files changed

+5155
-1906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+5155
-1906
lines changed

examples/cactus-example-cbdc-bridging-backend/src/main/typescript/infrastructure/cbdc-besu-environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export class BesuEnvironment {
426426
id: BesuEnvironment.BESU_ASSET_ID,
427427
referenceId: BesuEnvironment.BESU_ASSET_REFERENCE_ID,
428428
amount,
429-
tokenType: TokenType.NonstandardFungible,
429+
tokenType: TokenType.Fungible,
430430
networkId: {
431431
id: BesuEnvironment.BESU_NETWORK_ID,
432432
ledgerType: NetworkIdLedgerTypeEnum.Besu2X,

examples/cactus-example-cbdc-bridging-backend/src/main/typescript/infrastructure/cbdc-bridging-app-dummy-infrastructure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export class CbdcBridgingAppDummyInfrastructure {
407407
id: BesuEnvironment.BESU_NETWORK_ID,
408408
ledgerType: LedgerType.Besu2X,
409409
},
410-
TokenType.NonstandardFungible,
410+
TokenType.Fungible,
411411
);
412412

413413
if (!reqApproveBesuAddress?.data.approveAddress) {
@@ -429,7 +429,7 @@ export class CbdcBridgingAppDummyInfrastructure {
429429
id: FabricEnvironment.FABRIC_NETWORK_ID,
430430
ledgerType: LedgerType.Fabric2,
431431
},
432-
TokenType.NonstandardFungible,
432+
TokenType.Fungible,
433433
);
434434

435435
if (!reqApproveFabricAddress?.data.approveAddress) {

examples/cactus-example-cbdc-bridging-backend/src/main/typescript/infrastructure/cbdc-fabric-environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export class FabricEnvironment {
475475
id: FabricEnvironment.FABRIC_ASSET_ID,
476476
referenceId: FabricEnvironment.FABRIC_ASSET_REFERENCE_ID,
477477
amount,
478-
tokenType: TokenType.NonstandardFungible,
478+
tokenType: TokenType.Fungible,
479479
networkId: {
480480
id: FabricEnvironment.FABRIC_NETWORK_ID,
481481
ledgerType: NetworkIdLedgerTypeEnum.Fabric2,

packages/cactus-plugin-satp-hermes/src/main/json/openapi-blo-bundled.json

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
"contractName",
8888
"networkId",
8989
"tokenType",
90-
"referenceId"
90+
"referenceId",
91+
"ercTokenStandard"
9192
],
9293
"properties": {
9394
"id": {
@@ -141,16 +142,23 @@
141142
"tokenType": {
142143
"type": "string",
143144
"enum": [
144-
"ERC20",
145-
"ERC721",
146-
"ERC1155",
147145
"NONSTANDARD_FUNGIBLE",
148146
"NONSTANDARD_NONFUNGIBLE"
149147
],
150148
"description": "The type of token."
151149
},
152150
"referenceId": {
153151
"type": "string"
152+
},
153+
"ercTokenStandard": {
154+
"type": "string",
155+
"enum": [
156+
"UNSPECIFIED",
157+
"ERC20",
158+
"ERC721",
159+
"ERC1155"
160+
],
161+
"description": "The ERC token standard."
154162
}
155163
}
156164
},
@@ -163,7 +171,8 @@
163171
"contractName",
164172
"networkId",
165173
"tokenType",
166-
"referenceId"
174+
"referenceId",
175+
"ercTokenStandard"
167176
],
168177
"properties": {
169178
"id": {
@@ -217,16 +226,23 @@
217226
"tokenType": {
218227
"type": "string",
219228
"enum": [
220-
"ERC20",
221-
"ERC721",
222-
"ERC1155",
223229
"NONSTANDARD_FUNGIBLE",
224230
"NONSTANDARD_NONFUNGIBLE"
225231
],
226232
"description": "The type of token."
227233
},
228234
"referenceId": {
229235
"type": "string"
236+
},
237+
"ercTokenStandard": {
238+
"type": "string",
239+
"enum": [
240+
"UNSPECIFIED",
241+
"ERC20",
242+
"ERC721",
243+
"ERC1155"
244+
],
245+
"description": "The ERC token standard."
230246
}
231247
}
232248
}
@@ -2641,9 +2657,6 @@
26412657
"schema": {
26422658
"type": "string",
26432659
"enum": [
2644-
"ERC20",
2645-
"ERC721",
2646-
"ERC1155",
26472660
"NONSTANDARD_FUNGIBLE",
26482661
"NONSTANDARD_NONFUNGIBLE"
26492662
],
@@ -4533,7 +4546,8 @@
45334546
"contractName",
45344547
"networkId",
45354548
"tokenType",
4536-
"referenceId"
4549+
"referenceId",
4550+
"ercTokenStandard"
45374551
],
45384552
"properties": {
45394553
"id": {
@@ -4587,16 +4601,23 @@
45874601
"tokenType": {
45884602
"type": "string",
45894603
"enum": [
4590-
"ERC20",
4591-
"ERC721",
4592-
"ERC1155",
45934604
"NONSTANDARD_FUNGIBLE",
45944605
"NONSTANDARD_NONFUNGIBLE"
45954606
],
45964607
"description": "The type of token."
45974608
},
45984609
"referenceId": {
45994610
"type": "string"
4611+
},
4612+
"ercTokenStandard": {
4613+
"type": "string",
4614+
"enum": [
4615+
"UNSPECIFIED",
4616+
"ERC20",
4617+
"ERC721",
4618+
"ERC1155"
4619+
],
4620+
"description": "The ERC token standard."
46004621
}
46014622
}
46024623
},
@@ -4627,7 +4648,8 @@
46274648
"contractName",
46284649
"networkId",
46294650
"tokenType",
4630-
"referenceId"
4651+
"referenceId",
4652+
"ercTokenStandard"
46314653
],
46324654
"properties": {
46334655
"id": {
@@ -4681,16 +4703,23 @@
46814703
"tokenType": {
46824704
"type": "string",
46834705
"enum": [
4684-
"ERC20",
4685-
"ERC721",
4686-
"ERC1155",
46874706
"NONSTANDARD_FUNGIBLE",
46884707
"NONSTANDARD_NONFUNGIBLE"
46894708
],
46904709
"description": "The type of token."
46914710
},
46924711
"referenceId": {
46934712
"type": "string"
4713+
},
4714+
"ercTokenStandard": {
4715+
"type": "string",
4716+
"enum": [
4717+
"UNSPECIFIED",
4718+
"ERC20",
4719+
"ERC721",
4720+
"ERC1155"
4721+
],
4722+
"description": "The ERC token standard."
46944723
}
46954724
}
46964725
},
@@ -4703,7 +4732,8 @@
47034732
"contractName",
47044733
"networkId",
47054734
"tokenType",
4706-
"referenceId"
4735+
"referenceId",
4736+
"ercTokenStandard"
47074737
],
47084738
"properties": {
47094739
"id": {
@@ -4757,16 +4787,23 @@
47574787
"tokenType": {
47584788
"type": "string",
47594789
"enum": [
4760-
"ERC20",
4761-
"ERC721",
4762-
"ERC1155",
47634790
"NONSTANDARD_FUNGIBLE",
47644791
"NONSTANDARD_NONFUNGIBLE"
47654792
],
47664793
"description": "The type of token."
47674794
},
47684795
"referenceId": {
47694796
"type": "string"
4797+
},
4798+
"ercTokenStandard": {
4799+
"type": "string",
4800+
"enum": [
4801+
"UNSPECIFIED",
4802+
"ERC20",
4803+
"ERC721",
4804+
"ERC1155"
4805+
],
4806+
"description": "The ERC token standard."
47704807
}
47714808
}
47724809
}
@@ -8261,9 +8298,6 @@
82618298
"tokenType": {
82628299
"type": "string",
82638300
"enum": [
8264-
"ERC20",
8265-
"ERC721",
8266-
"ERC1155",
82678301
"NONSTANDARD_FUNGIBLE",
82688302
"NONSTANDARD_NONFUNGIBLE"
82698303
],
@@ -10024,14 +10058,21 @@
1002410058
"TokenType": {
1002510059
"type": "string",
1002610060
"enum": [
10027-
"ERC20",
10028-
"ERC721",
10029-
"ERC1155",
1003010061
"NONSTANDARD_FUNGIBLE",
1003110062
"NONSTANDARD_NONFUNGIBLE"
1003210063
],
1003310064
"description": "The type of token."
1003410065
},
10066+
"ERCTokenStandard": {
10067+
"type": "string",
10068+
"enum": [
10069+
"UNSPECIFIED",
10070+
"ERC20",
10071+
"ERC721",
10072+
"ERC1155"
10073+
],
10074+
"description": "The ERC token standard."
10075+
},
1003510076
"DraftVersions": {
1003610077
"type": "object",
1003710078
"description": "The draft versions supported by the gateway.",

packages/cactus-plugin-satp-hermes/src/main/proto/cacti/satp/v02/common/message.proto

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,8 @@ message WrapAssertionClaim {
277277

278278
enum TokenType {
279279
TOKEN_TYPE_UNSPECIFIED = 0;
280-
TOKEN_TYPE_ERC20 = 1;
281-
TOKEN_TYPE_ERC721 = 2;
282-
TOKEN_TYPE_ERC1155 = 3;
283-
TOKEN_TYPE_NONSTANDARD_FUNGIBLE = 4;
284-
TOKEN_TYPE_NONSTANDARD_NONFUNGIBLE = 5;
280+
TOKEN_TYPE_NONSTANDARD_FUNGIBLE = 1;
281+
TOKEN_TYPE_NONSTANDARD_NONFUNGIBLE = 2;
285282
}
286283

287284
message Asset {
@@ -297,10 +294,18 @@ message Asset {
297294
string msp_id = 8;
298295
string channel_name = 9;
299296
NetworkId network_id = 10;
297+
ERCTokenStandard erc_token_standard = 11;
300298
}
301299

302300
message NetworkId {
303301
string id = 1;
304302
string type = 2;
305303
}
306304

305+
enum ERCTokenStandard {
306+
ERC_TOKEN_STANDARD_UNSPECIFIED = 0;
307+
ERC_TOKEN_STANDARD_ERC20 = 1;
308+
ERC_TOKEN_STANDARD_ERC721 = 2;
309+
ERC_TOKEN_STANDARD_ERC1155 = 3;
310+
}
311+

0 commit comments

Comments
 (0)