@avalabs/vm-module-types
Advanced tools
Comparing version 0.0.0-revert-20240621180629 to 0.0.0-revert-20240621191233
# @avalabs/vm-module-types | ||
## 0.0.0-revert-20240621180629 | ||
## 0.0.0-revert-20240621191233 | ||
@@ -5,0 +5,0 @@ ### Patch Changes |
{ | ||
"name": "@avalabs/vm-module-types", | ||
"version": "0.0.0-revert-20240621180629", | ||
"version": "0.0.0-revert-20240621191233", | ||
"main": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -33,2 +33,38 @@ import { object, string, boolean, z } from 'zod'; | ||
export enum RpcMethod { | ||
/* EVM */ | ||
ETH_SEND_TRANSACTION = 'eth_sendTransaction', | ||
SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3', | ||
SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4', | ||
SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1', | ||
SIGN_TYPED_DATA = 'eth_signTypedData', | ||
PERSONAL_SIGN = 'personal_sign', | ||
ETH_SIGN = 'eth_sign', | ||
WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain', | ||
WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain', | ||
WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain', | ||
} | ||
export type RpcRequest = { | ||
method: RpcMethod; | ||
params: unknown; | ||
}; | ||
export type RpcResponse<R = unknown, E extends Error = Error> = | ||
| { | ||
result: R; | ||
} | ||
| { | ||
error: E; | ||
}; | ||
export type GetNetworkFeeParams = { | ||
isTestnet?: boolean; | ||
chainId?: string; | ||
chainName?: string; | ||
rpcUrl?: string; | ||
multiContractAddress?: string; | ||
pollingInterval?: number; | ||
}; | ||
export interface Module { | ||
@@ -38,4 +74,5 @@ getManifest: () => Manifest | undefined; | ||
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>; | ||
getNetworkFee: () => Promise<NetworkFees>; | ||
getNetworkFee: (params: GetNetworkFeeParams) => Promise<NetworkFees>; | ||
getAddress: () => Promise<string>; | ||
onRpcRequest: (request: RpcRequest) => Promise<RpcResponse>; | ||
} | ||
@@ -42,0 +79,0 @@ |
5609
183