@medialane/sdk 0.57.0 → 0.59.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/index.cjs CHANGED
@@ -43,6 +43,10 @@ var COORDINATES = {
43
43
  ipClubRegistry: "0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede",
44
44
  ipClubNftClassHash: "0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889",
45
45
  ipClubStartBlock: 11404776,
46
+ ipClubFactory: "0x010726346c264d1832a7303afaf5692dbd2b05446fecc6da30d958d0227c36d0",
47
+ ipClubFactoryClassHash: "0x07197062578375d962b2d42d3e91560770b11b1c97a9defb74c706a2c5299473",
48
+ ipClubCollectionClassHash: "0x049dc5e5ff00e67d5d457c6991ee70822f36a979b76cefd1b617aeccd7051d4b",
49
+ ipClubFactoryStartBlock: 11652766,
46
50
  ipSponsorship: "0x044d9b9c3bb29b94685b0a3fe27a5e2dfa30a3637ab55979c718ebcd3268bc2f",
47
51
  ipSponsorshipStartBlock: 11405085,
48
52
  // Dedicated ip-erc721/MIP instance for sponsorship receipts (class hash
@@ -891,6 +895,8 @@ var STARKNET_IP_TICKETS_FACTORY_CONTRACT = SN.ipTicketsFactory;
891
895
  var STARKNET_IP_TICKET_COLLECTION_CLASS_HASH = SN.ipTicketCollectionClassHash;
892
896
  var STARKNET_IP_CLUB_REGISTRY_CONTRACT = SN.ipClubRegistry;
893
897
  var STARKNET_IP_CLUB_NFT_CLASS_HASH = SN.ipClubNftClassHash;
898
+ var STARKNET_IP_CLUB_FACTORY_CONTRACT = SN.ipClubFactory;
899
+ var STARKNET_IP_CLUB_COLLECTION_CLASS_HASH = SN.ipClubCollectionClassHash;
894
900
  var STARKNET_IP_SPONSORSHIP_CONTRACT = SN.ipSponsorship;
895
901
  var STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT = SN.ipSponsorshipLicense;
896
902
  var STARKNET_CREATOR_COIN_FACTORY_CONTRACT = SN.creatorCoinFactory;
@@ -8210,27 +8216,141 @@ var IPClubNFTABI = [
8210
8216
  }
8211
8217
  ];
8212
8218
 
