@avalabs/vm-module-types
Advanced tools
Comparing version 0.0.0-fix-release-20240620193626 to 0.0.0-new-interface-20240620224928
# @avalabs/vm-module-types | ||
## 0.0.0-fix-release-20240620193626 | ||
## 0.0.0-new-interface-20240620224928 | ||
### Patch Changes | ||
- ed4a25b: test release | ||
- afe7c95: make module interface dynamic | ||
## 0.0.8 | ||
### Patch Changes | ||
- d1d080f: test release | ||
## 0.0.7 | ||
### Patch Changes | ||
- bb98621: Move types to @avalabs/vm-module-types | ||
## 0.0.6 | ||
### Patch Changes | ||
- 1122704: test release | ||
## 0.0.3 | ||
@@ -10,0 +28,0 @@ |
{ | ||
"name": "@avalabs/vm-module-types", | ||
"version": "0.0.0-fix-release-20240620193626", | ||
"version": "0.0.0-new-interface-20240620224928", | ||
"main": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -5,3 +5,3 @@ # VM Module Types | ||
This package exposes the types for the VM modules. | ||
This package exposes the types for the VM modules | ||
@@ -8,0 +8,0 @@ ## Installation |
@@ -33,8 +33,36 @@ 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', | ||
/* UNIVERSAL */ | ||
GET_NETWORK_FEE = 'getNetworkFee', | ||
GET_TRANSACTION_HISTORY = 'getTransactionHistory', | ||
} | ||
export type RpcRequest = { | ||
method: RpcMethod; | ||
params: unknown; | ||
}; | ||
export type RpcResponse<R = unknown, E extends Error = Error> = | ||
| { | ||
result: R; | ||
} | ||
| { | ||
error: E; | ||
}; | ||
export interface Module { | ||
getManifest: () => Manifest | undefined; | ||
getBalances: () => Promise<string>; | ||
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>; | ||
getNetworkFee: () => Promise<NetworkFees>; | ||
getAddress: () => Promise<string>; | ||
onRpcRequest: (request: RpcRequest) => Promise<RpcResponse>; | ||
} | ||
@@ -41,0 +69,0 @@ |
Sorry, the diff of this file is not supported yet
5298
174