@avalabs/vm-module-types 0.0.7 → 0.0.9
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/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/types.ts +39 -1
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -30,12 +30,50 @@ export type NetworkFees = {
|
|
|
30
30
|
baseFee: bigint;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
export enum RpcMethod {
|
|
34
|
+
/* EVM */
|
|
35
|
+
ETH_SEND_TRANSACTION = 'eth_sendTransaction',
|
|
36
|
+
SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',
|
|
37
|
+
SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',
|
|
38
|
+
SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',
|
|
39
|
+
SIGN_TYPED_DATA = 'eth_signTypedData',
|
|
40
|
+
PERSONAL_SIGN = 'personal_sign',
|
|
41
|
+
ETH_SIGN = 'eth_sign',
|
|
42
|
+
WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain',
|
|
43
|
+
WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain',
|
|
44
|
+
WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type RpcRequest = {
|
|
48
|
+
method: RpcMethod;
|
|
49
|
+
params: unknown;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type RpcResponse<R = unknown, E extends Error = Error> =
|
|
53
|
+
| {
|
|
54
|
+
result: R;
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
error: E;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type Chain = {
|
|
61
|
+
isTestnet?: boolean;
|
|
62
|
+
chainId?: string;
|
|
63
|
+
chainName?: string;
|
|
64
|
+
rpcUrl?: string;
|
|
65
|
+
multiContractAddress?: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type GetNetworkFeeParams = Chain;
|
|
69
|
+
|
|
33
70
|
export interface Module {
|
|
34
71
|
getManifest: () => Manifest | undefined;
|
|
35
72
|
getBalances: () => Promise<string>;
|
|
36
73
|
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
|
|
37
|
-
getNetworkFee: () => Promise<NetworkFees>;
|
|
74
|
+
getNetworkFee: (params: GetNetworkFeeParams) => Promise<NetworkFees>;
|
|
38
75
|
getAddress: () => Promise<string>;
|
|
76
|
+
onRpcRequest: (request: RpcRequest) => Promise<RpcResponse>;
|
|
39
77
|
}
|
|
40
78
|
|
|
41
79
|
export type GetTransactionHistory = {
|