8213
- // src/starknet/abis/ipSponsorship.ts
8214
- var IPSponsorshipABI = [
8219
+ // src/starknet/abis/ipClubFactory.ts
8220
+ var IPClubFactoryABI = [
8215
8221
  {
8216
8222
  "type": "impl",
8217
- "name": "IPSponsorshipImpl",
8218
- "interface_name": "ip_sponsorship::interface::IIPSponsorship"
8223
+ "name": "IPClubFactoryImpl",
8224
+ "interface_name": "ip_club::interface::IIPClubFactory"
8225
+ },
8226
+ {
8227
+ "type": "struct",
8228
+ "name": "core::byte_array::ByteArray",
8229
+ "members": [
8230
+ { "name": "data", "type": "core::array::Array::<core::bytes_31::bytes31>" },
8231
+ { "name": "pending_word", "type": "core::felt252" },
8232
+ { "name": "pending_word_len", "type": "core::internal::bounded_int::BoundedInt::<0, 30>" }
8233
+ ]
8219
8234
  },
8220
8235
  {
8221
8236
  "type": "struct",
8222
8237
  "name": "core::integer::u256",
8223
8238
  "members": [
8239
+ { "name": "low", "type": "core::integer::u128" },
8240
+ { "name": "high", "type": "core::integer::u128" }
8241
+ ]
8242
+ },
8243
+ {
8244
+ "type": "enum",
8245
+ "name": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
8246
+ "variants": [
8247
+ { "name": "Some", "type": "core::starknet::contract_address::ContractAddress" },
8248
+ { "name": "None", "type": "()" }
8249
+ ]
8250
+ },
8251
+ {
8252
+ "type": "interface",
8253
+ "name": "ip_club::interface::IIPClubFactory",
8254
+ "items": [
8224
8255
  {
8225
- "name": "low",
8226
- "type": "core::integer::u128"
8256
+ "type": "function",
8257
+ "name": "collection_class_hash",
8258
+ "inputs": [],
8259
+ "outputs": [{ "type": "core::starknet::class_hash::ClassHash" }],
8260
+ "state_mutability": "view"
8227
8261
  },
8228
8262
  {
8229
- "name": "high",
8230
- "type": "core::integer::u128"
8263
+ "type": "function",
8264
+ "name": "version",
8265
+ "inputs": [],
8266
+ "outputs": [{ "type": "core::byte_array::ByteArray" }],
8267
+ "state_mutability": "view"
8268
+ },
8269
+ {
8270
+ "type": "function",
8271
+ "name": "deploy_club",
8272
+ "inputs": [
8273
+ { "name": "name", "type": "core::byte_array::ByteArray" },
8274
+ { "name": "symbol", "type": "core::byte_array::ByteArray" },
8275
+ { "name": "base_uri", "type": "core::byte_array::ByteArray" },
8276
+ { "name": "max_supply", "type": "core::integer::u256" },
8277
+ { "name": "entry_fee", "type": "core::integer::u256" },
8278
+ { "name": "payment_token", "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>" },
8279
+ { "name": "royalty_bps", "type": "core::integer::u256" }
8280
+ ],
8281
+ "outputs": [{ "type": "core::starknet::contract_address::ContractAddress" }],
8282
+ "state_mutability": "external"
8283
+ }
8284
+ ]
8285
+ },
8286
+ {
8287
+ "type": "impl",
8288
+ "name": "SRC5Impl",
8289
+ "interface_name": "openzeppelin_introspection::interface::ISRC5"
8290
+ },
8291
+ {
8292
+ "type": "enum",
8293
+ "name": "core::bool",
8294
+ "variants": [
8295
+ { "name": "False", "type": "()" },
8296
+ { "name": "True", "type": "()" }
8297
+ ]
8298
+ },
8299
+ {
8300
+ "type": "interface",
8301
+ "name": "openzeppelin_introspection::interface::ISRC5",
8302
+ "items": [
8303
+ {
8304
+ "type": "function",
8305
+ "name": "supports_interface",
8306
+ "inputs": [{ "name": "interface_id", "type": "core::felt252" }],
8307
+ "outputs": [{ "type": "core::bool" }],
8308
+ "state_mutability": "view"
8231
8309
  }
8232
8310
  ]
8233
8311
  },
8312
+ {
8313
+ "type": "constructor",
8314
+ "name": "constructor",
8315
+ "inputs": [
8316
+ { "name": "collection_class_hash", "type": "core::starknet::class_hash::ClassHash" }
8317
+ ]
8318
+ },
8319
+ {
8320
+ "type": "event",
8321
+ "name": "openzeppelin_introspection::src5::SRC5Component::Event",
8322
+ "kind": "enum",
8323
+ "variants": []
8324
+ },
8325
+ {
8326
+ "type": "event",
8327
+ "name": "ip_club::IPClubFactory::IPClubFactory::ClubDeployed",
8328
+ "kind": "struct",
8329
+ "members": [
8330
+ { "name": "collection_address", "type": "core::starknet::contract_address::ContractAddress", "kind": "key" },
8331
+ { "name": "owner", "type": "core::starknet::contract_address::ContractAddress", "kind": "key" },
8332
+ { "name": "name", "type": "core::byte_array::ByteArray", "kind": "data" },
8333
+ { "name": "symbol", "type": "core::byte_array::ByteArray", "kind": "data" }
8334
+ ]
8335
+ },
8336
+ {
8337
+ "type": "event",
8338
+ "name": "ip_club::IPClubFactory::IPClubFactory::Event",
8339
+ "kind": "enum",
8340
+ "variants": [
8341
+ { "name": "SRC5Event", "type": "openzeppelin_introspection::src5::SRC5Component::Event", "kind": "flat" },
8342
+ { "name": "ClubDeployed", "type": "ip_club::IPClubFactory::IPClubFactory::ClubDeployed", "kind": "nested" }
8343
+ ]
8344
+ }
8345
+ ];
8346
+
8347
+ // src/starknet/abis/ipClubCollection.ts
8348
+ var IPClubCollectionABI = [
8349
+ {
8350
+ "type": "impl",
8351
+ "name": "ERC721MetadataImpl",
8352
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721Metadata"
8353
+ },
8234
8354
  {
8235
8355
  "type": "struct",
8236
8356
  "name": "core::byte_array::ByteArray",
@@ -8249,6 +8369,96 @@ var IPSponsorshipABI = [
8249
8369
  }
8250
8370
  ]
8251
8371
  },
8372
+ {
8373
+ "type": "struct",
8374
+ "name": "core::integer::u256",
8375
+ "members": [
8376
+ {
8377
+ "name": "low",
8378
+ "type": "core::integer::u128"
8379
+ },
8380
+ {
8381
+ "name": "high",
8382
+ "type": "core::integer::u128"
8383
+ }
8384
+ ]
8385
+ },
8386
+ {
8387
+ "type": "interface",
8388
+ "name": "openzeppelin_token::erc721::interface::IERC721Metadata",
8389
+ "items": [
8390
+ {
8391
+ "type": "function",
8392
+ "name": "name",
8393
+ "inputs": [],
8394
+ "outputs": [
8395
+ {
8396
+ "type": "core::byte_array::ByteArray"
8397
+ }
8398
+ ],
8399
+ "state_mutability": "view"
8400
+ },
8401
+ {
8402
+ "type": "function",
8403
+ "name": "symbol",
8404
+ "inputs": [],
8405
+ "outputs": [
8406
+ {
8407
+ "type": "core::byte_array::ByteArray"
8408
+ }
8409
+ ],
8410
+ "state_mutability": "view"
8411
+ },
8412
+ {
8413
+ "type": "function",
8414
+ "name": "token_uri",
8415
+ "inputs": [
8416
+ {
8417
+ "name": "token_id",
8418
+ "type": "core::integer::u256"
8419
+ }
8420
+ ],
8421
+ "outputs": [
8422
+ {
8423
+ "type": "core::byte_array::ByteArray"
8424
+ }
8425
+ ],
8426
+ "state_mutability": "view"
8427
+ }
8428
+ ]
8429
+ },
8430
+ {
8431
+ "type": "impl",
8432
+ "name": "ERC721MetadataCamelOnlyImpl",
8433
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly"
8434
+ },
8435
+ {
8436
+ "type": "interface",
8437
+ "name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly",
8438
+ "items": [
8439
+ {
8440
+ "type": "function",
8441
+ "name": "tokenURI",
8442
+ "inputs": [
8443
+ {
8444
+ "name": "tokenId",
8445
+ "type": "core::integer::u256"
8446
+ }
8447
+ ],
8448
+ "outputs": [
8449
+ {
8450
+ "type": "core::byte_array::ByteArray"
8451
+ }
8452
+ ],
8453
+ "state_mutability": "view"
8454
+ }
8455
+ ]
8456
+ },
8457
+ {
8458
+ "type": "impl",
8459
+ "name": "IPClubCollectionImpl",
8460
+ "interface_name": "ip_club::interface::IIPClubCollection"
8461
+ },
8252
8462
  {
8253
8463
  "type": "enum",
8254
8464
  "name": "core::bool",
@@ -8278,148 +8488,1844 @@ var IPSponsorshipABI = [
8278
8488
  ]
8279
8489
  },
8280
8490
  {
8281
- "type": "struct",
8282
- "name": "ip_sponsorship::types::SponsorshipOffer",
8283
- "members": [
8491
+ "type": "interface",
8492
+ "name": "ip_club::interface::IIPClubCollection",
8493
+ "items": [
8284
8494
  {
8285
- "name": "author",
8286
- "type": "core::starknet::contract_address::ContractAddress"
8495
+ "type": "function",
8496
+ "name": "mint",
8497
+ "inputs": [
8498
+ {
8499
+ "name": "to",
8500
+ "type": "core::starknet::contract_address::ContractAddress"
8501
+ }
8502
+ ],
8503
+ "outputs": [
8504
+ {
8505
+ "type": "core::integer::u256"
8506
+ }
8507
+ ],
8508
+ "state_mutability": "external"
8287
8509
  },
8288
8510
  {
8289
- "name": "nft_contract",
8290
- "type": "core::starknet::contract_address::ContractAddress"
8511
+ "type": "function",
8512
+ "name": "set_open",
8513
+ "inputs": [
8514
+ {
8515
+ "name": "open",
8516
+ "type": "core::bool"
8517
+ }
8518
+ ],
8519
+ "outputs": [],
8520
+ "state_mutability": "external"
8291
8521
  },
8292
8522
  {
8293
- "name": "token_id",
8294
- "type": "core::integer::u256"
8523
+ "type": "function",
8524
+ "name": "base_uri",
8525
+ "inputs": [],
8526
+ "outputs": [
8527
+ {
8528
+ "type": "core::byte_array::ByteArray"
8529
+ }
8530
+ ],
8531
+ "state_mutability": "view"
8295
8532
  },
8296
8533
  {
8297
- "name": "min_amount",
8298
- "type": "core::integer::u256"
8534
+ "type": "function",
8535
+ "name": "entry_fee",
8536
+ "inputs": [],
8537
+ "outputs": [
8538
+ {
8539
+ "type": "core::integer::u256"
8540
+ }
8541
+ ],
8542
+ "state_mutability": "view"
8299
8543
  },
8300
8544
  {
8301
- "name": "duration",
8302
- "type": "core::integer::u64"
8545
+ "type": "function",
8546
+ "name": "payment_token",
8547
+ "inputs": [],
8548
+ "outputs": [
8549
+ {
8550
+ "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
8551
+ }
8552
+ ],
8553
+ "state_mutability": "view"
8303
8554
  },
8304
8555
  {
8305
- "name": "payment_token",
8306
- "type": "core::starknet::contract_address::ContractAddress"
8556
+ "type": "function",
8557
+ "name": "max_supply",
8558
+ "inputs": [],
8559
+ "outputs": [
8560
+ {
8561
+ "type": "core::integer::u256"
8562
+ }
8563
+ ],
8564
+ "state_mutability": "view"
8565
+ },
8566
+ {
8567
+ "type": "function",
8568
+ "name": "total_minted",
8569
+ "inputs": [],
8570
+ "outputs": [
8571
+ {
8572
+ "type": "core::integer::u256"
8573
+ }
8574
+ ],
8575
+ "state_mutability": "view"
8576
+ },
8577
+ {
8578
+ "type": "function",
8579
+ "name": "is_open",
8580
+ "inputs": [],
8581
+ "outputs": [
8582
+ {
8583
+ "type": "core::bool"
8584
+ }
8585
+ ],
8586
+ "state_mutability": "view"
8587
+ },
8588
+ {
8589
+ "type": "function",
8590
+ "name": "royalty_info",
8591
+ "inputs": [
8592
+ {
8593
+ "name": "token_id",
8594
+ "type": "core::integer::u256"
8595
+ },
8596
+ {
8597
+ "name": "sale_price",
8598
+ "type": "core::integer::u256"
8599
+ }
8600
+ ],
8601
+ "outputs": [
8602
+ {
8603
+ "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256)"
8604
+ }
8605
+ ],
8606
+ "state_mutability": "view"
8607
+ },
8608
+ {
8609
+ "type": "function",
8610
+ "name": "royaltyInfo",
8611
+ "inputs": [
8612
+ {
8613
+ "name": "token_id",
8614
+ "type": "core::integer::u256"
8615
+ },
8616
+ {
8617
+ "name": "sale_price",
8618
+ "type": "core::integer::u256"
8619
+ }
8620
+ ],
8621
+ "outputs": [
8622
+ {
8623
+ "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256)"
8624
+ }
8625
+ ],
8626
+ "state_mutability": "view"
8627
+ },
8628
+ {
8629
+ "type": "function",
8630
+ "name": "version",
8631
+ "inputs": [],
8632
+ "outputs": [
8633
+ {
8634
+ "type": "core::byte_array::ByteArray"
8635
+ }
8636
+ ],
8637
+ "state_mutability": "view"
8638
+ }
8639
+ ]
8640
+ },
8641
+ {
8642
+ "type": "impl",
8643
+ "name": "ERC721Impl",
8644
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721"
8645
+ },
8646
+ {
8647
+ "type": "struct",
8648
+ "name": "core::array::Span::<core::felt252>",
8649
+ "members": [
8650
+ {
8651
+ "name": "snapshot",
8652
+ "type": "@core::array::Array::<core::felt252>"
8653
+ }
8654
+ ]
8655
+ },
8656
+ {
8657
+ "type": "interface",
8658
+ "name": "openzeppelin_token::erc721::interface::IERC721",
8659
+ "items": [
8660
+ {
8661
+ "type": "function",
8662
+ "name": "balance_of",
8663
+ "inputs": [
8664
+ {
8665
+ "name": "account",
8666
+ "type": "core::starknet::contract_address::ContractAddress"
8667
+ }
8668
+ ],
8669
+ "outputs": [
8670
+ {
8671
+ "type": "core::integer::u256"
8672
+ }
8673
+ ],
8674
+ "state_mutability": "view"
8675
+ },
8676
+ {
8677
+ "type": "function",
8678
+ "name": "owner_of",
8679
+ "inputs": [
8680
+ {
8681
+ "name": "token_id",
8682
+ "type": "core::integer::u256"
8683
+ }
8684
+ ],
8685
+ "outputs": [
8686
+ {
8687
+ "type": "core::starknet::contract_address::ContractAddress"
8688
+ }
8689
+ ],
8690
+ "state_mutability": "view"
8691
+ },
8692
+ {
8693
+ "type": "function",
8694
+ "name": "safe_transfer_from",
8695
+ "inputs": [
8696
+ {
8697
+ "name": "from",
8698
+ "type": "core::starknet::contract_address::ContractAddress"
8699
+ },
8700
+ {
8701
+ "name": "to",
8702
+ "type": "core::starknet::contract_address::ContractAddress"
8703
+ },
8704
+ {
8705
+ "name": "token_id",
8706
+ "type": "core::integer::u256"
8707
+ },
8708
+ {
8709
+ "name": "data",
8710
+ "type": "core::array::Span::<core::felt252>"
8711
+ }
8712
+ ],
8713
+ "outputs": [],
8714
+ "state_mutability": "external"
8715
+ },
8716
+ {
8717
+ "type": "function",
8718
+ "name": "transfer_from",
8719
+ "inputs": [
8720
+ {
8721
+ "name": "from",
8722
+ "type": "core::starknet::contract_address::ContractAddress"
8723
+ },
8724
+ {
8725
+ "name": "to",
8726
+ "type": "core::starknet::contract_address::ContractAddress"
8727
+ },
8728
+ {
8729
+ "name": "token_id",
8730
+ "type": "core::integer::u256"
8731
+ }
8732
+ ],
8733
+ "outputs": [],
8734
+ "state_mutability": "external"
8735
+ },
8736
+ {
8737
+ "type": "function",
8738
+ "name": "approve",
8739
+ "inputs": [
8740
+ {
8741
+ "name": "to",
8742
+ "type": "core::starknet::contract_address::ContractAddress"
8743
+ },
8744
+ {
8745
+ "name": "token_id",
8746
+ "type": "core::integer::u256"
8747
+ }
8748
+ ],
8749
+ "outputs": [],
8750
+ "state_mutability": "external"
8751
+ },
8752
+ {
8753
+ "type": "function",
8754
+ "name": "set_approval_for_all",
8755
+ "inputs": [
8756
+ {
8757
+ "name": "operator",
8758
+ "type": "core::starknet::contract_address::ContractAddress"
8759
+ },
8760
+ {
8761
+ "name": "approved",
8762
+ "type": "core::bool"
8763
+ }
8764
+ ],
8765
+ "outputs": [],
8766
+ "state_mutability": "external"
8767
+ },
8768
+ {
8769
+ "type": "function",
8770
+ "name": "get_approved",
8771
+ "inputs": [
8772
+ {
8773
+ "name": "token_id",
8774
+ "type": "core::integer::u256"
8775
+ }
8776
+ ],
8777
+ "outputs": [
8778
+ {
8779
+ "type": "core::starknet::contract_address::ContractAddress"
8780
+ }
8781
+ ],
8782
+ "state_mutability": "view"
8783
+ },
8784
+ {
8785
+ "type": "function",
8786
+ "name": "is_approved_for_all",
8787
+ "inputs": [
8788
+ {
8789
+ "name": "owner",
8790
+ "type": "core::starknet::contract_address::ContractAddress"
8791
+ },
8792
+ {
8793
+ "name": "operator",
8794
+ "type": "core::starknet::contract_address::ContractAddress"
8795
+ }
8796
+ ],
8797
+ "outputs": [
8798
+ {
8799
+ "type": "core::bool"
8800
+ }
8801
+ ],
8802
+ "state_mutability": "view"
8803
+ }
8804
+ ]
8805
+ },
8806
+ {
8807
+ "type": "impl",
8808
+ "name": "ERC721CamelOnly",
8809
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721CamelOnly"
8810
+ },
8811
+ {
8812
+ "type": "interface",
8813
+ "name": "openzeppelin_token::erc721::interface::IERC721CamelOnly",
8814
+ "items": [
8815
+ {
8816
+ "type": "function",
8817
+ "name": "balanceOf",
8818
+ "inputs": [
8819
+ {
8820
+ "name": "account",
8821
+ "type": "core::starknet::contract_address::ContractAddress"
8822
+ }
8823
+ ],
8824
+ "outputs": [
8825
+ {
8826
+ "type": "core::integer::u256"
8827
+ }
8828
+ ],
8829
+ "state_mutability": "view"
8830
+ },
8831
+ {
8832
+ "type": "function",
8833
+ "name": "ownerOf",
8834
+ "inputs": [
8835
+ {
8836
+ "name": "tokenId",
8837
+ "type": "core::integer::u256"
8838
+ }
8839
+ ],
8840
+ "outputs": [
8841
+ {
8842
+ "type": "core::starknet::contract_address::ContractAddress"
8843
+ }
8844
+ ],
8845
+ "state_mutability": "view"
8846
+ },
8847
+ {
8848
+ "type": "function",
8849
+ "name": "safeTransferFrom",
8850
+ "inputs": [
8851
+ {
8852
+ "name": "from",
8853
+ "type": "core::starknet::contract_address::ContractAddress"
8854
+ },
8855
+ {
8856
+ "name": "to",
8857
+ "type": "core::starknet::contract_address::ContractAddress"
8858
+ },
8859
+ {
8860
+ "name": "tokenId",
8861
+ "type": "core::integer::u256"
8862
+ },
8863
+ {
8864
+ "name": "data",
8865
+ "type": "core::array::Span::<core::felt252>"
8866
+ }
8867
+ ],
8868
+ "outputs": [],
8869
+ "state_mutability": "external"
8870
+ },
8871
+ {
8872
+ "type": "function",
8873
+ "name": "transferFrom",
8874
+ "inputs": [
8875
+ {
8876
+ "name": "from",
8877
+ "type": "core::starknet::contract_address::ContractAddress"
8878
+ },
8879
+ {
8880
+ "name": "to",
8881
+ "type": "core::starknet::contract_address::ContractAddress"
8882
+ },
8883
+ {
8884
+ "name": "tokenId",
8885
+ "type": "core::integer::u256"
8886
+ }
8887
+ ],
8888
+ "outputs": [],
8889
+ "state_mutability": "external"
8890
+ },
8891
+ {
8892
+ "type": "function",
8893
+ "name": "setApprovalForAll",
8894
+ "inputs": [
8895
+ {
8896
+ "name": "operator",
8897
+ "type": "core::starknet::contract_address::ContractAddress"
8898
+ },
8899
+ {
8900
+ "name": "approved",
8901
+ "type": "core::bool"
8902
+ }
8903
+ ],
8904
+ "outputs": [],
8905
+ "state_mutability": "external"
8906
+ },
8907
+ {
8908
+ "type": "function",
8909
+ "name": "getApproved",
8910
+ "inputs": [
8911
+ {
8912
+ "name": "tokenId",
8913
+ "type": "core::integer::u256"
8914
+ }
8915
+ ],
8916
+ "outputs": [
8917
+ {
8918
+ "type": "core::starknet::contract_address::ContractAddress"
8919
+ }
8920
+ ],
8921
+ "state_mutability": "view"
8922
+ },
8923
+ {
8924
+ "type": "function",
8925
+ "name": "isApprovedForAll",
8926
+ "inputs": [
8927
+ {
8928
+ "name": "owner",
8929
+ "type": "core::starknet::contract_address::ContractAddress"
8930
+ },
8931
+ {
8932
+ "name": "operator",
8933
+ "type": "core::starknet::contract_address::ContractAddress"
8934
+ }
8935
+ ],
8936
+ "outputs": [
8937
+ {
8938
+ "type": "core::bool"
8939
+ }
8940
+ ],
8941
+ "state_mutability": "view"
8942
+ }
8943
+ ]
8944
+ },
8945
+ {
8946
+ "type": "impl",
8947
+ "name": "SRC5Impl",
8948
+ "interface_name": "openzeppelin_introspection::interface::ISRC5"
8949
+ },
8950
+ {
8951
+ "type": "interface",
8952
+ "name": "openzeppelin_introspection::interface::ISRC5",
8953
+ "items": [
8954
+ {
8955
+ "type": "function",
8956
+ "name": "supports_interface",
8957
+ "inputs": [
8958
+ {
8959
+ "name": "interface_id",
8960
+ "type": "core::felt252"
8961
+ }
8962
+ ],
8963
+ "outputs": [
8964
+ {
8965
+ "type": "core::bool"
8966
+ }
8967
+ ],
8968
+ "state_mutability": "view"
8969
+ }
8970
+ ]
8971
+ },
8972
+ {
8973
+ "type": "impl",
8974
+ "name": "OwnableMixinImpl",
8975
+ "interface_name": "openzeppelin_access::ownable::interface::OwnableABI"
8976
+ },
8977
+ {
8978
+ "type": "interface",
8979
+ "name": "openzeppelin_access::ownable::interface::OwnableABI",
8980
+ "items": [
8981
+ {
8982
+ "type": "function",
8983
+ "name": "owner",
8984
+ "inputs": [],
8985
+ "outputs": [
8986
+ {
8987
+ "type": "core::starknet::contract_address::ContractAddress"
8988
+ }
8989
+ ],
8990
+ "state_mutability": "view"
8991
+ },
8992
+ {
8993
+ "type": "function",
8994
+ "name": "transfer_ownership",
8995
+ "inputs": [
8996
+ {
8997
+ "name": "new_owner",
8998
+ "type": "core::starknet::contract_address::ContractAddress"
8999
+ }
9000
+ ],
9001
+ "outputs": [],
9002
+ "state_mutability": "external"
9003
+ },
9004
+ {
9005
+ "type": "function",
9006
+ "name": "renounce_ownership",
9007
+ "inputs": [],
9008
+ "outputs": [],
9009
+ "state_mutability": "external"
9010
+ },
9011
+ {
9012
+ "type": "function",
9013
+ "name": "transferOwnership",
9014
+ "inputs": [
9015
+ {
9016
+ "name": "newOwner",
9017
+ "type": "core::starknet::contract_address::ContractAddress"
9018
+ }
9019
+ ],
9020
+ "outputs": [],
9021
+ "state_mutability": "external"
9022
+ },
9023
+ {
9024
+ "type": "function",
9025
+ "name": "renounceOwnership",
9026
+ "inputs": [],
9027
+ "outputs": [],
9028
+ "state_mutability": "external"
9029
+ }
9030
+ ]
9031
+ },
9032
+ {
9033
+ "type": "constructor",
9034
+ "name": "constructor",
9035
+ "inputs": [
9036
+ {
9037
+ "name": "name",
9038
+ "type": "core::byte_array::ByteArray"
9039
+ },
9040
+ {
9041
+ "name": "symbol",
9042
+ "type": "core::byte_array::ByteArray"
9043
+ },
9044
+ {
9045
+ "name": "base_uri",
9046
+ "type": "core::byte_array::ByteArray"
9047
+ },
9048
+ {
9049
+ "name": "max_supply",
9050
+ "type": "core::integer::u256"
9051
+ },
9052
+ {
9053
+ "name": "entry_fee",
9054
+ "type": "core::integer::u256"
9055
+ },
9056
+ {
9057
+ "name": "payment_token",
9058
+ "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
9059
+ },
9060
+ {
9061
+ "name": "royalty_bps",
9062
+ "type": "core::integer::u256"
9063
+ },
9064
+ {
9065
+ "name": "owner",
9066
+ "type": "core::starknet::contract_address::ContractAddress"
9067
+ }
9068
+ ]
9069
+ },
9070
+ {
9071
+ "type": "event",
9072
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
9073
+ "kind": "struct",
9074
+ "members": [
9075
+ {
9076
+ "name": "from",
9077
+ "type": "core::starknet::contract_address::ContractAddress",
9078
+ "kind": "key"
9079
+ },
9080
+ {
9081
+ "name": "to",
9082
+ "type": "core::starknet::contract_address::ContractAddress",
9083
+ "kind": "key"
9084
+ },
9085
+ {
9086
+ "name": "token_id",
9087
+ "type": "core::integer::u256",
9088
+ "kind": "key"
9089
+ }
9090
+ ]
9091
+ },
9092
+ {
9093
+ "type": "event",
9094
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
9095
+ "kind": "struct",
9096
+ "members": [
9097
+ {
9098
+ "name": "owner",
9099
+ "type": "core::starknet::contract_address::ContractAddress",
9100
+ "kind": "key"
9101
+ },
9102
+ {
9103
+ "name": "approved",
9104
+ "type": "core::starknet::contract_address::ContractAddress",
9105
+ "kind": "key"
9106
+ },
9107
+ {
9108
+ "name": "token_id",
9109
+ "type": "core::integer::u256",
9110
+ "kind": "key"
9111
+ }
9112
+ ]
9113
+ },
9114
+ {
9115
+ "type": "event",
9116
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
9117
+ "kind": "struct",
9118
+ "members": [
9119
+ {
9120
+ "name": "owner",
9121
+ "type": "core::starknet::contract_address::ContractAddress",
9122
+ "kind": "key"
9123
+ },
9124
+ {
9125
+ "name": "operator",
9126
+ "type": "core::starknet::contract_address::ContractAddress",
9127
+ "kind": "key"
9128
+ },
9129
+ {
9130
+ "name": "approved",
9131
+ "type": "core::bool",
9132
+ "kind": "data"
9133
+ }
9134
+ ]
9135
+ },
9136
+ {
9137
+ "type": "event",
9138
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
9139
+ "kind": "enum",
9140
+ "variants": [
9141
+ {
9142
+ "name": "Transfer",
9143
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
9144
+ "kind": "nested"
9145
+ },
9146
+ {
9147
+ "name": "Approval",
9148
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
9149
+ "kind": "nested"
9150
+ },
9151
+ {
9152
+ "name": "ApprovalForAll",
9153
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
9154
+ "kind": "nested"
9155
+ }
9156
+ ]
9157
+ },
9158
+ {
9159
+ "type": "event",
9160
+ "name": "openzeppelin_introspection::src5::SRC5Component::Event",
9161
+ "kind": "enum",
9162
+ "variants": []
9163
+ },
9164
+ {
9165
+ "type": "event",
9166
+ "name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
9167
+ "kind": "struct",
9168
+ "members": [
9169
+ {
9170
+ "name": "previous_owner",
9171
+ "type": "core::starknet::contract_address::ContractAddress",
9172
+ "kind": "key"
9173
+ },
9174
+ {
9175
+ "name": "new_owner",
9176
+ "type": "core::starknet::contract_address::ContractAddress",
9177
+ "kind": "key"
9178
+ }
9179
+ ]
9180
+ },
9181
+ {
9182
+ "type": "event",
9183
+ "name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
9184
+ "kind": "struct",
9185
+ "members": [
9186
+ {
9187
+ "name": "previous_owner",
9188
+ "type": "core::starknet::contract_address::ContractAddress",
9189
+ "kind": "key"
9190
+ },
9191
+ {
9192
+ "name": "new_owner",
9193
+ "type": "core::starknet::contract_address::ContractAddress",
9194
+ "kind": "key"
9195
+ }
9196
+ ]
9197
+ },
9198
+ {
9199
+ "type": "event",
9200
+ "name": "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
9201
+ "kind": "enum",
9202
+ "variants": [
9203
+ {
9204
+ "name": "OwnershipTransferred",
9205
+ "type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
9206
+ "kind": "nested"
9207
+ },
9208
+ {
9209
+ "name": "OwnershipTransferStarted",
9210
+ "type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted",
9211
+ "kind": "nested"
9212
+ }
9213
+ ]
9214
+ },
9215
+ {
9216
+ "type": "event",
9217
+ "name": "ip_club::IPClubCollection::IPClubCollection::MemberMinted",
9218
+ "kind": "struct",
9219
+ "members": [
9220
+ {
9221
+ "name": "token_id",
9222
+ "type": "core::integer::u256",
9223
+ "kind": "key"
9224
+ },
9225
+ {
9226
+ "name": "to",
9227
+ "type": "core::starknet::contract_address::ContractAddress",
9228
+ "kind": "key"
9229
+ },
9230
+ {
9231
+ "name": "payer",
9232
+ "type": "core::starknet::contract_address::ContractAddress",
9233
+ "kind": "data"
9234
+ }
9235
+ ]
9236
+ },
9237
+ {
9238
+ "type": "event",
9239
+ "name": "ip_club::IPClubCollection::IPClubCollection::OpenStatusChanged",
9240
+ "kind": "struct",
9241
+ "members": [
9242
+ {
9243
+ "name": "open",
9244
+ "type": "core::bool",
9245
+ "kind": "data"
9246
+ }
9247
+ ]
9248
+ },
9249
+ {
9250
+ "type": "event",
9251
+ "name": "ip_club::IPClubCollection::IPClubCollection::Event",
9252
+ "kind": "enum",
9253
+ "variants": [
9254
+ {
9255
+ "name": "ERC721Event",
9256
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
9257
+ "kind": "flat"
9258
+ },
9259
+ {
9260
+ "name": "SRC5Event",
9261
+ "type": "openzeppelin_introspection::src5::SRC5Component::Event",
9262
+ "kind": "flat"
9263
+ },
9264
+ {
9265
+ "name": "OwnableEvent",
9266
+ "type": "openzeppelin_access::ownable::ownable::OwnableComponent::Event",
9267
+ "kind": "flat"
9268
+ },
9269
+ {
9270
+ "name": "MemberMinted",
9271
+ "type": "ip_club::IPClubCollection::IPClubCollection::MemberMinted",
9272
+ "kind": "nested"
9273
+ },
9274
+ {
9275
+ "name": "OpenStatusChanged",
9276
+ "type": "ip_club::IPClubCollection::IPClubCollection::OpenStatusChanged",
9277
+ "kind": "nested"
9278
+ }
9279
+ ]
9280
+ }
9281
+ ];
9282
+
9283
+ // src/starknet/abis/ipSponsorship.ts
9284
+ var IPSponsorshipABI = [
9285
+ {
9286
+ "type": "impl",
9287
+ "name": "IPSponsorshipImpl",
9288
+ "interface_name": "ip_sponsorship::interface::IIPSponsorship"
9289
+ },
9290
+ {
9291
+ "type": "struct",
9292
+ "name": "core::integer::u256",
9293
+ "members": [
9294
+ {
9295
+ "name": "low",
9296
+ "type": "core::integer::u128"
9297
+ },
9298
+ {
9299
+ "name": "high",
9300
+ "type": "core::integer::u128"
9301
+ }
9302
+ ]
9303
+ },
9304
+ {
9305
+ "type": "struct",
9306
+ "name": "core::byte_array::ByteArray",
9307
+ "members": [
9308
+ {
9309
+ "name": "data",
9310
+ "type": "core::array::Array::<core::bytes_31::bytes31>"
9311
+ },
9312
+ {
9313
+ "name": "pending_word",
9314
+ "type": "core::felt252"
9315
+ },
9316
+ {
9317
+ "name": "pending_word_len",
9318
+ "type": "core::internal::bounded_int::BoundedInt::<0, 30>"
9319
+ }
9320
+ ]
9321
+ },
9322
+ {
9323
+ "type": "enum",
9324
+ "name": "core::bool",
9325
+ "variants": [
9326
+ {
9327
+ "name": "False",
9328
+ "type": "()"
9329
+ },
9330
+ {
9331
+ "name": "True",
9332
+ "type": "()"
9333
+ }
9334
+ ]
9335
+ },
9336
+ {
9337
+ "type": "enum",
9338
+ "name": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
9339
+ "variants": [
9340
+ {
9341
+ "name": "Some",
9342
+ "type": "core::starknet::contract_address::ContractAddress"
9343
+ },
9344
+ {
9345
+ "name": "None",
9346
+ "type": "()"
9347
+ }
9348
+ ]
9349
+ },
9350
+ {
9351
+ "type": "struct",
9352
+ "name": "ip_sponsorship::types::SponsorshipOffer",
9353
+ "members": [
9354
+ {
9355
+ "name": "author",
9356
+ "type": "core::starknet::contract_address::ContractAddress"
9357
+ },
9358
+ {
9359
+ "name": "nft_contract",
9360
+ "type": "core::starknet::contract_address::ContractAddress"
9361
+ },
9362
+ {
9363
+ "name": "token_id",
9364
+ "type": "core::integer::u256"
9365
+ },
9366
+ {
9367
+ "name": "min_amount",
9368
+ "type": "core::integer::u256"
9369
+ },
9370
+ {
9371
+ "name": "duration",
9372
+ "type": "core::integer::u64"
9373
+ },
9374
+ {
9375
+ "name": "payment_token",
9376
+ "type": "core::starknet::contract_address::ContractAddress"
9377
+ },
9378
+ {
9379
+ "name": "license_terms_uri",
9380
+ "type": "core::byte_array::ByteArray"
9381
+ },
9382
+ {
9383
+ "name": "transferable",
9384
+ "type": "core::bool"
9385
+ },
9386
+ {
9387
+ "name": "specific_sponsor",
9388
+ "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
9389
+ },
9390
+ {
9391
+ "name": "open",
9392
+ "type": "core::bool"
9393
+ }
9394
+ ]
9395
+ },
9396
+ {
9397
+ "type": "struct",
9398
+ "name": "ip_sponsorship::types::License",
9399
+ "members": [
9400
+ {
9401
+ "name": "author",
9402
+ "type": "core::starknet::contract_address::ContractAddress"
9403
+ },
9404
+ {
9405
+ "name": "sponsor",
9406
+ "type": "core::starknet::contract_address::ContractAddress"
9407
+ },
9408
+ {
9409
+ "name": "nft_contract",
9410
+ "type": "core::starknet::contract_address::ContractAddress"
9411
+ },
9412
+ {
9413
+ "name": "token_id",
9414
+ "type": "core::integer::u256"
9415
+ },
9416
+ {
9417
+ "name": "amount_paid",
9418
+ "type": "core::integer::u256"
9419
+ },
9420
+ {
9421
+ "name": "expires_at",
9422
+ "type": "core::integer::u64"
9423
+ },
9424
+ {
9425
+ "name": "transferable",
9426
+ "type": "core::bool"
9427
+ },
9428
+ {
9429
+ "name": "license_terms_uri",
9430
+ "type": "core::byte_array::ByteArray"
9431
+ }
9432
+ ]
9433
+ },
9434
+ {
9435
+ "type": "interface",
9436
+ "name": "ip_sponsorship::interface::IIPSponsorship",
9437
+ "items": [
9438
+ {
9439
+ "type": "function",
9440
+ "name": "create_offer",
9441
+ "inputs": [
9442
+ {
9443
+ "name": "nft_contract",
9444
+ "type": "core::starknet::contract_address::ContractAddress"
9445
+ },
9446
+ {
9447
+ "name": "token_id",
9448
+ "type": "core::integer::u256"
9449
+ },
9450
+ {
9451
+ "name": "min_amount",
9452
+ "type": "core::integer::u256"
9453
+ },
9454
+ {
9455
+ "name": "duration",
9456
+ "type": "core::integer::u64"
9457
+ },
9458
+ {
9459
+ "name": "payment_token",
9460
+ "type": "core::starknet::contract_address::ContractAddress"
9461
+ },
9462
+ {
9463
+ "name": "license_terms_uri",
9464
+ "type": "core::byte_array::ByteArray"
9465
+ },
9466
+ {
9467
+ "name": "transferable",
9468
+ "type": "core::bool"
9469
+ },
9470
+ {
9471
+ "name": "specific_sponsor",
9472
+ "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
9473
+ }
9474
+ ],
9475
+ "outputs": [
9476
+ {
9477
+ "type": "core::integer::u256"
9478
+ }
9479
+ ],
9480
+ "state_mutability": "external"
9481
+ },
9482
+ {
9483
+ "type": "function",
9484
+ "name": "set_offer_open",
9485
+ "inputs": [
9486
+ {
9487
+ "name": "offer_id",
9488
+ "type": "core::integer::u256"
9489
+ },
9490
+ {
9491
+ "name": "open",
9492
+ "type": "core::bool"
9493
+ }
9494
+ ],
9495
+ "outputs": [],
9496
+ "state_mutability": "external"
9497
+ },
9498
+ {
9499
+ "type": "function",
9500
+ "name": "place_bid",
9501
+ "inputs": [
9502
+ {
9503
+ "name": "offer_id",
9504
+ "type": "core::integer::u256"
9505
+ },
9506
+ {
9507
+ "name": "amount",
9508
+ "type": "core::integer::u256"
9509
+ }
9510
+ ],
9511
+ "outputs": [],
9512
+ "state_mutability": "external"
9513
+ },
9514
+ {
9515
+ "type": "function",
9516
+ "name": "retract_bid",
9517
+ "inputs": [
9518
+ {
9519
+ "name": "offer_id",
9520
+ "type": "core::integer::u256"
9521
+ }
9522
+ ],
9523
+ "outputs": [],
9524
+ "state_mutability": "external"
9525
+ },
9526
+ {
9527
+ "type": "function",
9528
+ "name": "accept_bid",
9529
+ "inputs": [
9530
+ {
9531
+ "name": "offer_id",
9532
+ "type": "core::integer::u256"
9533
+ },
9534
+ {
9535
+ "name": "sponsor",
9536
+ "type": "core::starknet::contract_address::ContractAddress"
9537
+ }
9538
+ ],
9539
+ "outputs": [
9540
+ {
9541
+ "type": "core::integer::u256"
9542
+ }
9543
+ ],
9544
+ "state_mutability": "external"
9545
+ },
9546
+ {
9547
+ "type": "function",
9548
+ "name": "transfer_license",
9549
+ "inputs": [
9550
+ {
9551
+ "name": "license_id",
9552
+ "type": "core::integer::u256"
9553
+ },
9554
+ {
9555
+ "name": "to",
9556
+ "type": "core::starknet::contract_address::ContractAddress"
9557
+ }
9558
+ ],
9559
+ "outputs": [],
9560
+ "state_mutability": "external"
9561
+ },
9562
+ {
9563
+ "type": "function",
9564
+ "name": "get_offer",
9565
+ "inputs": [
9566
+ {
9567
+ "name": "offer_id",
9568
+ "type": "core::integer::u256"
9569
+ }
9570
+ ],
9571
+ "outputs": [
9572
+ {
9573
+ "type": "ip_sponsorship::types::SponsorshipOffer"
9574
+ }
9575
+ ],
9576
+ "state_mutability": "view"
9577
+ },
9578
+ {
9579
+ "type": "function",
9580
+ "name": "get_bid",
9581
+ "inputs": [
9582
+ {
9583
+ "name": "offer_id",
9584
+ "type": "core::integer::u256"
9585
+ },
9586
+ {
9587
+ "name": "sponsor",
9588
+ "type": "core::starknet::contract_address::ContractAddress"
9589
+ }
9590
+ ],
9591
+ "outputs": [
9592
+ {
9593
+ "type": "core::integer::u256"
9594
+ }
9595
+ ],
9596
+ "state_mutability": "view"
9597
+ },
9598
+ {
9599
+ "type": "function",
9600
+ "name": "get_license",
9601
+ "inputs": [
9602
+ {
9603
+ "name": "license_id",
9604
+ "type": "core::integer::u256"
9605
+ }
9606
+ ],
9607
+ "outputs": [
9608
+ {
9609
+ "type": "ip_sponsorship::types::License"
9610
+ }
9611
+ ],
9612
+ "state_mutability": "view"
9613
+ },
9614
+ {
9615
+ "type": "function",
9616
+ "name": "is_license_valid",
9617
+ "inputs": [
9618
+ {
9619
+ "name": "license_id",
9620
+ "type": "core::integer::u256"
9621
+ }
9622
+ ],
9623
+ "outputs": [
9624
+ {
9625
+ "type": "core::bool"
9626
+ }
9627
+ ],
9628
+ "state_mutability": "view"
9629
+ },
9630
+ {
9631
+ "type": "function",
9632
+ "name": "get_last_offer_id",
9633
+ "inputs": [],
9634
+ "outputs": [
9635
+ {
9636
+ "type": "core::integer::u256"
9637
+ }
9638
+ ],
9639
+ "state_mutability": "view"
9640
+ },
9641
+ {
9642
+ "type": "function",
9643
+ "name": "get_last_license_id",
9644
+ "inputs": [],
9645
+ "outputs": [
9646
+ {
9647
+ "type": "core::integer::u256"
9648
+ }
9649
+ ],
9650
+ "state_mutability": "view"
9651
+ }
9652
+ ]
9653
+ },
9654
+ {
9655
+ "type": "impl",
9656
+ "name": "SRC5Impl",
9657
+ "interface_name": "openzeppelin_introspection::interface::ISRC5"
9658
+ },
9659
+ {
9660
+ "type": "interface",
9661
+ "name": "openzeppelin_introspection::interface::ISRC5",
9662
+ "items": [
9663
+ {
9664
+ "type": "function",
9665
+ "name": "supports_interface",
9666
+ "inputs": [
9667
+ {
9668
+ "name": "interface_id",
9669
+ "type": "core::felt252"
9670
+ }
9671
+ ],
9672
+ "outputs": [
9673
+ {
9674
+ "type": "core::bool"
9675
+ }
9676
+ ],
9677
+ "state_mutability": "view"
9678
+ }
9679
+ ]
9680
+ },
9681
+ {
9682
+ "type": "constructor",
9683
+ "name": "constructor",
9684
+ "inputs": []
9685
+ },
9686
+ {
9687
+ "type": "event",
9688
+ "name": "openzeppelin_introspection::src5::SRC5Component::Event",
9689
+ "kind": "enum",
9690
+ "variants": []
9691
+ },
9692
+ {
9693
+ "type": "event",
9694
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
9695
+ "kind": "struct",
9696
+ "members": [
9697
+ {
9698
+ "name": "offer_id",
9699
+ "type": "core::integer::u256",
9700
+ "kind": "key"
9701
+ },
9702
+ {
9703
+ "name": "author",
9704
+ "type": "core::starknet::contract_address::ContractAddress",
9705
+ "kind": "key"
9706
+ },
9707
+ {
9708
+ "name": "nft_contract",
9709
+ "type": "core::starknet::contract_address::ContractAddress",
9710
+ "kind": "key"
9711
+ },
9712
+ {
9713
+ "name": "token_id",
9714
+ "type": "core::integer::u256",
9715
+ "kind": "data"
9716
+ },
9717
+ {
9718
+ "name": "min_amount",
9719
+ "type": "core::integer::u256",
9720
+ "kind": "data"
9721
+ },
9722
+ {
9723
+ "name": "duration",
9724
+ "type": "core::integer::u64",
9725
+ "kind": "data"
9726
+ },
9727
+ {
9728
+ "name": "payment_token",
9729
+ "type": "core::starknet::contract_address::ContractAddress",
9730
+ "kind": "data"
8307
9731
  },
8308
9732
  {
8309
9733
  "name": "license_terms_uri",
8310
- "type": "core::byte_array::ByteArray"
9734
+ "type": "core::byte_array::ByteArray",
9735
+ "kind": "data"
9736
+ },
9737
+ {
9738
+ "name": "transferable",
9739
+ "type": "core::bool",
9740
+ "kind": "data"
9741
+ },
9742
+ {
9743
+ "name": "specific_sponsor",
9744
+ "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
9745
+ "kind": "data"
9746
+ },
9747
+ {
9748
+ "name": "created_at",
9749
+ "type": "core::integer::u64",
9750
+ "kind": "data"
9751
+ }
9752
+ ]
9753
+ },
9754
+ {
9755
+ "type": "event",
9756
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
9757
+ "kind": "struct",
9758
+ "members": [
9759
+ {
9760
+ "name": "offer_id",
9761
+ "type": "core::integer::u256",
9762
+ "kind": "key"
9763
+ },
9764
+ {
9765
+ "name": "open",
9766
+ "type": "core::bool",
9767
+ "kind": "data"
9768
+ },
9769
+ {
9770
+ "name": "updated_at",
9771
+ "type": "core::integer::u64",
9772
+ "kind": "data"
9773
+ }
9774
+ ]
9775
+ },
9776
+ {
9777
+ "type": "event",
9778
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
9779
+ "kind": "struct",
9780
+ "members": [
9781
+ {
9782
+ "name": "offer_id",
9783
+ "type": "core::integer::u256",
9784
+ "kind": "key"
9785
+ },
9786
+ {
9787
+ "name": "sponsor",
9788
+ "type": "core::starknet::contract_address::ContractAddress",
9789
+ "kind": "key"
9790
+ },
9791
+ {
9792
+ "name": "amount",
9793
+ "type": "core::integer::u256",
9794
+ "kind": "data"
9795
+ },
9796
+ {
9797
+ "name": "bid_at",
9798
+ "type": "core::integer::u64",
9799
+ "kind": "data"
9800
+ }
9801
+ ]
9802
+ },
9803
+ {
9804
+ "type": "event",
9805
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
9806
+ "kind": "struct",
9807
+ "members": [
9808
+ {
9809
+ "name": "offer_id",
9810
+ "type": "core::integer::u256",
9811
+ "kind": "key"
9812
+ },
9813
+ {
9814
+ "name": "sponsor",
9815
+ "type": "core::starknet::contract_address::ContractAddress",
9816
+ "kind": "key"
9817
+ },
9818
+ {
9819
+ "name": "retracted_at",
9820
+ "type": "core::integer::u64",
9821
+ "kind": "data"
9822
+ }
9823
+ ]
9824
+ },
9825
+ {
9826
+ "type": "event",
9827
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
9828
+ "kind": "struct",
9829
+ "members": [
9830
+ {
9831
+ "name": "offer_id",
9832
+ "type": "core::integer::u256",
9833
+ "kind": "key"
9834
+ },
9835
+ {
9836
+ "name": "license_id",
9837
+ "type": "core::integer::u256",
9838
+ "kind": "key"
9839
+ },
9840
+ {
9841
+ "name": "sponsor",
9842
+ "type": "core::starknet::contract_address::ContractAddress",
9843
+ "kind": "key"
9844
+ },
9845
+ {
9846
+ "name": "author",
9847
+ "type": "core::starknet::contract_address::ContractAddress",
9848
+ "kind": "data"
9849
+ },
9850
+ {
9851
+ "name": "amount",
9852
+ "type": "core::integer::u256",
9853
+ "kind": "data"
9854
+ },
9855
+ {
9856
+ "name": "expires_at",
9857
+ "type": "core::integer::u64",
9858
+ "kind": "data"
9859
+ }
9860
+ ]
9861
+ },
9862
+ {
9863
+ "type": "event",
9864
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseTransferred",
9865
+ "kind": "struct",
9866
+ "members": [
9867
+ {
9868
+ "name": "license_id",
9869
+ "type": "core::integer::u256",
9870
+ "kind": "key"
9871
+ },
9872
+ {
9873
+ "name": "from",
9874
+ "type": "core::starknet::contract_address::ContractAddress",
9875
+ "kind": "key"
9876
+ },
9877
+ {
9878
+ "name": "to",
9879
+ "type": "core::starknet::contract_address::ContractAddress",
9880
+ "kind": "key"
9881
+ },
9882
+ {
9883
+ "name": "transferred_at",
9884
+ "type": "core::integer::u64",
9885
+ "kind": "data"
9886
+ }
9887
+ ]
9888
+ },
9889
+ {
9890
+ "type": "event",
9891
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::Event",
9892
+ "kind": "enum",
9893
+ "variants": [
9894
+ {
9895
+ "name": "SRC5Event",
9896
+ "type": "openzeppelin_introspection::src5::SRC5Component::Event",
9897
+ "kind": "flat"
9898
+ },
9899
+ {
9900
+ "name": "OfferCreated",
9901
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
9902
+ "kind": "nested"
9903
+ },
9904
+ {
9905
+ "name": "OfferStatusUpdated",
9906
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
9907
+ "kind": "nested"
9908
+ },
9909
+ {
9910
+ "name": "BidPlaced",
9911
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
9912
+ "kind": "nested"
9913
+ },
9914
+ {
9915
+ "name": "BidRetracted",
9916
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
9917
+ "kind": "nested"
9918
+ },
9919
+ {
9920
+ "name": "SponsorshipAccepted",
9921
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
9922
+ "kind": "nested"
9923
+ },
9924
+ {
9925
+ "name": "LicenseTransferred",
9926
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseTransferred",
9927
+ "kind": "nested"
9928
+ }
9929
+ ]
9930
+ }
9931
+ ];
9932
+
9933
+ // src/starknet/abis/ipSponsorshipLicense.ts
9934
+ var IPSponsorshipLicenseABI = [
9935
+ {
9936
+ "type": "impl",
9937
+ "name": "ERC721MetadataImpl",
9938
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721Metadata"
9939
+ },
9940
+ {
9941
+ "type": "struct",
9942
+ "name": "core::byte_array::ByteArray",
9943
+ "members": [
9944
+ {
9945
+ "name": "data",
9946
+ "type": "core::array::Array::<core::bytes_31::bytes31>"
9947
+ },
9948
+ {
9949
+ "name": "pending_word",
9950
+ "type": "core::felt252"
9951
+ },
9952
+ {
9953
+ "name": "pending_word_len",
9954
+ "type": "core::internal::bounded_int::BoundedInt::<0, 30>"
9955
+ }
9956
+ ]
9957
+ },
9958
+ {
9959
+ "type": "struct",
9960
+ "name": "core::integer::u256",
9961
+ "members": [
9962
+ {
9963
+ "name": "low",
9964
+ "type": "core::integer::u128"
9965
+ },
9966
+ {
9967
+ "name": "high",
9968
+ "type": "core::integer::u128"
9969
+ }
9970
+ ]
9971
+ },
9972
+ {
9973
+ "type": "interface",
9974
+ "name": "openzeppelin_token::erc721::interface::IERC721Metadata",
9975
+ "items": [
9976
+ {
9977
+ "type": "function",
9978
+ "name": "name",
9979
+ "inputs": [],
9980
+ "outputs": [
9981
+ {
9982
+ "type": "core::byte_array::ByteArray"
9983
+ }
9984
+ ],
9985
+ "state_mutability": "view"
9986
+ },
9987
+ {
9988
+ "type": "function",
9989
+ "name": "symbol",
9990
+ "inputs": [],
9991
+ "outputs": [
9992
+ {
9993
+ "type": "core::byte_array::ByteArray"
9994
+ }
9995
+ ],
9996
+ "state_mutability": "view"
9997
+ },
9998
+ {
9999
+ "type": "function",
10000
+ "name": "token_uri",
10001
+ "inputs": [
10002
+ {
10003
+ "name": "token_id",
10004
+ "type": "core::integer::u256"
10005
+ }
10006
+ ],
10007
+ "outputs": [
10008
+ {
10009
+ "type": "core::byte_array::ByteArray"
10010
+ }
10011
+ ],
10012
+ "state_mutability": "view"
10013
+ }
10014
+ ]
10015
+ },
10016
+ {
10017
+ "type": "impl",
10018
+ "name": "ERC721MetadataCamelOnlyImpl",
10019
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly"
10020
+ },
10021
+ {
10022
+ "type": "interface",
10023
+ "name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly",
10024
+ "items": [
10025
+ {
10026
+ "type": "function",
10027
+ "name": "tokenURI",
10028
+ "inputs": [
10029
+ {
10030
+ "name": "tokenId",
10031
+ "type": "core::integer::u256"
10032
+ }
10033
+ ],
10034
+ "outputs": [
10035
+ {
10036
+ "type": "core::byte_array::ByteArray"
10037
+ }
10038
+ ],
10039
+ "state_mutability": "view"
10040
+ }
10041
+ ]
10042
+ },
10043
+ {
10044
+ "type": "impl",
10045
+ "name": "IPSponsorshipLicenseImpl",
10046
+ "interface_name": "ip_sponsorship::interface::IIPSponsorshipLicense"
10047
+ },
10048
+ {
10049
+ "type": "enum",
10050
+ "name": "core::bool",
10051
+ "variants": [
10052
+ {
10053
+ "name": "False",
10054
+ "type": "()"
10055
+ },
10056
+ {
10057
+ "name": "True",
10058
+ "type": "()"
10059
+ }
10060
+ ]
10061
+ },
10062
+ {
10063
+ "type": "struct",
10064
+ "name": "ip_sponsorship::types::LicenseData",
10065
+ "members": [
10066
+ {
10067
+ "name": "author",
10068
+ "type": "core::starknet::contract_address::ContractAddress"
10069
+ },
10070
+ {
10071
+ "name": "asset_contract",
10072
+ "type": "core::starknet::contract_address::ContractAddress"
10073
+ },
10074
+ {
10075
+ "name": "asset_token_id",
10076
+ "type": "core::integer::u256"
10077
+ },
10078
+ {
10079
+ "name": "expires_at",
10080
+ "type": "core::integer::u64"
8311
10081
  },
8312
10082
  {
8313
10083
  "name": "transferable",
8314
10084
  "type": "core::bool"
8315
10085
  },
8316
10086
  {
8317
- "name": "specific_sponsor",
8318
- "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
10087
+ "name": "royalty_bps",
10088
+ "type": "core::integer::u256"
8319
10089
  },
8320
10090
  {
8321
- "name": "open",
8322
- "type": "core::bool"
10091
+ "name": "license_terms_uri",
10092
+ "type": "core::byte_array::ByteArray"
10093
+ }
10094
+ ]
10095
+ },
10096
+ {
10097
+ "type": "interface",
10098
+ "name": "ip_sponsorship::interface::IIPSponsorshipLicense",
10099
+ "items": [
10100
+ {
10101
+ "type": "function",
10102
+ "name": "set_minter",
10103
+ "inputs": [
10104
+ {
10105
+ "name": "minter",
10106
+ "type": "core::starknet::contract_address::ContractAddress"
10107
+ }
10108
+ ],
10109
+ "outputs": [],
10110
+ "state_mutability": "external"
10111
+ },
10112
+ {
10113
+ "type": "function",
10114
+ "name": "get_minter",
10115
+ "inputs": [],
10116
+ "outputs": [
10117
+ {
10118
+ "type": "core::starknet::contract_address::ContractAddress"
10119
+ }
10120
+ ],
10121
+ "state_mutability": "view"
10122
+ },
10123
+ {
10124
+ "type": "function",
10125
+ "name": "mint",
10126
+ "inputs": [
10127
+ {
10128
+ "name": "recipient",
10129
+ "type": "core::starknet::contract_address::ContractAddress"
10130
+ },
10131
+ {
10132
+ "name": "data",
10133
+ "type": "ip_sponsorship::types::LicenseData"
10134
+ }
10135
+ ],
10136
+ "outputs": [
10137
+ {
10138
+ "type": "core::integer::u256"
10139
+ }
10140
+ ],
10141
+ "state_mutability": "external"
10142
+ },
10143
+ {
10144
+ "type": "function",
10145
+ "name": "get_license_data",
10146
+ "inputs": [
10147
+ {
10148
+ "name": "token_id",
10149
+ "type": "core::integer::u256"
10150
+ }
10151
+ ],
10152
+ "outputs": [
10153
+ {
10154
+ "type": "ip_sponsorship::types::LicenseData"
10155
+ }
10156
+ ],
10157
+ "state_mutability": "view"
10158
+ },
10159
+ {
10160
+ "type": "function",
10161
+ "name": "is_license_valid",
10162
+ "inputs": [
10163
+ {
10164
+ "name": "token_id",
10165
+ "type": "core::integer::u256"
10166
+ }
10167
+ ],
10168
+ "outputs": [
10169
+ {
10170
+ "type": "core::bool"
10171
+ }
10172
+ ],
10173
+ "state_mutability": "view"
10174
+ },
10175
+ {
10176
+ "type": "function",
10177
+ "name": "last_license_id",
10178
+ "inputs": [],
10179
+ "outputs": [
10180
+ {
10181
+ "type": "core::integer::u256"
10182
+ }
10183
+ ],
10184
+ "state_mutability": "view"
10185
+ },
10186
+ {
10187
+ "type": "function",
10188
+ "name": "royalty_info",
10189
+ "inputs": [
10190
+ {
10191
+ "name": "token_id",
10192
+ "type": "core::integer::u256"
10193
+ },
10194
+ {
10195
+ "name": "sale_price",
10196
+ "type": "core::integer::u256"
10197
+ }
10198
+ ],
10199
+ "outputs": [
10200
+ {
10201
+ "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256)"
10202
+ }
10203
+ ],
10204
+ "state_mutability": "view"
10205
+ },
10206
+ {
10207
+ "type": "function",
10208
+ "name": "royaltyInfo",
10209
+ "inputs": [
10210
+ {
10211
+ "name": "token_id",
10212
+ "type": "core::integer::u256"
10213
+ },
10214
+ {
10215
+ "name": "sale_price",
10216
+ "type": "core::integer::u256"
10217
+ }
10218
+ ],
10219
+ "outputs": [
10220
+ {
10221
+ "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256)"
10222
+ }
10223
+ ],
10224
+ "state_mutability": "view"
10225
+ },
10226
+ {
10227
+ "type": "function",
10228
+ "name": "version",
10229
+ "inputs": [],
10230
+ "outputs": [
10231
+ {
10232
+ "type": "core::byte_array::ByteArray"
10233
+ }
10234
+ ],
10235
+ "state_mutability": "view"
8323
10236
  }
8324
10237
  ]
8325
10238
  },
10239
+ {
10240
+ "type": "impl",
10241
+ "name": "ERC721Impl",
10242
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721"
10243
+ },
8326
10244
  {
8327
10245
  "type": "struct",
8328
- "name": "ip_sponsorship::types::License",
10246
+ "name": "core::array::Span::<core::felt252>",
8329
10247
  "members": [
8330
10248
  {
8331
- "name": "author",
8332
- "type": "core::starknet::contract_address::ContractAddress"
8333
- },
8334
- {
8335
- "name": "sponsor",
8336
- "type": "core::starknet::contract_address::ContractAddress"
8337
- },
8338
- {
8339
- "name": "nft_contract",
8340
- "type": "core::starknet::contract_address::ContractAddress"
8341
- },
8342
- {
8343
- "name": "token_id",
8344
- "type": "core::integer::u256"
8345
- },
8346
- {
8347
- "name": "amount_paid",
8348
- "type": "core::integer::u256"
8349
- },
8350
- {
8351
- "name": "expires_at",
8352
- "type": "core::integer::u64"
8353
- },
8354
- {
8355
- "name": "transferable",
8356
- "type": "core::bool"
8357
- },
8358
- {
8359
- "name": "license_terms_uri",
8360
- "type": "core::byte_array::ByteArray"
10249
+ "name": "snapshot",
10250
+ "type": "@core::array::Array::<core::felt252>"
8361
10251
  }
8362
10252
  ]
8363
10253
  },
8364
10254
  {
8365
10255
  "type": "interface",
8366
- "name": "ip_sponsorship::interface::IIPSponsorship",
10256
+ "name": "openzeppelin_token::erc721::interface::IERC721",
8367
10257
  "items": [
8368
10258
  {
8369
10259
  "type": "function",
8370
- "name": "create_offer",
10260
+ "name": "balance_of",
8371
10261
  "inputs": [
8372
10262
  {
8373
- "name": "nft_contract",
10263
+ "name": "account",
8374
10264
  "type": "core::starknet::contract_address::ContractAddress"
8375
- },
10265
+ }
10266
+ ],
10267
+ "outputs": [
8376
10268
  {
8377
- "name": "token_id",
8378
10269
  "type": "core::integer::u256"
8379
- },
10270
+ }
10271
+ ],
10272
+ "state_mutability": "view"
10273
+ },
10274
+ {
10275
+ "type": "function",
10276
+ "name": "owner_of",
10277
+ "inputs": [
8380
10278
  {
8381
- "name": "min_amount",
10279
+ "name": "token_id",
8382
10280
  "type": "core::integer::u256"
8383
- },
10281
+ }
10282
+ ],
10283
+ "outputs": [
8384
10284
  {
8385
- "name": "duration",
8386
- "type": "core::integer::u64"
8387
- },
10285
+ "type": "core::starknet::contract_address::ContractAddress"
10286
+ }
10287
+ ],
10288
+ "state_mutability": "view"
10289
+ },
10290
+ {
10291
+ "type": "function",
10292
+ "name": "safe_transfer_from",
10293
+ "inputs": [
8388
10294
  {
8389
- "name": "payment_token",
10295
+ "name": "from",
8390
10296
  "type": "core::starknet::contract_address::ContractAddress"
8391
10297
  },
8392
10298
  {
8393
- "name": "license_terms_uri",
8394
- "type": "core::byte_array::ByteArray"
10299
+ "name": "to",
10300
+ "type": "core::starknet::contract_address::ContractAddress"
8395
10301
  },
8396
10302
  {
8397
- "name": "transferable",
8398
- "type": "core::bool"
10303
+ "name": "token_id",
10304
+ "type": "core::integer::u256"
8399
10305
  },
8400
10306
  {
8401
- "name": "specific_sponsor",
8402
- "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
8403
- }
8404
- ],
8405
- "outputs": [
8406
- {
8407
- "type": "core::integer::u256"
10307
+ "name": "data",
10308
+ "type": "core::array::Span::<core::felt252>"
8408
10309
  }
8409
10310
  ],
10311
+ "outputs": [],
8410
10312
  "state_mutability": "external"
8411
10313
  },
