@avalabs/vm-module-types 0.12.1 → 1.2.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/balance.d.cts +2 -1
- package/dist/balance.d.ts +2 -1
- package/dist/chunk-2DSAT5RW.js +3 -0
- package/dist/{chunk-YB5EN6FL.cjs → chunk-ATL7CLLW.cjs} +1 -1
- package/dist/chunk-IQHOBS5Y.cjs +9 -0
- package/dist/chunk-IQHOBS5Y.cjs.map +1 -0
- package/dist/{chunk-A4YEBDMG.js → chunk-RINP3JFP.js} +2 -2
- package/dist/chunk-RINP3JFP.js.map +1 -0
- package/dist/{chunk-74SNNWSF.cjs → chunk-SYE3TX4L.cjs} +2 -2
- package/dist/chunk-SYE3TX4L.cjs.map +1 -0
- package/dist/chunk-T3QBBZUZ.js +5 -0
- package/dist/chunk-T3QBBZUZ.js.map +1 -0
- package/dist/coingecko.d.cts +4 -4
- package/dist/coingecko.d.ts +4 -4
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/manifest.cjs +2 -2
- package/dist/manifest.d.cts +7 -0
- package/dist/manifest.d.ts +7 -0
- package/dist/manifest.js +1 -1
- package/dist/module.cjs +1 -1
- package/dist/module.d.cts +3 -3
- package/dist/module.d.ts +3 -3
- package/dist/module.js +1 -1
- package/dist/rpc-ab7acd4d.d.ts +334 -0
- package/dist/rpc-c6776d81.d.ts +334 -0
- package/dist/rpc.cjs +4 -4
- package/dist/rpc.d.cts +7 -275
- package/dist/rpc.d.ts +7 -275
- package/dist/rpc.js +1 -1
- package/dist/transaction-simulation.d.cts +10 -27
- package/dist/transaction-simulation.d.ts +10 -27
- package/package.json +4 -3
- package/dist/chunk-5R4OCUZW.js +0 -5
- package/dist/chunk-5R4OCUZW.js.map +0 -1
- package/dist/chunk-74SNNWSF.cjs.map +0 -1
- package/dist/chunk-A4YEBDMG.js.map +0 -1
- package/dist/chunk-GF7C4PA6.js +0 -3
- package/dist/chunk-RXEAQKSD.cjs +0 -9
- package/dist/chunk-RXEAQKSD.cjs.map +0 -1
- /package/dist/{chunk-GF7C4PA6.js.map → chunk-2DSAT5RW.js.map} +0 -0
- /package/dist/{chunk-YB5EN6FL.cjs.map → chunk-ATL7CLLW.cjs.map} +0 -0
package/dist/rpc.d.cts
CHANGED
|
@@ -1,278 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import 'ethers';
|
|
2
|
+
import '@avalabs/core-wallets-sdk';
|
|
3
|
+
import './common.cjs';
|
|
4
|
+
import '@metamask/rpc-errors';
|
|
5
|
+
export { A as AddressItem, p as Alert, o as AlertDetails, n as AlertType, H as ApprovalController, w as ApprovalParams, z as ApprovalResponse, B as BaseDetailItem, I as BatchApprovalController, x as BatchApprovalParams, G as BatchApprovalResponse, q as BitcoinExecuteTxData, r as BitcoingSignTxData, u as BtcTxUpdateFn, C as CurrencyItem, D as DappInfo, i as DataItem, j as DateItem, l as DetailItem, g as DetailItemType, f as DetailSection, m as DisplayData, E as EvmTxBatchUpdateFn, t as EvmTxUpdateFn, F as FundsRecipientItem, k as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, N as NodeIDItem, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, s as SigningData_EthSendTx, v as SigningRequest, y as SigningResult, h as TextItem, T as TypedData, e as TypedDataV1 } from './rpc-c6776d81.js';
|
|
6
|
+
import './balance.cjs';
|
|
7
|
+
import 'hypersdk-client';
|
|
8
8
|
import './token.cjs';
|
|
9
9
|
import './error.cjs';
|
|
10
10
|
import '@avalabs/glacier-sdk';
|
|
11
|
-
|
|
12
|
-
declare enum RpcMethod {
|
|
13
|
-
BITCOIN_SEND_TRANSACTION = "bitcoin_sendTransaction",
|
|
14
|
-
BITCOIN_SIGN_TRANSACTION = "bitcoin_signTransaction",
|
|
15
|
-
ETH_SEND_TRANSACTION = "eth_sendTransaction",
|
|
16
|
-
SIGN_TYPED_DATA_V3 = "eth_signTypedData_v3",
|
|
17
|
-
SIGN_TYPED_DATA_V4 = "eth_signTypedData_v4",
|
|
18
|
-
SIGN_TYPED_DATA_V1 = "eth_signTypedData_v1",
|
|
19
|
-
SIGN_TYPED_DATA = "eth_signTypedData",
|
|
20
|
-
PERSONAL_SIGN = "personal_sign",
|
|
21
|
-
ETH_SIGN = "eth_sign",
|
|
22
|
-
AVALANCHE_SIGN_MESSAGE = "avalanche_signMessage",
|
|
23
|
-
AVALANCHE_SEND_TRANSACTION = "avalanche_sendTransaction",
|
|
24
|
-
AVALANCHE_SIGN_TRANSACTION = "avalanche_signTransaction",
|
|
25
|
-
HVM_SIGN_TRANSACTION = "hvm_signTransaction"
|
|
26
|
-
}
|
|
27
|
-
type DappInfo = {
|
|
28
|
-
name: string;
|
|
29
|
-
url: string;
|
|
30
|
-
icon: string;
|
|
31
|
-
};
|
|
32
|
-
type RpcRequest = {
|
|
33
|
-
requestId: string;
|
|
34
|
-
sessionId: string;
|
|
35
|
-
method: RpcMethod;
|
|
36
|
-
chainId: Caip2ChainId;
|
|
37
|
-
params: unknown;
|
|
38
|
-
dappInfo: DappInfo;
|
|
39
|
-
context?: Record<string, unknown>;
|
|
40
|
-
};
|
|
41
|
-
type RpcError = JsonRpcError<OptionalDataWithOptionalCause> | EthereumProviderError<OptionalDataWithOptionalCause>;
|
|
42
|
-
type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> = {
|
|
43
|
-
result: R;
|
|
44
|
-
} | {
|
|
45
|
-
error: E;
|
|
46
|
-
};
|
|
47
|
-
interface MessageTypeProperty {
|
|
48
|
-
name: string;
|
|
49
|
-
type: string;
|
|
50
|
-
}
|
|
51
|
-
interface MessageTypes {
|
|
52
|
-
EIP712Domain: MessageTypeProperty[];
|
|
53
|
-
[additionalProperties: string]: MessageTypeProperty[];
|
|
54
|
-
}
|
|
55
|
-
interface TypedData<T extends MessageTypes> {
|
|
56
|
-
types: T;
|
|
57
|
-
primaryType: keyof T;
|
|
58
|
-
domain: Record<string, unknown>;
|
|
59
|
-
message: Record<string, unknown>;
|
|
60
|
-
}
|
|
61
|
-
type TypedDataV1 = {
|
|
62
|
-
name: string;
|
|
63
|
-
type: string;
|
|
64
|
-
value: unknown;
|
|
65
|
-
}[];
|
|
66
|
-
type DetailSection = {
|
|
67
|
-
title?: string;
|
|
68
|
-
items: DetailItem[];
|
|
69
|
-
};
|
|
70
|
-
type BaseDetailItem = {
|
|
71
|
-
label: string;
|
|
72
|
-
};
|
|
73
|
-
declare enum DetailItemType {
|
|
74
|
-
TEXT = "text",
|
|
75
|
-
ADDRESS = "address",
|
|
76
|
-
NODE_ID = "nodeID",
|
|
77
|
-
CURRENCY = "currency",
|
|
78
|
-
FUNDS_RECIPIENT = "fundsRecipient",
|
|
79
|
-
DATA = "data",
|
|
80
|
-
DATE = "date",
|
|
81
|
-
LINK = "link"
|
|
82
|
-
}
|
|
83
|
-
type FundsRecipientItem = BaseDetailItem & {
|
|
84
|
-
type: DetailItemType.FUNDS_RECIPIENT;
|
|
85
|
-
amount: bigint;
|
|
86
|
-
maxDecimals: number;
|
|
87
|
-
symbol: string;
|
|
88
|
-
};
|
|
89
|
-
type TextItem = BaseDetailItem & {
|
|
90
|
-
type: DetailItemType.TEXT;
|
|
91
|
-
value: string;
|
|
92
|
-
alignment: 'vertical' | 'horizontal';
|
|
93
|
-
};
|
|
94
|
-
type AddressItem = BaseDetailItem & {
|
|
95
|
-
type: DetailItemType.ADDRESS;
|
|
96
|
-
value: string;
|
|
97
|
-
};
|
|
98
|
-
type NodeIDItem = BaseDetailItem & {
|
|
99
|
-
type: DetailItemType.NODE_ID;
|
|
100
|
-
value: string;
|
|
101
|
-
};
|
|
102
|
-
type CurrencyItem = BaseDetailItem & {
|
|
103
|
-
type: DetailItemType.CURRENCY;
|
|
104
|
-
value: bigint;
|
|
105
|
-
maxDecimals: number;
|
|
106
|
-
symbol: string;
|
|
107
|
-
};
|
|
108
|
-
type DataItem = BaseDetailItem & {
|
|
109
|
-
type: DetailItemType.DATA;
|
|
110
|
-
value: string;
|
|
111
|
-
};
|
|
112
|
-
type DateItem = BaseDetailItem & {
|
|
113
|
-
type: DetailItemType.DATE;
|
|
114
|
-
value: string;
|
|
115
|
-
};
|
|
116
|
-
type LinkItemValue = {
|
|
117
|
-
url: string;
|
|
118
|
-
name?: string;
|
|
119
|
-
icon?: string;
|
|
120
|
-
};
|
|
121
|
-
type LinkItem = BaseDetailItem & {
|
|
122
|
-
type: DetailItemType.LINK;
|
|
123
|
-
value: LinkItemValue;
|
|
124
|
-
};
|
|
125
|
-
type DetailItem = string | TextItem | AddressItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem | FundsRecipientItem;
|
|
126
|
-
type DisplayData = {
|
|
127
|
-
title: string;
|
|
128
|
-
dAppInfo?: {
|
|
129
|
-
name: string;
|
|
130
|
-
action: string;
|
|
131
|
-
logoUri?: string;
|
|
132
|
-
};
|
|
133
|
-
network: {
|
|
134
|
-
chainId: number;
|
|
135
|
-
name: string;
|
|
136
|
-
logoUri?: string;
|
|
137
|
-
};
|
|
138
|
-
account?: string;
|
|
139
|
-
details: DetailSection[];
|
|
140
|
-
networkFeeSelector?: boolean;
|
|
141
|
-
disclaimer?: string;
|
|
142
|
-
alert?: Alert;
|
|
143
|
-
balanceChange?: BalanceChange;
|
|
144
|
-
tokenApprovals?: TokenApprovals;
|
|
145
|
-
isSimulationSuccessful?: boolean;
|
|
146
|
-
};
|
|
147
|
-
declare enum AlertType {
|
|
148
|
-
WARNING = "Warning",
|
|
149
|
-
DANGER = "Danger",
|
|
150
|
-
INFO = "Info"
|
|
151
|
-
}
|
|
152
|
-
type AlertDetails = {
|
|
153
|
-
title: string;
|
|
154
|
-
description: string;
|
|
155
|
-
detailedDescription?: string;
|
|
156
|
-
actionTitles?: {
|
|
157
|
-
proceed: string;
|
|
158
|
-
reject: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
type Alert = {
|
|
162
|
-
type: AlertType;
|
|
163
|
-
details: AlertDetails;
|
|
164
|
-
};
|
|
165
|
-
type BitcoinExecuteTxData = {
|
|
166
|
-
to: string;
|
|
167
|
-
amount: number;
|
|
168
|
-
feeRate: number;
|
|
169
|
-
fee: number;
|
|
170
|
-
gasLimit: number;
|
|
171
|
-
balance: TokenWithBalanceBTC;
|
|
172
|
-
inputs: BitcoinInputUTXO[];
|
|
173
|
-
outputs: BitcoinOutputUTXO[];
|
|
174
|
-
};
|
|
175
|
-
type BitcoingSignTxData = {
|
|
176
|
-
inputs: BitcoinInputUTXO[];
|
|
177
|
-
outputs: BitcoinOutputUTXO[];
|
|
178
|
-
};
|
|
179
|
-
type SigningData = {
|
|
180
|
-
type: RpcMethod.BITCOIN_SEND_TRANSACTION;
|
|
181
|
-
account: string;
|
|
182
|
-
data: BitcoinExecuteTxData;
|
|
183
|
-
} | {
|
|
184
|
-
type: RpcMethod.BITCOIN_SIGN_TRANSACTION;
|
|
185
|
-
account: string;
|
|
186
|
-
data: BitcoingSignTxData;
|
|
187
|
-
} | {
|
|
188
|
-
type: RpcMethod.ETH_SEND_TRANSACTION;
|
|
189
|
-
account: string;
|
|
190
|
-
data: TransactionRequest;
|
|
191
|
-
} | {
|
|
192
|
-
type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;
|
|
193
|
-
account: string;
|
|
194
|
-
data: string;
|
|
195
|
-
} | {
|
|
196
|
-
type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;
|
|
197
|
-
account: string;
|
|
198
|
-
data: TypedData<MessageTypes> | TypedDataV1;
|
|
199
|
-
} | {
|
|
200
|
-
type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;
|
|
201
|
-
account: string;
|
|
202
|
-
data: TypedData<MessageTypes>;
|
|
203
|
-
} | {
|
|
204
|
-
type: RpcMethod.AVALANCHE_SIGN_MESSAGE;
|
|
205
|
-
data: string;
|
|
206
|
-
accountIndex?: number;
|
|
207
|
-
} | {
|
|
208
|
-
type: RpcMethod.AVALANCHE_SEND_TRANSACTION;
|
|
209
|
-
unsignedTxJson: string;
|
|
210
|
-
data: Avalanche.Tx;
|
|
211
|
-
vm: 'EVM' | 'AVM' | 'PVM';
|
|
212
|
-
externalIndices?: number[];
|
|
213
|
-
internalIndices?: number[];
|
|
214
|
-
} | {
|
|
215
|
-
type: RpcMethod.AVALANCHE_SIGN_TRANSACTION;
|
|
216
|
-
unsignedTxJson: string;
|
|
217
|
-
data: Avalanche.Tx;
|
|
218
|
-
vm: 'EVM' | 'AVM' | 'PVM';
|
|
219
|
-
ownSignatureIndices: [number, number][];
|
|
220
|
-
} | {
|
|
221
|
-
type: RpcMethod.HVM_SIGN_TRANSACTION;
|
|
222
|
-
data: {
|
|
223
|
-
abi: VMABI;
|
|
224
|
-
txPayload: TransactionPayload;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
type EvmTxUpdateFn = (data: {
|
|
228
|
-
maxFeeRate?: bigint;
|
|
229
|
-
maxTipRate?: bigint;
|
|
230
|
-
approvalLimit?: Hex;
|
|
231
|
-
}) => {
|
|
232
|
-
displayData: DisplayData;
|
|
233
|
-
signingData: Extract<SigningData, {
|
|
234
|
-
type: RpcMethod.ETH_SEND_TRANSACTION;
|
|
235
|
-
}>;
|
|
236
|
-
};
|
|
237
|
-
type BtcTxUpdateFn = (data: {
|
|
238
|
-
feeRate?: number;
|
|
239
|
-
}) => {
|
|
240
|
-
displayData: DisplayData;
|
|
241
|
-
signingData: Extract<SigningData, {
|
|
242
|
-
type: RpcMethod.BITCOIN_SEND_TRANSACTION;
|
|
243
|
-
}>;
|
|
244
|
-
};
|
|
245
|
-
type ApprovalParams = {
|
|
246
|
-
request: RpcRequest;
|
|
247
|
-
displayData: DisplayData;
|
|
248
|
-
signingData: SigningData;
|
|
249
|
-
updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* We want to accept both a signed data (tx/message) and a tx hash as a response
|
|
253
|
-
* coming in from the client apps, hence the XORs here.
|
|
254
|
-
*
|
|
255
|
-
* The reason we need to support both is because extension allows importing
|
|
256
|
-
* external software wallets, such as Fireblocks or other apps that support
|
|
257
|
-
* the WalletConnect protocol.
|
|
258
|
-
*
|
|
259
|
-
* My experience is that WalletConnect apps rarely, if ever, support
|
|
260
|
-
* "eth_signTransaction" requests and more often only allow sending
|
|
261
|
-
* "eth_sendTransaction" calls, which means that all we'll get in response
|
|
262
|
-
* from them is the transaction hash (not a signed tx).
|
|
263
|
-
*/
|
|
264
|
-
type SigningResult = {
|
|
265
|
-
signedData: string;
|
|
266
|
-
} | {
|
|
267
|
-
txHash: string;
|
|
268
|
-
};
|
|
269
|
-
type ApprovalResponse = {
|
|
270
|
-
error: RpcError;
|
|
271
|
-
} | SigningResult;
|
|
272
|
-
interface ApprovalController {
|
|
273
|
-
requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;
|
|
274
|
-
onTransactionConfirmed: (txHash: Hex, requestId: string) => void;
|
|
275
|
-
onTransactionReverted: (txHash: Hex, requestId: string) => void;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinExecuteTxData, BitcoingSignTxData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, FundsRecipientItem, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 };
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,278 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import 'ethers';
|
|
2
|
+
import '@avalabs/core-wallets-sdk';
|
|
3
|
+
import './common.js';
|
|
4
|
+
import '@metamask/rpc-errors';
|
|
5
|
+
export { A as AddressItem, p as Alert, o as AlertDetails, n as AlertType, H as ApprovalController, w as ApprovalParams, z as ApprovalResponse, B as BaseDetailItem, I as BatchApprovalController, x as BatchApprovalParams, G as BatchApprovalResponse, q as BitcoinExecuteTxData, r as BitcoingSignTxData, u as BtcTxUpdateFn, C as CurrencyItem, D as DappInfo, i as DataItem, j as DateItem, l as DetailItem, g as DetailItemType, f as DetailSection, m as DisplayData, E as EvmTxBatchUpdateFn, t as EvmTxUpdateFn, F as FundsRecipientItem, k as LinkItem, L as LinkItemValue, M as MessageTypeProperty, d as MessageTypes, N as NodeIDItem, b as RpcError, R as RpcMethod, a as RpcRequest, c as RpcResponse, S as SigningData, s as SigningData_EthSendTx, v as SigningRequest, y as SigningResult, h as TextItem, T as TypedData, e as TypedDataV1 } from './rpc-ab7acd4d.js';
|
|
6
|
+
import './balance.js';
|
|
7
|
+
import 'hypersdk-client';
|
|
8
8
|
import './token.js';
|
|
9
9
|
import './error.js';
|
|
10
10
|
import '@avalabs/glacier-sdk';
|
|
11
|
-
|
|
12
|
-
declare enum RpcMethod {
|
|
13
|
-
BITCOIN_SEND_TRANSACTION = "bitcoin_sendTransaction",
|
|
14
|
-
BITCOIN_SIGN_TRANSACTION = "bitcoin_signTransaction",
|
|
15
|
-
ETH_SEND_TRANSACTION = "eth_sendTransaction",
|
|
16
|
-
SIGN_TYPED_DATA_V3 = "eth_signTypedData_v3",
|
|
17
|
-
SIGN_TYPED_DATA_V4 = "eth_signTypedData_v4",
|
|
18
|
-
SIGN_TYPED_DATA_V1 = "eth_signTypedData_v1",
|
|
19
|
-
SIGN_TYPED_DATA = "eth_signTypedData",
|
|
20
|
-
PERSONAL_SIGN = "personal_sign",
|
|
21
|
-
ETH_SIGN = "eth_sign",
|
|
22
|
-
AVALANCHE_SIGN_MESSAGE = "avalanche_signMessage",
|
|
23
|
-
AVALANCHE_SEND_TRANSACTION = "avalanche_sendTransaction",
|
|
24
|
-
AVALANCHE_SIGN_TRANSACTION = "avalanche_signTransaction",
|
|
25
|
-
HVM_SIGN_TRANSACTION = "hvm_signTransaction"
|
|
26
|
-
}
|
|
27
|
-
type DappInfo = {
|
|
28
|
-
name: string;
|
|
29
|
-
url: string;
|
|
30
|
-
icon: string;
|
|
31
|
-
};
|
|
32
|
-
type RpcRequest = {
|
|
33
|
-
requestId: string;
|
|
34
|
-
sessionId: string;
|
|
35
|
-
method: RpcMethod;
|
|
36
|
-
chainId: Caip2ChainId;
|
|
37
|
-
params: unknown;
|
|
38
|
-
dappInfo: DappInfo;
|
|
39
|
-
context?: Record<string, unknown>;
|
|
40
|
-
};
|
|
41
|
-
type RpcError = JsonRpcError<OptionalDataWithOptionalCause> | EthereumProviderError<OptionalDataWithOptionalCause>;
|
|
42
|
-
type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> = {
|
|
43
|
-
result: R;
|
|
44
|
-
} | {
|
|
45
|
-
error: E;
|
|
46
|
-
};
|
|
47
|
-
interface MessageTypeProperty {
|
|
48
|
-
name: string;
|
|
49
|
-
type: string;
|
|
50
|
-
}
|
|
51
|
-
interface MessageTypes {
|
|
52
|
-
EIP712Domain: MessageTypeProperty[];
|
|
53
|
-
[additionalProperties: string]: MessageTypeProperty[];
|
|
54
|
-
}
|
|
55
|
-
interface TypedData<T extends MessageTypes> {
|
|
56
|
-
types: T;
|
|
57
|
-
primaryType: keyof T;
|
|
58
|
-
domain: Record<string, unknown>;
|
|
59
|
-
message: Record<string, unknown>;
|
|
60
|
-
}
|
|
61
|
-
type TypedDataV1 = {
|
|
62
|
-
name: string;
|
|
63
|
-
type: string;
|
|
64
|
-
value: unknown;
|
|
65
|
-
}[];
|
|
66
|
-
type DetailSection = {
|
|
67
|
-
title?: string;
|
|
68
|
-
items: DetailItem[];
|
|
69
|
-
};
|
|
70
|
-
type BaseDetailItem = {
|
|
71
|
-
label: string;
|
|
72
|
-
};
|
|
73
|
-
declare enum DetailItemType {
|
|
74
|
-
TEXT = "text",
|
|
75
|
-
ADDRESS = "address",
|
|
76
|
-
NODE_ID = "nodeID",
|
|
77
|
-
CURRENCY = "currency",
|
|
78
|
-
FUNDS_RECIPIENT = "fundsRecipient",
|
|
79
|
-
DATA = "data",
|
|
80
|
-
DATE = "date",
|
|
81
|
-
LINK = "link"
|
|
82
|
-
}
|
|
83
|
-
type FundsRecipientItem = BaseDetailItem & {
|
|
84
|
-
type: DetailItemType.FUNDS_RECIPIENT;
|
|
85
|
-
amount: bigint;
|
|
86
|
-
maxDecimals: number;
|
|
87
|
-
symbol: string;
|
|
88
|
-
};
|
|
89
|
-
type TextItem = BaseDetailItem & {
|
|
90
|
-
type: DetailItemType.TEXT;
|
|
91
|
-
value: string;
|
|
92
|
-
alignment: 'vertical' | 'horizontal';
|
|
93
|
-
};
|
|
94
|
-
type AddressItem = BaseDetailItem & {
|
|
95
|
-
type: DetailItemType.ADDRESS;
|
|
96
|
-
value: string;
|
|
97
|
-
};
|
|
98
|
-
type NodeIDItem = BaseDetailItem & {
|
|
99
|
-
type: DetailItemType.NODE_ID;
|
|
100
|
-
value: string;
|
|
101
|
-
};
|
|
102
|
-
type CurrencyItem = BaseDetailItem & {
|
|
103
|
-
type: DetailItemType.CURRENCY;
|
|
104
|
-
value: bigint;
|
|
105
|
-
maxDecimals: number;
|
|
106
|
-
symbol: string;
|
|
107
|
-
};
|
|
108
|
-
type DataItem = BaseDetailItem & {
|
|
109
|
-
type: DetailItemType.DATA;
|
|
110
|
-
value: string;
|
|
111
|
-
};
|
|
112
|
-
type DateItem = BaseDetailItem & {
|
|
113
|
-
type: DetailItemType.DATE;
|
|
114
|
-
value: string;
|
|
115
|
-
};
|
|
116
|
-
type LinkItemValue = {
|
|
117
|
-
url: string;
|
|
118
|
-
name?: string;
|
|
119
|
-
icon?: string;
|
|
120
|
-
};
|
|
121
|
-
type LinkItem = BaseDetailItem & {
|
|
122
|
-
type: DetailItemType.LINK;
|
|
123
|
-
value: LinkItemValue;
|
|
124
|
-
};
|
|
125
|
-
type DetailItem = string | TextItem | AddressItem | NodeIDItem | CurrencyItem | DataItem | DateItem | LinkItem | FundsRecipientItem;
|
|
126
|
-
type DisplayData = {
|
|
127
|
-
title: string;
|
|
128
|
-
dAppInfo?: {
|
|
129
|
-
name: string;
|
|
130
|
-
action: string;
|
|
131
|
-
logoUri?: string;
|
|
132
|
-
};
|
|
133
|
-
network: {
|
|
134
|
-
chainId: number;
|
|
135
|
-
name: string;
|
|
136
|
-
logoUri?: string;
|
|
137
|
-
};
|
|
138
|
-
account?: string;
|
|
139
|
-
details: DetailSection[];
|
|
140
|
-
networkFeeSelector?: boolean;
|
|
141
|
-
disclaimer?: string;
|
|
142
|
-
alert?: Alert;
|
|
143
|
-
balanceChange?: BalanceChange;
|
|
144
|
-
tokenApprovals?: TokenApprovals;
|
|
145
|
-
isSimulationSuccessful?: boolean;
|
|
146
|
-
};
|
|
147
|
-
declare enum AlertType {
|
|
148
|
-
WARNING = "Warning",
|
|
149
|
-
DANGER = "Danger",
|
|
150
|
-
INFO = "Info"
|
|
151
|
-
}
|
|
152
|
-
type AlertDetails = {
|
|
153
|
-
title: string;
|
|
154
|
-
description: string;
|
|
155
|
-
detailedDescription?: string;
|
|
156
|
-
actionTitles?: {
|
|
157
|
-
proceed: string;
|
|
158
|
-
reject: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
type Alert = {
|
|
162
|
-
type: AlertType;
|
|
163
|
-
details: AlertDetails;
|
|
164
|
-
};
|
|
165
|
-
type BitcoinExecuteTxData = {
|
|
166
|
-
to: string;
|
|
167
|
-
amount: number;
|
|
168
|
-
feeRate: number;
|
|
169
|
-
fee: number;
|
|
170
|
-
gasLimit: number;
|
|
171
|
-
balance: TokenWithBalanceBTC;
|
|
172
|
-
inputs: BitcoinInputUTXO[];
|
|
173
|
-
outputs: BitcoinOutputUTXO[];
|
|
174
|
-
};
|
|
175
|
-
type BitcoingSignTxData = {
|
|
176
|
-
inputs: BitcoinInputUTXO[];
|
|
177
|
-
outputs: BitcoinOutputUTXO[];
|
|
178
|
-
};
|
|
179
|
-
type SigningData = {
|
|
180
|
-
type: RpcMethod.BITCOIN_SEND_TRANSACTION;
|
|
181
|
-
account: string;
|
|
182
|
-
data: BitcoinExecuteTxData;
|
|
183
|
-
} | {
|
|
184
|
-
type: RpcMethod.BITCOIN_SIGN_TRANSACTION;
|
|
185
|
-
account: string;
|
|
186
|
-
data: BitcoingSignTxData;
|
|
187
|
-
} | {
|
|
188
|
-
type: RpcMethod.ETH_SEND_TRANSACTION;
|
|
189
|
-
account: string;
|
|
190
|
-
data: TransactionRequest;
|
|
191
|
-
} | {
|
|
192
|
-
type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;
|
|
193
|
-
account: string;
|
|
194
|
-
data: string;
|
|
195
|
-
} | {
|
|
196
|
-
type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;
|
|
197
|
-
account: string;
|
|
198
|
-
data: TypedData<MessageTypes> | TypedDataV1;
|
|
199
|
-
} | {
|
|
200
|
-
type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;
|
|
201
|
-
account: string;
|
|
202
|
-
data: TypedData<MessageTypes>;
|
|
203
|
-
} | {
|
|
204
|
-
type: RpcMethod.AVALANCHE_SIGN_MESSAGE;
|
|
205
|
-
data: string;
|
|
206
|
-
accountIndex?: number;
|
|
207
|
-
} | {
|
|
208
|
-
type: RpcMethod.AVALANCHE_SEND_TRANSACTION;
|
|
209
|
-
unsignedTxJson: string;
|
|
210
|
-
data: Avalanche.Tx;
|
|
211
|
-
vm: 'EVM' | 'AVM' | 'PVM';
|
|
212
|
-
externalIndices?: number[];
|
|
213
|
-
internalIndices?: number[];
|
|
214
|
-
} | {
|
|
215
|
-
type: RpcMethod.AVALANCHE_SIGN_TRANSACTION;
|
|
216
|
-
unsignedTxJson: string;
|
|
217
|
-
data: Avalanche.Tx;
|
|
218
|
-
vm: 'EVM' | 'AVM' | 'PVM';
|
|
219
|
-
ownSignatureIndices: [number, number][];
|
|
220
|
-
} | {
|
|
221
|
-
type: RpcMethod.HVM_SIGN_TRANSACTION;
|
|
222
|
-
data: {
|
|
223
|
-
abi: VMABI;
|
|
224
|
-
txPayload: TransactionPayload;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
type EvmTxUpdateFn = (data: {
|
|
228
|
-
maxFeeRate?: bigint;
|
|
229
|
-
maxTipRate?: bigint;
|
|
230
|
-
approvalLimit?: Hex;
|
|
231
|
-
}) => {
|
|
232
|
-
displayData: DisplayData;
|
|
233
|
-
signingData: Extract<SigningData, {
|
|
234
|
-
type: RpcMethod.ETH_SEND_TRANSACTION;
|
|
235
|
-
}>;
|
|
236
|
-
};
|
|
237
|
-
type BtcTxUpdateFn = (data: {
|
|
238
|
-
feeRate?: number;
|
|
239
|
-
}) => {
|
|
240
|
-
displayData: DisplayData;
|
|
241
|
-
signingData: Extract<SigningData, {
|
|
242
|
-
type: RpcMethod.BITCOIN_SEND_TRANSACTION;
|
|
243
|
-
}>;
|
|
244
|
-
};
|
|
245
|
-
type ApprovalParams = {
|
|
246
|
-
request: RpcRequest;
|
|
247
|
-
displayData: DisplayData;
|
|
248
|
-
signingData: SigningData;
|
|
249
|
-
updateTx?: EvmTxUpdateFn | BtcTxUpdateFn;
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* We want to accept both a signed data (tx/message) and a tx hash as a response
|
|
253
|
-
* coming in from the client apps, hence the XORs here.
|
|
254
|
-
*
|
|
255
|
-
* The reason we need to support both is because extension allows importing
|
|
256
|
-
* external software wallets, such as Fireblocks or other apps that support
|
|
257
|
-
* the WalletConnect protocol.
|
|
258
|
-
*
|
|
259
|
-
* My experience is that WalletConnect apps rarely, if ever, support
|
|
260
|
-
* "eth_signTransaction" requests and more often only allow sending
|
|
261
|
-
* "eth_sendTransaction" calls, which means that all we'll get in response
|
|
262
|
-
* from them is the transaction hash (not a signed tx).
|
|
263
|
-
*/
|
|
264
|
-
type SigningResult = {
|
|
265
|
-
signedData: string;
|
|
266
|
-
} | {
|
|
267
|
-
txHash: string;
|
|
268
|
-
};
|
|
269
|
-
type ApprovalResponse = {
|
|
270
|
-
error: RpcError;
|
|
271
|
-
} | SigningResult;
|
|
272
|
-
interface ApprovalController {
|
|
273
|
-
requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;
|
|
274
|
-
onTransactionConfirmed: (txHash: Hex, requestId: string) => void;
|
|
275
|
-
onTransactionReverted: (txHash: Hex, requestId: string) => void;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export { AddressItem, Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, BaseDetailItem, BitcoinExecuteTxData, BitcoingSignTxData, BtcTxUpdateFn, CurrencyItem, DappInfo, DataItem, DateItem, DetailItem, DetailItemType, DetailSection, DisplayData, EvmTxUpdateFn, FundsRecipientItem, LinkItem, LinkItemValue, MessageTypeProperty, MessageTypes, NodeIDItem, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningResult, TextItem, TypedData, TypedDataV1 };
|
package/dist/rpc.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type TokenDiffItem = {
|
|
12
|
-
displayValue: string;
|
|
13
|
-
usdPrice: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
type TokenApproval = {
|
|
16
|
-
token: NetworkContractToken;
|
|
17
|
-
spenderAddress: string;
|
|
18
|
-
value?: string;
|
|
19
|
-
usdPrice?: string;
|
|
20
|
-
logoUri?: string;
|
|
21
|
-
};
|
|
22
|
-
type TokenApprovals = {
|
|
23
|
-
isEditable: boolean;
|
|
24
|
-
approvals: TokenApproval[];
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem };
|
|
1
|
+
export { J as BalanceChange, P as TokenApproval, Q as TokenApprovals, K as TokenDiff, O as TokenDiffItem, U as TransactionSimulationResult } from './rpc-c6776d81.js';
|
|
2
|
+
import './token.cjs';
|
|
3
|
+
import 'ethers';
|
|
4
|
+
import '@avalabs/core-wallets-sdk';
|
|
5
|
+
import './common.cjs';
|
|
6
|
+
import '@metamask/rpc-errors';
|
|
7
|
+
import './balance.cjs';
|
|
8
|
+
import './error.cjs';
|
|
9
|
+
import '@avalabs/glacier-sdk';
|
|
10
|
+
import 'hypersdk-client';
|
|
@@ -1,27 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type TokenDiffItem = {
|
|
12
|
-
displayValue: string;
|
|
13
|
-
usdPrice: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
type TokenApproval = {
|
|
16
|
-
token: NetworkContractToken;
|
|
17
|
-
spenderAddress: string;
|
|
18
|
-
value?: string;
|
|
19
|
-
usdPrice?: string;
|
|
20
|
-
logoUri?: string;
|
|
21
|
-
};
|
|
22
|
-
type TokenApprovals = {
|
|
23
|
-
isEditable: boolean;
|
|
24
|
-
approvals: TokenApproval[];
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem };
|
|
1
|
+
export { J as BalanceChange, P as TokenApproval, Q as TokenApprovals, K as TokenDiff, O as TokenDiffItem, U as TransactionSimulationResult } from './rpc-ab7acd4d.js';
|
|
2
|
+
import './token.js';
|
|
3
|
+
import 'ethers';
|
|
4
|
+
import '@avalabs/core-wallets-sdk';
|
|
5
|
+
import './common.js';
|
|
6
|
+
import '@metamask/rpc-errors';
|
|
7
|
+
import './balance.js';
|
|
8
|
+
import './error.js';
|
|
9
|
+
import '@avalabs/glacier-sdk';
|
|
10
|
+
import 'hypersdk-client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/vm-module-types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -11,14 +11,15 @@
|
|
|
11
11
|
],
|
|
12
12
|
"license": "Limited Ecosystem License",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@avalabs/core-wallets-sdk": "3.1.0-alpha.
|
|
15
|
-
"@avalabs/glacier-sdk": "3.1.0-alpha.
|
|
14
|
+
"@avalabs/core-wallets-sdk": "3.1.0-alpha.32",
|
|
15
|
+
"@avalabs/glacier-sdk": "3.1.0-alpha.32",
|
|
16
16
|
"@metamask/rpc-errors": "6.3.0",
|
|
17
17
|
"bitcoinjs-lib": "5.2.0",
|
|
18
18
|
"zod": "3.23.8",
|
|
19
19
|
"hypersdk-client": "0.4.16"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@solana/rpc": "2.0.0",
|
|
22
23
|
"@types/bn.js": "5.1.5",
|
|
23
24
|
"bn.js": "5.2.1",
|
|
24
25
|
"ethers": "6.8.1",
|
package/dist/chunk-5R4OCUZW.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var n=(t=>(t.BITCOIN_SEND_TRANSACTION="bitcoin_sendTransaction",t.BITCOIN_SIGN_TRANSACTION="bitcoin_signTransaction",t.ETH_SEND_TRANSACTION="eth_sendTransaction",t.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",t.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",t.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",t.SIGN_TYPED_DATA="eth_signTypedData",t.PERSONAL_SIGN="personal_sign",t.ETH_SIGN="eth_sign",t.AVALANCHE_SIGN_MESSAGE="avalanche_signMessage",t.AVALANCHE_SEND_TRANSACTION="avalanche_sendTransaction",t.AVALANCHE_SIGN_TRANSACTION="avalanche_signTransaction",t.HVM_SIGN_TRANSACTION="hvm_signTransaction",t))(n||{}),i=(e=>(e.TEXT="text",e.ADDRESS="address",e.NODE_ID="nodeID",e.CURRENCY="currency",e.FUNDS_RECIPIENT="fundsRecipient",e.DATA="data",e.DATE="date",e.LINK="link",e))(i||{}),r=(a=>(a.WARNING="Warning",a.DANGER="Danger",a.INFO="Info",a))(r||{});
|
|
2
|
-
|
|
3
|
-
export { n as a, i as b, r as c };
|
|
4
|
-
//# sourceMappingURL=out.js.map
|
|
5
|
-
//# sourceMappingURL=chunk-5R4OCUZW.js.map
|