@imtbl/sdk 0.20.0 → 0.20.1-alpha.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/blockchain_data.d.ts +56 -50
- package/dist/blockchain_data.js +289 -4
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +71 -25
- package/dist/checkout_sdk.js +529 -133
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +12 -30
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +563 -137
- package/dist/index.d.ts +149 -89
- package/dist/index.js +563 -137
- package/dist/orderbook.d.ts +15 -15
- package/dist/orderbook.js +14 -14
- package/dist/passport.js +111 -5
- package/package.json +2 -2
package/dist/checkout_sdk.d.ts
CHANGED
|
@@ -11020,13 +11020,29 @@ interface GetAllBalancesResult {
|
|
|
11020
11020
|
* Interface representing the parameters for {@link Checkout.smartCheckout}
|
|
11021
11021
|
* @property {Web3Provider} provider - The provider to use for smart checkout.
|
|
11022
11022
|
* @property {ItemRequirement[]} itemRequirements - The item requirements for the transaction.
|
|
11023
|
-
* @property {
|
|
11023
|
+
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount - The transaction or gas amount.
|
|
11024
11024
|
*/
|
|
11025
11025
|
interface SmartCheckoutParams {
|
|
11026
11026
|
provider: Web3Provider;
|
|
11027
|
-
itemRequirements:
|
|
11028
|
-
transactionOrGasAmount:
|
|
11027
|
+
itemRequirements: (NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement)[];
|
|
11028
|
+
transactionOrGasAmount: FulfillmentTransaction | GasAmount;
|
|
11029
11029
|
}
|
|
11030
|
+
type NativeItemRequirement = {
|
|
11031
|
+
type: ItemType.NATIVE;
|
|
11032
|
+
amount: string;
|
|
11033
|
+
};
|
|
11034
|
+
type ERC20ItemRequirement = {
|
|
11035
|
+
type: ItemType.ERC20;
|
|
11036
|
+
contractAddress: string;
|
|
11037
|
+
amount: string;
|
|
11038
|
+
spenderAddress: string;
|
|
11039
|
+
};
|
|
11040
|
+
type ERC721ItemRequirement = {
|
|
11041
|
+
type: ItemType.ERC721;
|
|
11042
|
+
contractAddress: string;
|
|
11043
|
+
id: string;
|
|
11044
|
+
spenderAddress: string;
|
|
11045
|
+
};
|
|
11030
11046
|
/**
|
|
11031
11047
|
* Represents the item requirements for a transaction.
|
|
11032
11048
|
* NativeItem, ERC20Item or ERC721Item {@link Checkout.smartCheckout}.
|
|
@@ -11090,11 +11106,11 @@ declare enum TransactionOrGasType {
|
|
|
11090
11106
|
GAS = "GAS"
|
|
11091
11107
|
}
|
|
11092
11108
|
/**
|
|
11093
|
-
* The
|
|
11094
|
-
* @property {TransactionOrGasType} type - The type to indicate this is a
|
|
11109
|
+
* The fulfillment transaction which contains the transaction to send.
|
|
11110
|
+
* @property {TransactionOrGasType} type - The type to indicate this is a fulfillment transaction.
|
|
11095
11111
|
* @property {TransactionRequest} transaction - The transaction to send.
|
|
11096
11112
|
*/
|
|
11097
|
-
type
|
|
11113
|
+
type FulfillmentTransaction = {
|
|
11098
11114
|
type: TransactionOrGasType.TRANSACTION;
|
|
11099
11115
|
transaction: TransactionRequest;
|
|
11100
11116
|
};
|
|
@@ -11203,14 +11219,33 @@ type BalanceDelta = {
|
|
|
11203
11219
|
balance: BigNumber;
|
|
11204
11220
|
formattedBalance: string;
|
|
11205
11221
|
};
|
|
11222
|
+
interface OrderFee {
|
|
11223
|
+
amount: FeeToken | FeePercentage;
|
|
11224
|
+
recipient: string;
|
|
11225
|
+
}
|
|
11226
|
+
interface FeeToken {
|
|
11227
|
+
token: string;
|
|
11228
|
+
}
|
|
11229
|
+
interface FeePercentage {
|
|
11230
|
+
percentageDecimal: number;
|
|
11231
|
+
}
|
|
11206
11232
|
/**
|
|
11207
11233
|
* Interface representing the parameters for {@link Checkout.buy}
|
|
11208
11234
|
* @property {Web3Provider} provider - The provider to use for the buy.
|
|
11209
|
-
* @property {
|
|
11235
|
+
* @property {Array<BuyOrder>} orders - The orders to buy
|
|
11210
11236
|
*/
|
|
11211
11237
|
interface BuyParams {
|
|
11212
11238
|
provider: Web3Provider;
|
|
11213
|
-
|
|
11239
|
+
orders: Array<BuyOrder>;
|
|
11240
|
+
}
|
|
11241
|
+
/**
|
|
11242
|
+
* Interface representing the order to buy
|
|
11243
|
+
* @property {string} orderId - the id of the order to buy
|
|
11244
|
+
* @property {Array<OrderFee>} takerFees - array of order fees to apply to the order
|
|
11245
|
+
*/
|
|
11246
|
+
interface BuyOrder {
|
|
11247
|
+
id: string;
|
|
11248
|
+
takerFees?: Array<OrderFee>;
|
|
11214
11249
|
}
|
|
11215
11250
|
/**
|
|
11216
11251
|
* Interface representing the result of the buy
|
|
@@ -11259,11 +11294,11 @@ declare enum BuyStatusType {
|
|
|
11259
11294
|
/**
|
|
11260
11295
|
* Interface representing the parameters for {@link Checkout.cancel}
|
|
11261
11296
|
* @property {Web3Provider} provider - The provider to use for the cancel.
|
|
11262
|
-
* @property {string}
|
|
11297
|
+
* @property {string[]} orderIds - The order IDs to cancel.
|
|
11263
11298
|
*/
|
|
11264
11299
|
interface CancelParams {
|
|
11265
11300
|
provider: Web3Provider;
|
|
11266
|
-
|
|
11301
|
+
orderIds: string[];
|
|
11267
11302
|
}
|
|
11268
11303
|
interface CheckoutOverrides {
|
|
11269
11304
|
}
|
|
@@ -11286,6 +11321,7 @@ type RemoteConfiguration = {
|
|
|
11286
11321
|
bridge: BridgeConfig;
|
|
11287
11322
|
allowedNetworks: AllowedNetworkConfig[];
|
|
11288
11323
|
gasEstimateTokens?: GasEstimateTokenConfig;
|
|
11324
|
+
imxAddressMapping?: ImxAddressConfig;
|
|
11289
11325
|
};
|
|
11290
11326
|
/**
|
|
11291
11327
|
* A type representing the fee structure for an OnRamp provider
|
|
@@ -11339,6 +11375,13 @@ type BridgeConfig = {
|
|
|
11339
11375
|
type AllowedNetworkConfig = {
|
|
11340
11376
|
chainId: number;
|
|
11341
11377
|
};
|
|
11378
|
+
/**
|
|
11379
|
+
* A type representing the IMX address mappings across available networks.
|
|
11380
|
+
* @type {{ [chainId: string]: string }}
|
|
11381
|
+
*/
|
|
11382
|
+
type ImxAddressConfig = {
|
|
11383
|
+
[chainId: string]: string;
|
|
11384
|
+
};
|
|
11342
11385
|
/**
|
|
11343
11386
|
* A type representing the required information to estimate gas for a transaction.
|
|
11344
11387
|
* @type {{ [key: string]: { bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig, swapAddresses?: GasEstimateSwapTokenConfig } }}
|
|
@@ -11426,16 +11469,6 @@ interface CheckConnectionResult {
|
|
|
11426
11469
|
isConnected: boolean;
|
|
11427
11470
|
walletAddress: string;
|
|
11428
11471
|
}
|
|
11429
|
-
interface OrderFee {
|
|
11430
|
-
amount: FeeToken | FeePercentage;
|
|
11431
|
-
recipient: string;
|
|
11432
|
-
}
|
|
11433
|
-
interface FeeToken {
|
|
11434
|
-
token: string;
|
|
11435
|
-
}
|
|
11436
|
-
interface FeePercentage {
|
|
11437
|
-
percentageDecimal: number;
|
|
11438
|
-
}
|
|
11439
11472
|
/**
|
|
11440
11473
|
* An enum representing the type of gas estimate.
|
|
11441
11474
|
* @enum {string}
|
|
@@ -11564,11 +11597,22 @@ interface SellParams {
|
|
|
11564
11597
|
provider: Web3Provider;
|
|
11565
11598
|
orders: Array<SellOrder>;
|
|
11566
11599
|
}
|
|
11600
|
+
/**
|
|
11601
|
+
* Interface of the SellOrder to create a listing from, includes makerFees
|
|
11602
|
+
* @property {SellToken} sellToken - the token to be listed for sale
|
|
11603
|
+
* @property {BuyToken} buyToken - the token info of the price of the item
|
|
11604
|
+
* @property {OrderFee[]} makerFees - option array of makerFees to be applied to the listing
|
|
11605
|
+
*/
|
|
11567
11606
|
interface SellOrder {
|
|
11568
11607
|
sellToken: SellToken;
|
|
11569
11608
|
buyToken: BuyToken;
|
|
11570
11609
|
makerFees?: Array<OrderFee>;
|
|
11571
11610
|
}
|
|
11611
|
+
/**
|
|
11612
|
+
* Interface of the SellToken
|
|
11613
|
+
* @property {string} id - The ERC721 token id
|
|
11614
|
+
* @property {string} collectionAddress - The ERC721 contract address
|
|
11615
|
+
*/
|
|
11572
11616
|
interface SellToken {
|
|
11573
11617
|
id: string;
|
|
11574
11618
|
collectionAddress: string;
|
|
@@ -11628,7 +11672,7 @@ type BuyToken = NativeBuyToken | ERC20BuyToken;
|
|
|
11628
11672
|
/**
|
|
11629
11673
|
* Represents a native buy token
|
|
11630
11674
|
* @property {ItemType} type - The type indicate this is a native token.
|
|
11631
|
-
* @property {
|
|
11675
|
+
* @property {string} amount - The amount of native token.
|
|
11632
11676
|
*/
|
|
11633
11677
|
type NativeBuyToken = {
|
|
11634
11678
|
type: ItemType.NATIVE;
|
|
@@ -11637,7 +11681,7 @@ type NativeBuyToken = {
|
|
|
11637
11681
|
/**
|
|
11638
11682
|
* Represents a ERC20 buy token
|
|
11639
11683
|
* @property {ItemType} type - The type indicate this is a ERC20 token.
|
|
11640
|
-
* @property {
|
|
11684
|
+
* @property {string} amount - The amount of native token.
|
|
11641
11685
|
* @property {string} contractAddress - The contract address of the ERC20.
|
|
11642
11686
|
*/
|
|
11643
11687
|
type ERC20BuyToken = {
|
|
@@ -11834,14 +11878,16 @@ declare enum CheckoutErrorType {
|
|
|
11834
11878
|
CANCEL_ORDER_LISTING_ERROR = "CANCEL_ORDER_LISTING_ERROR",
|
|
11835
11879
|
PREPARE_ORDER_LISTING_ERROR = "PREPARE_ORDER_LISTING_ERROR",
|
|
11836
11880
|
CREATE_ORDER_LISTING_ERROR = "CREATE_ORDER_LISTING_ERROR",
|
|
11881
|
+
FULFILL_ORDER_LISTING_ERROR = "FULFILL_ORDER_LISTING_ERROR",
|
|
11837
11882
|
SWITCH_NETWORK_UNSUPPORTED = "SWITCH_NETWORK_UNSUPPORTED",
|
|
11838
11883
|
GET_ERC20_ALLOWANCE_ERROR = "GET_ERC20_ALLOWANCE_ERROR",
|
|
11839
11884
|
GET_ERC721_ALLOWANCE_ERROR = "GET_ERC721_ALLOWANCE_ERROR",
|
|
11840
11885
|
EXECUTE_APPROVAL_TRANSACTION_ERROR = "EXECUTE_APPROVAL_TRANSACTION_ERROR",
|
|
11841
|
-
|
|
11886
|
+
EXECUTE_FULFILLMENT_TRANSACTION_ERROR = "EXECUTE_FULFILLMENT_TRANSACTION_ERROR",
|
|
11842
11887
|
SIGN_MESSAGE_ERROR = "SIGN_MESSAGE_ERROR",
|
|
11843
11888
|
BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
|
|
11844
|
-
ORDER_FEE_ERROR = "ORDER_FEE_ERROR"
|
|
11889
|
+
ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
|
|
11890
|
+
ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR"
|
|
11845
11891
|
}
|
|
11846
11892
|
/**
|
|
11847
11893
|
* Represents an error object with a specific type, optional message, and optional data.
|
|
@@ -12016,4 +12062,4 @@ declare class Checkout {
|
|
|
12016
12062
|
getExchangeFeeEstimate(): Promise<OnRampProviderFees>;
|
|
12017
12063
|
}
|
|
12018
12064
|
|
|
12019
|
-
export { AllowedNetworkConfig, BuyParams, BuyResult, CHECKOUT_API_BASE_URL, CancelParams, ChainId, ChainName, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, CheckoutModuleConfiguration, ConnectParams, ConnectResult, DexConfig, ErrorType, ExchangeType, FeePercentage, FeeToken, FiatRampParams, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasEstimateType, GasTokenType, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, ItemType, NetworkFilter, NetworkFilterTypes, NetworkInfo, OrderFee, RemoteConfiguration, SellOrder, SellParams, SellResult, SellToken, SendTransactionParams, SendTransactionResult, SmartCheckoutParams, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, TransactionOrGasType, WalletFilter, WalletFilterTypes, WalletInfo, WalletProviderName };
|
|
12065
|
+
export { AllowedNetworkConfig, BuyParams, BuyResult, CHECKOUT_API_BASE_URL, CancelParams, ChainId, ChainName, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, CheckoutModuleConfiguration, ConnectParams, ConnectResult, DexConfig, ERC20ItemRequirement, ERC721ItemRequirement, ErrorType, ExchangeType, FeePercentage, FeeToken, FiatRampParams, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasEstimateType, GasTokenType, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, ItemRequirement, ItemType, NativeItemRequirement, NetworkFilter, NetworkFilterTypes, NetworkInfo, OrderFee, RemoteConfiguration, SellOrder, SellParams, SellResult, SellToken, SendTransactionParams, SendTransactionResult, SmartCheckoutParams, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, TransactionOrGasType, WalletFilter, WalletFilterTypes, WalletInfo, WalletProviderName };
|