@medialane/sdk 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -21
- package/dist/index.cjs +19 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +19 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,22 +7,27 @@ declare const SUPPORTED_TOKENS: readonly [{
|
|
|
7
7
|
readonly symbol: "USDC";
|
|
8
8
|
readonly address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb";
|
|
9
9
|
readonly decimals: 6;
|
|
10
|
-
|
|
11
|
-
readonly symbol: "USDC.e";
|
|
12
|
-
readonly address: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8";
|
|
13
|
-
readonly decimals: 6;
|
|
10
|
+
readonly listable: true;
|
|
14
11
|
}, {
|
|
15
12
|
readonly symbol: "USDT";
|
|
16
13
|
readonly address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8";
|
|
17
14
|
readonly decimals: 6;
|
|
15
|
+
readonly listable: true;
|
|
18
16
|
}, {
|
|
19
17
|
readonly symbol: "ETH";
|
|
20
18
|
readonly address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";
|
|
21
19
|
readonly decimals: 18;
|
|
20
|
+
readonly listable: true;
|
|
22
21
|
}, {
|
|
23
22
|
readonly symbol: "STRK";
|
|
24
23
|
readonly address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d";
|
|
25
24
|
readonly decimals: 18;
|
|
25
|
+
readonly listable: true;
|
|
26
|
+
}, {
|
|
27
|
+
readonly symbol: "WBTC";
|
|
28
|
+
readonly address: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac";
|
|
29
|
+
readonly decimals: 8;
|
|
30
|
+
readonly listable: true;
|
|
26
31
|
}];
|
|
27
32
|
type SupportedTokenSymbol = (typeof SUPPORTED_TOKENS)[number]["symbol"];
|
|
28
33
|
declare const SUPPORTED_NETWORKS: readonly ["mainnet", "sepolia"];
|
|
@@ -1083,6 +1088,11 @@ declare function getTokenByAddress(address: string): SupportedToken | undefined;
|
|
|
1083
1088
|
* Find a supported token by its symbol (case-insensitive).
|
|
1084
1089
|
*/
|
|
1085
1090
|
declare function getTokenBySymbol(symbol: string): SupportedToken | undefined;
|
|
1091
|
+
/**
|
|
1092
|
+
* Return all tokens available for use in listing and offer dialogs.
|
|
1093
|
+
* Tokens with listable: false appear only as marketplace filter chips.
|
|
1094
|
+
*/
|
|
1095
|
+
declare function getListableTokens(): ReadonlyArray<SupportedToken>;
|
|
1086
1096
|
|
|
1087
1097
|
/**
|
|
1088
1098
|
* Recursively convert all BigInt values to their decimal string representations.
|
|
@@ -1109,4 +1119,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
|
|
|
1109
1119
|
*/
|
|
1110
1120
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
1111
1121
|
|
|
1112
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1122
|
+
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.js
CHANGED
|
@@ -10,31 +10,35 @@ var MARKETPLACE_CONTRACT_SEPOLIA = "";
|
|
|
10
10
|
var COLLECTION_CONTRACT_SEPOLIA = "";
|
|
11
11
|
var SUPPORTED_TOKENS = [
|
|
12
12
|
{
|
|
13
|
-
// Circle-native USDC on Starknet (canonical
|
|
13
|
+
// Circle-native USDC on Starknet (canonical)
|
|
14
14
|
symbol: "USDC",
|
|
15
15
|
address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
|
|
16
|
-
decimals: 6
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
// Bridged USDC.e (Ethereum USDC bridged via Starkgate)
|
|
20
|
-
symbol: "USDC.e",
|
|
21
|
-
address: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
|
|
22
|
-
decimals: 6
|
|
16
|
+
decimals: 6,
|
|
17
|
+
listable: true
|
|
23
18
|
},
|
|
24
19
|
{
|
|
25
20
|
symbol: "USDT",
|
|
26
21
|
address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
|
|
27
|
-
decimals: 6
|
|
22
|
+
decimals: 6,
|
|
23
|
+
listable: true
|
|
28
24
|
},
|
|
29
25
|
{
|
|
30
26
|
symbol: "ETH",
|
|
31
27
|
address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
32
|
-
decimals: 18
|
|
28
|
+
decimals: 18,
|
|
29
|
+
listable: true
|
|
33
30
|
},
|
|
34
31
|
{
|
|
35
32
|
symbol: "STRK",
|
|
36
33
|
address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
|
|
37
|
-
decimals: 18
|
|
34
|
+
decimals: 18,
|
|
35
|
+
listable: true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
symbol: "WBTC",
|
|
39
|
+
address: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",
|
|
40
|
+
decimals: 8,
|
|
41
|
+
listable: true
|
|
38
42
|
}
|
|
39
43
|
];
|
|
40
44
|
var DEFAULT_CURRENCY = "USDC";
|
|
@@ -396,6 +400,9 @@ function getTokenBySymbol(symbol) {
|
|
|
396
400
|
const upper = symbol.toUpperCase();
|
|
397
401
|
return SUPPORTED_TOKENS.find((t) => t.symbol === upper);
|
|
398
402
|
}
|
|
403
|
+
function getListableTokens() {
|
|
404
|
+
return SUPPORTED_TOKENS.filter((t) => t.listable);
|
|
405
|
+
}
|
|
399
406
|
function buildOrderTypedData(message, chainId) {
|
|
400
407
|
return {
|
|
401
408
|
domain: {
|
|
@@ -1279,6 +1286,6 @@ var MedialaneClient = class {
|
|
|
1279
1286
|
}
|
|
1280
1287
|
};
|
|
1281
1288
|
|
|
1282
|
-
export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1289
|
+
export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1283
1290
|
//# sourceMappingURL=index.js.map
|
|
1284
1291
|
//# sourceMappingURL=index.js.map
|