@imtbl/sdk 0.39.5 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/widgets.js +58 -58
- package/dist/checkout.js +68 -15
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +70 -17
- package/dist/index.d.ts +6 -1
- package/dist/index.js +70 -17
- package/dist/orderbook.d.ts +6 -1
- package/dist/orderbook.js +8 -5
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4256,7 +4256,7 @@ class MultiRollupApiClients {
|
|
|
4256
4256
|
}
|
|
4257
4257
|
|
|
4258
4258
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4259
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
4259
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.40.0' };
|
|
4260
4260
|
const createConfig = ({ basePath, headers, }) => {
|
|
4261
4261
|
if (!basePath.trim()) {
|
|
4262
4262
|
throw Error('basePath can not be empty');
|
|
@@ -4316,7 +4316,7 @@ class APIError extends Error {
|
|
|
4316
4316
|
|
|
4317
4317
|
/* eslint-disable implicit-arrow-linebreak */
|
|
4318
4318
|
const defaultHeaders = {
|
|
4319
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
4319
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.40.0',
|
|
4320
4320
|
};
|
|
4321
4321
|
/**
|
|
4322
4322
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4755,7 +4755,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4755
4755
|
chainID,
|
|
4756
4756
|
coreContractAddress,
|
|
4757
4757
|
registrationContractAddress,
|
|
4758
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
4758
|
+
sdkVersion: 'ts-immutable-sdk-0.40.0',
|
|
4759
4759
|
});
|
|
4760
4760
|
/**
|
|
4761
4761
|
* Sets `sdkVersion` at the time of build
|
|
@@ -12899,8 +12899,8 @@ function getOrderbookConfig(environment) {
|
|
|
12899
12899
|
switch (environment) {
|
|
12900
12900
|
case Environment$1.SANDBOX:
|
|
12901
12901
|
return {
|
|
12902
|
-
seaportContractAddress: '
|
|
12903
|
-
zoneContractAddress: '
|
|
12902
|
+
seaportContractAddress: '0x7d117aA8BD6D31c4fa91722f246388f38ab1942c',
|
|
12903
|
+
zoneContractAddress: '0x8831867E347AB87FA30199C5B695F0A31604Bb52',
|
|
12904
12904
|
apiEndpoint: 'https://api.sandbox.immutable.com',
|
|
12905
12905
|
chainName: TESTNET_CHAIN_NAME,
|
|
12906
12906
|
provider: new ethers.providers.JsonRpcProvider('https://rpc.testnet.immutable.com'),
|
|
@@ -12908,8 +12908,8 @@ function getOrderbookConfig(environment) {
|
|
|
12908
12908
|
// not yet deployed
|
|
12909
12909
|
case Environment$1.PRODUCTION:
|
|
12910
12910
|
return {
|
|
12911
|
-
seaportContractAddress: '',
|
|
12912
|
-
zoneContractAddress: '',
|
|
12911
|
+
seaportContractAddress: '0x6c12aD6F0bD274191075Eb2E78D7dA5ba6453424',
|
|
12912
|
+
zoneContractAddress: '0x00338b92Bec262078B3e49BF12bbEA058916BF91',
|
|
12913
12913
|
apiEndpoint: 'https://api.immutable.com',
|
|
12914
12914
|
chainName: MAINNET_CHAIN_NAME,
|
|
12915
12915
|
provider: new ethers.providers.JsonRpcProvider('https://rpc.immutable.com'),
|
|
@@ -13054,13 +13054,15 @@ class Orderbook {
|
|
|
13054
13054
|
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
13055
13055
|
* transaction can be submitted or it will be reverted.
|
|
13056
13056
|
* @param {string} listingId - The listingId to fulfil.
|
|
13057
|
-
* @param {string}
|
|
13057
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
13058
|
+
* @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid.
|
|
13058
13059
|
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
13059
13060
|
*/
|
|
13060
13061
|
async fulfillOrder(listingId, takerAddress, takerFees) {
|
|
13061
13062
|
const fulfillmentDataRes = await this.apiClient.fulfillmentData([
|
|
13062
13063
|
{
|
|
13063
13064
|
order_id: listingId,
|
|
13065
|
+
taker_address: takerAddress,
|
|
13064
13066
|
fees: takerFees.map((fee) => ({
|
|
13065
13067
|
amount: fee.amount,
|
|
13066
13068
|
type: FeeType$1.TAKER_ECOSYSTEM,
|
|
@@ -13084,6 +13086,7 @@ class Orderbook {
|
|
|
13084
13086
|
async fulfillBulkOrders(listings, takerAddress) {
|
|
13085
13087
|
const fulfillmentDataRes = await this.apiClient.fulfillmentData(listings.map((listingRequest) => ({
|
|
13086
13088
|
order_id: listingRequest.listingId,
|
|
13089
|
+
taker_address: takerAddress,
|
|
13087
13090
|
fees: listingRequest.takerFees.map((fee) => ({
|
|
13088
13091
|
amount: fee.amount,
|
|
13089
13092
|
type: FeeType$1.TAKER_ECOSYSTEM,
|
|
@@ -34020,6 +34023,9 @@ class Fees {
|
|
|
34020
34023
|
const IMMUTABLE_TESTNET_RPC_URL = 'https://rpc.testnet.immutable.com';
|
|
34021
34024
|
const IMMUTABLE_TESTNET_CHAIN_ID = 13473;
|
|
34022
34025
|
|
|
34026
|
+
const IMMUTABLE_MAINNET_RPC_URL = 'https://rpc.immutable.com';
|
|
34027
|
+
const IMMUTABLE_MAINNET_CHAIN_ID = 13371;
|
|
34028
|
+
|
|
34023
34029
|
const NATIVE_IMX_IMMUTABLE_TESTNET = {
|
|
34024
34030
|
chainId: IMMUTABLE_TESTNET_CHAIN_ID,
|
|
34025
34031
|
decimals: 18,
|
|
@@ -34039,6 +34045,34 @@ const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS = [
|
|
|
34039
34045
|
WIMX_IMMUTABLE_TESTNET,
|
|
34040
34046
|
];
|
|
34041
34047
|
|
|
34048
|
+
const NATIVE_IMX_IMMUTABLE_MAINNET = {
|
|
34049
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34050
|
+
decimals: 18,
|
|
34051
|
+
symbol: 'IMX',
|
|
34052
|
+
name: 'Immutable Token',
|
|
34053
|
+
type: 'native',
|
|
34054
|
+
};
|
|
34055
|
+
const WIMX_IMMUTABLE_MAINNET = {
|
|
34056
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34057
|
+
address: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
|
|
34058
|
+
decimals: 18,
|
|
34059
|
+
symbol: 'WIMX',
|
|
34060
|
+
name: 'Wrapped Immutable Token',
|
|
34061
|
+
type: 'erc20',
|
|
34062
|
+
};
|
|
34063
|
+
const ETH_IMMUTABLE_MAINNET = {
|
|
34064
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34065
|
+
address: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
|
|
34066
|
+
decimals: 18,
|
|
34067
|
+
symbol: 'ETH',
|
|
34068
|
+
name: 'Ethereum',
|
|
34069
|
+
type: 'erc20',
|
|
34070
|
+
};
|
|
34071
|
+
const IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS = [
|
|
34072
|
+
WIMX_IMMUTABLE_MAINNET,
|
|
34073
|
+
ETH_IMMUTABLE_MAINNET,
|
|
34074
|
+
];
|
|
34075
|
+
|
|
34042
34076
|
const zeroNativeCurrencyValue = '0x00';
|
|
34043
34077
|
const multicallWithDeadlineFunctionSignature = 'multicall(uint256,bytes[])';
|
|
34044
34078
|
function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn, amountOut, routerContract, paymentsContract) {
|
|
@@ -34332,6 +34366,13 @@ const CONTRACTS_FOR_CHAIN_ID = {
|
|
|
34332
34366
|
swapRouter: '0x0b012055F770AE7BB7a8303968A7Fb6088A2296e',
|
|
34333
34367
|
immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
|
|
34334
34368
|
},
|
|
34369
|
+
[IMMUTABLE_MAINNET_CHAIN_ID]: {
|
|
34370
|
+
multicall: '0xc7efb32470dEE601959B15f1f923e017C6A918cA',
|
|
34371
|
+
coreFactory: '0x56c2162254b0E4417288786eE402c2B41d4e181e',
|
|
34372
|
+
quoter: '0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd',
|
|
34373
|
+
swapRouter: '0xE5a02c2Be08406c3fB36F9Aa29bF7C7A09CAe50B',
|
|
34374
|
+
immutableSwapProxy: '0xD67cc11151dBccCC424A16F8963ece3D0539BD61',
|
|
34375
|
+
},
|
|
34335
34376
|
};
|
|
34336
34377
|
const SUPPORTED_SANDBOX_CHAINS = {
|
|
34337
34378
|
[IMMUTABLE_TESTNET_CHAIN_ID]: {
|
|
@@ -34343,7 +34384,16 @@ const SUPPORTED_SANDBOX_CHAINS = {
|
|
|
34343
34384
|
wrappedNativeToken: WIMX_IMMUTABLE_TESTNET,
|
|
34344
34385
|
},
|
|
34345
34386
|
};
|
|
34346
|
-
const SUPPORTED_PRODUCTION_CHAINS = {
|
|
34387
|
+
const SUPPORTED_PRODUCTION_CHAINS = {
|
|
34388
|
+
[IMMUTABLE_MAINNET_CHAIN_ID]: {
|
|
34389
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34390
|
+
rpcUrl: IMMUTABLE_MAINNET_RPC_URL,
|
|
34391
|
+
contracts: CONTRACTS_FOR_CHAIN_ID[IMMUTABLE_MAINNET_CHAIN_ID],
|
|
34392
|
+
commonRoutingTokens: IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS,
|
|
34393
|
+
nativeToken: NATIVE_IMX_IMMUTABLE_MAINNET,
|
|
34394
|
+
wrappedNativeToken: WIMX_IMMUTABLE_MAINNET,
|
|
34395
|
+
},
|
|
34396
|
+
};
|
|
34347
34397
|
const SUPPORTED_CHAIN_IDS_FOR_ENVIRONMENT = {
|
|
34348
34398
|
[Environment$1.SANDBOX]: SUPPORTED_SANDBOX_CHAINS,
|
|
34349
34399
|
[Environment$1.PRODUCTION]: SUPPORTED_PRODUCTION_CHAINS,
|
|
@@ -35145,6 +35195,7 @@ const ZKEVM_NATIVE_TOKEN = {
|
|
|
35145
35195
|
name: 'IMX',
|
|
35146
35196
|
symbol: 'IMX',
|
|
35147
35197
|
decimals: DEFAULT_TOKEN_DECIMALS$1,
|
|
35198
|
+
address: NATIVE,
|
|
35148
35199
|
};
|
|
35149
35200
|
/**
|
|
35150
35201
|
* Base URL for the Immutable API based on the environment.
|
|
@@ -35482,7 +35533,7 @@ const GAS_OVERRIDES = {
|
|
|
35482
35533
|
maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
|
|
35483
35534
|
};
|
|
35484
35535
|
|
|
35485
|
-
const SDK_VERSION_MARKER = '0.
|
|
35536
|
+
const SDK_VERSION_MARKER = '0.40.0';
|
|
35486
35537
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
35487
35538
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
35488
35539
|
|
|
@@ -36799,11 +36850,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
|
|
|
36799
36850
|
type: ItemType.NATIVE,
|
|
36800
36851
|
balance: ethers.BigNumber.from(0),
|
|
36801
36852
|
formattedBalance: '0',
|
|
36802
|
-
token:
|
|
36803
|
-
name,
|
|
36804
|
-
symbol,
|
|
36805
|
-
decimals: DEFAULT_TOKEN_DECIMALS$1,
|
|
36806
|
-
},
|
|
36853
|
+
token: ZKEVM_NATIVE_TOKEN,
|
|
36807
36854
|
};
|
|
36808
36855
|
}
|
|
36809
36856
|
return {
|
|
@@ -38072,13 +38119,19 @@ const bridgeAndSwapRoute = async (config, readOnlyProviders, availableRoutingOpt
|
|
|
38072
38119
|
};
|
|
38073
38120
|
|
|
38074
38121
|
const onRampRoute = async (config, availableRoutingOptions, balanceRequirement) => {
|
|
38075
|
-
|
|
38122
|
+
// Only check for ERC20 and NATIVE
|
|
38123
|
+
if (![ItemType.ERC20, ItemType.NATIVE].includes(balanceRequirement.type))
|
|
38076
38124
|
return undefined;
|
|
38077
38125
|
const { required, current, delta } = balanceRequirement;
|
|
38078
38126
|
let hasAllowList = false;
|
|
38079
38127
|
const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
|
|
38080
38128
|
onRampAllowList.forEach((token) => {
|
|
38081
|
-
if (token.address
|
|
38129
|
+
if (!token.address)
|
|
38130
|
+
return;
|
|
38131
|
+
if (!required.token)
|
|
38132
|
+
return;
|
|
38133
|
+
if (isNativeToken(required.token.address)
|
|
38134
|
+
|| token.address.toLowerCase() === required.token.address?.toLowerCase()) {
|
|
38082
38135
|
hasAllowList = true;
|
|
38083
38136
|
}
|
|
38084
38137
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -16220,6 +16220,10 @@ type FulfillableOrder = {
|
|
|
16220
16220
|
|
|
16221
16221
|
type FulfillmentDataRequest = {
|
|
16222
16222
|
order_id: string;
|
|
16223
|
+
/**
|
|
16224
|
+
* Address of the intended account fulfilling the order
|
|
16225
|
+
*/
|
|
16226
|
+
taker_address?: string;
|
|
16223
16227
|
fees: Array<Fee$2>;
|
|
16224
16228
|
};
|
|
16225
16229
|
|
|
@@ -16798,7 +16802,8 @@ declare class Orderbook {
|
|
|
16798
16802
|
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
16799
16803
|
* transaction can be submitted or it will be reverted.
|
|
16800
16804
|
* @param {string} listingId - The listingId to fulfil.
|
|
16801
|
-
* @param {string}
|
|
16805
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
16806
|
+
* @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid.
|
|
16802
16807
|
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
16803
16808
|
*/
|
|
16804
16809
|
fulfillOrder(listingId: string, takerAddress: string, takerFees: FeeValue[]): Promise<FulfillOrderResponse>;
|
package/dist/index.js
CHANGED
|
@@ -4234,7 +4234,7 @@ class MultiRollupApiClients {
|
|
|
4234
4234
|
}
|
|
4235
4235
|
|
|
4236
4236
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4237
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
4237
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.40.0' };
|
|
4238
4238
|
const createConfig = ({ basePath, headers, }) => {
|
|
4239
4239
|
if (!basePath.trim()) {
|
|
4240
4240
|
throw Error('basePath can not be empty');
|
|
@@ -4294,7 +4294,7 @@ class APIError extends Error {
|
|
|
4294
4294
|
|
|
4295
4295
|
/* eslint-disable implicit-arrow-linebreak */
|
|
4296
4296
|
const defaultHeaders = {
|
|
4297
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
4297
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.40.0',
|
|
4298
4298
|
};
|
|
4299
4299
|
/**
|
|
4300
4300
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4733,7 +4733,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4733
4733
|
chainID,
|
|
4734
4734
|
coreContractAddress,
|
|
4735
4735
|
registrationContractAddress,
|
|
4736
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
4736
|
+
sdkVersion: 'ts-immutable-sdk-0.40.0',
|
|
4737
4737
|
});
|
|
4738
4738
|
/**
|
|
4739
4739
|
* Sets `sdkVersion` at the time of build
|
|
@@ -12877,8 +12877,8 @@ function getOrderbookConfig(environment) {
|
|
|
12877
12877
|
switch (environment) {
|
|
12878
12878
|
case Environment$1.SANDBOX:
|
|
12879
12879
|
return {
|
|
12880
|
-
seaportContractAddress: '
|
|
12881
|
-
zoneContractAddress: '
|
|
12880
|
+
seaportContractAddress: '0x7d117aA8BD6D31c4fa91722f246388f38ab1942c',
|
|
12881
|
+
zoneContractAddress: '0x8831867E347AB87FA30199C5B695F0A31604Bb52',
|
|
12882
12882
|
apiEndpoint: 'https://api.sandbox.immutable.com',
|
|
12883
12883
|
chainName: TESTNET_CHAIN_NAME,
|
|
12884
12884
|
provider: new providers.JsonRpcProvider('https://rpc.testnet.immutable.com'),
|
|
@@ -12886,8 +12886,8 @@ function getOrderbookConfig(environment) {
|
|
|
12886
12886
|
// not yet deployed
|
|
12887
12887
|
case Environment$1.PRODUCTION:
|
|
12888
12888
|
return {
|
|
12889
|
-
seaportContractAddress: '',
|
|
12890
|
-
zoneContractAddress: '',
|
|
12889
|
+
seaportContractAddress: '0x6c12aD6F0bD274191075Eb2E78D7dA5ba6453424',
|
|
12890
|
+
zoneContractAddress: '0x00338b92Bec262078B3e49BF12bbEA058916BF91',
|
|
12891
12891
|
apiEndpoint: 'https://api.immutable.com',
|
|
12892
12892
|
chainName: MAINNET_CHAIN_NAME,
|
|
12893
12893
|
provider: new providers.JsonRpcProvider('https://rpc.immutable.com'),
|
|
@@ -13032,13 +13032,15 @@ class Orderbook {
|
|
|
13032
13032
|
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
13033
13033
|
* transaction can be submitted or it will be reverted.
|
|
13034
13034
|
* @param {string} listingId - The listingId to fulfil.
|
|
13035
|
-
* @param {string}
|
|
13035
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
13036
|
+
* @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid.
|
|
13036
13037
|
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
13037
13038
|
*/
|
|
13038
13039
|
async fulfillOrder(listingId, takerAddress, takerFees) {
|
|
13039
13040
|
const fulfillmentDataRes = await this.apiClient.fulfillmentData([
|
|
13040
13041
|
{
|
|
13041
13042
|
order_id: listingId,
|
|
13043
|
+
taker_address: takerAddress,
|
|
13042
13044
|
fees: takerFees.map((fee) => ({
|
|
13043
13045
|
amount: fee.amount,
|
|
13044
13046
|
type: FeeType$1.TAKER_ECOSYSTEM,
|
|
@@ -13062,6 +13064,7 @@ class Orderbook {
|
|
|
13062
13064
|
async fulfillBulkOrders(listings, takerAddress) {
|
|
13063
13065
|
const fulfillmentDataRes = await this.apiClient.fulfillmentData(listings.map((listingRequest) => ({
|
|
13064
13066
|
order_id: listingRequest.listingId,
|
|
13067
|
+
taker_address: takerAddress,
|
|
13065
13068
|
fees: listingRequest.takerFees.map((fee) => ({
|
|
13066
13069
|
amount: fee.amount,
|
|
13067
13070
|
type: FeeType$1.TAKER_ECOSYSTEM,
|
|
@@ -33998,6 +34001,9 @@ class Fees {
|
|
|
33998
34001
|
const IMMUTABLE_TESTNET_RPC_URL = 'https://rpc.testnet.immutable.com';
|
|
33999
34002
|
const IMMUTABLE_TESTNET_CHAIN_ID = 13473;
|
|
34000
34003
|
|
|
34004
|
+
const IMMUTABLE_MAINNET_RPC_URL = 'https://rpc.immutable.com';
|
|
34005
|
+
const IMMUTABLE_MAINNET_CHAIN_ID = 13371;
|
|
34006
|
+
|
|
34001
34007
|
const NATIVE_IMX_IMMUTABLE_TESTNET = {
|
|
34002
34008
|
chainId: IMMUTABLE_TESTNET_CHAIN_ID,
|
|
34003
34009
|
decimals: 18,
|
|
@@ -34017,6 +34023,34 @@ const IMMUTABLE_TESTNET_COMMON_ROUTING_TOKENS = [
|
|
|
34017
34023
|
WIMX_IMMUTABLE_TESTNET,
|
|
34018
34024
|
];
|
|
34019
34025
|
|
|
34026
|
+
const NATIVE_IMX_IMMUTABLE_MAINNET = {
|
|
34027
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34028
|
+
decimals: 18,
|
|
34029
|
+
symbol: 'IMX',
|
|
34030
|
+
name: 'Immutable Token',
|
|
34031
|
+
type: 'native',
|
|
34032
|
+
};
|
|
34033
|
+
const WIMX_IMMUTABLE_MAINNET = {
|
|
34034
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34035
|
+
address: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
|
|
34036
|
+
decimals: 18,
|
|
34037
|
+
symbol: 'WIMX',
|
|
34038
|
+
name: 'Wrapped Immutable Token',
|
|
34039
|
+
type: 'erc20',
|
|
34040
|
+
};
|
|
34041
|
+
const ETH_IMMUTABLE_MAINNET = {
|
|
34042
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34043
|
+
address: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
|
|
34044
|
+
decimals: 18,
|
|
34045
|
+
symbol: 'ETH',
|
|
34046
|
+
name: 'Ethereum',
|
|
34047
|
+
type: 'erc20',
|
|
34048
|
+
};
|
|
34049
|
+
const IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS = [
|
|
34050
|
+
WIMX_IMMUTABLE_MAINNET,
|
|
34051
|
+
ETH_IMMUTABLE_MAINNET,
|
|
34052
|
+
];
|
|
34053
|
+
|
|
34020
34054
|
const zeroNativeCurrencyValue = '0x00';
|
|
34021
34055
|
const multicallWithDeadlineFunctionSignature = 'multicall(uint256,bytes[])';
|
|
34022
34056
|
function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn, amountOut, routerContract, paymentsContract) {
|
|
@@ -34310,6 +34344,13 @@ const CONTRACTS_FOR_CHAIN_ID = {
|
|
|
34310
34344
|
swapRouter: '0x0b012055F770AE7BB7a8303968A7Fb6088A2296e',
|
|
34311
34345
|
immutableSwapProxy: '0xDdBDa144cEbe1cCd68E746CDff8a6e4Be51A9e98',
|
|
34312
34346
|
},
|
|
34347
|
+
[IMMUTABLE_MAINNET_CHAIN_ID]: {
|
|
34348
|
+
multicall: '0xc7efb32470dEE601959B15f1f923e017C6A918cA',
|
|
34349
|
+
coreFactory: '0x56c2162254b0E4417288786eE402c2B41d4e181e',
|
|
34350
|
+
quoter: '0xF6Ad3CcF71Abb3E12beCf6b3D2a74C963859ADCd',
|
|
34351
|
+
swapRouter: '0xE5a02c2Be08406c3fB36F9Aa29bF7C7A09CAe50B',
|
|
34352
|
+
immutableSwapProxy: '0xD67cc11151dBccCC424A16F8963ece3D0539BD61',
|
|
34353
|
+
},
|
|
34313
34354
|
};
|
|
34314
34355
|
const SUPPORTED_SANDBOX_CHAINS = {
|
|
34315
34356
|
[IMMUTABLE_TESTNET_CHAIN_ID]: {
|
|
@@ -34321,7 +34362,16 @@ const SUPPORTED_SANDBOX_CHAINS = {
|
|
|
34321
34362
|
wrappedNativeToken: WIMX_IMMUTABLE_TESTNET,
|
|
34322
34363
|
},
|
|
34323
34364
|
};
|
|
34324
|
-
const SUPPORTED_PRODUCTION_CHAINS = {
|
|
34365
|
+
const SUPPORTED_PRODUCTION_CHAINS = {
|
|
34366
|
+
[IMMUTABLE_MAINNET_CHAIN_ID]: {
|
|
34367
|
+
chainId: IMMUTABLE_MAINNET_CHAIN_ID,
|
|
34368
|
+
rpcUrl: IMMUTABLE_MAINNET_RPC_URL,
|
|
34369
|
+
contracts: CONTRACTS_FOR_CHAIN_ID[IMMUTABLE_MAINNET_CHAIN_ID],
|
|
34370
|
+
commonRoutingTokens: IMMUTABLE_MAINNET_COMMON_ROUTING_TOKENS,
|
|
34371
|
+
nativeToken: NATIVE_IMX_IMMUTABLE_MAINNET,
|
|
34372
|
+
wrappedNativeToken: WIMX_IMMUTABLE_MAINNET,
|
|
34373
|
+
},
|
|
34374
|
+
};
|
|
34325
34375
|
const SUPPORTED_CHAIN_IDS_FOR_ENVIRONMENT = {
|
|
34326
34376
|
[Environment$1.SANDBOX]: SUPPORTED_SANDBOX_CHAINS,
|
|
34327
34377
|
[Environment$1.PRODUCTION]: SUPPORTED_PRODUCTION_CHAINS,
|
|
@@ -35123,6 +35173,7 @@ const ZKEVM_NATIVE_TOKEN = {
|
|
|
35123
35173
|
name: 'IMX',
|
|
35124
35174
|
symbol: 'IMX',
|
|
35125
35175
|
decimals: DEFAULT_TOKEN_DECIMALS$1,
|
|
35176
|
+
address: NATIVE,
|
|
35126
35177
|
};
|
|
35127
35178
|
/**
|
|
35128
35179
|
* Base URL for the Immutable API based on the environment.
|
|
@@ -35460,7 +35511,7 @@ const GAS_OVERRIDES = {
|
|
|
35460
35511
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
35461
35512
|
};
|
|
35462
35513
|
|
|
35463
|
-
const SDK_VERSION_MARKER = '0.
|
|
35514
|
+
const SDK_VERSION_MARKER = '0.40.0';
|
|
35464
35515
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
35465
35516
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
35466
35517
|
|
|
@@ -36777,11 +36828,7 @@ const getTokenBalanceRequirement = (itemRequirement, balances) => {
|
|
|
36777
36828
|
type: ItemType.NATIVE,
|
|
36778
36829
|
balance: BigNumber$1.from(0),
|
|
36779
36830
|
formattedBalance: '0',
|
|
36780
|
-
token:
|
|
36781
|
-
name,
|
|
36782
|
-
symbol,
|
|
36783
|
-
decimals: DEFAULT_TOKEN_DECIMALS$1,
|
|
36784
|
-
},
|
|
36831
|
+
token: ZKEVM_NATIVE_TOKEN,
|
|
36785
36832
|
};
|
|
36786
36833
|
}
|
|
36787
36834
|
return {
|
|
@@ -38050,13 +38097,19 @@ const bridgeAndSwapRoute = async (config, readOnlyProviders, availableRoutingOpt
|
|
|
38050
38097
|
};
|
|
38051
38098
|
|
|
38052
38099
|
const onRampRoute = async (config, availableRoutingOptions, balanceRequirement) => {
|
|
38053
|
-
|
|
38100
|
+
// Only check for ERC20 and NATIVE
|
|
38101
|
+
if (![ItemType.ERC20, ItemType.NATIVE].includes(balanceRequirement.type))
|
|
38054
38102
|
return undefined;
|
|
38055
38103
|
const { required, current, delta } = balanceRequirement;
|
|
38056
38104
|
let hasAllowList = false;
|
|
38057
38105
|
const onRampAllowList = await allowListCheckForOnRamp(config, availableRoutingOptions);
|
|
38058
38106
|
onRampAllowList.forEach((token) => {
|
|
38059
|
-
if (token.address
|
|
38107
|
+
if (!token.address)
|
|
38108
|
+
return;
|
|
38109
|
+
if (!required.token)
|
|
38110
|
+
return;
|
|
38111
|
+
if (isNativeToken(required.token.address)
|
|
38112
|
+
|| token.address.toLowerCase() === required.token.address?.toLowerCase()) {
|
|
38060
38113
|
hasAllowList = true;
|
|
38061
38114
|
}
|
|
38062
38115
|
});
|
package/dist/orderbook.d.ts
CHANGED
|
@@ -1028,6 +1028,10 @@ type FulfillableOrder = {
|
|
|
1028
1028
|
|
|
1029
1029
|
type FulfillmentDataRequest = {
|
|
1030
1030
|
order_id: string;
|
|
1031
|
+
/**
|
|
1032
|
+
* Address of the intended account fulfilling the order
|
|
1033
|
+
*/
|
|
1034
|
+
taker_address?: string;
|
|
1031
1035
|
fees: Array<Fee$1>;
|
|
1032
1036
|
};
|
|
1033
1037
|
|
|
@@ -1606,7 +1610,8 @@ declare class Orderbook {
|
|
|
1606
1610
|
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
1607
1611
|
* transaction can be submitted or it will be reverted.
|
|
1608
1612
|
* @param {string} listingId - The listingId to fulfil.
|
|
1609
|
-
* @param {string}
|
|
1613
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
1614
|
+
* @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid.
|
|
1610
1615
|
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
1611
1616
|
*/
|
|
1612
1617
|
fulfillOrder(listingId: string, takerAddress: string, takerFees: FeeValue[]): Promise<FulfillOrderResponse>;
|
package/dist/orderbook.js
CHANGED
|
@@ -1279,8 +1279,8 @@ function getOrderbookConfig(environment) {
|
|
|
1279
1279
|
switch (environment) {
|
|
1280
1280
|
case Environment.SANDBOX:
|
|
1281
1281
|
return {
|
|
1282
|
-
seaportContractAddress: '
|
|
1283
|
-
zoneContractAddress: '
|
|
1282
|
+
seaportContractAddress: '0x7d117aA8BD6D31c4fa91722f246388f38ab1942c',
|
|
1283
|
+
zoneContractAddress: '0x8831867E347AB87FA30199C5B695F0A31604Bb52',
|
|
1284
1284
|
apiEndpoint: 'https://api.sandbox.immutable.com',
|
|
1285
1285
|
chainName: TESTNET_CHAIN_NAME,
|
|
1286
1286
|
provider: new providers.JsonRpcProvider('https://rpc.testnet.immutable.com'),
|
|
@@ -1288,8 +1288,8 @@ function getOrderbookConfig(environment) {
|
|
|
1288
1288
|
// not yet deployed
|
|
1289
1289
|
case Environment.PRODUCTION:
|
|
1290
1290
|
return {
|
|
1291
|
-
seaportContractAddress: '',
|
|
1292
|
-
zoneContractAddress: '',
|
|
1291
|
+
seaportContractAddress: '0x6c12aD6F0bD274191075Eb2E78D7dA5ba6453424',
|
|
1292
|
+
zoneContractAddress: '0x00338b92Bec262078B3e49BF12bbEA058916BF91',
|
|
1293
1293
|
apiEndpoint: 'https://api.immutable.com',
|
|
1294
1294
|
chainName: MAINNET_CHAIN_NAME,
|
|
1295
1295
|
provider: new providers.JsonRpcProvider('https://rpc.immutable.com'),
|
|
@@ -1434,13 +1434,15 @@ class Orderbook {
|
|
|
1434
1434
|
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
1435
1435
|
* transaction can be submitted or it will be reverted.
|
|
1436
1436
|
* @param {string} listingId - The listingId to fulfil.
|
|
1437
|
-
* @param {string}
|
|
1437
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
1438
|
+
* @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid.
|
|
1438
1439
|
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
1439
1440
|
*/
|
|
1440
1441
|
async fulfillOrder(listingId, takerAddress, takerFees) {
|
|
1441
1442
|
const fulfillmentDataRes = await this.apiClient.fulfillmentData([
|
|
1442
1443
|
{
|
|
1443
1444
|
order_id: listingId,
|
|
1445
|
+
taker_address: takerAddress,
|
|
1444
1446
|
fees: takerFees.map((fee) => ({
|
|
1445
1447
|
amount: fee.amount,
|
|
1446
1448
|
type: FeeType.TAKER_ECOSYSTEM,
|
|
@@ -1464,6 +1466,7 @@ class Orderbook {
|
|
|
1464
1466
|
async fulfillBulkOrders(listings, takerAddress) {
|
|
1465
1467
|
const fulfillmentDataRes = await this.apiClient.fulfillmentData(listings.map((listingRequest) => ({
|
|
1466
1468
|
order_id: listingRequest.listingId,
|
|
1469
|
+
taker_address: takerAddress,
|
|
1467
1470
|
fees: listingRequest.takerFees.map((fee) => ({
|
|
1468
1471
|
amount: fee.amount,
|
|
1469
1472
|
type: FeeType.TAKER_ECOSYSTEM,
|
package/dist/passport.js
CHANGED
|
@@ -2349,7 +2349,7 @@ class MultiRollupApiClients {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
|
|
2351
2351
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2352
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.
|
|
2352
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.40.0' };
|
|
2353
2353
|
const createConfig = ({ basePath, headers, }) => {
|
|
2354
2354
|
if (!basePath.trim()) {
|
|
2355
2355
|
throw Error('basePath can not be empty');
|
|
@@ -2405,7 +2405,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2405
2405
|
chainID,
|
|
2406
2406
|
coreContractAddress,
|
|
2407
2407
|
registrationContractAddress,
|
|
2408
|
-
sdkVersion: 'ts-immutable-sdk-0.
|
|
2408
|
+
sdkVersion: 'ts-immutable-sdk-0.40.0',
|
|
2409
2409
|
});
|
|
2410
2410
|
/**
|
|
2411
2411
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED