@medialane/sdk 0.156.0 → 0.157.0
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/dist/{chunk-ZFRHADHR.cjs → chunk-3IJQNNFE.cjs} +2 -2
- package/dist/{chunk-ZFRHADHR.cjs.map → chunk-3IJQNNFE.cjs.map} +1 -1
- package/dist/{chunk-ASDN46XU.js → chunk-SEBUPNF4.js} +2 -2
- package/dist/{chunk-ASDN46XU.js.map → chunk-SEBUPNF4.js.map} +1 -1
- package/dist/{errors-BKaHnCOI.d.ts → errors-D037rFnb.d.ts} +0 -2
- package/dist/{errors-CAKnNI3N.d.cts → errors-D_k2He89.d.cts} +0 -2
- package/dist/index.cjs +65 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +282 -306
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +168 -193
- package/dist/starknet/index.d.ts +168 -193
- package/dist/starknet/index.js +222 -246
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/starknet/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3IJQNNFE_cjs = require('../chunk-3IJQNNFE.cjs');
|
|
4
4
|
var chunkOUPVVMLK_cjs = require('../chunk-OUPVVMLK.cjs');
|
|
5
5
|
var starknet = require('starknet');
|
|
6
6
|
var hkdf_js = require('@noble/hashes/hkdf.js');
|
|
@@ -33,7 +33,7 @@ function getChainId(config) {
|
|
|
33
33
|
return starknet.constants.StarknetChainId.SN_MAIN;
|
|
34
34
|
}
|
|
35
35
|
function resolveToken(currency) {
|
|
36
|
-
const token =
|
|
36
|
+
const token = chunk3IJQNNFE_cjs.SUPPORTED_TOKENS.find(
|
|
37
37
|
(t) => t.symbol === currency.toUpperCase() || t.address.toLowerCase() === currency.toLowerCase()
|
|
38
38
|
);
|
|
39
39
|
if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
|
|
@@ -44,7 +44,7 @@ function getProvider(config) {
|
|
|
44
44
|
let p = _providerCache.get(config);
|
|
45
45
|
if (!p) {
|
|
46
46
|
const urls = [config.rpcUrl];
|
|
47
|
-
p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch:
|
|
47
|
+
p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: chunk3IJQNNFE_cjs.createFailoverFetch(urls) });
|
|
48
48
|
_providerCache.set(config, p);
|
|
49
49
|
}
|
|
50
50
|
return p;
|
|
@@ -8249,8 +8249,8 @@ var IPSponsorshipABI = [
|
|
|
8249
8249
|
var IPGenesisABI = [
|
|
8250
8250
|
{
|
|
8251
8251
|
"type": "impl",
|
|
8252
|
-
"name": "
|
|
8253
|
-
"interface_name": "
|
|
8252
|
+
"name": "ERC721MetadataImpl",
|
|
8253
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721Metadata"
|
|
8254
8254
|
},
|
|
8255
8255
|
{
|
|
8256
8256
|
"type": "struct",
|
|
@@ -8266,7 +8266,7 @@ var IPGenesisABI = [
|
|
|
8266
8266
|
},
|
|
8267
8267
|
{
|
|
8268
8268
|
"name": "pending_word_len",
|
|
8269
|
-
"type": "core::
|
|
8269
|
+
"type": "core::integer::u32"
|
|
8270
8270
|
}
|
|
8271
8271
|
]
|
|
8272
8272
|
},
|
|
@@ -8286,70 +8286,195 @@ var IPGenesisABI = [
|
|
|
8286
8286
|
},
|
|
8287
8287
|
{
|
|
8288
8288
|
"type": "interface",
|
|
8289
|
-
"name": "
|
|
8289
|
+
"name": "openzeppelin_token::erc721::interface::IERC721Metadata",
|
|
8290
8290
|
"items": [
|
|
8291
8291
|
{
|
|
8292
8292
|
"type": "function",
|
|
8293
|
-
"name": "
|
|
8294
|
-
"inputs": [
|
|
8293
|
+
"name": "name",
|
|
8294
|
+
"inputs": [],
|
|
8295
|
+
"outputs": [
|
|
8295
8296
|
{
|
|
8296
|
-
"
|
|
8297
|
-
|
|
8298
|
-
|
|
8297
|
+
"type": "core::byte_array::ByteArray"
|
|
8298
|
+
}
|
|
8299
|
+
],
|
|
8300
|
+
"state_mutability": "view"
|
|
8301
|
+
},
|
|
8302
|
+
{
|
|
8303
|
+
"type": "function",
|
|
8304
|
+
"name": "symbol",
|
|
8305
|
+
"inputs": [],
|
|
8306
|
+
"outputs": [
|
|
8299
8307
|
{
|
|
8300
|
-
"name": "uri",
|
|
8301
8308
|
"type": "core::byte_array::ByteArray"
|
|
8302
8309
|
}
|
|
8303
8310
|
],
|
|
8311
|
+
"state_mutability": "view"
|
|
8312
|
+
},
|
|
8313
|
+
{
|
|
8314
|
+
"type": "function",
|
|
8315
|
+
"name": "token_uri",
|
|
8316
|
+
"inputs": [
|
|
8317
|
+
{
|
|
8318
|
+
"name": "token_id",
|
|
8319
|
+
"type": "core::integer::u256"
|
|
8320
|
+
}
|
|
8321
|
+
],
|
|
8304
8322
|
"outputs": [
|
|
8305
8323
|
{
|
|
8324
|
+
"type": "core::byte_array::ByteArray"
|
|
8325
|
+
}
|
|
8326
|
+
],
|
|
8327
|
+
"state_mutability": "view"
|
|
8328
|
+
}
|
|
8329
|
+
]
|
|
8330
|
+
},
|
|
8331
|
+
{
|
|
8332
|
+
"type": "impl",
|
|
8333
|
+
"name": "ERC721MetadataCamelOnlyImpl",
|
|
8334
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly"
|
|
8335
|
+
},
|
|
8336
|
+
{
|
|
8337
|
+
"type": "interface",
|
|
8338
|
+
"name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly",
|
|
8339
|
+
"items": [
|
|
8340
|
+
{
|
|
8341
|
+
"type": "function",
|
|
8342
|
+
"name": "tokenURI",
|
|
8343
|
+
"inputs": [
|
|
8344
|
+
{
|
|
8345
|
+
"name": "tokenId",
|
|
8306
8346
|
"type": "core::integer::u256"
|
|
8307
8347
|
}
|
|
8308
8348
|
],
|
|
8309
|
-
"
|
|
8349
|
+
"outputs": [
|
|
8350
|
+
{
|
|
8351
|
+
"type": "core::byte_array::ByteArray"
|
|
8352
|
+
}
|
|
8353
|
+
],
|
|
8354
|
+
"state_mutability": "view"
|
|
8310
8355
|
}
|
|
8311
8356
|
]
|
|
8312
8357
|
},
|
|
8313
8358
|
{
|
|
8314
8359
|
"type": "impl",
|
|
8315
|
-
"name": "
|
|
8316
|
-
"interface_name": "
|
|
8360
|
+
"name": "IPCollectionImpl",
|
|
8361
|
+
"interface_name": "ip_programmable_erc_721::interfaces::IIPCollection::IIPCollection"
|
|
8362
|
+
},
|
|
8363
|
+
{
|
|
8364
|
+
"type": "struct",
|
|
8365
|
+
"name": "ip_programmable_erc_721::types::TokenData",
|
|
8366
|
+
"members": [
|
|
8367
|
+
{
|
|
8368
|
+
"name": "token_id",
|
|
8369
|
+
"type": "core::integer::u256"
|
|
8370
|
+
},
|
|
8371
|
+
{
|
|
8372
|
+
"name": "owner",
|
|
8373
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8374
|
+
},
|
|
8375
|
+
{
|
|
8376
|
+
"name": "metadata_uri",
|
|
8377
|
+
"type": "core::byte_array::ByteArray"
|
|
8378
|
+
},
|
|
8379
|
+
{
|
|
8380
|
+
"name": "original_creator",
|
|
8381
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8382
|
+
},
|
|
8383
|
+
{
|
|
8384
|
+
"name": "registered_at",
|
|
8385
|
+
"type": "core::integer::u64"
|
|
8386
|
+
}
|
|
8387
|
+
]
|
|
8317
8388
|
},
|
|
8318
8389
|
{
|
|
8319
8390
|
"type": "interface",
|
|
8320
|
-
"name": "
|
|
8391
|
+
"name": "ip_programmable_erc_721::interfaces::IIPCollection::IIPCollection",
|
|
8321
8392
|
"items": [
|
|
8322
8393
|
{
|
|
8323
8394
|
"type": "function",
|
|
8324
|
-
"name": "
|
|
8395
|
+
"name": "mint_item",
|
|
8396
|
+
"inputs": [
|
|
8397
|
+
{
|
|
8398
|
+
"name": "recipient",
|
|
8399
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8400
|
+
},
|
|
8401
|
+
{
|
|
8402
|
+
"name": "token_uri",
|
|
8403
|
+
"type": "core::byte_array::ByteArray"
|
|
8404
|
+
}
|
|
8405
|
+
],
|
|
8406
|
+
"outputs": [
|
|
8407
|
+
{
|
|
8408
|
+
"type": "core::integer::u256"
|
|
8409
|
+
}
|
|
8410
|
+
],
|
|
8411
|
+
"state_mutability": "external"
|
|
8412
|
+
},
|
|
8413
|
+
{
|
|
8414
|
+
"type": "function",
|
|
8415
|
+
"name": "get_collection_creator",
|
|
8325
8416
|
"inputs": [],
|
|
8326
8417
|
"outputs": [
|
|
8327
8418
|
{
|
|
8419
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8420
|
+
}
|
|
8421
|
+
],
|
|
8422
|
+
"state_mutability": "view"
|
|
8423
|
+
},
|
|
8424
|
+
{
|
|
8425
|
+
"type": "function",
|
|
8426
|
+
"name": "get_token_creator",
|
|
8427
|
+
"inputs": [
|
|
8428
|
+
{
|
|
8429
|
+
"name": "token_id",
|
|
8328
8430
|
"type": "core::integer::u256"
|
|
8329
8431
|
}
|
|
8330
8432
|
],
|
|
8433
|
+
"outputs": [
|
|
8434
|
+
{
|
|
8435
|
+
"type": "core::starknet::contract_address::ContractAddress"
|
|
8436
|
+
}
|
|
8437
|
+
],
|
|
8331
8438
|
"state_mutability": "view"
|
|
8332
8439
|
},
|
|
8333
8440
|
{
|
|
8334
8441
|
"type": "function",
|
|
8335
|
-
"name": "
|
|
8336
|
-
"inputs": [
|
|
8337
|
-
|
|
8338
|
-
|
|
8442
|
+
"name": "get_token_registered_at",
|
|
8443
|
+
"inputs": [
|
|
8444
|
+
{
|
|
8445
|
+
"name": "token_id",
|
|
8446
|
+
"type": "core::integer::u256"
|
|
8447
|
+
}
|
|
8448
|
+
],
|
|
8449
|
+
"outputs": [
|
|
8450
|
+
{
|
|
8451
|
+
"type": "core::integer::u64"
|
|
8452
|
+
}
|
|
8453
|
+
],
|
|
8454
|
+
"state_mutability": "view"
|
|
8339
8455
|
},
|
|
8340
8456
|
{
|
|
8341
8457
|
"type": "function",
|
|
8342
|
-
"name": "
|
|
8343
|
-
"inputs": [
|
|
8344
|
-
|
|
8345
|
-
|
|
8458
|
+
"name": "get_token_data",
|
|
8459
|
+
"inputs": [
|
|
8460
|
+
{
|
|
8461
|
+
"name": "token_id",
|
|
8462
|
+
"type": "core::integer::u256"
|
|
8463
|
+
}
|
|
8464
|
+
],
|
|
8465
|
+
"outputs": [
|
|
8466
|
+
{
|
|
8467
|
+
"type": "ip_programmable_erc_721::types::TokenData"
|
|
8468
|
+
}
|
|
8469
|
+
],
|
|
8470
|
+
"state_mutability": "view"
|
|
8346
8471
|
}
|
|
8347
8472
|
]
|
|
8348
8473
|
},
|
|
8349
8474
|
{
|
|
8350
8475
|
"type": "impl",
|
|
8351
|
-
"name": "
|
|
8352
|
-
"interface_name": "openzeppelin_token::erc721::interface::
|
|
8476
|
+
"name": "ERC721Impl",
|
|
8477
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721"
|
|
8353
8478
|
},
|
|
8354
8479
|
{
|
|
8355
8480
|
"type": "struct",
|
|
@@ -8377,7 +8502,7 @@ var IPGenesisABI = [
|
|
|
8377
8502
|
},
|
|
8378
8503
|
{
|
|
8379
8504
|
"type": "interface",
|
|
8380
|
-
"name": "openzeppelin_token::erc721::interface::
|
|
8505
|
+
"name": "openzeppelin_token::erc721::interface::IERC721",
|
|
8381
8506
|
"items": [
|
|
8382
8507
|
{
|
|
8383
8508
|
"type": "function",
|
|
@@ -8522,61 +8647,18 @@ var IPGenesisABI = [
|
|
|
8522
8647
|
}
|
|
8523
8648
|
],
|
|
8524
8649
|
"state_mutability": "view"
|
|
8525
|
-
}
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
"type": "core::bool"
|
|
8538
|
-
}
|
|
8539
|
-
],
|
|
8540
|
-
"state_mutability": "view"
|
|
8541
|
-
},
|
|
8542
|
-
{
|
|
8543
|
-
"type": "function",
|
|
8544
|
-
"name": "name",
|
|
8545
|
-
"inputs": [],
|
|
8546
|
-
"outputs": [
|
|
8547
|
-
{
|
|
8548
|
-
"type": "core::byte_array::ByteArray"
|
|
8549
|
-
}
|
|
8550
|
-
],
|
|
8551
|
-
"state_mutability": "view"
|
|
8552
|
-
},
|
|
8553
|
-
{
|
|
8554
|
-
"type": "function",
|
|
8555
|
-
"name": "symbol",
|
|
8556
|
-
"inputs": [],
|
|
8557
|
-
"outputs": [
|
|
8558
|
-
{
|
|
8559
|
-
"type": "core::byte_array::ByteArray"
|
|
8560
|
-
}
|
|
8561
|
-
],
|
|
8562
|
-
"state_mutability": "view"
|
|
8563
|
-
},
|
|
8564
|
-
{
|
|
8565
|
-
"type": "function",
|
|
8566
|
-
"name": "token_uri",
|
|
8567
|
-
"inputs": [
|
|
8568
|
-
{
|
|
8569
|
-
"name": "token_id",
|
|
8570
|
-
"type": "core::integer::u256"
|
|
8571
|
-
}
|
|
8572
|
-
],
|
|
8573
|
-
"outputs": [
|
|
8574
|
-
{
|
|
8575
|
-
"type": "core::byte_array::ByteArray"
|
|
8576
|
-
}
|
|
8577
|
-
],
|
|
8578
|
-
"state_mutability": "view"
|
|
8579
|
-
},
|
|
8650
|
+
}
|
|
8651
|
+
]
|
|
8652
|
+
},
|
|
8653
|
+
{
|
|
8654
|
+
"type": "impl",
|
|
8655
|
+
"name": "ERC721CamelOnly",
|
|
8656
|
+
"interface_name": "openzeppelin_token::erc721::interface::IERC721CamelOnly"
|
|
8657
|
+
},
|
|
8658
|
+
{
|
|
8659
|
+
"type": "interface",
|
|
8660
|
+
"name": "openzeppelin_token::erc721::interface::IERC721CamelOnly",
|
|
8661
|
+
"items": [
|
|
8580
8662
|
{
|
|
8581
8663
|
"type": "function",
|
|
8582
8664
|
"name": "balanceOf",
|
|
@@ -8704,82 +8786,6 @@ var IPGenesisABI = [
|
|
|
8704
8786
|
}
|
|
8705
8787
|
],
|
|
8706
8788
|
"state_mutability": "view"
|
|
8707
|
-
},
|
|
8708
|
-
{
|
|
8709
|
-
"type": "function",
|
|
8710
|
-
"name": "tokenURI",
|
|
8711
|
-
"inputs": [
|
|
8712
|
-
{
|
|
8713
|
-
"name": "tokenId",
|
|
8714
|
-
"type": "core::integer::u256"
|
|
8715
|
-
}
|
|
8716
|
-
],
|
|
8717
|
-
"outputs": [
|
|
8718
|
-
{
|
|
8719
|
-
"type": "core::byte_array::ByteArray"
|
|
8720
|
-
}
|
|
8721
|
-
],
|
|
8722
|
-
"state_mutability": "view"
|
|
8723
|
-
}
|
|
8724
|
-
]
|
|
8725
|
-
},
|
|
8726
|
-
{
|
|
8727
|
-
"type": "impl",
|
|
8728
|
-
"name": "OwnableMixinImpl",
|
|
8729
|
-
"interface_name": "openzeppelin_access::ownable::interface::OwnableABI"
|
|
8730
|
-
},
|
|
8731
|
-
{
|
|
8732
|
-
"type": "interface",
|
|
8733
|
-
"name": "openzeppelin_access::ownable::interface::OwnableABI",
|
|
8734
|
-
"items": [
|
|
8735
|
-
{
|
|
8736
|
-
"type": "function",
|
|
8737
|
-
"name": "owner",
|
|
8738
|
-
"inputs": [],
|
|
8739
|
-
"outputs": [
|
|
8740
|
-
{
|
|
8741
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
8742
|
-
}
|
|
8743
|
-
],
|
|
8744
|
-
"state_mutability": "view"
|
|
8745
|
-
},
|
|
8746
|
-
{
|
|
8747
|
-
"type": "function",
|
|
8748
|
-
"name": "transfer_ownership",
|
|
8749
|
-
"inputs": [
|
|
8750
|
-
{
|
|
8751
|
-
"name": "new_owner",
|
|
8752
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
8753
|
-
}
|
|
8754
|
-
],
|
|
8755
|
-
"outputs": [],
|
|
8756
|
-
"state_mutability": "external"
|
|
8757
|
-
},
|
|
8758
|
-
{
|
|
8759
|
-
"type": "function",
|
|
8760
|
-
"name": "renounce_ownership",
|
|
8761
|
-
"inputs": [],
|
|
8762
|
-
"outputs": [],
|
|
8763
|
-
"state_mutability": "external"
|
|
8764
|
-
},
|
|
8765
|
-
{
|
|
8766
|
-
"type": "function",
|
|
8767
|
-
"name": "transferOwnership",
|
|
8768
|
-
"inputs": [
|
|
8769
|
-
{
|
|
8770
|
-
"name": "newOwner",
|
|
8771
|
-
"type": "core::starknet::contract_address::ContractAddress"
|
|
8772
|
-
}
|
|
8773
|
-
],
|
|
8774
|
-
"outputs": [],
|
|
8775
|
-
"state_mutability": "external"
|
|
8776
|
-
},
|
|
8777
|
-
{
|
|
8778
|
-
"type": "function",
|
|
8779
|
-
"name": "renounceOwnership",
|
|
8780
|
-
"inputs": [],
|
|
8781
|
-
"outputs": [],
|
|
8782
|
-
"state_mutability": "external"
|
|
8783
8789
|
}
|
|
8784
8790
|
]
|
|
8785
8791
|
},
|
|
@@ -8841,10 +8847,45 @@ var IPGenesisABI = [
|
|
|
8841
8847
|
}
|
|
8842
8848
|
]
|
|
8843
8849
|
},
|
|
8850
|
+
{
|
|
8851
|
+
"type": "impl",
|
|
8852
|
+
"name": "SRC5Impl",
|
|
8853
|
+
"interface_name": "openzeppelin_introspection::interface::ISRC5"
|
|
8854
|
+
},
|
|
8855
|
+
{
|
|
8856
|
+
"type": "interface",
|
|
8857
|
+
"name": "openzeppelin_introspection::interface::ISRC5",
|
|
8858
|
+
"items": [
|
|
8859
|
+
{
|
|
8860
|
+
"type": "function",
|
|
8861
|
+
"name": "supports_interface",
|
|
8862
|
+
"inputs": [
|
|
8863
|
+
{
|
|
8864
|
+
"name": "interface_id",
|
|
8865
|
+
"type": "core::felt252"
|
|
8866
|
+
}
|
|
8867
|
+
],
|
|
8868
|
+
"outputs": [
|
|
8869
|
+
{
|
|
8870
|
+
"type": "core::bool"
|
|
8871
|
+
}
|
|
8872
|
+
],
|
|
8873
|
+
"state_mutability": "view"
|
|
8874
|
+
}
|
|
8875
|
+
]
|
|
8876
|
+
},
|
|
8844
8877
|
{
|
|
8845
8878
|
"type": "constructor",
|
|
8846
8879
|
"name": "constructor",
|
|
8847
8880
|
"inputs": [
|
|
8881
|
+
{
|
|
8882
|
+
"name": "name",
|
|
8883
|
+
"type": "core::byte_array::ByteArray"
|
|
8884
|
+
},
|
|
8885
|
+
{
|
|
8886
|
+
"name": "symbol",
|
|
8887
|
+
"type": "core::byte_array::ByteArray"
|
|
8888
|
+
},
|
|
8848
8889
|
{
|
|
8849
8890
|
"name": "owner",
|
|
8850
8891
|
"type": "core::starknet::contract_address::ContractAddress"
|
|
@@ -8939,57 +8980,6 @@ var IPGenesisABI = [
|
|
|
8939
8980
|
}
|
|
8940
8981
|
]
|
|
8941
8982
|
},
|
|
8942
|
-
{
|
|
8943
|
-
"type": "event",
|
|
8944
|
-
"name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
|
|
8945
|
-
"kind": "struct",
|
|
8946
|
-
"members": [
|
|
8947
|
-
{
|
|
8948
|
-
"name": "previous_owner",
|
|
8949
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
8950
|
-
"kind": "key"
|
|
8951
|
-
},
|
|
8952
|
-
{
|
|
8953
|
-
"name": "new_owner",
|
|
8954
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
8955
|
-
"kind": "key"
|
|
8956
|
-
}
|
|
8957
|
-
]
|
|
8958
|
-
},
|
|
8959
|
-
{
|
|
8960
|
-
"type": "event",
|
|
8961
|
-
"name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
|
|
8962
|
-
"kind": "struct",
|
|
8963
|
-
"members": [
|
|
8964
|
-
{
|
|
8965
|
-
"name": "previous_owner",
|
|
8966
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
8967
|
-
"kind": "key"
|
|
8968
|
-
},
|
|
8969
|
-
{
|
|
8970
|
-
"name": "new_owner",
|
|
8971
|
-
"type": "core::starknet::contract_address::ContractAddress",
|
|
8972
|
-
"kind": "key"
|
|
8973
|
-
}
|
|
8974
|
-
]
|
|
8975
|
-
},
|
|
8976
|
-
{
|
|
8977
|
-
"type": "event",
|
|
8978
|
-
"name": "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
|
|
8979
|
-
"kind": "enum",
|
|
8980
|
-
"variants": [
|
|
8981
|
-
{
|
|
8982
|
-
"name": "OwnershipTransferred",
|
|
8983
|
-
"type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
|
|
8984
|
-
"kind": "nested"
|
|
8985
|
-
},
|
|
8986
|
-
{
|
|
8987
|
-
"name": "OwnershipTransferStarted",
|
|
8988
|
-
"type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
|
|
8989
|
-
"kind": "nested"
|
|
8990
|
-
}
|
|
8991
|
-
]
|
|
8992
|
-
},
|
|
8993
8983
|
{
|
|
8994
8984
|
"type": "event",
|
|
8995
8985
|
"name": "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
@@ -9004,48 +8994,39 @@ var IPGenesisABI = [
|
|
|
9004
8994
|
},
|
|
9005
8995
|
{
|
|
9006
8996
|
"type": "event",
|
|
9007
|
-
"name": "
|
|
8997
|
+
"name": "ip_programmable_erc_721::IPCollection::IPCollection::IPMinted",
|
|
9008
8998
|
"kind": "struct",
|
|
9009
8999
|
"members": [
|
|
9010
9000
|
{
|
|
9011
|
-
"name": "
|
|
9001
|
+
"name": "token_id",
|
|
9012
9002
|
"type": "core::integer::u256",
|
|
9013
|
-
"kind": "
|
|
9014
|
-
}
|
|
9015
|
-
]
|
|
9016
|
-
},
|
|
9017
|
-
{
|
|
9018
|
-
"type": "event",
|
|
9019
|
-
"name": "mip::mip::MIP::CounterComponent::CounterDecremented",
|
|
9020
|
-
"kind": "struct",
|
|
9021
|
-
"members": [
|
|
9003
|
+
"kind": "key"
|
|
9004
|
+
},
|
|
9022
9005
|
{
|
|
9023
|
-
"name": "
|
|
9024
|
-
"type": "core::
|
|
9006
|
+
"name": "recipient",
|
|
9007
|
+
"type": "core::starknet::contract_address::ContractAddress",
|
|
9008
|
+
"kind": "key"
|
|
9009
|
+
},
|
|
9010
|
+
{
|
|
9011
|
+
"name": "uri",
|
|
9012
|
+
"type": "core::byte_array::ByteArray",
|
|
9025
9013
|
"kind": "data"
|
|
9026
|
-
}
|
|
9027
|
-
]
|
|
9028
|
-
},
|
|
9029
|
-
{
|
|
9030
|
-
"type": "event",
|
|
9031
|
-
"name": "mip::mip::MIP::CounterComponent::Event",
|
|
9032
|
-
"kind": "enum",
|
|
9033
|
-
"variants": [
|
|
9014
|
+
},
|
|
9034
9015
|
{
|
|
9035
|
-
"name": "
|
|
9036
|
-
"type": "
|
|
9037
|
-
"kind": "
|
|
9016
|
+
"name": "creator",
|
|
9017
|
+
"type": "core::starknet::contract_address::ContractAddress",
|
|
9018
|
+
"kind": "data"
|
|
9038
9019
|
},
|
|
9039
9020
|
{
|
|
9040
|
-
"name": "
|
|
9041
|
-
"type": "
|
|
9042
|
-
"kind": "
|
|
9021
|
+
"name": "registered_at",
|
|
9022
|
+
"type": "core::integer::u64",
|
|
9023
|
+
"kind": "data"
|
|
9043
9024
|
}
|
|
9044
9025
|
]
|
|
9045
9026
|
},
|
|
9046
9027
|
{
|
|
9047
9028
|
"type": "event",
|
|
9048
|
-
"name": "
|
|
9029
|
+
"name": "ip_programmable_erc_721::IPCollection::IPCollection::Event",
|
|
9049
9030
|
"kind": "enum",
|
|
9050
9031
|
"variants": [
|
|
9051
9032
|
{
|
|
@@ -9053,11 +9034,6 @@ var IPGenesisABI = [
|
|
|
9053
9034
|
"type": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
|
|
9054
9035
|
"kind": "flat"
|
|
9055
9036
|
},
|
|
9056
|
-
{
|
|
9057
|
-
"name": "OwnableEvent",
|
|
9058
|
-
"type": "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
|
|
9059
|
-
"kind": "flat"
|
|
9060
|
-
},
|
|
9061
9037
|
{
|
|
9062
9038
|
"name": "SRC5Event",
|
|
9063
9039
|
"type": "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
@@ -9069,9 +9045,9 @@ var IPGenesisABI = [
|
|
|
9069
9045
|
"kind": "flat"
|
|
9070
9046
|
},
|
|
9071
9047
|
{
|
|
9072
|
-
"name": "
|
|
9073
|
-
"type": "
|
|
9074
|
-
"kind": "
|
|
9048
|
+
"name": "IPMinted",
|
|
9049
|
+
"type": "ip_programmable_erc_721::IPCollection::IPCollection::IPMinted",
|
|
9050
|
+
"kind": "nested"
|
|
9075
9051
|
}
|
|
9076
9052
|
]
|
|
9077
9053
|
}
|
|
@@ -9083,7 +9059,7 @@ var PopService = class {
|
|
|
9083
9059
|
this.factoryAddress = chunkOUPVVMLK_cjs.getStarknetCoordinates(config.chain).popFactory;
|
|
9084
9060
|
}
|
|
9085
9061
|
_collection(address, account) {
|
|
9086
|
-
return newContract(POPCollectionABI,
|
|
9062
|
+
return newContract(POPCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9087
9063
|
}
|
|
9088
9064
|
async claim(account, collectionAddress) {
|
|
9089
9065
|
const call = this._collection(collectionAddress, account).populate("claim", []);
|
|
@@ -9174,7 +9150,7 @@ var DropService = class {
|
|
|
9174
9150
|
this.config = config;
|
|
9175
9151
|
}
|
|
9176
9152
|
_collection(address, account) {
|
|
9177
|
-
return newContract(DropCollectionABI,
|
|
9153
|
+
return newContract(DropCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9178
9154
|
}
|
|
9179
9155
|
async claim(account, collectionAddress, quantity = 1) {
|
|
9180
9156
|
const collection = this._collection(collectionAddress, account);
|
|
@@ -9259,14 +9235,14 @@ var ERC1155CollectionService = class {
|
|
|
9259
9235
|
_factory(account) {
|
|
9260
9236
|
return newContract(
|
|
9261
9237
|
IPCollection1155FactoryABI,
|
|
9262
|
-
|
|
9238
|
+
chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", this.factoryAddress),
|
|
9263
9239
|
account
|
|
9264
9240
|
);
|
|
9265
9241
|
}
|
|
9266
9242
|
_collection(address, account) {
|
|
9267
9243
|
return newContract(
|
|
9268
9244
|
IPCollection1155ABI,
|
|
9269
|
-
|
|
9245
|
+
chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address),
|
|
9270
9246
|
account
|
|
9271
9247
|
);
|
|
9272
9248
|
}
|
|
@@ -9494,20 +9470,20 @@ function buildLaunchOnEkuboCalls(params) {
|
|
|
9494
9470
|
}
|
|
9495
9471
|
var CREATOR_COIN_CREATED_SELECTOR = starknet.hash.getSelectorFromName("CreatorCoinCreated");
|
|
9496
9472
|
function parseCreatorCoinCreated(receipt) {
|
|
9497
|
-
const factory =
|
|
9473
|
+
const factory = chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", chunkOUPVVMLK_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
|
|
9498
9474
|
for (const ev of receipt?.events ?? []) {
|
|
9499
9475
|
let from;
|
|
9500
9476
|
try {
|
|
9501
|
-
from =
|
|
9477
|
+
from = chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
|
|
9502
9478
|
} catch {
|
|
9503
9479
|
continue;
|
|
9504
9480
|
}
|
|
9505
9481
|
if (from !== factory) continue;
|
|
9506
9482
|
const k0 = ev.keys?.[0];
|
|
9507
|
-
if (!k0 ||
|
|
9483
|
+
if (!k0 || chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", k0) !== chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
|
|
9508
9484
|
const data = ev.data ?? [];
|
|
9509
9485
|
if (data.length < 1) continue;
|
|
9510
|
-
return
|
|
9486
|
+
return chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
|
|
9511
9487
|
}
|
|
9512
9488
|
throw new Error("Coin deployed but the coin address could not be read from the receipt");
|
|
9513
9489
|
}
|
|
@@ -9543,14 +9519,14 @@ var TicketService = class {
|
|
|
9543
9519
|
_factory(account, factoryAddress) {
|
|
9544
9520
|
const address = factoryAddress ?? this.factoryAddress;
|
|
9545
9521
|
if (!address) throw new Error("IP-Tickets factory address not configured for this chain");
|
|
9546
|
-
return newContract(IPTicketCollectionFactoryABI,
|
|
9522
|
+
return newContract(IPTicketCollectionFactoryABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9547
9523
|
}
|
|
9548
9524
|
_collection(address, account) {
|
|
9549
|
-
return newContract(IPTicketCollectionABI,
|
|
9525
|
+
return newContract(IPTicketCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9550
9526
|
}
|
|
9551
9527
|
_collectionRead(address) {
|
|
9552
9528
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
9553
|
-
return newContract(IPTicketCollectionABI,
|
|
9529
|
+
return newContract(IPTicketCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), provider);
|
|
9554
9530
|
}
|
|
9555
9531
|
async deployCollection(account, params) {
|
|
9556
9532
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -9616,14 +9592,14 @@ var ClubService = class {
|
|
|
9616
9592
|
_factory(account, factoryAddress) {
|
|
9617
9593
|
const address = factoryAddress ?? this.factoryAddress;
|
|
9618
9594
|
if (!address) throw new Error("IP-Club factory address not configured for this chain");
|
|
9619
|
-
return newContract(IPClubFactoryABI,
|
|
9595
|
+
return newContract(IPClubFactoryABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9620
9596
|
}
|
|
9621
9597
|
_collection(address, account) {
|
|
9622
|
-
return newContract(IPClubCollectionABI,
|
|
9598
|
+
return newContract(IPClubCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), account);
|
|
9623
9599
|
}
|
|
9624
9600
|
_collectionRead(address) {
|
|
9625
9601
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
9626
|
-
return newContract(IPClubCollectionABI,
|
|
9602
|
+
return newContract(IPClubCollectionABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address), provider);
|
|
9627
9603
|
}
|
|
9628
9604
|
async deployCollection(account, params) {
|
|
9629
9605
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
@@ -9693,7 +9669,7 @@ var SponsorshipService = class {
|
|
|
9693
9669
|
if (!resolved) {
|
|
9694
9670
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
9695
9671
|
}
|
|
9696
|
-
return newContract(IPSponsorshipABI,
|
|
9672
|
+
return newContract(IPSponsorshipABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", resolved), account);
|
|
9697
9673
|
}
|
|
9698
9674
|
_contractRead(address) {
|
|
9699
9675
|
const resolved = address ?? this.sponsorshipAddress;
|
|
@@ -9701,7 +9677,7 @@ var SponsorshipService = class {
|
|
|
9701
9677
|
throw new Error("IP-Sponsorship address not configured for this chain");
|
|
9702
9678
|
}
|
|
9703
9679
|
const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
9704
|
-
return newContract(IPSponsorshipABI,
|
|
9680
|
+
return newContract(IPSponsorshipABI, chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", resolved), provider);
|
|
9705
9681
|
}
|
|
9706
9682
|
async createOffer(account, params) {
|
|
9707
9683
|
const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
@@ -9736,7 +9712,7 @@ var SponsorshipService = class {
|
|
|
9736
9712
|
const approveCall = {
|
|
9737
9713
|
contractAddress: params.paymentToken,
|
|
9738
9714
|
entrypoint: "approve",
|
|
9739
|
-
calldata: [
|
|
9715
|
+
calldata: [chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
|
|
9740
9716
|
};
|
|
9741
9717
|
const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
|
|
9742
9718
|
starknet.cairo.uint256(params.offerId),
|
|
@@ -9863,7 +9839,7 @@ var SponsorshipService = class {
|
|
|
9863
9839
|
// src/starknet/client.ts
|
|
9864
9840
|
var MedialaneClient = class {
|
|
9865
9841
|
constructor(rawConfig = {}) {
|
|
9866
|
-
this.config =
|
|
9842
|
+
this.config = chunk3IJQNNFE_cjs.resolveConfig(rawConfig);
|
|
9867
9843
|
this.services = {
|
|
9868
9844
|
pop: new PopService(this.config),
|
|
9869
9845
|
drop: new DropService(this.config),
|
|
@@ -9874,9 +9850,9 @@ var MedialaneClient = class {
|
|
|
9874
9850
|
sponsorship: new SponsorshipService(this.config)
|
|
9875
9851
|
};
|
|
9876
9852
|
if (!this.config.backendUrl) {
|
|
9877
|
-
const sentinel = new
|
|
9853
|
+
const sentinel = new chunk3IJQNNFE_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
|
|
9878
9854
|
const apiMethodNames = new Set(
|
|
9879
|
-
Object.getOwnPropertyNames(
|
|
9855
|
+
Object.getOwnPropertyNames(chunk3IJQNNFE_cjs.ApiClient.prototype).filter(
|
|
9880
9856
|
(k) => k !== "constructor" && typeof sentinel[k] === "function"
|
|
9881
9857
|
)
|
|
9882
9858
|
);
|
|
@@ -9893,7 +9869,7 @@ var MedialaneClient = class {
|
|
|
9893
9869
|
}
|
|
9894
9870
|
});
|
|
9895
9871
|
} else {
|
|
9896
|
-
this.api = new
|
|
9872
|
+
this.api = new chunk3IJQNNFE_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
|
|
9897
9873
|
}
|
|
9898
9874
|
}
|
|
9899
9875
|
get chain() {
|
|
@@ -10065,7 +10041,7 @@ function buildListingOrder(i, cfg) {
|
|
|
10065
10041
|
salt: i.salt,
|
|
10066
10042
|
counter: i.counter
|
|
10067
10043
|
};
|
|
10068
|
-
const typedData =
|
|
10044
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10069
10045
|
return { orderParams, typedData };
|
|
10070
10046
|
}
|
|
10071
10047
|
function buildOfferOrder(i, cfg) {
|
|
@@ -10086,11 +10062,11 @@ function buildOfferOrder(i, cfg) {
|
|
|
10086
10062
|
salt: i.salt,
|
|
10087
10063
|
counter: i.counter
|
|
10088
10064
|
};
|
|
10089
|
-
const typedData =
|
|
10065
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
|
|
10090
10066
|
return { orderParams, typedData };
|
|
10091
10067
|
}
|
|
10092
10068
|
function registerPayload(orderParams, signature) {
|
|
10093
|
-
return
|
|
10069
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10094
10070
|
parameters: {
|
|
10095
10071
|
...orderParams,
|
|
10096
10072
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -10121,14 +10097,14 @@ function buildFulfillCalls(a, cfg) {
|
|
|
10121
10097
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
10122
10098
|
}
|
|
10123
10099
|
function buildCancelCalls(a, cfg) {
|
|
10124
|
-
const cancelRequest =
|
|
10100
|
+
const cancelRequest = chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10125
10101
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
10126
10102
|
signature: a.signature
|
|
10127
10103
|
});
|
|
10128
10104
|
return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
|
|
10129
10105
|
}
|
|
10130
10106
|
function buildCancelTypedData(orderHash, offerer, cfg) {
|
|
10131
|
-
return
|
|
10107
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
|
|
10132
10108
|
}
|
|
10133
10109
|
function contractFor2(cfg) {
|
|
10134
10110
|
return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
|
|
@@ -10151,7 +10127,7 @@ function buildListing1155Order(i, cfg) {
|
|
|
10151
10127
|
salt: i.salt,
|
|
10152
10128
|
counter: i.counter
|
|
10153
10129
|
};
|
|
10154
|
-
const typedData =
|
|
10130
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(
|
|
10155
10131
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
10156
10132
|
);
|
|
10157
10133
|
return { orderParams, typedData };
|
|
@@ -10174,13 +10150,13 @@ function buildOffer1155Order(i, cfg) {
|
|
|
10174
10150
|
salt: i.salt,
|
|
10175
10151
|
counter: i.counter
|
|
10176
10152
|
};
|
|
10177
|
-
const typedData =
|
|
10153
|
+
const typedData = chunk3IJQNNFE_cjs.stringifyBigInts(
|
|
10178
10154
|
build1155OrderTypedData(orderParams, getChainId(cfg))
|
|
10179
10155
|
);
|
|
10180
10156
|
return { orderParams, typedData };
|
|
10181
10157
|
}
|
|
10182
10158
|
function registerPayload2(orderParams, signature) {
|
|
10183
|
-
return
|
|
10159
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10184
10160
|
parameters: {
|
|
10185
10161
|
...orderParams,
|
|
10186
10162
|
offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
|
|
@@ -10211,14 +10187,14 @@ function buildFulfill1155Calls(a, cfg) {
|
|
|
10211
10187
|
return fee ? [approve, fulfill, fee] : [approve, fulfill];
|
|
10212
10188
|
}
|
|
10213
10189
|
function buildCancel1155Calls(a, cfg) {
|
|
10214
|
-
const cancelPayload =
|
|
10190
|
+
const cancelPayload = chunk3IJQNNFE_cjs.stringifyBigInts({
|
|
10215
10191
|
cancelation: { order_hash: a.orderHash, offerer: a.offerer },
|
|
10216
10192
|
signature: a.signature
|
|
10217
10193
|
});
|
|
10218
10194
|
return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
|
|
10219
10195
|
}
|
|
10220
10196
|
function buildCancel1155TypedData(orderHash, offerer, cfg) {
|
|
10221
|
-
return
|
|
10197
|
+
return chunk3IJQNNFE_cjs.stringifyBigInts(
|
|
10222
10198
|
build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
|
|
10223
10199
|
);
|
|
10224
10200
|
}
|
|
@@ -10561,14 +10537,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
|
|
|
10561
10537
|
const receipt = await provider.getTransactionReceipt(txHash);
|
|
10562
10538
|
const status = receipt.execution_status ?? receipt.status;
|
|
10563
10539
|
if (status === "REVERTED" || status === "REJECTED") {
|
|
10564
|
-
throw new
|
|
10540
|
+
throw new chunk3IJQNNFE_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
|
|
10565
10541
|
}
|
|
10566
10542
|
if (status) return receipt;
|
|
10567
10543
|
} catch (err) {
|
|
10568
10544
|
if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
|
|
10569
10545
|
}
|
|
10570
10546
|
}
|
|
10571
|
-
throw new
|
|
10547
|
+
throw new chunk3IJQNNFE_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
|
|
10572
10548
|
}
|
|
10573
10549
|
async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
10574
10550
|
let calls;
|
|
@@ -10621,14 +10597,14 @@ function u2562(low, high) {
|
|
|
10621
10597
|
return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
|
|
10622
10598
|
}
|
|
10623
10599
|
function deployedCollectionFromReceipt(receipt, service) {
|
|
10624
|
-
const factory =
|
|
10600
|
+
const factory = chunk3IJQNNFE_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
|
|
10625
10601
|
const { event, address } = DEPLOY_EVENTS[service];
|
|
10626
10602
|
const selector = BigInt(starknet.hash.getSelectorFromName(event));
|
|
10627
10603
|
for (const e of receipt.events ?? []) {
|
|
10628
10604
|
if (factory && !sameFelt(e.from_address, factory)) continue;
|
|
10629
10605
|
if (!sameFelt(e.keys?.[0], selector)) continue;
|
|
10630
10606
|
const value = address(e);
|
|
10631
|
-
if (value) return
|
|
10607
|
+
if (value) return chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", value);
|
|
10632
10608
|
}
|
|
10633
10609
|
return null;
|
|
10634
10610
|
}
|
|
@@ -10749,13 +10725,13 @@ function buildRemoveOwnerByGuidCall(accountAddress, ownerGuid) {
|
|
|
10749
10725
|
}
|
|
10750
10726
|
function buildDeployAccountParams(ownerPubkey, salt = 0) {
|
|
10751
10727
|
return {
|
|
10752
|
-
classHash:
|
|
10753
|
-
constructorCalldata:
|
|
10728
|
+
classHash: chunk3IJQNNFE_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
|
|
10729
|
+
constructorCalldata: chunk3IJQNNFE_cjs.ownerConstructorCalldata(ownerPubkey),
|
|
10754
10730
|
addressSalt: starknet.num.toHex(salt),
|
|
10755
|
-
contractAddress:
|
|
10731
|
+
contractAddress: chunk3IJQNNFE_cjs.computeAccountAddress(ownerPubkey, salt)
|
|
10756
10732
|
};
|
|
10757
10733
|
}
|
|
10758
|
-
var norm = (address) =>
|
|
10734
|
+
var norm = (address) => chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address);
|
|
10759
10735
|
var SIGNER_TYPE_NAMES = ["Starknet", "Secp256k1", "Secp256r1"];
|
|
10760
10736
|
function encodeFeltArray(items) {
|
|
10761
10737
|
return [starknet.num.toHex(items.length), ...items];
|
|
@@ -10948,7 +10924,7 @@ var InvalidRecoveryKeyError = class extends Error {
|
|
|
10948
10924
|
var canonicalAddress = (address) => `0x${BigInt(address).toString(16).padStart(64, "0")}`;
|
|
10949
10925
|
function keyPair(privateKey) {
|
|
10950
10926
|
try {
|
|
10951
|
-
return
|
|
10927
|
+
return chunk3IJQNNFE_cjs.starkKeyPairFromPrivateKey(privateKey);
|
|
10952
10928
|
} catch {
|
|
10953
10929
|
throw new InvalidRecoveryKeyError();
|
|
10954
10930
|
}
|
|
@@ -10961,7 +10937,7 @@ function parseRecoveryKey(input) {
|
|
|
10961
10937
|
const trimmed = input.trim();
|
|
10962
10938
|
if (!trimmed.startsWith(PREFIX)) {
|
|
10963
10939
|
const { privateKeyHex, publicKeyHex } = keyPair(trimmed);
|
|
10964
|
-
return { walletAddress:
|
|
10940
|
+
return { walletAddress: chunk3IJQNNFE_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
|
|
10965
10941
|
}
|
|
10966
10942
|
const parts = trimmed.slice(PREFIX.length).split(":");
|
|
10967
10943
|
const [walletAddress, privateKey] = parts;
|
|
@@ -10983,7 +10959,7 @@ function describeRecoveryAction(escape) {
|
|
|
10983
10959
|
return "none";
|
|
10984
10960
|
}
|
|
10985
10961
|
function normalizeWalletAddress(address) {
|
|
10986
|
-
return
|
|
10962
|
+
return chunk3IJQNNFE_cjs.normalizeAddress("STARKNET", address);
|
|
10987
10963
|
}
|
|
10988
10964
|
function isValidStarknetAddress(address) {
|
|
10989
10965
|
try {
|
|
@@ -11028,7 +11004,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
|
|
|
11028
11004
|
return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
|
|
11029
11005
|
}
|
|
11030
11006
|
async function feeTokenBalance(provider, address, unit) {
|
|
11031
|
-
const token =
|
|
11007
|
+
const token = chunk3IJQNNFE_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
|
|
11032
11008
|
if (!token) throw new Error(`No fee token for unit ${unit}`);
|
|
11033
11009
|
const [low = "0x0", high = "0x0"] = await provider.callContract({
|
|
11034
11010
|
contractAddress: token.address,
|
|
@@ -11055,7 +11031,7 @@ function sponsoredExecutor(deps) {
|
|
|
11055
11031
|
{ proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
|
|
11056
11032
|
{
|
|
11057
11033
|
address: userAddress,
|
|
11058
|
-
signTypedData: async (data) =>
|
|
11034
|
+
signTypedData: async (data) => chunk3IJQNNFE_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
|
|
11059
11035
|
},
|
|
11060
11036
|
calls
|
|
11061
11037
|
);
|
|
@@ -11115,7 +11091,7 @@ async function deploySelfFunded(input) {
|
|
|
11115
11091
|
});
|
|
11116
11092
|
const { transaction_hash } = await account.deployAccount({
|
|
11117
11093
|
classHash,
|
|
11118
|
-
constructorCalldata:
|
|
11094
|
+
constructorCalldata: chunk3IJQNNFE_cjs.ownerConstructorCalldata(input.ownerPubKey),
|
|
11119
11095
|
addressSalt: 0,
|
|
11120
11096
|
contractAddress: input.ownerAddress
|
|
11121
11097
|
});
|
|
@@ -11178,7 +11154,7 @@ async function completeDeployment(deps, onStep, options = {}) {
|
|
|
11178
11154
|
backendUrl: deps.backendUrl,
|
|
11179
11155
|
walletAddress: address,
|
|
11180
11156
|
signer: {
|
|
11181
|
-
signMessage: async (td) =>
|
|
11157
|
+
signMessage: async (td) => chunk3IJQNNFE_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
|
|
11182
11158
|
}
|
|
11183
11159
|
});
|
|
11184
11160
|
deps.store.notifyChange();
|
|
@@ -11283,7 +11259,7 @@ function createMediaWallet(config) {
|
|
|
11283
11259
|
address: sealed.address,
|
|
11284
11260
|
signTypedData: async (data) => {
|
|
11285
11261
|
const privateKeyHex = await unlockOnce(sealed);
|
|
11286
|
-
return
|
|
11262
|
+
return chunk3IJQNNFE_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
|
|
11287
11263
|
},
|
|
11288
11264
|
execute: async (calls) => {
|
|
11289
11265
|
const { transactionHash } = await run(sealed, calls);
|
|
@@ -11355,51 +11331,51 @@ async function claimSessionWallet(api, walletAddress, deps) {
|
|
|
11355
11331
|
|
|
11356
11332
|
Object.defineProperty(exports, "InvalidStarkPrivateKeyError", {
|
|
11357
11333
|
enumerable: true,
|
|
11358
|
-
get: function () { return
|
|
11334
|
+
get: function () { return chunk3IJQNNFE_cjs.InvalidStarkPrivateKeyError; }
|
|
11359
11335
|
});
|
|
11360
11336
|
Object.defineProperty(exports, "PasskeyCancelledError", {
|
|
11361
11337
|
enumerable: true,
|
|
11362
|
-
get: function () { return
|
|
11338
|
+
get: function () { return chunk3IJQNNFE_cjs.PasskeyCancelledError; }
|
|
11363
11339
|
});
|
|
11364
11340
|
Object.defineProperty(exports, "UserFacingError", {
|
|
11365
11341
|
enumerable: true,
|
|
11366
|
-
get: function () { return
|
|
11342
|
+
get: function () { return chunk3IJQNNFE_cjs.UserFacingError; }
|
|
11367
11343
|
});
|
|
11368
11344
|
Object.defineProperty(exports, "computeAccountAddress", {
|
|
11369
11345
|
enumerable: true,
|
|
11370
|
-
get: function () { return
|
|
11346
|
+
get: function () { return chunk3IJQNNFE_cjs.computeAccountAddress; }
|
|
11371
11347
|
});
|
|
11372
11348
|
Object.defineProperty(exports, "createPasskeyOwner", {
|
|
11373
11349
|
enumerable: true,
|
|
11374
|
-
get: function () { return
|
|
11350
|
+
get: function () { return chunk3IJQNNFE_cjs.createPasskeyOwner; }
|
|
11375
11351
|
});
|
|
11376
11352
|
Object.defineProperty(exports, "deriveAesKey", {
|
|
11377
11353
|
enumerable: true,
|
|
11378
|
-
get: function () { return
|
|
11354
|
+
get: function () { return chunk3IJQNNFE_cjs.deriveAesKey; }
|
|
11379
11355
|
});
|
|
11380
11356
|
Object.defineProperty(exports, "generateStarkKeyPair", {
|
|
11381
11357
|
enumerable: true,
|
|
11382
|
-
get: function () { return
|
|
11358
|
+
get: function () { return chunk3IJQNNFE_cjs.generateStarkKeyPair; }
|
|
11383
11359
|
});
|
|
11384
11360
|
Object.defineProperty(exports, "ownerConstructorCalldata", {
|
|
11385
11361
|
enumerable: true,
|
|
11386
|
-
get: function () { return
|
|
11362
|
+
get: function () { return chunk3IJQNNFE_cjs.ownerConstructorCalldata; }
|
|
11387
11363
|
});
|
|
11388
11364
|
Object.defineProperty(exports, "sealPrivateKey", {
|
|
11389
11365
|
enumerable: true,
|
|
11390
|
-
get: function () { return
|
|
11366
|
+
get: function () { return chunk3IJQNNFE_cjs.sealPrivateKey; }
|
|
11391
11367
|
});
|
|
11392
11368
|
Object.defineProperty(exports, "signWithPrivateKey", {
|
|
11393
11369
|
enumerable: true,
|
|
11394
|
-
get: function () { return
|
|
11370
|
+
get: function () { return chunk3IJQNNFE_cjs.signWithPrivateKey; }
|
|
11395
11371
|
});
|
|
11396
11372
|
Object.defineProperty(exports, "starkKeyPairFromPrivateKey", {
|
|
11397
11373
|
enumerable: true,
|
|
11398
|
-
get: function () { return
|
|
11374
|
+
get: function () { return chunk3IJQNNFE_cjs.starkKeyPairFromPrivateKey; }
|
|
11399
11375
|
});
|
|
11400
11376
|
Object.defineProperty(exports, "unsealPrivateKey", {
|
|
11401
11377
|
enumerable: true,
|
|
11402
|
-
get: function () { return
|
|
11378
|
+
get: function () { return chunk3IJQNNFE_cjs.unsealPrivateKey; }
|
|
11403
11379
|
});
|
|
11404
11380
|
exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
|
|
11405
11381
|
exports.COIN_MIN_SUPPLY = MIN_SUPPLY;
|