@medialane/sdk 0.66.0 → 0.68.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
@@ -44,16 +44,18 @@ var COORDINATES = {
44
44
  ipClubRegistry: "0x00e189c619b6bb07d78973a149641c59c37eb0716f8584d7520bce12d303eede",
45
45
  ipClubNftClassHash: "0x02bc9b20cca21b04245e9215bf7121f4d7295b195890e449b472b573017fb889",
46
46
  ipClubStartBlock: 11404776,
47
- ipClubFactory: "0x010726346c264d1832a7303afaf5692dbd2b05446fecc6da30d958d0227c36d0",
47
+ ipClubFactory: "0x05519705345ce225db666253a21cf89d1c675658f16cc6ae4320cefd1a1219a3",
48
48
  ipClubFactoryClassHash: "0x07197062578375d962b2d42d3e91560770b11b1c97a9defb74c706a2c5299473",
49
- ipClubCollectionClassHash: "0x049dc5e5ff00e67d5d457c6991ee70822f36a979b76cefd1b617aeccd7051d4b",
50
- ipClubFactoryStartBlock: 11652766,
51
- ipSponsorship: "0x044d9b9c3bb29b94685b0a3fe27a5e2dfa30a3637ab55979c718ebcd3268bc2f",
52
- ipSponsorshipStartBlock: 11405085,
53
- // Dedicated ip-erc721/MIP instance for sponsorship receipts (class hash
54
- // 0x01bd7e39c5135b32b664e34cbbb4eafbd707a0fbc3ec2ef28657f52577d277d7)
55
- // never the genesis-mint instance.
56
- ipSponsorshipLicense: "0x06bcfc4e97758a2abf95af4bd49596efdbfd88ccd740caddc56ad0a4bd095839"
49
+ ipClubCollectionClassHash: "0x35b8836a2269523ae9176077ec525451cce1053b2acd9fae3b05354aa4eded3",
50
+ ipClubFactoryStartBlock: 11884796,
51
+ // v3 redesign (deployed 2026-07-15): single contract is both the
52
+ // offer/bid/proposal registry and the license collection (embeds
53
+ // ERC721Component directly) no separate receipt contract, no
54
+ // set_minter bootstrap. Supersedes the 2026-07-02 v2 address, which had
55
+ // zero offers/licenses ever issued (clean cutover, no reclassification).
56
+ ipSponsorship: "0x03729ebe0fedf29ec97fca34db09174772af7f870af26a26e024a61040143e5c",
57
+ ipSponsorshipClassHash: "0x0626daac2ed7e2bf630ef5b10104b3202db1559216c0c1a504c0e99be2fbfec3",
58
+ ipSponsorshipStartBlock: 11896456
57
59
  }
58
60
  };
