@medialane/sdk 0.7.0 → 0.7.1
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 +109 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +126 -17
- package/dist/index.d.ts +126 -17
- package/dist/index.js +109 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
43
|
-
declare const ERC1155_FACTORY_CONTRACT_MAINNET = "
|
|
44
|
-
/** Class hash of the IPCollection ERC-1155 implementation.
|
|
45
|
-
declare const ERC1155_COLLECTION_CLASS_HASH_MAINNET = "
|
|
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;
|
|
@@ -2702,11 +2702,23 @@ declare const IPCollection1155FactoryABI: readonly [{
|
|
|
2702
2702
|
}, {
|
|
2703
2703
|
readonly name: "symbol";
|
|
2704
2704
|
readonly type: "core::byte_array::ByteArray";
|
|
2705
|
+
}, {
|
|
2706
|
+
readonly name: "base_uri";
|
|
2707
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2705
2708
|
}];
|
|
2706
2709
|
readonly outputs: readonly [{
|
|
2707
2710
|
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2708
2711
|
}];
|
|
2709
2712
|
readonly state_mutability: "external";
|
|
2713
|
+
}, {
|
|
2714
|
+
readonly type: "function";
|
|
2715
|
+
readonly name: "update_collection_class_hash";
|
|
2716
|
+
readonly inputs: readonly [{
|
|
2717
|
+
readonly name: "new_class_hash";
|
|
2718
|
+
readonly type: "core::starknet::class_hash::ClassHash";
|
|
2719
|
+
}];
|
|
2720
|
+
readonly outputs: readonly [];
|
|
2721
|
+
readonly state_mutability: "external";
|
|
2710
2722
|
}, {
|
|
2711
2723
|
readonly type: "function";
|
|
2712
2724
|
readonly name: "owner";
|
|
@@ -2717,6 +2729,41 @@ declare const IPCollection1155FactoryABI: readonly [{
|
|
|
2717
2729
|
readonly state_mutability: "view";
|
|
2718
2730
|
}];
|
|
2719
2731
|
declare const IPCollection1155ABI: readonly [{
|
|
2732
|
+
readonly type: "function";
|
|
2733
|
+
readonly name: "name";
|
|
2734
|
+
readonly inputs: readonly [];
|
|
2735
|
+
readonly outputs: readonly [{
|
|
2736
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2737
|
+
}];
|
|
2738
|
+
readonly state_mutability: "view";
|
|
2739
|
+
}, {
|
|
2740
|
+
readonly type: "function";
|
|
2741
|
+
readonly name: "symbol";
|
|
2742
|
+
readonly inputs: readonly [];
|
|
2743
|
+
readonly outputs: readonly [{
|
|
2744
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2745
|
+
}];
|
|
2746
|
+
readonly state_mutability: "view";
|
|
2747
|
+
}, {
|
|
2748
|
+
readonly type: "function";
|
|
2749
|
+
readonly name: "base_uri";
|
|
2750
|
+
readonly inputs: readonly [];
|
|
2751
|
+
readonly outputs: readonly [{
|
|
2752
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2753
|
+
}];
|
|
2754
|
+
readonly state_mutability: "view";
|
|
2755
|
+
}, {
|
|
2756
|
+
readonly type: "function";
|
|
2757
|
+
readonly name: "uri";
|
|
2758
|
+
readonly inputs: readonly [{
|
|
2759
|
+
readonly name: "token_id";
|
|
2760
|
+
readonly type: "core::integer::u256";
|
|
2761
|
+
}];
|
|
2762
|
+
readonly outputs: readonly [{
|
|
2763
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2764
|
+
}];
|
|
2765
|
+
readonly state_mutability: "view";
|
|
2766
|
+
}, {
|
|
2720
2767
|
readonly type: "function";
|
|
2721
2768
|
readonly name: "mint_item";
|
|
2722
2769
|
readonly inputs: readonly [{
|
|
@@ -2754,32 +2801,32 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
2754
2801
|
readonly state_mutability: "external";
|
|
2755
2802
|
}, {
|
|
2756
2803
|
readonly type: "function";
|
|
2757
|
-
readonly name: "
|
|
2758
|
-
readonly inputs: readonly [
|
|
2759
|
-
readonly name: "token_id";
|
|
2760
|
-
readonly type: "core::integer::u256";
|
|
2761
|
-
}];
|
|
2804
|
+
readonly name: "get_collection_creator";
|
|
2805
|
+
readonly inputs: readonly [];
|
|
2762
2806
|
readonly outputs: readonly [{
|
|
2763
|
-
readonly type: "core::
|
|
2807
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2764
2808
|
}];
|
|
2765
2809
|
readonly state_mutability: "view";
|
|
2766
2810
|
}, {
|
|
2767
2811
|
readonly type: "function";
|
|
2768
|
-
readonly name: "
|
|
2769
|
-
readonly inputs: readonly [
|
|
2812
|
+
readonly name: "get_token_creator";
|
|
2813
|
+
readonly inputs: readonly [{
|
|
2814
|
+
readonly name: "token_id";
|
|
2815
|
+
readonly type: "core::integer::u256";
|
|
2816
|
+
}];
|
|
2770
2817
|
readonly outputs: readonly [{
|
|
2771
2818
|
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2772
2819
|
}];
|
|
2773
2820
|
readonly state_mutability: "view";
|
|
2774
2821
|
}, {
|
|
2775
2822
|
readonly type: "function";
|
|
2776
|
-
readonly name: "
|
|
2823
|
+
readonly name: "get_token_registered_at";
|
|
2777
2824
|
readonly inputs: readonly [{
|
|
2778
2825
|
readonly name: "token_id";
|
|
2779
2826
|
readonly type: "core::integer::u256";
|
|
2780
2827
|
}];
|
|
2781
2828
|
readonly outputs: readonly [{
|
|
2782
|
-
readonly type: "core::
|
|
2829
|
+
readonly type: "core::integer::u64";
|
|
2783
2830
|
}];
|
|
2784
2831
|
readonly state_mutability: "view";
|
|
2785
2832
|
}, {
|
|
@@ -2832,8 +2879,39 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
2832
2879
|
readonly state_mutability: "view";
|
|
2833
2880
|
}, {
|
|
2834
2881
|
readonly type: "function";
|
|
2835
|
-
readonly name: "
|
|
2882
|
+
readonly name: "royalty_info";
|
|
2883
|
+
readonly inputs: readonly [{
|
|
2884
|
+
readonly name: "token_id";
|
|
2885
|
+
readonly type: "core::integer::u256";
|
|
2886
|
+
}, {
|
|
2887
|
+
readonly name: "sale_price";
|
|
2888
|
+
readonly type: "core::integer::u256";
|
|
2889
|
+
}];
|
|
2890
|
+
readonly outputs: readonly [{
|
|
2891
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2892
|
+
}, {
|
|
2893
|
+
readonly type: "core::integer::u256";
|
|
2894
|
+
}];
|
|
2895
|
+
readonly state_mutability: "view";
|
|
2896
|
+
}, {
|
|
2897
|
+
readonly type: "function";
|
|
2898
|
+
readonly name: "set_default_royalty";
|
|
2899
|
+
readonly inputs: readonly [{
|
|
2900
|
+
readonly name: "receiver";
|
|
2901
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2902
|
+
}, {
|
|
2903
|
+
readonly name: "fee_numerator";
|
|
2904
|
+
readonly type: "core::integer::u128";
|
|
2905
|
+
}];
|
|
2906
|
+
readonly outputs: readonly [];
|
|
2907
|
+
readonly state_mutability: "external";
|
|
2908
|
+
}, {
|
|
2909
|
+
readonly type: "function";
|
|
2910
|
+
readonly name: "set_token_royalty";
|
|
2836
2911
|
readonly inputs: readonly [{
|
|
2912
|
+
readonly name: "token_id";
|
|
2913
|
+
readonly type: "core::integer::u256";
|
|
2914
|
+
}, {
|
|
2837
2915
|
readonly name: "receiver";
|
|
2838
2916
|
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2839
2917
|
}, {
|
|
@@ -2842,6 +2920,21 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
2842
2920
|
}];
|
|
2843
2921
|
readonly outputs: readonly [];
|
|
2844
2922
|
readonly state_mutability: "external";
|
|
2923
|
+
}, {
|
|
2924
|
+
readonly type: "function";
|
|
2925
|
+
readonly name: "delete_default_royalty";
|
|
2926
|
+
readonly inputs: readonly [];
|
|
2927
|
+
readonly outputs: readonly [];
|
|
2928
|
+
readonly state_mutability: "external";
|
|
2929
|
+
}, {
|
|
2930
|
+
readonly type: "function";
|
|
2931
|
+
readonly name: "reset_token_royalty";
|
|
2932
|
+
readonly inputs: readonly [{
|
|
2933
|
+
readonly name: "token_id";
|
|
2934
|
+
readonly type: "core::integer::u256";
|
|
2935
|
+
}];
|
|
2936
|
+
readonly outputs: readonly [];
|
|
2937
|
+
readonly state_mutability: "external";
|
|
2845
2938
|
}];
|
|
2846
2939
|
|
|
2847
2940
|
interface DeployCollectionParams {
|
|
@@ -2849,6 +2942,12 @@ interface DeployCollectionParams {
|
|
|
2849
2942
|
name: string;
|
|
2850
2943
|
/** Short ticker symbol (e.g. "MIP") */
|
|
2851
2944
|
symbol: string;
|
|
2945
|
+
/**
|
|
2946
|
+
* Collection-level metadata URI (e.g. "ipfs://Qm…/collection.json").
|
|
2947
|
+
* Should point to a JSON containing `name`, `description`, `image`, and `external_link`.
|
|
2948
|
+
* Stored on-chain at deploy time. Pass an empty string if not available.
|
|
2949
|
+
*/
|
|
2950
|
+
baseUri: string;
|
|
2852
2951
|
}
|
|
2853
2952
|
interface MintItemParams {
|
|
2854
2953
|
/** ERC-1155 collection contract address */
|
|
@@ -2901,15 +3000,25 @@ declare class ERC1155CollectionService {
|
|
|
2901
3000
|
*/
|
|
2902
3001
|
batchMintItem(account: AccountInterface, params: BatchMintItemParams): Promise<TxResult>;
|
|
2903
3002
|
/**
|
|
2904
|
-
* Set ERC-2981
|
|
3003
|
+
* Set the default ERC-2981 royalty for the entire collection.
|
|
2905
3004
|
* `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
|
|
2906
3005
|
* Caller must be the collection owner.
|
|
2907
3006
|
*/
|
|
2908
|
-
|
|
3007
|
+
setDefaultRoyalty(account: AccountInterface, params: {
|
|
2909
3008
|
collection: string;
|
|
2910
3009
|
receiver: string;
|
|
2911
3010
|
feeNumerator: number;
|
|
2912
3011
|
}): Promise<TxResult>;
|
|
3012
|
+
/**
|
|
3013
|
+
* Set a per-token ERC-2981 royalty override.
|
|
3014
|
+
* `feeNumerator` is out of 10 000. Caller must be the collection owner.
|
|
3015
|
+
*/
|
|
3016
|
+
setTokenRoyalty(account: AccountInterface, params: {
|
|
3017
|
+
collection: string;
|
|
3018
|
+
tokenId: bigint | string;
|
|
3019
|
+
receiver: string;
|
|
3020
|
+
feeNumerator: number;
|
|
3021
|
+
}): Promise<TxResult>;
|
|
2913
3022
|
/**
|
|
2914
3023
|
* Approve the Medialane1155 marketplace (or any operator) to transfer
|
|
2915
3024
|
* 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.
|
|
43
|
-
declare const ERC1155_FACTORY_CONTRACT_MAINNET = "
|
|
44
|
-
/** Class hash of the IPCollection ERC-1155 implementation.
|
|
45
|
-
declare const ERC1155_COLLECTION_CLASS_HASH_MAINNET = "
|
|
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;
|
|
@@ -2702,11 +2702,23 @@ declare const IPCollection1155FactoryABI: readonly [{
|
|
|
2702
2702
|
}, {
|
|
2703
2703
|
readonly name: "symbol";
|
|
2704
2704
|
readonly type: "core::byte_array::ByteArray";
|
|
2705
|
+
}, {
|
|
2706
|
+
readonly name: "base_uri";
|
|
2707
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2705
2708
|
}];
|
|
2706
2709
|
readonly outputs: readonly [{
|
|
2707
2710
|
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2708
2711
|
}];
|
|
2709
2712
|
readonly state_mutability: "external";
|
|
2713
|
+
}, {
|
|
2714
|
+
readonly type: "function";
|
|
2715
|
+
readonly name: "update_collection_class_hash";
|
|
2716
|
+
readonly inputs: readonly [{
|
|
2717
|
+
readonly name: "new_class_hash";
|
|
2718
|
+
readonly type: "core::starknet::class_hash::ClassHash";
|
|
2719
|
+
}];
|
|
2720
|
+
readonly outputs: readonly [];
|
|
2721
|
+
readonly state_mutability: "external";
|
|
2710
2722
|
}, {
|
|
2711
2723
|
readonly type: "function";
|
|
2712
2724
|
readonly name: "owner";
|
|
@@ -2717,6 +2729,41 @@ declare const IPCollection1155FactoryABI: readonly [{
|
|
|
2717
2729
|
readonly state_mutability: "view";
|
|
2718
2730
|
}];
|
|
2719
2731
|
declare const IPCollection1155ABI: readonly [{
|
|
2732
|
+
readonly type: "function";
|
|
2733
|
+
readonly name: "name";
|
|
2734
|
+
readonly inputs: readonly [];
|
|
2735
|
+
readonly outputs: readonly [{
|
|
2736
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2737
|
+
}];
|
|
2738
|
+
readonly state_mutability: "view";
|
|
2739
|
+
}, {
|
|
2740
|
+
readonly type: "function";
|
|
2741
|
+
readonly name: "symbol";
|
|
2742
|
+
readonly inputs: readonly [];
|
|
2743
|
+
readonly outputs: readonly [{
|
|
2744
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2745
|
+
}];
|
|
2746
|
+
readonly state_mutability: "view";
|
|
2747
|
+
}, {
|
|
2748
|
+
readonly type: "function";
|
|
2749
|
+
readonly name: "base_uri";
|
|
2750
|
+
readonly inputs: readonly [];
|
|
2751
|
+
readonly outputs: readonly [{
|
|
2752
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2753
|
+
}];
|
|
2754
|
+
readonly state_mutability: "view";
|
|
2755
|
+
}, {
|
|
2756
|
+
readonly type: "function";
|
|
2757
|
+
readonly name: "uri";
|
|
2758
|
+
readonly inputs: readonly [{
|
|
2759
|
+
readonly name: "token_id";
|
|
2760
|
+
readonly type: "core::integer::u256";
|
|
2761
|
+
}];
|
|
2762
|
+
readonly outputs: readonly [{
|
|
2763
|
+
readonly type: "core::byte_array::ByteArray";
|
|
2764
|
+
}];
|
|
2765
|
+
readonly state_mutability: "view";
|
|
2766
|
+
}, {
|
|
2720
2767
|
readonly type: "function";
|
|
2721
2768
|
readonly name: "mint_item";
|
|
2722
2769
|
readonly inputs: readonly [{
|
|
@@ -2754,32 +2801,32 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
2754
2801
|
readonly state_mutability: "external";
|
|
2755
2802
|
}, {
|
|
2756
2803
|
readonly type: "function";
|
|
2757
|
-
readonly name: "
|
|
2758
|
-
readonly inputs: readonly [
|
|
2759
|
-
readonly name: "token_id";
|
|
2760
|
-
readonly type: "core::integer::u256";
|
|
2761
|
-
}];
|
|
2804
|
+
readonly name: "get_collection_creator";
|
|
2805
|
+
readonly inputs: readonly [];
|
|
2762
2806
|
readonly outputs: readonly [{
|
|
2763
|
-
readonly type: "core::
|
|
2807
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2764
2808
|
}];
|
|
2765
2809
|
readonly state_mutability: "view";
|
|
2766
2810
|
}, {
|
|
2767
2811
|
readonly type: "function";
|
|
2768
|
-
readonly name: "
|
|
2769
|
-
readonly inputs: readonly [
|
|
2812
|
+
readonly name: "get_token_creator";
|
|
2813
|
+
readonly inputs: readonly [{
|
|
2814
|
+
readonly name: "token_id";
|
|
2815
|
+
readonly type: "core::integer::u256";
|
|
2816
|
+
}];
|
|
2770
2817
|
readonly outputs: readonly [{
|
|
2771
2818
|
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2772
2819
|
}];
|
|
2773
2820
|
readonly state_mutability: "view";
|
|
2774
2821
|
}, {
|
|
2775
2822
|
readonly type: "function";
|
|
2776
|
-
readonly name: "
|
|
2823
|
+
readonly name: "get_token_registered_at";
|
|
2777
2824
|
readonly inputs: readonly [{
|
|
2778
2825
|
readonly name: "token_id";
|
|
2779
2826
|
readonly type: "core::integer::u256";
|
|
2780
2827
|
}];
|
|
2781
2828
|
readonly outputs: readonly [{
|
|
2782
|
-
readonly type: "core::
|
|
2829
|
+
readonly type: "core::integer::u64";
|
|
2783
2830
|
}];
|
|
2784
2831
|
readonly state_mutability: "view";
|
|
2785
2832
|
}, {
|
|
@@ -2832,8 +2879,39 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
2832
2879
|
readonly state_mutability: "view";
|
|
2833
2880
|
}, {
|
|
2834
2881
|
readonly type: "function";
|
|
2835
|
-
readonly name: "
|
|
2882
|
+
readonly name: "royalty_info";
|
|
2883
|
+
readonly inputs: readonly [{
|
|
2884
|
+
readonly name: "token_id";
|
|
2885
|
+
readonly type: "core::integer::u256";
|
|
2886
|
+
}, {
|
|
2887
|
+
readonly name: "sale_price";
|
|
2888
|
+
readonly type: "core::integer::u256";
|
|
2889
|
+
}];
|
|
2890
|
+
readonly outputs: readonly [{
|
|
2891
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2892
|
+
}, {
|
|
2893
|
+
readonly type: "core::integer::u256";
|
|
2894
|
+
}];
|
|
2895
|
+
readonly state_mutability: "view";
|
|
2896
|
+
}, {
|
|
2897
|
+
readonly type: "function";
|
|
2898
|
+
readonly name: "set_default_royalty";
|
|
2899
|
+
readonly inputs: readonly [{
|
|
2900
|
+
readonly name: "receiver";
|
|
2901
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2902
|
+
}, {
|
|
2903
|
+
readonly name: "fee_numerator";
|
|
2904
|
+
readonly type: "core::integer::u128";
|
|
2905
|
+
}];
|
|
2906
|
+
readonly outputs: readonly [];
|
|
2907
|
+
readonly state_mutability: "external";
|
|
2908
|
+
}, {
|
|
2909
|
+
readonly type: "function";
|
|
2910
|
+
readonly name: "set_token_royalty";
|
|
2836
2911
|
readonly inputs: readonly [{
|
|
2912
|
+
readonly name: "token_id";
|
|
2913
|
+
readonly type: "core::integer::u256";
|
|
2914
|
+
}, {
|
|
2837
2915
|
readonly name: "receiver";
|
|
2838
2916
|
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
2839
2917
|
}, {
|
|
@@ -2842,6 +2920,21 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
2842
2920
|
}];
|
|
2843
2921
|
readonly outputs: readonly [];
|
|
2844
2922
|
readonly state_mutability: "external";
|
|
2923
|
+
}, {
|
|
2924
|
+
readonly type: "function";
|
|
2925
|
+
readonly name: "delete_default_royalty";
|
|
2926
|
+
readonly inputs: readonly [];
|
|
2927
|
+
readonly outputs: readonly [];
|
|
2928
|
+
readonly state_mutability: "external";
|
|
2929
|
+
}, {
|
|
2930
|
+
readonly type: "function";
|
|
2931
|
+
readonly name: "reset_token_royalty";
|
|
2932
|
+
readonly inputs: readonly [{
|
|
2933
|
+
readonly name: "token_id";
|
|
2934
|
+
readonly type: "core::integer::u256";
|
|
2935
|
+
}];
|
|
2936
|
+
readonly outputs: readonly [];
|
|
2937
|
+
readonly state_mutability: "external";
|
|
2845
2938
|
}];
|
|
2846
2939
|
|
|
2847
2940
|
interface DeployCollectionParams {
|
|
@@ -2849,6 +2942,12 @@ interface DeployCollectionParams {
|
|
|
2849
2942
|
name: string;
|
|
2850
2943
|
/** Short ticker symbol (e.g. "MIP") */
|
|
2851
2944
|
symbol: string;
|
|
2945
|
+
/**
|
|
2946
|
+
* Collection-level metadata URI (e.g. "ipfs://Qm…/collection.json").
|
|
2947
|
+
* Should point to a JSON containing `name`, `description`, `image`, and `external_link`.
|
|
2948
|
+
* Stored on-chain at deploy time. Pass an empty string if not available.
|
|
2949
|
+
*/
|
|
2950
|
+
baseUri: string;
|
|
2852
2951
|
}
|
|
2853
2952
|
interface MintItemParams {
|
|
2854
2953
|
/** ERC-1155 collection contract address */
|
|
@@ -2901,15 +3000,25 @@ declare class ERC1155CollectionService {
|
|
|
2901
3000
|
*/
|
|
2902
3001
|
batchMintItem(account: AccountInterface, params: BatchMintItemParams): Promise<TxResult>;
|
|
2903
3002
|
/**
|
|
2904
|
-
* Set ERC-2981
|
|
3003
|
+
* Set the default ERC-2981 royalty for the entire collection.
|
|
2905
3004
|
* `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
|
|
2906
3005
|
* Caller must be the collection owner.
|
|
2907
3006
|
*/
|
|
2908
|
-
|
|
3007
|
+
setDefaultRoyalty(account: AccountInterface, params: {
|
|
2909
3008
|
collection: string;
|
|
2910
3009
|
receiver: string;
|
|
2911
3010
|
feeNumerator: number;
|
|
2912
3011
|
}): Promise<TxResult>;
|
|
3012
|
+
/**
|
|
3013
|
+
* Set a per-token ERC-2981 royalty override.
|
|
3014
|
+
* `feeNumerator` is out of 10 000. Caller must be the collection owner.
|
|
3015
|
+
*/
|
|
3016
|
+
setTokenRoyalty(account: AccountInterface, params: {
|
|
3017
|
+
collection: string;
|
|
3018
|
+
tokenId: bigint | string;
|
|
3019
|
+
receiver: string;
|
|
3020
|
+
feeNumerator: number;
|
|
3021
|
+
}): Promise<TxResult>;
|
|
2913
3022
|
/**
|
|
2914
3023
|
* Approve the Medialane1155 marketplace (or any operator) to transfer
|
|
2915
3024
|
* 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 = "
|
|
51
|
-
var ERC1155_COLLECTION_CLASS_HASH_MAINNET = "
|
|
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: "
|
|
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
|
|
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
|
|
3442
|
+
async setDefaultRoyalty(account, params) {
|
|
3363
3443
|
const collection = this._collection(params.collection, account);
|
|
3364
|
-
const call = collection.populate("
|
|
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
|
]);
|