@metamask/keyring-api 11.0.0 → 12.0.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/CHANGELOG.md +21 -1
- package/dist/api/account.cjs +3 -4
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +1 -1
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +1 -1
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +1 -2
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/asset.cjs +82 -0
- package/dist/api/asset.cjs.map +1 -0
- package/dist/api/asset.d.cts +93 -0
- package/dist/api/asset.d.cts.map +1 -0
- package/dist/api/asset.d.mts +93 -0
- package/dist/api/asset.d.mts.map +1 -0
- package/dist/api/asset.mjs +79 -0
- package/dist/api/asset.mjs.map +1 -0
- package/dist/api/balance.cjs +3 -4
- package/dist/api/balance.cjs.map +1 -1
- package/dist/api/balance.d.cts +1 -1
- package/dist/api/balance.d.cts.map +1 -1
- package/dist/api/balance.d.mts +1 -1
- package/dist/api/balance.d.mts.map +1 -1
- package/dist/api/balance.mjs +1 -2
- package/dist/api/balance.mjs.map +1 -1
- package/dist/api/caip.cjs +3 -3
- package/dist/api/caip.cjs.map +1 -1
- package/dist/api/caip.d.cts.map +1 -1
- package/dist/api/caip.d.mts.map +1 -1
- package/dist/api/caip.mjs +1 -1
- package/dist/api/caip.mjs.map +1 -1
- package/dist/api/index.cjs +3 -0
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.cts +4 -1
- package/dist/api/index.d.cts.map +1 -1
- package/dist/api/index.d.mts +4 -1
- package/dist/api/index.d.mts.map +1 -1
- package/dist/api/index.mjs +3 -0
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/keyring.cjs +2 -0
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +14 -0
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +14 -0
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs +2 -0
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/pagination.cjs +28 -0
- package/dist/api/pagination.cjs.map +1 -0
- package/dist/api/pagination.d.cts +59 -0
- package/dist/api/pagination.d.cts.map +1 -0
- package/dist/api/pagination.d.mts +59 -0
- package/dist/api/pagination.d.mts.map +1 -0
- package/dist/api/pagination.mjs +25 -0
- package/dist/api/pagination.mjs.map +1 -0
- package/dist/api/request.cjs +6 -7
- package/dist/api/request.cjs.map +1 -1
- package/dist/api/request.d.cts +5 -5
- package/dist/api/request.d.cts.map +1 -1
- package/dist/api/request.d.mts +5 -5
- package/dist/api/request.d.mts.map +1 -1
- package/dist/api/request.mjs +1 -2
- package/dist/api/request.mjs.map +1 -1
- package/dist/api/response.cjs +6 -6
- package/dist/api/response.cjs.map +1 -1
- package/dist/api/response.d.cts +1 -1
- package/dist/api/response.d.cts.map +1 -1
- package/dist/api/response.d.mts +1 -1
- package/dist/api/response.d.mts.map +1 -1
- package/dist/api/response.mjs +1 -1
- package/dist/api/response.mjs.map +1 -1
- package/dist/api/transaction.cjs +294 -0
- package/dist/api/transaction.cjs.map +1 -0
- package/dist/api/transaction.d.cts +773 -0
- package/dist/api/transaction.d.cts.map +1 -0
- package/dist/api/transaction.d.mts +773 -0
- package/dist/api/transaction.d.mts.map +1 -0
- package/dist/api/transaction.mjs +291 -0
- package/dist/api/transaction.mjs.map +1 -0
- package/dist/btc/types.cjs +2 -2
- package/dist/btc/types.cjs.map +1 -1
- package/dist/btc/types.d.cts +1 -1
- package/dist/btc/types.d.cts.map +1 -1
- package/dist/btc/types.d.mts +1 -1
- package/dist/btc/types.d.mts.map +1 -1
- package/dist/btc/types.mjs +2 -2
- package/dist/btc/types.mjs.map +1 -1
- package/dist/eth/erc4337/types.cjs +10 -11
- package/dist/eth/erc4337/types.cjs.map +1 -1
- package/dist/eth/erc4337/types.d.cts +4 -4
- package/dist/eth/erc4337/types.d.cts.map +1 -1
- package/dist/eth/erc4337/types.d.mts +4 -4
- package/dist/eth/erc4337/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.mjs +1 -2
- package/dist/eth/erc4337/types.mjs.map +1 -1
- package/dist/eth/types.cjs +6 -6
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts +2 -2
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts +2 -2
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs +1 -1
- package/dist/eth/types.mjs.map +1 -1
- package/dist/eth/utils.cjs.map +1 -1
- package/dist/eth/utils.d.cts.map +1 -1
- package/dist/eth/utils.d.mts.map +1 -1
- package/dist/eth/utils.mjs.map +1 -1
- package/dist/events.cjs +67 -1
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +161 -0
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +161 -0
- package/dist/events.d.mts.map +1 -1
- package/dist/events.mjs +66 -0
- package/dist/events.mjs.map +1 -1
- package/dist/index.cjs +2 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{internal/api.cjs → rpc.cjs} +78 -38
- package/dist/rpc.cjs.map +1 -0
- package/dist/{internal/api.d.cts → rpc.d.cts} +402 -59
- package/dist/rpc.d.cts.map +1 -0
- package/dist/{internal/api.d.mts → rpc.d.mts} +402 -59
- package/dist/rpc.d.mts.map +1 -0
- package/dist/{internal/api.mjs → rpc.mjs} +44 -5
- package/dist/rpc.mjs.map +1 -0
- package/dist/sol/types.cjs +3 -3
- package/dist/sol/types.cjs.map +1 -1
- package/dist/sol/types.d.cts +1 -1
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts +1 -1
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/sol/types.mjs +1 -1
- package/dist/sol/types.mjs.map +1 -1
- package/package.json +11 -14
- package/dist/JsonRpcRequest.cjs +0 -13
- package/dist/JsonRpcRequest.cjs.map +0 -1
- package/dist/JsonRpcRequest.d.cts +0 -17
- package/dist/JsonRpcRequest.d.cts.map +0 -1
- package/dist/JsonRpcRequest.d.mts +0 -17
- package/dist/JsonRpcRequest.d.mts.map +0 -1
- package/dist/JsonRpcRequest.mjs +0 -10
- package/dist/JsonRpcRequest.mjs.map +0 -1
- package/dist/KeyringClient.cjs +0 -124
- package/dist/KeyringClient.cjs.map +0 -1
- package/dist/KeyringClient.d.cts +0 -29
- package/dist/KeyringClient.d.cts.map +0 -1
- package/dist/KeyringClient.d.mts +0 -29
- package/dist/KeyringClient.d.mts.map +0 -1
- package/dist/KeyringClient.mjs +0 -120
- package/dist/KeyringClient.mjs.map +0 -1
- package/dist/KeyringSnapRpcClient.cjs +0 -68
- package/dist/KeyringSnapRpcClient.cjs.map +0 -1
- package/dist/KeyringSnapRpcClient.d.cts +0 -40
- package/dist/KeyringSnapRpcClient.d.cts.map +0 -1
- package/dist/KeyringSnapRpcClient.d.mts +0 -40
- package/dist/KeyringSnapRpcClient.d.mts.map +0 -1
- package/dist/KeyringSnapRpcClient.mjs +0 -63
- package/dist/KeyringSnapRpcClient.mjs.map +0 -1
- package/dist/internal/api.cjs.map +0 -1
- package/dist/internal/api.d.cts.map +0 -1
- package/dist/internal/api.d.mts.map +0 -1
- package/dist/internal/api.mjs.map +0 -1
- package/dist/internal/eth/EthKeyring.cjs +0 -3
- package/dist/internal/eth/EthKeyring.cjs.map +0 -1
- package/dist/internal/eth/EthKeyring.d.cts +0 -34
- package/dist/internal/eth/EthKeyring.d.cts.map +0 -1
- package/dist/internal/eth/EthKeyring.d.mts +0 -34
- package/dist/internal/eth/EthKeyring.d.mts.map +0 -1
- package/dist/internal/eth/EthKeyring.mjs +0 -2
- package/dist/internal/eth/EthKeyring.mjs.map +0 -1
- package/dist/internal/eth/index.cjs +0 -3
- package/dist/internal/eth/index.cjs.map +0 -1
- package/dist/internal/eth/index.d.cts +0 -2
- package/dist/internal/eth/index.d.cts.map +0 -1
- package/dist/internal/eth/index.d.mts +0 -2
- package/dist/internal/eth/index.d.mts.map +0 -1
- package/dist/internal/eth/index.mjs +0 -2
- package/dist/internal/eth/index.mjs.map +0 -1
- package/dist/internal/events.cjs +0 -72
- package/dist/internal/events.cjs.map +0 -1
- package/dist/internal/events.d.cts +0 -162
- package/dist/internal/events.d.cts.map +0 -1
- package/dist/internal/events.d.mts +0 -162
- package/dist/internal/events.d.mts.map +0 -1
- package/dist/internal/events.mjs +0 -69
- package/dist/internal/events.mjs.map +0 -1
- package/dist/internal/index.cjs +0 -21
- package/dist/internal/index.cjs.map +0 -1
- package/dist/internal/index.d.cts +0 -6
- package/dist/internal/index.d.cts.map +0 -1
- package/dist/internal/index.d.mts +0 -6
- package/dist/internal/index.d.mts.map +0 -1
- package/dist/internal/index.mjs +0 -5
- package/dist/internal/index.mjs.map +0 -1
- package/dist/internal/rpc.cjs +0 -33
- package/dist/internal/rpc.cjs.map +0 -1
- package/dist/internal/rpc.d.cts +0 -26
- package/dist/internal/rpc.d.cts.map +0 -1
- package/dist/internal/rpc.d.mts +0 -26
- package/dist/internal/rpc.d.mts.map +0 -1
- package/dist/internal/rpc.mjs +0 -29
- package/dist/internal/rpc.mjs.map +0 -1
- package/dist/internal/types.cjs +0 -52
- package/dist/internal/types.cjs.map +0 -1
- package/dist/internal/types.d.cts +0 -392
- package/dist/internal/types.d.cts.map +0 -1
- package/dist/internal/types.d.mts +0 -392
- package/dist/internal/types.d.mts.map +0 -1
- package/dist/internal/types.mjs +0 -49
- package/dist/internal/types.mjs.map +0 -1
- package/dist/rpc-handler.cjs +0 -136
- package/dist/rpc-handler.cjs.map +0 -1
- package/dist/rpc-handler.d.cts +0 -30
- package/dist/rpc-handler.d.cts.map +0 -1
- package/dist/rpc-handler.d.mts +0 -30
- package/dist/rpc-handler.d.mts.map +0 -1
- package/dist/rpc-handler.mjs +0 -131
- package/dist/rpc-handler.mjs.map +0 -1
- package/dist/snap-utils.cjs +0 -20
- package/dist/snap-utils.cjs.map +0 -1
- package/dist/snap-utils.d.cts +0 -12
- package/dist/snap-utils.d.cts.map +0 -1
- package/dist/snap-utils.d.mts +0 -12
- package/dist/snap-utils.d.mts.map +0 -1
- package/dist/snap-utils.mjs +0 -17
- package/dist/snap-utils.mjs.map +0 -1
- package/dist/superstruct.cjs +0 -80
- package/dist/superstruct.cjs.map +0 -1
- package/dist/superstruct.d.cts +0 -84
- package/dist/superstruct.d.cts.map +0 -1
- package/dist/superstruct.d.mts +0 -84
- package/dist/superstruct.d.mts.map +0 -1
- package/dist/superstruct.mjs +0 -74
- package/dist/superstruct.mjs.map +0 -1
- package/dist/utils/index.cjs +0 -19
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.d.cts +0 -3
- package/dist/utils/index.d.cts.map +0 -1
- package/dist/utils/index.d.mts +0 -3
- package/dist/utils/index.d.mts.map +0 -1
- package/dist/utils/index.mjs +0 -3
- package/dist/utils/index.mjs.map +0 -1
- package/dist/utils/types.cjs +0 -29
- package/dist/utils/types.cjs.map +0 -1
- package/dist/utils/types.d.cts +0 -18
- package/dist/utils/types.d.cts.map +0 -1
- package/dist/utils/types.d.mts +0 -18
- package/dist/utils/types.d.mts.map +0 -1
- package/dist/utils/types.mjs +0 -26
- package/dist/utils/types.mjs.map +0 -1
- package/dist/utils/typing.cjs +0 -20
- package/dist/utils/typing.cjs.map +0 -1
- package/dist/utils/typing.d.cts +0 -33
- package/dist/utils/typing.d.cts.map +0 -1
- package/dist/utils/typing.d.mts +0 -33
- package/dist/utils/typing.d.mts.map +0 -1
- package/dist/utils/typing.mjs +0 -17
- package/dist/utils/typing.mjs.map +0 -1
@@ -0,0 +1,773 @@
|
|
1
|
+
import type { InferEquals } from "@metamask/keyring-utils";
|
2
|
+
import type { Infer } from "@metamask/superstruct";
|
3
|
+
import type { Paginated } from "./pagination.cjs";
|
4
|
+
/**
|
5
|
+
* Fee types.
|
6
|
+
*/
|
7
|
+
export declare enum FeeType {
|
8
|
+
/**
|
9
|
+
* Base fee. It is the minimum fee required to include a transaction in the
|
10
|
+
* blockchain.
|
11
|
+
*
|
12
|
+
* For non-confirmed transactions, it must be the maximum base fee. For
|
13
|
+
* confirmed transactions, it must be the actual base fee paid.
|
14
|
+
*/
|
15
|
+
Base = "base",
|
16
|
+
/**
|
17
|
+
* Priority fee. It is an optional fee used to prioritize the transaction.
|
18
|
+
*
|
19
|
+
* For non-confirmed transactions, it must be the maximum priority fee. For
|
20
|
+
* confirmed transactions, it must be the actual priority fee paid.
|
21
|
+
*/
|
22
|
+
Priority = "priority"
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* Transaction statuses.
|
26
|
+
*/
|
27
|
+
export declare enum TransactionStatus {
|
28
|
+
/**
|
29
|
+
* The transaction has been submitted but is not yet in the
|
30
|
+
* blockchain. For example, it can be in the mempool.
|
31
|
+
*/
|
32
|
+
Submitted = "submitted",
|
33
|
+
/**
|
34
|
+
* The transaction is in the blockchain but has not been
|
35
|
+
* confirmed yet.
|
36
|
+
*/
|
37
|
+
Unconfirmed = "unconfirmed",
|
38
|
+
/**
|
39
|
+
* The transaction has been confirmed.
|
40
|
+
*/
|
41
|
+
Confirmed = "confirmed",
|
42
|
+
/**
|
43
|
+
* The transaction has failed. For example, it has been reverted.
|
44
|
+
*/
|
45
|
+
Failed = "failed"
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* Transaction types.
|
49
|
+
*/
|
50
|
+
export declare enum TransactionType {
|
51
|
+
/**
|
52
|
+
* The transaction was originated by the account. If the transaction
|
53
|
+
* has a change output that goes back to the same account, it must be tagged
|
54
|
+
* as a send transaction.
|
55
|
+
*/
|
56
|
+
Send = "send",
|
57
|
+
/**
|
58
|
+
* The transaction was received by the account, but originated by
|
59
|
+
* another account.
|
60
|
+
*/
|
61
|
+
Receive = "receive"
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* This struct represents a transaction event.
|
65
|
+
*/
|
66
|
+
export declare const TransactionEventStruct: import("@metamask/superstruct").Struct<{
|
67
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
68
|
+
timestamp: number | null;
|
69
|
+
}, {
|
70
|
+
/**
|
71
|
+
* New status of the transaction.
|
72
|
+
*/
|
73
|
+
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
|
74
|
+
submitted: "submitted";
|
75
|
+
unconfirmed: "unconfirmed";
|
76
|
+
confirmed: "confirmed";
|
77
|
+
failed: "failed";
|
78
|
+
}>;
|
79
|
+
/**
|
80
|
+
* UNIX timestamp of when the event occurred.
|
81
|
+
*/
|
82
|
+
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
|
83
|
+
}>;
|
84
|
+
/**
|
85
|
+
* This struct represents a blockchain transaction.
|
86
|
+
*
|
87
|
+
* @example
|
88
|
+
* ```ts
|
89
|
+
* const tx = {
|
90
|
+
* id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',
|
91
|
+
* chain: 'bip122:000000000019d6689c085ae165831e93',
|
92
|
+
* account: 'b9beb861-9761-4b97-89ce-d992be5f34da',
|
93
|
+
* status: 'confirmed',
|
94
|
+
* timestamp: 1716367781,
|
95
|
+
* type: 'send',
|
96
|
+
* from: [
|
97
|
+
* {
|
98
|
+
* address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',
|
99
|
+
* asset: {
|
100
|
+
* fungible: true,
|
101
|
+
* type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
|
102
|
+
* unit: 'BTC',
|
103
|
+
* amount: '0.1',
|
104
|
+
* },
|
105
|
+
* },
|
106
|
+
* ],
|
107
|
+
* to: [
|
108
|
+
* {
|
109
|
+
* address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',
|
110
|
+
* asset: {
|
111
|
+
* fungible: true,
|
112
|
+
* type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
|
113
|
+
* unit: 'BTC',
|
114
|
+
* amount: '0.1',
|
115
|
+
* },
|
116
|
+
* },
|
117
|
+
* {
|
118
|
+
* address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',
|
119
|
+
* asset: {
|
120
|
+
* fungible: true,
|
121
|
+
* type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
|
122
|
+
* unit: 'BTC',
|
123
|
+
* amount: '0.1',
|
124
|
+
* },
|
125
|
+
* },
|
126
|
+
* ],
|
127
|
+
* fees: [
|
128
|
+
* {
|
129
|
+
* type: 'priority',
|
130
|
+
* asset: {
|
131
|
+
* fungible: true,
|
132
|
+
* type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
|
133
|
+
* unit: 'BTC',
|
134
|
+
* amount: '0.1',
|
135
|
+
* },
|
136
|
+
* },
|
137
|
+
* ],
|
138
|
+
* };
|
139
|
+
* ```
|
140
|
+
*/
|
141
|
+
export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
142
|
+
type: "send" | "receive";
|
143
|
+
id: string;
|
144
|
+
from: {
|
145
|
+
address: string;
|
146
|
+
asset: {
|
147
|
+
unit: string;
|
148
|
+
type: `${string}:${string}/${string}:${string}`;
|
149
|
+
fungible: true;
|
150
|
+
amount: string;
|
151
|
+
} | {
|
152
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
153
|
+
fungible: false;
|
154
|
+
} | null;
|
155
|
+
}[];
|
156
|
+
events: {
|
157
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
158
|
+
timestamp: number | null;
|
159
|
+
}[];
|
160
|
+
chain: `${string}:${string}`;
|
161
|
+
account: string;
|
162
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
163
|
+
timestamp: number | null;
|
164
|
+
to: {
|
165
|
+
address: string;
|
166
|
+
asset: {
|
167
|
+
unit: string;
|
168
|
+
type: `${string}:${string}/${string}:${string}`;
|
169
|
+
fungible: true;
|
170
|
+
amount: string;
|
171
|
+
} | {
|
172
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
173
|
+
fungible: false;
|
174
|
+
} | null;
|
175
|
+
}[];
|
176
|
+
fees: {
|
177
|
+
type: "base" | "priority";
|
178
|
+
asset: {
|
179
|
+
unit: string;
|
180
|
+
type: `${string}:${string}/${string}:${string}`;
|
181
|
+
fungible: true;
|
182
|
+
amount: string;
|
183
|
+
} | {
|
184
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
185
|
+
fungible: false;
|
186
|
+
};
|
187
|
+
}[];
|
188
|
+
}, {
|
189
|
+
/**
|
190
|
+
* Chain-specific transaction ID.
|
191
|
+
*/
|
192
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
193
|
+
/**
|
194
|
+
* Chain ID (CAIP-2).
|
195
|
+
*/
|
196
|
+
chain: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
197
|
+
/**
|
198
|
+
* Account ID (UUIDv4).
|
199
|
+
*/
|
200
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
201
|
+
/**
|
202
|
+
* Transaction status {@see TransactionStatus}.
|
203
|
+
*/
|
204
|
+
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
|
205
|
+
submitted: "submitted";
|
206
|
+
unconfirmed: "unconfirmed";
|
207
|
+
confirmed: "confirmed";
|
208
|
+
failed: "failed";
|
209
|
+
}>;
|
210
|
+
/**
|
211
|
+
* UNIX timestamp of when the transaction was added to the blockchain. The
|
212
|
+
* timestamp can be null if the transaction has not been included in the
|
213
|
+
* blockchain yet.
|
214
|
+
*/
|
215
|
+
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
|
216
|
+
/**
|
217
|
+
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
218
|
+
* details on the UI.
|
219
|
+
*/
|
220
|
+
type: import("@metamask/superstruct").Struct<"send" | "receive", {
|
221
|
+
send: "send";
|
222
|
+
receive: "receive";
|
223
|
+
}>;
|
224
|
+
/**
|
225
|
+
* Transaction sender addresses and amounts.
|
226
|
+
*/
|
227
|
+
from: import("@metamask/superstruct").Struct<{
|
228
|
+
address: string;
|
229
|
+
asset: {
|
230
|
+
unit: string;
|
231
|
+
type: `${string}:${string}/${string}:${string}`;
|
232
|
+
fungible: true;
|
233
|
+
amount: string;
|
234
|
+
} | {
|
235
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
236
|
+
fungible: false;
|
237
|
+
} | null;
|
238
|
+
}[], import("@metamask/superstruct").Struct<{
|
239
|
+
address: string;
|
240
|
+
asset: {
|
241
|
+
unit: string;
|
242
|
+
type: `${string}:${string}/${string}:${string}`;
|
243
|
+
fungible: true;
|
244
|
+
amount: string;
|
245
|
+
} | {
|
246
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
247
|
+
fungible: false;
|
248
|
+
} | null;
|
249
|
+
}, {
|
250
|
+
/**
|
251
|
+
* Participant address.
|
252
|
+
*/
|
253
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
254
|
+
/**
|
255
|
+
* Asset being transferred.
|
256
|
+
*/
|
257
|
+
asset: import("@metamask/superstruct").Struct<{
|
258
|
+
unit: string;
|
259
|
+
type: `${string}:${string}/${string}:${string}`;
|
260
|
+
fungible: true;
|
261
|
+
amount: string;
|
262
|
+
} | {
|
263
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
264
|
+
fungible: false;
|
265
|
+
} | null, null>;
|
266
|
+
}>>;
|
267
|
+
/**
|
268
|
+
* Transaction receiver addresses and amounts.
|
269
|
+
*/
|
270
|
+
to: import("@metamask/superstruct").Struct<{
|
271
|
+
address: string;
|
272
|
+
asset: {
|
273
|
+
unit: string;
|
274
|
+
type: `${string}:${string}/${string}:${string}`;
|
275
|
+
fungible: true;
|
276
|
+
amount: string;
|
277
|
+
} | {
|
278
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
279
|
+
fungible: false;
|
280
|
+
} | null;
|
281
|
+
}[], import("@metamask/superstruct").Struct<{
|
282
|
+
address: string;
|
283
|
+
asset: {
|
284
|
+
unit: string;
|
285
|
+
type: `${string}:${string}/${string}:${string}`;
|
286
|
+
fungible: true;
|
287
|
+
amount: string;
|
288
|
+
} | {
|
289
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
290
|
+
fungible: false;
|
291
|
+
} | null;
|
292
|
+
}, {
|
293
|
+
/**
|
294
|
+
* Participant address.
|
295
|
+
*/
|
296
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
297
|
+
/**
|
298
|
+
* Asset being transferred.
|
299
|
+
*/
|
300
|
+
asset: import("@metamask/superstruct").Struct<{
|
301
|
+
unit: string;
|
302
|
+
type: `${string}:${string}/${string}:${string}`;
|
303
|
+
fungible: true;
|
304
|
+
amount: string;
|
305
|
+
} | {
|
306
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
307
|
+
fungible: false;
|
308
|
+
} | null, null>;
|
309
|
+
}>>;
|
310
|
+
/**
|
311
|
+
* Total transaction fee.
|
312
|
+
*/
|
313
|
+
fees: import("@metamask/superstruct").Struct<{
|
314
|
+
type: "base" | "priority";
|
315
|
+
asset: {
|
316
|
+
unit: string;
|
317
|
+
type: `${string}:${string}/${string}:${string}`;
|
318
|
+
fungible: true;
|
319
|
+
amount: string;
|
320
|
+
} | {
|
321
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
322
|
+
fungible: false;
|
323
|
+
};
|
324
|
+
}[], import("@metamask/superstruct").Struct<{
|
325
|
+
type: "base" | "priority";
|
326
|
+
asset: {
|
327
|
+
unit: string;
|
328
|
+
type: `${string}:${string}/${string}:${string}`;
|
329
|
+
fungible: true;
|
330
|
+
amount: string;
|
331
|
+
} | {
|
332
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
333
|
+
fungible: false;
|
334
|
+
};
|
335
|
+
}, {
|
336
|
+
/**
|
337
|
+
* Fee type {@see FeeType}.
|
338
|
+
*/
|
339
|
+
type: import("@metamask/superstruct").Struct<"base" | "priority", {
|
340
|
+
base: "base";
|
341
|
+
priority: "priority";
|
342
|
+
}>;
|
343
|
+
/**
|
344
|
+
* Asset used to pay for the fee.
|
345
|
+
*/
|
346
|
+
asset: import("@metamask/superstruct").Struct<{
|
347
|
+
unit: string;
|
348
|
+
type: `${string}:${string}/${string}:${string}`;
|
349
|
+
fungible: true;
|
350
|
+
amount: string;
|
351
|
+
} | {
|
352
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
353
|
+
fungible: false;
|
354
|
+
}, null>;
|
355
|
+
}>>;
|
356
|
+
/**
|
357
|
+
* List of events related to the transaction {@see TransactionEventStruct}.
|
358
|
+
*
|
359
|
+
* The events are tracked in a best-effort basis and may not be available for
|
360
|
+
* all transactions.
|
361
|
+
*/
|
362
|
+
events: import("@metamask/superstruct").Struct<{
|
363
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
364
|
+
timestamp: number | null;
|
365
|
+
}[], import("@metamask/superstruct").Struct<{
|
366
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
367
|
+
timestamp: number | null;
|
368
|
+
}, {
|
369
|
+
/**
|
370
|
+
* New status of the transaction.
|
371
|
+
*/
|
372
|
+
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
|
373
|
+
submitted: "submitted";
|
374
|
+
unconfirmed: "unconfirmed";
|
375
|
+
confirmed: "confirmed";
|
376
|
+
failed: "failed";
|
377
|
+
}>;
|
378
|
+
/**
|
379
|
+
* UNIX timestamp of when the event occurred.
|
380
|
+
*/
|
381
|
+
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
|
382
|
+
}>>;
|
383
|
+
}>;
|
384
|
+
/**
|
385
|
+
* Transaction object.
|
386
|
+
*
|
387
|
+
* See {@link TransactionStruct}.
|
388
|
+
*/
|
389
|
+
export type Transaction = Infer<typeof TransactionStruct>;
|
390
|
+
/**
|
391
|
+
* This struct represents a page of transactions.
|
392
|
+
*
|
393
|
+
* @example
|
394
|
+
* ```ts
|
395
|
+
* {
|
396
|
+
* data: [
|
397
|
+
* {
|
398
|
+
* // Transaction object
|
399
|
+
* }
|
400
|
+
* ],
|
401
|
+
* next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
|
402
|
+
* }
|
403
|
+
* ```
|
404
|
+
*
|
405
|
+
* @example
|
406
|
+
* ```ts
|
407
|
+
* {
|
408
|
+
* data: [
|
409
|
+
* {
|
410
|
+
* // Transaction object
|
411
|
+
* }
|
412
|
+
* ],
|
413
|
+
* next: null, // No more results
|
414
|
+
* }**
|
415
|
+
* ```
|
416
|
+
*/
|
417
|
+
export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
|
418
|
+
data: {
|
419
|
+
type: "send" | "receive";
|
420
|
+
id: string;
|
421
|
+
from: {
|
422
|
+
address: string;
|
423
|
+
asset: {
|
424
|
+
unit: string;
|
425
|
+
type: `${string}:${string}/${string}:${string}`;
|
426
|
+
fungible: true;
|
427
|
+
amount: string;
|
428
|
+
} | {
|
429
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
430
|
+
fungible: false;
|
431
|
+
} | null;
|
432
|
+
}[];
|
433
|
+
events: {
|
434
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
435
|
+
timestamp: number | null;
|
436
|
+
}[];
|
437
|
+
chain: `${string}:${string}`;
|
438
|
+
account: string;
|
439
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
440
|
+
timestamp: number | null;
|
441
|
+
to: {
|
442
|
+
address: string;
|
443
|
+
asset: {
|
444
|
+
unit: string;
|
445
|
+
type: `${string}:${string}/${string}:${string}`;
|
446
|
+
fungible: true;
|
447
|
+
amount: string;
|
448
|
+
} | {
|
449
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
450
|
+
fungible: false;
|
451
|
+
} | null;
|
452
|
+
}[];
|
453
|
+
fees: {
|
454
|
+
type: "base" | "priority";
|
455
|
+
asset: {
|
456
|
+
unit: string;
|
457
|
+
type: `${string}:${string}/${string}:${string}`;
|
458
|
+
fungible: true;
|
459
|
+
amount: string;
|
460
|
+
} | {
|
461
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
462
|
+
fungible: false;
|
463
|
+
};
|
464
|
+
}[];
|
465
|
+
}[];
|
466
|
+
next: string | null;
|
467
|
+
}, {
|
468
|
+
/**
|
469
|
+
* List of transactions.
|
470
|
+
*/
|
471
|
+
data: import("@metamask/superstruct").Struct<{
|
472
|
+
type: "send" | "receive";
|
473
|
+
id: string;
|
474
|
+
from: {
|
475
|
+
address: string;
|
476
|
+
asset: {
|
477
|
+
unit: string;
|
478
|
+
type: `${string}:${string}/${string}:${string}`;
|
479
|
+
fungible: true;
|
480
|
+
amount: string;
|
481
|
+
} | {
|
482
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
483
|
+
fungible: false;
|
484
|
+
} | null;
|
485
|
+
}[];
|
486
|
+
events: {
|
487
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
488
|
+
timestamp: number | null;
|
489
|
+
}[];
|
490
|
+
chain: `${string}:${string}`;
|
491
|
+
account: string;
|
492
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
493
|
+
timestamp: number | null;
|
494
|
+
to: {
|
495
|
+
address: string;
|
496
|
+
asset: {
|
497
|
+
unit: string;
|
498
|
+
type: `${string}:${string}/${string}:${string}`;
|
499
|
+
fungible: true;
|
500
|
+
amount: string;
|
501
|
+
} | {
|
502
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
503
|
+
fungible: false;
|
504
|
+
} | null;
|
505
|
+
}[];
|
506
|
+
fees: {
|
507
|
+
type: "base" | "priority";
|
508
|
+
asset: {
|
509
|
+
unit: string;
|
510
|
+
type: `${string}:${string}/${string}:${string}`;
|
511
|
+
fungible: true;
|
512
|
+
amount: string;
|
513
|
+
} | {
|
514
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
515
|
+
fungible: false;
|
516
|
+
};
|
517
|
+
}[];
|
518
|
+
}[], import("@metamask/superstruct").Struct<{
|
519
|
+
type: "send" | "receive";
|
520
|
+
id: string;
|
521
|
+
from: {
|
522
|
+
address: string;
|
523
|
+
asset: {
|
524
|
+
unit: string;
|
525
|
+
type: `${string}:${string}/${string}:${string}`;
|
526
|
+
fungible: true;
|
527
|
+
amount: string;
|
528
|
+
} | {
|
529
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
530
|
+
fungible: false;
|
531
|
+
} | null;
|
532
|
+
}[];
|
533
|
+
events: {
|
534
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
535
|
+
timestamp: number | null;
|
536
|
+
}[];
|
537
|
+
chain: `${string}:${string}`;
|
538
|
+
account: string;
|
539
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
540
|
+
timestamp: number | null;
|
541
|
+
to: {
|
542
|
+
address: string;
|
543
|
+
asset: {
|
544
|
+
unit: string;
|
545
|
+
type: `${string}:${string}/${string}:${string}`;
|
546
|
+
fungible: true;
|
547
|
+
amount: string;
|
548
|
+
} | {
|
549
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
550
|
+
fungible: false;
|
551
|
+
} | null;
|
552
|
+
}[];
|
553
|
+
fees: {
|
554
|
+
type: "base" | "priority";
|
555
|
+
asset: {
|
556
|
+
unit: string;
|
557
|
+
type: `${string}:${string}/${string}:${string}`;
|
558
|
+
fungible: true;
|
559
|
+
amount: string;
|
560
|
+
} | {
|
561
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
562
|
+
fungible: false;
|
563
|
+
};
|
564
|
+
}[];
|
565
|
+
}, {
|
566
|
+
/**
|
567
|
+
* Chain-specific transaction ID.
|
568
|
+
*/
|
569
|
+
id: import("@metamask/superstruct").Struct<string, null>;
|
570
|
+
/**
|
571
|
+
* Chain ID (CAIP-2).
|
572
|
+
*/
|
573
|
+
chain: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
574
|
+
/**
|
575
|
+
* Account ID (UUIDv4).
|
576
|
+
*/
|
577
|
+
account: import("@metamask/superstruct").Struct<string, null>;
|
578
|
+
/**
|
579
|
+
* Transaction status {@see TransactionStatus}.
|
580
|
+
*/
|
581
|
+
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
|
582
|
+
submitted: "submitted";
|
583
|
+
unconfirmed: "unconfirmed";
|
584
|
+
confirmed: "confirmed";
|
585
|
+
failed: "failed";
|
586
|
+
}>;
|
587
|
+
/**
|
588
|
+
* UNIX timestamp of when the transaction was added to the blockchain. The
|
589
|
+
* timestamp can be null if the transaction has not been included in the
|
590
|
+
* blockchain yet.
|
591
|
+
*/
|
592
|
+
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
|
593
|
+
/**
|
594
|
+
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
595
|
+
* details on the UI.
|
596
|
+
*/
|
597
|
+
type: import("@metamask/superstruct").Struct<"send" | "receive", {
|
598
|
+
send: "send";
|
599
|
+
receive: "receive";
|
600
|
+
}>;
|
601
|
+
/**
|
602
|
+
* Transaction sender addresses and amounts.
|
603
|
+
*/
|
604
|
+
from: import("@metamask/superstruct").Struct<{
|
605
|
+
address: string;
|
606
|
+
asset: {
|
607
|
+
unit: string;
|
608
|
+
type: `${string}:${string}/${string}:${string}`;
|
609
|
+
fungible: true;
|
610
|
+
amount: string;
|
611
|
+
} | {
|
612
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
613
|
+
fungible: false;
|
614
|
+
} | null;
|
615
|
+
}[], import("@metamask/superstruct").Struct<{
|
616
|
+
address: string;
|
617
|
+
asset: {
|
618
|
+
unit: string;
|
619
|
+
type: `${string}:${string}/${string}:${string}`;
|
620
|
+
fungible: true;
|
621
|
+
amount: string;
|
622
|
+
} | {
|
623
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
624
|
+
fungible: false;
|
625
|
+
} | null;
|
626
|
+
}, {
|
627
|
+
/**
|
628
|
+
* Participant address.
|
629
|
+
*/
|
630
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
631
|
+
/**
|
632
|
+
* Asset being transferred.
|
633
|
+
*/
|
634
|
+
asset: import("@metamask/superstruct").Struct<{
|
635
|
+
unit: string;
|
636
|
+
type: `${string}:${string}/${string}:${string}`;
|
637
|
+
fungible: true;
|
638
|
+
amount: string;
|
639
|
+
} | {
|
640
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
641
|
+
fungible: false;
|
642
|
+
} | null, null>;
|
643
|
+
}>>;
|
644
|
+
/**
|
645
|
+
* Transaction receiver addresses and amounts.
|
646
|
+
*/
|
647
|
+
to: import("@metamask/superstruct").Struct<{
|
648
|
+
address: string;
|
649
|
+
asset: {
|
650
|
+
unit: string;
|
651
|
+
type: `${string}:${string}/${string}:${string}`;
|
652
|
+
fungible: true;
|
653
|
+
amount: string;
|
654
|
+
} | {
|
655
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
656
|
+
fungible: false;
|
657
|
+
} | null;
|
658
|
+
}[], import("@metamask/superstruct").Struct<{
|
659
|
+
address: string;
|
660
|
+
asset: {
|
661
|
+
unit: string;
|
662
|
+
type: `${string}:${string}/${string}:${string}`;
|
663
|
+
fungible: true;
|
664
|
+
amount: string;
|
665
|
+
} | {
|
666
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
667
|
+
fungible: false;
|
668
|
+
} | null;
|
669
|
+
}, {
|
670
|
+
/**
|
671
|
+
* Participant address.
|
672
|
+
*/
|
673
|
+
address: import("@metamask/superstruct").Struct<string, null>;
|
674
|
+
/**
|
675
|
+
* Asset being transferred.
|
676
|
+
*/
|
677
|
+
asset: import("@metamask/superstruct").Struct<{
|
678
|
+
unit: string;
|
679
|
+
type: `${string}:${string}/${string}:${string}`;
|
680
|
+
fungible: true;
|
681
|
+
amount: string;
|
682
|
+
} | {
|
683
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
684
|
+
fungible: false;
|
685
|
+
} | null, null>;
|
686
|
+
}>>;
|
687
|
+
/**
|
688
|
+
* Total transaction fee.
|
689
|
+
*/
|
690
|
+
fees: import("@metamask/superstruct").Struct<{
|
691
|
+
type: "base" | "priority";
|
692
|
+
asset: {
|
693
|
+
unit: string;
|
694
|
+
type: `${string}:${string}/${string}:${string}`;
|
695
|
+
fungible: true;
|
696
|
+
amount: string;
|
697
|
+
} | {
|
698
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
699
|
+
fungible: false;
|
700
|
+
};
|
701
|
+
}[], import("@metamask/superstruct").Struct<{
|
702
|
+
type: "base" | "priority";
|
703
|
+
asset: {
|
704
|
+
unit: string;
|
705
|
+
type: `${string}:${string}/${string}:${string}`;
|
706
|
+
fungible: true;
|
707
|
+
amount: string;
|
708
|
+
} | {
|
709
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
710
|
+
fungible: false;
|
711
|
+
};
|
712
|
+
}, {
|
713
|
+
/**
|
714
|
+
* Fee type {@see FeeType}.
|
715
|
+
*/
|
716
|
+
type: import("@metamask/superstruct").Struct<"base" | "priority", {
|
717
|
+
base: "base";
|
718
|
+
priority: "priority";
|
719
|
+
}>;
|
720
|
+
/**
|
721
|
+
* Asset used to pay for the fee.
|
722
|
+
*/
|
723
|
+
asset: import("@metamask/superstruct").Struct<{
|
724
|
+
unit: string;
|
725
|
+
type: `${string}:${string}/${string}:${string}`;
|
726
|
+
fungible: true;
|
727
|
+
amount: string;
|
728
|
+
} | {
|
729
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
730
|
+
fungible: false;
|
731
|
+
}, null>;
|
732
|
+
}>>;
|
733
|
+
/**
|
734
|
+
* List of events related to the transaction {@see TransactionEventStruct}.
|
735
|
+
*
|
736
|
+
* The events are tracked in a best-effort basis and may not be available for
|
737
|
+
* all transactions.
|
738
|
+
*/
|
739
|
+
events: import("@metamask/superstruct").Struct<{
|
740
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
741
|
+
timestamp: number | null;
|
742
|
+
}[], import("@metamask/superstruct").Struct<{
|
743
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
744
|
+
timestamp: number | null;
|
745
|
+
}, {
|
746
|
+
/**
|
747
|
+
* New status of the transaction.
|
748
|
+
*/
|
749
|
+
status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
|
750
|
+
submitted: "submitted";
|
751
|
+
unconfirmed: "unconfirmed";
|
752
|
+
confirmed: "confirmed";
|
753
|
+
failed: "failed";
|
754
|
+
}>;
|
755
|
+
/**
|
756
|
+
* UNIX timestamp of when the event occurred.
|
757
|
+
*/
|
758
|
+
timestamp: import("@metamask/superstruct").Struct<number | null, null>;
|
759
|
+
}>>;
|
760
|
+
}>>;
|
761
|
+
/**
|
762
|
+
* Next cursor to iterate over the results. If null, there are no more
|
763
|
+
* results.
|
764
|
+
*/
|
765
|
+
next: import("@metamask/superstruct").Struct<string | null, null>;
|
766
|
+
}>;
|
767
|
+
/**
|
768
|
+
* Transactions page object.
|
769
|
+
*
|
770
|
+
* See {@link TransactionsPageStruct}.
|
771
|
+
*/
|
772
|
+
export type TransactionsPage = InferEquals<typeof TransactionsPageStruct, Paginated<Transaction>>;
|
773
|
+
//# sourceMappingURL=transaction.d.cts.map
|