@medialane/sdk 0.13.0 → 0.14.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 +68 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -4
- package/dist/index.d.ts +81 -4
- package/dist/index.js +67 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AccountInterface, constants, TypedData } from 'starknet';
|
|
2
|
+
import { Call, AccountInterface, constants, TypedData } from 'starknet';
|
|
3
3
|
|
|
4
4
|
/** Medialane Protocol ERC-721 marketplace — immutable, no admin key. */
|
|
5
5
|
declare const MARKETPLACE_721_CONTRACT_MAINNET = "0x00f8ccaae0bc811c79605974cc1dab769b9cea8877f033f8e3c17f30457caba6";
|
|
@@ -75,6 +75,48 @@ interface RetryOptions {
|
|
|
75
75
|
maxDelayMs?: number;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
declare const FeeConfigSchema: z.ZodObject<{
|
|
79
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
fundAddress: z.ZodOptional<z.ZodString>;
|
|
81
|
+
marketplaceBps: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
launchpadBps: z.ZodDefault<z.ZodNumber>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
marketplaceBps: number;
|
|
86
|
+
launchpadBps: number;
|
|
87
|
+
fundAddress?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
enabled?: boolean | undefined;
|
|
90
|
+
fundAddress?: string | undefined;
|
|
91
|
+
marketplaceBps?: number | undefined;
|
|
92
|
+
launchpadBps?: number | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
type FeeConfig = z.input<typeof FeeConfigSchema>;
|
|
95
|
+
interface ResolvedFeeConfig {
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
fundAddress: string | undefined;
|
|
98
|
+
marketplaceBps: number;
|
|
99
|
+
launchpadBps: number;
|
|
100
|
+
}
|
|
101
|
+
declare function resolveFeeConfig(raw: FeeConfig | undefined): ResolvedFeeConfig;
|
|
102
|
+
|
|
103
|
+
type FeeSurface = "marketplace" | "launchpad";
|
|
104
|
+
interface BuildFeeCallParams {
|
|
105
|
+
surface: FeeSurface;
|
|
106
|
+
/** ERC-20 address the gross amount is denominated in. */
|
|
107
|
+
token: string;
|
|
108
|
+
/** Gross amount in raw token units (e.g. price in wei, or price * quantity). */
|
|
109
|
+
grossAmount: bigint;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The single source of truth for the platform fee. Returns one ERC-20
|
|
113
|
+
* `transfer(fundAddress, feeAmount)` Call to bundle into the settlement
|
|
114
|
+
* multicall, or `null` when no fee should be charged.
|
|
115
|
+
*
|
|
116
|
+
* Fail-safe: returns null if disabled, no fund address, or the fee floors to 0.
|
|
117
|
+
*/
|
|
118
|
+
declare function buildFeeCall(p: BuildFeeCallParams, cfg: ResolvedFeeConfig): Call | null;
|
|
119
|
+
|
|
78
120
|
declare const MedialaneConfigSchema: z.ZodObject<{
|
|
79
121
|
network: z.ZodDefault<z.ZodEnum<["mainnet"]>>;
|
|
80
122
|
rpcUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -99,6 +141,22 @@ declare const MedialaneConfigSchema: z.ZodObject<{
|
|
|
99
141
|
baseDelayMs?: number | undefined;
|
|
100
142
|
maxDelayMs?: number | undefined;
|
|
101
143
|
}>>;
|
|
144
|
+
feeConfig: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
146
|
+
fundAddress: z.ZodOptional<z.ZodString>;
|
|
147
|
+
marketplaceBps: z.ZodDefault<z.ZodNumber>;
|
|
148
|
+
launchpadBps: z.ZodDefault<z.ZodNumber>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
marketplaceBps: number;
|
|
152
|
+
launchpadBps: number;
|
|
153
|
+
fundAddress?: string | undefined;
|
|
154
|
+
}, {
|
|
155
|
+
enabled?: boolean | undefined;
|
|
156
|
+
fundAddress?: string | undefined;
|
|
157
|
+
marketplaceBps?: number | undefined;
|
|
158
|
+
launchpadBps?: number | undefined;
|
|
159
|
+
}>>;
|
|
102
160
|
}, "strip", z.ZodTypeAny, {
|
|
103
161
|
network: "mainnet";
|
|
104
162
|
rpcUrl?: string | undefined;
|
|
@@ -115,6 +173,12 @@ declare const MedialaneConfigSchema: z.ZodObject<{
|
|
|
115
173
|
baseDelayMs?: number | undefined;
|
|
116
174
|
maxDelayMs?: number | undefined;
|
|
117
175
|
} | undefined;
|
|
176
|
+
feeConfig?: {
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
marketplaceBps: number;
|
|
179
|
+
launchpadBps: number;
|
|
180
|
+
fundAddress?: string | undefined;
|
|
181
|
+
} | undefined;
|
|
118
182
|
}, {
|
|
119
183
|
network?: "mainnet" | undefined;
|
|
120
184
|
rpcUrl?: string | undefined;
|
|
@@ -131,6 +195,12 @@ declare const MedialaneConfigSchema: z.ZodObject<{
|
|
|
131
195
|
baseDelayMs?: number | undefined;
|
|
132
196
|
maxDelayMs?: number | undefined;
|
|
133
197
|
} | undefined;
|
|
198
|
+
feeConfig?: {
|
|
199
|
+
enabled?: boolean | undefined;
|
|
200
|
+
fundAddress?: string | undefined;
|
|
201
|
+
marketplaceBps?: number | undefined;
|
|
202
|
+
launchpadBps?: number | undefined;
|
|
203
|
+
} | undefined;
|
|
134
204
|
}>;
|
|
135
205
|
type MedialaneConfig = z.input<typeof MedialaneConfigSchema>;
|
|
136
206
|
interface ResolvedConfig {
|
|
@@ -145,6 +215,7 @@ interface ResolvedConfig {
|
|
|
145
215
|
collectionContract: string;
|
|
146
216
|
collection1155Contract: string;
|
|
147
217
|
retryOptions?: RetryOptions;
|
|
218
|
+
feeConfig: ResolvedFeeConfig;
|
|
148
219
|
}
|
|
149
220
|
declare function resolveConfig(raw: MedialaneConfig): ResolvedConfig;
|
|
150
221
|
|
|
@@ -940,6 +1011,8 @@ interface ApiCreatorListResult {
|
|
|
940
1011
|
page: number;
|
|
941
1012
|
limit: number;
|
|
942
1013
|
}
|
|
1014
|
+
type ApiWalletType = "ARGENT" | "BRAAVOS" | "CARTRIDGE" | "PRIVY" | "CHIPIPAY" | "INJECTED" | "UNKNOWN";
|
|
1015
|
+
type ApiAppSource = "MEDIALANE_DAPP" | "MEDIALANE_IO" | "MEDIALANE_PORTAL" | "MEDIALANE_SDK";
|
|
943
1016
|
interface ApiUserWallet {
|
|
944
1017
|
walletAddress: string;
|
|
945
1018
|
}
|
|
@@ -1111,7 +1184,10 @@ declare class ApiClient {
|
|
|
1111
1184
|
* Call after onboarding when ChipiPay confirms the wallet address.
|
|
1112
1185
|
* Requires Clerk JWT; no tenant API key needed.
|
|
1113
1186
|
*/
|
|
1114
|
-
upsertMyWallet(clerkToken: string
|
|
1187
|
+
upsertMyWallet(clerkToken: string, options?: {
|
|
1188
|
+
walletType?: ApiWalletType;
|
|
1189
|
+
appSource?: ApiAppSource;
|
|
1190
|
+
}): Promise<ApiUserWallet>;
|
|
1115
1191
|
/**
|
|
1116
1192
|
* Get the authenticated user's stored wallet address from the backend DB.
|
|
1117
1193
|
* Returns null if the user has not completed onboarding yet.
|
|
@@ -1238,7 +1314,8 @@ declare class PopService {
|
|
|
1238
1314
|
|
|
1239
1315
|
declare class DropService {
|
|
1240
1316
|
private readonly factoryAddress;
|
|
1241
|
-
|
|
1317
|
+
private readonly config;
|
|
1318
|
+
constructor(config: ResolvedConfig);
|
|
1242
1319
|
private _collection;
|
|
1243
1320
|
claim(account: AccountInterface, collectionAddress: string, quantity?: bigint | string | number): Promise<TxResult>;
|
|
1244
1321
|
adminMint(account: AccountInterface, params: {
|
|
@@ -4238,4 +4315,4 @@ declare function build1155FulfillmentTypedData(message: Record<string, unknown>,
|
|
|
4238
4315
|
*/
|
|
4239
4316
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
4240
4317
|
|
|
4241
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, 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 ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_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, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type EnforcementDeclaration, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, 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, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_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 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, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
4318
|
+
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_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_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, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, 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, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AccountInterface, constants, TypedData } from 'starknet';
|
|
2
|
+
import { Call, AccountInterface, constants, TypedData } from 'starknet';
|
|
3
3
|
|
|
4
4
|
/** Medialane Protocol ERC-721 marketplace — immutable, no admin key. */
|
|
5
5
|
declare const MARKETPLACE_721_CONTRACT_MAINNET = "0x00f8ccaae0bc811c79605974cc1dab769b9cea8877f033f8e3c17f30457caba6";
|
|
@@ -75,6 +75,48 @@ interface RetryOptions {
|
|
|
75
75
|
maxDelayMs?: number;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
declare const FeeConfigSchema: z.ZodObject<{
|
|
79
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
fundAddress: z.ZodOptional<z.ZodString>;
|
|
81
|
+
marketplaceBps: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
launchpadBps: z.ZodDefault<z.ZodNumber>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
marketplaceBps: number;
|
|
86
|
+
launchpadBps: number;
|
|
87
|
+
fundAddress?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
enabled?: boolean | undefined;
|
|
90
|
+
fundAddress?: string | undefined;
|
|
91
|
+
marketplaceBps?: number | undefined;
|
|
92
|
+
launchpadBps?: number | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
type FeeConfig = z.input<typeof FeeConfigSchema>;
|
|
95
|
+
interface ResolvedFeeConfig {
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
fundAddress: string | undefined;
|
|
98
|
+
marketplaceBps: number;
|
|
99
|
+
launchpadBps: number;
|
|
100
|
+
}
|
|
101
|
+
declare function resolveFeeConfig(raw: FeeConfig | undefined): ResolvedFeeConfig;
|
|
102
|
+
|
|
103
|
+
type FeeSurface = "marketplace" | "launchpad";
|
|
104
|
+
interface BuildFeeCallParams {
|
|
105
|
+
surface: FeeSurface;
|
|
106
|
+
/** ERC-20 address the gross amount is denominated in. */
|
|
107
|
+
token: string;
|
|
108
|
+
/** Gross amount in raw token units (e.g. price in wei, or price * quantity). */
|
|
109
|
+
grossAmount: bigint;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The single source of truth for the platform fee. Returns one ERC-20
|
|
113
|
+
* `transfer(fundAddress, feeAmount)` Call to bundle into the settlement
|
|
114
|
+
* multicall, or `null` when no fee should be charged.
|
|
115
|
+
*
|
|
116
|
+
* Fail-safe: returns null if disabled, no fund address, or the fee floors to 0.
|
|
117
|
+
*/
|
|
118
|
+
declare function buildFeeCall(p: BuildFeeCallParams, cfg: ResolvedFeeConfig): Call | null;
|
|
119
|
+
|
|
78
120
|
declare const MedialaneConfigSchema: z.ZodObject<{
|
|
79
121
|
network: z.ZodDefault<z.ZodEnum<["mainnet"]>>;
|
|
80
122
|
rpcUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -99,6 +141,22 @@ declare const MedialaneConfigSchema: z.ZodObject<{
|
|
|
99
141
|
baseDelayMs?: number | undefined;
|
|
100
142
|
maxDelayMs?: number | undefined;
|
|
101
143
|
}>>;
|
|
144
|
+
feeConfig: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
146
|
+
fundAddress: z.ZodOptional<z.ZodString>;
|
|
147
|
+
marketplaceBps: z.ZodDefault<z.ZodNumber>;
|
|
148
|
+
launchpadBps: z.ZodDefault<z.ZodNumber>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
marketplaceBps: number;
|
|
152
|
+
launchpadBps: number;
|
|
153
|
+
fundAddress?: string | undefined;
|
|
154
|
+
}, {
|
|
155
|
+
enabled?: boolean | undefined;
|
|
156
|
+
fundAddress?: string | undefined;
|
|
157
|
+
marketplaceBps?: number | undefined;
|
|
158
|
+
launchpadBps?: number | undefined;
|
|
159
|
+
}>>;
|
|
102
160
|
}, "strip", z.ZodTypeAny, {
|
|
103
161
|
network: "mainnet";
|
|
104
162
|
rpcUrl?: string | undefined;
|
|
@@ -115,6 +173,12 @@ declare const MedialaneConfigSchema: z.ZodObject<{
|
|
|
115
173
|
baseDelayMs?: number | undefined;
|
|
116
174
|
maxDelayMs?: number | undefined;
|
|
117
175
|
} | undefined;
|
|
176
|
+
feeConfig?: {
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
marketplaceBps: number;
|
|
179
|
+
launchpadBps: number;
|
|
180
|
+
fundAddress?: string | undefined;
|
|
181
|
+
} | undefined;
|
|
118
182
|
}, {
|
|
119
183
|
network?: "mainnet" | undefined;
|
|
120
184
|
rpcUrl?: string | undefined;
|
|
@@ -131,6 +195,12 @@ declare const MedialaneConfigSchema: z.ZodObject<{
|
|
|
131
195
|
baseDelayMs?: number | undefined;
|
|
132
196
|
maxDelayMs?: number | undefined;
|
|
133
197
|
} | undefined;
|
|
198
|
+
feeConfig?: {
|
|
199
|
+
enabled?: boolean | undefined;
|
|
200
|
+
fundAddress?: string | undefined;
|
|
201
|
+
marketplaceBps?: number | undefined;
|
|
202
|
+
launchpadBps?: number | undefined;
|
|
203
|
+
} | undefined;
|
|
134
204
|
}>;
|
|
135
205
|
type MedialaneConfig = z.input<typeof MedialaneConfigSchema>;
|
|
136
206
|
interface ResolvedConfig {
|
|
@@ -145,6 +215,7 @@ interface ResolvedConfig {
|
|
|
145
215
|
collectionContract: string;
|
|
146
216
|
collection1155Contract: string;
|
|
147
217
|
retryOptions?: RetryOptions;
|
|
218
|
+
feeConfig: ResolvedFeeConfig;
|
|
148
219
|
}
|
|
149
220
|
declare function resolveConfig(raw: MedialaneConfig): ResolvedConfig;
|
|
150
221
|
|
|
@@ -940,6 +1011,8 @@ interface ApiCreatorListResult {
|
|
|
940
1011
|
page: number;
|
|
941
1012
|
limit: number;
|
|
942
1013
|
}
|
|
1014
|
+
type ApiWalletType = "ARGENT" | "BRAAVOS" | "CARTRIDGE" | "PRIVY" | "CHIPIPAY" | "INJECTED" | "UNKNOWN";
|
|
1015
|
+
type ApiAppSource = "MEDIALANE_DAPP" | "MEDIALANE_IO" | "MEDIALANE_PORTAL" | "MEDIALANE_SDK";
|
|
943
1016
|
interface ApiUserWallet {
|
|
944
1017
|
walletAddress: string;
|
|
945
1018
|
}
|
|
@@ -1111,7 +1184,10 @@ declare class ApiClient {
|
|
|
1111
1184
|
* Call after onboarding when ChipiPay confirms the wallet address.
|
|
1112
1185
|
* Requires Clerk JWT; no tenant API key needed.
|
|
1113
1186
|
*/
|
|
1114
|
-
upsertMyWallet(clerkToken: string
|
|
1187
|
+
upsertMyWallet(clerkToken: string, options?: {
|
|
1188
|
+
walletType?: ApiWalletType;
|
|
1189
|
+
appSource?: ApiAppSource;
|
|
1190
|
+
}): Promise<ApiUserWallet>;
|
|
1115
1191
|
/**
|
|
1116
1192
|
* Get the authenticated user's stored wallet address from the backend DB.
|
|
1117
1193
|
* Returns null if the user has not completed onboarding yet.
|
|
@@ -1238,7 +1314,8 @@ declare class PopService {
|
|
|
1238
1314
|
|
|
1239
1315
|
declare class DropService {
|
|
1240
1316
|
private readonly factoryAddress;
|
|
1241
|
-
|
|
1317
|
+
private readonly config;
|
|
1318
|
+
constructor(config: ResolvedConfig);
|
|
1242
1319
|
private _collection;
|
|
1243
1320
|
claim(account: AccountInterface, collectionAddress: string, quantity?: bigint | string | number): Promise<TxResult>;
|
|
1244
1321
|
adminMint(account: AccountInterface, params: {
|
|
@@ -4238,4 +4315,4 @@ declare function build1155FulfillmentTypedData(message: Record<string, unknown>,
|
|
|
4238
4315
|
*/
|
|
4239
4316
|
declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
4240
4317
|
|
|
4241
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, 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 ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintItemParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_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, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type EnforcementDeclaration, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, 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, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_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 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, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
4318
|
+
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_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_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, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, type EnforcementDeclaration, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, 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, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_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 { TypedDataRevision, num, Contract, shortString,
|
|
2
|
+
import { cairo, TypedDataRevision, num, Contract, shortString, constants, RpcProvider } from 'starknet';
|
|
3
3
|
|
|
4
4
|
// src/config.ts
|
|
5
5
|
|
|
@@ -61,6 +61,34 @@ var COLLECTION_1155_CONTRACT_MAINNET = "0x006b2dc7ca7c4f466bb4575ba043d934310f05
|
|
|
61
61
|
var ERC1155_FACTORY_CONTRACT_MAINNET = COLLECTION_1155_CONTRACT_MAINNET;
|
|
62
62
|
var COLLECTION_1155_CLASS_HASH_MAINNET = "0x39a85126c6627db263617e5bce2bb72e49d2bb1f20961efc8b8954665bcfd25";
|
|
63
63
|
var ERC1155_COLLECTION_CLASS_HASH_MAINNET = COLLECTION_1155_CLASS_HASH_MAINNET;
|
|
64
|
+
var FeeConfigSchema = z.object({
|
|
65
|
+
enabled: z.boolean().default(true),
|
|
66
|
+
fundAddress: z.string().min(1).optional(),
|
|
67
|
+
marketplaceBps: z.number().int().min(0).max(1e4).default(100),
|
|
68
|
+
launchpadBps: z.number().int().min(0).max(1e4).default(100)
|
|
69
|
+
});
|
|
70
|
+
function resolveFeeConfig(raw) {
|
|
71
|
+
const p = FeeConfigSchema.parse(raw ?? {});
|
|
72
|
+
return {
|
|
73
|
+
enabled: p.enabled,
|
|
74
|
+
fundAddress: p.fundAddress,
|
|
75
|
+
marketplaceBps: p.marketplaceBps,
|
|
76
|
+
launchpadBps: p.launchpadBps
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function buildFeeCall(p, cfg) {
|
|
80
|
+
if (!cfg.enabled || !cfg.fundAddress) return null;
|
|
81
|
+
const bps = p.surface === "marketplace" ? cfg.marketplaceBps : cfg.launchpadBps;
|
|
82
|
+
if (bps <= 0) return null;
|
|
83
|
+
const fee = p.grossAmount * BigInt(bps) / 10000n;
|
|
84
|
+
if (fee <= 0n) return null;
|
|
85
|
+
const u = cairo.uint256(fee.toString());
|
|
86
|
+
return {
|
|
87
|
+
contractAddress: p.token,
|
|
88
|
+
entrypoint: "transfer",
|
|
89
|
+
calldata: [cfg.fundAddress, u.low.toString(), u.high.toString()]
|
|
90
|
+
};
|
|
91
|
+
}
|
|
64
92
|
|
|
65
93
|
// src/config.ts
|
|
66
94
|
var MedialaneConfigSchema = z.object({
|
|
@@ -78,7 +106,8 @@ var MedialaneConfigSchema = z.object({
|
|
|
78
106
|
maxAttempts: z.number().int().min(1).max(10).optional(),
|
|
79
107
|
baseDelayMs: z.number().int().min(0).optional(),
|
|
80
108
|
maxDelayMs: z.number().int().min(0).optional()
|
|
81
|
-
}).optional()
|
|
109
|
+
}).optional(),
|
|
110
|
+
feeConfig: FeeConfigSchema.optional()
|
|
82
111
|
});
|
|
83
112
|
function resolveConfig(raw) {
|
|
84
113
|
const parsed = MedialaneConfigSchema.parse(raw);
|
|
@@ -95,7 +124,8 @@ function resolveConfig(raw) {
|
|
|
95
124
|
collection721Contract,
|
|
96
125
|
collectionContract: collection721Contract,
|
|
97
126
|
collection1155Contract: parsed.collection1155Contract ?? COLLECTION_1155_CONTRACT_MAINNET,
|
|
98
|
-
retryOptions: parsed.retryOptions
|
|
127
|
+
retryOptions: parsed.retryOptions,
|
|
128
|
+
feeConfig: resolveFeeConfig(parsed.feeConfig)
|
|
99
129
|
};
|
|
100
130
|
}
|
|
101
131
|
function buildOrderTypedData(message, chainId) {
|
|
@@ -3540,8 +3570,13 @@ async function fulfillOrder(account, params, config) {
|
|
|
3540
3570
|
]
|
|
3541
3571
|
};
|
|
3542
3572
|
const fulfillCall = contract.populate("fulfill_order", [fulfillPayload]);
|
|
3573
|
+
const feeCall = buildFeeCall(
|
|
3574
|
+
{ surface: "marketplace", token: paymentToken, grossAmount: BigInt(totalPrice) },
|
|
3575
|
+
config.feeConfig
|
|
3576
|
+
);
|
|
3577
|
+
const calls = feeCall ? [approveCall, fulfillCall, feeCall] : [approveCall, fulfillCall];
|
|
3543
3578
|
try {
|
|
3544
|
-
const tx = await account.execute(
|
|
3579
|
+
const tx = await account.execute(calls);
|
|
3545
3580
|
await provider.waitForTransaction(tx.transaction_hash);
|
|
3546
3581
|
return { txHash: tx.transaction_hash };
|
|
3547
3582
|
} catch (err) {
|
|
@@ -3650,8 +3685,14 @@ async function checkoutCart(account, items, config) {
|
|
|
3650
3685
|
});
|
|
3651
3686
|
fulfillCalls.push(contract.populate("fulfill_order", [fulfillPayload]));
|
|
3652
3687
|
}
|
|
3688
|
+
const feeCalls = Array.from(tokenTotals.entries()).map(
|
|
3689
|
+
([tokenAddr, totalWei]) => buildFeeCall(
|
|
3690
|
+
{ surface: "marketplace", token: tokenAddr, grossAmount: totalWei },
|
|
3691
|
+
config.feeConfig
|
|
3692
|
+
)
|
|
3693
|
+
).filter((c) => c !== null);
|
|
3653
3694
|
try {
|
|
3654
|
-
const tx = await account.execute([...approveCalls, ...fulfillCalls]);
|
|
3695
|
+
const tx = await account.execute([...approveCalls, ...fulfillCalls, ...feeCalls]);
|
|
3655
3696
|
await provider.waitForTransaction(tx.transaction_hash);
|
|
3656
3697
|
return { txHash: tx.transaction_hash };
|
|
3657
3698
|
} catch (err) {
|
|
@@ -4608,14 +4649,18 @@ var ApiClient = class {
|
|
|
4608
4649
|
* Call after onboarding when ChipiPay confirms the wallet address.
|
|
4609
4650
|
* Requires Clerk JWT; no tenant API key needed.
|
|
4610
4651
|
*/
|
|
4611
|
-
async upsertMyWallet(clerkToken) {
|
|
4652
|
+
async upsertMyWallet(clerkToken, options = {}) {
|
|
4612
4653
|
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/users/me`;
|
|
4613
4654
|
const res = await fetch(url, {
|
|
4614
4655
|
method: "POST",
|
|
4615
4656
|
headers: {
|
|
4616
4657
|
"Content-Type": "application/json",
|
|
4617
4658
|
"Authorization": `Bearer ${clerkToken}`
|
|
4618
|
-
}
|
|
4659
|
+
},
|
|
4660
|
+
body: JSON.stringify({
|
|
4661
|
+
walletType: options.walletType ?? "UNKNOWN",
|
|
4662
|
+
appSource: options.appSource ?? "MEDIALANE_SDK"
|
|
4663
|
+
})
|
|
4619
4664
|
});
|
|
4620
4665
|
return this.checkResponse(res);
|
|
4621
4666
|
}
|
|
@@ -4834,15 +4879,26 @@ function toContractConditions(c) {
|
|
|
4834
4879
|
};
|
|
4835
4880
|
}
|
|
4836
4881
|
var DropService = class {
|
|
4837
|
-
constructor(
|
|
4882
|
+
constructor(config) {
|
|
4838
4883
|
this.factoryAddress = DROP_FACTORY_CONTRACT_MAINNET;
|
|
4884
|
+
this.config = config;
|
|
4839
4885
|
}
|
|
4840
4886
|
_collection(address, account) {
|
|
4841
4887
|
return new Contract(DropCollectionABI, normalizeAddress(address), account);
|
|
4842
4888
|
}
|
|
4843
4889
|
async claim(account, collectionAddress, quantity = 1) {
|
|
4844
|
-
const
|
|
4845
|
-
const
|
|
4890
|
+
const collection = this._collection(collectionAddress, account);
|
|
4891
|
+
const qty = BigInt(quantity);
|
|
4892
|
+
const claimCall = collection.populate("claim", [qty]);
|
|
4893
|
+
const conditions = await collection.get_claim_conditions();
|
|
4894
|
+
const price = BigInt(conditions.price);
|
|
4895
|
+
const paymentToken = typeof conditions.payment_token === "bigint" ? "0x" + conditions.payment_token.toString(16) : conditions.payment_token;
|
|
4896
|
+
const feeCall = price > 0n ? buildFeeCall(
|
|
4897
|
+
{ surface: "launchpad", token: paymentToken, grossAmount: price * qty },
|
|
4898
|
+
this.config.feeConfig
|
|
4899
|
+
) : null;
|
|
4900
|
+
const calls = feeCall ? [claimCall, feeCall] : [claimCall];
|
|
4901
|
+
const res = await account.execute(calls);
|
|
4846
4902
|
return { txHash: res.transaction_hash };
|
|
4847
4903
|
}
|
|
4848
4904
|
async adminMint(account, params) {
|
|
@@ -5159,6 +5215,6 @@ function getServicesByCapability(cap) {
|
|
|
5159
5215
|
return Object.values(SERVICES).filter((s) => s.capabilities.includes(cap));
|
|
5160
5216
|
}
|
|
5161
5217
|
|
|
5162
|
-
export { ApiClient, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_MAINNET, CollectionRegistryABI, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNftABI, 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, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_START_BLOCK_MAINNET, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, MedialaneError, NFTCOMMENTS_CONTRACT_MAINNET, OPEN_LICENSES, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PopService, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
5218
|
+
export { ApiClient, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_CONTRACT_MAINNET, CollectionRegistryABI, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, ERC1155_COLLECTION_CLASS_HASH_MAINNET, ERC1155_FACTORY_CONTRACT_MAINNET, FeeConfigSchema, INDEXER_START_BLOCK_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNftABI, 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, MARKETPLACE_CLASS_HASH_MAINNET, MARKETPLACE_CONTRACT_MAINNET, MARKETPLACE_START_BLOCK_MAINNET, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, MedialaneError, NFTCOMMENTS_CONTRACT_MAINNET, OPEN_LICENSES, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PopService, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, build1155CancellationTypedData, build1155FulfillmentTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildFulfillmentTypedData, buildOrderTypedData, encodeByteArray, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, listServices, normalizeAddress, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
5163
5219
|
//# sourceMappingURL=index.js.map
|
|
5164
5220
|
//# sourceMappingURL=index.js.map
|