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