@medialane/sdk 0.7.0 → 0.7.2

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.d.cts CHANGED
@@ -39,10 +39,10 @@ type Network = (typeof SUPPORTED_NETWORKS)[number];
39
39
  declare const DEFAULT_RPC_URL = "https://rpc.starknet.lava.build";
40
40
  declare const POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
41
41
  declare const DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
42
- /** IP-Programmable-ERC1155-Collections factory. Deployed 2026-04-15. */
43
- declare const ERC1155_FACTORY_CONTRACT_MAINNET = "0x0459a9a3c04be5d884a038744f977dff019897264d4a281f9e0f87af417b3bec";
44
- /** Class hash of the IPCollection ERC-1155 implementation. Deployed 2026-04-15. */
45
- declare const ERC1155_COLLECTION_CLASS_HASH_MAINNET = "0x02da5e81be7a1ca493b9441522c450f8ff4c54b14ec16a0c2349f5e6e6fdc5d7";
42
+ /** IP-Programmable-ERC1155-Collections factory. Redeployed 2026-04-16 (v2 — adds base_uri). */
43
+ declare const ERC1155_FACTORY_CONTRACT_MAINNET = "0x006b2dc7ca7c4f466bb4575ba043d934310f052074f849caf853a86bcb819fd6";
44
+ /** Class hash of the IPCollection ERC-1155 implementation. Redeployed 2026-04-16 (v2). */
45
+ declare const ERC1155_COLLECTION_CLASS_HASH_MAINNET = "0x39a85126c6627db263617e5bce2bb72e49d2bb1f20961efc8b8954665bcfd25";
46
46
 