59
61
  function getCoordinates(chain) {
@@ -899,7 +901,7 @@ var STARKNET_IP_CLUB_NFT_CLASS_HASH = SN.ipClubNftClassHash;
899
901
  var STARKNET_IP_CLUB_FACTORY_CONTRACT = SN.ipClubFactory;
900
902
  var STARKNET_IP_CLUB_COLLECTION_CLASS_HASH = SN.ipClubCollectionClassHash;
901
903
  var STARKNET_IP_SPONSORSHIP_CONTRACT = SN.ipSponsorship;
902
- var STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT = SN.ipSponsorshipLicense;
904
+ var STARKNET_IP_SPONSORSHIP_CLASS_HASH = SN.ipSponsorshipClassHash;
903
905
  var STARKNET_CREATOR_COIN_FACTORY_CONTRACT = SN.creatorCoinFactory;
904
906
  var STARKNET_CREATOR_COIN_EKUBO_LAUNCHER = SN.creatorCoinEkuboLauncher;
905
907
  var STARKNET_CREATOR_COIN_CLASS_HASH = SN.creatorCoinClassHash;
@@ -1078,18 +1080,28 @@ var SERVICES = {
1078
1080
  description: "Sponsorship offers and licenses anchored to an existing Medialane asset.",
1079
1081
  standard: "ERC721",
1080
1082
  provenance: "MEDIALANE",
1083
+ onchain: {
1084
+ STARKNET: {
1085
+ factoryAddress: SN2.ipSponsorship,
1086
+ classHash: SN2.ipSponsorshipClassHash,
1087
+ startBlock: SN2.ipSponsorshipStartBlock
1088
+ }
1089
+ },
1081
1090
  uiVariant: "standard",
1082
- capabilities: ["sponsor"],
1083
- metadataSchema: { licenseDefault: "CC BY-SA" }
1084
- },
1085
- "ip-sponsorship-license": {
1086
- id: "ip-sponsorship-license",
1087
- displayName: "Sponsorship License Receipt",
1088
- description: "Non-authoritative receipt NFT minted to a sponsor when a sponsorship bid is accepted.",
1089
- standard: "ERC721",
1090
- provenance: "MEDIALANE",
1091
- uiVariant: "standard",
1092
- capabilities: ["transfer"],
1091
+ // v3: one contract is both the offer/bid/proposal registry and the
1092
+ // issued license collection (a real, standard ERC-721 minted internally
1093
+ // — no separate receipt contract). `transfer` reflects that a license is
1094
+ // freely transferable at the protocol layer; transferable/expiry intent
1095
+ // is declarative (carried in metadata + LicenseMinted), never
1096
+ // contract-enforced. Supersedes the 2026-07-02 v2 `ip-sponsorship`
1097
+ // (registry-only) + `ip-sponsorship-license` (non-authoritative receipt
1098
+ // via a dedicated ip-erc721 instance) pair — retired as of this redesign.
1099
+ capabilities: ["sponsor", "transfer"],
1100
+ events: [
1101
+ { name: "OfferCreated", emittedBy: "factory" },
1102
+ { name: "ProposalCreated", emittedBy: "factory" },
1103
+ { name: "LicenseMinted", emittedBy: "factory" }
1104
+ ],
1093
1105
  metadataSchema: { licenseDefault: "CC BY-SA" }
1094
1106
  },
1095
1107
  "creator-coin": {
@@ -9069,8 +9081,26 @@ var IPClubCollectionABI = [
9069
9081
  var IPSponsorshipABI = [
9070
9082
  {
9071
9083
  "type": "impl",
9072
- "name": "IPSponsorshipImpl",
9073
- "interface_name": "ip_sponsorship::interface::IIPSponsorship"
9084
+ "name": "ERC721MetadataImpl",
9085
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721Metadata"
9086
+ },
9087
+ {
9088
+ "type": "struct",
9089
+ "name": "core::byte_array::ByteArray",
9090
+ "members": [
9091
+ {
9092
+ "name": "data",
9093
+ "type": "core::array::Array::<core::bytes_31::bytes31>"
9094
+ },
9095
+ {
9096
+ "name": "pending_word",
9097
+ "type": "core::felt252"
9098
+ },
9099
+ {
9100
+ "name": "pending_word_len",
9101
+ "type": "core::internal::bounded_int::BoundedInt::<0, 30>"
9102
+ }
9103
+ ]
9074
9104
  },
9075
9105
  {
9076
9106
  "type": "struct",
@@ -9087,23 +9117,81 @@ var IPSponsorshipABI = [
9087
9117
  ]
9088
9118
  },
9089
9119
  {
9090
- "type": "struct",
9091
- "name": "core::byte_array::ByteArray",
9092
- "members": [
9120
+ "type": "interface",
9121
+ "name": "openzeppelin_token::erc721::interface::IERC721Metadata",
9122
+ "items": [
9093
9123
  {
9094
- "name": "data",
9095
- "type": "core::array::Array::<core::bytes_31::bytes31>"
9124
+ "type": "function",
9125
+ "name": "name",
9126
+ "inputs": [],
9127
+ "outputs": [
9128
+ {
9129
+ "type": "core::byte_array::ByteArray"
9130
+ }
9131
+ ],
9132
+ "state_mutability": "view"
9096
9133
  },
9097
9134
  {
9098
- "name": "pending_word",
9099
- "type": "core::felt252"
9135
+ "type": "function",
9136
+ "name": "symbol",
9137
+ "inputs": [],
9138
+ "outputs": [
9139
+ {
9140
+ "type": "core::byte_array::ByteArray"
9141
+ }
9142
+ ],
9143
+ "state_mutability": "view"
9100
9144
  },
9101
9145
  {
9102
- "name": "pending_word_len",
9103
- "type": "core::internal::bounded_int::BoundedInt::<0, 30>"
9146
+ "type": "function",
9147
+ "name": "token_uri",
9148
+ "inputs": [
9149
+ {
9150
+ "name": "token_id",
9151
+ "type": "core::integer::u256"
9152
+ }
9153
+ ],
9154
+ "outputs": [
9155
+ {
9156
+ "type": "core::byte_array::ByteArray"
9157
+ }
9158
+ ],
9159
+ "state_mutability": "view"
9160
+ }
9161
+ ]
9162
+ },
9163
+ {
9164
+ "type": "impl",
9165
+ "name": "ERC721MetadataCamelOnlyImpl",
9166
+ "interface_name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly"
9167
+ },
9168
+ {
9169
+ "type": "interface",
9170
+ "name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly",
9171
+ "items": [
9172
+ {
9173
+ "type": "function",
9174
+ "name": "tokenURI",
9175
+ "inputs": [
9176
+ {
9177
+ "name": "tokenId",
9178
+ "type": "core::integer::u256"
9179
+ }
9180
+ ],
9181
+ "outputs": [
9182
+ {
9183
+ "type": "core::byte_array::ByteArray"
9184
+ }
9185
+ ],
9186
+ "state_mutability": "view"
9104
9187
  }
9105
9188
  ]
9106
9189
  },
9190
+ {
9191
+ "type": "impl",
9192
+ "name": "IPSponsorshipImpl",
9193
+ "interface_name": "ip_sponsorship::interface::IIPSponsorship"
9194
+ },
9107
9195
  {
9108
9196
  "type": "enum",
9109
9197
  "name": "core::bool",
@@ -9175,19 +9263,19 @@ var IPSponsorshipABI = [
9175
9263
  {
9176
9264
  "name": "open",
9177
9265
  "type": "core::bool"
9266
+ },
9267
+ {
9268
+ "name": "royalty_bps",
9269
+ "type": "core::integer::u256"
9178
9270
  }
9179
9271
  ]
9180
9272
  },
9181
9273
  {
9182
9274
  "type": "struct",
9183
- "name": "ip_sponsorship::types::License",
9275
+ "name": "ip_sponsorship::types::SponsorshipProposal",
9184
9276
  "members": [
9185
9277
  {
9186
- "name": "author",
9187
- "type": "core::starknet::contract_address::ContractAddress"
9188
- },
9189
- {
9190
- "name": "sponsor",
9278
+ "name": "proposer",
9191
9279
  "type": "core::starknet::contract_address::ContractAddress"
9192
9280
  },
9193
9281
  {
@@ -9199,20 +9287,36 @@ var IPSponsorshipABI = [
9199
9287
  "type": "core::integer::u256"
9200
9288
  },
9201
9289
  {
9202
- "name": "amount_paid",
9290
+ "name": "amount",
9203
9291
  "type": "core::integer::u256"
9204
9292
  },
9205
9293
  {
9206
- "name": "expires_at",
9294
+ "name": "duration",
9207
9295
  "type": "core::integer::u64"
9208
9296
  },
9209
9297
  {
9210
- "name": "transferable",
9211
- "type": "core::bool"
9298
+ "name": "valid_until",
9299
+ "type": "core::integer::u64"
9300
+ },
9301
+ {
9302
+ "name": "payment_token",
9303
+ "type": "core::starknet::contract_address::ContractAddress"
9212
9304
  },
9213
9305
  {
9214
9306
  "name": "license_terms_uri",
9215
9307
  "type": "core::byte_array::ByteArray"
9308
+ },
9309
+ {
9310
+ "name": "transferable",
9311
+ "type": "core::bool"
9312
+ },
9313
+ {
9314
+ "name": "open",
9315
+ "type": "core::bool"
9316
+ },
9317
+ {
9318
+ "name": "royalty_bps",
9319
+ "type": "core::integer::u256"
9216
9320
  }
9217
9321
  ]
9218
9322
  },
@@ -9252,6 +9356,10 @@ var IPSponsorshipABI = [
9252
9356
  "name": "transferable",
9253
9357
  "type": "core::bool"
9254
9358
  },
9359
+ {
9360
+ "name": "royalty_bps",
9361
+ "type": "core::integer::u256"
9362
+ },
9255
9363
  {
9256
9364
  "name": "specific_sponsor",
9257
9365
  "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>"
@@ -9328,22 +9436,6 @@ var IPSponsorshipABI = [
9328
9436
  ],
9329
9437
  "state_mutability": "external"
9330
9438
  },
9331
- {
9332
- "type": "function",
9333
- "name": "transfer_license",
9334
- "inputs": [
9335
- {
9336
- "name": "license_id",
9337
- "type": "core::integer::u256"
9338
- },
9339
- {
9340
- "name": "to",
9341
- "type": "core::starknet::contract_address::ContractAddress"
9342
- }
9343
- ],
9344
- "outputs": [],
9345
- "state_mutability": "external"
9346
- },
9347
9439
  {
9348
9440
  "type": "function",
9349
9441
  "name": "get_offer",
@@ -9382,584 +9474,133 @@ var IPSponsorshipABI = [
9382
9474
  },
9383
9475
  {
9384
9476
  "type": "function",
9385
- "name": "get_license",
9386
- "inputs": [
9477
+ "name": "get_last_offer_id",
9478
+ "inputs": [],
9479
+ "outputs": [
9387
9480
  {
9388
- "name": "license_id",
9389
9481
  "type": "core::integer::u256"
9390
9482
  }
9391
9483
  ],
9484
+ "state_mutability": "view"
9485
+ },
9486
+ {
9487
+ "type": "function",
9488
+ "name": "get_last_license_id",
9489
+ "inputs": [],
9392
9490
  "outputs": [
9393
9491
  {
9394
- "type": "ip_sponsorship::types::License"
9492
+ "type": "core::integer::u256"
9395
9493
  }
9396
9494
  ],
9397
9495
  "state_mutability": "view"
9398
9496
  },
9399
9497
  {
9400
9498
  "type": "function",
9401
- "name": "is_license_valid",
9499
+ "name": "propose_sponsorship",
9402
9500
  "inputs": [
9403
9501
  {
9404
- "name": "license_id",
9502
+ "name": "nft_contract",
9503
+ "type": "core::starknet::contract_address::ContractAddress"
9504
+ },
9505
+ {
9506
+ "name": "token_id",
9507
+ "type": "core::integer::u256"
9508
+ },
9509
+ {
9510
+ "name": "amount",
9511
+ "type": "core::integer::u256"
9512
+ },
9513
+ {
9514
+ "name": "duration",
9515
+ "type": "core::integer::u64"
9516
+ },
9517
+ {
9518
+ "name": "valid_until",
9519
+ "type": "core::integer::u64"
9520
+ },
9521
+ {
9522
+ "name": "payment_token",
9523
+ "type": "core::starknet::contract_address::ContractAddress"
9524
+ },
9525
+ {
9526
+ "name": "license_terms_uri",
9527
+ "type": "core::byte_array::ByteArray"
9528
+ },
9529
+ {
9530
+ "name": "transferable",
9531
+ "type": "core::bool"
9532
+ },
9533
+ {
9534
+ "name": "royalty_bps",
9405
9535
  "type": "core::integer::u256"
9406
9536
  }
9407
9537
  ],
9408
9538
  "outputs": [
9409
9539
  {
9410
- "type": "core::bool"
9540
+ "type": "core::integer::u256"
9411
9541
  }
9412
9542
  ],
9413
- "state_mutability": "view"
9543
+ "state_mutability": "external"
9414
9544
  },
9415
9545
  {
9416
9546
  "type": "function",
9417
- "name": "get_last_offer_id",
9418
- "inputs": [],
9419
- "outputs": [
9547
+ "name": "withdraw_proposal",
9548
+ "inputs": [
9420
9549
  {
9550
+ "name": "proposal_id",
9421
9551
  "type": "core::integer::u256"
9422
9552
  }
9423
9553
  ],
9424
- "state_mutability": "view"
9554
+ "outputs": [],
9555
+ "state_mutability": "external"
9425
9556
  },
9426
9557
  {
9427
9558
  "type": "function",
9428
- "name": "get_last_license_id",
9429
- "inputs": [],
9559
+ "name": "accept_proposal",
9560
+ "inputs": [
9561
+ {
9562
+ "name": "proposal_id",
9563
+ "type": "core::integer::u256"
9564
+ }
9565
+ ],
9430
9566
  "outputs": [
9431
9567
  {
9432
9568
  "type": "core::integer::u256"
9433
9569
  }
9434
9570
  ],
9435
- "state_mutability": "view"
9436
- }
9437
- ]
9438
- },
9439
- {
9440
- "type": "impl",
9441
- "name": "SRC5Impl",
9442
- "interface_name": "openzeppelin_introspection::interface::ISRC5"
9443
- },
9444
- {
9445
- "type": "interface",
9446
- "name": "openzeppelin_introspection::interface::ISRC5",
9447
- "items": [
9571
+ "state_mutability": "external"
9572
+ },
9448
9573
  {
9449
9574
  "type": "function",
9450
- "name": "supports_interface",
9575
+ "name": "reject_proposal",
9451
9576
  "inputs": [
9452
9577
  {
9453
- "name": "interface_id",
9454
- "type": "core::felt252"
9578
+ "name": "proposal_id",
9579
+ "type": "core::integer::u256"
9580
+ }
9581
+ ],
9582
+ "outputs": [],
9583
+ "state_mutability": "external"
9584
+ },
9585
+ {
9586
+ "type": "function",
9587
+ "name": "get_proposal",
9588
+ "inputs": [
9589
+ {
9590
+ "name": "proposal_id",
9591
+ "type": "core::integer::u256"
9455
9592
  }
9456
9593
  ],
9457
9594
  "outputs": [
9458
9595
  {
9459
- "type": "core::bool"
9460
- }
9461
- ],
9462
- "state_mutability": "view"
9463
- }
9464
- ]
9465
- },
9466
- {
9467
- "type": "constructor",
9468
- "name": "constructor",
9469
- "inputs": []
9470
- },
9471
- {
9472
- "type": "event",
9473
- "name": "openzeppelin_introspection::src5::SRC5Component::Event",
9474
- "kind": "enum",
9475
- "variants": []
9476
- },
9477
- {
9478
- "type": "event",
9479
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
9480
- "kind": "struct",
9481
- "members": [
9482
- {
9483
- "name": "offer_id",
9484
- "type": "core::integer::u256",
9485
- "kind": "key"
9486
- },
9487
- {
9488
- "name": "author",
9489
- "type": "core::starknet::contract_address::ContractAddress",
9490
- "kind": "key"
9491
- },
9492
- {
9493
- "name": "nft_contract",
9494
- "type": "core::starknet::contract_address::ContractAddress",
9495
- "kind": "key"
9496
- },
9497
- {
9498
- "name": "token_id",
9499
- "type": "core::integer::u256",
9500
- "kind": "data"
9501
- },
9502
- {
9503
- "name": "min_amount",
9504
- "type": "core::integer::u256",
9505
- "kind": "data"
9506
- },
9507
- {
9508
- "name": "duration",
9509
- "type": "core::integer::u64",
9510
- "kind": "data"
9511
- },
9512
- {
9513
- "name": "payment_token",
9514
- "type": "core::starknet::contract_address::ContractAddress",
9515
- "kind": "data"
9516
- },
9517
- {
9518
- "name": "license_terms_uri",
9519
- "type": "core::byte_array::ByteArray",
9520
- "kind": "data"
9521
- },
9522
- {
9523
- "name": "transferable",
9524
- "type": "core::bool",
9525
- "kind": "data"
9526
- },
9527
- {
9528
- "name": "specific_sponsor",
9529
- "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
9530
- "kind": "data"
9531
- },
9532
- {
9533
- "name": "created_at",
9534
- "type": "core::integer::u64",
9535
- "kind": "data"
9536
- }
9537
- ]
9538
- },
9539
- {
9540
- "type": "event",
9541
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
9542
- "kind": "struct",
9543
- "members": [
9544
- {
9545
- "name": "offer_id",
9546
- "type": "core::integer::u256",
9547
- "kind": "key"
9548
- },
9549
- {
9550
- "name": "open",
9551
- "type": "core::bool",
9552
- "kind": "data"
9553
- },
9554
- {
9555
- "name": "updated_at",
9556
- "type": "core::integer::u64",
9557
- "kind": "data"
9558
- }
9559
- ]
9560
- },
9561
- {
9562
- "type": "event",
9563
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
9564
- "kind": "struct",
9565
- "members": [
9566
- {
9567
- "name": "offer_id",
9568
- "type": "core::integer::u256",
9569
- "kind": "key"
9570
- },
9571
- {
9572
- "name": "sponsor",
9573
- "type": "core::starknet::contract_address::ContractAddress",
9574
- "kind": "key"
9575
- },
9576
- {
9577
- "name": "amount",
9578
- "type": "core::integer::u256",
9579
- "kind": "data"
9580
- },
9581
- {
9582
- "name": "bid_at",
9583
- "type": "core::integer::u64",
9584
- "kind": "data"
9585
- }
9586
- ]
9587
- },
9588
- {
9589
- "type": "event",
9590
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
9591
- "kind": "struct",
9592
- "members": [
9593
- {
9594
- "name": "offer_id",
9595
- "type": "core::integer::u256",
9596
- "kind": "key"
9597
- },
9598
- {
9599
- "name": "sponsor",
9600
- "type": "core::starknet::contract_address::ContractAddress",
9601
- "kind": "key"
9602
- },
9603
- {
9604
- "name": "retracted_at",
9605
- "type": "core::integer::u64",
9606
- "kind": "data"
9607
- }
9608
- ]
9609
- },
9610
- {
9611
- "type": "event",
9612
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
9613
- "kind": "struct",
9614
- "members": [
9615
- {
9616
- "name": "offer_id",
9617
- "type": "core::integer::u256",
9618
- "kind": "key"
9619
- },
9620
- {
9621
- "name": "license_id",
9622
- "type": "core::integer::u256",
9623
- "kind": "key"
9624
- },
9625
- {
9626
- "name": "sponsor",
9627
- "type": "core::starknet::contract_address::ContractAddress",
9628
- "kind": "key"
9629
- },
9630
- {
9631
- "name": "author",
9632
- "type": "core::starknet::contract_address::ContractAddress",
9633
- "kind": "data"
9634
- },
9635
- {
9636
- "name": "amount",
9637
- "type": "core::integer::u256",
9638
- "kind": "data"
9639
- },
9640
- {
9641
- "name": "expires_at",
9642
- "type": "core::integer::u64",
9643
- "kind": "data"
9644
- }
9645
- ]
9646
- },
9647
- {
9648
- "type": "event",
9649
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseTransferred",
9650
- "kind": "struct",
9651
- "members": [
9652
- {
9653
- "name": "license_id",
9654
- "type": "core::integer::u256",
9655
- "kind": "key"
9656
- },
9657
- {
9658
- "name": "from",
9659
- "type": "core::starknet::contract_address::ContractAddress",
9660
- "kind": "key"
9661
- },
9662
- {
9663
- "name": "to",
9664
- "type": "core::starknet::contract_address::ContractAddress",
9665
- "kind": "key"
9666
- },
9667
- {
9668
- "name": "transferred_at",
9669
- "type": "core::integer::u64",
9670
- "kind": "data"
9671
- }
9672
- ]
9673
- },
9674
- {
9675
- "type": "event",
9676
- "name": "ip_sponsorship::IPSponsorship::IPSponsorship::Event",
9677
- "kind": "enum",
9678
- "variants": [
9679
- {
9680
- "name": "SRC5Event",
9681
- "type": "openzeppelin_introspection::src5::SRC5Component::Event",
9682
- "kind": "flat"
9683
- },
9684
- {
9685
- "name": "OfferCreated",
9686
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
9687
- "kind": "nested"
9688
- },
9689
- {
9690
- "name": "OfferStatusUpdated",
9691
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
9692
- "kind": "nested"
9693
- },
9694
- {
9695
- "name": "BidPlaced",
9696
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
9697
- "kind": "nested"
9698
- },
9699
- {
9700
- "name": "BidRetracted",
9701
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
9702
- "kind": "nested"
9703
- },
9704
- {
9705
- "name": "SponsorshipAccepted",
9706
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
9707
- "kind": "nested"
9708
- },
9709
- {
9710
- "name": "LicenseTransferred",
9711
- "type": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseTransferred",
9712
- "kind": "nested"
9713
- }
9714
- ]
9715
- }
9716
- ];
9717
-
9718
- // src/starknet/abis/ipSponsorshipLicense.ts
9719
- var IPSponsorshipLicenseABI = [
9720
- {
9721
- "type": "impl",
9722
- "name": "ERC721MetadataImpl",
9723
- "interface_name": "openzeppelin_token::erc721::interface::IERC721Metadata"
9724
- },
9725
- {
9726
- "type": "struct",
9727
- "name": "core::byte_array::ByteArray",
9728
- "members": [
9729
- {
9730
- "name": "data",
9731
- "type": "core::array::Array::<core::bytes_31::bytes31>"
9732
- },
9733
- {
9734
- "name": "pending_word",
9735
- "type": "core::felt252"
9736
- },
9737
- {
9738
- "name": "pending_word_len",
9739
- "type": "core::internal::bounded_int::BoundedInt::<0, 30>"
9740
- }
9741
- ]
9742
- },
9743
- {
9744
- "type": "struct",
9745
- "name": "core::integer::u256",
9746
- "members": [
9747
- {
9748
- "name": "low",
9749
- "type": "core::integer::u128"
9750
- },
9751
- {
9752
- "name": "high",
9753
- "type": "core::integer::u128"
9754
- }
9755
- ]
9756
- },
9757
- {
9758
- "type": "interface",
9759
- "name": "openzeppelin_token::erc721::interface::IERC721Metadata",
9760
- "items": [
9761
- {
9762
- "type": "function",
9763
- "name": "name",
9764
- "inputs": [],
9765
- "outputs": [
9766
- {
9767
- "type": "core::byte_array::ByteArray"
9768
- }
9769
- ],
9770
- "state_mutability": "view"
9771
- },
9772
- {
9773
- "type": "function",
9774
- "name": "symbol",
9775
- "inputs": [],
9776
- "outputs": [
9777
- {
9778
- "type": "core::byte_array::ByteArray"
9779
- }
9780
- ],
9781
- "state_mutability": "view"
9782
- },
9783
- {
9784
- "type": "function",
9785
- "name": "token_uri",
9786
- "inputs": [
9787
- {
9788
- "name": "token_id",
9789
- "type": "core::integer::u256"
9790
- }
9791
- ],
9792
- "outputs": [
9793
- {
9794
- "type": "core::byte_array::ByteArray"
9795
- }
9796
- ],
9797
- "state_mutability": "view"
9798
- }
9799
- ]
9800
- },
9801
- {
9802
- "type": "impl",
9803
- "name": "ERC721MetadataCamelOnlyImpl",
9804
- "interface_name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly"
9805
- },
9806
- {
9807
- "type": "interface",
9808
- "name": "openzeppelin_token::erc721::interface::IERC721MetadataCamelOnly",
9809
- "items": [
9810
- {
9811
- "type": "function",
9812
- "name": "tokenURI",
9813
- "inputs": [
9814
- {
9815
- "name": "tokenId",
9816
- "type": "core::integer::u256"
9817
- }
9818
- ],
9819
- "outputs": [
9820
- {
9821
- "type": "core::byte_array::ByteArray"
9822
- }
9823
- ],
9824
- "state_mutability": "view"
9825
- }
9826
- ]
9827
- },
9828
- {
9829
- "type": "impl",
9830
- "name": "IPSponsorshipLicenseImpl",
9831
- "interface_name": "ip_sponsorship::interface::IIPSponsorshipLicense"
9832
- },
9833
- {
9834
- "type": "enum",
9835
- "name": "core::bool",
9836
- "variants": [
9837
- {
9838
- "name": "False",
9839
- "type": "()"
9840
- },
9841
- {
9842
- "name": "True",
9843
- "type": "()"
9844
- }
9845
- ]
9846
- },
9847
- {
9848
- "type": "struct",
9849
- "name": "ip_sponsorship::types::LicenseData",
9850
- "members": [
9851
- {
9852
- "name": "author",
9853
- "type": "core::starknet::contract_address::ContractAddress"
9854
- },
9855
- {
9856
- "name": "asset_contract",
9857
- "type": "core::starknet::contract_address::ContractAddress"
9858
- },
9859
- {
9860
- "name": "asset_token_id",
9861
- "type": "core::integer::u256"
9862
- },
9863
- {
9864
- "name": "expires_at",
9865
- "type": "core::integer::u64"
9866
- },
9867
- {
9868
- "name": "transferable",
9869
- "type": "core::bool"
9870
- },
9871
- {
9872
- "name": "royalty_bps",
9873
- "type": "core::integer::u256"
9874
- },
9875
- {
9876
- "name": "license_terms_uri",
9877
- "type": "core::byte_array::ByteArray"
9878
- }
9879
- ]
9880
- },
9881
- {
9882
- "type": "interface",
9883
- "name": "ip_sponsorship::interface::IIPSponsorshipLicense",
9884
- "items": [
9885
- {
9886
- "type": "function",
9887
- "name": "set_minter",
9888
- "inputs": [
9889
- {
9890
- "name": "minter",
9891
- "type": "core::starknet::contract_address::ContractAddress"
9892
- }
9893
- ],
9894
- "outputs": [],
9895
- "state_mutability": "external"
9896
- },
9897
- {
9898
- "type": "function",
9899
- "name": "get_minter",
9900
- "inputs": [],
9901
- "outputs": [
9902
- {
9903
- "type": "core::starknet::contract_address::ContractAddress"
9904
- }
9905
- ],
9906
- "state_mutability": "view"
9907
- },
9908
- {
9909
- "type": "function",
9910
- "name": "mint",
9911
- "inputs": [
9912
- {
9913
- "name": "recipient",
9914
- "type": "core::starknet::contract_address::ContractAddress"
9915
- },
9916
- {
9917
- "name": "data",
9918
- "type": "ip_sponsorship::types::LicenseData"
9919
- }
9920
- ],
9921
- "outputs": [
9922
- {
9923
- "type": "core::integer::u256"
9924
- }
9925
- ],
9926
- "state_mutability": "external"
9927
- },
9928
- {
9929
- "type": "function",
9930
- "name": "get_license_data",
9931
- "inputs": [
9932
- {
9933
- "name": "token_id",
9934
- "type": "core::integer::u256"
9935
- }
9936
- ],
9937
- "outputs": [
9938
- {
9939
- "type": "ip_sponsorship::types::LicenseData"
9940
- }
9941
- ],
9942
- "state_mutability": "view"
9943
- },
9944
- {
9945
- "type": "function",
9946
- "name": "is_license_valid",
9947
- "inputs": [
9948
- {
9949
- "name": "token_id",
9950
- "type": "core::integer::u256"
9951
- }
9952
- ],
9953
- "outputs": [
9954
- {
9955
- "type": "core::bool"
9596
+ "type": "ip_sponsorship::types::SponsorshipProposal"
9956
9597
  }
9957
9598
  ],
9958
9599
  "state_mutability": "view"
9959
9600
  },
9960
9601
  {
9961
9602
  "type": "function",
9962
- "name": "last_license_id",
9603
+ "name": "get_last_proposal_id",
9963
9604
  "inputs": [],
9964
9605
  "outputs": [
9965
9606
  {
@@ -10335,134 +9976,435 @@ var IPSponsorshipLicenseABI = [
10335
9976
  "name": "openzeppelin_introspection::interface::ISRC5",
10336
9977
  "items": [
10337
9978
  {
10338
- "type": "function",
10339
- "name": "supports_interface",
10340
- "inputs": [
10341
- {
10342
- "name": "interface_id",
10343
- "type": "core::felt252"
10344
- }
10345
- ],
10346
- "outputs": [
10347
- {
10348
- "type": "core::bool"
10349
- }
10350
- ],
10351
- "state_mutability": "view"
9979
+ "type": "function",
9980
+ "name": "supports_interface",
9981
+ "inputs": [
9982
+ {
9983
+ "name": "interface_id",
9984
+ "type": "core::felt252"
9985
+ }
9986
+ ],
9987
+ "outputs": [
9988
+ {
9989
+ "type": "core::bool"
9990
+ }
9991
+ ],
9992
+ "state_mutability": "view"
9993
+ }
9994
+ ]
9995
+ },
9996
+ {
9997
+ "type": "constructor",
9998
+ "name": "constructor",
9999
+ "inputs": [
10000
+ {
10001
+ "name": "name",
10002
+ "type": "core::byte_array::ByteArray"
10003
+ },
10004
+ {
10005
+ "name": "symbol",
10006
+ "type": "core::byte_array::ByteArray"
10007
+ }
10008
+ ]
10009
+ },
10010
+ {
10011
+ "type": "event",
10012
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
10013
+ "kind": "struct",
10014
+ "members": [
10015
+ {
10016
+ "name": "from",
10017
+ "type": "core::starknet::contract_address::ContractAddress",
10018
+ "kind": "key"
10019
+ },
10020
+ {
10021
+ "name": "to",
10022
+ "type": "core::starknet::contract_address::ContractAddress",
10023
+ "kind": "key"
10024
+ },
10025
+ {
10026
+ "name": "token_id",
10027
+ "type": "core::integer::u256",
10028
+ "kind": "key"
10029
+ }
10030
+ ]
10031
+ },
10032
+ {
10033
+ "type": "event",
10034
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
10035
+ "kind": "struct",
10036
+ "members": [
10037
+ {
10038
+ "name": "owner",
10039
+ "type": "core::starknet::contract_address::ContractAddress",
10040
+ "kind": "key"
10041
+ },
10042
+ {
10043
+ "name": "approved",
10044
+ "type": "core::starknet::contract_address::ContractAddress",
10045
+ "kind": "key"
10046
+ },
10047
+ {
10048
+ "name": "token_id",
10049
+ "type": "core::integer::u256",
10050
+ "kind": "key"
10051
+ }
10052
+ ]
10053
+ },
10054
+ {
10055
+ "type": "event",
10056
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
10057
+ "kind": "struct",
10058
+ "members": [
10059
+ {
10060
+ "name": "owner",
10061
+ "type": "core::starknet::contract_address::ContractAddress",
10062
+ "kind": "key"
10063
+ },
10064
+ {
10065
+ "name": "operator",
10066
+ "type": "core::starknet::contract_address::ContractAddress",
10067
+ "kind": "key"
10068
+ },
10069
+ {
10070
+ "name": "approved",
10071
+ "type": "core::bool",
10072
+ "kind": "data"
10073
+ }
10074
+ ]
10075
+ },
10076
+ {
10077
+ "type": "event",
10078
+ "name": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
10079
+ "kind": "enum",
10080
+ "variants": [
10081
+ {
10082
+ "name": "Transfer",
10083
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
10084
+ "kind": "nested"
10085
+ },
10086
+ {
10087
+ "name": "Approval",
10088
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
10089
+ "kind": "nested"
10090
+ },
10091
+ {
10092
+ "name": "ApprovalForAll",
10093
+ "type": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
10094
+ "kind": "nested"
10095
+ }
10096
+ ]
10097
+ },
10098
+ {
10099
+ "type": "event",
10100
+ "name": "openzeppelin_introspection::src5::SRC5Component::Event",
10101
+ "kind": "enum",
10102
+ "variants": []
10103
+ },
10104
+ {
10105
+ "type": "event",
10106
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
10107
+ "kind": "struct",
10108
+ "members": [
10109
+ {
10110
+ "name": "offer_id",
10111
+ "type": "core::integer::u256",
10112
+ "kind": "key"
10113
+ },
10114
+ {
10115
+ "name": "author",
10116
+ "type": "core::starknet::contract_address::ContractAddress",
10117
+ "kind": "key"
10118
+ },
10119
+ {
10120
+ "name": "nft_contract",
10121
+ "type": "core::starknet::contract_address::ContractAddress",
10122
+ "kind": "key"
10123
+ },
10124
+ {
10125
+ "name": "token_id",
10126
+ "type": "core::integer::u256",
10127
+ "kind": "data"
10128
+ },
10129
+ {
10130
+ "name": "min_amount",
10131
+ "type": "core::integer::u256",
10132
+ "kind": "data"
10133
+ },
10134
+ {
10135
+ "name": "duration",
10136
+ "type": "core::integer::u64",
10137
+ "kind": "data"
10138
+ },
10139
+ {
10140
+ "name": "payment_token",
10141
+ "type": "core::starknet::contract_address::ContractAddress",
10142
+ "kind": "data"
10143
+ },
10144
+ {
10145
+ "name": "license_terms_uri",
10146
+ "type": "core::byte_array::ByteArray",
10147
+ "kind": "data"
10148
+ },
10149
+ {
10150
+ "name": "transferable",
10151
+ "type": "core::bool",
10152
+ "kind": "data"
10153
+ },
10154
+ {
10155
+ "name": "royalty_bps",
10156
+ "type": "core::integer::u256",
10157
+ "kind": "data"
10158
+ },
10159
+ {
10160
+ "name": "specific_sponsor",
10161
+ "type": "core::option::Option::<core::starknet::contract_address::ContractAddress>",
10162
+ "kind": "data"
10163
+ },
10164
+ {
10165
+ "name": "created_at",
10166
+ "type": "core::integer::u64",
10167
+ "kind": "data"
10168
+ }
10169
+ ]
10170
+ },
10171
+ {
10172
+ "type": "event",
10173
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
10174
+ "kind": "struct",
10175
+ "members": [
10176
+ {
10177
+ "name": "offer_id",
10178
+ "type": "core::integer::u256",
10179
+ "kind": "key"
10180
+ },
10181
+ {
10182
+ "name": "open",
10183
+ "type": "core::bool",
10184
+ "kind": "data"
10185
+ },
10186
+ {
10187
+ "name": "updated_at",
10188
+ "type": "core::integer::u64",
10189
+ "kind": "data"
10190
+ }
10191
+ ]
10192
+ },
10193
+ {
10194
+ "type": "event",
10195
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
10196
+ "kind": "struct",
10197
+ "members": [
10198
+ {
10199
+ "name": "offer_id",
10200
+ "type": "core::integer::u256",
10201
+ "kind": "key"
10202
+ },
10203
+ {
10204
+ "name": "sponsor",
10205
+ "type": "core::starknet::contract_address::ContractAddress",
10206
+ "kind": "key"
10207
+ },
10208
+ {
10209
+ "name": "amount",
10210
+ "type": "core::integer::u256",
10211
+ "kind": "data"
10212
+ },
10213
+ {
10214
+ "name": "bid_at",
10215
+ "type": "core::integer::u64",
10216
+ "kind": "data"
10352
10217
  }
10353
10218
  ]
10354
10219
  },
10355
10220
  {
10356
- "type": "constructor",
10357
- "name": "constructor",
10358
- "inputs": [
10221
+ "type": "event",
10222
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
10223
+ "kind": "struct",
10224
+ "members": [
10359
10225
  {
10360
- "name": "name",
10361
- "type": "core::byte_array::ByteArray"
10226
+ "name": "offer_id",
10227
+ "type": "core::integer::u256",
10228
+ "kind": "key"
10362
10229
  },
10363
10230
  {
10364
- "name": "symbol",
10365
- "type": "core::byte_array::ByteArray"
10231
+ "name": "sponsor",
10232
+ "type": "core::starknet::contract_address::ContractAddress",
10233
+ "kind": "key"
10234
+ },
10235
+ {
10236
+ "name": "retracted_at",
10237
+ "type": "core::integer::u64",
10238
+ "kind": "data"
10366
10239
  }
10367
10240
  ]
10368
10241
  },
10369
10242
  {
10370
10243
  "type": "event",
10371
- "name": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
10244
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
10372
10245
  "kind": "struct",
10373
10246
  "members": [
10374
10247
  {
10375
- "name": "from",
10376
- "type": "core::starknet::contract_address::ContractAddress",
10248
+ "name": "offer_id",
10249
+ "type": "core::integer::u256",
10377
10250
  "kind": "key"
10378
10251
  },
10379
10252
  {
10380
- "name": "to",
10253
+ "name": "license_id",
10254
+ "type": "core::integer::u256",
10255
+ "kind": "key"
10256
+ },
10257
+ {
10258
+ "name": "sponsor",
10381
10259
  "type": "core::starknet::contract_address::ContractAddress",
10382
10260
  "kind": "key"
10383
10261
  },
10384
10262
  {
10385
- "name": "token_id",
10263
+ "name": "author",
10264
+ "type": "core::starknet::contract_address::ContractAddress",
10265
+ "kind": "data"
10266
+ },
10267
+ {
10268
+ "name": "amount",
10386
10269
  "type": "core::integer::u256",
10387
- "kind": "key"
10270
+ "kind": "data"
10271
+ },
10272
+ {
10273
+ "name": "expires_at",
10274
+ "type": "core::integer::u64",
10275
+ "kind": "data"
10388
10276
  }
10389
10277
  ]
10390
10278
  },
10391
10279
  {
10392
10280
  "type": "event",
10393
- "name": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
10281
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::ProposalCreated",
10394
10282
  "kind": "struct",
10395
10283
  "members": [
10396
10284
  {
10397
- "name": "owner",
10285
+ "name": "proposal_id",
10286
+ "type": "core::integer::u256",
10287
+ "kind": "key"
10288
+ },
10289
+ {
10290
+ "name": "proposer",
10398
10291
  "type": "core::starknet::contract_address::ContractAddress",
10399
10292
  "kind": "key"
10400
10293
  },
10401
10294
  {
10402
- "name": "approved",
10295
+ "name": "nft_contract",
10403
10296
  "type": "core::starknet::contract_address::ContractAddress",
10404
10297
  "kind": "key"
10405
10298
  },
10406
10299
  {
10407
10300
  "name": "token_id",
10408
10301
  "type": "core::integer::u256",
10409
- "kind": "key"
10302
+ "kind": "data"
10303
+ },
10304
+ {
10305
+ "name": "amount",
10306
+ "type": "core::integer::u256",
10307
+ "kind": "data"
10308
+ },
10309
+ {
10310
+ "name": "duration",
10311
+ "type": "core::integer::u64",
10312
+ "kind": "data"
10313
+ },
10314
+ {
10315
+ "name": "valid_until",
10316
+ "type": "core::integer::u64",
10317
+ "kind": "data"
10318
+ },
10319
+ {
10320
+ "name": "payment_token",
10321
+ "type": "core::starknet::contract_address::ContractAddress",
10322
+ "kind": "data"
10323
+ },
10324
+ {
10325
+ "name": "license_terms_uri",
10326
+ "type": "core::byte_array::ByteArray",
10327
+ "kind": "data"
10328
+ },
10329
+ {
10330
+ "name": "transferable",
10331
+ "type": "core::bool",
10332
+ "kind": "data"
10333
+ },
10334
+ {
10335
+ "name": "royalty_bps",
10336
+ "type": "core::integer::u256",
10337
+ "kind": "data"
10338
+ },
10339
+ {
10340
+ "name": "created_at",
10341
+ "type": "core::integer::u64",
10342
+ "kind": "data"
10410
10343
  }
10411
10344
  ]
10412
10345
  },
10413
10346
  {
10414
10347
  "type": "event",
10415
- "name": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
10348
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::ProposalClosed",
10416
10349
  "kind": "struct",
10417
10350
  "members": [
10418
10351
  {
10419
- "name": "owner",
10420
- "type": "core::starknet::contract_address::ContractAddress",
10352
+ "name": "proposal_id",
10353
+ "type": "core::integer::u256",
10421
10354
  "kind": "key"
10422
10355
  },
10423
10356
  {
10424
- "name": "operator",
10425
- "type": "core::starknet::contract_address::ContractAddress",
10426
- "kind": "key"
10357
+ "name": "accepted",
10358
+ "type": "core::bool",
10359
+ "kind": "data"
10427
10360
  },
10428
10361
  {
10429
- "name": "approved",
10430
- "type": "core::bool",
10362
+ "name": "closed_at",
10363
+ "type": "core::integer::u64",
10431
10364
  "kind": "data"
10432
10365
  }
10433
10366
  ]
10434
10367
  },
10435
10368
  {
10436
10369
  "type": "event",
10437
- "name": "openzeppelin_token::erc721::erc721::ERC721Component::Event",
10438
- "kind": "enum",
10439
- "variants": [
10370
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::ProposalAccepted",
10371
+ "kind": "struct",
10372
+ "members": [
10440
10373
  {
10441
- "name": "Transfer",
10442
- "type": "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
10443
- "kind": "nested"
10374
+ "name": "proposal_id",
10375
+ "type": "core::integer::u256",
10376
+ "kind": "key"
10444
10377
  },
10445
10378
  {
10446
- "name": "Approval",
10447
- "type": "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
10448
- "kind": "nested"
10379
+ "name": "license_id",
10380
+ "type": "core::integer::u256",
10381
+ "kind": "key"
10449
10382
  },
10450
10383
  {
10451
- "name": "ApprovalForAll",
10452
- "type": "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
10453
- "kind": "nested"
10384
+ "name": "sponsor",
10385
+ "type": "core::starknet::contract_address::ContractAddress",
10386
+ "kind": "key"
10387
+ },
10388
+ {
10389
+ "name": "author",
10390
+ "type": "core::starknet::contract_address::ContractAddress",
10391
+ "kind": "data"
10392
+ },
10393
+ {
10394
+ "name": "amount",
10395
+ "type": "core::integer::u256",
10396
+ "kind": "data"
10397
+ },
10398
+ {
10399
+ "name": "expires_at",
10400
+ "type": "core::integer::u64",
10401
+ "kind": "data"
10454
10402
  }
10455
10403
  ]
10456
10404
  },
10457
10405
  {
10458
10406
  "type": "event",
10459
- "name": "openzeppelin_introspection::src5::SRC5Component::Event",
10460
- "kind": "enum",
10461
- "variants": []
10462
- },
10463
- {
10464
- "type": "event",
10465
- "name": "ip_sponsorship::IPSponsorshipLicense::IPSponsorshipLicense::LicenseMinted",
10407
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseMinted",
10466
10408
  "kind": "struct",
10467
10409
  "members": [
10468
10410
  {
@@ -10519,7 +10461,7 @@ var IPSponsorshipLicenseABI = [
10519
10461
  },
10520
10462
  {
10521
10463
  "type": "event",
10522
- "name": "ip_sponsorship::IPSponsorshipLicense::IPSponsorshipLicense::Event",
10464
+ "name": "ip_sponsorship::IPSponsorship::IPSponsorship::Event",
10523
10465
  "kind": "enum",
10524
10466
  "variants": [
10525
10467
  {
@@ -10532,9 +10474,49 @@ var IPSponsorshipLicenseABI = [
10532
10474
  "type": "openzeppelin_introspection::src5::SRC5Component::Event",
10533
10475
  "kind": "flat"
10534
10476
  },
10477
+ {
10478
+ "name": "OfferCreated",
10479
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferCreated",
10480
+ "kind": "nested"
10481
+ },
10482
+ {
10483
+ "name": "OfferStatusUpdated",
10484
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::OfferStatusUpdated",
10485
+ "kind": "nested"
10486
+ },
10487
+ {
10488
+ "name": "BidPlaced",
10489
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidPlaced",
10490
+ "kind": "nested"
10491
+ },
10492
+ {
10493
+ "name": "BidRetracted",
10494
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::BidRetracted",
10495
+ "kind": "nested"
10496
+ },
10497
+ {
10498
+ "name": "SponsorshipAccepted",
10499
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::SponsorshipAccepted",
10500
+ "kind": "nested"
10501
+ },
10502
+ {
10503
+ "name": "ProposalCreated",
10504
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::ProposalCreated",
10505
+ "kind": "nested"
10506
+ },
10507
+ {
10508
+ "name": "ProposalClosed",
10509
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::ProposalClosed",
10510
+ "kind": "nested"
10511
+ },
10512
+ {
10513
+ "name": "ProposalAccepted",
10514
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::ProposalAccepted",
10515
+ "kind": "nested"
10516
+ },
10535
10517
  {
10536
10518
  "name": "LicenseMinted",
10537
- "type": "ip_sponsorship::IPSponsorshipLicense::IPSponsorshipLicense::LicenseMinted",
10519
+ "type": "ip_sponsorship::IPSponsorship::IPSponsorship::LicenseMinted",
10538
10520
  "kind": "nested"
10539
10521
  }
10540
10522
  ]
@@ -12001,20 +11983,29 @@ var ClubService = class {
12001
11983
  };
12002
11984
  var SponsorshipService = class {
12003
11985
  constructor(config) {
11986
+ this.config = config;
12004
11987
  this.sponsorshipAddress = getStarknetCoordinates(config.chain).ipSponsorship;
12005
- this.licenseReceiptAddress = getStarknetCoordinates(config.chain).ipSponsorshipLicense;
12006
11988
  }
12007
- _sponsorship(account, address) {
11989
+ _contract(account, address) {
12008
11990
  const resolved = address ?? this.sponsorshipAddress;
12009
11991
  if (!resolved) {
12010
11992
  throw new Error("IP-Sponsorship address not configured for this chain");
12011
11993
  }
12012
11994
  return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), account);
12013
11995
  }
11996
+ _contractRead(address) {
11997
+ const resolved = address ?? this.sponsorshipAddress;
11998
+ if (!resolved) {
11999
+ throw new Error("IP-Sponsorship address not configured for this chain");
12000
+ }
12001
+ const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
12002
+ return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
12003
+ }
12004
+ // ── Offers (owner-initiated) ───────────────────────────────────────────────
12014
12005
  /** The offer author must currently own (nftContract, tokenId) — enforced on-chain at create and accept. */
12015
12006
  async createOffer(account, params) {
12016
12007
  const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
12017
- const call = this._sponsorship(account, params.sponsorshipAddress).populate("create_offer", [
12008
+ const call = this._contract(account, params.sponsorshipAddress).populate("create_offer", [
12018
12009
  params.nftContract,
12019
12010
  starknet.cairo.uint256(params.tokenId),
12020
12011
  starknet.cairo.uint256(params.minAmount),
@@ -12022,6 +12013,7 @@ var SponsorshipService = class {
12022
12013
  params.paymentToken,
12023
12014
  params.licenseTermsUri,
12024
12015
  params.transferable,
12016
+ starknet.cairo.uint256(params.royaltyBps),
12025
12017
  specificSponsor
12026
12018
  ]);
12027
12019
  const res = await account.execute([call]);
@@ -12029,7 +12021,7 @@ var SponsorshipService = class {
12029
12021
  }
12030
12022
  /** Reversible — gates new bids/acceptance only. */
12031
12023
  async setOfferOpen(account, params) {
12032
- const call = this._sponsorship(account, params.sponsorshipAddress).populate("set_offer_open", [
12024
+ const call = this._contract(account, params.sponsorshipAddress).populate("set_offer_open", [
12033
12025
  starknet.cairo.uint256(params.offerId),
12034
12026
  params.open
12035
12027
  ]);
@@ -12048,7 +12040,7 @@ var SponsorshipService = class {
12048
12040
  entrypoint: "approve",
12049
12041
  calldata: [normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
12050
12042
  };
12051
- const bidCall = this._sponsorship(account, sponsorshipAddress).populate("place_bid", [
12043
+ const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
12052
12044
  starknet.cairo.uint256(params.offerId),
12053
12045
  amount
12054
12046
  ]);
@@ -12056,54 +12048,139 @@ var SponsorshipService = class {
12056
12048
  return { txHash: res.transaction_hash };
12057
12049
  }
12058
12050
  async retractBid(account, params) {
12059
- const call = this._sponsorship(account, params.sponsorshipAddress).populate("retract_bid", [
12051
+ const call = this._contract(account, params.sponsorshipAddress).populate("retract_bid", [
12060
12052
  starknet.cairo.uint256(params.offerId)
12061
12053
  ]);
12062
12054
  const res = await account.execute([call]);
12063
12055
  return { txHash: res.transaction_hash };
12064
12056
  }
12065
12057
  /**
12066
- * Author-only. Settles the sponsor's payment (allowance pull, no escrow) and
12067
- * mints a non-authoritative receipt NFT to the sponsor via the dedicated
12068
- * sponsorship-license IPGenesis instancenever the genesis-mint instance.
12069
- * `is_license_valid()` on IPSponsorship remains the sole authority for
12070
- * gating/perks; the receipt is a wallet-visible courtesy only.
12058
+ * Author-only. Re-verifies IP ownership, settles the sponsor's payment
12059
+ * (allowance pull, no escrow), and mints the license a real ERC-721 on
12060
+ * this same contractto the sponsor, all atomically in one call.
12071
12061
  */
12072
12062
  async acceptBid(account, params) {
12073
- const receiptAddress = params.licenseReceiptAddress ?? this.licenseReceiptAddress;
12074
- if (!receiptAddress) {
12075
- throw new Error("IP-Sponsorship-License receipt address not configured for this chain");
12076
- }
12077
- const acceptCall = this._sponsorship(account, params.sponsorshipAddress).populate("accept_bid", [
12063
+ const call = this._contract(account, params.sponsorshipAddress).populate("accept_bid", [
12078
12064
  starknet.cairo.uint256(params.offerId),
12079
12065
  params.sponsor
12080
12066
  ]);
12081
- const receipt = newContract(IPGenesisABI, normalizeAddress("STARKNET", receiptAddress), account);
12082
- const mintCall = receipt.populate("mint_item", [params.sponsor, params.licenseTermsUri]);
12083
- const res = await account.execute([acceptCall, mintCall]);
12067
+ const res = await account.execute([call]);
12068
+ return { txHash: res.transaction_hash };
12069
+ }
12070
+ // ── Proposals (sponsor-initiated) ──────────────────────────────────────────
12071
+ // The symmetric counterpart to offers/bids: a sponsor proposes fixed terms
12072
+ // on an asset with no open offer yet; only the asset's current owner may
12073
+ // accept or reject. Unlike an offer, the SPONSOR chooses `paymentToken` here
12074
+ // — an accepting owner's UI should surface only recognized tokens, since a
12075
+ // bad-faith ERC-20 could return `true` on `transfer_from` without moving funds.
12076
+ async proposeSponsorship(account, params) {
12077
+ const call = this._contract(account, params.sponsorshipAddress).populate("propose_sponsorship", [
12078
+ params.nftContract,
12079
+ starknet.cairo.uint256(params.tokenId),
12080
+ starknet.cairo.uint256(params.amount),
12081
+ params.duration,
12082
+ params.validUntil ?? 0,
12083
+ params.paymentToken,
12084
+ params.licenseTermsUri,
12085
+ params.transferable,
12086
+ starknet.cairo.uint256(params.royaltyBps)
12087
+ ]);
12088
+ const res = await account.execute([call]);
12089
+ return { txHash: res.transaction_hash };
12090
+ }
12091
+ /** Proposer-only. Advisory against an acceptance in flight in the same block. */
12092
+ async withdrawProposal(account, params) {
12093
+ const call = this._contract(account, params.sponsorshipAddress).populate("withdraw_proposal", [
12094
+ starknet.cairo.uint256(params.proposalId)
12095
+ ]);
12096
+ const res = await account.execute([call]);
12084
12097
  return { txHash: res.transaction_hash };
12085
12098
  }
12086
12099
  /**
12087
- * Best-effortbundles a receipt-NFT transfer alongside `transfer_license`
12088
- * when both `licenseReceiptAddress` and `receiptTokenId` are supplied.
12089
- * IPSponsorship's own license ownership stays authoritative regardless of
12090
- * whether the receipt NFT is kept in sync.
12100
+ * Asset-owner-only (re-verified on-chain — a proposal binds to the asset,
12101
+ * not a person: whoever owns it at acceptance time is paid and issues the
12102
+ * license). Settles payment and mints the license atomically, same as
12103
+ * `acceptBid`.
12091
12104
  */
12092
- async transferLicense(account, params) {
12093
- const calls = [
12094
- this._sponsorship(account, params.sponsorshipAddress).populate("transfer_license", [
12095
- starknet.cairo.uint256(params.licenseId),
12096
- params.to
12097
- ])
12098
- ];
12099
- const receiptAddress = params.licenseReceiptAddress ?? this.licenseReceiptAddress;
12100
- if (receiptAddress && params.receiptTokenId != null) {
12101
- const receipt = newContract(IPGenesisABI, normalizeAddress("STARKNET", receiptAddress), account);
12102
- calls.push(receipt.populate("transfer_from", [account.address, params.to, starknet.cairo.uint256(params.receiptTokenId)]));
12103
- }
12104
- const res = await account.execute(calls);
12105
+ async acceptProposal(account, params) {
12106
+ const call = this._contract(account, params.sponsorshipAddress).populate("accept_proposal", [
12107
+ starknet.cairo.uint256(params.proposalId)
12108
+ ]);
12109
+ const res = await account.execute([call]);
12110
+ return { txHash: res.transaction_hash };
12111
+ }
12112
+ /** Asset-owner-only. */
12113
+ async rejectProposal(account, params) {
12114
+ const call = this._contract(account, params.sponsorshipAddress).populate("reject_proposal", [
12115
+ starknet.cairo.uint256(params.proposalId)
12116
+ ]);
12117
+ const res = await account.execute([call]);
12105
12118
  return { txHash: res.transaction_hash };
12106
12119
  }
12120
+ // ── Reads ───────────────────────────────────────────────────────────────────
12121
+ async getOffer(params) {
12122
+ const o = await this._contractRead(params.sponsorshipAddress).call("get_offer", [
12123
+ starknet.cairo.uint256(params.offerId)
12124
+ ]);
12125
+ return {
12126
+ author: o.author,
12127
+ nftContract: o.nft_contract,
12128
+ tokenId: BigInt(o.token_id),
12129
+ minAmount: BigInt(o.min_amount),
12130
+ duration: Number(o.duration),
12131
+ paymentToken: o.payment_token,
12132
+ licenseTermsUri: o.license_terms_uri,
12133
+ transferable: Boolean(o.transferable),
12134
+ specificSponsor: o.specific_sponsor?.variant === "Some" ? o.specific_sponsor.values?.[0] ?? o.specific_sponsor.value : null,
12135
+ open: Boolean(o.open),
12136
+ royaltyBps: BigInt(o.royalty_bps)
12137
+ };
12138
+ }
12139
+ async getBid(params) {
12140
+ const result = await this._contractRead(params.sponsorshipAddress).call("get_bid", [
12141
+ starknet.cairo.uint256(params.offerId),
12142
+ params.sponsor
12143
+ ]);
12144
+ return BigInt(result);
12145
+ }
12146
+ async getProposal(params) {
12147
+ const p = await this._contractRead(params.sponsorshipAddress).call("get_proposal", [
12148
+ starknet.cairo.uint256(params.proposalId)
12149
+ ]);
12150
+ return {
12151
+ proposer: p.proposer,
12152
+ nftContract: p.nft_contract,
12153
+ tokenId: BigInt(p.token_id),
12154
+ amount: BigInt(p.amount),
12155
+ duration: Number(p.duration),
12156
+ validUntil: Number(p.valid_until),
12157
+ paymentToken: p.payment_token,
12158
+ licenseTermsUri: p.license_terms_uri,
12159
+ transferable: Boolean(p.transferable),
12160
+ open: Boolean(p.open),
12161
+ royaltyBps: BigInt(p.royalty_bps)
12162
+ };
12163
+ }
12164
+ async getLastOfferId(params) {
12165
+ const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_offer_id", []);
12166
+ return BigInt(result);
12167
+ }
12168
+ async getLastProposalId(params) {
12169
+ const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_proposal_id", []);
12170
+ return BigInt(result);
12171
+ }
12172
+ async getLastLicenseId(params) {
12173
+ const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_license_id", []);
12174
+ return BigInt(result);
12175
+ }
12176
+ /** EIP-2981 — royalty recipient (the license's issuing author) and amount owed on a resale at `salePrice`. */
12177
+ async royaltyInfo(params) {
12178
+ const [recipient, amount] = await this._contractRead(params.sponsorshipAddress).call("royalty_info", [
12179
+ starknet.cairo.uint256(params.licenseId),
12180
+ starknet.cairo.uint256(params.salePrice)
12181
+ ]);
12182
+ return { recipient, amount: BigInt(amount) };
12183
+ }
12107
12184
  };
12108
12185
 
12109
12186
  // src/starknet/client.ts
@@ -12940,7 +13017,6 @@ exports.IPGenesisABI = IPGenesisABI;
12940
13017
  exports.IPMarketplaceABI = IPMarketplaceABI;
12941
13018
  exports.IPNftABI = IPNftABI;
12942
13019
  exports.IPSponsorshipABI = IPSponsorshipABI;
12943
- exports.IPSponsorshipLicenseABI = IPSponsorshipLicenseABI;
12944
13020
  exports.IPTicketCollectionABI = IPTicketCollectionABI;
12945
13021
  exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
12946
13022
  exports.LAUNCH_PRICE_QUOTE_PER_COIN = LAUNCH_PRICE_QUOTE_PER_COIN;
@@ -12973,8 +13049,8 @@ exports.STARKNET_IP_CLUB_COLLECTION_CLASS_HASH = STARKNET_IP_CLUB_COLLECTION_CLA
12973
13049
  exports.STARKNET_IP_CLUB_FACTORY_CONTRACT = STARKNET_IP_CLUB_FACTORY_CONTRACT;
12974
13050
  exports.STARKNET_IP_CLUB_NFT_CLASS_HASH = STARKNET_IP_CLUB_NFT_CLASS_HASH;
12975
13051
  exports.STARKNET_IP_CLUB_REGISTRY_CONTRACT = STARKNET_IP_CLUB_REGISTRY_CONTRACT;
13052
+ exports.STARKNET_IP_SPONSORSHIP_CLASS_HASH = STARKNET_IP_SPONSORSHIP_CLASS_HASH;
12976
13053
  exports.STARKNET_IP_SPONSORSHIP_CONTRACT = STARKNET_IP_SPONSORSHIP_CONTRACT;
12977
- exports.STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT = STARKNET_IP_SPONSORSHIP_LICENSE_CONTRACT;
12978
13054
  exports.STARKNET_IP_TICKETS_FACTORY_CONTRACT = STARKNET_IP_TICKETS_FACTORY_CONTRACT;
12979
13055
  exports.STARKNET_IP_TICKET_COLLECTION_CLASS_HASH = STARKNET_IP_TICKET_COLLECTION_CLASS_HASH;
12980
13056
  exports.STARKNET_MARKETPLACE_1155_CLASS_HASH = STARKNET_MARKETPLACE_1155_CLASS_HASH;