8412
10314
  {
8413
10315
  "type": "function",
8414
- "name": "set_offer_open",
10316
+ "name": "transfer_from",
8415
10317
  "inputs": [
8416
10318
  {
8417
- "name": "offer_id",
8418
- "type": "core::integer::u256"
10319
+ "name": "from",
10320
+ "type": "core::starknet::contract_address::ContractAddress"
8419
10321
  },
8420
10322
  {
8421
- "name": "open",
8422
- "type": "core::bool"
10323
+ "name": "to",
10324
+ "type": "core::starknet::contract_address::ContractAddress"
10325
+ },
10326
+ {
10327
+ "name": "token_id",
10328
+ "type": "core::integer::u256"
8423
10329
  }
8424
10330
  ],
8425
10331
  "outputs": [],
@@ -8427,14 +10333,14 @@ var IPSponsorshipABI = [
8427
10333
  },
8428
10334
  {
8429
10335
  "type": "function",
8430
- "name": "place_bid",
10336
+ "name": "approve",
8431
10337
  "inputs": [
8432
10338
  {
8433
- "name": "offer_id",
8434
- "type": "core::integer::u256"
10339
+ "name": "to",
10340
+ "type": "core::starknet::contract_address::ContractAddress"
8435
10341
  },
8436
10342
  {
8437
- "name": "amount",
10343
+ "name": "token_id",
8438
10344
  "type": "core::integer::u256"
8439
10345
  }
8440
10346
  ],
@@ -8443,11 +10349,15 @@ var IPSponsorshipABI = [
8443
10349
  },
8444
10350
  {
8445
10351
  "type": "function",
8446
- "name": "retract_bid",
10352
+ "name": "set_approval_for_all",
8447
10353
  "inputs": [
8448
10354
  {
8449
- "name": "offer_id",
8450
- "type": "core::integer::u256"
10355
+ "name": "operator",
10356
+ "type": "core::starknet::contract_address::ContractAddress"
10357
+ },
10358
+ {
10359
+ "name": "approved",
10360
+ "type": "core::bool"
8451
10361
  }
8452
10362
  ],
8453
10363
  "outputs": [],
@@ -8455,126 +10365,175 @@ var IPSponsorshipABI = [
8455
10365
  },
8456
10366
  {
8457
10367
  "type": "function",
8458
- "name": "accept_bid",
10368
+ "name": "get_approved",
8459
10369
  "inputs": [
8460
10370
  {
8461
- "name": "offer_id",
10371
+ "name": "token_id",
8462
10372
  "type": "core::integer::u256"
8463
- },
8464
- {
8465
- "name": "sponsor",
8466
- "type": "core::starknet::contract_address::ContractAddress"
8467
10373
  }
8468
10374
  ],
8469
10375
  "outputs": [
8470
10376
  {
8471
- "type": "core::integer::u256"
10377
+ "type": "core::starknet::contract_address::ContractAddress"
8472
10378
  }
8473
10379
  ],
8474
- "state_mutability": "external"
10380
+ "state_mutability": "view"
8475
10381
  },
8476
10382
  {
8477
10383
  "type": "function",
8478
- "name": "transfer_license",
10384
+ "name": "is_approved_for_all",
8479
10385
  "inputs": [
8480
10386
  {
8481
- "name": "license_id",
8482
- "type": "core::integer::u256"
10387
+ "name": "owner",
10388
+ "type": "core::starknet::contract_address::ContractAddress"
8483
10389
  },
8484
10390
  {
8485
- "name": "to",
10391
+ "name": "operator",
8486
10392
  "type": "core::starknet::contract_address::ContractAddress"
8487
10393
  }
8488
10394
  ],
8489
- "outputs": [],
8490
- "state_mutability": "external"
8491
- },
10395
+ "outputs": [
10396
+ {
10397
+ "type": "core::bool"
10398
+ }
10399
+ ],
10400
+ "state_mutability": "view"
10401
+ }
10402
+ ]
10403
+ },
10404
+ {
10405
+ "type": "impl",
10406
+ "name": "ERC721CamelOnly",
10407
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721CamelOnly"
10408
+ },
10409
+ {
10410
+ "type": "interface",
10411
+ "name": "openzeppelin_token::erc721::interface::IERC721CamelOnly",
10412
+ "items": [
8492
10413
  {
8493
10414
  "type": "function",
8494
- "name": "get_offer",
10415
+ "name": "balanceOf",
8495
10416
  "inputs": [
8496
10417
  {
8497
- "name": "offer_id",
8498
- "type": "core::integer::u256"
10418
+ "name": "account",
10419
+ "type": "core::starknet::contract_address::ContractAddress"
8499
10420
  }
8500
10421
  ],
8501
10422
  "outputs": [
8502
10423
  {
8503
- "type": "ip_sponsorship::types::SponsorshipOffer"
10424
+ "type": "core::integer::u256"
8504
10425
  }
8505
10426
  ],
8506
10427
  "state_mutability": "view"
8507
10428
  },
8508
10429
  {
8509
10430
  "type": "function",
8510
- "name": "get_bid",
10431
+ "name": "ownerOf",
8511
10432
  "inputs": [
8512
10433
  {
8513
- "name": "offer_id",
10434
+ "name": "tokenId",
8514
10435
  "type": "core::integer::u256"
8515
- },
8516
- {
8517
- "name": "sponsor",
8518
- "type": "core::starknet::contract_address::ContractAddress"
8519
10436
  }
8520
10437
  ],
8521
10438
  "outputs": [
8522
10439
  {
8523
- "type": "core::integer::u256"
10440
+ "type": "core::starknet::contract_address::ContractAddress"
8524
10441
  }
8525
10442
  ],
8526
10443
  "state_mutability": "view"
8527
10444
  },
8528
10445
  {
8529
10446
  "type": "function",
8530
- "name": "get_license",
10447
+ "name": "safeTransferFrom",
8531
10448
  "inputs": [
8532
10449
  {
8533
- "name": "license_id",
10450
+ "name": "from",
10451
+ "type": "core::starknet::contract_address::ContractAddress"
10452
+ },
10453
+ {
10454
+ "name": "to",
10455
+ "type": "core::starknet::contract_address::ContractAddress"
10456
+ },
10457
+ {
10458
+ "name": "tokenId",
8534
10459
  "type": "core::integer::u256"
8535
- }
8536
- ],
8537
- "outputs": [
10460
+ },
8538
10461
  {
8539
- "type": "ip_sponsorship::types::License"
10462
+ "name": "data",
10463
+ "type": "core::array::Span::<core::felt252>"
8540
10464
  }
8541
10465
  ],
8542
- "state_mutability": "view"
10466
+ "outputs": [],
10467
+ "state_mutability": "external"
8543
10468
  },
8544
10469
  {
8545
10470
  "type": "function",
8546
- "name": "is_license_valid",
10471
+ "name": "transferFrom",
8547
10472
  "inputs": [
8548
10473
  {
8549
- "name": "license_id",
10474
+ "name": "from",
10475
+ "type": "core::starknet::contract_address::ContractAddress"
10476
+ },
10477
+ {
10478
+ "name": "to",
10479
+ "type": "core::starknet::contract_address::ContractAddress"
10480
+ },
10481
+ {
10482
+ "name": "tokenId",
8550
10483
  "type": "core::integer::u256"
8551
10484
  }
8552
10485
  ],
8553
- "outputs": [
10486
+ "outputs": [],
10487
+ "state_mutability": "external"
10488
+ },
10489
+ {
10490
+ "type": "function",
10491
+ "name": "setApprovalForAll",
10492
+ "inputs": [
10493
+ {
10494
+ "name": "operator",
10495
+ "type": "core::starknet::contract_address::ContractAddress"
10496
+ },
8554
10497
  {
10498
+ "name": "approved",
8555
10499
  "type": "core::bool"
8556
10500
  }
8557
10501
  ],
8558
- "state_mutability": "view"
10502
+ "outputs": [],
10503
+ "state_mutability": "external"
8559
10504
  },
8560
10505
  {
8561
10506
  "type": "function",
8562
- "name": "get_last_offer_id",
8563
- "inputs": [],
8564
- "outputs": [
10507
+ "name": "getApproved",
10508
+ "inputs": [
8565
10509
  {
10510
+ "name": "tokenId",
8566
10511
  "type": "core::integer::u256"
8567
10512
  }
8568
10513
  ],
10514
+ "outputs": [
10515
+ {
10516
+ "type": "core::starknet::contract_address::ContractAddress"
10517
+ }
10518
+ ],
8569
10519
  "state_mutability": "view"
8570
10520
  },
8571
10521
  {
8572
10522
  "type": "function",
8573
- "name": "get_last_license_id",
8574
- "inputs": [],
10523
+ "name": "isApprovedForAll",
10524
+ "inputs": [
10525
+ {
10526
+ "name": "owner",
10527
+ "type": "core::starknet::contract_address::ContractAddress"
10528
+ },
10529
+ {
10530
+ "name": "operator",
10531
+ "type": "core::starknet::contract_address::ContractAddress"
10532
+ }
10533
+ ],
8575
10534
  "outputs": [
8576
10535
  {
8577
- "type": "core::integer::u256"
10536
+ "type": "core::bool"
8578
10537
  }
8579
10538
  ],
8580
10539
  "state_mutability": "view"
@@ -8611,174 +10570,138 @@ var IPSponsorshipABI = [
8611
10570
  {
8612
10571
  "type": "constructor",
8613
10572
  "name": "constructor",
8614
- "inputs": []
8615
- },
8616
- {
8617
- "type": "event",
8618
- "name": "openzeppelin_introspection::src5::SRC5Component::Event",
8619
- "kind": "enum",
8620
- "variants": []
10573
+ "inputs": [
10574
+ {
10575
+ "name": "name",
10576
+ "type": "core::byte_array::ByteArray"
10577
+ },
10578
+ {
10579
+ "name": "symbol",
10580
+ "type": "core::byte_array::ByteArray"
10581
+ }
10582
+ ]
8621
10583
  },
8622
10584
  {
8623
10585
  "type": "event",
8624
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
10586
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
8625
10587
  "kind": "struct",
8626
10588
  "members": [
8627
10589
  {
8628
- "name": "offer_id",
8629
- "type": "core::integer::u256",
8630
- "kind": "key"
8631
- },
8632
- {
8633
- "name": "author",
10590
+ "name": "from",
8634
10591
  "type": "core::starknet::contract_address::ContractAddress",
8635
10592
  "kind": "key"
8636
10593
  },
8637
10594
  {
8638
- "name": "nft_contract",
10595
+ "name": "to",
8639
10596
  "type": "core::starknet::contract_address::ContractAddress",
8640
10597
  "kind": "key"
8641
10598
  },
8642
10599
  {
8643
10600
  "name": "token_id",
8644
10601
  "type": "core::integer::u256",
8645
- "kind": "data"
8646
- },
8647
- {
8648
- "name": "min_amount",
8649
- "type": "core::integer::u256",
8650
- "kind": "data"
8651
- },
8652
- {
8653
- "name": "duration",
8654
- "type": "core::integer::u64",
8655
- "kind": "data"
8656
- },
8657
- {
8658
- "name": "payment_token",
8659
- "type": "core::starknet::contract_address::ContractAddress",
8660
- "kind": "data"
8661
- },
8662
- {
8663
- "name": "license_terms_uri",
8664
- "type": "core::byte_array::ByteArray",
8665
- "kind": "data"
8666
- },
8667
- {
8668
- "name": "transferable",
8669
- "type": "core::bool",
8670
- "kind": "data"
8671
- },
8672
- {
8673
- "name": "specific_sponsor",
8674
- "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
8675
- "kind": "data"
8676
- },
8677
- {
8678
- "name": "created_at",
8679
- "type": "core::integer::u64",
8680
- "kind": "data"
10602
+ "kind": "key"
8681
10603
  }
8682
10604
  ]
8683
10605
  },
8684
10606
  {
8685
10607
  "type": "event",
8686
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
10608
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
8687
10609
  "kind": "struct",
8688
10610
  "members": [
8689
10611
  {
8690
- "name": "offer_id",
8691
- "type": "core::integer::u256",
10612
+ "name": "owner",
10613
+ "type": "core::starknet::contract_address::ContractAddress",
8692
10614
  "kind": "key"
8693
10615
  },
8694
10616
  {
8695
- "name": "open",
8696
- "type": "core::bool",
8697
- "kind": "data"
10617
+ "name": "approved",
10618
+ "type": "core::starknet::contract_address::ContractAddress",
10619
+ "kind": "key"
8698
10620
  },
8699
10621
  {
8700
- "name": "updated_at",
8701
- "type": "core::integer::u64",
8702
- "kind": "data"
10622
+ "name": "token_id",
10623
+ "type": "core::integer::u256",
10624
+ "kind": "key"
8703
10625
  }
8704
10626
  ]
8705
10627
  },
8706
10628
  {
8707
10629
  "type": "event",
8708
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
10630
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
8709
10631
  "kind": "struct",
8710
10632
  "members": [
8711
10633
  {
8712
- "name": "offer_id",
8713
- "type": "core::integer::u256",
10634
+ "name": "owner",
10635
+ "type": "core::starknet::contract_address::ContractAddress",
8714
10636
  "kind": "key"
8715
10637
  },
8716
10638
  {
8717
- "name": "sponsor",
10639
+ "name": "operator",
8718
10640
  "type": "core::starknet::contract_address::ContractAddress",
8719
10641
  "kind": "key"
8720
10642
  },
8721
10643
  {
8722
- "name": "amount",
8723
- "type": "core::integer::u256",
8724
- "kind": "data"
8725
- },
8726
- {
8727
- "name": "bid_at",
8728
- "type": "core::integer::u64",
10644
+ "name": "approved",
10645
+ "type": "core::bool",
8729
10646
  "kind": "data"
8730
10647
  }
8731
10648
  ]
8732
10649
  },
8733
10650
  {
8734
10651
  "type": "event",
8735
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
8736
- "kind": "struct",
8737
- "members": [
10652
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
10653
+ "kind": "enum",
10654
+ "variants": [
8738
10655
  {
8739
- "name": "offer_id",
8740
- "type": "core::integer::u256",
8741
- "kind": "key"
10656
+ "name": "Transfer",
10657
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
10658
+ "kind": "nested"
8742
10659
  },
8743
10660
  {
8744
- "name": "sponsor",
8745
- "type": "core::starknet::contract_address::ContractAddress",
8746
- "kind": "key"
10661
+ "name": "Approval",
10662
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
10663
+ "kind": "nested"
8747
10664
  },
8748
10665
  {
8749
- "name": "retracted_at",
8750
- "type": "core::integer::u64",
8751
- "kind": "data"
10666
+ "name": "ApprovalForAll",
10667
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
10668
+ "kind": "nested"
8752
10669
  }
8753
10670
  ]
8754
10671
  },
8755
10672
  {
8756
10673
  "type": "event",
8757
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
10674
+ "name": "openzeppelin_introspection::src5::SRC5Component::Event",
10675
+ "kind": "enum",
10676
+ "variants": []
10677
+ },
10678
+ {
10679
+ "type": "event",
10680
+ "name": "ip_sponsorship::IPSponsorshipLicense::IPSponsorshipLicense::LicenseMinted",
8758
10681
  "kind": "struct",
8759
10682
  "members": [
8760
10683
  {
8761
- "name": "offer_id",
10684
+ "name": "token_id",
8762
10685
  "type": "core::integer::u256",
8763
10686
  "kind": "key"
8764
10687
  },
8765
10688
  {
8766
- "name": "license_id",
8767
- "type": "core::integer::u256",
10689
+ "name": "recipient",
10690
+ "type": "core::starknet::contract_address::ContractAddress",
8768
10691
  "kind": "key"
8769
10692
  },
8770
10693
  {
8771
- "name": "sponsor",
10694
+ "name": "author",
8772
10695
  "type": "core::starknet::contract_address::ContractAddress",
8773
10696
  "kind": "key"
8774
10697
  },
8775
10698
  {
8776
- "name": "author",
10699
+ "name": "asset_contract",
8777
10700
  "type": "core::starknet::contract_address::ContractAddress",
8778
10701
  "kind": "data"
8779
10702
  },
8780
10703
  {
8781
- "name": "amount",
10704
+ "name": "asset_token_id",
8782
10705
  "type": "core::integer::u256",
8783
10706
  "kind": "data"
8784
10707
  },
@@ -8786,31 +10709,24 @@ var IPSponsorshipABI = [
8786
10709
  "name": "expires_at",
8787
10710
  "type": "core::integer::u64",
8788
10711
  "kind": "data"
8789
- }
8790
- ]
8791
- },
8792
- {
8793
- "type": "event",
8794
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseTransferred",
8795
- "kind": "struct",
8796
- "members": [
10712
+ },
8797
10713
  {
8798
- "name": "license_id",
8799
- "type": "core::integer::u256",
8800
- "kind": "key"
10714
+ "name": "transferable",
10715
+ "type": "core::bool",
10716
+ "kind": "data"
8801
10717
  },
8802
10718
  {
8803
- "name": "from",
8804
- "type": "core::starknet::contract_address::ContractAddress",
8805
- "kind": "key"
10719
+ "name": "royalty_bps",
10720
+ "type": "core::integer::u256",
10721
+ "kind": "data"
8806
10722
  },
8807
10723
  {
8808
- "name": "to",
8809
- "type": "core::starknet::contract_address::ContractAddress",
8810
- "kind": "key"
10724
+ "name": "license_terms_uri",
10725
+ "type": "core::byte_array::ByteArray",
10726
+ "kind": "data"
8811
10727
  },
8812
10728
  {
8813
- "name": "transferred_at",
10729
+ "name": "minted_at",
8814
10730
  "type": "core::integer::u64",
8815
10731
  "kind": "data"
8816
10732
  }
@@ -8818,42 +10734,22 @@ var IPSponsorshipABI = [
8818
10734
  },
8819
10735
  {
8820
10736
  "type": "event",
8821
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::Event",
10737
+ "name": "ip_sponsorship::IPSponsorshipLicense::IPSponsorshipLicense::Event",
8822
10738
  "kind": "enum",
8823
10739
  "variants": [
8824
10740
  {
8825
- "name": "SRC5Event",
8826
- "type": "openzeppelin_introspection::src5::SRC5Component::Event",
10741
+ "name": "ERC721Event",
10742
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
8827
10743
  "kind": "flat"
8828
10744
  },
8829
10745
  {
8830
- "name": "OfferCreated",
8831
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
8832
- "kind": "nested"
8833
- },
8834
- {
8835
- "name": "OfferStatusUpdated",
8836
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
8837
- "kind": "nested"
8838
- },
8839
- {
8840
- "name": "BidPlaced",
8841
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
8842
- "kind": "nested"
8843
- },
8844
- {
8845
- "name": "BidRetracted",
8846
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
8847
- "kind": "nested"
8848
- },
8849
- {
8850
- "name": "SponsorshipAccepted",
8851
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
8852
- "kind": "nested"
10746
+ "name": "SRC5Event",
10747
+ "type": "openzeppelin_introspection::src5::SRC5Component::Event",
10748
+ "kind": "flat"
8853
10749
  },
8854
10750
  {
8855
- "name": "LicenseTransferred",
8856
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseTransferred",
10751
+ "name": "LicenseMinted",
10752
+ "type": "ip_sponsorship::IPSponsorshipLicense::IPSponsorshipLicense::LicenseMinted",
8857
10753
  "kind": "nested"
8858
10754
  }
8859
10755
  ]
@@ -9741,115 +11637,27 @@ function toSignatureArray(sig) {
9741
11637
  return [s.r.toString(), s.s.toString()];
9742
11638
  }
9743
11639
  function getChainId(config) {
9744
- if (config.chain !== "STARKNET") {
9745
- throw new Error(`SNIP-12 signing is Starknet-only; got chain "${config.chain}"`);
9746
- }
9747
- return starknet.constants.StarknetChainId.SN_MAIN;
9748
- }
9749
- function resolveToken(currency) {
9750
- const token = SUPPORTED_TOKENS.find(
9751
- (t) => t.symbol === currency.toUpperCase() || t.address.toLowerCase() === currency.toLowerCase()
9752
- );
9753
- if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
9754
- return token;
9755
- }
9756
- var _providerCache = /* @__PURE__ */ new WeakMap();
9757
- function getProvider(config) {
9758
- let p = _providerCache.get(config);
9759
- if (!p) {
9760
- const urls = Array.from(/* @__PURE__ */ new Set([config.rpcUrl, ...PUBLIC_RPC_FALLBACKS]));
9761
- p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: createFailoverFetch(urls) });
9762
- _providerCache.set(config, p);
9763
- }
9764
- return p;
9765
- }
9766
-
9767
- // src/starknet/marketplace/build.ts
9768
- function contractFor(cfg) {
9769
- return new starknet.Contract(IPMarketplaceABI, cfg.marketplaceContract, getProvider(cfg));
9770
- }
9771
- function buildListingOrder(i, cfg) {
9772
- const orderParams = {
9773
- offerer: i.offerer,
9774
- marketplace: cfg.marketplaceContract,
9775
- offer: { item_type: "ERC721", token: i.nftContract, identifier_or_criteria: i.tokenId, amount: "1" },
9776
- consideration: {
9777
- item_type: "ERC20",
9778
- token: i.paymentTokenAddress,
9779
- identifier_or_criteria: "0",
9780
- amount: i.priceWei,
9781
- recipient: i.offerer
9782
- },
9783
- royalty_max_bps: i.royaltyMaxBps,
9784
- start_time: String(i.startTime),
9785
- end_time: String(i.endTime),
9786
- salt: i.salt,
9787
- counter: i.counter
9788
- };
9789
- const typedData = stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
9790
- return { orderParams, typedData };
9791
- }
9792
- function buildOfferOrder(i, cfg) {
9793
- const orderParams = {
9794
- offerer: i.offerer,
9795
- marketplace: cfg.marketplaceContract,
9796
- offer: { item_type: "ERC20", token: i.paymentTokenAddress, identifier_or_criteria: "0", amount: i.priceWei },
9797
- consideration: {
9798
- item_type: "ERC721",
9799
- token: i.nftContract,
9800
- identifier_or_criteria: i.tokenId,
9801
- amount: "1",
9802
- recipient: i.offerer
9803
- },
9804
- royalty_max_bps: i.royaltyMaxBps,
9805
- start_time: String(i.startTime),
9806
- end_time: String(i.endTime),
9807
- salt: i.salt,
9808
- counter: i.counter
9809
- };
9810
- const typedData = stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
9811
- return { orderParams, typedData };
9812
- }
9813
- function registerPayload(orderParams, signature) {
9814
- return stringifyBigInts({
9815
- parameters: {
9816
- ...orderParams,
9817
- offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
9818
- consideration: {
9819
- ...orderParams.consideration,
9820
- item_type: starknet.shortString.encodeShortString(orderParams.consideration.item_type)
9821
- }
9822
- },
9823
- signature
9824
- });
9825
- }
9826
- function buildRegisterCalls(a, cfg) {
9827
- const registerCall = contractFor(cfg).populate("register_order", [registerPayload(a.orderParams, a.signature)]);
9828
- return a.approvalNeeded ? [a.approve, registerCall] : [registerCall];
11640
+ if (config.chain !== "STARKNET") {
11641
+ throw new Error(`SNIP-12 signing is Starknet-only; got chain "${config.chain}"`);
11642
+ }
11643
+ return starknet.constants.StarknetChainId.SN_MAIN;
9829
11644
  }
9830
- function buildFulfillCalls(a, cfg) {
9831
- const u = starknet.cairo.uint256(a.totalPrice);
9832
- const approve = {
9833
- contractAddress: a.paymentToken,
9834
- entrypoint: "approve",
9835
- calldata: [cfg.marketplaceContract, u.low.toString(), u.high.toString()]
9836
- };
9837
- const fulfill = contractFor(cfg).populate("fulfill_order", [a.orderHash]);
9838
- const fee = buildFeeCall(
9839
- { surface: "marketplace", token: a.paymentToken, grossAmount: BigInt(a.totalPrice) },
9840
- cfg.feeConfig
11645
+ function resolveToken(currency) {
11646
+ const token = SUPPORTED_TOKENS.find(
11647
+ (t) => t.symbol === currency.toUpperCase() || t.address.toLowerCase() === currency.toLowerCase()
9841
11648
  );
9842
- return fee ? [approve, fulfill, fee] : [approve, fulfill];
9843
- }
9844
- function buildCancelCalls(a, cfg) {
9845
- const cancelRequest = stringifyBigInts({
9846
- cancelation: { order_hash: a.orderHash, offerer: a.offerer },
9847
- signature: a.signature
9848
- });
9849
- return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
11649
+ if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
11650
+ return token;
9850
11651
  }
9851
- function buildCancelTypedData(orderHash, offerer, cfg) {
9852
- return stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
11652
+ var _providerCache = /* @__PURE__ */ new WeakMap();
11653
+ function getProvider(config) {
11654
+ let p = _providerCache.get(config);
11655
+ if (!p) {
11656
+ const urls = Array.from(/* @__PURE__ */ new Set([config.rpcUrl, ...PUBLIC_RPC_FALLBACKS]));
11657
+ p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: createFailoverFetch(urls) });
11658
+ _providerCache.set(config, p);
11659
+ }
11660
+ return p;
9853
11661
  }
9854
11662
 
9855
11663
  // src/starknet/marketplace/orders.ts
@@ -9876,22 +11684,46 @@ async function createListing(account, params, config) {
9876
11684
  const endTime = now + durationSeconds;
9877
11685
  const counter = (await contract.get_counter(account.address)).toString();
9878
11686
  const royaltyMaxBps = await resolveRoyaltyMaxBps(provider, nftContract, tokenId, params.royaltyMaxBps);
9879
- const { orderParams, typedData } = buildListingOrder(
9880
- {
9881
- offerer: account.address,
9882
- nftContract,
9883
- tokenId,
9884
- priceWei,
9885
- paymentTokenAddress: token.address,
9886
- royaltyMaxBps,
9887
- startTime,
9888
- endTime,
9889
- salt: generateSalt(),
9890
- counter
11687
+ const orderParams = {
11688
+ offerer: account.address,
11689
+ marketplace: config.marketplaceContract,
11690
+ offer: {
11691
+ item_type: "ERC721",
11692
+ token: nftContract,
11693
+ identifier_or_criteria: tokenId,
11694
+ amount: "1"
9891
11695
  },
9892
- config
9893
- );
9894
- const signatureArray = toSignatureArray(await account.signMessage(typedData));
11696
+ consideration: {
11697
+ item_type: "ERC20",
11698
+ token: token.address,
11699
+ identifier_or_criteria: "0",
11700
+ amount: priceWei,
11701
+ recipient: account.address
11702
+ },
11703
+ royalty_max_bps: royaltyMaxBps,
11704
+ start_time: startTime.toString(),
11705
+ end_time: endTime.toString(),
11706
+ salt: generateSalt(),
11707
+ counter
11708
+ };
11709
+ const chainId = getChainId(config);
11710
+ const typedData = stringifyBigInts(buildOrderTypedData(orderParams, chainId));
11711
+ const signature = await account.signMessage(typedData);
11712
+ const signatureArray = toSignatureArray(signature);
11713
+ const registerPayload = stringifyBigInts({
11714
+ parameters: {
11715
+ ...orderParams,
11716
+ offer: {
11717
+ ...orderParams.offer,
11718
+ item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type)
11719
+ },
11720
+ consideration: {
11721
+ ...orderParams.consideration,
11722
+ item_type: starknet.shortString.encodeShortString(orderParams.consideration.item_type)
11723
+ }
11724
+ },
11725
+ signature: signatureArray
11726
+ });
9895
11727
  const tokenIdUint256 = starknet.cairo.uint256(tokenId);
9896
11728
  let isAlreadyApproved = false;
9897
11729
  try {
@@ -9903,19 +11735,19 @@ async function createListing(account, params, config) {
9903
11735
  isAlreadyApproved = BigInt(result[0]).toString() === BigInt(config.marketplaceContract).toString();
9904
11736
  } catch {
9905
11737
  }
9906
- const approve = {
9907
- contractAddress: nftContract,
9908
- entrypoint: "approve",
9909
- calldata: [
9910
- config.marketplaceContract,
9911
- tokenIdUint256.low.toString(),
9912
- tokenIdUint256.high.toString()
9913
- ]
9914
- };
9915
- const calls = buildRegisterCalls(
9916
- { orderParams, signature: signatureArray, approvalNeeded: !isAlreadyApproved, approve },
9917
- config
9918
- );
11738
+ const registerCall = contract.populate("register_order", [registerPayload]);
11739
+ const calls = isAlreadyApproved ? [registerCall] : [
11740
+ {
11741
+ contractAddress: nftContract,
11742
+ entrypoint: "approve",
11743
+ calldata: [
11744
+ config.marketplaceContract,
11745
+ tokenIdUint256.low.toString(),
11746
+ tokenIdUint256.high.toString()
11747
+ ]
11748
+ },
11749
+ registerCall
11750
+ ];
9919
11751
  try {
9920
11752
  const tx = await account.execute(calls);
9921
11753
  await provider.waitForTransaction(tx.transaction_hash);
@@ -9934,22 +11766,46 @@ async function makeOffer(account, params, config) {
9934
11766
  const endTime = now + durationSeconds;
9935
11767
  const counter = (await contract.get_counter(account.address)).toString();
9936
11768
  const royaltyMaxBps = await resolveRoyaltyMaxBps(provider, nftContract, tokenId, params.royaltyMaxBps);
9937
- const { orderParams, typedData } = buildOfferOrder(
9938
- {
9939
- offerer: account.address,
9940
- nftContract,
9941
- tokenId,
9942
- priceWei,
9943
- paymentTokenAddress: token.address,
9944
- royaltyMaxBps,
9945
- startTime,
9946
- endTime,
9947
- salt: generateSalt(),
9948
- counter
11769
+ const orderParams = {
11770
+ offerer: account.address,
11771
+ marketplace: config.marketplaceContract,
11772
+ offer: {
11773
+ item_type: "ERC20",
11774
+ token: token.address,
11775
+ identifier_or_criteria: "0",
11776
+ amount: priceWei
9949
11777
  },
9950
- config
9951
- );
9952
- const signatureArray = toSignatureArray(await account.signMessage(typedData));
11778
+ consideration: {
11779
+ item_type: "ERC721",
11780
+ token: nftContract,
11781
+ identifier_or_criteria: tokenId,
11782
+ amount: "1",
11783
+ recipient: account.address
11784
+ },
11785
+ royalty_max_bps: royaltyMaxBps,
11786
+ start_time: startTime.toString(),
11787
+ end_time: endTime.toString(),
11788
+ salt: generateSalt(),
11789
+ counter
11790
+ };
11791
+ const chainId = getChainId(config);
11792
+ const typedData = stringifyBigInts(buildOrderTypedData(orderParams, chainId));
11793
+ const signature = await account.signMessage(typedData);
11794
+ const signatureArray = toSignatureArray(signature);
11795
+ const registerPayload = stringifyBigInts({
11796
+ parameters: {
11797
+ ...orderParams,
11798
+ offer: {
11799
+ ...orderParams.offer,
11800
+ item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type)
11801
+ },
11802
+ consideration: {
11803
+ ...orderParams.consideration,
11804
+ item_type: starknet.shortString.encodeShortString(orderParams.consideration.item_type)
11805
+ }
11806
+ },
11807
+ signature: signatureArray
11808
+ });
9953
11809
  const amountUint256 = starknet.cairo.uint256(priceWei);
9954
11810
  const approveCall = {
9955
11811
  contractAddress: token.address,
@@ -9960,12 +11816,9 @@ async function makeOffer(account, params, config) {
9960
11816
  amountUint256.high.toString()
9961
11817
  ]
9962
11818
  };
9963
- const calls = buildRegisterCalls(
9964
- { orderParams, signature: signatureArray, approvalNeeded: true, approve: approveCall },
9965
- config
9966
- );
11819
+ const registerCall = contract.populate("register_order", [registerPayload]);
9967
11820
  try {
9968
- const tx = await account.execute(calls);
11821
+ const tx = await account.execute([approveCall, registerCall]);
9969
11822
  await provider.waitForTransaction(tx.transaction_hash);
9970
11823
  return { txHash: tx.transaction_hash };
9971
11824
  } catch (err) {
@@ -9974,8 +11827,23 @@ async function makeOffer(account, params, config) {
9974
11827
  }
9975
11828
  async function fulfillOrder(account, params, config) {
9976
11829
  const { orderHash, paymentToken, totalPrice } = params;
9977
- const { provider } = makeContract(config);
9978
- const calls = buildFulfillCalls({ orderHash, paymentToken, totalPrice }, config);
11830
+ const { contract, provider } = makeContract(config);
11831
+ const totalPriceU256 = starknet.cairo.uint256(totalPrice);
11832
+ const approveCall = {
11833
+ contractAddress: paymentToken,
11834
+ entrypoint: "approve",
11835
+ calldata: [
11836
+ config.marketplaceContract,
11837
+ totalPriceU256.low.toString(),
11838
+ totalPriceU256.high.toString()
11839
+ ]
11840
+ };
11841
+ const fulfillCall = contract.populate("fulfill_order", [orderHash]);
11842
+ const feeCall = buildFeeCall(
11843
+ { surface: "marketplace", token: paymentToken, grossAmount: BigInt(totalPrice) },
11844
+ config.feeConfig
11845
+ );
11846
+ const calls = feeCall ? [approveCall, fulfillCall, feeCall] : [approveCall, fulfillCall];
9979
11847
  try {
9980
11848
  const tx = await account.execute(calls);
9981
11849
  await provider.waitForTransaction(tx.transaction_hash);
@@ -9986,12 +11854,24 @@ async function fulfillOrder(account, params, config) {
9986
11854
  }
9987
11855
  async function cancelOrder(account, params, config) {
9988
11856
  const { orderHash } = params;
9989
- const { provider } = makeContract(config);
9990
- const typedData = buildCancelTypedData(orderHash, account.address, config);
9991
- const signatureArray = toSignatureArray(await account.signMessage(typedData));
9992
- const calls = buildCancelCalls({ orderHash, offerer: account.address, signature: signatureArray }, config);
11857
+ const { contract, provider } = makeContract(config);
11858
+ const chainId = getChainId(config);
11859
+ const cancelParams = {
11860
+ order_hash: orderHash,
11861
+ offerer: account.address
11862
+ };
11863
+ const typedData = stringifyBigInts(
11864
+ buildCancellationTypedData(cancelParams, chainId)
11865
+ );
11866
+ const signature = await account.signMessage(typedData);
11867
+ const signatureArray = toSignatureArray(signature);
11868
+ const cancelRequest = stringifyBigInts({
11869
+ cancelation: cancelParams,
11870
+ signature: signatureArray
11871
+ });
11872
+ const call = contract.populate("cancel_order", [cancelRequest]);
9993
11873
  try {
9994
- const tx = await account.execute(calls);
11874
+ const tx = await account.execute(call);
9995
11875
  await provider.waitForTransaction(tx.transaction_hash);
9996
11876
  return { txHash: tx.transaction_hash };
9997
11877
  } catch (err) {
@@ -10138,100 +12018,6 @@ var MarketplaceModule = class {
10138
12018
  return buildCancellationTypedData(params, chainId);
10139
12019
  }
10140
12020
  };
10141
- function contractFor2(cfg) {
10142
- return new starknet.Contract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
10143
- }
10144
- function buildListing1155Order(i, cfg) {
10145
- const orderParams = {
10146
- offerer: i.offerer,
10147
- marketplace: cfg.marketplace1155Contract,
10148
- offer: { item_type: "ERC1155", token: i.nftContract, identifier_or_criteria: i.tokenId, amount: i.quantity },
10149
- consideration: {
10150
- item_type: "ERC20",
10151
- token: i.paymentTokenAddress,
10152
- identifier_or_criteria: "0",
10153
- amount: i.priceWeiPerUnit,
10154
- recipient: i.offerer
10155
- },
10156
- royalty_max_bps: i.royaltyMaxBps,
10157
- start_time: String(i.startTime),
10158
- end_time: String(i.endTime),
10159
- salt: i.salt,
10160
- counter: i.counter
10161
- };
10162
- const typedData = stringifyBigInts(
10163
- build1155OrderTypedData(orderParams, getChainId(cfg))
10164
- );
10165
- return { orderParams, typedData };
10166
- }
10167
- function buildOffer1155Order(i, cfg) {
10168
- const orderParams = {
10169
- offerer: i.offerer,
10170
- marketplace: cfg.marketplace1155Contract,
10171
- offer: { item_type: "ERC20", token: i.paymentTokenAddress, identifier_or_criteria: "0", amount: i.priceWeiPerUnit },
10172
- consideration: {
10173
- item_type: "ERC1155",
10174
- token: i.nftContract,
10175
- identifier_or_criteria: i.tokenId,
10176
- amount: i.quantity,
10177
- recipient: i.offerer
10178
- },
10179
- royalty_max_bps: i.royaltyMaxBps,
10180
- start_time: String(i.startTime),
10181
- end_time: String(i.endTime),
10182
- salt: i.salt,
10183
- counter: i.counter
10184
- };
10185
- const typedData = stringifyBigInts(
10186
- build1155OrderTypedData(orderParams, getChainId(cfg))
10187
- );
10188
- return { orderParams, typedData };
10189
- }
10190
- function registerPayload2(orderParams, signature) {
10191
- return stringifyBigInts({
10192
- parameters: {
10193
- ...orderParams,
10194
- offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
10195
- consideration: {
10196
- ...orderParams.consideration,
10197
- item_type: starknet.shortString.encodeShortString(orderParams.consideration.item_type)
10198
- }
10199
- },
10200
- signature
10201
- });
10202
- }
10203
- function buildRegister1155Calls(a, cfg) {
10204
- const registerCall = contractFor2(cfg).populate("register_order", [registerPayload2(a.orderParams, a.signature)]);
10205
- return a.approvalNeeded ? [a.approve, registerCall] : [registerCall];
10206
- }
10207
- function buildFulfill1155Calls(a, cfg) {
10208
- const u = starknet.cairo.uint256(a.totalPrice);
10209
- const approve = {
10210
- contractAddress: a.paymentToken,
10211
- entrypoint: "approve",
10212
- calldata: [cfg.marketplace1155Contract, u.low.toString(), u.high.toString()]
10213
- };
10214
- const fulfill = contractFor2(cfg).populate("fulfill_order", [a.orderHash, a.quantity]);
10215
- const fee = buildFeeCall(
10216
- { surface: "marketplace", token: a.paymentToken, grossAmount: BigInt(a.totalPrice) },
10217
- cfg.feeConfig
10218
- );
10219
- return fee ? [approve, fulfill, fee] : [approve, fulfill];
10220
- }
10221
- function buildCancel1155Calls(a, cfg) {
10222
- const cancelPayload = stringifyBigInts({
10223
- cancelation: { order_hash: a.orderHash, offerer: a.offerer },
10224
- signature: a.signature
10225
- });
10226
- return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
10227
- }
10228
- function buildCancel1155TypedData(orderHash, offerer, cfg) {
10229
- return stringifyBigInts(
10230
- build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
10231
- );
10232
- }
10233
-
10234
- // src/starknet/marketplace1155/orders.ts
10235
12021
  var _contractCache2 = /* @__PURE__ */ new WeakMap();
10236
12022
  function getContract(config) {
10237
12023
  let c = _contractCache2.get(config);
@@ -10260,27 +12046,53 @@ async function createListing1155(account, params, config) {
10260
12046
  const token = resolveToken(currency);
10261
12047
  const priceWei = parseAmount(pricePerUnit, token.decimals);
10262
12048
  const now = Math.floor(Date.now() / 1e3);
10263
- const startTime = now + START_TIME_BUFFER_SECS;
10264
12049
  const endTime = now + durationSeconds;
12050
+ const chainId = getChainId(config);
10265
12051
  const counter = (await contract.get_counter(account.address)).toString();
10266
12052
  const royaltyMaxBps = await resolveRoyaltyMaxBps(provider, nftContract, tokenId, params.royaltyMaxBps);
10267
- const { orderParams, typedData } = buildListing1155Order(
10268
- {
10269
- offerer: account.address,
10270
- nftContract,
10271
- tokenId,
10272
- quantity: amount,
10273
- priceWeiPerUnit: priceWei,
10274
- paymentTokenAddress: token.address,
10275
- royaltyMaxBps,
10276
- startTime,
10277
- endTime,
10278
- salt: generateSalt(),
10279
- counter
12053
+ const orderParams = {
12054
+ offerer: account.address,
12055
+ marketplace: config.marketplace1155Contract,
12056
+ offer: {
12057
+ item_type: "ERC1155",
12058
+ token: nftContract,
12059
+ identifier_or_criteria: tokenId,
12060
+ amount
12061
+ // ERC-1155 leg amount = unit quantity
12062
+ },
12063
+ consideration: {
12064
+ item_type: "ERC20",
12065
+ token: token.address,
12066
+ identifier_or_criteria: "0",
12067
+ amount: priceWei,
12068
+ // payment leg amount = price PER UNIT
12069
+ recipient: account.address
10280
12070
  },
10281
- config
12071
+ royalty_max_bps: royaltyMaxBps,
12072
+ start_time: (now + START_TIME_BUFFER_SECS).toString(),
12073
+ end_time: endTime.toString(),
12074
+ salt: generateSalt(),
12075
+ counter
12076
+ };
12077
+ const typedData = stringifyBigInts(
12078
+ build1155OrderTypedData(orderParams, chainId)
10282
12079
  );
10283
- const signatureArray = toSignatureArray(await account.signMessage(typedData));
12080
+ const signature = await account.signMessage(typedData);
12081
+ const signatureArray = toSignatureArray(signature);
12082
+ const orderPayload = stringifyBigInts({
12083
+ parameters: {
12084
+ ...orderParams,
12085
+ offer: {
12086
+ ...orderParams.offer,
12087
+ item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type)
12088
+ },
12089
+ consideration: {
12090
+ ...orderParams.consideration,
12091
+ item_type: starknet.shortString.encodeShortString(orderParams.consideration.item_type)
12092
+ }
12093
+ },
12094
+ signature: signatureArray
12095
+ });
10284
12096
  let isApproved = false;
10285
12097
  try {
10286
12098
  const result = await provider.callContract({
@@ -10291,15 +12103,15 @@ async function createListing1155(account, params, config) {
10291
12103
  isApproved = BigInt(result[0]) === 1n;
10292
12104
  } catch {
10293
12105
  }
10294
- const approve = {
10295
- contractAddress: nftContract,
10296
- entrypoint: "set_approval_for_all",
10297
- calldata: [config.marketplace1155Contract, "1"]
10298
- };
10299
- const calls = buildRegister1155Calls(
10300
- { orderParams, signature: signatureArray, approvalNeeded: !isApproved, approve },
10301
- config
10302
- );
12106
+ const registerCall = contract.populate("register_order", [orderPayload]);
12107
+ const calls = isApproved ? [registerCall] : [
12108
+ {
12109
+ contractAddress: nftContract,
12110
+ entrypoint: "set_approval_for_all",
12111
+ calldata: [config.marketplace1155Contract, "1"]
12112
+ },
12113
+ registerCall
12114
+ ];
10303
12115
  try {
10304
12116
  const tx = await account.execute(calls);
10305
12117
  await provider.waitForTransaction(tx.transaction_hash);
@@ -10310,10 +12122,21 @@ async function createListing1155(account, params, config) {
10310
12122
  }
10311
12123
  async function fulfillOrder1155(account, params, config) {
10312
12124
  const { orderHash, paymentToken, totalPrice, quantity = "1" } = params;
12125
+ const contract = getContract(config);
10313
12126
  const provider = getProvider(config);
10314
- const calls = buildFulfill1155Calls({ orderHash, paymentToken, totalPrice, quantity }, config);
12127
+ const totalPriceU256 = starknet.cairo.uint256(totalPrice);
12128
+ const approveCall = {
12129
+ contractAddress: paymentToken,
12130
+ entrypoint: "approve",
12131
+ calldata: [
12132
+ config.marketplace1155Contract,
12133
+ totalPriceU256.low.toString(),
12134
+ totalPriceU256.high.toString()
12135
+ ]
12136
+ };
12137
+ const fulfillCall = contract.populate("fulfill_order", [orderHash, quantity]);
10315
12138
  try {
10316
- const tx = await account.execute(calls);
12139
+ const tx = await account.execute([approveCall, fulfillCall]);
10317
12140
  await provider.waitForTransaction(tx.transaction_hash);
10318
12141
  return { txHash: tx.transaction_hash };
10319
12142
  } catch (err) {
@@ -10322,12 +12145,25 @@ async function fulfillOrder1155(account, params, config) {
10322
12145
  }
10323
12146
  async function cancelOrder1155(account, params, config) {
10324
12147
  const { orderHash } = params;
12148
+ const contract = getContract(config);
10325
12149
  const provider = getProvider(config);
10326
- const typedData = buildCancel1155TypedData(orderHash, account.address, config);
10327
- const signatureArray = toSignatureArray(await account.signMessage(typedData));
10328
- const calls = buildCancel1155Calls({ orderHash, offerer: account.address, signature: signatureArray }, config);
12150
+ const chainId = getChainId(config);
12151
+ const cancelParams = {
12152
+ order_hash: orderHash,
12153
+ offerer: account.address
12154
+ };
12155
+ const typedData = stringifyBigInts(
12156
+ build1155CancellationTypedData(cancelParams, chainId)
12157
+ );
12158
+ const signature = await account.signMessage(typedData);
12159
+ const signatureArray = toSignatureArray(signature);
12160
+ const cancelPayload = stringifyBigInts({
12161
+ cancelation: cancelParams,
12162
+ signature: signatureArray
12163
+ });
12164
+ const cancelCall = contract.populate("cancel_order", [cancelPayload]);
10329
12165
  try {
10330
- const tx = await account.execute(calls);
12166
+ const tx = await account.execute(cancelCall);
10331
12167
  await provider.waitForTransaction(tx.transaction_hash);
10332
12168
  return { txHash: tx.transaction_hash };
10333
12169
  } catch (err) {
@@ -10345,30 +12181,56 @@ async function makeOffer1155(account, params, config) {
10345
12181
  } = params;
10346
12182
  const contract = getContract(config);
10347
12183
  const provider = getProvider(config);
12184
+ const chainId = getChainId(config);
10348
12185
  const token = resolveToken(currency);
10349
12186
  const priceWei = parseAmount(price, token.decimals);
10350
12187
  const now = Math.floor(Date.now() / 1e3);
10351
- const startTime = now + START_TIME_BUFFER_SECS;
10352
12188
  const endTime = now + durationSeconds;
10353
12189
  const counter = (await contract.get_counter(account.address)).toString();
10354
12190
  const royaltyMaxBps = await resolveRoyaltyMaxBps(provider, nftContract, tokenId, params.royaltyMaxBps);
10355
- const { orderParams, typedData } = buildOffer1155Order(
10356
- {
10357
- offerer: account.address,
10358
- nftContract,
10359
- tokenId,
10360
- quantity: amount,
10361
- priceWeiPerUnit: priceWei,
10362
- paymentTokenAddress: token.address,
10363
- royaltyMaxBps,
10364
- startTime,
10365
- endTime,
10366
- salt: generateSalt(),
10367
- counter
12191
+ const orderParams = {
12192
+ offerer: account.address,
12193
+ marketplace: config.marketplace1155Contract,
12194
+ offer: {
12195
+ item_type: "ERC20",
12196
+ token: token.address,
12197
+ identifier_or_criteria: "0",
12198
+ amount: priceWei
12199
+ // price PER UNIT
12200
+ },
12201
+ consideration: {
12202
+ item_type: "ERC1155",
12203
+ token: nftContract,
12204
+ identifier_or_criteria: tokenId,
12205
+ amount,
12206
+ // unit quantity
12207
+ recipient: account.address
10368
12208
  },
10369
- config
12209
+ royalty_max_bps: royaltyMaxBps,
12210
+ start_time: (now + START_TIME_BUFFER_SECS).toString(),
12211
+ end_time: endTime.toString(),
12212
+ salt: generateSalt(),
12213
+ counter
12214
+ };
12215
+ const typedData = stringifyBigInts(
12216
+ build1155OrderTypedData(orderParams, chainId)
10370
12217
  );
10371
- const signatureArray = toSignatureArray(await account.signMessage(typedData));
12218
+ const signature = await account.signMessage(typedData);
12219
+ const signatureArray = toSignatureArray(signature);
12220
+ const registerPayload = stringifyBigInts({
12221
+ parameters: {
12222
+ ...orderParams,
12223
+ offer: {
12224
+ ...orderParams.offer,
12225
+ item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type)
12226
+ },
12227
+ consideration: {
12228
+ ...orderParams.consideration,
12229
+ item_type: starknet.shortString.encodeShortString(orderParams.consideration.item_type)
12230
+ }
12231
+ },
12232
+ signature: signatureArray
12233
+ });
10372
12234
  const totalWei = BigInt(priceWei) * BigInt(amount);
10373
12235
  const amountU256 = starknet.cairo.uint256(totalWei.toString());
10374
12236
  const approveCall = {
@@ -10380,12 +12242,9 @@ async function makeOffer1155(account, params, config) {
10380
12242
  amountU256.high.toString()
10381
12243
  ]
10382
12244
  };
10383
- const calls = buildRegister1155Calls(
10384
- { orderParams, signature: signatureArray, approvalNeeded: true, approve: approveCall },
10385
- config
10386
- );
12245
+ const registerCall = contract.populate("register_order", [registerPayload]);
10387
12246
  try {
10388
- const tx = await account.execute(calls);
12247
+ const tx = await account.execute([approveCall, registerCall]);
10389
12248
  await provider.waitForTransaction(tx.transaction_hash);
10390
12249
  return { txHash: tx.transaction_hash };
10391
12250
  } catch (err) {
@@ -10980,16 +12839,72 @@ var TicketService = class {
10980
12839
  };
10981
12840
  var ClubService = class {
10982
12841
  constructor(config) {
10983
- this.registryAddress = getStarknetCoordinates(config.chain).ipClubRegistry;
12842
+ const coords = getStarknetCoordinates(config.chain);
12843
+ this.registryAddress = coords.ipClubRegistry;
12844
+ this.factoryAddress = coords.ipClubFactory;
10984
12845
  }
10985
12846
  _registry(account, registryAddress) {
10986
12847
  const address = registryAddress ?? this.registryAddress;
10987
- if (!address) {
10988
- throw new Error("IP-Club registry address not configured for this chain");
10989
- }
12848
+ if (!address) throw new Error("IP-Club registry address not configured for this chain");
10990
12849
  return new starknet.Contract(IPClubABI, normalizeAddress("STARKNET", address), account);
10991
12850
  }
10992
- /** Permissionless — anyone may create a club. The registry deploys its own membership NFT internally. */
12851
+ _factory(account, factoryAddress) {
12852
+ const address = factoryAddress ?? this.factoryAddress;
12853
+ if (!address) throw new Error("IP-Club factory address not configured for this chain");
12854
+ return new starknet.Contract(IPClubFactoryABI, normalizeAddress("STARKNET", address), account);
12855
+ }
12856
+ _collection(account, collectionAddress) {
12857
+ return new starknet.Contract(IPClubCollectionABI, normalizeAddress("STARKNET", collectionAddress), account);
12858
+ }
12859
+ /** Deploy a new per-creator membership ERC-721 collection via the factory. */
12860
+ async deployClub(account, params) {
12861
+ const maxSupply = starknet.cairo.uint256(params.maxSupply ?? 0xffffffffffffffffn);
12862
+ const entryFee = starknet.cairo.uint256(params.entryFee ?? 0n);
12863
+ const paymentToken = params.paymentToken ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.paymentToken) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
12864
+ const royaltyBps = starknet.cairo.uint256(params.royaltyBps ?? 0n);
12865
+ const call = this._factory(account, params.factoryAddress).populate("deploy_club", [
12866
+ params.name,
12867
+ params.symbol,
12868
+ params.baseUri,
12869
+ maxSupply,
12870
+ entryFee,
12871
+ paymentToken,
12872
+ royaltyBps
12873
+ ]);
12874
+ const res = await account.execute([call]);
12875
+ return { txHash: res.transaction_hash };
12876
+ }
12877
+ /** Owner-only — pause or resume new mints on a club collection. */
12878
+ async setOpen(account, params) {
12879
+ const call = this._collection(account, params.collectionAddress).populate("set_open", [params.open]);
12880
+ const res = await account.execute([call]);
12881
+ return { txHash: res.transaction_hash };
12882
+ }
12883
+ /** Public mint — caller pays entry fee (if any) and receives the membership NFT. */
12884
+ async mintMembership(account, params) {
12885
+ const calls = [];
12886
+ if (params.entryFee && params.paymentToken && BigInt(params.entryFee) > 0n) {
12887
+ const amount = starknet.cairo.uint256(params.entryFee);
12888
+ calls.push({
12889
+ contractAddress: params.paymentToken,
12890
+ entrypoint: "approve",
12891
+ calldata: [
12892
+ normalizeAddress("STARKNET", params.collectionAddress),
12893
+ amount.low.toString(),
12894
+ amount.high.toString()
12895
+ ]
12896
+ });
12897
+ }
12898
+ calls.push(
12899
+ this._collection(account, params.collectionAddress).populate("mint", [
12900
+ params.to ?? account.address
12901
+ ])
12902
+ );
12903
+ const res = await account.execute(calls);
12904
+ return { txHash: res.transaction_hash };
12905
+ }
12906
+ // ── Legacy registry methods (retained for backward compatibility) ──────────────
12907
+ /** @deprecated Use deployClub — the factory pattern replaced the registry. */
10993
12908
  async createClub(account, params) {
10994
12909
  const maxMembers = params.maxMembers != null ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.maxMembers) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
10995
12910
  const entryFee = params.entryFee != null ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, starknet.cairo.uint256(params.entryFee)) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
@@ -11005,7 +12920,7 @@ var ClubService = class {
11005
12920
  const res = await account.execute([call]);
11006
12921
  return { txHash: res.transaction_hash };
11007
12922
  }
11008
- /** Reversible gates new joins only; existing members are never affected. */
12923
+ /** @deprecated Legacy registry use factory-deployed collection methods. */
11009
12924
  async setClubOpen(account, params) {
11010
12925
  const call = this._registry(account, params.registryAddress).populate("set_club_open", [
11011
12926
  starknet.cairo.uint256(params.clubId),
@@ -11014,12 +12929,10 @@ var ClubService = class {
11014
12929
  const res = await account.execute([call]);
11015
12930
  return { txHash: res.transaction_hash };
11016
12931
  }
11017
- /** Prepends an ERC-20 approve when the club has an entry fee. */
12932
+ /** @deprecated Legacy registry use mintMembership with factory-deployed collections. */
11018
12933
  async joinClub(account, params) {
11019
12934
  const registryAddress = params.registryAddress ?? this.registryAddress;
11020
- if (!registryAddress) {
11021
- throw new Error("IP-Club registry address not configured for this chain");
11022
- }
12935
+ if (!registryAddress) throw new Error("IP-Club registry address not configured for this chain");
11023
12936
  const calls = [];
11024
12937
  if (params.paymentToken && params.entryFee && BigInt(params.entryFee) > 0n) {
11025
12938
  const amount = starknet.cairo.uint256(params.entryFee);
@@ -11033,7 +12946,7 @@ var ClubService = class {
11033
12946
  const res = await account.execute(calls);
11034
12947
  return { txHash: res.transaction_hash };
11035
12948
  }
11036
- /** Always allowed, open or closed. No fee refund. Burns the caller's membership NFT. */
12949
+ /** @deprecated Legacy registry use factory-deployed collection burn. */
11037
12950
  async leaveClub(account, params) {
11038
12951
  const call = this._registry(account, params.registryAddress).populate("leave_club", [
11039
12952
  starknet.cairo.uint256(params.clubId),
@@ -11203,147 +13116,94 @@ var StarknetVenue = class {
11203
13116
  constructor(deps) {
11204
13117
  this.deps = deps;
11205
13118
  this.chain = "STARKNET";
13119
+ this.m721 = new MarketplaceModule(deps.config);
13120
+ this.m1155 = new Medialane1155Module(deps.config);
11206
13121
  }
11207
- async incrementCounter(signer) {
11208
- return signer.execute([
11209
- { contractAddress: this.deps.config.marketplaceContract, entrypoint: "increment_counter", calldata: [] }
11210
- ]);
13122
+ incrementCounter(signer) {
13123
+ return this.m721.incrementCounter(signer);
11211
13124
  }
11212
13125
  getOrderDetails(orderRef) {
11213
- return getOrderDetails(orderRef, this.deps.config);
13126
+ return this.m721.getOrderDetails(orderRef);
11214
13127
  }
11215
- async getCounter(address) {
11216
- return this.readCounter(this.deps.config.marketplaceContract, address);
13128
+ getCounter(address) {
13129
+ return this.m721.getCounter(address);
11217
13130
  }
11218
13131
  async fulfillOrder(signer, orderRef, opts) {
11219
13132
  const o = await this.deps.resolveOrder(orderRef);
11220
13133
  const quantity = opts?.quantity ?? "1";
11221
13134
  const totalPrice = (BigInt(o.unitPrice) * BigInt(quantity)).toString();
11222
- const calls = o.standard === "ERC1155" ? buildFulfill1155Calls({ orderHash: orderRef, paymentToken: o.paymentToken, totalPrice, quantity }, this.deps.config) : buildFulfillCalls({ orderHash: orderRef, paymentToken: o.paymentToken, totalPrice }, this.deps.config);
11223
- return signer.execute(calls);
13135
+ if (o.standard === "ERC1155") {
13136
+ return this.m1155.fulfillOrder(signer, {
13137
+ orderHash: orderRef,
13138
+ paymentToken: o.paymentToken,
13139
+ totalPrice,
13140
+ quantity
13141
+ });
13142
+ }
13143
+ return this.m721.fulfillOrder(signer, {
13144
+ orderHash: orderRef,
13145
+ paymentToken: o.paymentToken,
13146
+ totalPrice
13147
+ });
11224
13148
  }
11225
13149
  async cancelOrder(signer, orderRef) {
11226
13150
  const o = await this.deps.resolveOrder(orderRef);
11227
- const typedData = o.standard === "ERC1155" ? buildCancel1155TypedData(orderRef, signer.address, this.deps.config) : buildCancelTypedData(orderRef, signer.address, this.deps.config);
11228
- const signature = await signer.signTypedData(typedData);
11229
- const calls = o.standard === "ERC1155" ? buildCancel1155Calls({ orderHash: orderRef, offerer: signer.address, signature }, this.deps.config) : buildCancelCalls({ orderHash: orderRef, offerer: signer.address, signature }, this.deps.config);
11230
- return signer.execute(calls);
13151
+ if (o.standard === "ERC1155") {
13152
+ return this.m1155.cancelOrder(signer, { orderHash: orderRef });
13153
+ }
13154
+ return this.m721.cancelOrder(signer, { orderHash: orderRef });
11231
13155
  }
11232
13156
  async registerOrder(signer, p) {
11233
13157
  const standard = await this.deps.resolveStandard(p.asset.contract);
11234
- const paymentTokenAddress = resolveToken(p.paymentToken).address;
13158
+ const token = resolveToken(p.paymentToken);
13159
+ const humanPrice = formatAmount(p.amount, token.decimals);
13160
+ const durationSeconds = this.durationSeconds(p.endTime);
11235
13161
  const royaltyMaxBps = String(p.royaltyMaxBps);
11236
- const startTime = Math.floor(Date.now() / 1e3) + START_TIME_BUFFER_SECS;
11237
- const endTime = p.endTime && p.endTime > 0 ? p.endTime : startTime + NO_EXPIRY_SECONDS;
11238
13162
  const quantity = p.quantity ?? "1";
11239
- const marketplace = standard === "ERC1155" ? this.deps.config.marketplace1155Contract : this.deps.config.marketplaceContract;
11240
- const counter = String(await this.readCounter(marketplace, signer.address));
11241
- let typedData;
11242
- let buildCalls;
13163
+ let txHash;
11243
13164
  if (standard === "ERC1155") {
11244
- const built = (p.side === "listing" ? buildListing1155Order : buildOffer1155Order)(
11245
- {
11246
- offerer: signer.address,
13165
+ if (p.side === "listing") {
13166
+ const res = await this.m1155.createListing(signer, {
11247
13167
  nftContract: p.asset.contract,
11248
13168
  tokenId: p.asset.tokenId,
11249
- quantity,
11250
- priceWeiPerUnit: p.amount,
11251
- paymentTokenAddress,
11252
- royaltyMaxBps,
11253
- startTime,
11254
- endTime,
11255
- salt: p.salt,
11256
- counter
11257
- },
11258
- this.deps.config
11259
- );
11260
- typedData = built.typedData;
11261
- const approval = p.side === "listing" ? await this.approval1155ForListing(signer.address, p.asset.contract) : this.approvalForErc20(paymentTokenAddress, (BigInt(p.amount) * BigInt(quantity)).toString(), marketplace);
11262
- buildCalls = (sig) => buildRegister1155Calls({ orderParams: built.orderParams, signature: sig, ...approval }, this.deps.config);
11263
- } else {
11264
- const built = (p.side === "listing" ? buildListingOrder : buildOfferOrder)(
11265
- {
11266
- offerer: signer.address,
13169
+ amount: quantity,
13170
+ pricePerUnit: humanPrice,
13171
+ currency: p.paymentToken,
13172
+ durationSeconds,
13173
+ royaltyMaxBps
13174
+ });
13175
+ txHash = res.txHash;
13176
+ } else {
13177
+ const totalHuman = formatAmount((BigInt(p.amount) * BigInt(quantity)).toString(), token.decimals);
13178
+ const res = await this.m1155.makeOffer(signer, {
11267
13179
  nftContract: p.asset.contract,
11268
13180
  tokenId: p.asset.tokenId,
11269
- priceWei: p.amount,
11270
- paymentTokenAddress,
11271
- royaltyMaxBps,
11272
- startTime,
11273
- endTime,
11274
- salt: p.salt,
11275
- counter
11276
- },
11277
- this.deps.config
11278
- );
11279
- typedData = built.typedData;
11280
- const approval = p.side === "listing" ? await this.approval721ForListing(signer.address, p.asset.contract, p.asset.tokenId) : this.approvalForErc20(paymentTokenAddress, p.amount, marketplace);
11281
- buildCalls = (sig) => buildRegisterCalls({ orderParams: built.orderParams, signature: sig, ...approval }, this.deps.config);
13181
+ amount: quantity,
13182
+ price: totalHuman,
13183
+ currency: p.paymentToken,
13184
+ durationSeconds,
13185
+ royaltyMaxBps
13186
+ });
13187
+ txHash = res.txHash;
13188
+ }
13189
+ } else {
13190
+ const params = {
13191
+ nftContract: p.asset.contract,
13192
+ tokenId: p.asset.tokenId,
13193
+ price: humanPrice,
13194
+ currency: p.paymentToken,
13195
+ durationSeconds,
13196
+ royaltyMaxBps
13197
+ };
13198
+ const res = p.side === "listing" ? await this.m721.createListing(signer, params) : await this.m721.makeOffer(signer, params);
13199
+ txHash = res.txHash;
11282
13200
  }
11283
- const signature = await signer.signTypedData(typedData);
11284
- const { txHash } = await signer.execute(buildCalls(signature));
11285
13201
  const orderRef = await this.orderRefFromReceipt(txHash);
11286
13202
  return { txHash, orderRef };
11287
13203
  }
11288
- // ─── reads (all on deps.provider) ─────────────────────────────────────────
11289
- async readCounter(marketplace, address) {
11290
- const res = await this.deps.provider.callContract({
11291
- contractAddress: marketplace,
11292
- entrypoint: "get_counter",
11293
- calldata: [address]
11294
- });
11295
- return BigInt(res[0] ?? "0");
11296
- }
11297
- /** 721 listing approval: `get_approved(tokenId) == marketplace` ⇒ no approve. */
11298
- async approval721ForListing(_owner, nftContract, tokenId) {
11299
- const id = starknet.cairo.uint256(tokenId);
11300
- const approve = {
11301
- contractAddress: nftContract,
11302
- entrypoint: "approve",
11303
- calldata: [this.deps.config.marketplaceContract, id.low.toString(), id.high.toString()]
11304
- };
11305
- let approved = false;
11306
- try {
11307
- const res = await this.deps.provider.callContract({
11308
- contractAddress: nftContract,
11309
- entrypoint: "get_approved",
11310
- calldata: [id.low.toString(), id.high.toString()]
11311
- });
11312
- approved = BigInt(res[0]).toString() === BigInt(this.deps.config.marketplaceContract).toString();
11313
- } catch {
11314
- }
11315
- return { approvalNeeded: !approved, approve };
11316
- }
11317
- /** 1155 listing approval: `is_approved_for_all(owner, marketplace)`. */
11318
- async approval1155ForListing(owner, nftContract) {
11319
- const approve = {
11320
- contractAddress: nftContract,
11321
- entrypoint: "set_approval_for_all",
11322
- calldata: [this.deps.config.marketplace1155Contract, "1"]
11323
- };
11324
- let approved = false;
11325
- try {
11326
- const res = await this.deps.provider.callContract({
11327
- contractAddress: nftContract,
11328
- entrypoint: "is_approved_for_all",
11329
- calldata: [owner, this.deps.config.marketplace1155Contract]
11330
- });
11331
- approved = BigInt(res[0]) === 1n;
11332
- } catch {
11333
- }
11334
- return { approvalNeeded: !approved, approve };
11335
- }
11336
- /** Offers always approve the ERC-20 spend (no read). */
11337
- approvalForErc20(token, amountWei, marketplace) {
11338
- const u = starknet.cairo.uint256(amountWei);
11339
- return {
11340
- approvalNeeded: true,
11341
- approve: {
11342
- contractAddress: token,
11343
- entrypoint: "approve",
11344
- calldata: [marketplace, u.low.toString(), u.high.toString()]
11345
- }
11346
- };
13204
+ durationSeconds(endTime) {
13205
+ if (!endTime) return NO_EXPIRY_SECONDS;
13206
+ return Math.max(1, endTime - Math.floor(Date.now() / 1e3));
11347
13207
  }
11348
13208
  /** The canonical Starknet order id = the contract-emitted `OrderCreated`
11349
13209
  * hash (`keys[1]`), which is exactly what the indexer stores. */
@@ -11634,6 +13494,8 @@ exports.DropService = DropService;
11634
13494
  exports.ERC1155CollectionService = ERC1155CollectionService;
11635
13495
  exports.FeeConfigSchema = FeeConfigSchema;
11636
13496
  exports.IPClubABI = IPClubABI;
13497
+ exports.IPClubCollectionABI = IPClubCollectionABI;
13498
+ exports.IPClubFactoryABI = IPClubFactoryABI;
11637
13499
  exports.IPClubNFTABI = IPClubNFTABI;
11638
13500
  exports.IPCollection1155ABI = IPCollection1155ABI;
11639
13501
  exports.IPCollection1155FactoryABI = IPCollection1155FactoryABI;
@@ -11642,6 +13504,7 @@ exports.IPGenesisABI = IPGenesisABI;
11642
13504
  exports.IPMarketplaceABI = IPMarketplaceABI;
11643
13505
  exports.IPNftABI = IPNftABI;
11644
13506
  exports.IPSponsorshipABI = IPSponsorshipABI;
13507
+ exports.IPSponsorshipLicenseABI = IPSponsorshipLicenseABI;
11645
13508
  exports.IPTicketCollectionABI = IPTicketCollectionABI;
11646
13509
  exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
11647
13510
  exports.LAUNCH_PRICE_QUOTE_PER_COIN = LAUNCH_PRICE_QUOTE_PER_COIN;
@@ -11672,6 +13535,8 @@ exports.STARKNET_DROP_FACTORY_CONTRACT = STARKNET_DROP_FACTORY_CONTRACT;
11672
13535
  exports.STARKNET_EKUBO_CORE = STARKNET_EKUBO_CORE;
11673
13536
  exports.STARKNET_IPCOLLECTION_CLASS_HASH = STARKNET_IPCOLLECTION_CLASS_HASH;
11674
13537
  exports.STARKNET_IPNFT_CLASS_HASH = STARKNET_IPNFT_CLASS_HASH;
13538
+ exports.STARKNET_IP_CLUB_COLLECTION_CLASS_HASH = STARKNET_IP_CLUB_COLLECTION_CLASS_HASH;
13539
+ exports.STARKNET_IP_CLUB_FACTORY_CONTRACT = STARKNET_IP_CLUB_FACTORY_CONTRACT;
11675
13540
  exports.STARKNET_IP_CLUB_NFT_CLASS_HASH = STARKNET_IP_CLUB_NFT_CLASS_HASH;
11676
13541
  exports.STARKNET_IP_CLUB_REGISTRY_CONTRACT = STARKNET_IP_CLUB_REGISTRY_CONTRACT;
11677
13542
  exports.STARKNET_IP_SPONSORSHIP_CONTRACT = STARKNET_IP_SPONSORSHIP_CONTRACT;