@medialane/sdk 0.8.0 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/index.cjs +156 -414
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +118 -311
- package/dist/index.d.ts +118 -311
- package/dist/index.js +145 -415
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,11 +6,21 @@ var starknet = require('starknet');
|
|
|
6
6
|
// src/config.ts
|
|
7
7
|
|
|
8
8
|
// src/constants.ts
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var MARKETPLACE_721_CONTRACT_MAINNET = "0x00f8ccaae0bc811c79605974cc1dab769b9cea8877f033f8e3c17f30457caba6";
|
|
10
|
+
var MARKETPLACE_CONTRACT_MAINNET = MARKETPLACE_721_CONTRACT_MAINNET;
|
|
11
|
+
var MARKETPLACE_721_CLASS_HASH_MAINNET = "0x03dff4f34b976207246207954263be9a28b51390321702443291088dcdf4b2e6";
|
|
12
|
+
var MARKETPLACE_CLASS_HASH_MAINNET = MARKETPLACE_721_CLASS_HASH_MAINNET;
|
|
13
|
+
var MARKETPLACE_721_START_BLOCK_MAINNET = 9196722;
|
|
14
|
+
var MARKETPLACE_START_BLOCK_MAINNET = MARKETPLACE_721_START_BLOCK_MAINNET;
|
|
15
|
+
var MARKETPLACE_1155_CONTRACT_MAINNET = "0x02bfa521c25461a09d735889b469418608d7d92f8b26e3d37ef174a4c2e22f99";
|
|
16
|
+
var MARKETPLACE_1155_CLASS_HASH_MAINNET = "0x01b674aad934be85abc7c1970265cbf7e9bc7d586a90f0a67112c201636dbdd3";
|
|
17
|
+
var MARKETPLACE_1155_START_BLOCK_MAINNET = 9260304;
|
|
18
|
+
var COLLECTION_721_CONTRACT_MAINNET = "0x05c49ee5d3208a2c2e150fdd0c247d1195ed9ab54fa2d5dea7a633f39e4b205b";
|
|
19
|
+
var COLLECTION_CONTRACT_MAINNET = COLLECTION_721_CONTRACT_MAINNET;
|
|
12
20
|
var DROP_FACTORY_CONTRACT_MAINNET = "0x03587f42e29daee1b193f6cf83bf8627908ed6632d0d83fcb26225c50547d800";
|
|
13
21
|
var POP_FACTORY_CONTRACT_MAINNET = "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111";
|
|
22
|
+
var NFTCOMMENTS_CONTRACT_MAINNET = "0x024f97eb5abe659fb650bf162b5fc16501f8f3863a7369901ce6099462e62799";
|
|
23
|
+
var INDEXER_START_BLOCK_MAINNET = MARKETPLACE_721_START_BLOCK_MAINNET;
|
|
14
24
|
var SUPPORTED_TOKENS = [
|
|
15
25
|
{
|
|
16
26
|
// Circle-native USDC on Starknet (canonical)
|
|
@@ -49,8 +59,10 @@ var SUPPORTED_NETWORKS = ["mainnet"];
|
|
|
49
59
|
var DEFAULT_RPC_URL = "https://rpc.starknet.lava.build";
|
|
50
60
|
var POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
|
|
51
61
|
var DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
|
|
52
|
-
var
|
|
53
|
-
var
|
|
62
|
+
var COLLECTION_1155_CONTRACT_MAINNET = "0x006b2dc7ca7c4f466bb4575ba043d934310f052074f849caf853a86bcb819fd6";
|
|
63
|
+
var ERC1155_FACTORY_CONTRACT_MAINNET = COLLECTION_1155_CONTRACT_MAINNET;
|
|
64
|
+
var COLLECTION_1155_CLASS_HASH_MAINNET = "0x39a85126c6627db263617e5bce2bb72e49d2bb1f20961efc8b8954665bcfd25";
|
|
65
|
+
var ERC1155_COLLECTION_CLASS_HASH_MAINNET = COLLECTION_1155_CLASS_HASH_MAINNET;
|
|
54
66
|
|
|
55
67
|
// src/config.ts
|
|
56
68
|
var MedialaneConfigSchema = zod.z.object({
|
|
@@ -58,9 +70,12 @@ var MedialaneConfigSchema = zod.z.object({
|
|
|
58
70
|
rpcUrl: zod.z.string().url().optional(),
|
|
59
71
|
backendUrl: zod.z.string().url().optional(),
|
|
60
72
|
apiKey: zod.z.string().optional(),
|
|
73
|
+
marketplace721Contract: zod.z.string().optional(),
|
|
61
74
|
marketplaceContract: zod.z.string().optional(),
|
|
62
75
|
marketplace1155Contract: zod.z.string().optional(),
|
|
76
|
+
collection721Contract: zod.z.string().optional(),
|
|
63
77
|
collectionContract: zod.z.string().optional(),
|
|
78
|
+
collection1155Contract: zod.z.string().optional(),
|
|
64
79
|
retryOptions: zod.z.object({
|
|
65
80
|
maxAttempts: zod.z.number().int().min(1).max(10).optional(),
|
|
66
81
|
baseDelayMs: zod.z.number().int().min(0).optional(),
|
|
@@ -69,14 +84,19 @@ var MedialaneConfigSchema = zod.z.object({
|
|
|
69
84
|
});
|
|
70
85
|
function resolveConfig(raw) {
|
|
71
86
|
const parsed = MedialaneConfigSchema.parse(raw);
|
|
87
|
+
const marketplace721Contract = parsed.marketplace721Contract ?? parsed.marketplaceContract ?? MARKETPLACE_721_CONTRACT_MAINNET;
|
|
88
|
+
const collection721Contract = parsed.collection721Contract ?? parsed.collectionContract ?? COLLECTION_721_CONTRACT_MAINNET;
|
|
72
89
|
return {
|
|
73
90
|
network: parsed.network,
|
|
74
91
|
rpcUrl: parsed.rpcUrl ?? DEFAULT_RPC_URL,
|
|
75
92
|
backendUrl: parsed.backendUrl,
|
|
76
93
|
apiKey: parsed.apiKey,
|
|
77
|
-
|
|
94
|
+
marketplace721Contract,
|
|
95
|
+
marketplaceContract: marketplace721Contract,
|
|
78
96
|
marketplace1155Contract: parsed.marketplace1155Contract ?? MARKETPLACE_1155_CONTRACT_MAINNET,
|
|
79
|
-
|
|
97
|
+
collection721Contract,
|
|
98
|
+
collectionContract: collection721Contract,
|
|
99
|
+
collection1155Contract: parsed.collection1155Contract ?? COLLECTION_1155_CONTRACT_MAINNET,
|
|
80
100
|
retryOptions: parsed.retryOptions
|
|
81
101
|
};
|
|
82
102
|
}
|
|
@@ -920,59 +940,80 @@ var CollectionRegistryABI = [
|
|
|
920
940
|
var Medialane1155ABI = [
|
|
921
941
|
{
|
|
922
942
|
"type": "impl",
|
|
923
|
-
"name": "
|
|
924
|
-
"interface_name": "
|
|
943
|
+
"name": "Medialane1155V2Impl",
|
|
944
|
+
"interface_name": "medialane_erc1155::core::interface::IMedialane1155V2"
|
|
925
945
|
},
|
|
926
946
|
{
|
|
927
|
-
"type": "
|
|
928
|
-
"name": "
|
|
929
|
-
"
|
|
947
|
+
"type": "struct",
|
|
948
|
+
"name": "medialane_erc1155::core::types::OfferItem",
|
|
949
|
+
"members": [
|
|
930
950
|
{
|
|
931
|
-
"
|
|
932
|
-
"
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
"
|
|
940
|
-
"
|
|
951
|
+
"name": "item_type",
|
|
952
|
+
"type": "core::felt252"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "token",
|
|
956
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"name": "identifier_or_criteria",
|
|
960
|
+
"type": "core::felt252"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"name": "start_amount",
|
|
964
|
+
"type": "core::felt252"
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"name": "end_amount",
|
|
968
|
+
"type": "core::felt252"
|
|
941
969
|
}
|
|
942
970
|
]
|
|
943
971
|
},
|
|
944
|
-
{
|
|
945
|
-
"type": "impl",
|
|
946
|
-
"name": "Medialane1155Impl",
|
|
947
|
-
"interface_name": "medialane_erc1155::core::interface::IMedialane1155"
|
|
948
|
-
},
|
|
949
972
|
{
|
|
950
973
|
"type": "struct",
|
|
951
|
-
"name": "medialane_erc1155::core::types::
|
|
974
|
+
"name": "medialane_erc1155::core::types::ConsiderationItem",
|
|
952
975
|
"members": [
|
|
953
976
|
{
|
|
954
|
-
"name": "
|
|
955
|
-
"type": "core::
|
|
977
|
+
"name": "item_type",
|
|
978
|
+
"type": "core::felt252"
|
|
956
979
|
},
|
|
957
980
|
{
|
|
958
|
-
"name": "
|
|
981
|
+
"name": "token",
|
|
959
982
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
960
983
|
},
|
|
961
984
|
{
|
|
962
|
-
"name": "
|
|
985
|
+
"name": "identifier_or_criteria",
|
|
986
|
+
"type": "core::felt252"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"name": "start_amount",
|
|
963
990
|
"type": "core::felt252"
|
|
964
991
|
},
|
|
965
992
|
{
|
|
966
|
-
"name": "
|
|
993
|
+
"name": "end_amount",
|
|
967
994
|
"type": "core::felt252"
|
|
968
995
|
},
|
|
969
996
|
{
|
|
970
|
-
"name": "
|
|
997
|
+
"name": "recipient",
|
|
998
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
999
|
+
}
|
|
1000
|
+
]
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"type": "struct",
|
|
1004
|
+
"name": "medialane_erc1155::core::types::OrderParameters",
|
|
1005
|
+
"members": [
|
|
1006
|
+
{
|
|
1007
|
+
"name": "offerer",
|
|
971
1008
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
972
1009
|
},
|
|
973
1010
|
{
|
|
974
|
-
"name": "
|
|
975
|
-
"type": "core::
|
|
1011
|
+
"name": "offer",
|
|
1012
|
+
"type": "medialane_erc1155::core::types::OfferItem"
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
"name": "consideration",
|
|
1016
|
+
"type": "medialane_erc1155::core::types::ConsiderationItem"
|
|
976
1017
|
},
|
|
977
1018
|
{
|
|
978
1019
|
"name": "start_time",
|
|
@@ -1018,6 +1059,10 @@ var Medialane1155ABI = [
|
|
|
1018
1059
|
"name": "fulfiller",
|
|
1019
1060
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
1020
1061
|
},
|
|
1062
|
+
{
|
|
1063
|
+
"name": "quantity",
|
|
1064
|
+
"type": "core::felt252"
|
|
1065
|
+
},
|
|
1021
1066
|
{
|
|
1022
1067
|
"name": "nonce",
|
|
1023
1068
|
"type": "core::felt252"
|
|
@@ -1092,20 +1137,6 @@ var Medialane1155ABI = [
|
|
|
1092
1137
|
}
|
|
1093
1138
|
]
|
|
1094
1139
|
},
|
|
1095
|
-
{
|
|
1096
|
-
"type": "enum",
|
|
1097
|
-
"name": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
|
|
1098
|
-
"variants": [
|
|
1099
|
-
{
|
|
1100
|
-
"name": "Some",
|
|
1101
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
1102
|
-
},
|
|
1103
|
-
{
|
|
1104
|
-
"name": "None",
|
|
1105
|
-
"type": "()"
|
|
1106
|
-
}
|
|
1107
|
-
]
|
|
1108
|
-
},
|
|
1109
1140
|
{
|
|
1110
1141
|
"type": "struct",
|
|
1111
1142
|
"name": "medialane_erc1155::core::types::OrderDetails",
|
|
@@ -1115,24 +1146,12 @@ var Medialane1155ABI = [
|
|
|
1115
1146
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
1116
1147
|
},
|
|
1117
1148
|
{
|
|
1118
|
-
"name": "
|
|
1119
|
-
"type": "core::
|
|
1120
|
-
},
|
|
1121
|
-
{
|
|
1122
|
-
"name": "token_id",
|
|
1123
|
-
"type": "core::felt252"
|
|
1124
|
-
},
|
|
1125
|
-
{
|
|
1126
|
-
"name": "amount",
|
|
1127
|
-
"type": "core::felt252"
|
|
1149
|
+
"name": "offer",
|
|
1150
|
+
"type": "medialane_erc1155::core::types::OfferItem"
|
|
1128
1151
|
},
|
|
1129
1152
|
{
|
|
1130
|
-
"name": "
|
|
1131
|
-
"type": "core::
|
|
1132
|
-
},
|
|
1133
|
-
{
|
|
1134
|
-
"name": "price_per_unit",
|
|
1135
|
-
"type": "core::felt252"
|
|
1153
|
+
"name": "consideration",
|
|
1154
|
+
"type": "medialane_erc1155::core::types::ConsiderationItem"
|
|
1136
1155
|
},
|
|
1137
1156
|
{
|
|
1138
1157
|
"name": "start_time",
|
|
@@ -1147,14 +1166,18 @@ var Medialane1155ABI = [
|
|
|
1147
1166
|
"type": "medialane_erc1155::core::types::OrderStatus"
|
|
1148
1167
|
},
|
|
1149
1168
|
{
|
|
1150
|
-
"name": "
|
|
1151
|
-
"type": "core::
|
|
1169
|
+
"name": "total_amount",
|
|
1170
|
+
"type": "core::felt252"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
"name": "remaining_amount",
|
|
1174
|
+
"type": "core::felt252"
|
|
1152
1175
|
}
|
|
1153
1176
|
]
|
|
1154
1177
|
},
|
|
1155
1178
|
{
|
|
1156
1179
|
"type": "interface",
|
|
1157
|
-
"name": "medialane_erc1155::core::interface::
|
|
1180
|
+
"name": "medialane_erc1155::core::interface::IMedialane1155V2",
|
|
1158
1181
|
"items": [
|
|
1159
1182
|
{
|
|
1160
1183
|
"type": "function",
|
|
@@ -1230,7 +1253,7 @@ var Medialane1155ABI = [
|
|
|
1230
1253
|
},
|
|
1231
1254
|
{
|
|
1232
1255
|
"type": "function",
|
|
1233
|
-
"name": "
|
|
1256
|
+
"name": "get_native_token_address",
|
|
1234
1257
|
"inputs": [],
|
|
1235
1258
|
"outputs": [
|
|
1236
1259
|
{
|
|
@@ -1268,150 +1291,10 @@ var Medialane1155ABI = [
|
|
|
1268
1291
|
}
|
|
1269
1292
|
]
|
|
1270
1293
|
},
|
|
1271
|
-
{
|
|
1272
|
-
"type": "impl",
|
|
1273
|
-
"name": "SRC5Impl",
|
|
1274
|
-
"interface_name": "openzeppelin_introspection::interface::ISRC5"
|
|
1275
|
-
},
|
|
1276
|
-
{
|
|
1277
|
-
"type": "enum",
|
|
1278
|
-
"name": "core::bool",
|
|
1279
|
-
"variants": [
|
|
1280
|
-
{
|
|
1281
|
-
"name": "False",
|
|
1282
|
-
"type": "()"
|
|
1283
|
-
},
|
|
1284
|
-
{
|
|
1285
|
-
"name": "True",
|
|
1286
|
-
"type": "()"
|
|
1287
|
-
}
|
|
1288
|
-
]
|
|
1289
|
-
},
|
|
1290
|
-
{
|
|
1291
|
-
"type": "interface",
|
|
1292
|
-
"name": "openzeppelin_introspection::interface::ISRC5",
|
|
1293
|
-
"items": [
|
|
1294
|
-
{
|
|
1295
|
-
"type": "function",
|
|
1296
|
-
"name": "supports_interface",
|
|
1297
|
-
"inputs": [
|
|
1298
|
-
{
|
|
1299
|
-
"name": "interface_id",
|
|
1300
|
-
"type": "core::felt252"
|
|
1301
|
-
}
|
|
1302
|
-
],
|
|
1303
|
-
"outputs": [
|
|
1304
|
-
{
|
|
1305
|
-
"type": "core::bool"
|
|
1306
|
-
}
|
|
1307
|
-
],
|
|
1308
|
-
"state_mutability": "view"
|
|
1309
|
-
}
|
|
1310
|
-
]
|
|
1311
|
-
},
|
|
1312
|
-
{
|
|
1313
|
-
"type": "impl",
|
|
1314
|
-
"name": "AccessControlImpl",
|
|
1315
|
-
"interface_name": "openzeppelin_access::accesscontrol::interface::IAccessControl"
|
|
1316
|
-
},
|
|
1317
|
-
{
|
|
1318
|
-
"type": "interface",
|
|
1319
|
-
"name": "openzeppelin_access::accesscontrol::interface::IAccessControl",
|
|
1320
|
-
"items": [
|
|
1321
|
-
{
|
|
1322
|
-
"type": "function",
|
|
1323
|
-
"name": "has_role",
|
|
1324
|
-
"inputs": [
|
|
1325
|
-
{
|
|
1326
|
-
"name": "role",
|
|
1327
|
-
"type": "core::felt252"
|
|
1328
|
-
},
|
|
1329
|
-
{
|
|
1330
|
-
"name": "account",
|
|
1331
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
1332
|
-
}
|
|
1333
|
-
],
|
|
1334
|
-
"outputs": [
|
|
1335
|
-
{
|
|
1336
|
-
"type": "core::bool"
|
|
1337
|
-
}
|
|
1338
|
-
],
|
|
1339
|
-
"state_mutability": "view"
|
|
1340
|
-
},
|
|
1341
|
-
{
|
|
1342
|
-
"type": "function",
|
|
1343
|
-
"name": "get_role_admin",
|
|
1344
|
-
"inputs": [
|
|
1345
|
-
{
|
|
1346
|
-
"name": "role",
|
|
1347
|
-
"type": "core::felt252"
|
|
1348
|
-
}
|
|
1349
|
-
],
|
|
1350
|
-
"outputs": [
|
|
1351
|
-
{
|
|
1352
|
-
"type": "core::felt252"
|
|
1353
|
-
}
|
|
1354
|
-
],
|
|
1355
|
-
"state_mutability": "view"
|
|
1356
|
-
},
|
|
1357
|
-
{
|
|
1358
|
-
"type": "function",
|
|
1359
|
-
"name": "grant_role",
|
|
1360
|
-
"inputs": [
|
|
1361
|
-
{
|
|
1362
|
-
"name": "role",
|
|
1363
|
-
"type": "core::felt252"
|
|
1364
|
-
},
|
|
1365
|
-
{
|
|
1366
|
-
"name": "account",
|
|
1367
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
1368
|
-
}
|
|
1369
|
-
],
|
|
1370
|
-
"outputs": [],
|
|
1371
|
-
"state_mutability": "external"
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
"type": "function",
|
|
1375
|
-
"name": "revoke_role",
|
|
1376
|
-
"inputs": [
|
|
1377
|
-
{
|
|
1378
|
-
"name": "role",
|
|
1379
|
-
"type": "core::felt252"
|
|
1380
|
-
},
|
|
1381
|
-
{
|
|
1382
|
-
"name": "account",
|
|
1383
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
1384
|
-
}
|
|
1385
|
-
],
|
|
1386
|
-
"outputs": [],
|
|
1387
|
-
"state_mutability": "external"
|
|
1388
|
-
},
|
|
1389
|
-
{
|
|
1390
|
-
"type": "function",
|
|
1391
|
-
"name": "renounce_role",
|
|
1392
|
-
"inputs": [
|
|
1393
|
-
{
|
|
1394
|
-
"name": "role",
|
|
1395
|
-
"type": "core::felt252"
|
|
1396
|
-
},
|
|
1397
|
-
{
|
|
1398
|
-
"name": "account",
|
|
1399
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
1400
|
-
}
|
|
1401
|
-
],
|
|
1402
|
-
"outputs": [],
|
|
1403
|
-
"state_mutability": "external"
|
|
1404
|
-
}
|
|
1405
|
-
]
|
|
1406
|
-
},
|
|
1407
1294
|
{
|
|
1408
1295
|
"type": "constructor",
|
|
1409
1296
|
"name": "constructor",
|
|
1410
1297
|
"inputs": [
|
|
1411
|
-
{
|
|
1412
|
-
"name": "manager",
|
|
1413
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
1414
|
-
},
|
|
1415
1298
|
{
|
|
1416
1299
|
"name": "native_token_address",
|
|
1417
1300
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
@@ -1432,31 +1315,6 @@ var Medialane1155ABI = [
|
|
|
1432
1315
|
"name": "offerer",
|
|
1433
1316
|
"type": "core::starknet::contract_address::ContractAddress",
|
|
1434
1317
|
"kind": "key"
|
|
1435
|
-
},
|
|
1436
|
-
{
|
|
1437
|
-
"name": "nft_contract",
|
|
1438
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1439
|
-
"kind": "data"
|
|
1440
|
-
},
|
|
1441
|
-
{
|
|
1442
|
-
"name": "token_id",
|
|
1443
|
-
"type": "core::felt252",
|
|
1444
|
-
"kind": "data"
|
|
1445
|
-
},
|
|
1446
|
-
{
|
|
1447
|
-
"name": "amount",
|
|
1448
|
-
"type": "core::felt252",
|
|
1449
|
-
"kind": "data"
|
|
1450
|
-
},
|
|
1451
|
-
{
|
|
1452
|
-
"name": "price_per_unit",
|
|
1453
|
-
"type": "core::felt252",
|
|
1454
|
-
"kind": "data"
|
|
1455
|
-
},
|
|
1456
|
-
{
|
|
1457
|
-
"name": "payment_token",
|
|
1458
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1459
|
-
"kind": "data"
|
|
1460
1318
|
}
|
|
1461
1319
|
]
|
|
1462
1320
|
},
|
|
@@ -1495,193 +1353,58 @@ var Medialane1155ABI = [
|
|
|
1495
1353
|
"kind": "key"
|
|
1496
1354
|
},
|
|
1497
1355
|
{
|
|
1498
|
-
"name": "
|
|
1499
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1500
|
-
"kind": "data"
|
|
1501
|
-
},
|
|
1502
|
-
{
|
|
1503
|
-
"name": "royalty_amount",
|
|
1504
|
-
"type": "core::integer::u256",
|
|
1505
|
-
"kind": "data"
|
|
1506
|
-
}
|
|
1507
|
-
]
|
|
1508
|
-
},
|
|
1509
|
-
{
|
|
1510
|
-
"type": "event",
|
|
1511
|
-
"name": "medialane_erc1155::core::events::OrderCancelled",
|
|
1512
|
-
"kind": "struct",
|
|
1513
|
-
"members": [
|
|
1514
|
-
{
|
|
1515
|
-
"name": "order_hash",
|
|
1516
|
-
"type": "core::felt252",
|
|
1517
|
-
"kind": "key"
|
|
1518
|
-
},
|
|
1519
|
-
{
|
|
1520
|
-
"name": "offerer",
|
|
1521
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1522
|
-
"kind": "key"
|
|
1523
|
-
}
|
|
1524
|
-
]
|
|
1525
|
-
},
|
|
1526
|
-
{
|
|
1527
|
-
"type": "event",
|
|
1528
|
-
"name": "openzeppelin_utils::cryptography::nonces::NoncesComponent::Event",
|
|
1529
|
-
"kind": "enum",
|
|
1530
|
-
"variants": []
|
|
1531
|
-
},
|
|
1532
|
-
{
|
|
1533
|
-
"type": "event",
|
|
1534
|
-
"name": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
|
|
1535
|
-
"kind": "struct",
|
|
1536
|
-
"members": [
|
|
1537
|
-
{
|
|
1538
|
-
"name": "class_hash",
|
|
1539
|
-
"type": "core::starknet::class_hash::ClassHash",
|
|
1540
|
-
"kind": "data"
|
|
1541
|
-
}
|
|
1542
|
-
]
|
|
1543
|
-
},
|
|
1544
|
-
{
|
|
1545
|
-
"type": "event",
|
|
1546
|
-
"name": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
|
|
1547
|
-
"kind": "enum",
|
|
1548
|
-
"variants": [
|
|
1549
|
-
{
|
|
1550
|
-
"name": "Upgraded",
|
|
1551
|
-
"type": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
|
|
1552
|
-
"kind": "nested"
|
|
1553
|
-
}
|
|
1554
|
-
]
|
|
1555
|
-
},
|
|
1556
|
-
{
|
|
1557
|
-
"type": "event",
|
|
1558
|
-
"name": "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
1559
|
-
"kind": "enum",
|
|
1560
|
-
"variants": []
|
|
1561
|
-
},
|
|
1562
|
-
{
|
|
1563
|
-
"type": "event",
|
|
1564
|
-
"name": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleGranted",
|
|
1565
|
-
"kind": "struct",
|
|
1566
|
-
"members": [
|
|
1567
|
-
{
|
|
1568
|
-
"name": "role",
|
|
1356
|
+
"name": "quantity",
|
|
1569
1357
|
"type": "core::felt252",
|
|
1570
1358
|
"kind": "data"
|
|
1571
1359
|
},
|
|
1572
1360
|
{
|
|
1573
|
-
"name": "
|
|
1574
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1575
|
-
"kind": "data"
|
|
1576
|
-
},
|
|
1577
|
-
{
|
|
1578
|
-
"name": "sender",
|
|
1579
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1580
|
-
"kind": "data"
|
|
1581
|
-
}
|
|
1582
|
-
]
|
|
1583
|
-
},
|
|
1584
|
-
{
|
|
1585
|
-
"type": "event",
|
|
1586
|
-
"name": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleGrantedWithDelay",
|
|
1587
|
-
"kind": "struct",
|
|
1588
|
-
"members": [
|
|
1589
|
-
{
|
|
1590
|
-
"name": "role",
|
|
1361
|
+
"name": "remaining_amount",
|
|
1591
1362
|
"type": "core::felt252",
|
|
1592
1363
|
"kind": "data"
|
|
1593
1364
|
},
|
|
1594
1365
|
{
|
|
1595
|
-
"name": "
|
|
1596
|
-
"type": "core::
|
|
1366
|
+
"name": "sale_amount",
|
|
1367
|
+
"type": "core::integer::u256",
|
|
1597
1368
|
"kind": "data"
|
|
1598
1369
|
},
|
|
1599
1370
|
{
|
|
1600
|
-
"name": "
|
|
1371
|
+
"name": "royalty_receiver",
|
|
1601
1372
|
"type": "core::starknet::contract_address::ContractAddress",
|
|
1602
1373
|
"kind": "data"
|
|
1603
1374
|
},
|
|
1604
1375
|
{
|
|
1605
|
-
"name": "
|
|
1606
|
-
"type": "core::integer::
|
|
1376
|
+
"name": "royalty_amount",
|
|
1377
|
+
"type": "core::integer::u256",
|
|
1607
1378
|
"kind": "data"
|
|
1608
1379
|
}
|
|
1609
1380
|
]
|
|
1610
1381
|
},
|
|
1611
1382
|
{
|
|
1612
1383
|
"type": "event",
|
|
1613
|
-
"name": "
|
|
1384
|
+
"name": "medialane_erc1155::core::events::OrderCancelled",
|
|
1614
1385
|
"kind": "struct",
|
|
1615
1386
|
"members": [
|
|
1616
1387
|
{
|
|
1617
|
-
"name": "
|
|
1388
|
+
"name": "order_hash",
|
|
1618
1389
|
"type": "core::felt252",
|
|
1619
|
-
"kind": "
|
|
1620
|
-
},
|
|
1621
|
-
{
|
|
1622
|
-
"name": "account",
|
|
1623
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
1624
|
-
"kind": "data"
|
|
1390
|
+
"kind": "key"
|
|
1625
1391
|
},
|
|
1626
1392
|
{
|
|
1627
|
-
"name": "
|
|
1393
|
+
"name": "offerer",
|
|
1628
1394
|
"type": "core::starknet::contract_address::ContractAddress",
|
|
1629
|
-
"kind": "
|
|
1630
|
-
}
|
|
1631
|
-
]
|
|
1632
|
-
},
|
|
1633
|
-
{
|
|
1634
|
-
"type": "event",
|
|
1635
|
-
"name": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleAdminChanged",
|
|
1636
|
-
"kind": "struct",
|
|
1637
|
-
"members": [
|
|
1638
|
-
{
|
|
1639
|
-
"name": "role",
|
|
1640
|
-
"type": "core::felt252",
|
|
1641
|
-
"kind": "data"
|
|
1642
|
-
},
|
|
1643
|
-
{
|
|
1644
|
-
"name": "previous_admin_role",
|
|
1645
|
-
"type": "core::felt252",
|
|
1646
|
-
"kind": "data"
|
|
1647
|
-
},
|
|
1648
|
-
{
|
|
1649
|
-
"name": "new_admin_role",
|
|
1650
|
-
"type": "core::felt252",
|
|
1651
|
-
"kind": "data"
|
|
1395
|
+
"kind": "key"
|
|
1652
1396
|
}
|
|
1653
1397
|
]
|
|
1654
1398
|
},
|
|
1655
1399
|
{
|
|
1656
1400
|
"type": "event",
|
|
1657
|
-
"name": "
|
|
1401
|
+
"name": "openzeppelin_utils::cryptography::nonces::NoncesComponent::Event",
|
|
1658
1402
|
"kind": "enum",
|
|
1659
|
-
"variants": [
|
|
1660
|
-
{
|
|
1661
|
-
"name": "RoleGranted",
|
|
1662
|
-
"type": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleGranted",
|
|
1663
|
-
"kind": "nested"
|
|
1664
|
-
},
|
|
1665
|
-
{
|
|
1666
|
-
"name": "RoleGrantedWithDelay",
|
|
1667
|
-
"type": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleGrantedWithDelay",
|
|
1668
|
-
"kind": "nested"
|
|
1669
|
-
},
|
|
1670
|
-
{
|
|
1671
|
-
"name": "RoleRevoked",
|
|
1672
|
-
"type": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleRevoked",
|
|
1673
|
-
"kind": "nested"
|
|
1674
|
-
},
|
|
1675
|
-
{
|
|
1676
|
-
"name": "RoleAdminChanged",
|
|
1677
|
-
"type": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::RoleAdminChanged",
|
|
1678
|
-
"kind": "nested"
|
|
1679
|
-
}
|
|
1680
|
-
]
|
|
1403
|
+
"variants": []
|
|
1681
1404
|
},
|
|
1682
1405
|
{
|
|
1683
1406
|
"type": "event",
|
|
1684
|
-
"name": "medialane_erc1155::core::medialane::
|
|
1407
|
+
"name": "medialane_erc1155::core::medialane::Medialane1155V2::Event",
|
|
1685
1408
|
"kind": "enum",
|
|
1686
1409
|
"variants": [
|
|
1687
1410
|
{
|
|
@@ -1703,21 +1426,6 @@ var Medialane1155ABI = [
|
|
|
1703
1426
|
"name": "NoncesEvent",
|
|
1704
1427
|
"type": "openzeppelin_utils::cryptography::nonces::NoncesComponent::Event",
|
|
1705
1428
|
"kind": "flat"
|
|
1706
|
-
},
|
|
1707
|
-
{
|
|
1708
|
-
"name": "UpgradeableEvent",
|
|
1709
|
-
"type": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
|
|
1710
|
-
"kind": "flat"
|
|
1711
|
-
},
|
|
1712
|
-
{
|
|
1713
|
-
"name": "SRC5Event",
|
|
1714
|
-
"type": "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
1715
|
-
"kind": "flat"
|
|
1716
|
-
},
|
|
1717
|
-
{
|
|
1718
|
-
"name": "AccessControlEvent",
|
|
1719
|
-
"type": "openzeppelin_access::accesscontrol::accesscontrol::AccessControlComponent::Event",
|
|
1720
|
-
"kind": "flat"
|
|
1721
1429
|
}
|
|
1722
1430
|
]
|
|
1723
1431
|
}
|
|
@@ -2367,8 +2075,8 @@ var STARKNET_DOMAIN = [
|
|
|
2367
2075
|
];
|
|
2368
2076
|
function domain1155(chainId) {
|
|
2369
2077
|
return {
|
|
2370
|
-
name: "
|
|
2371
|
-
version: "
|
|
2078
|
+
name: "Medialane",
|
|
2079
|
+
version: "2",
|
|
2372
2080
|
chainId,
|
|
2373
2081
|
revision: starknet.TypedDataRevision.ACTIVE
|
|
2374
2082
|
};
|
|
@@ -2379,13 +2087,25 @@ function build1155OrderTypedData(message, chainId) {
|
|
|
2379
2087
|
primaryType: "OrderParameters",
|
|
2380
2088
|
types: {
|
|
2381
2089
|
StarknetDomain: STARKNET_DOMAIN,
|
|
2090
|
+
OfferItem: [
|
|
2091
|
+
{ name: "item_type", type: "shortstring" },
|
|
2092
|
+
{ name: "token", type: "ContractAddress" },
|
|
2093
|
+
{ name: "identifier_or_criteria", type: "felt" },
|
|
2094
|
+
{ name: "start_amount", type: "felt" },
|
|
2095
|
+
{ name: "end_amount", type: "felt" }
|
|
2096
|
+
],
|
|
2097
|
+
ConsiderationItem: [
|
|
2098
|
+
{ name: "item_type", type: "shortstring" },
|
|
2099
|
+
{ name: "token", type: "ContractAddress" },
|
|
2100
|
+
{ name: "identifier_or_criteria", type: "felt" },
|
|
2101
|
+
{ name: "start_amount", type: "felt" },
|
|
2102
|
+
{ name: "end_amount", type: "felt" },
|
|
2103
|
+
{ name: "recipient", type: "ContractAddress" }
|
|
2104
|
+
],
|
|
2382
2105
|
OrderParameters: [
|
|
2383
2106
|
{ name: "offerer", type: "ContractAddress" },
|
|
2384
|
-
{ name: "
|
|
2385
|
-
{ name: "
|
|
2386
|
-
{ name: "amount", type: "felt" },
|
|
2387
|
-
{ name: "payment_token", type: "ContractAddress" },
|
|
2388
|
-
{ name: "price_per_unit", type: "felt" },
|
|
2107
|
+
{ name: "offer", type: "OfferItem" },
|
|
2108
|
+
{ name: "consideration", type: "ConsiderationItem" },
|
|
2389
2109
|
{ name: "start_time", type: "felt" },
|
|
2390
2110
|
{ name: "end_time", type: "felt" },
|
|
2391
2111
|
{ name: "salt", type: "felt" },
|
|
@@ -2486,11 +2206,21 @@ async function createListing1155(account, params, config) {
|
|
|
2486
2206
|
const chainId = getChainId2();
|
|
2487
2207
|
const orderParams = {
|
|
2488
2208
|
offerer: account.address,
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2209
|
+
offer: {
|
|
2210
|
+
item_type: "ERC1155",
|
|
2211
|
+
token: nftContract,
|
|
2212
|
+
identifier_or_criteria: tokenId,
|
|
2213
|
+
start_amount: amount,
|
|
2214
|
+
end_amount: amount
|
|
2215
|
+
},
|
|
2216
|
+
consideration: {
|
|
2217
|
+
item_type: "ERC20",
|
|
2218
|
+
token: token.address,
|
|
2219
|
+
identifier_or_criteria: "0",
|
|
2220
|
+
start_amount: priceWei,
|
|
2221
|
+
end_amount: priceWei,
|
|
2222
|
+
recipient: account.address
|
|
2223
|
+
},
|
|
2494
2224
|
start_time: now.toString(),
|
|
2495
2225
|
end_time: endTime.toString(),
|
|
2496
2226
|
salt,
|
|
@@ -3374,8 +3104,8 @@ var MedialaneClient = class {
|
|
|
3374
3104
|
// src/types/api.ts
|
|
3375
3105
|
var OPEN_LICENSES = ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
|
|
3376
3106
|
var ERC1155CollectionService = class {
|
|
3377
|
-
constructor(
|
|
3378
|
-
this.factoryAddress =
|
|
3107
|
+
constructor(config) {
|
|
3108
|
+
this.factoryAddress = config.collection1155Contract ?? COLLECTION_1155_CONTRACT_MAINNET;
|
|
3379
3109
|
}
|
|
3380
3110
|
_factory(account) {
|
|
3381
3111
|
return new starknet.Contract(
|
|
@@ -3482,6 +3212,9 @@ var ERC1155CollectionService = class {
|
|
|
3482
3212
|
};
|
|
3483
3213
|
|
|
3484
3214
|
exports.ApiClient = ApiClient;
|
|
3215
|
+
exports.COLLECTION_1155_CLASS_HASH_MAINNET = COLLECTION_1155_CLASS_HASH_MAINNET;
|
|
3216
|
+
exports.COLLECTION_1155_CONTRACT_MAINNET = COLLECTION_1155_CONTRACT_MAINNET;
|
|
3217
|
+
exports.COLLECTION_721_CONTRACT_MAINNET = COLLECTION_721_CONTRACT_MAINNET;
|
|
3485
3218
|
exports.COLLECTION_CONTRACT_MAINNET = COLLECTION_CONTRACT_MAINNET;
|
|
3486
3219
|
exports.CollectionRegistryABI = CollectionRegistryABI;
|
|
3487
3220
|
exports.DEFAULT_RPC_URL = DEFAULT_RPC_URL;
|
|
@@ -3493,17 +3226,26 @@ exports.DropService = DropService;
|
|
|
3493
3226
|
exports.ERC1155CollectionService = ERC1155CollectionService;
|
|
3494
3227
|
exports.ERC1155_COLLECTION_CLASS_HASH_MAINNET = ERC1155_COLLECTION_CLASS_HASH_MAINNET;
|
|
3495
3228
|
exports.ERC1155_FACTORY_CONTRACT_MAINNET = ERC1155_FACTORY_CONTRACT_MAINNET;
|
|
3229
|
+
exports.INDEXER_START_BLOCK_MAINNET = INDEXER_START_BLOCK_MAINNET;
|
|
3496
3230
|
exports.IPCollection1155ABI = IPCollection1155ABI;
|
|
3497
3231
|
exports.IPCollection1155FactoryABI = IPCollection1155FactoryABI;
|
|
3498
3232
|
exports.IPMarketplaceABI = IPMarketplaceABI;
|
|
3233
|
+
exports.MARKETPLACE_1155_CLASS_HASH_MAINNET = MARKETPLACE_1155_CLASS_HASH_MAINNET;
|
|
3499
3234
|
exports.MARKETPLACE_1155_CONTRACT_MAINNET = MARKETPLACE_1155_CONTRACT_MAINNET;
|
|
3235
|
+
exports.MARKETPLACE_1155_START_BLOCK_MAINNET = MARKETPLACE_1155_START_BLOCK_MAINNET;
|
|
3236
|
+
exports.MARKETPLACE_721_CLASS_HASH_MAINNET = MARKETPLACE_721_CLASS_HASH_MAINNET;
|
|
3237
|
+
exports.MARKETPLACE_721_CONTRACT_MAINNET = MARKETPLACE_721_CONTRACT_MAINNET;
|
|
3238
|
+
exports.MARKETPLACE_721_START_BLOCK_MAINNET = MARKETPLACE_721_START_BLOCK_MAINNET;
|
|
3239
|
+
exports.MARKETPLACE_CLASS_HASH_MAINNET = MARKETPLACE_CLASS_HASH_MAINNET;
|
|
3500
3240
|
exports.MARKETPLACE_CONTRACT_MAINNET = MARKETPLACE_CONTRACT_MAINNET;
|
|
3241
|
+
exports.MARKETPLACE_START_BLOCK_MAINNET = MARKETPLACE_START_BLOCK_MAINNET;
|
|
3501
3242
|
exports.MarketplaceModule = MarketplaceModule;
|
|
3502
3243
|
exports.Medialane1155ABI = Medialane1155ABI;
|
|
3503
3244
|
exports.Medialane1155Module = Medialane1155Module;
|
|
3504
3245
|
exports.MedialaneApiError = MedialaneApiError;
|
|
3505
3246
|
exports.MedialaneClient = MedialaneClient;
|
|
3506
3247
|
exports.MedialaneError = MedialaneError;
|
|
3248
|
+
exports.NFTCOMMENTS_CONTRACT_MAINNET = NFTCOMMENTS_CONTRACT_MAINNET;
|
|
3507
3249
|
exports.OPEN_LICENSES = OPEN_LICENSES;
|
|
3508
3250
|
exports.POPCollectionABI = POPCollectionABI;
|
|
3509
3251
|
exports.POPFactoryABI = POPFactoryABI;
|