@imtbl/passport 2.11.0 → 2.11.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +9 -410
- package/dist/node/index.cjs +27 -439
- package/dist/node/index.js +9 -410
- package/dist/types/Passport.d.ts +68 -70
- package/dist/types/config/config.d.ts +3 -1
- package/dist/types/errors/passportError.d.ts +1 -30
- package/dist/types/index.d.ts +4 -4
- package/dist/types/starkEx/imxGuardianClient.d.ts +18 -0
- package/dist/types/starkEx/passportImxProvider.d.ts +9 -9
- package/dist/types/starkEx/passportImxProviderFactory.d.ts +9 -9
- package/dist/types/starkEx/workflows/order.d.ts +3 -3
- package/dist/types/starkEx/workflows/registerOffchain.d.ts +2 -3
- package/dist/types/starkEx/workflows/trades.d.ts +2 -2
- package/dist/types/starkEx/workflows/transfer.d.ts +3 -3
- package/dist/types/types.d.ts +22 -83
- package/dist/types/utils/httpError.d.ts +8 -0
- package/dist/types/utils/imxUser.d.ts +9 -0
- package/dist/types/utils/metrics.d.ts +0 -1
- package/package.json +14 -23
- package/dist/types/Passport.int.test.d.ts +0 -1
- package/dist/types/authManager.d.ts +0 -61
- package/dist/types/authManager.test.d.ts +0 -1
- package/dist/types/confirmation/confirmation.d.ts +0 -28
- package/dist/types/confirmation/confirmation.test.d.ts +0 -1
- package/dist/types/confirmation/embeddedLoginPrompt.d.ts +0 -10
- package/dist/types/confirmation/embeddedLoginPrompt.test.d.ts +0 -1
- package/dist/types/confirmation/index.d.ts +0 -3
- package/dist/types/confirmation/popup.d.ts +0 -8
- package/dist/types/confirmation/popup.test.d.ts +0 -1
- package/dist/types/confirmation/types.d.ts +0 -33
- package/dist/types/guardian/index.d.ts +0 -58
- package/dist/types/guardian/index.test.d.ts +0 -1
- package/dist/types/magic/index.d.ts +0 -1
- package/dist/types/magic/magicTEESigner.d.ts +0 -24
- package/dist/types/magic/magicTEESigner.test.d.ts +0 -1
- package/dist/types/mocks/zkEvm/msw.d.ts +0 -39
- package/dist/types/network/chains.d.ts +0 -32
- package/dist/types/network/constants.d.ts +0 -3
- package/dist/types/network/retry.d.ts +0 -8
- package/dist/types/network/retry.test.d.ts +0 -1
- package/dist/types/overlay/confirmationOverlay.d.ts +0 -17
- package/dist/types/overlay/confirmationOverlay.test.d.ts +0 -1
- package/dist/types/overlay/constants.d.ts +0 -7
- package/dist/types/overlay/elements.d.ts +0 -12
- package/dist/types/overlay/embeddedLoginPromptOverlay.d.ts +0 -7
- package/dist/types/overlay/embeddedLoginPromptOverlay.test.d.ts +0 -1
- package/dist/types/starkEx/passportImxProvider.test.d.ts +0 -1
- package/dist/types/starkEx/passportImxProviderFactory.test.d.ts +0 -1
- package/dist/types/starkEx/workflows/exchange.test.d.ts +0 -1
- package/dist/types/starkEx/workflows/order.test.d.ts +0 -1
- package/dist/types/starkEx/workflows/registerOffchain.test.d.ts +0 -1
- package/dist/types/starkEx/workflows/trades.test.d.ts +0 -1
- package/dist/types/starkEx/workflows/transfer.test.d.ts +0 -1
- package/dist/types/storage/LocalForageAsyncStorage.d.ts +0 -11
- package/dist/types/storage/device_credentials_manager.d.ts +0 -6
- package/dist/types/test/mocks.d.ts +0 -56
- package/dist/types/utils/metrics.test.d.ts +0 -1
- package/dist/types/utils/string.d.ts +0 -1
- package/dist/types/utils/string.test.d.ts +0 -1
- package/dist/types/utils/token.d.ts +0 -2
- package/dist/types/utils/token.test.d.ts +0 -1
- package/dist/types/utils/typedEventEmitter.d.ts +0 -6
- package/dist/types/utils/typedEventEmitter.test.d.ts +0 -1
- package/dist/types/zkEvm/JsonRpcError.d.ts +0 -25
- package/dist/types/zkEvm/index.d.ts +0 -2
- package/dist/types/zkEvm/personalSign.d.ts +0 -15
- package/dist/types/zkEvm/personalSign.test.d.ts +0 -1
- package/dist/types/zkEvm/provider/eip6963.d.ts +0 -3
- package/dist/types/zkEvm/relayerClient.d.ts +0 -60
- package/dist/types/zkEvm/relayerClient.test.d.ts +0 -1
- package/dist/types/zkEvm/sendDeployTransactionAndPersonalSign.d.ts +0 -6
- package/dist/types/zkEvm/sendDeployTransactionAndPersonalSign.test.d.ts +0 -1
- package/dist/types/zkEvm/sendTransaction.d.ts +0 -6
- package/dist/types/zkEvm/sendTransaction.test.d.ts +0 -1
- package/dist/types/zkEvm/sessionActivity/errorBoundary.d.ts +0 -1
- package/dist/types/zkEvm/sessionActivity/request.d.ts +0 -15
- package/dist/types/zkEvm/sessionActivity/sessionActivity.d.ts +0 -2
- package/dist/types/zkEvm/signEjectionTransaction.d.ts +0 -6
- package/dist/types/zkEvm/signEjectionTransaction.test.d.ts +0 -1
- package/dist/types/zkEvm/signTypedDataV4.d.ts +0 -14
- package/dist/types/zkEvm/signTypedDataV4.test.d.ts +0 -1
- package/dist/types/zkEvm/transactionHelpers.d.ts +0 -31
- package/dist/types/zkEvm/transactionHelpers.test.d.ts +0 -1
- package/dist/types/zkEvm/types.d.ts +0 -120
- package/dist/types/zkEvm/user/index.d.ts +0 -1
- package/dist/types/zkEvm/user/registerZkEvmUser.d.ts +0 -13
- package/dist/types/zkEvm/user/registerZkEvmUser.test.d.ts +0 -1
- package/dist/types/zkEvm/walletHelpers.d.ts +0 -33
- package/dist/types/zkEvm/walletHelpers.test.d.ts +0 -1
- package/dist/types/zkEvm/zkEvmProvider.d.ts +0 -25
- package/dist/types/zkEvm/zkEvmProvider.test.d.ts +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ProviderErrors should take priority over RpcErrorCodes
|
|
3
|
-
* https://eips.ethereum.org/EIPS/eip-1193#provider-errors
|
|
4
|
-
* https://eips.ethereum.org/EIPS/eip-1474#error-codes
|
|
5
|
-
*/
|
|
6
|
-
export declare enum ProviderErrorCode {
|
|
7
|
-
USER_REJECTED_REQUEST = 4001,
|
|
8
|
-
UNAUTHORIZED = 4100,
|
|
9
|
-
UNSUPPORTED_METHOD = 4200,
|
|
10
|
-
DISCONNECTED = 4900
|
|
11
|
-
}
|
|
12
|
-
export declare enum RpcErrorCode {
|
|
13
|
-
RPC_SERVER_ERROR = -32000,
|
|
14
|
-
INVALID_REQUEST = -32600,
|
|
15
|
-
METHOD_NOT_FOUND = -32601,
|
|
16
|
-
INVALID_PARAMS = -32602,
|
|
17
|
-
INTERNAL_ERROR = -32603,
|
|
18
|
-
PARSE_ERROR = -32700,
|
|
19
|
-
TRANSACTION_REJECTED = -32003
|
|
20
|
-
}
|
|
21
|
-
export declare class JsonRpcError extends Error {
|
|
22
|
-
readonly message: string;
|
|
23
|
-
readonly code: ProviderErrorCode | RpcErrorCode;
|
|
24
|
-
constructor(code: ProviderErrorCode | RpcErrorCode, message: string);
|
|
25
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Flow } from '@imtbl/metrics';
|
|
2
|
-
import { Signer, JsonRpcProvider } from 'ethers';
|
|
3
|
-
import GuardianClient from '../guardian';
|
|
4
|
-
import { RelayerClient } from './relayerClient';
|
|
5
|
-
interface PersonalSignParams {
|
|
6
|
-
ethSigner: Signer;
|
|
7
|
-
rpcProvider: JsonRpcProvider;
|
|
8
|
-
params: any[];
|
|
9
|
-
zkEvmAddress: string;
|
|
10
|
-
guardianClient: GuardianClient;
|
|
11
|
-
relayerClient: RelayerClient;
|
|
12
|
-
flow: Flow;
|
|
13
|
-
}
|
|
14
|
-
export declare const personalSign: ({ params, ethSigner, zkEvmAddress, rpcProvider, guardianClient, relayerClient, flow, }: PersonalSignParams) => Promise<string>;
|
|
15
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { BytesLike, JsonRpcProvider } from 'ethers';
|
|
2
|
-
import AuthManager from '../authManager';
|
|
3
|
-
import { PassportConfiguration } from '../config';
|
|
4
|
-
import { FeeOption, RelayerTransaction, TypedDataPayload } from './types';
|
|
5
|
-
export type RelayerClientInput = {
|
|
6
|
-
config: PassportConfiguration;
|
|
7
|
-
rpcProvider: JsonRpcProvider;
|
|
8
|
-
authManager: AuthManager;
|
|
9
|
-
};
|
|
10
|
-
type EthSendTransactionRequest = {
|
|
11
|
-
method: 'eth_sendTransaction';
|
|
12
|
-
params: {
|
|
13
|
-
to: string;
|
|
14
|
-
data: BytesLike;
|
|
15
|
-
chainId: string;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
18
|
-
type ImGetTransactionByHashRequest = {
|
|
19
|
-
method: 'im_getTransactionByHash';
|
|
20
|
-
params: string[];
|
|
21
|
-
};
|
|
22
|
-
type ImGetFeeOptionsRequest = {
|
|
23
|
-
method: 'im_getFeeOptions';
|
|
24
|
-
params: {
|
|
25
|
-
userAddress: string;
|
|
26
|
-
data: BytesLike;
|
|
27
|
-
chainId: string;
|
|
28
|
-
}[];
|
|
29
|
-
};
|
|
30
|
-
type ImSignRequest = {
|
|
31
|
-
method: 'im_sign';
|
|
32
|
-
params: {
|
|
33
|
-
chainId: string;
|
|
34
|
-
address: string;
|
|
35
|
-
message: string;
|
|
36
|
-
}[];
|
|
37
|
-
};
|
|
38
|
-
type ImSignTypedDataRequest = {
|
|
39
|
-
method: 'im_signTypedData';
|
|
40
|
-
params: {
|
|
41
|
-
chainId: string;
|
|
42
|
-
address: string;
|
|
43
|
-
eip712Payload: TypedDataPayload;
|
|
44
|
-
}[];
|
|
45
|
-
};
|
|
46
|
-
export type RelayerTransactionRequest = EthSendTransactionRequest | ImGetTransactionByHashRequest | ImGetFeeOptionsRequest | ImSignTypedDataRequest | ImSignRequest;
|
|
47
|
-
export declare class RelayerClient {
|
|
48
|
-
private readonly config;
|
|
49
|
-
private readonly rpcProvider;
|
|
50
|
-
private readonly authManager;
|
|
51
|
-
constructor({ config, rpcProvider, authManager }: RelayerClientInput);
|
|
52
|
-
private static getResponsePreview;
|
|
53
|
-
private postToRelayer;
|
|
54
|
-
ethSendTransaction(to: string, data: BytesLike): Promise<string>;
|
|
55
|
-
imGetTransactionByHash(hash: string): Promise<RelayerTransaction>;
|
|
56
|
-
imGetFeeOptions(userAddress: string, data: BytesLike): Promise<FeeOption[] | undefined>;
|
|
57
|
-
imSignTypedData(address: string, eip712Payload: TypedDataPayload): Promise<string>;
|
|
58
|
-
imSign(address: string, message: string): Promise<string>;
|
|
59
|
-
}
|
|
60
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TransactionParams } from './transactionHelpers';
|
|
2
|
-
type EthSendDeployTransactionParams = TransactionParams & {
|
|
3
|
-
params: Array<any>;
|
|
4
|
-
};
|
|
5
|
-
export declare const sendDeployTransactionAndPersonalSign: ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkEvmAddress, flow, }: EthSendDeployTransactionParams) => Promise<string>;
|
|
6
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TransactionParams } from './transactionHelpers';
|
|
2
|
-
type EthSendTransactionParams = TransactionParams & {
|
|
3
|
-
params: Array<any>;
|
|
4
|
-
};
|
|
5
|
-
export declare const sendTransaction: ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkEvmAddress, flow, nonceSpace, isBackgroundTransaction, }: EthSendTransactionParams) => Promise<string>;
|
|
6
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function errorBoundary<T extends (...args: any[]) => any>(fn: T, fallbackResult?: ReturnType<T>): (...args: Parameters<T>) => ReturnType<T>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Environment } from '@imtbl/config';
|
|
2
|
-
export declare const setupClient: (environment: Environment) => void;
|
|
3
|
-
type CheckParams = {
|
|
4
|
-
clientId: string;
|
|
5
|
-
wallet?: string;
|
|
6
|
-
checkCount?: number;
|
|
7
|
-
sendCount?: number;
|
|
8
|
-
};
|
|
9
|
-
export type CheckResponse = {
|
|
10
|
-
contractAddress?: string;
|
|
11
|
-
functionName?: string;
|
|
12
|
-
delay?: number;
|
|
13
|
-
};
|
|
14
|
-
export declare function get(queries: CheckParams): Promise<CheckResponse | undefined>;
|
|
15
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { EjectionTransactionParams, EjectionTransactionResponse } from './transactionHelpers';
|
|
2
|
-
type EthSendTransactionEjectionParams = EjectionTransactionParams & {
|
|
3
|
-
params: Array<any>;
|
|
4
|
-
};
|
|
5
|
-
export declare const signEjectionTransaction: ({ params, ethSigner, zkEvmAddress, flow, }: EthSendTransactionEjectionParams) => Promise<EjectionTransactionResponse>;
|
|
6
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Flow } from '@imtbl/metrics';
|
|
2
|
-
import { Signer, JsonRpcProvider } from 'ethers';
|
|
3
|
-
import GuardianClient from '../guardian';
|
|
4
|
-
import { RelayerClient } from './relayerClient';
|
|
5
|
-
export type SignTypedDataV4Params = {
|
|
6
|
-
ethSigner: Signer;
|
|
7
|
-
rpcProvider: JsonRpcProvider;
|
|
8
|
-
relayerClient: RelayerClient;
|
|
9
|
-
method: string;
|
|
10
|
-
params: Array<any>;
|
|
11
|
-
guardianClient: GuardianClient;
|
|
12
|
-
flow: Flow;
|
|
13
|
-
};
|
|
14
|
-
export declare const signTypedDataV4: ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, flow, }: SignTypedDataV4Params) => Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Flow } from '@imtbl/metrics';
|
|
2
|
-
import { Signer, TransactionRequest, JsonRpcProvider, BigNumberish } from 'ethers';
|
|
3
|
-
import { RelayerClient } from './relayerClient';
|
|
4
|
-
import GuardianClient from '../guardian';
|
|
5
|
-
export type TransactionParams = {
|
|
6
|
-
ethSigner: Signer;
|
|
7
|
-
rpcProvider: JsonRpcProvider;
|
|
8
|
-
guardianClient: GuardianClient;
|
|
9
|
-
relayerClient: RelayerClient;
|
|
10
|
-
zkEvmAddress: string;
|
|
11
|
-
flow: Flow;
|
|
12
|
-
nonceSpace?: bigint;
|
|
13
|
-
isBackgroundTransaction?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type EjectionTransactionParams = Pick<TransactionParams, 'ethSigner' | 'zkEvmAddress' | 'flow'>;
|
|
16
|
-
export type EjectionTransactionResponse = {
|
|
17
|
-
to: string;
|
|
18
|
-
data: string;
|
|
19
|
-
chainId: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const pollRelayerTransaction: (relayerClient: RelayerClient, relayerId: string, flow: Flow) => Promise<import("./types").RelayerTransaction>;
|
|
22
|
-
export declare const prepareAndSignTransaction: ({ transactionRequest, ethSigner, rpcProvider, guardianClient, relayerClient, zkEvmAddress, flow, nonceSpace, isBackgroundTransaction, }: TransactionParams & {
|
|
23
|
-
transactionRequest: TransactionRequest;
|
|
24
|
-
}) => Promise<{
|
|
25
|
-
signedTransactions: string;
|
|
26
|
-
relayerId: string;
|
|
27
|
-
nonce: BigNumberish;
|
|
28
|
-
}>;
|
|
29
|
-
export declare const prepareAndSignEjectionTransaction: ({ transactionRequest, ethSigner, zkEvmAddress, flow, }: EjectionTransactionParams & {
|
|
30
|
-
transactionRequest: TransactionRequest;
|
|
31
|
-
}) => Promise<EjectionTransactionResponse>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { BigNumberish } from 'ethers';
|
|
2
|
-
import { JsonRpcError } from './JsonRpcError';
|
|
3
|
-
export declare enum RelayerTransactionStatus {
|
|
4
|
-
PENDING = "PENDING",
|
|
5
|
-
SUBMITTED = "SUBMITTED",
|
|
6
|
-
SUCCESSFUL = "SUCCESSFUL",
|
|
7
|
-
REVERTED = "REVERTED",
|
|
8
|
-
FAILED = "FAILED",
|
|
9
|
-
CANCELLED = "CANCELLED"
|
|
10
|
-
}
|
|
11
|
-
export interface RelayerTransaction {
|
|
12
|
-
status: RelayerTransactionStatus;
|
|
13
|
-
chainId: string;
|
|
14
|
-
relayerId: string;
|
|
15
|
-
hash: string;
|
|
16
|
-
statusMessage?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface FeeOption {
|
|
19
|
-
tokenPrice: string;
|
|
20
|
-
tokenSymbol: string;
|
|
21
|
-
tokenDecimals: number;
|
|
22
|
-
tokenAddress: string;
|
|
23
|
-
recipientAddress: string;
|
|
24
|
-
}
|
|
25
|
-
export interface MetaTransaction {
|
|
26
|
-
to: string;
|
|
27
|
-
value?: BigNumberish | null;
|
|
28
|
-
data?: string | null;
|
|
29
|
-
nonce?: BigNumberish;
|
|
30
|
-
gasLimit?: BigNumberish;
|
|
31
|
-
delegateCall?: boolean;
|
|
32
|
-
revertOnError?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface MetaTransactionNormalised {
|
|
35
|
-
delegateCall: boolean;
|
|
36
|
-
revertOnError: boolean;
|
|
37
|
-
gasLimit: BigNumberish;
|
|
38
|
-
target: string;
|
|
39
|
-
value: BigNumberish;
|
|
40
|
-
data: string;
|
|
41
|
-
}
|
|
42
|
-
export interface TypedDataPayload {
|
|
43
|
-
types: {
|
|
44
|
-
EIP712Domain: Array<{
|
|
45
|
-
name: string;
|
|
46
|
-
type: string;
|
|
47
|
-
}>;
|
|
48
|
-
[key: string]: Array<{
|
|
49
|
-
name: string;
|
|
50
|
-
type: string;
|
|
51
|
-
}>;
|
|
52
|
-
};
|
|
53
|
-
domain: {
|
|
54
|
-
name?: string;
|
|
55
|
-
version?: string;
|
|
56
|
-
chainId?: number | string;
|
|
57
|
-
verifyingContract?: string;
|
|
58
|
-
salt?: string;
|
|
59
|
-
} | {
|
|
60
|
-
name?: string;
|
|
61
|
-
version?: string;
|
|
62
|
-
chainId?: number;
|
|
63
|
-
verifyingContract?: string;
|
|
64
|
-
salt?: string;
|
|
65
|
-
};
|
|
66
|
-
primaryType: string;
|
|
67
|
-
message: Record<string, any>;
|
|
68
|
-
}
|
|
69
|
-
export interface RequestArguments {
|
|
70
|
-
method: string;
|
|
71
|
-
params?: Array<any>;
|
|
72
|
-
}
|
|
73
|
-
export type JsonRpcRequestPayload = RequestArguments & {
|
|
74
|
-
jsonrpc?: string;
|
|
75
|
-
id?: string | number;
|
|
76
|
-
};
|
|
77
|
-
export interface JsonRpcRequestCallback {
|
|
78
|
-
(err: JsonRpcError | null, result?: JsonRpcResponsePayload | (JsonRpcResponsePayload | null)[] | null): void;
|
|
79
|
-
}
|
|
80
|
-
export interface JsonRpcResponsePayload {
|
|
81
|
-
result?: Array<any> | null;
|
|
82
|
-
error?: JsonRpcError | null;
|
|
83
|
-
jsonrpc?: string;
|
|
84
|
-
id?: string | number;
|
|
85
|
-
}
|
|
86
|
-
export type Provider = {
|
|
87
|
-
request: (request: RequestArguments) => Promise<any>;
|
|
88
|
-
on: (event: string, listener: (...args: any[]) => void) => void;
|
|
89
|
-
removeListener: (event: string, listener: (...args: any[]) => void) => void;
|
|
90
|
-
isPassport: boolean;
|
|
91
|
-
};
|
|
92
|
-
export declare enum ProviderEvent {
|
|
93
|
-
ACCOUNTS_CHANGED = "accountsChanged"
|
|
94
|
-
}
|
|
95
|
-
export type AccountsChangedEvent = Array<string>;
|
|
96
|
-
export interface ProviderEventMap extends Record<string, any> {
|
|
97
|
-
[ProviderEvent.ACCOUNTS_CHANGED]: [AccountsChangedEvent];
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Event detail from the `eip6963:announceProvider` event.
|
|
101
|
-
*/
|
|
102
|
-
export interface EIP6963ProviderDetail {
|
|
103
|
-
info: EIP6963ProviderInfo;
|
|
104
|
-
provider: Provider;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Metadata of the EIP-1193 Provider.
|
|
108
|
-
*/
|
|
109
|
-
export interface EIP6963ProviderInfo {
|
|
110
|
-
icon: `data:image/${string}`;
|
|
111
|
-
name: string;
|
|
112
|
-
rdns: string;
|
|
113
|
-
uuid: string;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Event type to announce an EIP-1193 Provider.
|
|
117
|
-
*/
|
|
118
|
-
export interface EIP6963AnnounceProviderEvent extends CustomEvent<EIP6963ProviderDetail> {
|
|
119
|
-
type: 'eip6963:announceProvider';
|
|
120
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './registerZkEvmUser';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MultiRollupApiClients } from '@imtbl/generated-clients';
|
|
2
|
-
import { Flow } from '@imtbl/metrics';
|
|
3
|
-
import { Signer, JsonRpcProvider } from 'ethers';
|
|
4
|
-
import AuthManager from '../../authManager';
|
|
5
|
-
export type RegisterZkEvmUserInput = {
|
|
6
|
-
authManager: AuthManager;
|
|
7
|
-
ethSigner: Signer;
|
|
8
|
-
multiRollupApiClients: MultiRollupApiClients;
|
|
9
|
-
accessToken: string;
|
|
10
|
-
rpcProvider: JsonRpcProvider;
|
|
11
|
-
flow: Flow;
|
|
12
|
-
};
|
|
13
|
-
export declare function registerZkEvmUser({ authManager, ethSigner, multiRollupApiClients, accessToken, rpcProvider, flow, }: RegisterZkEvmUserInput): Promise<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BigNumberish, Signer, JsonRpcProvider } from 'ethers';
|
|
2
|
-
import { MetaTransaction, MetaTransactionNormalised, TypedDataPayload } from './types';
|
|
3
|
-
export declare const getNormalisedTransactions: (txs: MetaTransaction[]) => MetaTransactionNormalised[];
|
|
4
|
-
export declare const digestOfTransactionsAndNonce: (nonce: BigNumberish, normalisedTransactions: MetaTransactionNormalised[]) => string;
|
|
5
|
-
export declare const encodedTransactions: (normalisedTransactions: MetaTransactionNormalised[]) => string;
|
|
6
|
-
/**
|
|
7
|
-
* This helper function is used to coerce the type <BigNumber | undefined> to BigNumber for the
|
|
8
|
-
* getNonce function above.
|
|
9
|
-
* @param {BigNumber} nonceSpace - An unsigned 256 bit value that can be used to encode a nonce into a distinct space.
|
|
10
|
-
* @returns {BigNumber} The passed in nonceSpace or instead initialises the nonce to 0.
|
|
11
|
-
*/
|
|
12
|
-
export declare const coerceNonceSpace: (nonceSpace?: bigint) => bigint;
|
|
13
|
-
/**
|
|
14
|
-
* This helper function is used to encode the nonce into a 256 bit value where the space is encoded into
|
|
15
|
-
* the first 160 bits, and the nonce the remaining 96 bits.
|
|
16
|
-
* @param {BigNumber} nonceSpace - An unsigned 256 bit value that can be used to encode a nonce into a distinct space.
|
|
17
|
-
* @param nonce {BigNumber} nonce - Sequential number starting at 0, and incrementing in single steps e.g. 0,1,2,...
|
|
18
|
-
* @returns {BigNumber} The encoded value where the space is left shifted 96 bits, and the nonce is in the first 96 bits.
|
|
19
|
-
*/
|
|
20
|
-
export declare const encodeNonce: (nonceSpace: bigint, nonce: bigint) => bigint;
|
|
21
|
-
/**
|
|
22
|
-
* When we retrieve a nonce for a smart contract wallet we can retrieve the nonce in a given 256 bit space.
|
|
23
|
-
* Nonces in each 256 bit space need to be sequential per wallet address. Nonces across 256 bit spaces per
|
|
24
|
-
* wallet address do not. This function overload can be used to invoke transactions in parallel per smart
|
|
25
|
-
* contract wallet if required.
|
|
26
|
-
*/
|
|
27
|
-
export declare const getNonce: (rpcProvider: JsonRpcProvider, smartContractWalletAddress: string, nonceSpace?: bigint) => Promise<bigint>;
|
|
28
|
-
export declare const encodeMessageSubDigest: (chainId: bigint, walletAddress: string, digest: string) => string;
|
|
29
|
-
export declare const signMetaTransactions: (metaTransactions: MetaTransaction[], nonce: BigNumberish, chainId: bigint, walletAddress: string, signer: Signer) => Promise<string>;
|
|
30
|
-
export declare const packSignatures: (EOASignature: string, EOAAddress: string, relayerSignature: string) => string;
|
|
31
|
-
export declare const signAndPackTypedData: (typedData: TypedDataPayload, relayerSignature: string, chainId: bigint, walletAddress: string, signer: Signer) => Promise<string>;
|
|
32
|
-
export declare const signERC191Message: (chainId: bigint, payload: string, signer: Signer, walletAddress: string) => Promise<string>;
|
|
33
|
-
export declare const getEip155ChainId: (chainId: number) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { MultiRollupApiClients } from '@imtbl/generated-clients';
|
|
2
|
-
import { Signer } from 'ethers';
|
|
3
|
-
import { Provider, RequestArguments } from './types';
|
|
4
|
-
import AuthManager from '../authManager';
|
|
5
|
-
import TypedEventEmitter from '../utils/typedEventEmitter';
|
|
6
|
-
import { PassportConfiguration } from '../config';
|
|
7
|
-
import { PassportEventMap, User } from '../types';
|
|
8
|
-
import GuardianClient from '../guardian';
|
|
9
|
-
export type ZkEvmProviderInput = {
|
|
10
|
-
authManager: AuthManager;
|
|
11
|
-
config: PassportConfiguration;
|
|
12
|
-
multiRollupApiClients: MultiRollupApiClients;
|
|
13
|
-
passportEventEmitter: TypedEventEmitter<PassportEventMap>;
|
|
14
|
-
guardianClient: GuardianClient;
|
|
15
|
-
ethSigner: Signer;
|
|
16
|
-
user: User | null;
|
|
17
|
-
};
|
|
18
|
-
export declare class ZkEvmProvider implements Provider {
|
|
19
|
-
#private;
|
|
20
|
-
readonly isPassport: boolean;
|
|
21
|
-
constructor({ authManager, config, multiRollupApiClients, passportEventEmitter, guardianClient, ethSigner, user, }: ZkEvmProviderInput);
|
|
22
|
-
request(request: RequestArguments): Promise<any>;
|
|
23
|
-
on(event: string, listener: (...args: any[]) => void): void;
|
|
24
|
-
removeListener(event: string, listener: (...args: any[]) => void): void;
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|