@avalabs/vm-module-types
Advanced tools
Comparing version 0.0.8 to 0.0.9
# @avalabs/vm-module-types | ||
## 0.0.9 | ||
### Patch Changes | ||
- 6ffa356: add module functions to evm-module | ||
## 0.0.8 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@avalabs/vm-module-types", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"main": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -33,2 +33,39 @@ 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 Chain = { | ||
isTestnet?: boolean; | ||
chainId?: string; | ||
chainName?: string; | ||
rpcUrl?: string; | ||
multiContractAddress?: string; | ||
}; | ||
export type GetNetworkFeeParams = Chain; | ||
export interface Module { | ||
@@ -38,4 +75,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 +80,0 @@ |
Sorry, the diff of this file is not supported yet
5565
183