47
47
  interface RetryOptions {
48
48
  maxAttempts?: number;
@@ -771,6 +771,8 @@ interface ApiCreatorProfile {
771
771
  bio: string | null;
772
772
  avatarImage: string | null;
773
773
  bannerImage: string | null;
774
+ /** First collection image for creators without avatarImage/bannerImage. Populated by the API, null otherwise. */
775
+ collectionImage: string | null;
774
776
  websiteUrl: string | null;
775
777
  twitterUrl: string | null;
776
778
  discordUrl: string | null;
@@ -2702,11 +2704,23 @@ declare const IPCollection1155FactoryABI: readonly [{
2702
2704
  }, {
2703
2705
  readonly name: "symbol";
2704
2706
  readonly type: "core::byte_array::ByteArray";
2707
+ }, {
2708
+ readonly name: "base_uri";
2709
+ readonly type: "core::byte_array::ByteArray";
2705
2710
  }];
2706
2711
  readonly outputs: readonly [{
2707
2712
  readonly type: "core::starknet::contract_address::ContractAddress";
2708
2713
  }];
2709
2714
  readonly state_mutability: "external";
2715
+ }, {
2716
+ readonly type: "function";
2717
+ readonly name: "update_collection_class_hash";
2718
+ readonly inputs: readonly [{
2719
+ readonly name: "new_class_hash";
2720
+ readonly type: "core::starknet::class_hash::ClassHash";
2721
+ }];
2722
+ readonly outputs: readonly [];
2723
+ readonly state_mutability: "external";
2710
2724
  }, {
2711
2725
  readonly type: "function";
2712
2726
  readonly name: "owner";
@@ -2717,6 +2731,41 @@ declare const IPCollection1155FactoryABI: readonly [{
2717
2731
  readonly state_mutability: "view";
2718
2732
  }];
2719
2733
  declare const IPCollection1155ABI: readonly [{
2734
+ readonly type: "function";
2735
+ readonly name: "name";
2736
+ readonly inputs: readonly [];
2737
+ readonly outputs: readonly [{
2738
+ readonly type: "core::byte_array::ByteArray";
2739
+ }];
2740
+ readonly state_mutability: "view";
2741
+ }, {
2742
+ readonly type: "function";
2743
+ readonly name: "symbol";
2744
+ readonly inputs: readonly [];
2745
+ readonly outputs: readonly [{
2746
+ readonly type: "core::byte_array::ByteArray";
2747
+ }];
2748
+ readonly state_mutability: "view";
2749
+ }, {
2750
+ readonly type: "function";
2751
+ readonly name: "base_uri";
2752
+ readonly inputs: readonly [];
2753
+ readonly outputs: readonly [{
2754
+ readonly type: "core::byte_array::ByteArray";
2755
+ }];
2756
+ readonly state_mutability: "view";
2757
+ }, {
2758
+ readonly type: "function";
2759
+ readonly name: "uri";
2760
+ readonly inputs: readonly [{
2761
+ readonly name: "token_id";
2762
+ readonly type: "core::integer::u256";
2763
+ }];
2764
+ readonly outputs: readonly [{
2765
+ readonly type: "core::byte_array::ByteArray";
2766
+ }];
2767
+ readonly state_mutability: "view";
2768
+ }, {
2720
2769
  readonly type: "function";
2721
2770
  readonly name: "mint_item";
2722
2771
  readonly inputs: readonly [{
@@ -2754,32 +2803,32 @@ declare const IPCollection1155ABI: readonly [{
2754
2803
  readonly state_mutability: "external";
2755
2804
  }, {
2756
2805
  readonly type: "function";
2757
- readonly name: "uri";
2758
- readonly inputs: readonly [{
2759
- readonly name: "token_id";
2760
- readonly type: "core::integer::u256";
2761
- }];
2806
+ readonly name: "get_collection_creator";
2807
+ readonly inputs: readonly [];
2762
2808
  readonly outputs: readonly [{
2763
- readonly type: "core::byte_array::ByteArray";
2809
+ readonly type: "core::starknet::contract_address::ContractAddress";
2764
2810
  }];
2765
2811
  readonly state_mutability: "view";
2766
2812
  }, {
2767
2813
  readonly type: "function";
2768
- readonly name: "get_collection_creator";
2769
- readonly inputs: readonly [];
2814
+ readonly name: "get_token_creator";
2815
+ readonly inputs: readonly [{
2816
+ readonly name: "token_id";
2817
+ readonly type: "core::integer::u256";
2818
+ }];
2770
2819
  readonly outputs: readonly [{
2771
2820
  readonly type: "core::starknet::contract_address::ContractAddress";
2772
2821
  }];
2773
2822
  readonly state_mutability: "view";
2774
2823
  }, {
2775
2824
  readonly type: "function";
2776
- readonly name: "get_token_creator";
2825
+ readonly name: "get_token_registered_at";
2777
2826
  readonly inputs: readonly [{
2778
2827
  readonly name: "token_id";
2779
2828
  readonly type: "core::integer::u256";
2780
2829
  }];
2781
2830
  readonly outputs: readonly [{
2782
- readonly type: "core::starknet::contract_address::ContractAddress";
2831
+ readonly type: "core::integer::u64";
2783
2832
  }];
2784
2833
  readonly state_mutability: "view";
2785
2834
  }, {
@@ -2832,8 +2881,39 @@ declare const IPCollection1155ABI: readonly [{
2832
2881
  readonly state_mutability: "view";
2833
2882
  }, {
2834
2883
  readonly type: "function";
2835
- readonly name: "set_royalty";
2884
+ readonly name: "royalty_info";
2885
+ readonly inputs: readonly [{
2886
+ readonly name: "token_id";
2887
+ readonly type: "core::integer::u256";
2888
+ }, {
2889
+ readonly name: "sale_price";
2890
+ readonly type: "core::integer::u256";
2891
+ }];
2892
+ readonly outputs: readonly [{
2893
+ readonly type: "core::starknet::contract_address::ContractAddress";
2894
+ }, {
2895
+ readonly type: "core::integer::u256";
2896
+ }];
2897
+ readonly state_mutability: "view";
2898
+ }, {
2899
+ readonly type: "function";
2900
+ readonly name: "set_default_royalty";
2901
+ readonly inputs: readonly [{
2902
+ readonly name: "receiver";
2903
+ readonly type: "core::starknet::contract_address::ContractAddress";
2904
+ }, {
2905
+ readonly name: "fee_numerator";
2906
+ readonly type: "core::integer::u128";
2907
+ }];
2908
+ readonly outputs: readonly [];
2909
+ readonly state_mutability: "external";
2910
+ }, {
2911
+ readonly type: "function";
2912
+ readonly name: "set_token_royalty";
2836
2913
  readonly inputs: readonly [{
2914
+ readonly name: "token_id";
2915
+ readonly type: "core::integer::u256";
2916
+ }, {
2837
2917
  readonly name: "receiver";
2838
2918
  readonly type: "core::starknet::contract_address::ContractAddress";
2839
2919
  }, {
@@ -2842,6 +2922,21 @@ declare const IPCollection1155ABI: readonly [{
2842
2922
  }];
2843
2923
  readonly outputs: readonly [];
2844
2924
  readonly state_mutability: "external";
2925
+ }, {
2926
+ readonly type: "function";
2927
+ readonly name: "delete_default_royalty";
2928
+ readonly inputs: readonly [];
2929
+ readonly outputs: readonly [];
2930
+ readonly state_mutability: "external";
2931
+ }, {
2932
+ readonly type: "function";
2933
+ readonly name: "reset_token_royalty";
2934
+ readonly inputs: readonly [{
2935
+ readonly name: "token_id";
2936
+ readonly type: "core::integer::u256";
2937
+ }];
2938
+ readonly outputs: readonly [];
2939
+ readonly state_mutability: "external";
2845
2940
  }];
2846
2941
 
2847
2942
  interface DeployCollectionParams {
@@ -2849,6 +2944,12 @@ interface DeployCollectionParams {
2849
2944
  name: string;
2850
2945
  /** Short ticker symbol (e.g. "MIP") */
2851
2946
  symbol: string;
2947
+ /**
2948
+ * Collection-level metadata URI (e.g. "ipfs://Qm…/collection.json").
2949
+ * Should point to a JSON containing `name`, `description`, `image`, and `external_link`.
2950
+ * Stored on-chain at deploy time. Pass an empty string if not available.
2951
+ */
2952
+ baseUri: string;
2852
2953
  }
2853
2954
  interface MintItemParams {
2854
2955
  /** ERC-1155 collection contract address */
@@ -2901,15 +3002,25 @@ declare class ERC1155CollectionService {
2901
3002
  */
2902
3003
  batchMintItem(account: AccountInterface, params: BatchMintItemParams): Promise<TxResult>;
2903
3004
  /**
2904
- * Set ERC-2981 royalties for the collection.
3005
+ * Set the default ERC-2981 royalty for the entire collection.
2905
3006
  * `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
2906
3007
  * Caller must be the collection owner.
2907
3008
  */
2908
- setRoyalty(account: AccountInterface, params: {
3009
+ setDefaultRoyalty(account: AccountInterface, params: {
2909
3010
  collection: string;
2910
3011
  receiver: string;
2911
3012
  feeNumerator: number;
2912
3013
  }): Promise<TxResult>;
3014
+ /**
3015
+ * Set a per-token ERC-2981 royalty override.
3016
+ * `feeNumerator` is out of 10 000. Caller must be the collection owner.
3017
+ */
3018
+ setTokenRoyalty(account: AccountInterface, params: {
3019
+ collection: string;
3020
+ tokenId: bigint | string;
3021
+ receiver: string;
3022
+ feeNumerator: number;
3023
+ }): Promise<TxResult>;
2913
3024
  /**
2914
3025
  * Approve the Medialane1155 marketplace (or any operator) to transfer
2915
3026
  * all tokens on behalf of `account`. Required before listing.
package/dist/index.d.ts CHANGED
@@ -39,10 +39,10 @@ type Network = (typeof SUPPORTED_NETWORKS)[number];
39
39
  declare const DEFAULT_RPC_URL = "https://rpc.starknet.lava.build";
40
40
  declare const POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
41
41
  declare const DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
42
- /** IP-Programmable-ERC1155-Collections factory. Deployed 2026-04-15. */
43
- declare const ERC1155_FACTORY_CONTRACT_MAINNET = "0x0459a9a3c04be5d884a038744f977dff019897264d4a281f9e0f87af417b3bec";
44
- /** Class hash of the IPCollection ERC-1155 implementation. Deployed 2026-04-15. */
45
- declare const ERC1155_COLLECTION_CLASS_HASH_MAINNET = "0x02da5e81be7a1ca493b9441522c450f8ff4c54b14ec16a0c2349f5e6e6fdc5d7";
42
+ /** IP-Programmable-ERC1155-Collections factory. Redeployed 2026-04-16 (v2 — adds base_uri). */
43
+ declare const ERC1155_FACTORY_CONTRACT_MAINNET = "0x006b2dc7ca7c4f466bb4575ba043d934310f052074f849caf853a86bcb819fd6";
44
+ /** Class hash of the IPCollection ERC-1155 implementation. Redeployed 2026-04-16 (v2). */
45
+ declare const ERC1155_COLLECTION_CLASS_HASH_MAINNET = "0x39a85126c6627db263617e5bce2bb72e49d2bb1f20961efc8b8954665bcfd25";
46
46
 
47
47
  interface RetryOptions {
48
48
  maxAttempts?: number;
@@ -771,6 +771,8 @@ interface ApiCreatorProfile {
771
771
  bio: string | null;
772
772
  avatarImage: string | null;
773
773
  bannerImage: string | null;
774
+ /** First collection image for creators without avatarImage/bannerImage. Populated by the API, null otherwise. */
775
+ collectionImage: string | null;
774
776
  websiteUrl: string | null;
775
777
  twitterUrl: string | null;
776
778
  discordUrl: string | null;
@@ -2702,11 +2704,23 @@ declare const IPCollection1155FactoryABI: readonly [{
2702
2704
  }, {
2703
2705
  readonly name: "symbol";
2704
2706
  readonly type: "core::byte_array::ByteArray";
2707
+ }, {
2708
+ readonly name: "base_uri";
2709
+ readonly type: "core::byte_array::ByteArray";
2705
2710
  }];
2706
2711
  readonly outputs: readonly [{
2707
2712
  readonly type: "core::starknet::contract_address::ContractAddress";
2708
2713
  }];
2709
2714
  readonly state_mutability: "external";
2715
+ }, {
2716
+ readonly type: "function";
2717
+ readonly name: "update_collection_class_hash";
2718
+ readonly inputs: readonly [{
2719
+ readonly name: "new_class_hash";
2720
+ readonly type: "core::starknet::class_hash::ClassHash";
2721
+ }];
2722
+ readonly outputs: readonly [];
2723
+ readonly state_mutability: "external";
2710
2724
  }, {
2711
2725
  readonly type: "function";
2712
2726
  readonly name: "owner";
@@ -2717,6 +2731,41 @@ declare const IPCollection1155FactoryABI: readonly [{
2717
2731
  readonly state_mutability: "view";
2718
2732
  }];
2719
2733
  declare const IPCollection1155ABI: readonly [{
2734
+ readonly type: "function";
2735
+ readonly name: "name";
2736
+ readonly inputs: readonly [];
2737
+ readonly outputs: readonly [{
2738
+ readonly type: "core::byte_array::ByteArray";
2739
+ }];
2740
+ readonly state_mutability: "view";
2741
+ }, {
2742
+ readonly type: "function";
2743
+ readonly name: "symbol";
2744
+ readonly inputs: readonly [];
2745
+ readonly outputs: readonly [{
2746
+ readonly type: "core::byte_array::ByteArray";
2747
+ }];
2748
+ readonly state_mutability: "view";
2749
+ }, {
2750
+ readonly type: "function";
2751
+ readonly name: "base_uri";
2752
+ readonly inputs: readonly [];
2753
+ readonly outputs: readonly [{
2754
+ readonly type: "core::byte_array::ByteArray";
2755
+ }];
2756
+ readonly state_mutability: "view";
2757
+ }, {
2758
+ readonly type: "function";
2759
+ readonly name: "uri";
2760
+ readonly inputs: readonly [{
2761
+ readonly name: "token_id";
2762
+ readonly type: "core::integer::u256";
2763
+ }];
2764
+ readonly outputs: readonly [{
2765
+ readonly type: "core::byte_array::ByteArray";
2766
+ }];
2767
+ readonly state_mutability: "view";
2768
+ }, {
2720
2769
  readonly type: "function";
2721
2770
  readonly name: "mint_item";
2722
2771
  readonly inputs: readonly [{
@@ -2754,32 +2803,32 @@ declare const IPCollection1155ABI: readonly [{
2754
2803
  readonly state_mutability: "external";
2755
2804
  }, {
2756
2805
  readonly type: "function";
2757
- readonly name: "uri";
2758
- readonly inputs: readonly [{
2759
- readonly name: "token_id";
2760
- readonly type: "core::integer::u256";
2761
- }];
2806
+ readonly name: "get_collection_creator";
2807
+ readonly inputs: readonly [];
2762
2808
  readonly outputs: readonly [{
2763
- readonly type: "core::byte_array::ByteArray";
2809
+ readonly type: "core::starknet::contract_address::ContractAddress";
2764
2810
  }];
2765
2811
  readonly state_mutability: "view";
2766
2812
  }, {
2767
2813
  readonly type: "function";
2768
- readonly name: "get_collection_creator";
2769
- readonly inputs: readonly [];
2814
+ readonly name: "get_token_creator";
2815
+ readonly inputs: readonly [{
2816
+ readonly name: "token_id";
2817
+ readonly type: "core::integer::u256";
2818
+ }];
2770
2819
  readonly outputs: readonly [{
2771
2820
  readonly type: "core::starknet::contract_address::ContractAddress";
2772
2821
  }];
2773
2822
  readonly state_mutability: "view";
2774
2823
  }, {
2775
2824
  readonly type: "function";
2776
- readonly name: "get_token_creator";
2825
+ readonly name: "get_token_registered_at";
2777
2826
  readonly inputs: readonly [{
2778
2827
  readonly name: "token_id";
2779
2828
  readonly type: "core::integer::u256";
2780
2829
  }];
2781
2830
  readonly outputs: readonly [{
2782
- readonly type: "core::starknet::contract_address::ContractAddress";
2831
+ readonly type: "core::integer::u64";
2783
2832
  }];
2784
2833
  readonly state_mutability: "view";
2785
2834
  }, {
@@ -2832,8 +2881,39 @@ declare const IPCollection1155ABI: readonly [{
2832
2881
  readonly state_mutability: "view";
2833
2882
  }, {
2834
2883
  readonly type: "function";
2835
- readonly name: "set_royalty";
2884
+ readonly name: "royalty_info";
2885
+ readonly inputs: readonly [{
2886
+ readonly name: "token_id";
2887
+ readonly type: "core::integer::u256";
2888
+ }, {
2889
+ readonly name: "sale_price";
2890
+ readonly type: "core::integer::u256";
2891
+ }];
2892
+ readonly outputs: readonly [{
2893
+ readonly type: "core::starknet::contract_address::ContractAddress";
2894
+ }, {
2895
+ readonly type: "core::integer::u256";
2896
+ }];
2897
+ readonly state_mutability: "view";
2898
+ }, {
2899
+ readonly type: "function";
2900
+ readonly name: "set_default_royalty";
2901
+ readonly inputs: readonly [{
2902
+ readonly name: "receiver";
2903
+ readonly type: "core::starknet::contract_address::ContractAddress";
2904
+ }, {
2905
+ readonly name: "fee_numerator";
2906
+ readonly type: "core::integer::u128";
2907
+ }];
2908
+ readonly outputs: readonly [];
2909
+ readonly state_mutability: "external";
2910
+ }, {
2911
+ readonly type: "function";
2912
+ readonly name: "set_token_royalty";
2836
2913
  readonly inputs: readonly [{
2914
+ readonly name: "token_id";
2915
+ readonly type: "core::integer::u256";
2916
+ }, {
2837
2917
  readonly name: "receiver";
2838
2918
  readonly type: "core::starknet::contract_address::ContractAddress";
2839
2919
  }, {
@@ -2842,6 +2922,21 @@ declare const IPCollection1155ABI: readonly [{
2842
2922
  }];
2843
2923
  readonly outputs: readonly [];
2844
2924
  readonly state_mutability: "external";
2925
+ }, {
2926
+ readonly type: "function";
2927
+ readonly name: "delete_default_royalty";
2928
+ readonly inputs: readonly [];
2929
+ readonly outputs: readonly [];
2930
+ readonly state_mutability: "external";
2931
+ }, {
2932
+ readonly type: "function";
2933
+ readonly name: "reset_token_royalty";
2934
+ readonly inputs: readonly [{
2935
+ readonly name: "token_id";
2936
+ readonly type: "core::integer::u256";
2937
+ }];
2938
+ readonly outputs: readonly [];
2939
+ readonly state_mutability: "external";
2845
2940
  }];
2846
2941
 
2847
2942
  interface DeployCollectionParams {
@@ -2849,6 +2944,12 @@ interface DeployCollectionParams {
2849
2944
  name: string;
2850
2945
  /** Short ticker symbol (e.g. "MIP") */
2851
2946
  symbol: string;
2947
+ /**
2948
+ * Collection-level metadata URI (e.g. "ipfs://Qm…/collection.json").
2949
+ * Should point to a JSON containing `name`, `description`, `image`, and `external_link`.
2950
+ * Stored on-chain at deploy time. Pass an empty string if not available.
2951
+ */
2952
+ baseUri: string;
2852
2953
  }
2853
2954
  interface MintItemParams {
2854
2955
  /** ERC-1155 collection contract address */
@@ -2901,15 +3002,25 @@ declare class ERC1155CollectionService {
2901
3002
  */
2902
3003
  batchMintItem(account: AccountInterface, params: BatchMintItemParams): Promise<TxResult>;
2903
3004
  /**
2904
- * Set ERC-2981 royalties for the collection.
3005
+ * Set the default ERC-2981 royalty for the entire collection.
2905
3006
  * `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
2906
3007
  * Caller must be the collection owner.
2907
3008
  */
2908
- setRoyalty(account: AccountInterface, params: {
3009
+ setDefaultRoyalty(account: AccountInterface, params: {
2909
3010
  collection: string;
2910
3011
  receiver: string;
2911
3012
  feeNumerator: number;
2912
3013
  }): Promise<TxResult>;
3014
+ /**
3015
+ * Set a per-token ERC-2981 royalty override.
3016
+ * `feeNumerator` is out of 10 000. Caller must be the collection owner.
3017
+ */
3018
+ setTokenRoyalty(account: AccountInterface, params: {
3019
+ collection: string;
3020
+ tokenId: bigint | string;
3021
+ receiver: string;
3022
+ feeNumerator: number;
3023
+ }): Promise<TxResult>;
2913
3024
  /**
2914
3025
  * Approve the Medialane1155 marketplace (or any operator) to transfer
2915
3026
  * all tokens on behalf of `account`. Required before listing.
package/dist/index.js CHANGED
@@ -47,8 +47,8 @@ var SUPPORTED_NETWORKS = ["mainnet"];
47
47
  var DEFAULT_RPC_URL = "https://rpc.starknet.lava.build";
48
48
  var POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
49
49
  var DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
50
- var ERC1155_FACTORY_CONTRACT_MAINNET = "0x0459a9a3c04be5d884a038744f977dff019897264d4a281f9e0f87af417b3bec";
51
- var ERC1155_COLLECTION_CLASS_HASH_MAINNET = "0x02da5e81be7a1ca493b9441522c450f8ff4c54b14ec16a0c2349f5e6e6fdc5d7";
50
+ var ERC1155_FACTORY_CONTRACT_MAINNET = "0x006b2dc7ca7c4f466bb4575ba043d934310f052074f849caf853a86bcb819fd6";
51
+ var ERC1155_COLLECTION_CLASS_HASH_MAINNET = "0x39a85126c6627db263617e5bce2bb72e49d2bb1f20961efc8b8954665bcfd25";
52
52
 
53
53
  // src/config.ts
54
54
  var MedialaneConfigSchema = z.object({
@@ -1733,11 +1733,19 @@ var IPCollection1155FactoryABI = [
1733
1733
  name: "deploy_collection",
1734
1734
  inputs: [
1735
1735
  { name: "name", type: "core::byte_array::ByteArray" },
1736
- { name: "symbol", type: "core::byte_array::ByteArray" }
1736
+ { name: "symbol", type: "core::byte_array::ByteArray" },
1737
+ { name: "base_uri", type: "core::byte_array::ByteArray" }
1737
1738
  ],
1738
1739
  outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
1739
1740
  state_mutability: "external"
1740
1741
  },
1742
+ {
1743
+ type: "function",
1744
+ name: "update_collection_class_hash",
1745
+ inputs: [{ name: "new_class_hash", type: "core::starknet::class_hash::ClassHash" }],
1746
+ outputs: [],
1747
+ state_mutability: "external"
1748
+ },
1741
1749
  {
1742
1750
  type: "function",
1743
1751
  name: "owner",
@@ -1747,6 +1755,36 @@ var IPCollection1155FactoryABI = [
1747
1755
  }
1748
1756
  ];
1749
1757
  var IPCollection1155ABI = [
1758
+ // ── Metadata views ──────────────────────────────────────────────────────────
1759
+ {
1760
+ type: "function",
1761
+ name: "name",
1762
+ inputs: [],
1763
+ outputs: [{ type: "core::byte_array::ByteArray" }],
1764
+ state_mutability: "view"
1765
+ },
1766
+ {
1767
+ type: "function",
1768
+ name: "symbol",
1769
+ inputs: [],
1770
+ outputs: [{ type: "core::byte_array::ByteArray" }],
1771
+ state_mutability: "view"
1772
+ },
1773
+ {
1774
+ type: "function",
1775
+ name: "base_uri",
1776
+ inputs: [],
1777
+ outputs: [{ type: "core::byte_array::ByteArray" }],
1778
+ state_mutability: "view"
1779
+ },
1780
+ {
1781
+ type: "function",
1782
+ name: "uri",
1783
+ inputs: [{ name: "token_id", type: "core::integer::u256" }],
1784
+ outputs: [{ type: "core::byte_array::ByteArray" }],
1785
+ state_mutability: "view"
1786
+ },
1787
+ // ── Minting ─────────────────────────────────────────────────────────────────
1750
1788
  {
1751
1789
  type: "function",
1752
1790
  name: "mint_item",
@@ -1771,13 +1809,7 @@ var IPCollection1155ABI = [
1771
1809
  outputs: [],
1772
1810
  state_mutability: "external"
1773
1811
  },
1774
- {
1775
- type: "function",
1776
- name: "uri",
1777
- inputs: [{ name: "token_id", type: "core::integer::u256" }],
1778
- outputs: [{ type: "core::byte_array::ByteArray" }],
1779
- state_mutability: "view"
1780
- },
1812
+ // ── Provenance queries ───────────────────────────────────────────────────────
1781
1813
  {
1782
1814
  type: "function",
1783
1815
  name: "get_collection_creator",
@@ -1792,6 +1824,14 @@ var IPCollection1155ABI = [
1792
1824
  outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
1793
1825
  state_mutability: "view"
1794
1826
  },
1827
+ {
1828
+ type: "function",
1829
+ name: "get_token_registered_at",
1830
+ inputs: [{ name: "token_id", type: "core::integer::u256" }],
1831
+ outputs: [{ type: "core::integer::u64" }],
1832
+ state_mutability: "view"
1833
+ },
1834
+ // ── Ownership ────────────────────────────────────────────────────────────────
1795
1835
  {
1796
1836
  type: "function",
1797
1837
  name: "owner",
@@ -1799,6 +1839,7 @@ var IPCollection1155ABI = [
1799
1839
  outputs: [{ type: "core::starknet::contract_address::ContractAddress" }],
1800
1840
  state_mutability: "view"
1801
1841
  },
1842
+ // ── ERC-1155 standard ────────────────────────────────────────────────────────
1802
1843
  {
1803
1844
  type: "function",
1804
1845
  name: "balance_of",
@@ -1829,15 +1870,54 @@ var IPCollection1155ABI = [
1829
1870
  outputs: [{ type: "core::bool" }],
1830
1871
  state_mutability: "view"
1831
1872
  },
1873
+ // ── ERC-2981 royalties ───────────────────────────────────────────────────────
1832
1874
  {
1833
1875
  type: "function",
1834
- name: "set_royalty",
1876
+ name: "royalty_info",
1877
+ inputs: [
1878
+ { name: "token_id", type: "core::integer::u256" },
1879
+ { name: "sale_price", type: "core::integer::u256" }
1880
+ ],
1881
+ outputs: [
1882
+ { type: "core::starknet::contract_address::ContractAddress" },
1883
+ { type: "core::integer::u256" }
1884
+ ],
1885
+ state_mutability: "view"
1886
+ },
1887
+ {
1888
+ type: "function",
1889
+ name: "set_default_royalty",
1835
1890
  inputs: [
1836
1891
  { name: "receiver", type: "core::starknet::contract_address::ContractAddress" },
1837
1892
  { name: "fee_numerator", type: "core::integer::u128" }
1838
1893
  ],
1839
1894
  outputs: [],
1840
1895
  state_mutability: "external"
1896
+ },
1897
+ {
1898
+ type: "function",
1899
+ name: "set_token_royalty",
1900
+ inputs: [
1901
+ { name: "token_id", type: "core::integer::u256" },
1902
+ { name: "receiver", type: "core::starknet::contract_address::ContractAddress" },
1903
+ { name: "fee_numerator", type: "core::integer::u128" }
1904
+ ],
1905
+ outputs: [],
1906
+ state_mutability: "external"
1907
+ },
1908
+ {
1909
+ type: "function",
1910
+ name: "delete_default_royalty",
1911
+ inputs: [],
1912
+ outputs: [],
1913
+ state_mutability: "external"
1914
+ },
1915
+ {
1916
+ type: "function",
1917
+ name: "reset_token_royalty",
1918
+ inputs: [{ name: "token_id", type: "core::integer::u256" }],
1919
+ outputs: [],
1920
+ state_mutability: "external"
1841
1921
  }
1842
1922
  ];
1843
1923
 
@@ -3315,7 +3395,7 @@ var ERC1155CollectionService = class {
3315
3395
  */
3316
3396
  async deployCollection(account, params) {
3317
3397
  const factory = this._factory(account);
3318
- const call = factory.populate("deploy_collection", [params.name, params.symbol]);
3398
+ const call = factory.populate("deploy_collection", [params.name, params.symbol, params.baseUri]);
3319
3399
  const res = await account.execute([call]);
3320
3400
  return { txHash: res.transaction_hash };
3321
3401
  }
@@ -3355,13 +3435,27 @@ var ERC1155CollectionService = class {
3355
3435
  return { txHash: res.transaction_hash };
3356
3436
  }
3357
3437
  /**
3358
- * Set ERC-2981 royalties for the collection.
3438
+ * Set the default ERC-2981 royalty for the entire collection.
3359
3439
  * `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
3360
3440
  * Caller must be the collection owner.
3361
3441
  */
3362
- async setRoyalty(account, params) {
3442
+ async setDefaultRoyalty(account, params) {
3363
3443
  const collection = this._collection(params.collection, account);
3364
- const call = collection.populate("set_royalty", [
3444
+ const call = collection.populate("set_default_royalty", [
3445
+ params.receiver,
3446
+ BigInt(params.feeNumerator)
3447
+ ]);
3448
+ const res = await account.execute([call]);
3449
+ return { txHash: res.transaction_hash };
3450
+ }
3451
+ /**
3452
+ * Set a per-token ERC-2981 royalty override.
3453
+ * `feeNumerator` is out of 10 000. Caller must be the collection owner.
3454
+ */
3455
+ async setTokenRoyalty(account, params) {
3456
+ const collection = this._collection(params.collection, account);
3457
+ const call = collection.populate("set_token_royalty", [
3458
+ BigInt(params.tokenId),
3365
3459
  params.receiver,
3366
3460
  BigInt(params.feeNumerator)
3367
3461
  ]);