@medialane/sdk 0.17.0 → 0.19.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 +115 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -22
- package/dist/index.d.ts +18 -22
- package/dist/index.js +116 -143
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1848,6 +1848,7 @@ declare const IPMarketplaceABI: readonly [{
|
|
|
1848
1848
|
readonly kind: "nested";
|
|
1849
1849
|
}];
|
|
1850
1850
|
}];
|
|
1851
|
+
|
|
1851
1852
|
declare const POPCollectionABI: readonly [{
|
|
1852
1853
|
readonly type: "struct";
|
|
1853
1854
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -1958,6 +1959,7 @@ declare const POPCollectionABI: readonly [{
|
|
|
1958
1959
|
}];
|
|
1959
1960
|
readonly state_mutability: "view";
|
|
1960
1961
|
}];
|
|
1962
|
+
|
|
1961
1963
|
declare const POPFactoryABI: readonly [{
|
|
1962
1964
|
readonly type: "struct";
|
|
1963
1965
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2044,6 +2046,7 @@ declare const POPFactoryABI: readonly [{
|
|
|
2044
2046
|
readonly outputs: readonly [];
|
|
2045
2047
|
readonly state_mutability: "external";
|
|
2046
2048
|
}];
|
|
2049
|
+
|
|
2047
2050
|
declare const DropCollectionABI: readonly [{
|
|
2048
2051
|
readonly type: "struct";
|
|
2049
2052
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2260,6 +2263,7 @@ declare const DropCollectionABI: readonly [{
|
|
|
2260
2263
|
}];
|
|
2261
2264
|
readonly state_mutability: "view";
|
|
2262
2265
|
}];
|
|
2266
|
+
|
|
2263
2267
|
declare const DropFactoryABI: readonly [{
|
|
2264
2268
|
readonly type: "struct";
|
|
2265
2269
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2387,6 +2391,7 @@ declare const DropFactoryABI: readonly [{
|
|
|
2387
2391
|
readonly outputs: readonly [];
|
|
2388
2392
|
readonly state_mutability: "external";
|
|
2389
2393
|
}];
|
|
2394
|
+
|
|
2390
2395
|
declare const CollectionRegistryABI: readonly [{
|
|
2391
2396
|
readonly type: "struct";
|
|
2392
2397
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2442,6 +2447,7 @@ declare const CollectionRegistryABI: readonly [{
|
|
|
2442
2447
|
}];
|
|
2443
2448
|
readonly state_mutability: "view";
|
|
2444
2449
|
}];
|
|
2450
|
+
|
|
2445
2451
|
declare const Medialane1155ABI: readonly [{
|
|
2446
2452
|
readonly type: "impl";
|
|
2447
2453
|
readonly name: "Medialane1155V2Impl";
|
|
@@ -2805,6 +2811,7 @@ declare const Medialane1155ABI: readonly [{
|
|
|
2805
2811
|
readonly kind: "flat";
|
|
2806
2812
|
}];
|
|
2807
2813
|
}];
|
|
2814
|
+
|
|
2808
2815
|
declare const IPCollection1155FactoryABI: readonly [{
|
|
2809
2816
|
readonly type: "impl";
|
|
2810
2817
|
readonly name: "IPCollectionFactoryImpl";
|
|
@@ -3019,6 +3026,7 @@ declare const IPCollection1155FactoryABI: readonly [{
|
|
|
3019
3026
|
readonly kind: "nested";
|
|
3020
3027
|
}];
|
|
3021
3028
|
}];
|
|
3029
|
+
|
|
3022
3030
|
declare const IPCollection1155ABI: readonly [{
|
|
3023
3031
|
readonly type: "impl";
|
|
3024
3032
|
readonly name: "ERC1155MetadataURIImpl";
|
|
@@ -3818,6 +3826,7 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
3818
3826
|
readonly kind: "nested";
|
|
3819
3827
|
}];
|
|
3820
3828
|
}];
|
|
3829
|
+
|
|
3821
3830
|
declare const IPCollectionABI: readonly [{
|
|
3822
3831
|
readonly type: "impl";
|
|
3823
3832
|
readonly name: "IPCollectionImpl";
|
|
@@ -4382,6 +4391,7 @@ declare const IPCollectionABI: readonly [{
|
|
|
4382
4391
|
readonly kind: "nested";
|
|
4383
4392
|
}];
|
|
4384
4393
|
}];
|
|
4394
|
+
|
|
4385
4395
|
declare const IPNftABI: readonly [{
|
|
4386
4396
|
readonly type: "impl";
|
|
4387
4397
|
readonly name: "ERC721Metadata";
|
|
@@ -5065,34 +5075,20 @@ declare function encodeByteArray(str: string): string[];
|
|
|
5065
5075
|
|
|
5066
5076
|
/**
|
|
5067
5077
|
* Build SNIP-12 typed data for signing an OrderParameters struct.
|
|
5068
|
-
*
|
|
5078
|
+
* The shape is identical across ERC-721 and ERC-1155 (nested OfferItem +
|
|
5079
|
+
* ConsiderationItem) — only the domain version differs.
|
|
5069
5080
|
*/
|
|
5070
5081
|
declare function buildOrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5071
|
-
/**
|
|
5072
|
-
* Build SNIP-12 typed data for signing an OrderFulfillment struct.
|
|
5073
|
-
*/
|
|
5074
|
-
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5075
|
-
/**
|
|
5076
|
-
* Build SNIP-12 typed data for signing an OrderCancellation struct.
|
|
5077
|
-
*/
|
|
5078
|
-
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5079
|
-
|
|
5080
|
-
/**
|
|
5081
|
-
* Build SNIP-12 typed data for signing an ERC-1155 OrderParameters struct.
|
|
5082
|
-
*
|
|
5083
|
-
* Uses the ERC-1155 V2 marketplace shape:
|
|
5084
|
-
* - Domain name is "Medialane"
|
|
5085
|
-
* - Domain version is "2"
|
|
5086
|
-
* - OrderParameters contains nested OfferItem and ConsiderationItem structs
|
|
5087
|
-
*/
|
|
5088
5082
|
declare function build1155OrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5089
5083
|
/**
|
|
5090
|
-
* Build SNIP-12 typed data for
|
|
5084
|
+
* Build SNIP-12 typed data for an OrderFulfillment struct.
|
|
5085
|
+
* ERC-1155 adds a `quantity` field so the contract can verify the partial-fill
|
|
5086
|
+
* amount; ERC-721 omits it (always single-fill).
|
|
5091
5087
|
*/
|
|
5088
|
+
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5092
5089
|
declare function build1155FulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5093
|
-
/**
|
|
5094
|
-
|
|
5095
|
-
*/
|
|
5090
|
+
/** OrderCancellation typed data — identical shape across both standards. */
|
|
5091
|
+
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5096
5092
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5097
5093
|
|
|
5098
5094
|
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1848,6 +1848,7 @@ declare const IPMarketplaceABI: readonly [{
|
|
|
1848
1848
|
readonly kind: "nested";
|
|
1849
1849
|
}];
|
|
1850
1850
|
}];
|
|
1851
|
+
|
|
1851
1852
|
declare const POPCollectionABI: readonly [{
|
|
1852
1853
|
readonly type: "struct";
|
|
1853
1854
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -1958,6 +1959,7 @@ declare const POPCollectionABI: readonly [{
|
|
|
1958
1959
|
}];
|
|
1959
1960
|
readonly state_mutability: "view";
|
|
1960
1961
|
}];
|
|
1962
|
+
|
|
1961
1963
|
declare const POPFactoryABI: readonly [{
|
|
1962
1964
|
readonly type: "struct";
|
|
1963
1965
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2044,6 +2046,7 @@ declare const POPFactoryABI: readonly [{
|
|
|
2044
2046
|
readonly outputs: readonly [];
|
|
2045
2047
|
readonly state_mutability: "external";
|
|
2046
2048
|
}];
|
|
2049
|
+
|
|
2047
2050
|
declare const DropCollectionABI: readonly [{
|
|
2048
2051
|
readonly type: "struct";
|
|
2049
2052
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2260,6 +2263,7 @@ declare const DropCollectionABI: readonly [{
|
|
|
2260
2263
|
}];
|
|
2261
2264
|
readonly state_mutability: "view";
|
|
2262
2265
|
}];
|
|
2266
|
+
|
|
2263
2267
|
declare const DropFactoryABI: readonly [{
|
|
2264
2268
|
readonly type: "struct";
|
|
2265
2269
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2387,6 +2391,7 @@ declare const DropFactoryABI: readonly [{
|
|
|
2387
2391
|
readonly outputs: readonly [];
|
|
2388
2392
|
readonly state_mutability: "external";
|
|
2389
2393
|
}];
|
|
2394
|
+
|
|
2390
2395
|
declare const CollectionRegistryABI: readonly [{
|
|
2391
2396
|
readonly type: "struct";
|
|
2392
2397
|
readonly name: "core::byte_array::ByteArray";
|
|
@@ -2442,6 +2447,7 @@ declare const CollectionRegistryABI: readonly [{
|
|
|
2442
2447
|
}];
|
|
2443
2448
|
readonly state_mutability: "view";
|
|
2444
2449
|
}];
|
|
2450
|
+
|
|
2445
2451
|
declare const Medialane1155ABI: readonly [{
|
|
2446
2452
|
readonly type: "impl";
|
|
2447
2453
|
readonly name: "Medialane1155V2Impl";
|
|
@@ -2805,6 +2811,7 @@ declare const Medialane1155ABI: readonly [{
|
|
|
2805
2811
|
readonly kind: "flat";
|
|
2806
2812
|
}];
|
|
2807
2813
|
}];
|
|
2814
|
+
|
|
2808
2815
|
declare const IPCollection1155FactoryABI: readonly [{
|
|
2809
2816
|
readonly type: "impl";
|
|
2810
2817
|
readonly name: "IPCollectionFactoryImpl";
|
|
@@ -3019,6 +3026,7 @@ declare const IPCollection1155FactoryABI: readonly [{
|
|
|
3019
3026
|
readonly kind: "nested";
|
|
3020
3027
|
}];
|
|
3021
3028
|
}];
|
|
3029
|
+
|
|
3022
3030
|
declare const IPCollection1155ABI: readonly [{
|
|
3023
3031
|
readonly type: "impl";
|
|
3024
3032
|
readonly name: "ERC1155MetadataURIImpl";
|
|
@@ -3818,6 +3826,7 @@ declare const IPCollection1155ABI: readonly [{
|
|
|
3818
3826
|
readonly kind: "nested";
|
|
3819
3827
|
}];
|
|
3820
3828
|
}];
|
|
3829
|
+
|
|
3821
3830
|
declare const IPCollectionABI: readonly [{
|
|
3822
3831
|
readonly type: "impl";
|
|
3823
3832
|
readonly name: "IPCollectionImpl";
|
|
@@ -4382,6 +4391,7 @@ declare const IPCollectionABI: readonly [{
|
|
|
4382
4391
|
readonly kind: "nested";
|
|
4383
4392
|
}];
|
|
4384
4393
|
}];
|
|
4394
|
+
|
|
4385
4395
|
declare const IPNftABI: readonly [{
|
|
4386
4396
|
readonly type: "impl";
|
|
4387
4397
|
readonly name: "ERC721Metadata";
|
|
@@ -5065,34 +5075,20 @@ declare function encodeByteArray(str: string): string[];
|
|
|
5065
5075
|
|
|
5066
5076
|
/**
|
|
5067
5077
|
* Build SNIP-12 typed data for signing an OrderParameters struct.
|
|
5068
|
-
*
|
|
5078
|
+
* The shape is identical across ERC-721 and ERC-1155 (nested OfferItem +
|
|
5079
|
+
* ConsiderationItem) — only the domain version differs.
|
|
5069
5080
|
*/
|
|
5070
5081
|
declare function buildOrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5071
|
-
/**
|
|
5072
|
-
* Build SNIP-12 typed data for signing an OrderFulfillment struct.
|
|
5073
|
-
*/
|
|
5074
|
-
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5075
|
-
/**
|
|
5076
|
-
* Build SNIP-12 typed data for signing an OrderCancellation struct.
|
|
5077
|
-
*/
|
|
5078
|
-
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5079
|
-
|
|
5080
|
-
/**
|
|
5081
|
-
* Build SNIP-12 typed data for signing an ERC-1155 OrderParameters struct.
|
|
5082
|
-
*
|
|
5083
|
-
* Uses the ERC-1155 V2 marketplace shape:
|
|
5084
|
-
* - Domain name is "Medialane"
|
|
5085
|
-
* - Domain version is "2"
|
|
5086
|
-
* - OrderParameters contains nested OfferItem and ConsiderationItem structs
|
|
5087
|
-
*/
|
|
5088
5082
|
declare function build1155OrderTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5089
5083
|
/**
|
|
5090
|
-
* Build SNIP-12 typed data for
|
|
5084
|
+
* Build SNIP-12 typed data for an OrderFulfillment struct.
|
|
5085
|
+
* ERC-1155 adds a `quantity` field so the contract can verify the partial-fill
|
|
5086
|
+
* amount; ERC-721 omits it (always single-fill).
|
|
5091
5087
|
*/
|
|
5088
|
+
declare function buildFulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5092
5089
|
declare function build1155FulfillmentTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5093
|
-
/**
|
|
5094
|
-
|
|
5095
|
-
*/
|
|
5090
|
+
/** OrderCancellation typed data — identical shape across both standards. */
|
|
5091
|
+
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5096
5092
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
5097
5093
|
|
|
5098
5094
|
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, ERC1155CollectionService, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintItemParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { cairo,
|
|
2
|
+
import { cairo, num, Contract, TypedDataRevision, shortString, constants, RpcProvider } from 'starknet';
|
|
3
3
|
|
|
4
4
|
// src/config.ts
|
|
5
5
|
|
|
@@ -126,69 +126,104 @@ function resolveConfig(raw) {
|
|
|
126
126
|
feeConfig: resolveFeeConfig(parsed.feeConfig)
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
+
var STARKNET_DOMAIN = [
|
|
130
|
+
{ name: "name", type: "shortstring" },
|
|
131
|
+
{ name: "version", type: "shortstring" },
|
|
132
|
+
{ name: "chainId", type: "shortstring" },
|
|
133
|
+
{ name: "revision", type: "shortstring" }
|
|
134
|
+
];
|
|
135
|
+
var OFFER_ITEM = [
|
|
136
|
+
{ name: "item_type", type: "shortstring" },
|
|
137
|
+
{ name: "token", type: "ContractAddress" },
|
|
138
|
+
{ name: "identifier_or_criteria", type: "felt" },
|
|
139
|
+
{ name: "start_amount", type: "felt" },
|
|
140
|
+
{ name: "end_amount", type: "felt" }
|
|
141
|
+
];
|
|
142
|
+
var CONSIDERATION_ITEM = [
|
|
143
|
+
{ name: "item_type", type: "shortstring" },
|
|
144
|
+
{ name: "token", type: "ContractAddress" },
|
|
145
|
+
{ name: "identifier_or_criteria", type: "felt" },
|
|
146
|
+
{ name: "start_amount", type: "felt" },
|
|
147
|
+
{ name: "end_amount", type: "felt" },
|
|
148
|
+
{ name: "recipient", type: "ContractAddress" }
|
|
149
|
+
];
|
|
150
|
+
var ORDER_PARAMETERS = [
|
|
151
|
+
{ name: "offerer", type: "ContractAddress" },
|
|
152
|
+
{ name: "offer", type: "OfferItem" },
|
|
153
|
+
{ name: "consideration", type: "ConsiderationItem" },
|
|
154
|
+
{ name: "start_time", type: "felt" },
|
|
155
|
+
{ name: "end_time", type: "felt" },
|
|
156
|
+
{ name: "salt", type: "felt" },
|
|
157
|
+
{ name: "nonce", type: "felt" }
|
|
158
|
+
];
|
|
159
|
+
var ORDER_CANCELLATION = [
|
|
160
|
+
{ name: "order_hash", type: "felt" },
|
|
161
|
+
{ name: "offerer", type: "ContractAddress" },
|
|
162
|
+
{ name: "nonce", type: "felt" }
|
|
163
|
+
];
|
|
164
|
+
var DOMAIN_VERSION = {
|
|
165
|
+
erc721: "1",
|
|
166
|
+
erc1155: "2"
|
|
167
|
+
};
|
|
168
|
+
function buildDomain(standard, chainId) {
|
|
169
|
+
return {
|
|
170
|
+
name: "Medialane",
|
|
171
|
+
version: DOMAIN_VERSION[standard],
|
|
172
|
+
chainId,
|
|
173
|
+
revision: TypedDataRevision.ACTIVE
|
|
174
|
+
};
|
|
175
|
+
}
|
|
129
176
|
function buildOrderTypedData(message, chainId) {
|
|
130
177
|
return {
|
|
131
|
-
domain:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
178
|
+
domain: buildDomain("erc721", chainId),
|
|
179
|
+
primaryType: "OrderParameters",
|
|
180
|
+
types: {
|
|
181
|
+
StarknetDomain: STARKNET_DOMAIN,
|
|
182
|
+
OrderParameters: ORDER_PARAMETERS,
|
|
183
|
+
OfferItem: OFFER_ITEM,
|
|
184
|
+
ConsiderationItem: CONSIDERATION_ITEM
|
|
136
185
|
},
|
|
186
|
+
message
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function build1155OrderTypedData(message, chainId) {
|
|
190
|
+
return {
|
|
191
|
+
domain: buildDomain("erc1155", chainId),
|
|
137
192
|
primaryType: "OrderParameters",
|
|
138
193
|
types: {
|
|
139
|
-
StarknetDomain:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
{ name: "revision", type: "shortstring" }
|
|
144
|
-
],
|
|
145
|
-
OrderParameters: [
|
|
146
|
-
{ name: "offerer", type: "ContractAddress" },
|
|
147
|
-
{ name: "offer", type: "OfferItem" },
|
|
148
|
-
{ name: "consideration", type: "ConsiderationItem" },
|
|
149
|
-
{ name: "start_time", type: "felt" },
|
|
150
|
-
{ name: "end_time", type: "felt" },
|
|
151
|
-
{ name: "salt", type: "felt" },
|
|
152
|
-
{ name: "nonce", type: "felt" }
|
|
153
|
-
],
|
|
154
|
-
OfferItem: [
|
|
155
|
-
{ name: "item_type", type: "shortstring" },
|
|
156
|
-
{ name: "token", type: "ContractAddress" },
|
|
157
|
-
{ name: "identifier_or_criteria", type: "felt" },
|
|
158
|
-
{ name: "start_amount", type: "felt" },
|
|
159
|
-
{ name: "end_amount", type: "felt" }
|
|
160
|
-
],
|
|
161
|
-
ConsiderationItem: [
|
|
162
|
-
{ name: "item_type", type: "shortstring" },
|
|
163
|
-
{ name: "token", type: "ContractAddress" },
|
|
164
|
-
{ name: "identifier_or_criteria", type: "felt" },
|
|
165
|
-
{ name: "start_amount", type: "felt" },
|
|
166
|
-
{ name: "end_amount", type: "felt" },
|
|
167
|
-
{ name: "recipient", type: "ContractAddress" }
|
|
168
|
-
]
|
|
194
|
+
StarknetDomain: STARKNET_DOMAIN,
|
|
195
|
+
OrderParameters: ORDER_PARAMETERS,
|
|
196
|
+
OfferItem: OFFER_ITEM,
|
|
197
|
+
ConsiderationItem: CONSIDERATION_ITEM
|
|
169
198
|
},
|
|
170
199
|
message
|
|
171
200
|
};
|
|
172
201
|
}
|
|
173
202
|
function buildFulfillmentTypedData(message, chainId) {
|
|
174
203
|
return {
|
|
175
|
-
domain:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
204
|
+
domain: buildDomain("erc721", chainId),
|
|
205
|
+
primaryType: "OrderFulfillment",
|
|
206
|
+
types: {
|
|
207
|
+
StarknetDomain: STARKNET_DOMAIN,
|
|
208
|
+
OrderFulfillment: [
|
|
209
|
+
{ name: "order_hash", type: "felt" },
|
|
210
|
+
{ name: "fulfiller", type: "ContractAddress" },
|
|
211
|
+
{ name: "nonce", type: "felt" }
|
|
212
|
+
]
|
|
180
213
|
},
|
|
214
|
+
message
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function build1155FulfillmentTypedData(message, chainId) {
|
|
218
|
+
return {
|
|
219
|
+
domain: buildDomain("erc1155", chainId),
|
|
181
220
|
primaryType: "OrderFulfillment",
|
|
182
221
|
types: {
|
|
183
|
-
StarknetDomain:
|
|
184
|
-
{ name: "name", type: "shortstring" },
|
|
185
|
-
{ name: "version", type: "shortstring" },
|
|
186
|
-
{ name: "chainId", type: "shortstring" },
|
|
187
|
-
{ name: "revision", type: "shortstring" }
|
|
188
|
-
],
|
|
222
|
+
StarknetDomain: STARKNET_DOMAIN,
|
|
189
223
|
OrderFulfillment: [
|
|
190
224
|
{ name: "order_hash", type: "felt" },
|
|
191
225
|
{ name: "fulfiller", type: "ContractAddress" },
|
|
226
|
+
{ name: "quantity", type: "felt" },
|
|
192
227
|
{ name: "nonce", type: "felt" }
|
|
193
228
|
]
|
|
194
229
|
},
|
|
@@ -197,25 +232,22 @@ function buildFulfillmentTypedData(message, chainId) {
|
|
|
197
232
|
}
|
|
198
233
|
function buildCancellationTypedData(message, chainId) {
|
|
199
234
|
return {
|
|
200
|
-
domain:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
235
|
+
domain: buildDomain("erc721", chainId),
|
|
236
|
+
primaryType: "OrderCancellation",
|
|
237
|
+
types: {
|
|
238
|
+
StarknetDomain: STARKNET_DOMAIN,
|
|
239
|
+
OrderCancellation: ORDER_CANCELLATION
|
|
205
240
|
},
|
|
241
|
+
message
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function build1155CancellationTypedData(message, chainId) {
|
|
245
|
+
return {
|
|
246
|
+
domain: buildDomain("erc1155", chainId),
|
|
206
247
|
primaryType: "OrderCancellation",
|
|
207
248
|
types: {
|
|
208
|
-
StarknetDomain:
|
|
209
|
-
|
|
210
|
-
{ name: "version", type: "shortstring" },
|
|
211
|
-
{ name: "chainId", type: "shortstring" },
|
|
212
|
-
{ name: "revision", type: "shortstring" }
|
|
213
|
-
],
|
|
214
|
-
OrderCancellation: [
|
|
215
|
-
{ name: "order_hash", type: "felt" },
|
|
216
|
-
{ name: "offerer", type: "ContractAddress" },
|
|
217
|
-
{ name: "nonce", type: "felt" }
|
|
218
|
-
]
|
|
249
|
+
StarknetDomain: STARKNET_DOMAIN,
|
|
250
|
+
OrderCancellation: ORDER_CANCELLATION
|
|
219
251
|
},
|
|
220
252
|
message
|
|
221
253
|
};
|
|
@@ -245,7 +277,7 @@ function encodeByteArray(str) {
|
|
|
245
277
|
];
|
|
246
278
|
}
|
|
247
279
|
|
|
248
|
-
// src/abis.ts
|
|
280
|
+
// src/abis/ipMarketplace.ts
|
|
249
281
|
var IPMarketplaceABI = [
|
|
250
282
|
{
|
|
251
283
|
type: "impl",
|
|
@@ -552,6 +584,8 @@ var IPMarketplaceABI = [
|
|
|
552
584
|
]
|
|
553
585
|
}
|
|
554
586
|
];
|
|
587
|
+
|
|
588
|
+
// src/abis/popCollection.ts
|
|
555
589
|
var POPCollectionABI = [
|
|
556
590
|
{
|
|
557
591
|
type: "struct",
|
|
@@ -639,6 +673,8 @@ var POPCollectionABI = [
|
|
|
639
673
|
state_mutability: "view"
|
|
640
674
|
}
|
|
641
675
|
];
|
|
676
|
+
|
|
677
|
+
// src/abis/popFactory.ts
|
|
642
678
|
var POPFactoryABI = [
|
|
643
679
|
{
|
|
644
680
|
type: "struct",
|
|
@@ -694,6 +730,8 @@ var POPFactoryABI = [
|
|
|
694
730
|
state_mutability: "external"
|
|
695
731
|
}
|
|
696
732
|
];
|
|
733
|
+
|
|
734
|
+
// src/abis/dropCollection.ts
|
|
697
735
|
var DropCollectionABI = [
|
|
698
736
|
{
|
|
699
737
|
type: "struct",
|
|
@@ -863,6 +901,8 @@ var DropCollectionABI = [
|
|
|
863
901
|
state_mutability: "view"
|
|
864
902
|
}
|
|
865
903
|
];
|
|
904
|
+
|
|
905
|
+
// src/abis/dropFactory.ts
|
|
866
906
|
var DropFactoryABI = [
|
|
867
907
|
{
|
|
868
908
|
type: "struct",
|
|
@@ -950,6 +990,8 @@ var DropFactoryABI = [
|
|
|
950
990
|
state_mutability: "external"
|
|
951
991
|
}
|
|
952
992
|
];
|
|
993
|
+
|
|
994
|
+
// src/abis/collectionRegistry.ts
|
|
953
995
|
var CollectionRegistryABI = [
|
|
954
996
|
{
|
|
955
997
|
type: "struct",
|
|
@@ -986,6 +1028,8 @@ var CollectionRegistryABI = [
|
|
|
986
1028
|
state_mutability: "view"
|
|
987
1029
|
}
|
|
988
1030
|
];
|
|
1031
|
+
|
|
1032
|
+
// src/abis/medialane1155.ts
|
|
989
1033
|
var Medialane1155ABI = [
|
|
990
1034
|
{
|
|
991
1035
|
"type": "impl",
|
|
@@ -1479,6 +1523,8 @@ var Medialane1155ABI = [
|
|
|
1479
1523
|
]
|
|
1480
1524
|
}
|
|
1481
1525
|
];
|
|
1526
|
+
|
|
1527
|
+
// src/abis/ipCollection1155Factory.ts
|
|
1482
1528
|
var IPCollection1155FactoryABI = [
|
|
1483
1529
|
{
|
|
1484
1530
|
"type": "impl",
|
|
@@ -1764,6 +1810,8 @@ var IPCollection1155FactoryABI = [
|
|
|
1764
1810
|
]
|
|
1765
1811
|
}
|
|
1766
1812
|
];
|
|
1813
|
+
|
|
1814
|
+
// src/abis/ipCollection1155.ts
|
|
1767
1815
|
var IPCollection1155ABI = [
|
|
1768
1816
|
{
|
|
1769
1817
|
"type": "impl",
|
|
@@ -2845,6 +2893,8 @@ var IPCollection1155ABI = [
|
|
|
2845
2893
|
]
|
|
2846
2894
|
}
|
|
2847
2895
|
];
|
|
2896
|
+
|
|
2897
|
+
// src/abis/ipCollection.ts
|
|
2848
2898
|
var IPCollectionABI = [
|
|
2849
2899
|
{
|
|
2850
2900
|
"type": "impl",
|
|
@@ -3608,6 +3658,8 @@ var IPCollectionABI = [
|
|
|
3608
3658
|
]
|
|
3609
3659
|
}
|
|
3610
3660
|
];
|
|
3661
|
+
|
|
3662
|
+
// src/abis/ipNft.ts
|
|
3611
3663
|
var IPNftABI = [
|
|
3612
3664
|
{
|
|
3613
3665
|
"type": "impl",
|
|
@@ -4921,85 +4973,6 @@ var MarketplaceModule = class {
|
|
|
4921
4973
|
return buildCancellationTypedData(params, chainId);
|
|
4922
4974
|
}
|
|
4923
4975
|
};
|
|
4924
|
-
var STARKNET_DOMAIN = [
|
|
4925
|
-
{ name: "name", type: "shortstring" },
|
|
4926
|
-
{ name: "version", type: "shortstring" },
|
|
4927
|
-
{ name: "chainId", type: "shortstring" },
|
|
4928
|
-
{ name: "revision", type: "shortstring" }
|
|
4929
|
-
];
|
|
4930
|
-
function domain1155(chainId) {
|
|
4931
|
-
return {
|
|
4932
|
-
name: "Medialane",
|
|
4933
|
-
version: "2",
|
|
4934
|
-
chainId,
|
|
4935
|
-
revision: TypedDataRevision.ACTIVE
|
|
4936
|
-
};
|
|
4937
|
-
}
|
|
4938
|
-
function build1155OrderTypedData(message, chainId) {
|
|
4939
|
-
return {
|
|
4940
|
-
domain: domain1155(chainId),
|
|
4941
|
-
primaryType: "OrderParameters",
|
|
4942
|
-
types: {
|
|
4943
|
-
StarknetDomain: STARKNET_DOMAIN,
|
|
4944
|
-
OfferItem: [
|
|
4945
|
-
{ name: "item_type", type: "shortstring" },
|
|
4946
|
-
{ name: "token", type: "ContractAddress" },
|
|
4947
|
-
{ name: "identifier_or_criteria", type: "felt" },
|
|
4948
|
-
{ name: "start_amount", type: "felt" },
|
|
4949
|
-
{ name: "end_amount", type: "felt" }
|
|
4950
|
-
],
|
|
4951
|
-
ConsiderationItem: [
|
|
4952
|
-
{ name: "item_type", type: "shortstring" },
|
|
4953
|
-
{ name: "token", type: "ContractAddress" },
|
|
4954
|
-
{ name: "identifier_or_criteria", type: "felt" },
|
|
4955
|
-
{ name: "start_amount", type: "felt" },
|
|
4956
|
-
{ name: "end_amount", type: "felt" },
|
|
4957
|
-
{ name: "recipient", type: "ContractAddress" }
|
|
4958
|
-
],
|
|
4959
|
-
OrderParameters: [
|
|
4960
|
-
{ name: "offerer", type: "ContractAddress" },
|
|
4961
|
-
{ name: "offer", type: "OfferItem" },
|
|
4962
|
-
{ name: "consideration", type: "ConsiderationItem" },
|
|
4963
|
-
{ name: "start_time", type: "felt" },
|
|
4964
|
-
{ name: "end_time", type: "felt" },
|
|
4965
|
-
{ name: "salt", type: "felt" },
|
|
4966
|
-
{ name: "nonce", type: "felt" }
|
|
4967
|
-
]
|
|
4968
|
-
},
|
|
4969
|
-
message
|
|
4970
|
-
};
|
|
4971
|
-
}
|
|
4972
|
-
function build1155FulfillmentTypedData(message, chainId) {
|
|
4973
|
-
return {
|
|
4974
|
-
domain: domain1155(chainId),
|
|
4975
|
-
primaryType: "OrderFulfillment",
|
|
4976
|
-
types: {
|
|
4977
|
-
StarknetDomain: STARKNET_DOMAIN,
|
|
4978
|
-
OrderFulfillment: [
|
|
4979
|
-
{ name: "order_hash", type: "felt" },
|
|
4980
|
-
{ name: "fulfiller", type: "ContractAddress" },
|
|
4981
|
-
{ name: "quantity", type: "felt" },
|
|
4982
|
-
{ name: "nonce", type: "felt" }
|
|
4983
|
-
]
|
|
4984
|
-
},
|
|
4985
|
-
message
|
|
4986
|
-
};
|
|
4987
|
-
}
|
|
4988
|
-
function build1155CancellationTypedData(message, chainId) {
|
|
4989
|
-
return {
|
|
4990
|
-
domain: domain1155(chainId),
|
|
4991
|
-
primaryType: "OrderCancellation",
|
|
4992
|
-
types: {
|
|
4993
|
-
StarknetDomain: STARKNET_DOMAIN,
|
|
4994
|
-
OrderCancellation: [
|
|
4995
|
-
{ name: "order_hash", type: "felt" },
|
|
4996
|
-
{ name: "offerer", type: "ContractAddress" },
|
|
4997
|
-
{ name: "nonce", type: "felt" }
|
|
4998
|
-
]
|
|
4999
|
-
},
|
|
5000
|
-
message
|
|
5001
|
-
};
|
|
5002
|
-
}
|
|
5003
4976
|
var _contractCache2 = /* @__PURE__ */ new WeakMap();
|
|
5004
4977
|
function getContract(config) {
|
|
5005
4978
|
let c = _contractCache2.get(config);
|