New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@avalabs/vm-module-types

Package Overview
Dependencies
Maintainers
0
Versions
531
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@avalabs/vm-module-types - npm Package Compare versions

Comparing version 0.0.0-publicTypes-20240620175625 to 0.0.0-refactor-params-20240711144718

.turbo/turbo-build.log

48

CHANGELOG.md
# @avalabs/vm-module-types
## 0.0.0-publicTypes-20240620175625
## 0.0.0-refactor-params-20240711144718
### Patch Changes
- 55240c4: Move types from packages-internal/types to packages/types
- cd97708: fix: build types package
## 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
### Patch Changes
- 0b0c52e: Move types to @avalabs/vm-module-types
## 0.0.2
### Patch Changes
- 4b7d5e9: Move types from packages-internal/types to packages/types

13

package.json
{
"name": "@avalabs/vm-module-types",
"version": "0.0.0-publicTypes-20240620175625",
"main": "src/index.ts",
"version": "0.0.0-refactor-params-20240711144718",
"main": "dist/index.cjs",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"type": "module",
"dependencies": {
"zod": "3.23.8"
"zod": "3.23.8",
"@metamask/rpc-errors": "6.3.0"
},
"devDependencies": {
"tsup": "7.2.0",
"@internal/tsup-config": "0.0.1",
"eslint-config-custom": "0.0.1"
},
"scripts": {
"build": "tsup",
"lint": "eslint \"src/**/*.ts\""
}
}
import { object, string, boolean, z } from 'zod';
import type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';

@@ -33,2 +34,54 @@ export enum TransactionType {

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 DappInfo = {
name: string;
url: string;
icon: string;
};
export type RpcRequest = {
requestId: string;
sessionId: string;
method: RpcMethod;
chainId: Caip2ChainId;
params: unknown;
dappInfo: DappInfo;
};
export type RpcError =
| JsonRpcError<OptionalDataWithOptionalCause>
| EthereumProviderError<OptionalDataWithOptionalCause>;
export type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =
| {
result: R;
}
| {
error: E;
};
export type Network = {
chainId: Caip2ChainId;
chainName: string;
rpcUrl: string;
networkToken: NetworkToken;
multiContractAddress?: string;
logoUrl?: string;
isTestnet?: boolean;
explorerUrl?: string;
};
export interface Module {

@@ -38,15 +91,13 @@ getManifest: () => Manifest | undefined;

getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
getNetworkFee: () => Promise<NetworkFees>;
getNetworkFee: (network: Network) => Promise<NetworkFees>;
getAddress: () => Promise<string>;
getTokens: (network: Network) => Promise<NetworkContractToken[]>;
onRpcRequest: (request: RpcRequest, chain: Network) => Promise<RpcResponse>;
}
export type GetTransactionHistory = {
chainId: number;
isTestnet: boolean;
networkToken: NetworkToken;
explorerUrl: string;
network: Network;
address: string;
nextPageToken?: string;
offset?: number;
glacierApiUrl?: string;
};

@@ -120,2 +171,13 @@

export interface NetworkContractToken {
address: string;
chainId?: number;
color?: string;
contractType: string;
decimals: number;
logoUri?: string;
name: string;
symbol: string;
}
const sourceSchema = object({

@@ -159,1 +221,10 @@ checksum: string(),

};
export type Caip2ChainId = string;
export type Hex = `0x${string}`;
export enum Environment {
PRODUCTION = 'production',
DEV = 'dev',
}

@@ -5,5 +5,5 @@ {

"outDir": "./dist",
"composite": true
"tsBuildInfoFile": ".tsbuildinfo"
},
"include": ["src"]
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc