@imtbl/sdk 0.28.10-alpha.1 → 0.29.0-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/README.md +147 -0
- package/dist/blockchain_data.d.ts +14 -5
- package/dist/blockchain_data.js +4 -4
- package/dist/browser/checkout/sdk.js +2 -2
- package/dist/browser/checkout/widgets.js +51 -51
- package/dist/checkout_sdk.d.ts +462 -216
- package/dist/checkout_sdk.js +6 -24
- package/dist/config.d.ts +18 -6
- package/dist/config.js +21 -20
- package/dist/immutablex_client.d.ts +14 -5
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +10 -10
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +174 -122
- package/dist/index.d.ts +471 -216
- package/dist/index.js +174 -122
- package/dist/orderbook.d.ts +14 -5
- package/dist/passport.d.ts +14 -5
- package/dist/passport.js +146 -98
- package/dist/provider.d.ts +14 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,16 +7,28 @@ declare class ImmutableConfiguration {
|
|
|
7
7
|
readonly environment: Environment;
|
|
8
8
|
readonly rateLimitingKey?: string;
|
|
9
9
|
readonly apiKey?: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly publishableKey?: string;
|
|
11
11
|
constructor(options: {
|
|
12
12
|
environment: Environment;
|
|
13
|
-
rateLimitingKey?: string;
|
|
14
|
-
apiKey?: string;
|
|
15
|
-
clientAppId?: string;
|
|
16
13
|
});
|
|
17
14
|
}
|
|
15
|
+
declare const addApiKeyToAxiosHeader: (apiKey: string) => void;
|
|
16
|
+
declare const addPublishableKeyToAxiosHeader: (publishableKey: string) => void;
|
|
17
|
+
declare const addRateLimitingKeyToAxiosHeader: (rateLimitingKey: string) => void;
|
|
18
|
+
type ImmutableConfigurationWithRequireableFields<T> = ImmutableConfiguration & (T extends {
|
|
19
|
+
apiKey: 'required';
|
|
20
|
+
} ? Required<{
|
|
21
|
+
apiKey: string;
|
|
22
|
+
}> : {}) & (T extends {
|
|
23
|
+
publishableKey: 'required';
|
|
24
|
+
} ? Required<{
|
|
25
|
+
publishableKey: string;
|
|
26
|
+
}> : {});
|
|
27
|
+
type ImmutableConfigurationWithOmitableFields<T> = (T extends {
|
|
28
|
+
apiKey: 'omit';
|
|
29
|
+
} ? Omit<ImmutableConfigurationWithRequireableFields<T>, 'apiKey'> : ImmutableConfigurationWithRequireableFields<T>);
|
|
18
30
|
interface ModuleConfiguration<T> {
|
|
19
|
-
baseConfig:
|
|
31
|
+
baseConfig: ImmutableConfigurationWithOmitableFields<T>;
|
|
20
32
|
overrides?: T;
|
|
21
33
|
}
|
|
22
34
|
|
|
@@ -25,11 +37,17 @@ declare const config_d_Environment: typeof Environment;
|
|
|
25
37
|
type config_d_ImmutableConfiguration = ImmutableConfiguration;
|
|
26
38
|
declare const config_d_ImmutableConfiguration: typeof ImmutableConfiguration;
|
|
27
39
|
type config_d_ModuleConfiguration<T> = ModuleConfiguration<T>;
|
|
40
|
+
declare const config_d_addApiKeyToAxiosHeader: typeof addApiKeyToAxiosHeader;
|
|
41
|
+
declare const config_d_addPublishableKeyToAxiosHeader: typeof addPublishableKeyToAxiosHeader;
|
|
42
|
+
declare const config_d_addRateLimitingKeyToAxiosHeader: typeof addRateLimitingKeyToAxiosHeader;
|
|
28
43
|
declare namespace config_d {
|
|
29
44
|
export {
|
|
30
45
|
config_d_Environment as Environment,
|
|
31
46
|
config_d_ImmutableConfiguration as ImmutableConfiguration,
|
|
32
47
|
config_d_ModuleConfiguration as ModuleConfiguration,
|
|
48
|
+
config_d_addApiKeyToAxiosHeader as addApiKeyToAxiosHeader,
|
|
49
|
+
config_d_addPublishableKeyToAxiosHeader as addPublishableKeyToAxiosHeader,
|
|
50
|
+
config_d_addRateLimitingKeyToAxiosHeader as addRateLimitingKeyToAxiosHeader,
|
|
33
51
|
};
|
|
34
52
|
}
|
|
35
53
|
|
|
@@ -15981,85 +15999,107 @@ interface FeePercentage {
|
|
|
15981
15999
|
type BuyResult = BuyResultSuccess | BuyResultFailed | BuyResultInsufficientFunds;
|
|
15982
16000
|
/**
|
|
15983
16001
|
* Represents the result of {@link Checkout.buy}
|
|
15984
|
-
* @property {CheckoutStatus.SUCCESS} status
|
|
15985
|
-
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
16002
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
16003
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
15986
16004
|
*/
|
|
15987
16005
|
type BuyResultSuccess = {
|
|
16006
|
+
/** The status to indicate success */
|
|
15988
16007
|
status: CheckoutStatus.SUCCESS;
|
|
16008
|
+
/** The sufficient result of smart checkout */
|
|
15989
16009
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
15990
16010
|
};
|
|
15991
16011
|
/**
|
|
15992
16012
|
* Represents the result of {@link Checkout.buy}
|
|
15993
|
-
* @property {CheckoutStatus.FAILED} status
|
|
15994
|
-
* @property {string} transactionHash
|
|
15995
|
-
* @property {string} reason
|
|
15996
|
-
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
16013
|
+
* @property {CheckoutStatus.FAILED} status
|
|
16014
|
+
* @property {string} transactionHash
|
|
16015
|
+
* @property {string} reason
|
|
16016
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
15997
16017
|
*/
|
|
15998
16018
|
type BuyResultFailed = {
|
|
16019
|
+
/** The status to indicate failure */
|
|
15999
16020
|
status: CheckoutStatus.FAILED;
|
|
16021
|
+
/** The transaction hash of the failed transaction */
|
|
16000
16022
|
transactionHash: string;
|
|
16023
|
+
/** The reason for the failure */
|
|
16001
16024
|
reason: string;
|
|
16025
|
+
/** The sufficient result of smart checkout */
|
|
16002
16026
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
16003
16027
|
};
|
|
16004
16028
|
/**
|
|
16005
16029
|
* Represents the result of {@link Checkout.buy}
|
|
16006
|
-
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
16007
|
-
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
16030
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
16031
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
16008
16032
|
*/
|
|
16009
16033
|
type BuyResultInsufficientFunds = {
|
|
16034
|
+
/** The status to indicate insufficient funds */
|
|
16010
16035
|
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
16036
|
+
/** The insufficient result of smart checkout */
|
|
16011
16037
|
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
16012
16038
|
};
|
|
16013
16039
|
type SellResult = SellResultSuccess | SellResultFailed | SellResultInsufficientFunds;
|
|
16014
16040
|
/**
|
|
16015
16041
|
* Represents the result of {@link Checkout.sell}
|
|
16016
|
-
* @property {CheckoutStatus.SUCCESS} status
|
|
16017
|
-
* @property {
|
|
16042
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
16043
|
+
* @property {string[]} orderIds
|
|
16044
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
16018
16045
|
*/
|
|
16019
16046
|
type SellResultSuccess = {
|
|
16047
|
+
/** The status to indicate success */
|
|
16020
16048
|
status: CheckoutStatus.SUCCESS;
|
|
16049
|
+
/** The orders' ids */
|
|
16021
16050
|
orderIds: string[];
|
|
16051
|
+
/** The sufficient result of smart checkout */
|
|
16022
16052
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
16023
16053
|
};
|
|
16024
16054
|
/**
|
|
16025
16055
|
* Represents the result of {@link Checkout.sell}
|
|
16026
|
-
* @property {CheckoutStatus.FAILED} status
|
|
16027
|
-
* @property {string} transactionHash
|
|
16028
|
-
* @property {string} reason
|
|
16029
|
-
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
16056
|
+
* @property {CheckoutStatus.FAILED} status
|
|
16057
|
+
* @property {string} transactionHash
|
|
16058
|
+
* @property {string} reason
|
|
16059
|
+
* @property {SmartCheckoutSufficient} smartCheckoutResult
|
|
16030
16060
|
*/
|
|
16031
16061
|
type SellResultFailed = {
|
|
16062
|
+
/** The status to indicate failure */
|
|
16032
16063
|
status: CheckoutStatus.FAILED;
|
|
16064
|
+
/** The transaction hash of the failed transaction */
|
|
16033
16065
|
transactionHash: string;
|
|
16066
|
+
/** The reason for the failure */
|
|
16034
16067
|
reason: string;
|
|
16068
|
+
/** The sufficient result of smart checkout */
|
|
16035
16069
|
smartCheckoutResult: SmartCheckoutSufficient;
|
|
16036
16070
|
};
|
|
16037
16071
|
/**
|
|
16038
16072
|
* Represents the result of {@link Checkout.sell}
|
|
16039
|
-
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
16040
|
-
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
16073
|
+
* @property {CheckoutStatus.INSUFFICIENT_FUNDS} status
|
|
16074
|
+
* @property {SmartCheckoutInsufficient} smartCheckoutResult
|
|
16041
16075
|
*/
|
|
16042
16076
|
type SellResultInsufficientFunds = {
|
|
16077
|
+
/** The status to indicate insufficient funds */
|
|
16043
16078
|
status: CheckoutStatus.INSUFFICIENT_FUNDS;
|
|
16079
|
+
/** The insufficient result of smart checkout */
|
|
16044
16080
|
smartCheckoutResult: SmartCheckoutInsufficient;
|
|
16045
16081
|
};
|
|
16046
16082
|
type CancelResult = CancelResultSuccess | CancelResultFailed;
|
|
16047
16083
|
/**
|
|
16048
16084
|
* Represents the result of {@link Checkout.cancel}
|
|
16049
|
-
* @property {CheckoutStatus.SUCCESS} status
|
|
16085
|
+
* @property {CheckoutStatus.SUCCESS} status
|
|
16050
16086
|
*/
|
|
16051
16087
|
type CancelResultSuccess = {
|
|
16088
|
+
/** The status to indicate success */
|
|
16052
16089
|
status: CheckoutStatus.SUCCESS;
|
|
16053
16090
|
};
|
|
16054
16091
|
/**
|
|
16055
16092
|
* Represents the result of {@link Checkout.cancel}
|
|
16056
|
-
* @property {CheckoutStatus.FAILED} status
|
|
16057
|
-
* @property {string} transactionHash
|
|
16058
|
-
* @property {string} reason
|
|
16093
|
+
* @property {CheckoutStatus.FAILED} status
|
|
16094
|
+
* @property {string} transactionHash
|
|
16095
|
+
* @property {string} reason
|
|
16059
16096
|
*/
|
|
16060
16097
|
type CancelResultFailed = {
|
|
16098
|
+
/** The status to indicate failure */
|
|
16061
16099
|
status: CheckoutStatus.FAILED;
|
|
16100
|
+
/** The transaction hash of the failed transaction */
|
|
16062
16101
|
transactionHash: string;
|
|
16102
|
+
/** The reason for the failure */
|
|
16063
16103
|
reason: string;
|
|
16064
16104
|
};
|
|
16065
16105
|
/**
|
|
@@ -16076,22 +16116,27 @@ declare enum CheckoutStatus {
|
|
|
16076
16116
|
}
|
|
16077
16117
|
/**
|
|
16078
16118
|
* The type representing the order to buy
|
|
16079
|
-
* @property {string} orderId
|
|
16080
|
-
* @property {Array<OrderFee>} takerFees
|
|
16119
|
+
* @property {string} orderId
|
|
16120
|
+
* @property {Array<OrderFee>} takerFees
|
|
16081
16121
|
*/
|
|
16082
16122
|
type BuyOrder = {
|
|
16123
|
+
/** the id of the order to buy */
|
|
16083
16124
|
id: string;
|
|
16125
|
+
/** array of order fees to apply to the order */
|
|
16084
16126
|
takerFees?: OrderFee[];
|
|
16085
16127
|
};
|
|
16086
16128
|
/**
|
|
16087
16129
|
* The type representing the sell order to create a listing from
|
|
16088
|
-
* @property {SellToken} sellToken
|
|
16089
|
-
* @property {BuyToken} buyToken
|
|
16090
|
-
* @property {OrderFee[]} makerFees
|
|
16130
|
+
* @property {SellToken} sellToken
|
|
16131
|
+
* @property {BuyToken} buyToken
|
|
16132
|
+
* @property {OrderFee[]} makerFees
|
|
16091
16133
|
*/
|
|
16092
16134
|
type SellOrder = {
|
|
16135
|
+
/** the token to be listed for sale */
|
|
16093
16136
|
sellToken: SellToken;
|
|
16137
|
+
/** the token info of the price of the item */
|
|
16094
16138
|
buyToken: BuyToken;
|
|
16139
|
+
/** option array of makerFees to be applied to the listing */
|
|
16095
16140
|
makerFees?: OrderFee[];
|
|
16096
16141
|
};
|
|
16097
16142
|
/**
|
|
@@ -16101,77 +16146,97 @@ type SellOrder = {
|
|
|
16101
16146
|
type BuyToken = NativeBuyToken | ERC20BuyToken;
|
|
16102
16147
|
/**
|
|
16103
16148
|
* Represents a native buy token
|
|
16104
|
-
* @property {ItemType} type
|
|
16105
|
-
* @property {string} amount
|
|
16149
|
+
* @property {ItemType} type
|
|
16150
|
+
* @property {string} amount
|
|
16106
16151
|
*/
|
|
16107
16152
|
type NativeBuyToken = {
|
|
16153
|
+
/** The type indicate this is a native token. */
|
|
16108
16154
|
type: ItemType.NATIVE;
|
|
16155
|
+
/** The amount of native token. */
|
|
16109
16156
|
amount: string;
|
|
16110
16157
|
};
|
|
16111
16158
|
/**
|
|
16112
16159
|
* Represents a ERC20 buy token
|
|
16113
|
-
* @property {ItemType} type
|
|
16114
|
-
* @property {string} amount
|
|
16115
|
-
* @property {string} contractAddress
|
|
16160
|
+
* @property {ItemType} type
|
|
16161
|
+
* @property {string} amount
|
|
16162
|
+
* @property {string} contractAddress
|
|
16116
16163
|
*/
|
|
16117
16164
|
type ERC20BuyToken = {
|
|
16165
|
+
/** The type indicate this is a ERC20 token. */
|
|
16118
16166
|
type: ItemType.ERC20;
|
|
16167
|
+
/** The amount of native token. */
|
|
16119
16168
|
amount: string;
|
|
16169
|
+
/** The contract address of the ERC20. */
|
|
16120
16170
|
contractAddress: string;
|
|
16121
16171
|
};
|
|
16122
16172
|
/**
|
|
16123
16173
|
* The SellToken type
|
|
16124
|
-
* @property {string} id
|
|
16125
|
-
* @property {string} collectionAddress
|
|
16174
|
+
* @property {string} id
|
|
16175
|
+
* @property {string} collectionAddress
|
|
16126
16176
|
*/
|
|
16127
16177
|
type SellToken = {
|
|
16178
|
+
/** The ERC721 token id */
|
|
16128
16179
|
id: string;
|
|
16180
|
+
/** The ERC721 collection address */
|
|
16129
16181
|
collectionAddress: string;
|
|
16130
16182
|
};
|
|
16131
16183
|
/**
|
|
16132
16184
|
* Interface representing the parameters for {@link Checkout.smartCheckout}
|
|
16133
|
-
* @property {Web3Provider} provider
|
|
16134
|
-
* @property {ItemRequirement[]} itemRequirements
|
|
16135
|
-
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount
|
|
16185
|
+
* @property {Web3Provider} provider
|
|
16186
|
+
* @property {ItemRequirement[]} itemRequirements
|
|
16187
|
+
* @property {FulfillmentTransaction | GasAmount} transactionOrGasAmount
|
|
16136
16188
|
*/
|
|
16137
16189
|
interface SmartCheckoutParams {
|
|
16190
|
+
/** The provider to use for smart checkout. */
|
|
16138
16191
|
provider: Web3Provider;
|
|
16192
|
+
/** The item requirements for the transaction. */
|
|
16139
16193
|
itemRequirements: (NativeItemRequirement | ERC20ItemRequirement | ERC721ItemRequirement)[];
|
|
16194
|
+
/** The transaction or gas amount. */
|
|
16140
16195
|
transactionOrGasAmount: FulfillmentTransaction | GasAmount;
|
|
16141
16196
|
}
|
|
16142
16197
|
/**
|
|
16143
16198
|
* Represents a native item requirement for a transaction.
|
|
16144
|
-
* @property {ItemType.NATIVE} type
|
|
16145
|
-
* @property {string} amount
|
|
16199
|
+
* @property {ItemType.NATIVE} type
|
|
16200
|
+
* @property {string} amount
|
|
16146
16201
|
*/
|
|
16147
16202
|
type NativeItemRequirement = {
|
|
16203
|
+
/** The type to indicate this is a native item requirement. */
|
|
16148
16204
|
type: ItemType.NATIVE;
|
|
16205
|
+
/** The amount of the item. */
|
|
16149
16206
|
amount: string;
|
|
16150
16207
|
};
|
|
16151
16208
|
/**
|
|
16152
16209
|
* Represents an ERC20 item requirement for a transaction.
|
|
16153
|
-
* @property {ItemType.ERC20} type
|
|
16154
|
-
* @property {string} amount
|
|
16155
|
-
* @property {string} contractAddress
|
|
16156
|
-
* @property {string} spenderAddress
|
|
16210
|
+
* @property {ItemType.ERC20} type
|
|
16211
|
+
* @property {string} amount
|
|
16212
|
+
* @property {string} contractAddress
|
|
16213
|
+
* @property {string} spenderAddress
|
|
16157
16214
|
*/
|
|
16158
16215
|
type ERC20ItemRequirement = {
|
|
16216
|
+
/** The type to indicate this is a ERC20 item requirement. */
|
|
16159
16217
|
type: ItemType.ERC20;
|
|
16218
|
+
/** The amount of the item. */
|
|
16160
16219
|
contractAddress: string;
|
|
16220
|
+
/** The contract address of the ERC20. */
|
|
16161
16221
|
amount: string;
|
|
16222
|
+
/** The contract address of the approver. */
|
|
16162
16223
|
spenderAddress: string;
|
|
16163
16224
|
};
|
|
16164
16225
|
/**
|
|
16165
16226
|
* Represents an ERC721 item requirement for a transaction.
|
|
16166
|
-
* @property {ItemType.ERC721} type
|
|
16167
|
-
* @property {string} contractAddress
|
|
16168
|
-
* @property {string} id
|
|
16169
|
-
* @property {string} spenderAddress
|
|
16227
|
+
* @property {ItemType.ERC721} type
|
|
16228
|
+
* @property {string} contractAddress
|
|
16229
|
+
* @property {string} id
|
|
16230
|
+
* @property {string} spenderAddress
|
|
16170
16231
|
*/
|
|
16171
16232
|
type ERC721ItemRequirement = {
|
|
16233
|
+
/** The type to indicate this is a ERC721 item requirement. */
|
|
16172
16234
|
type: ItemType.ERC721;
|
|
16235
|
+
/** The contract address of the ERC721 collection. */
|
|
16173
16236
|
contractAddress: string;
|
|
16237
|
+
/** The ID of this ERC721 in the collection. */
|
|
16174
16238
|
id: string;
|
|
16239
|
+
/** The contract address of the approver. */
|
|
16175
16240
|
spenderAddress: string;
|
|
16176
16241
|
};
|
|
16177
16242
|
/**
|
|
@@ -16198,20 +16263,24 @@ declare enum TransactionOrGasType {
|
|
|
16198
16263
|
}
|
|
16199
16264
|
/**
|
|
16200
16265
|
* The fulfillment transaction which contains the transaction to send.
|
|
16201
|
-
* @property {TransactionOrGasType} type
|
|
16202
|
-
* @property {TransactionRequest} transaction
|
|
16266
|
+
* @property {TransactionOrGasType} type
|
|
16267
|
+
* @property {TransactionRequest} transaction
|
|
16203
16268
|
*/
|
|
16204
16269
|
type FulfillmentTransaction = {
|
|
16270
|
+
/** The type to indicate this is a fulfillment transaction. */
|
|
16205
16271
|
type: TransactionOrGasType.TRANSACTION;
|
|
16272
|
+
/** The transaction to send. */
|
|
16206
16273
|
transaction: TransactionRequest;
|
|
16207
16274
|
};
|
|
16208
16275
|
/**
|
|
16209
16276
|
* The gas amount which contains the gas token and the gas limit.
|
|
16210
|
-
* @property {TransactionOrGasType} type
|
|
16211
|
-
* @property {GasToken} gasToken
|
|
16277
|
+
* @property {TransactionOrGasType} type
|
|
16278
|
+
* @property {GasToken} gasToken
|
|
16212
16279
|
*/
|
|
16213
16280
|
type GasAmount = {
|
|
16281
|
+
/** The type to indicate this is a gas amount. */
|
|
16214
16282
|
type: TransactionOrGasType.GAS;
|
|
16283
|
+
/** The gas token. */
|
|
16215
16284
|
gasToken: GasToken;
|
|
16216
16285
|
};
|
|
16217
16286
|
/**
|
|
@@ -16230,22 +16299,27 @@ declare enum GasTokenType {
|
|
|
16230
16299
|
}
|
|
16231
16300
|
/**
|
|
16232
16301
|
* Represents a native gas token.
|
|
16233
|
-
* @property {GasTokenType} type
|
|
16234
|
-
* @property {BigNumber} limit
|
|
16302
|
+
* @property {GasTokenType} type
|
|
16303
|
+
* @property {BigNumber} limit
|
|
16235
16304
|
*/
|
|
16236
16305
|
type NativeGas = {
|
|
16306
|
+
/** The type to indicate this is a native gas token. */
|
|
16237
16307
|
type: GasTokenType.NATIVE;
|
|
16308
|
+
/** The gas limit. */
|
|
16238
16309
|
limit: BigNumber;
|
|
16239
16310
|
};
|
|
16240
16311
|
/**
|
|
16241
16312
|
* Represents an ERC20 gas token.
|
|
16242
|
-
* @property {GasTokenType} type
|
|
16243
|
-
* @property {string} contractAddress
|
|
16244
|
-
* @property {BigNumber} limit
|
|
16313
|
+
* @property {GasTokenType} type
|
|
16314
|
+
* @property {string} contractAddress
|
|
16315
|
+
* @property {BigNumber} limit
|
|
16245
16316
|
*/
|
|
16246
16317
|
type ERC20Gas = {
|
|
16318
|
+
/** The type to indicate this is an ERC20 gas token. */
|
|
16247
16319
|
type: GasTokenType.ERC20;
|
|
16320
|
+
/** The contract address of the ERC20. */
|
|
16248
16321
|
contractAddress: string;
|
|
16322
|
+
/** The gas limit. */
|
|
16249
16323
|
limit: BigNumber;
|
|
16250
16324
|
};
|
|
16251
16325
|
/**
|
|
@@ -16254,34 +16328,38 @@ type ERC20Gas = {
|
|
|
16254
16328
|
type SmartCheckoutResult = SmartCheckoutSufficient | SmartCheckoutInsufficient;
|
|
16255
16329
|
/**
|
|
16256
16330
|
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is sufficient.
|
|
16257
|
-
* @property {boolean} sufficient
|
|
16258
|
-
* @property {TransactionRequirement[]} transactionRequirements
|
|
16259
|
-
* determined were required for the transaction.
|
|
16331
|
+
* @property {boolean} sufficient
|
|
16332
|
+
* @property {TransactionRequirement[]} transactionRequirements
|
|
16260
16333
|
*/
|
|
16261
16334
|
type SmartCheckoutSufficient = {
|
|
16335
|
+
/** Indicates that smart checkout determined the user had sufficient funds. */
|
|
16262
16336
|
sufficient: true;
|
|
16337
|
+
/** The transaction requirements smart checkout determined were required for the transaction. */
|
|
16263
16338
|
transactionRequirements: TransactionRequirement[];
|
|
16264
16339
|
};
|
|
16265
16340
|
/**
|
|
16266
16341
|
* Represents the result of {@link Checkout.smartCheckout} when smart checkout is insufficient.
|
|
16267
|
-
* @property {boolean} sufficient
|
|
16268
|
-
* @property {TransactionRequirement[]} transactionRequirements
|
|
16269
|
-
*
|
|
16270
|
-
* @property {SmartCheckoutRouter} router - The type containing the funding routes the user can take to fulfill the transaction requirements
|
|
16342
|
+
* @property {boolean} sufficient
|
|
16343
|
+
* @property {TransactionRequirement[]} transactionRequirements
|
|
16344
|
+
* @property {SmartCheckoutRouter} router
|
|
16271
16345
|
*/
|
|
16272
16346
|
type SmartCheckoutInsufficient = {
|
|
16347
|
+
/** Indicates that smart checkout determined the user has insufficient funds */
|
|
16273
16348
|
sufficient: false;
|
|
16349
|
+
/** The transaction requirements smart checkout determined were required for the transaction. */
|
|
16274
16350
|
transactionRequirements: TransactionRequirement[];
|
|
16351
|
+
/** The type containing the funding routes the user can take to fulfill the transaction requirements */
|
|
16275
16352
|
router: SmartCheckoutRouter;
|
|
16276
16353
|
};
|
|
16277
16354
|
/**
|
|
16278
16355
|
* Represents the routing outcome for a transaction.
|
|
16279
|
-
* @property {AvailableRoutingOptions} availableRoutingOptions
|
|
16280
|
-
* @property {RoutingOutcome} routingOutcome
|
|
16281
|
-
* includes the funding routes if routes were found
|
|
16356
|
+
* @property {AvailableRoutingOptions} availableRoutingOptions
|
|
16357
|
+
* @property {RoutingOutcome} routingOutcome
|
|
16282
16358
|
*/
|
|
16283
16359
|
type SmartCheckoutRouter = {
|
|
16360
|
+
/** The routing options available to the user */
|
|
16284
16361
|
availableRoutingOptions: AvailableRoutingOptions;
|
|
16362
|
+
/** The routing outcome for the transaction which includes the funding routes if routes were found */
|
|
16285
16363
|
routingOutcome: RoutingOutcome;
|
|
16286
16364
|
};
|
|
16287
16365
|
/**
|
|
@@ -16299,109 +16377,137 @@ declare enum RoutingOutcomeType {
|
|
|
16299
16377
|
type RoutingOutcome = RoutesFound | NoRoutesFound | NoRouteOptions;
|
|
16300
16378
|
/**
|
|
16301
16379
|
* Represents a routing outcome where funding routes were found.
|
|
16302
|
-
* @property {RoutingOutcomeType.ROUTES_FOUND} type
|
|
16303
|
-
* @property {AvailableRoutingOptions} fundingRoutes
|
|
16380
|
+
* @property {RoutingOutcomeType.ROUTES_FOUND} type
|
|
16381
|
+
* @property {AvailableRoutingOptions} fundingRoutes
|
|
16304
16382
|
*/
|
|
16305
16383
|
type RoutesFound = {
|
|
16384
|
+
/** Indicates that funding routes were found for the transaction. */
|
|
16306
16385
|
type: RoutingOutcomeType.ROUTES_FOUND;
|
|
16386
|
+
/** The funding routes found for the transaction. */
|
|
16307
16387
|
fundingRoutes: FundingRoute[];
|
|
16308
16388
|
};
|
|
16309
16389
|
/**
|
|
16310
16390
|
* Represents a routing outcome where no funding routes were found.
|
|
16311
|
-
* @property {RoutingOutcomeType.NO_ROUTES_FOUND} type
|
|
16312
|
-
* @property {string} message
|
|
16391
|
+
* @property {RoutingOutcomeType.NO_ROUTES_FOUND} type
|
|
16392
|
+
* @property {string} message
|
|
16313
16393
|
*/
|
|
16314
16394
|
type NoRoutesFound = {
|
|
16395
|
+
/** Indicates that no funding routes were found for the transaction. */
|
|
16315
16396
|
type: RoutingOutcomeType.NO_ROUTES_FOUND;
|
|
16397
|
+
/** The message indicating why no funding routes were found. */
|
|
16316
16398
|
message: string;
|
|
16317
16399
|
};
|
|
16318
16400
|
/**
|
|
16319
16401
|
* Represents a routing outcome where no routing options were available for the transaction.
|
|
16320
|
-
* @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type
|
|
16321
|
-
* @property {string} message
|
|
16402
|
+
* @property {RoutingOutcomeType.NO_ROUTE_OPTIONS} type
|
|
16403
|
+
* @property {string} message
|
|
16322
16404
|
*/
|
|
16323
16405
|
type NoRouteOptions = {
|
|
16406
|
+
/** Indicates that no routing options were available for the transaction. */
|
|
16324
16407
|
type: RoutingOutcomeType.NO_ROUTE_OPTIONS;
|
|
16408
|
+
/** The message indicating why no routing options were available. */
|
|
16325
16409
|
message: string;
|
|
16326
16410
|
};
|
|
16327
16411
|
/**
|
|
16328
16412
|
* Represents a funding route
|
|
16329
|
-
* @property {number} priority
|
|
16330
|
-
* @property {FundingStep[]} steps
|
|
16413
|
+
* @property {number} priority
|
|
16414
|
+
* @property {FundingStep[]} steps
|
|
16331
16415
|
*/
|
|
16332
16416
|
type FundingRoute = {
|
|
16417
|
+
/** The priority of the route */
|
|
16333
16418
|
priority: number;
|
|
16419
|
+
/** The steps associated with this funding route */
|
|
16334
16420
|
steps: FundingStep[];
|
|
16335
16421
|
};
|
|
16336
16422
|
/**
|
|
16337
16423
|
* Represents a fee
|
|
16338
|
-
* @property {BigNumber} amount
|
|
16339
|
-
* @property {string} formatted
|
|
16340
|
-
* @property {TokenInfo | undefined} token
|
|
16424
|
+
* @property {BigNumber} amount
|
|
16425
|
+
* @property {string} formatted
|
|
16426
|
+
* @property {TokenInfo | undefined} token
|
|
16341
16427
|
*/
|
|
16342
16428
|
type Fee = {
|
|
16429
|
+
/** The amount of the fee */
|
|
16343
16430
|
amount: BigNumber;
|
|
16431
|
+
/** The formatted amount of the fee */
|
|
16344
16432
|
formattedAmount: string;
|
|
16433
|
+
/** The token info for the fee */
|
|
16345
16434
|
token?: TokenInfo;
|
|
16346
16435
|
};
|
|
16347
16436
|
type FundingStep = BridgeFundingStep | SwapFundingStep | OnRampFundingStep;
|
|
16348
16437
|
/**
|
|
16349
16438
|
* Represents a bridge funding route
|
|
16350
|
-
* @property {FundingStepType.BRIDGE} type
|
|
16351
|
-
* @property {number} chainId
|
|
16352
|
-
* @property {FundingItem} fundingItem
|
|
16353
|
-
* @property {BridgeFees} fees
|
|
16439
|
+
* @property {FundingStepType.BRIDGE} type
|
|
16440
|
+
* @property {number} chainId
|
|
16441
|
+
* @property {FundingItem} fundingItem
|
|
16442
|
+
* @property {BridgeFees} fees
|
|
16354
16443
|
*/
|
|
16355
16444
|
type BridgeFundingStep = {
|
|
16445
|
+
/** Indicates that this is a bridge funding step */
|
|
16356
16446
|
type: FundingStepType.BRIDGE;
|
|
16447
|
+
/** The chain id the bridge should be executed on */
|
|
16357
16448
|
chainId: number;
|
|
16449
|
+
/** The funding item for the bridge */
|
|
16358
16450
|
fundingItem: FundingItem;
|
|
16451
|
+
/** The fees for the bridge */
|
|
16359
16452
|
fees: BridgeFees;
|
|
16360
16453
|
};
|
|
16361
16454
|
/**
|
|
16362
16455
|
* Represents the fees for a bridge funding step
|
|
16363
|
-
* @property {Fee} approvalGasFees
|
|
16364
|
-
* @property {Fee} bridgeGasFees
|
|
16365
|
-
* @property {Fee[]} bridgeFees
|
|
16456
|
+
* @property {Fee} approvalGasFees
|
|
16457
|
+
* @property {Fee} bridgeGasFees
|
|
16458
|
+
* @property {Fee[]} bridgeFees
|
|
16366
16459
|
*/
|
|
16367
16460
|
type BridgeFees = {
|
|
16461
|
+
/** The approval gas fees for the bridge */
|
|
16368
16462
|
approvalGasFees: Fee;
|
|
16463
|
+
/** The bridge gas fees for the bridge */
|
|
16369
16464
|
bridgeGasFees: Fee;
|
|
16465
|
+
/** Additional bridge fees for the bridge */
|
|
16370
16466
|
bridgeFees: Fee[];
|
|
16371
16467
|
};
|
|
16372
16468
|
/**
|
|
16373
16469
|
* Represents a swap funding route
|
|
16374
|
-
* @property {FundingStepType.SWAP} type
|
|
16375
|
-
* @property {number} chainId
|
|
16376
|
-
* @property {FundingItem} fundingItem
|
|
16377
|
-
* @property {SwapFees} fees
|
|
16470
|
+
* @property {FundingStepType.SWAP} type
|
|
16471
|
+
* @property {number} chainId
|
|
16472
|
+
* @property {FundingItem} fundingItem
|
|
16473
|
+
* @property {SwapFees} fees
|
|
16378
16474
|
*/
|
|
16379
16475
|
type SwapFundingStep = {
|
|
16476
|
+
/** Indicates that this is a swap funding step */
|
|
16380
16477
|
type: FundingStepType.SWAP;
|
|
16478
|
+
/** The chain id the swap should be executed on */
|
|
16381
16479
|
chainId: number;
|
|
16480
|
+
/** The funding item for the swap */
|
|
16382
16481
|
fundingItem: FundingItem;
|
|
16482
|
+
/** The fees for the swap */
|
|
16383
16483
|
fees: SwapFees;
|
|
16384
16484
|
};
|
|
16385
16485
|
/**
|
|
16386
16486
|
* Represents the fees for a swap funding step
|
|
16387
|
-
* @property {Fee} approvalGasFees
|
|
16388
|
-
* @property {Fee} swapGasFees
|
|
16389
|
-
* @property {Fee[]} swapFees
|
|
16487
|
+
* @property {Fee} approvalGasFees
|
|
16488
|
+
* @property {Fee} swapGasFees
|
|
16489
|
+
* @property {Fee[]} swapFees
|
|
16390
16490
|
*/
|
|
16391
16491
|
type SwapFees = {
|
|
16492
|
+
/** The approval gas fees for the swap */
|
|
16392
16493
|
approvalGasFees: Fee;
|
|
16494
|
+
/** The swap gas fees for the swap */
|
|
16393
16495
|
swapGasFees: Fee;
|
|
16496
|
+
/** Additional swap fees for the swap */
|
|
16394
16497
|
swapFees: Fee[];
|
|
16395
16498
|
};
|
|
16396
16499
|
/**
|
|
16397
16500
|
* Represents an onramp funding route
|
|
16398
|
-
* @property {FundingStepType.ONRAMP} type
|
|
16399
|
-
* @property {number} chainId
|
|
16400
|
-
* @property {FundingItem} fundingItem
|
|
16501
|
+
* @property {FundingStepType.ONRAMP} type
|
|
16502
|
+
* @property {number} chainId
|
|
16503
|
+
* @property {FundingItem} fundingItem
|
|
16401
16504
|
*/
|
|
16402
16505
|
type OnRampFundingStep = {
|
|
16506
|
+
/** Indicates that this is an onramp funding step */
|
|
16403
16507
|
type: FundingStepType.ONRAMP;
|
|
16508
|
+
/** The chain id the onramp should provide funds to */
|
|
16404
16509
|
chainId: number;
|
|
16510
|
+
/** The item to be onramped */
|
|
16405
16511
|
fundingItem: FundingItem;
|
|
16406
16512
|
};
|
|
16407
16513
|
/**
|
|
@@ -16418,76 +16524,98 @@ declare enum FundingStepType {
|
|
|
16418
16524
|
}
|
|
16419
16525
|
/**
|
|
16420
16526
|
* Represents a funding item
|
|
16421
|
-
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
16422
|
-
* @property {FundsRequired} fundsRequired
|
|
16423
|
-
* @property {UserBalance} userBalance
|
|
16424
|
-
* @property {TokenInfo} token
|
|
16527
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
16528
|
+
* @property {FundsRequired} fundsRequired
|
|
16529
|
+
* @property {UserBalance} userBalance
|
|
16530
|
+
* @property {TokenInfo} token
|
|
16425
16531
|
*/
|
|
16426
16532
|
type FundingItem = {
|
|
16533
|
+
/** The type of the funding item */
|
|
16427
16534
|
type: ItemType.NATIVE | ItemType.ERC20;
|
|
16535
|
+
/** The amount of funds required of this funding item */
|
|
16428
16536
|
fundsRequired: FundsRequired;
|
|
16537
|
+
/** The current user balance of this funding item */
|
|
16429
16538
|
userBalance: UserBalance;
|
|
16539
|
+
/** The token info for the funding item */
|
|
16430
16540
|
token: TokenInfo;
|
|
16431
16541
|
};
|
|
16432
16542
|
/**
|
|
16433
16543
|
* Represents the funds required of a funding item
|
|
16434
|
-
* @property {BigNumber} amount
|
|
16435
|
-
* @property {string} formattedAmount
|
|
16544
|
+
* @property {BigNumber} amount
|
|
16545
|
+
* @property {string} formattedAmount
|
|
16436
16546
|
*/
|
|
16437
16547
|
type FundsRequired = {
|
|
16548
|
+
/** The amount of funds required */
|
|
16438
16549
|
amount: BigNumber;
|
|
16550
|
+
/** The formatted amount of funds required */
|
|
16439
16551
|
formattedAmount: string;
|
|
16440
16552
|
};
|
|
16441
16553
|
/**
|
|
16442
16554
|
* Represents the user balance of a funding item
|
|
16443
|
-
* @property {BigNumber} balance
|
|
16444
|
-
* @property {string} formattedBalance
|
|
16555
|
+
* @property {BigNumber} balance
|
|
16556
|
+
* @property {string} formattedBalance
|
|
16445
16557
|
*/
|
|
16446
16558
|
type UserBalance = {
|
|
16559
|
+
/** The balance of the funding item */
|
|
16447
16560
|
balance: BigNumber;
|
|
16561
|
+
/** The formatted balance of the funding item */
|
|
16448
16562
|
formattedBalance: string;
|
|
16449
16563
|
};
|
|
16450
16564
|
/**
|
|
16451
16565
|
* Represents the transaction requirement for a transaction.
|
|
16452
|
-
* @property {ItemType} type
|
|
16453
|
-
* @property {boolean} sufficient
|
|
16454
|
-
* @property {ItemBalance} required
|
|
16455
|
-
* @property {ItemBalance} current
|
|
16456
|
-
* @property {BalanceDelta} delta
|
|
16566
|
+
* @property {ItemType} type
|
|
16567
|
+
* @property {boolean} sufficient
|
|
16568
|
+
* @property {ItemBalance} required
|
|
16569
|
+
* @property {ItemBalance} current
|
|
16570
|
+
* @property {BalanceDelta} delta
|
|
16457
16571
|
*/
|
|
16458
16572
|
type TransactionRequirement = {
|
|
16573
|
+
/** The type of the transaction requirement. */
|
|
16459
16574
|
type: ItemType;
|
|
16575
|
+
/** If the user address has sufficient funds to cover the transaction. */
|
|
16460
16576
|
sufficient: boolean;
|
|
16577
|
+
/** The required item balance. */
|
|
16461
16578
|
required: ItemBalance;
|
|
16579
|
+
/** The current item balance. */
|
|
16462
16580
|
current: ItemBalance;
|
|
16581
|
+
/** The delta between the required and current balances. */
|
|
16463
16582
|
delta: BalanceDelta;
|
|
16464
16583
|
};
|
|
16465
16584
|
/**
|
|
16466
16585
|
* Represents the balance for either a native or ERC20 token.
|
|
16467
|
-
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
16468
|
-
* @property {BigNumber} balance
|
|
16469
|
-
* @property {string}
|
|
16470
|
-
* @property {TokenInfo} token
|
|
16586
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type
|
|
16587
|
+
* @property {BigNumber} balance
|
|
16588
|
+
* @property {string} formattedBalanc
|
|
16589
|
+
* @property {TokenInfo} token
|
|
16471
16590
|
*/
|
|
16472
16591
|
type TokenBalance = {
|
|
16592
|
+
/** Type to indicate this is a native or ERC20 token. */
|
|
16473
16593
|
type: ItemType.NATIVE | ItemType.ERC20;
|
|
16594
|
+
/** The balance of the item. */
|
|
16474
16595
|
balance: BigNumber;
|
|
16596
|
+
/** The formatted balance of the item. */
|
|
16475
16597
|
formattedBalance: string;
|
|
16598
|
+
/** The token info of the item. */
|
|
16476
16599
|
token: TokenInfo;
|
|
16477
16600
|
};
|
|
16478
16601
|
/**
|
|
16479
16602
|
* Represents the balance for an ERC721.
|
|
16480
|
-
* @property {ItemType.ERC721} type
|
|
16481
|
-
* @property {BigNumber} balance
|
|
16482
|
-
* @property {string} formattedBalance
|
|
16483
|
-
* @property {string} contractAddress
|
|
16484
|
-
* @property {string} id
|
|
16603
|
+
* @property {ItemType.ERC721} type
|
|
16604
|
+
* @property {BigNumber} balance
|
|
16605
|
+
* @property {string} formattedBalance
|
|
16606
|
+
* @property {string} contractAddress
|
|
16607
|
+
* @property {string} id
|
|
16485
16608
|
*/
|
|
16486
16609
|
type ERC721Balance = {
|
|
16610
|
+
/** Type to indicate this is an ERC721 token. */
|
|
16487
16611
|
type: ItemType.ERC721;
|
|
16612
|
+
/** The balance of the item. */
|
|
16488
16613
|
balance: BigNumber;
|
|
16614
|
+
/** The formatted balance of the item. */
|
|
16489
16615
|
formattedBalance: string;
|
|
16616
|
+
/** The contract address of the ERC721 collection. */
|
|
16490
16617
|
contractAddress: string;
|
|
16618
|
+
/** The ID of the ERC721 in the collection */
|
|
16491
16619
|
id: string;
|
|
16492
16620
|
};
|
|
16493
16621
|
/**
|
|
@@ -16496,23 +16624,28 @@ type ERC721Balance = {
|
|
|
16496
16624
|
type ItemBalance = ERC721Balance | TokenBalance;
|
|
16497
16625
|
/**
|
|
16498
16626
|
* Represents the delta between two balances.
|
|
16499
|
-
* @property {BigNumber} balance
|
|
16500
|
-
* @property {string} formattedBalance
|
|
16627
|
+
* @property {BigNumber} balance
|
|
16628
|
+
* @property {string} formattedBalance
|
|
16501
16629
|
*/
|
|
16502
16630
|
type BalanceDelta = {
|
|
16631
|
+
/** The delta of the balance. */
|
|
16503
16632
|
balance: BigNumber;
|
|
16633
|
+
/** The formatted balance of the delta. */
|
|
16504
16634
|
formattedBalance: string;
|
|
16505
16635
|
};
|
|
16506
16636
|
/**
|
|
16507
16637
|
* A type representing the Smart Checkout routing options available for a user
|
|
16508
16638
|
* if they are configured and enabled (not geo-blocked etc.)
|
|
16509
|
-
* @property {boolean | undefined} onRamp
|
|
16510
|
-
* @property {boolean | undefined} swap
|
|
16511
|
-
* @property {boolean | undefined} bridge
|
|
16639
|
+
* @property {boolean | undefined} onRamp
|
|
16640
|
+
* @property {boolean | undefined} swap
|
|
16641
|
+
* @property {boolean | undefined} bridge
|
|
16512
16642
|
*/
|
|
16513
16643
|
type AvailableRoutingOptions = {
|
|
16644
|
+
/** If the user can use onramp */
|
|
16514
16645
|
onRamp?: boolean;
|
|
16646
|
+
/** If the user can use swap */
|
|
16515
16647
|
swap?: boolean;
|
|
16648
|
+
/** If the user can use bridge */
|
|
16516
16649
|
bridge?: boolean;
|
|
16517
16650
|
};
|
|
16518
16651
|
|
|
@@ -16615,69 +16748,88 @@ interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverri
|
|
|
16615
16748
|
/**
|
|
16616
16749
|
* A type representing various remotely defined configurations which are
|
|
16617
16750
|
* accessible via the Checkout config and configured based on the Environment.
|
|
16618
|
-
* @property {DexConfig} dex
|
|
16619
|
-
* @property {OnRampConfig} onramp
|
|
16620
|
-
* @property {
|
|
16621
|
-
* @property {
|
|
16751
|
+
* @property {DexConfig} dex
|
|
16752
|
+
* @property {OnRampConfig} onramp
|
|
16753
|
+
* @property {BridgeConfig} bridge
|
|
16754
|
+
* @property {AllowedNetworkConfig[]} allowedNetworks
|
|
16755
|
+
* @property {GasEstimateTokenConfig | undefined} gasEstimateTokens
|
|
16756
|
+
* @property {ImxAddressConfig | undefined} imxAddressMapping
|
|
16622
16757
|
*/
|
|
16623
16758
|
type RemoteConfiguration = {
|
|
16759
|
+
/** The config used for the DEX. */
|
|
16624
16760
|
dex: DexConfig;
|
|
16761
|
+
/** The config used for the OnRamp */
|
|
16625
16762
|
onramp: OnRampConfig;
|
|
16763
|
+
/** The config used for the Bridge. */
|
|
16626
16764
|
bridge: BridgeConfig;
|
|
16765
|
+
/** An array representing the allowed networks. */
|
|
16627
16766
|
allowedNetworks: AllowedNetworkConfig[];
|
|
16767
|
+
/** The config for the tokens used to estimate gas. */
|
|
16628
16768
|
gasEstimateTokens?: GasEstimateTokenConfig;
|
|
16769
|
+
/** The IMX address mappings across available networks. */
|
|
16629
16770
|
imxAddressMapping?: ImxAddressConfig;
|
|
16630
16771
|
};
|
|
16631
16772
|
/**
|
|
16632
16773
|
* A type representing the fee structure for an OnRamp provider
|
|
16633
|
-
* @property {string | undefined} minPercentage
|
|
16634
|
-
* @property {string | undefined} maxPercentage
|
|
16635
|
-
* @property {string | undefined} feePercentage
|
|
16774
|
+
* @property {string | undefined} minPercentage
|
|
16775
|
+
* @property {string | undefined} maxPercentage
|
|
16776
|
+
* @property {string | undefined} feePercentage
|
|
16636
16777
|
*/
|
|
16637
16778
|
type OnRampProviderFees = {
|
|
16779
|
+
/** The minimum percentage fee shown if a fee range is provided */
|
|
16638
16780
|
minPercentage?: string;
|
|
16781
|
+
/** The maximum percentage fee shown if a fee range is provided */
|
|
16639
16782
|
maxPercentage?: string;
|
|
16783
|
+
/** The specific fee percentage shown if there is no range provided */
|
|
16640
16784
|
feePercentage?: string;
|
|
16641
16785
|
};
|
|
16642
16786
|
/**
|
|
16643
16787
|
* A type representing the configuration for the OnRamp for a specific provider.
|
|
16644
|
-
* @property {string} publishableApiKey
|
|
16645
|
-
* @property {TokenInfo[]} tokens
|
|
16646
|
-
* @property {OnRampProviderFees} fees
|
|
16788
|
+
* @property {string} publishableApiKey
|
|
16789
|
+
* @property {TokenInfo[]} tokens
|
|
16790
|
+
* @property {OnRampProviderFees} fees
|
|
16647
16791
|
*/
|
|
16648
16792
|
type OnRampProviderConfig = {
|
|
16793
|
+
/** The on ramp provider publishable api-key */
|
|
16649
16794
|
publishableApiKey: string;
|
|
16795
|
+
/** The allowed tokens for the OnRamp provider */
|
|
16650
16796
|
tokens: TokenInfo[];
|
|
16797
|
+
/** The on ramp provider transaction fees */
|
|
16651
16798
|
fees: OnRampProviderFees;
|
|
16652
16799
|
};
|
|
16653
16800
|
/**
|
|
16654
16801
|
* A type representing the configuration for the OnRamp.
|
|
16655
|
-
* @property {OnRampProviderConfig} transak
|
|
16802
|
+
* @property {OnRampProviderConfig} transak
|
|
16656
16803
|
*/
|
|
16657
16804
|
type OnRampConfig = {
|
|
16805
|
+
/** OnRamp config for Transak provider */
|
|
16658
16806
|
[key: string]: OnRampProviderConfig;
|
|
16659
16807
|
};
|
|
16660
16808
|
/**
|
|
16661
16809
|
* A type representing the configuration for the DEX.
|
|
16662
|
-
* @property {ExchangeOverrides | undefined} overrides
|
|
16663
|
-
* @property {TokenInfo[] | undefined} tokens
|
|
16810
|
+
* @property {ExchangeOverrides | undefined} overrides
|
|
16811
|
+
* @property {TokenInfo[] | undefined} tokens
|
|
16664
16812
|
*/
|
|
16665
16813
|
type DexConfig = {
|
|
16814
|
+
/** The DEX overrides. */
|
|
16666
16815
|
overrides?: ExchangeOverrides;
|
|
16816
|
+
/** An array of tokens compatible with the DEX. */
|
|
16667
16817
|
tokens?: TokenInfo[];
|
|
16668
16818
|
};
|
|
16669
16819
|
/**
|
|
16670
16820
|
* A type representing the configuration for the Bridge.
|
|
16671
|
-
* @property {TokenInfo[] | undefined} tokens
|
|
16821
|
+
* @property {TokenInfo[] | undefined} tokens
|
|
16672
16822
|
*/
|
|
16673
16823
|
type BridgeConfig = {
|
|
16824
|
+
/** An array of tokens compatible with the Bridge. */
|
|
16674
16825
|
tokens?: TokenInfo[];
|
|
16675
16826
|
};
|
|
16676
16827
|
/**
|
|
16677
16828
|
* A type representing an allowed network.
|
|
16678
|
-
* @property {number} chainId
|
|
16829
|
+
* @property {number} chainId
|
|
16679
16830
|
*/
|
|
16680
16831
|
type AllowedNetworkConfig = {
|
|
16832
|
+
/** The network chain id. */
|
|
16681
16833
|
chainId: number;
|
|
16682
16834
|
};
|
|
16683
16835
|
/**
|
|
@@ -16692,40 +16844,47 @@ type ImxAddressConfig = {
|
|
|
16692
16844
|
* @type {{ [key: string]: { bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig, swapAddresses?: GasEstimateSwapTokenConfig } }}
|
|
16693
16845
|
* - A map of addresses for estimating gas keyed by the network chain id.
|
|
16694
16846
|
* @property {GasEstimateBridgeToL2TokenConfig | undefined} bridgeToL2Addresses
|
|
16695
|
-
*
|
|
16696
|
-
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses - The type representing the addresses for a swap gas estimate
|
|
16847
|
+
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses
|
|
16697
16848
|
*/
|
|
16698
16849
|
type GasEstimateTokenConfig = {
|
|
16699
16850
|
[key: string]: {
|
|
16851
|
+
/** The type representing the addresses for a bridge to layer 2 gas estimate. */
|
|
16700
16852
|
bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig;
|
|
16853
|
+
/** The type representing the addresses for a swap gas estimate */
|
|
16701
16854
|
swapAddresses?: GasEstimateSwapTokenConfig;
|
|
16702
16855
|
};
|
|
16703
16856
|
};
|
|
16704
16857
|
/**
|
|
16705
16858
|
* A type representing the config for a bridge to layer 2 gas estimate.
|
|
16706
|
-
* @property {string | 'NATIVE'} gasTokenAddress
|
|
16707
|
-
* @property {string} fromAddress
|
|
16859
|
+
* @property {string | 'NATIVE'} gasTokenAddress
|
|
16860
|
+
* @property {string} fromAddress
|
|
16708
16861
|
*/
|
|
16709
16862
|
type GasEstimateBridgeToL2TokenConfig = {
|
|
16863
|
+
/** The address of the gas token. */
|
|
16710
16864
|
gasTokenAddress: string | 'NATIVE';
|
|
16865
|
+
/** The address of the token being bridged. */
|
|
16711
16866
|
fromAddress: string;
|
|
16712
16867
|
};
|
|
16713
16868
|
/**
|
|
16714
16869
|
* A type representing the config for a swap gas estimate.
|
|
16715
|
-
* @property {string} inAddress
|
|
16716
|
-
* @property {string} outAddress
|
|
16870
|
+
* @property {string} inAddress
|
|
16871
|
+
* @property {string} outAddress
|
|
16717
16872
|
*/
|
|
16718
16873
|
type GasEstimateSwapTokenConfig = {
|
|
16874
|
+
/** The in token address. */
|
|
16719
16875
|
inAddress: string;
|
|
16876
|
+
/** The out token address. */
|
|
16720
16877
|
outAddress: string;
|
|
16721
16878
|
};
|
|
16722
16879
|
/**
|
|
16723
16880
|
* A type representing all the feature flags available.
|
|
16724
|
-
* @property {TokenInfo[] | undefined} allowed -
|
|
16725
|
-
* @property {boolean | undefined} blockscout -
|
|
16881
|
+
* @property {TokenInfo[] | undefined} allowed -
|
|
16882
|
+
* @property {boolean | undefined} blockscout -
|
|
16726
16883
|
*/
|
|
16727
16884
|
type ChainTokensConfig = {
|
|
16885
|
+
/** List of allowed tokens for a given chain. */
|
|
16728
16886
|
allowed?: TokenInfo[];
|
|
16887
|
+
/** Feature flag to enable/disable blockscout integration. */
|
|
16729
16888
|
blockscout?: boolean;
|
|
16730
16889
|
};
|
|
16731
16890
|
|
|
@@ -17140,10 +17299,11 @@ declare enum WidgetTheme {
|
|
|
17140
17299
|
}
|
|
17141
17300
|
|
|
17142
17301
|
/**
|
|
17143
|
-
*
|
|
17144
|
-
* @property {WidgetTheme | undefined} theme
|
|
17302
|
+
* Widget Configuration represents the shared configuration options for the Checkout Widgets.
|
|
17303
|
+
* @property {WidgetTheme | undefined} theme
|
|
17145
17304
|
*/
|
|
17146
17305
|
type WidgetConfiguration = {
|
|
17306
|
+
/** The theme of the Checkout Widget (default: "DARK") */
|
|
17147
17307
|
theme?: WidgetTheme;
|
|
17148
17308
|
};
|
|
17149
17309
|
|
|
@@ -17182,18 +17342,21 @@ declare enum ConnectEventType {
|
|
|
17182
17342
|
}
|
|
17183
17343
|
/**
|
|
17184
17344
|
* Represents a successful connection.
|
|
17185
|
-
* @property {Web3Provider} provider
|
|
17186
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
17345
|
+
* @property {Web3Provider} provider
|
|
17346
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
17187
17347
|
*/
|
|
17188
17348
|
type ConnectionSuccess = {
|
|
17349
|
+
/** The connected provider. */
|
|
17189
17350
|
provider: Web3Provider;
|
|
17351
|
+
/** The wallet provider name of the connected provider. */
|
|
17190
17352
|
walletProviderName: WalletProviderName | undefined;
|
|
17191
17353
|
};
|
|
17192
17354
|
/**
|
|
17193
17355
|
* Represents a connection failure with a reason.
|
|
17194
|
-
* @property {string} reason
|
|
17356
|
+
* @property {string} reason
|
|
17195
17357
|
*/
|
|
17196
17358
|
type ConnectionFailed = {
|
|
17359
|
+
/** The reason for the failed connection. */
|
|
17197
17360
|
reason: string;
|
|
17198
17361
|
};
|
|
17199
17362
|
|
|
@@ -17207,13 +17370,16 @@ declare enum WalletEventType {
|
|
|
17207
17370
|
}
|
|
17208
17371
|
/**
|
|
17209
17372
|
* Represents an event that is triggered when the user switches the network in their wallet.
|
|
17210
|
-
* @property {string} network
|
|
17211
|
-
* @property {number} chainId
|
|
17212
|
-
* @property {Web3Provider} provider
|
|
17373
|
+
* @property {string} network
|
|
17374
|
+
* @property {number} chainId
|
|
17375
|
+
* @property {Web3Provider} provider
|
|
17213
17376
|
*/
|
|
17214
17377
|
type WalletNetworkSwitch = {
|
|
17378
|
+
/** The name of the network that the user switched to. */
|
|
17215
17379
|
network: string;
|
|
17380
|
+
/** The chain ID of the network that the user switched to. */
|
|
17216
17381
|
chainId: number;
|
|
17382
|
+
/** The Web3 provider object for the switched network. */
|
|
17217
17383
|
provider: Web3Provider;
|
|
17218
17384
|
};
|
|
17219
17385
|
/**
|
|
@@ -17232,27 +17398,32 @@ declare enum SwapEventType {
|
|
|
17232
17398
|
}
|
|
17233
17399
|
/**
|
|
17234
17400
|
* Represents a successful swap transaction.
|
|
17235
|
-
* @property {string} transactionHash
|
|
17401
|
+
* @property {string} transactionHash
|
|
17236
17402
|
*/
|
|
17237
17403
|
type SwapSuccess = {
|
|
17404
|
+
/** The hash of the successful transaction. */
|
|
17238
17405
|
transactionHash: string;
|
|
17239
17406
|
};
|
|
17240
17407
|
/**
|
|
17241
17408
|
* Type representing a Swap Widget with type FAILURE.
|
|
17242
|
-
* @property {string} reason
|
|
17243
|
-
* @property {number} timestamp
|
|
17409
|
+
* @property {string} reason
|
|
17410
|
+
* @property {number} timestamp
|
|
17244
17411
|
*/
|
|
17245
17412
|
type SwapFailed = {
|
|
17413
|
+
/** The reason why the swap failed. */
|
|
17246
17414
|
reason: string;
|
|
17415
|
+
/** The timestamp of the failed swap. */
|
|
17247
17416
|
timestamp: number;
|
|
17248
17417
|
};
|
|
17249
17418
|
/**
|
|
17250
17419
|
* Type representing a Swap Widget with type REJECTED.
|
|
17251
|
-
* @property {string} reason -
|
|
17252
|
-
* @property {number} timestamp -
|
|
17420
|
+
* @property {string} reason -
|
|
17421
|
+
* @property {number} timestamp -
|
|
17253
17422
|
*/
|
|
17254
17423
|
type SwapRejected = {
|
|
17424
|
+
/** The reason why the swap failed. */
|
|
17255
17425
|
reason: string;
|
|
17426
|
+
/** The timestamp of the failed swap. */
|
|
17256
17427
|
timestamp: number;
|
|
17257
17428
|
};
|
|
17258
17429
|
|
|
@@ -17268,9 +17439,10 @@ declare enum SaleEventType {
|
|
|
17268
17439
|
}
|
|
17269
17440
|
/**
|
|
17270
17441
|
* Represents a successful Sale transaction.
|
|
17271
|
-
* @property {Array} transactions -
|
|
17442
|
+
* @property {Array} transactions -
|
|
17272
17443
|
*/
|
|
17273
17444
|
type SaleSuccess = {
|
|
17445
|
+
/** The executed transactions */
|
|
17274
17446
|
transactions: {
|
|
17275
17447
|
method: string;
|
|
17276
17448
|
hash: string | undefined;
|
|
@@ -17279,13 +17451,16 @@ type SaleSuccess = {
|
|
|
17279
17451
|
};
|
|
17280
17452
|
/**
|
|
17281
17453
|
* Type representing a Sale Widget with type FAILURE.
|
|
17282
|
-
* @property {string} reason
|
|
17283
|
-
* @property {number} timestamp
|
|
17284
|
-
* @property {Array} transactions
|
|
17454
|
+
* @property {string} reason
|
|
17455
|
+
* @property {number} timestamp
|
|
17456
|
+
* @property {Array} transactions
|
|
17285
17457
|
*/
|
|
17286
17458
|
type SaleFailed = {
|
|
17459
|
+
/** The reason why the swap failed. */
|
|
17287
17460
|
reason: string;
|
|
17461
|
+
/** The timestamp of the failed swap. */
|
|
17288
17462
|
timestamp: number;
|
|
17463
|
+
/** The executed transactions */
|
|
17289
17464
|
transactions: {
|
|
17290
17465
|
method: string;
|
|
17291
17466
|
hash: string | undefined;
|
|
@@ -17293,9 +17468,10 @@ type SaleFailed = {
|
|
|
17293
17468
|
};
|
|
17294
17469
|
/**
|
|
17295
17470
|
* Type representing a Sale Widget with type TRANSACTION_SUCCESS.
|
|
17296
|
-
* @property {Object} transactions
|
|
17471
|
+
* @property {Object} transactions
|
|
17297
17472
|
*/
|
|
17298
17473
|
type SaleTransactionSuccess = {
|
|
17474
|
+
/** The executed transactions */
|
|
17299
17475
|
transactions: {
|
|
17300
17476
|
method: string;
|
|
17301
17477
|
hash: string | undefined;
|
|
@@ -17312,18 +17488,21 @@ declare enum BridgeEventType {
|
|
|
17312
17488
|
}
|
|
17313
17489
|
/**
|
|
17314
17490
|
* Represents a successful bridge transaction.
|
|
17315
|
-
* @property {string} transactionHash
|
|
17491
|
+
* @property {string} transactionHash
|
|
17316
17492
|
*/
|
|
17317
17493
|
type BridgeSuccess = {
|
|
17494
|
+
/** The hash of the successful transaction. */
|
|
17318
17495
|
transactionHash: string;
|
|
17319
17496
|
};
|
|
17320
17497
|
/**
|
|
17321
17498
|
* Represents a failed bridge transaction.
|
|
17322
|
-
* @property {string} reason
|
|
17323
|
-
* @property {number} timestamp
|
|
17499
|
+
* @property {string} reason
|
|
17500
|
+
* @property {number} timestamp
|
|
17324
17501
|
*/
|
|
17325
17502
|
type BridgeFailed = {
|
|
17503
|
+
/** The reason for the failed transaction. */
|
|
17326
17504
|
reason: string;
|
|
17505
|
+
/** The timestamp of the failed transaction. */
|
|
17327
17506
|
timestamp: number;
|
|
17328
17507
|
};
|
|
17329
17508
|
|
|
@@ -17339,45 +17518,54 @@ declare enum OrchestrationEventType {
|
|
|
17339
17518
|
}
|
|
17340
17519
|
/**
|
|
17341
17520
|
* Represents the connect event object when the connect widget is requested.
|
|
17342
|
-
* @property {string} walletProviderName
|
|
17521
|
+
* @property {string} walletProviderName
|
|
17343
17522
|
*/
|
|
17344
17523
|
type RequestConnectEvent = {
|
|
17524
|
+
/** The wallet provider name. */
|
|
17345
17525
|
walletProviderName: string;
|
|
17346
17526
|
};
|
|
17347
17527
|
/**
|
|
17348
17528
|
* Represents the wallet event object when the wallet widget is requested.
|
|
17349
|
-
* @property {string} walletProviderName
|
|
17529
|
+
* @property {string} walletProviderName
|
|
17350
17530
|
*/
|
|
17351
17531
|
type RequestWalletEvent = {
|
|
17532
|
+
/** The wallet provider name. */
|
|
17352
17533
|
walletProviderName: string;
|
|
17353
17534
|
};
|
|
17354
17535
|
/**
|
|
17355
17536
|
* Represents the swap event object when the swap widget is requested.
|
|
17356
|
-
* @property {string} fromTokenAddress
|
|
17357
|
-
* @property {string} toTokenAddress
|
|
17358
|
-
* @property {string} amount
|
|
17537
|
+
* @property {string} fromTokenAddress
|
|
17538
|
+
* @property {string} toTokenAddress
|
|
17539
|
+
* @property {string} amount
|
|
17359
17540
|
*/
|
|
17360
17541
|
type RequestSwapEvent = {
|
|
17542
|
+
/** The address of the token to swap from. */
|
|
17361
17543
|
fromTokenAddress: string;
|
|
17544
|
+
/** The address of the token to swap to. */
|
|
17362
17545
|
toTokenAddress: string;
|
|
17546
|
+
/** The amount of from tokens to swap. */
|
|
17363
17547
|
amount: string;
|
|
17364
17548
|
};
|
|
17365
17549
|
/**
|
|
17366
17550
|
* Represents the bridge event object when the bridge widget is requested.
|
|
17367
|
-
* @property {string} tokenAddress
|
|
17368
|
-
* @property {string} amount
|
|
17551
|
+
* @property {string} tokenAddress
|
|
17552
|
+
* @property {string} amount
|
|
17369
17553
|
*/
|
|
17370
17554
|
type RequestBridgeEvent = {
|
|
17555
|
+
/** The address of the token to bridge. */
|
|
17371
17556
|
tokenAddress: string;
|
|
17557
|
+
/** The amount of tokens to bridge. */
|
|
17372
17558
|
amount: string;
|
|
17373
17559
|
};
|
|
17374
17560
|
/**
|
|
17375
17561
|
* Represents the onramp event object when the onramp widget is requested.
|
|
17376
|
-
* @property {string} tokenAddress
|
|
17377
|
-
* @property {string} amount
|
|
17562
|
+
* @property {string} tokenAddress
|
|
17563
|
+
* @property {string} amount
|
|
17378
17564
|
*/
|
|
17379
17565
|
type RequestOnrampEvent = {
|
|
17566
|
+
/** The address of the token to be used for onramp. */
|
|
17380
17567
|
tokenAddress: string;
|
|
17568
|
+
/** The amount of tokens to onramp. */
|
|
17381
17569
|
amount: string;
|
|
17382
17570
|
};
|
|
17383
17571
|
type OrchestrationEventData = RequestConnectEvent | RequestWalletEvent | RequestSwapEvent | RequestBridgeEvent | RequestOnrampEvent;
|
|
@@ -17392,18 +17580,21 @@ declare enum OnRampEventType {
|
|
|
17392
17580
|
}
|
|
17393
17581
|
/**
|
|
17394
17582
|
* Represents a successful on-ramp transaction.
|
|
17395
|
-
* @property {string} transactionHash
|
|
17583
|
+
* @property {string} transactionHash
|
|
17396
17584
|
*/
|
|
17397
17585
|
type OnRampSuccess = {
|
|
17586
|
+
/** The transaction hash of the successful transaction. */
|
|
17398
17587
|
transactionHash: string;
|
|
17399
17588
|
};
|
|
17400
17589
|
/**
|
|
17401
17590
|
* Type representing a On-ramp Widget with type FAILURE.
|
|
17402
|
-
* @property {string} reason
|
|
17403
|
-
* @property {number} timestamp
|
|
17591
|
+
* @property {string} reason
|
|
17592
|
+
* @property {number} timestamp
|
|
17404
17593
|
*/
|
|
17405
17594
|
type OnRampFailed = {
|
|
17595
|
+
/** The reason why the on-ramp failed. */
|
|
17406
17596
|
reason: string;
|
|
17597
|
+
/** The timestamp of the failed transaction. */
|
|
17407
17598
|
timestamp: number;
|
|
17408
17599
|
};
|
|
17409
17600
|
|
|
@@ -17415,82 +17606,128 @@ type ConnectWidgetParams = {};
|
|
|
17415
17606
|
|
|
17416
17607
|
/**
|
|
17417
17608
|
* Bridge Widget parameters
|
|
17418
|
-
* @property {string | undefined} fromContractAddress
|
|
17419
|
-
* @property {string | undefined} amount
|
|
17420
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
17609
|
+
* @property {string | undefined} fromContractAddress
|
|
17610
|
+
* @property {string | undefined} amount
|
|
17611
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
17421
17612
|
*/
|
|
17422
17613
|
type BridgeWidgetParams = {
|
|
17614
|
+
/** The contract address of the token to bridge from, used to populate the bridge form token field */
|
|
17423
17615
|
fromContractAddress?: string;
|
|
17616
|
+
/** The formatted amount to bridge, used to populate the bridge form amount field */
|
|
17424
17617
|
amount?: string;
|
|
17618
|
+
/** The wallet provider name to use for the bridge widget */
|
|
17425
17619
|
walletProviderName?: WalletProviderName;
|
|
17426
17620
|
};
|
|
17427
17621
|
|
|
17428
17622
|
/**
|
|
17429
17623
|
* Wallet Widget parameters
|
|
17430
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
17431
|
-
* @property {Web3Provider | undefined} web3Provider - The ethers Web3Provider
|
|
17624
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
17432
17625
|
*/
|
|
17433
17626
|
type WalletWidgetParams = {
|
|
17627
|
+
/** The wallet provider name to use for the wallet widget */
|
|
17434
17628
|
walletProviderName?: WalletProviderName;
|
|
17435
17629
|
};
|
|
17436
17630
|
|
|
17437
17631
|
/**
|
|
17438
17632
|
* Swap Widget parameters
|
|
17439
|
-
* @property {string | undefined} amount
|
|
17440
|
-
* @property {string | undefined} fromContractAddress
|
|
17441
|
-
* @property {string | undefined} toContractAddress
|
|
17442
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
17633
|
+
* @property {string | undefined} amount
|
|
17634
|
+
* @property {string | undefined} fromContractAddress
|
|
17635
|
+
* @property {string | undefined} toContractAddress
|
|
17636
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
17443
17637
|
*/
|
|
17444
|
-
|
|
17638
|
+
type SwapWidgetParams = {
|
|
17639
|
+
/** The formatted amount to swap, used to populate the swap from amount field */
|
|
17445
17640
|
amount?: string;
|
|
17641
|
+
/** The contract address of the token to swap from */
|
|
17446
17642
|
fromContractAddress?: string;
|
|
17643
|
+
/** The contract address of the token to swap to */
|
|
17447
17644
|
toContractAddress?: string;
|
|
17645
|
+
/** The wallet provider name to use for the swap widget */
|
|
17448
17646
|
walletProviderName?: WalletProviderName;
|
|
17449
|
-
}
|
|
17647
|
+
};
|
|
17450
17648
|
|
|
17451
17649
|
/**
|
|
17452
17650
|
* OnRamp Widget parameters
|
|
17453
|
-
* @property {string | undefined} contractAddress
|
|
17454
|
-
* @property {string | undefined} amount
|
|
17455
|
-
* @property {WalletProviderName | undefined} walletProviderName
|
|
17651
|
+
* @property {string | undefined} contractAddress
|
|
17652
|
+
* @property {string | undefined} amount
|
|
17653
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
17456
17654
|
*/
|
|
17457
17655
|
type OnRampWidgetParams = {
|
|
17656
|
+
/** The contract address of the token to onramp */
|
|
17458
17657
|
contractAddress?: string;
|
|
17658
|
+
/** The formatted amount to onramp, used to populate the onramp form amount field */
|
|
17459
17659
|
amount?: string;
|
|
17660
|
+
/** The wallet provider name to use for the onramp widget */
|
|
17460
17661
|
walletProviderName?: WalletProviderName;
|
|
17461
17662
|
};
|
|
17462
17663
|
|
|
17463
17664
|
/**
|
|
17464
17665
|
* Sale Widget parameters
|
|
17465
|
-
* @property {string} amount
|
|
17466
|
-
* @property {
|
|
17467
|
-
* @property {
|
|
17666
|
+
* @property {string} amount
|
|
17667
|
+
* @property {string} environmentId
|
|
17668
|
+
* @property {string} fromContractAddress
|
|
17669
|
+
* @property {SaleItem[]} items
|
|
17670
|
+
* @property {WalletProviderName | undefined} walletProviderName
|
|
17468
17671
|
*/
|
|
17469
17672
|
type SaleWidgetParams = {
|
|
17673
|
+
/** The total price to pay for the items in the sale */
|
|
17470
17674
|
amount?: string;
|
|
17471
17675
|
environmentId?: string;
|
|
17472
17676
|
fromContractAddress?: string;
|
|
17677
|
+
/** The list of products to be purchased */
|
|
17473
17678
|
items?: SaleItem[];
|
|
17679
|
+
/** The wallet provider name to default to if no web3Provider is passed */
|
|
17474
17680
|
walletProviderName?: WalletProviderName;
|
|
17475
17681
|
};
|
|
17682
|
+
/**
|
|
17683
|
+
* A product to be purchased
|
|
17684
|
+
* @property {string} productId
|
|
17685
|
+
* @property {number} qty
|
|
17686
|
+
* @property {string} name
|
|
17687
|
+
* @property {string} image
|
|
17688
|
+
* @property {string} description
|
|
17689
|
+
*/
|
|
17476
17690
|
type SaleItem = {
|
|
17691
|
+
/** The id of the product */
|
|
17477
17692
|
productId: string;
|
|
17693
|
+
/** The quantity to be purchased */
|
|
17478
17694
|
qty: number;
|
|
17695
|
+
/** The name of the item */
|
|
17479
17696
|
name: string;
|
|
17697
|
+
/** The image url of the item */
|
|
17480
17698
|
image: string;
|
|
17699
|
+
/** The description of the item */
|
|
17481
17700
|
description: string;
|
|
17482
17701
|
};
|
|
17483
17702
|
|
|
17703
|
+
/**
|
|
17704
|
+
* Connect Widget Configuration represents the configuration options for the Connect Widget.
|
|
17705
|
+
*/
|
|
17484
17706
|
type ConnectWidgetConfiguration = {} & WidgetConfiguration;
|
|
17485
17707
|
|
|
17708
|
+
/**
|
|
17709
|
+
* Bridge Widget Configuration represents the configuration options for the Bridge Widget.
|
|
17710
|
+
*/
|
|
17486
17711
|
type BridgeWidgetConfiguration = {} & WidgetConfiguration;
|
|
17487
17712
|
|
|
17713
|
+
/**
|
|
17714
|
+
* Wallet Widget Configuration represents the configuration options for the Wallet Widget.
|
|
17715
|
+
*/
|
|
17488
17716
|
type WalletWidgetConfiguration = {} & WidgetConfiguration;
|
|
17489
17717
|
|
|
17718
|
+
/**
|
|
17719
|
+
* Swap Widget Configuration represents the configuration options for the Swap Widget.
|
|
17720
|
+
*/
|
|
17490
17721
|
type SwapWidgetConfiguration = {} & WidgetConfiguration;
|
|
17491
17722
|
|
|
17723
|
+
/**
|
|
17724
|
+
* Onramp Widget Configuration represents the configuration options for the Onramp Widget.
|
|
17725
|
+
*/
|
|
17492
17726
|
type OnrampWidgetConfiguration = {} & WidgetConfiguration;
|
|
17493
17727
|
|
|
17728
|
+
/**
|
|
17729
|
+
* Sale Widget Configuration represents the configuration options for the Sale Widget.
|
|
17730
|
+
*/
|
|
17494
17731
|
type SaleWidgetConfiguration = {} & WidgetConfiguration;
|
|
17495
17732
|
|
|
17496
17733
|
/**
|
|
@@ -17605,21 +17842,25 @@ type WidgetEvent<T extends WidgetType, KEventName extends keyof WidgetEventData[
|
|
|
17605
17842
|
/**
|
|
17606
17843
|
* Represents an event emitted by a widget.
|
|
17607
17844
|
* @template KEventName - The orchestration event name.
|
|
17608
|
-
* @property {KEventName} type
|
|
17609
|
-
* @property {OrchestrationMapping[KEventName]} data
|
|
17845
|
+
* @property {KEventName} type
|
|
17846
|
+
* @property {OrchestrationMapping[KEventName]} data
|
|
17610
17847
|
*/
|
|
17611
17848
|
type OrchestrationEvent<KEventName extends keyof OrchestrationMapping> = {
|
|
17849
|
+
/** The type of the event. */
|
|
17612
17850
|
type: KEventName;
|
|
17851
|
+
/** The data associated with the event. */
|
|
17613
17852
|
data: OrchestrationMapping[KEventName];
|
|
17614
17853
|
};
|
|
17615
17854
|
/**
|
|
17616
17855
|
* Represents an event emitted by a widget.
|
|
17617
17856
|
* @template KEventName - The provider event name.
|
|
17618
|
-
* @property {KEventName} type
|
|
17619
|
-
* @property {ProviderEventMapping[KEventName]} data
|
|
17857
|
+
* @property {KEventName} type
|
|
17858
|
+
* @property {ProviderEventMapping[KEventName]} data
|
|
17620
17859
|
*/
|
|
17621
17860
|
type ProviderEvent<KEventName extends keyof ProviderEventMapping> = {
|
|
17861
|
+
/** The type of the event. */
|
|
17622
17862
|
type: KEventName;
|
|
17863
|
+
/** The data associated with the event. */
|
|
17623
17864
|
data: ProviderEventMapping[KEventName];
|
|
17624
17865
|
};
|
|
17625
17866
|
interface IWidgetsFactory {
|
|
@@ -17631,7 +17872,7 @@ interface IWidgetsFactory {
|
|
|
17631
17872
|
create<T extends WidgetType>(type: T, props?: WidgetProperties<T>): Widget<T>;
|
|
17632
17873
|
/**
|
|
17633
17874
|
* Update the widgets provider instance.
|
|
17634
|
-
* @param provider provider
|
|
17875
|
+
* @param provider the provider instance to update all widgets.
|
|
17635
17876
|
*/
|
|
17636
17877
|
updateProvider(provider: Web3Provider): void;
|
|
17637
17878
|
}
|
|
@@ -17668,11 +17909,11 @@ interface Widget<T extends WidgetType> {
|
|
|
17668
17909
|
}
|
|
17669
17910
|
/**
|
|
17670
17911
|
* Represents the version of the Checkout Widgets to use defaults to (0.1.9-alpha)
|
|
17671
|
-
* @property {number} major
|
|
17672
|
-
* @property {number | undefined} minor
|
|
17673
|
-
* @property {number | undefined} patch
|
|
17674
|
-
* @property {'alpha' | undefined} prerelease
|
|
17675
|
-
* @property {number | undefined} build
|
|
17912
|
+
* @property {number} major
|
|
17913
|
+
* @property {number | undefined} minor
|
|
17914
|
+
* @property {number | undefined} patch
|
|
17915
|
+
* @property {'alpha' | undefined} prerelease
|
|
17916
|
+
* @property {number | undefined} build
|
|
17676
17917
|
*
|
|
17677
17918
|
* @example
|
|
17678
17919
|
* { major: 0 } - use default version 0.1.9-alpha
|
|
@@ -17681,27 +17922,38 @@ interface Widget<T extends WidgetType> {
|
|
|
17681
17922
|
* { major: 1, minor: 2, patch: 3 } - use version 1.2.3 specifically
|
|
17682
17923
|
*/
|
|
17683
17924
|
type SemanticVersion = {
|
|
17925
|
+
/** The major version of the widgets, must specify a major version even if it is 0. */
|
|
17684
17926
|
major: number;
|
|
17927
|
+
/** The minor version of the widgets, leaving this blank will use the latest minor based on major */
|
|
17685
17928
|
minor?: number;
|
|
17929
|
+
/** The patch version of the widgets, leaving this blank will use the latest minor based on minor */
|
|
17686
17930
|
patch?: number;
|
|
17931
|
+
/** The prerelease version of the widgets, can only be 'alpha'. Do not use in production. */
|
|
17687
17932
|
prerelease?: 'alpha';
|
|
17933
|
+
/** The build version of the widgets. Do not use in production. */
|
|
17688
17934
|
build?: number;
|
|
17689
17935
|
};
|
|
17690
17936
|
/**
|
|
17691
17937
|
* Represents the global configuration options for the Checkout Widgets.
|
|
17692
|
-
* @property {WidgetTheme | undefined} theme
|
|
17693
|
-
* @property {Environment | undefined} environment
|
|
17694
|
-
* @property {SemanticVersion | undefined} version
|
|
17695
|
-
* @property {boolean | undefined} isOnRampEnabled
|
|
17696
|
-
* @property {boolean | undefined} isSwapEnabled
|
|
17697
|
-
* @property {boolean | undefined} isBridgeEnabled
|
|
17938
|
+
* @property {WidgetTheme | undefined} theme
|
|
17939
|
+
* @property {Environment | undefined} environment
|
|
17940
|
+
* @property {SemanticVersion | undefined} version
|
|
17941
|
+
* @property {boolean | undefined} isOnRampEnabled
|
|
17942
|
+
* @property {boolean | undefined} isSwapEnabled
|
|
17943
|
+
* @property {boolean | undefined} isBridgeEnabled
|
|
17698
17944
|
*/
|
|
17699
17945
|
type CheckoutWidgetsConfig = {
|
|
17946
|
+
/** The theme of the Checkout Widget (default: "DARK") */
|
|
17700
17947
|
theme?: WidgetTheme;
|
|
17948
|
+
/** The environment configuration (default: "SANDBOX") */
|
|
17701
17949
|
environment?: Environment;
|
|
17950
|
+
/** The version of the checkout widgets js file to use (default: "0.1.x") */
|
|
17702
17951
|
version?: SemanticVersion;
|
|
17952
|
+
/** Enable on-ramp top-up method (default: "true") */
|
|
17703
17953
|
isOnRampEnabled?: boolean;
|
|
17954
|
+
/** Enable swap top-up method (default: "true") */
|
|
17704
17955
|
isSwapEnabled?: boolean;
|
|
17956
|
+
/** Enable bridge top-up method (default: "true") */
|
|
17705
17957
|
isBridgeEnabled?: boolean;
|
|
17706
17958
|
};
|
|
17707
17959
|
|
|
@@ -17957,13 +18209,16 @@ declare enum CheckoutErrorType {
|
|
|
17957
18209
|
}
|
|
17958
18210
|
/**
|
|
17959
18211
|
* Represents an error object with a specific type, optional message, and optional data.
|
|
17960
|
-
* @property {CheckoutErrorType} type
|
|
17961
|
-
* @property {string | undefined} [message]
|
|
17962
|
-
* @property {Object.<string, string> | undefined} [data]
|
|
18212
|
+
* @property {CheckoutErrorType} type
|
|
18213
|
+
* @property {string | undefined} [message]
|
|
18214
|
+
* @property {Object.<string, string> | undefined} [data]
|
|
17963
18215
|
*/
|
|
17964
18216
|
type ErrorType = {
|
|
18217
|
+
/** The type of the error. */
|
|
17965
18218
|
type: CheckoutErrorType;
|
|
18219
|
+
/** The error message. */
|
|
17966
18220
|
message?: string;
|
|
18221
|
+
/** Additional data associated with the error. */
|
|
17967
18222
|
data?: {
|
|
17968
18223
|
[key: string]: string;
|
|
17969
18224
|
};
|