@imtbl/sdk 1.63.0 → 1.64.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{blockchain_data-Dpv5muPl.js → blockchain_data-Nd9tDahm.js} +2 -2
- package/dist/blockchain_data.js +3 -3
- package/dist/browser/checkout/{AddTokensWidget-BfDY0LwB.js → AddTokensWidget-BQw-P60S.js} +56 -28
- package/dist/browser/checkout/{BridgeWidget-DreWq2OO.js → BridgeWidget-Cyu5i2LL.js} +9 -8
- package/dist/browser/checkout/{CommerceWidget-BFEo_z63.js → CommerceWidget-C5vGYGbd.js} +90 -74
- package/dist/browser/checkout/CryptoFiatProvider-3fUUkERi.js +224 -0
- package/dist/browser/checkout/{EllipsizedText-_yDoxF8V.js → EllipsizedText-CpY-fwmV.js} +1 -1
- package/dist/browser/checkout/{FeesBreakdown-CQVi4M-W.js → FeesBreakdown-C6qrQVEs.js} +1 -1
- package/dist/browser/checkout/{HandoverContent-D0HXf455.js → HandoverContent-BENLzW4n.js} +1 -1
- package/dist/browser/checkout/{OnRampWidget-BpRLbHli.js → OnRampWidget-JkxC8nMN.js} +3 -3
- package/dist/browser/checkout/{SaleWidget-C-ATgwRu.js → SaleWidget-aIL3dbMH.js} +15 -26
- package/dist/browser/checkout/{SpendingCapHero-DLdYNa0u.js → SpendingCapHero-C_loMgYA.js} +1 -1
- package/dist/browser/checkout/{SwapWidget-Dm2cQUYh.js → SwapWidget-DSQPb69U.js} +9 -8
- package/dist/browser/checkout/{TopUpView-Nbu5J6zy.js → TopUpView-3d5yxKuq.js} +6 -239
- package/dist/browser/checkout/{WalletApproveHero-Cc6p3CkR.js → WalletApproveHero-B5TXSbim.js} +3 -3
- package/dist/browser/checkout/{WalletWidget-C25SCVnz.js → WalletWidget-C-_77Eb9.js} +7 -22
- package/dist/browser/checkout/{auto-track-1Zr4QLt3.js → auto-track-D3w38cYJ.js} +1 -1
- package/dist/browser/checkout/{index-c7pVchOF.js → index-B0XncTM8.js} +1 -1
- package/dist/browser/checkout/{index-DthkZUK5.js → index-CAXT0vz6.js} +1 -1
- package/dist/browser/checkout/{index-Vadzr0yp.js → index-CQQwF7M-.js} +1 -1
- package/dist/browser/checkout/{index-BYrBQsd2.js → index-CfEMgTvB.js} +2 -2
- package/dist/browser/checkout/{index-Co93fBqn.js → index-CluzFQyb.js} +31 -28
- package/dist/browser/checkout/{index-DzrC5Kuy.js → index-D8cKqUD1.js} +1 -1
- package/dist/browser/checkout/{index-3DC3zK0u.js → index-DUmgcmvB.js} +1 -1
- package/dist/browser/checkout/{index-B7urOO_H.js → index-R-wtc9-g.js} +1 -1
- package/dist/browser/checkout/{index-t2b5ztUB.js → index-Vok4qNAE.js} +1 -1
- package/dist/browser/checkout/{index.umd-CwLr5uH5.js → index.umd-BztHAlRB.js} +1 -1
- package/dist/browser/checkout/{retry-DqIpQ6wO.js → retry-DekCi5fl.js} +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/{useInterval-D42dwhRA.js → useInterval-BstnDnYa.js} +1 -1
- package/dist/browser/checkout/widgets-esm.js +1 -1
- package/dist/browser/checkout/widgets.js +936 -984
- package/dist/{checkout-Dr99AQC1.js → checkout-Dqmj1x40.js} +5 -5
- package/dist/checkout.d.ts +2 -0
- package/dist/checkout.js +5 -5
- package/dist/{config-DkJOEY8_.js → config-p7sPROak.js} +1 -1
- package/dist/config.js +1 -1
- package/dist/{index-B7ZGqefm.js → index-B7Ry_G0i.js} +1 -1
- package/dist/{index-ONuhnAdl.js → index-BBulTBlw.js} +1 -1
- package/dist/{index-DWXUkxHc.js → index-BWfwTwx-.js} +1 -1
- package/dist/{index-Dvd-bDuR.js → index-BuZNUhP9.js} +4 -4
- package/dist/{index-CK8NRXyO.js → index-DB4LpDqf.js} +1 -1
- package/dist/{index-BI-lDUrN.js → index-ulndU_eA.js} +3 -3
- package/dist/index.browser.js +5 -5
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +77 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -14
- package/dist/{minting_backend-CpZGmZ-L.js → minting_backend-CsKrfvF3.js} +3 -3
- package/dist/minting_backend.js +5 -5
- package/dist/{orderbook-BGc1pQHt.js → orderbook-BW9zFoLz.js} +1 -1
- package/dist/orderbook.js +2 -2
- package/dist/{passport-CsmpMk_U.js → passport-CIedTeNc.js} +73 -3
- package/dist/passport.js +4 -4
- package/dist/{webhook-8q1P3n_h.js → webhook-C20pzRK2.js} +1 -1
- package/dist/webhook.js +2 -2
- package/dist/{x-BNK0EB3B.js → x-D4XBahT5.js} +3 -3
- package/dist/x.js +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -218,7 +218,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
221
|
-
const SDK_VERSION$1 = '1.
|
|
221
|
+
const SDK_VERSION$1 = '1.64.0-alpha.2';
|
|
222
222
|
const getFrameParentDomain$1 = () => {
|
|
223
223
|
if (isNode$1()) {
|
|
224
224
|
return '';
|
|
@@ -14192,7 +14192,7 @@ class MultiRollupApiClients {
|
|
|
14192
14192
|
}
|
|
14193
14193
|
|
|
14194
14194
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14195
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.
|
|
14195
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.64.0-alpha.2' };
|
|
14196
14196
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
14197
14197
|
if (!basePath.trim()) {
|
|
14198
14198
|
throw Error('basePath can not be empty');
|
|
@@ -14264,7 +14264,7 @@ class APIError extends Error {
|
|
|
14264
14264
|
|
|
14265
14265
|
/* eslint-disable implicit-arrow-linebreak */
|
|
14266
14266
|
const defaultHeaders$1 = {
|
|
14267
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.
|
|
14267
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.64.0-alpha.2',
|
|
14268
14268
|
};
|
|
14269
14269
|
/**
|
|
14270
14270
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14754,7 +14754,7 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14754
14754
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14755
14755
|
class ApiConfiguration extends index$2.Configuration {
|
|
14756
14756
|
}
|
|
14757
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.
|
|
14757
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.64.0-alpha.2' };
|
|
14758
14758
|
/**
|
|
14759
14759
|
* @dev use createImmutableXConfiguration instead
|
|
14760
14760
|
*/
|
|
@@ -14795,7 +14795,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
14795
14795
|
coreContractAddress,
|
|
14796
14796
|
registrationContractAddress,
|
|
14797
14797
|
registrationV4ContractAddress,
|
|
14798
|
-
sdkVersion: 'ts-immutable-sdk-1.
|
|
14798
|
+
sdkVersion: 'ts-immutable-sdk-1.64.0-alpha.2',
|
|
14799
14799
|
baseConfig,
|
|
14800
14800
|
});
|
|
14801
14801
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
@@ -26120,6 +26120,36 @@ const prepareAndSignTransaction = async ({ transactionRequest, ethSigner, rpcPro
|
|
|
26120
26120
|
flow.addEvent('endRelayerSendTransaction');
|
|
26121
26121
|
return { signedTransactions, relayerId, nonce };
|
|
26122
26122
|
};
|
|
26123
|
+
const buildMetaTransactionForEjection = async (transactionRequest) => {
|
|
26124
|
+
if (!transactionRequest.to) {
|
|
26125
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a "to" field');
|
|
26126
|
+
}
|
|
26127
|
+
if (!transactionRequest.nonce) {
|
|
26128
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a "nonce" field');
|
|
26129
|
+
}
|
|
26130
|
+
if (!transactionRequest.chainId) {
|
|
26131
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a "chainId" field');
|
|
26132
|
+
}
|
|
26133
|
+
const metaTransaction = {
|
|
26134
|
+
to: transactionRequest.to,
|
|
26135
|
+
data: transactionRequest.data,
|
|
26136
|
+
nonce: transactionRequest.nonce,
|
|
26137
|
+
value: transactionRequest.value,
|
|
26138
|
+
revertOnError: true,
|
|
26139
|
+
};
|
|
26140
|
+
return [metaTransaction];
|
|
26141
|
+
};
|
|
26142
|
+
const prepareAndSignEjectionTransaction = async ({ transactionRequest, ethSigner, zkEvmAddress, flow, }) => {
|
|
26143
|
+
const metaTransaction = await buildMetaTransactionForEjection(transactionRequest);
|
|
26144
|
+
flow.addEvent('endBuildMetaTransactions');
|
|
26145
|
+
const signedTransaction = await signMetaTransactions(metaTransaction, transactionRequest.nonce, ethers.BigNumber.from(transactionRequest.chainId), zkEvmAddress, ethSigner);
|
|
26146
|
+
flow.addEvent('endGetSignedMetaTransactions');
|
|
26147
|
+
return {
|
|
26148
|
+
to: zkEvmAddress,
|
|
26149
|
+
data: signedTransaction,
|
|
26150
|
+
chainId: getEip155ChainId(transactionRequest.chainId),
|
|
26151
|
+
};
|
|
26152
|
+
};
|
|
26123
26153
|
|
|
26124
26154
|
const sendTransaction$1 = async ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkEvmAddress, flow, }) => {
|
|
26125
26155
|
const transactionRequest = params[0];
|
|
@@ -26446,6 +26476,19 @@ const sendDeployTransactionAndPersonalSign = async ({ params, ethSigner, rpcProv
|
|
|
26446
26476
|
});
|
|
26447
26477
|
};
|
|
26448
26478
|
|
|
26479
|
+
const signEjectionTransaction = async ({ params, ethSigner, zkEvmAddress, flow, }) => {
|
|
26480
|
+
if (!params || params.length !== 1) {
|
|
26481
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a singular param (hash)');
|
|
26482
|
+
}
|
|
26483
|
+
const transactionRequest = params[0];
|
|
26484
|
+
return await prepareAndSignEjectionTransaction({
|
|
26485
|
+
transactionRequest,
|
|
26486
|
+
ethSigner,
|
|
26487
|
+
zkEvmAddress,
|
|
26488
|
+
flow,
|
|
26489
|
+
});
|
|
26490
|
+
};
|
|
26491
|
+
|
|
26449
26492
|
const isZkEvmUser = (user) => 'zkEvm' in user;
|
|
26450
26493
|
class ZkEvmProvider {
|
|
26451
26494
|
#authManager;
|
|
@@ -26817,6 +26860,33 @@ class ZkEvmProvider {
|
|
|
26817
26860
|
case 'eth_getTransactionReceipt': {
|
|
26818
26861
|
return this.#rpcProvider.send(request.method, request.params || []);
|
|
26819
26862
|
}
|
|
26863
|
+
case 'im_signEjectionTransaction': {
|
|
26864
|
+
const zkEvmAddress = await this.#getZkEvmAddress();
|
|
26865
|
+
if (!zkEvmAddress) {
|
|
26866
|
+
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
|
|
26867
|
+
}
|
|
26868
|
+
const flow = trackFlow('passport', 'imSignEjectionTransaction');
|
|
26869
|
+
try {
|
|
26870
|
+
const ethSigner = await this.#getSigner();
|
|
26871
|
+
flow.addEvent('endGetSigner');
|
|
26872
|
+
return await signEjectionTransaction({
|
|
26873
|
+
params: request.params || [],
|
|
26874
|
+
ethSigner,
|
|
26875
|
+
zkEvmAddress,
|
|
26876
|
+
flow,
|
|
26877
|
+
});
|
|
26878
|
+
}
|
|
26879
|
+
catch (error) {
|
|
26880
|
+
if (error instanceof Error) {
|
|
26881
|
+
trackError$1('passport', 'imSignEjectionTransaction', error);
|
|
26882
|
+
}
|
|
26883
|
+
flow.addEvent('errored');
|
|
26884
|
+
throw error;
|
|
26885
|
+
}
|
|
26886
|
+
finally {
|
|
26887
|
+
flow.addEvent('End');
|
|
26888
|
+
}
|
|
26889
|
+
}
|
|
26820
26890
|
default: {
|
|
26821
26891
|
throw new JsonRpcError(ProviderErrorCode.UNSUPPORTED_METHOD, 'Method not supported');
|
|
26822
26892
|
}
|
|
@@ -49450,7 +49520,7 @@ const flattenProperties = (properties) => {
|
|
|
49450
49520
|
};
|
|
49451
49521
|
|
|
49452
49522
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
49453
|
-
const SDK_VERSION = '1.
|
|
49523
|
+
const SDK_VERSION = '1.64.0-alpha.2';
|
|
49454
49524
|
const getFrameParentDomain = () => {
|
|
49455
49525
|
if (isNode()) {
|
|
49456
49526
|
return '';
|
|
@@ -54558,7 +54628,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
54558
54628
|
maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
|
|
54559
54629
|
};
|
|
54560
54630
|
|
|
54561
|
-
const SDK_VERSION_MARKER = '1.
|
|
54631
|
+
const SDK_VERSION_MARKER = '1.64.0-alpha.2';
|
|
54562
54632
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
54563
54633
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
54564
54634
|
|
package/dist/index.d.ts
CHANGED
|
@@ -25575,6 +25575,8 @@ type RequestOnrampEvent = {
|
|
|
25575
25575
|
tokenAddress: string;
|
|
25576
25576
|
/** The amount of tokens to onramp. */
|
|
25577
25577
|
amount: string;
|
|
25578
|
+
/** The connected provider. */
|
|
25579
|
+
provider?: Web3Provider;
|
|
25578
25580
|
};
|
|
25579
25581
|
/**
|
|
25580
25582
|
* Represents the add tokens event object when the add tokens widget is requested.
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { c as config } from './config-
|
|
2
|
-
export { b as blockchainData } from './blockchain_data-
|
|
3
|
-
export { p as passport } from './passport-
|
|
4
|
-
export { o as orderbook } from './orderbook-
|
|
5
|
-
export { c as checkout } from './checkout-
|
|
6
|
-
export { x } from './x-
|
|
7
|
-
export { w as webhook } from './webhook-
|
|
8
|
-
export { m as mintingBackend } from './minting_backend-
|
|
9
|
-
import './index-
|
|
1
|
+
export { c as config } from './config-p7sPROak.js';
|
|
2
|
+
export { b as blockchainData } from './blockchain_data-Nd9tDahm.js';
|
|
3
|
+
export { p as passport } from './passport-CIedTeNc.js';
|
|
4
|
+
export { o as orderbook } from './orderbook-BW9zFoLz.js';
|
|
5
|
+
export { c as checkout } from './checkout-Dqmj1x40.js';
|
|
6
|
+
export { x } from './x-D4XBahT5.js';
|
|
7
|
+
export { w as webhook } from './webhook-C20pzRK2.js';
|
|
8
|
+
export { m as mintingBackend } from './minting_backend-CsKrfvF3.js';
|
|
9
|
+
import './index-DB4LpDqf.js';
|
|
10
10
|
import 'axios';
|
|
11
11
|
import 'lru-memorise';
|
|
12
12
|
import 'global-const';
|
|
13
|
-
import './index-
|
|
14
|
-
import './index-
|
|
15
|
-
import './index-
|
|
13
|
+
import './index-ulndU_eA.js';
|
|
14
|
+
import './index-B7Ry_G0i.js';
|
|
15
|
+
import './index-BuZNUhP9.js';
|
|
16
16
|
import '@ethersproject/keccak256';
|
|
17
17
|
import '@ethersproject/strings';
|
|
18
18
|
import 'bn.js';
|
|
@@ -35,7 +35,7 @@ import 'events';
|
|
|
35
35
|
import '@0xsequence/abi';
|
|
36
36
|
import '@0xsequence/core';
|
|
37
37
|
import 'uuid';
|
|
38
|
-
import './index-
|
|
38
|
+
import './index-BWfwTwx-.js';
|
|
39
39
|
import 'form-data';
|
|
40
40
|
import '@opensea/seaport-js/lib/constants';
|
|
41
41
|
import 'ethers-v6';
|
|
@@ -49,5 +49,5 @@ import '@metamask/detect-provider';
|
|
|
49
49
|
import 'semver';
|
|
50
50
|
import '@ethersproject/units';
|
|
51
51
|
import '@ethersproject/bignumber';
|
|
52
|
-
import './index-
|
|
52
|
+
import './index-BBulTBlw.js';
|
|
53
53
|
import 'sns-validator';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BlockchainData } from './index-
|
|
2
|
-
import { h as handle } from './index-
|
|
3
|
-
import { t as track, e as setEnvironment, f as setPublishableApiKey } from './index-
|
|
1
|
+
import { B as BlockchainData } from './index-ulndU_eA.js';
|
|
2
|
+
import { h as handle } from './index-BBulTBlw.js';
|
|
3
|
+
import { t as track, e as setEnvironment, f as setPublishableApiKey } from './index-DB4LpDqf.js';
|
|
4
4
|
|
|
5
5
|
const moduleName = 'minting_backend_sdk';
|
|
6
6
|
const trackInitializePersistencePG = () => {
|
package/dist/minting_backend.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { M as MintingBackendModule, a as mintingPersistencePg, b as mintingPersistencePrismaSqlite, p as processMint, r as recordMint, s as submitMintingRequests } from './minting_backend-
|
|
2
|
-
import './index-
|
|
3
|
-
import './index-
|
|
1
|
+
export { M as MintingBackendModule, a as mintingPersistencePg, b as mintingPersistencePrismaSqlite, p as processMint, r as recordMint, s as submitMintingRequests } from './minting_backend-CsKrfvF3.js';
|
|
2
|
+
import './index-ulndU_eA.js';
|
|
3
|
+
import './index-B7Ry_G0i.js';
|
|
4
4
|
import 'axios';
|
|
5
|
-
import './index-
|
|
5
|
+
import './index-DB4LpDqf.js';
|
|
6
6
|
import 'lru-memorise';
|
|
7
7
|
import 'global-const';
|
|
8
|
-
import './index-
|
|
8
|
+
import './index-BBulTBlw.js';
|
|
9
9
|
import 'sns-validator';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-
|
|
1
|
+
import { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-BWfwTwx-.js';
|
|
2
2
|
|
|
3
3
|
var orderbook = /*#__PURE__*/Object.freeze({
|
|
4
4
|
__proto__: null,
|
package/dist/orderbook.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-
|
|
2
|
-
import './index-
|
|
1
|
+
export { A as ActionType, F as FeeType, O as OrderStatusName, a as Orderbook, S as SignablePurpose, T as TransactionPurpose, c as constants } from './index-BWfwTwx-.js';
|
|
2
|
+
import './index-DB4LpDqf.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import 'lru-memorise';
|
|
5
5
|
import 'global-const';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import globalAxios, { isAxiosError } from 'axios';
|
|
2
|
-
import { M as MultiRollupApiClients, c as createConfig, m as multiRollupConfig, a as index$1, I as ImxApiClients, b as imxApiConfig } from './index-
|
|
3
|
-
import { I as IMXClient, s as signRaw, c as convertToSignableToken, g as generateLegacyStarkPrivateKey, a as createStarkSigner } from './index-
|
|
4
|
-
import { s as setPassportClientId, t as track, b as trackFlow, c as trackError, u as utils, i as identify, g as getDetail, D as Detail, d as trackDuration, E as Environment } from './index-
|
|
2
|
+
import { M as MultiRollupApiClients, c as createConfig, m as multiRollupConfig, a as index$1, I as ImxApiClients, b as imxApiConfig } from './index-B7Ry_G0i.js';
|
|
3
|
+
import { I as IMXClient, s as signRaw, c as convertToSignableToken, g as generateLegacyStarkPrivateKey, a as createStarkSigner } from './index-BuZNUhP9.js';
|
|
4
|
+
import { s as setPassportClientId, t as track, b as trackFlow, c as trackError, u as utils, i as identify, g as getDetail, D as Detail, d as trackDuration, E as Environment } from './index-DB4LpDqf.js';
|
|
5
5
|
import { UserManager, User, ErrorTimeout, ErrorResponse, InMemoryWebStorage, WebStorageStateStore } from 'oidc-client-ts';
|
|
6
6
|
import * as crypto from 'crypto';
|
|
7
7
|
import jwt_decode from 'jwt-decode';
|
|
@@ -2720,6 +2720,36 @@ const prepareAndSignTransaction = async ({ transactionRequest, ethSigner, rpcPro
|
|
|
2720
2720
|
flow.addEvent('endRelayerSendTransaction');
|
|
2721
2721
|
return { signedTransactions, relayerId, nonce };
|
|
2722
2722
|
};
|
|
2723
|
+
const buildMetaTransactionForEjection = async (transactionRequest) => {
|
|
2724
|
+
if (!transactionRequest.to) {
|
|
2725
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a "to" field');
|
|
2726
|
+
}
|
|
2727
|
+
if (!transactionRequest.nonce) {
|
|
2728
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a "nonce" field');
|
|
2729
|
+
}
|
|
2730
|
+
if (!transactionRequest.chainId) {
|
|
2731
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a "chainId" field');
|
|
2732
|
+
}
|
|
2733
|
+
const metaTransaction = {
|
|
2734
|
+
to: transactionRequest.to,
|
|
2735
|
+
data: transactionRequest.data,
|
|
2736
|
+
nonce: transactionRequest.nonce,
|
|
2737
|
+
value: transactionRequest.value,
|
|
2738
|
+
revertOnError: true,
|
|
2739
|
+
};
|
|
2740
|
+
return [metaTransaction];
|
|
2741
|
+
};
|
|
2742
|
+
const prepareAndSignEjectionTransaction = async ({ transactionRequest, ethSigner, zkEvmAddress, flow, }) => {
|
|
2743
|
+
const metaTransaction = await buildMetaTransactionForEjection(transactionRequest);
|
|
2744
|
+
flow.addEvent('endBuildMetaTransactions');
|
|
2745
|
+
const signedTransaction = await signMetaTransactions(metaTransaction, transactionRequest.nonce, BigNumber.from(transactionRequest.chainId), zkEvmAddress, ethSigner);
|
|
2746
|
+
flow.addEvent('endGetSignedMetaTransactions');
|
|
2747
|
+
return {
|
|
2748
|
+
to: zkEvmAddress,
|
|
2749
|
+
data: signedTransaction,
|
|
2750
|
+
chainId: getEip155ChainId(transactionRequest.chainId),
|
|
2751
|
+
};
|
|
2752
|
+
};
|
|
2723
2753
|
|
|
2724
2754
|
const sendTransaction = async ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkEvmAddress, flow, }) => {
|
|
2725
2755
|
const transactionRequest = params[0];
|
|
@@ -3046,6 +3076,19 @@ const sendDeployTransactionAndPersonalSign = async ({ params, ethSigner, rpcProv
|
|
|
3046
3076
|
});
|
|
3047
3077
|
};
|
|
3048
3078
|
|
|
3079
|
+
const signEjectionTransaction = async ({ params, ethSigner, zkEvmAddress, flow, }) => {
|
|
3080
|
+
if (!params || params.length !== 1) {
|
|
3081
|
+
throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'im_signEjectionTransaction requires a singular param (hash)');
|
|
3082
|
+
}
|
|
3083
|
+
const transactionRequest = params[0];
|
|
3084
|
+
return await prepareAndSignEjectionTransaction({
|
|
3085
|
+
transactionRequest,
|
|
3086
|
+
ethSigner,
|
|
3087
|
+
zkEvmAddress,
|
|
3088
|
+
flow,
|
|
3089
|
+
});
|
|
3090
|
+
};
|
|
3091
|
+
|
|
3049
3092
|
const isZkEvmUser = (user) => 'zkEvm' in user;
|
|
3050
3093
|
class ZkEvmProvider {
|
|
3051
3094
|
#authManager;
|
|
@@ -3417,6 +3460,33 @@ class ZkEvmProvider {
|
|
|
3417
3460
|
case 'eth_getTransactionReceipt': {
|
|
3418
3461
|
return this.#rpcProvider.send(request.method, request.params || []);
|
|
3419
3462
|
}
|
|
3463
|
+
case 'im_signEjectionTransaction': {
|
|
3464
|
+
const zkEvmAddress = await this.#getZkEvmAddress();
|
|
3465
|
+
if (!zkEvmAddress) {
|
|
3466
|
+
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
|
|
3467
|
+
}
|
|
3468
|
+
const flow = trackFlow('passport', 'imSignEjectionTransaction');
|
|
3469
|
+
try {
|
|
3470
|
+
const ethSigner = await this.#getSigner();
|
|
3471
|
+
flow.addEvent('endGetSigner');
|
|
3472
|
+
return await signEjectionTransaction({
|
|
3473
|
+
params: request.params || [],
|
|
3474
|
+
ethSigner,
|
|
3475
|
+
zkEvmAddress,
|
|
3476
|
+
flow,
|
|
3477
|
+
});
|
|
3478
|
+
}
|
|
3479
|
+
catch (error) {
|
|
3480
|
+
if (error instanceof Error) {
|
|
3481
|
+
trackError('passport', 'imSignEjectionTransaction', error);
|
|
3482
|
+
}
|
|
3483
|
+
flow.addEvent('errored');
|
|
3484
|
+
throw error;
|
|
3485
|
+
}
|
|
3486
|
+
finally {
|
|
3487
|
+
flow.addEvent('End');
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3420
3490
|
default: {
|
|
3421
3491
|
throw new JsonRpcError(ProviderErrorCode.UNSUPPORTED_METHOD, 'Method not supported');
|
|
3422
3492
|
}
|
package/dist/passport.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { J as JsonRpcError, P as Passport, a as PassportError, b as ProviderErrorCode, c as ProviderEvent, R as RpcErrorCode } from './passport-
|
|
1
|
+
export { J as JsonRpcError, P as Passport, a as PassportError, b as ProviderErrorCode, c as ProviderEvent, R as RpcErrorCode } from './passport-CIedTeNc.js';
|
|
2
2
|
import 'axios';
|
|
3
|
-
import './index-
|
|
4
|
-
import './index-
|
|
5
|
-
import './index-
|
|
3
|
+
import './index-B7Ry_G0i.js';
|
|
4
|
+
import './index-BuZNUhP9.js';
|
|
5
|
+
import './index-DB4LpDqf.js';
|
|
6
6
|
import 'lru-memorise';
|
|
7
7
|
import 'global-const';
|
|
8
8
|
import '@ethersproject/keccak256';
|
package/dist/webhook.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as ImxConfiguration, c as convertToSignableToken, s as signRaw, e as exportContracts, d as signMessage, E as EncodingApi, M as MintsApi, f as signRegisterEthAddress, A as ApiConfiguration, h as AssetsApi, B as BalancesApi, C as CollectionsApi, D as DepositsApi, i as ExchangesApi, I as IMXClient, j as IMXError, k as ImmutableX, l as MetadataApi, m as MetadataRefreshesApi, n as MetadataSchemaRequestTypeEnum, N as NftCheckoutPrimaryApi, O as OrdersApi, P as ProjectsApi, T as TokensApi, o as TradesApi, p as TransfersApi, U as UsersApi, W as WithdrawalsApi, q as createConfig, r as createImmutableXConfiguration, a as createStarkSigner, g as generateLegacyStarkPrivateKey, t as generateStarkPrivateKey, u as imxClientConfig, v as production, w as sandbox, x as serializePackedSignature, y as starkEcOrder } from './index-
|
|
2
|
-
import { d as index$2 } from './index-
|
|
1
|
+
import { b as ImxConfiguration, c as convertToSignableToken, s as signRaw, e as exportContracts, d as signMessage, E as EncodingApi, M as MintsApi, f as signRegisterEthAddress, A as ApiConfiguration, h as AssetsApi, B as BalancesApi, C as CollectionsApi, D as DepositsApi, i as ExchangesApi, I as IMXClient, j as IMXError, k as ImmutableX, l as MetadataApi, m as MetadataRefreshesApi, n as MetadataSchemaRequestTypeEnum, N as NftCheckoutPrimaryApi, O as OrdersApi, P as ProjectsApi, T as TokensApi, o as TradesApi, p as TransfersApi, U as UsersApi, W as WithdrawalsApi, q as createConfig, r as createImmutableXConfiguration, a as createStarkSigner, g as generateLegacyStarkPrivateKey, t as generateStarkPrivateKey, u as imxClientConfig, v as production, w as sandbox, x as serializePackedSignature, y as starkEcOrder } from './index-BuZNUhP9.js';
|
|
2
|
+
import { d as index$2 } from './index-B7Ry_G0i.js';
|
|
3
3
|
import { isAxiosError } from 'axios';
|
|
4
4
|
import * as encUtils from 'enc-utils';
|
|
5
5
|
import { parseUnits } from '@ethersproject/units';
|
|
6
6
|
import { BigNumber } from '@ethersproject/bignumber';
|
|
7
7
|
import { ethers } from 'ethers';
|
|
8
8
|
import detectEthereumProvider from '@metamask/detect-provider';
|
|
9
|
-
import { E as Environment, I as ImmutableConfiguration } from './index-
|
|
9
|
+
import { E as Environment, I as ImmutableConfiguration } from './index-DB4LpDqf.js';
|
|
10
10
|
import { Signer } from '@ethersproject/abstract-signer';
|
|
11
11
|
|
|
12
12
|
function isChainValid(chainID, config) {
|
package/dist/x.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { A as ApiConfiguration, h as AssetsApi, B as BalancesApi, C as CollectionsApi, e as Contracts, D as DepositsApi, E as EncodingApi, i as ExchangesApi, I as IMXClient, j as IMXError, k as ImmutableX, b as ImxConfiguration, l as MetadataApi, m as MetadataRefreshesApi, n as MetadataSchemaRequestTypeEnum, M as MintsApi, N as NftCheckoutPrimaryApi, O as OrdersApi, P as ProjectsApi, T as TokensApi, o as TradesApi, p as TransfersApi, U as UsersApi, W as WithdrawalsApi, q as createConfig, r as createImmutableXConfiguration, a as createStarkSigner, g as generateLegacyStarkPrivateKey, t as generateStarkPrivateKey, u as imxClientConfig, a as imxClientCreateStarkSigner, g as imxClientGenerateLegacyStarkPrivateKey, v as production, w as sandbox, x as serializePackedSignature, f as signRegisterEthAddress, y as starkEcOrder } from './index-
|
|
2
|
-
export { G as GenericIMXProvider, M as MetaMaskIMXProvider, P as ProviderConfiguration } from './x-
|
|
3
|
-
export { E as Environment, I as ImmutableConfiguration } from './index-
|
|
1
|
+
export { A as ApiConfiguration, h as AssetsApi, B as BalancesApi, C as CollectionsApi, e as Contracts, D as DepositsApi, E as EncodingApi, i as ExchangesApi, I as IMXClient, j as IMXError, k as ImmutableX, b as ImxConfiguration, l as MetadataApi, m as MetadataRefreshesApi, n as MetadataSchemaRequestTypeEnum, M as MintsApi, N as NftCheckoutPrimaryApi, O as OrdersApi, P as ProjectsApi, T as TokensApi, o as TradesApi, p as TransfersApi, U as UsersApi, W as WithdrawalsApi, q as createConfig, r as createImmutableXConfiguration, a as createStarkSigner, g as generateLegacyStarkPrivateKey, t as generateStarkPrivateKey, u as imxClientConfig, a as imxClientCreateStarkSigner, g as imxClientGenerateLegacyStarkPrivateKey, v as production, w as sandbox, x as serializePackedSignature, f as signRegisterEthAddress, y as starkEcOrder } from './index-BuZNUhP9.js';
|
|
2
|
+
export { G as GenericIMXProvider, M as MetaMaskIMXProvider, P as ProviderConfiguration } from './x-D4XBahT5.js';
|
|
3
|
+
export { E as Environment, I as ImmutableConfiguration } from './index-DB4LpDqf.js';
|
|
4
4
|
export { Signer as EthSigner } from '@ethersproject/abstract-signer';
|
|
5
|
-
import './index-
|
|
5
|
+
import './index-B7Ry_G0i.js';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import '@ethersproject/keccak256';
|
|
8
8
|
import '@ethersproject/strings';
|
package/package.json
CHANGED