@avalabs/vm-module-types
Advanced tools
Comparing version 0.0.0-fix-release-20240620193626 to 0.0.0-getNetworkFeeAvax-20240711160009
# @avalabs/vm-module-types | ||
## 0.0.0-fix-release-20240620193626 | ||
## 0.0.0-getNetworkFeeAvax-20240711160009 | ||
### Patch Changes | ||
- ed4a25b: test release | ||
- cd97708: fix: build types package | ||
- 1121db3: add module functions to evm-module | ||
## 0.0.11 | ||
## 0.0.10 | ||
### Patch Changes | ||
- 60f36fa: add getTokens function | ||
## 0.0.9 | ||
### Patch Changes | ||
- 6ffa356: add module functions to evm-module | ||
## 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 +43,0 @@ |
{ | ||
"name": "@avalabs/vm-module-types", | ||
"version": "0.0.0-fix-release-20240620193626", | ||
"main": "src/index.ts", | ||
"version": "0.0.0-getNetworkFeeAvax-20240711160009", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"type": "module", | ||
"dependencies": { | ||
@@ -9,7 +12,10 @@ "zod": "3.23.8" | ||
"devDependencies": { | ||
"tsup": "7.2.0", | ||
"@internal/tsup-config": "0.0.1", | ||
"eslint-config-custom": "0.0.1" | ||
}, | ||
"scripts": { | ||
"build": "tsup", | ||
"lint": "eslint \"src/**/*.ts\"" | ||
} | ||
} |
@@ -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 |
@@ -27,8 +27,46 @@ import { object, string, boolean, z } from 'zod'; | ||
export type NetworkFees = { | ||
low: { maxPriorityFeePerGas: bigint; maxFeePerGas: bigint }; | ||
medium: { maxPriorityFeePerGas: bigint; maxFeePerGas: bigint }; | ||
high: { maxPriorityFeePerGas: bigint; maxFeePerGas: bigint }; | ||
low: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint }; | ||
medium: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint }; | ||
high: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint }; | ||
baseFee: bigint; | ||
isFixedFee: boolean; | ||
}; | ||
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 +76,6 @@ getManifest: () => Manifest | undefined; | ||
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>; | ||
getNetworkFee: () => Promise<NetworkFees>; | ||
getNetworkFee: (params: GetNetworkFeeParams) => Promise<NetworkFees>; | ||
getAddress: () => Promise<string>; | ||
getTokens: (chainId: number) => Promise<NetworkContractToken[]>; | ||
onRpcRequest: (request: RpcRequest) => Promise<RpcResponse>; | ||
} | ||
@@ -120,2 +160,13 @@ | ||
export interface NetworkContractToken { | ||
address: string; | ||
chainId?: number; | ||
color?: string; | ||
contractType: string; | ||
decimals: number; | ||
logoUri?: string; | ||
name: string; | ||
symbol: string; | ||
} | ||
const sourceSchema = object({ | ||
@@ -122,0 +173,0 @@ checksum: string(), |
@@ -5,5 +5,5 @@ { | ||
"outDir": "./dist", | ||
"composite": true | ||
"tsBuildInfoFile": ".tsbuildinfo" | ||
}, | ||
"include": ["src"] | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
48322
25
678
Yes
3
3
1