@avalabs/vm-module-types
Advanced tools
Comparing version 0.0.0-eth-send-20240711135800 to 0.0.0-eth-send-20240711174340
# @avalabs/vm-module-types | ||
## 0.0.0-eth-send-20240711135800 | ||
## 0.0.0-eth-send-20240711174340 | ||
@@ -5,0 +5,0 @@ ### Patch Changes |
@@ -1,4 +0,5 @@ | ||
export { Asset, Caip2ChainId, Chain, DappInfo, GetNetworkFeeParams, GetTransactionHistory, Hex, Manifest, Module, NetworkContractToken, NetworkFees, NetworkToken, RpcError, RpcMethod, RpcRequest, RpcResponse, TokenType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, parseManifest } from './types.js'; | ||
export { ApprovalController, ApprovalParams, ApprovalResponse, Asset, Caip2ChainId, Chain, DappInfo, DisplayData, GetNetworkFeeParams, GetTransactionHistory, Hex, Manifest, Module, NetworkContractToken, NetworkFees, NetworkToken, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType, TokenType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, parseManifest } from './types.js'; | ||
import 'zod'; | ||
import 'viem'; | ||
import 'ethers'; | ||
import '@metamask/rpc-errors'; |
@@ -1,3 +0,3 @@ | ||
export { c as RpcMethod, b as TokenType, a as TransactionType, d as parseManifest } from './chunk-AMEBF5QM.js'; | ||
export { c as RpcMethod, e as SigningDataType, b as TokenType, a as TransactionType, d as parseManifest } from './chunk-55P5W75Y.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
import { z } from 'zod'; | ||
import { Address } from 'viem'; | ||
import { TransactionRequest } from 'ethers'; | ||
import { JsonRpcError, OptionalDataWithOptionalCause, EthereumProviderError } from '@metamask/rpc-errors'; | ||
@@ -62,2 +63,3 @@ | ||
dappInfo: DappInfo; | ||
context?: Record<string, unknown>; | ||
}; | ||
@@ -438,3 +440,60 @@ type RpcError = JsonRpcError<OptionalDataWithOptionalCause> | EthereumProviderError<OptionalDataWithOptionalCause>; | ||
type Hex = `0x${string}`; | ||
type DisplayData = { | ||
title: string; | ||
chain: { | ||
chainId: Caip2ChainId; | ||
name: string; | ||
logoUrl?: string; | ||
}; | ||
messageDetails?: string; | ||
transactionDetails?: { | ||
website: string; | ||
from: string; | ||
to: string; | ||
data?: string; | ||
}; | ||
networkFeeSelector?: boolean; | ||
}; | ||
/** | ||
* Enum for different types of signing data. | ||
*/ | ||
declare enum SigningDataType { | ||
EVM_TRANSACTION = "evm_transaction", | ||
EVM_MESSAGE_ETH_SIGN = "evm_message_eth_sign", | ||
EVM_MESSAGE_PERSONAL_SIGN = "evm_message_personal_sign", | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA = "evm_message_eth_sign_typed_data", | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = "evm_message_eth_sign_typed_data_v1", | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = "evm_message_eth_sign_typed_data_v3", | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = "evm_message_eth_sign_typed_data_v4", | ||
AVALANCHE_TRANSACTION = "avalanche_transaction", | ||
AVALANCHE_MESSAGE = "avalanche_message", | ||
BTC_TRANSACTION = "btc_transaction" | ||
} | ||
type SigningData = { | ||
type: SigningDataType.EVM_TRANSACTION; | ||
account: string; | ||
chainId: Caip2ChainId; | ||
data: TransactionRequest; | ||
} | { | ||
type: SigningDataType.EVM_MESSAGE_ETH_SIGN; | ||
account: string; | ||
chainId: Caip2ChainId; | ||
data: string; | ||
}; | ||
type ApprovalParams = { | ||
request: RpcRequest; | ||
displayData: DisplayData; | ||
signingData: SigningData; | ||
}; | ||
type ApprovalResponse = { | ||
result: Hex; | ||
} | { | ||
error: RpcError; | ||
}; | ||
interface ApprovalController { | ||
requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>; | ||
onTransactionConfirmed: (txHash: Hex) => void; | ||
onTransactionReverted: (txHash: Hex) => void; | ||
} | ||
export { Asset, Caip2ChainId, Chain, DappInfo, GetNetworkFeeParams, GetTransactionHistory, Hex, Manifest, Module, NetworkContractToken, NetworkFees, NetworkToken, RpcError, RpcMethod, RpcRequest, RpcResponse, TokenType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, parseManifest }; | ||
export { ApprovalController, ApprovalParams, ApprovalResponse, Asset, Caip2ChainId, Chain, DappInfo, DisplayData, GetNetworkFeeParams, GetTransactionHistory, Hex, Manifest, Module, NetworkContractToken, NetworkFees, NetworkToken, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType, TokenType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, parseManifest }; |
@@ -1,3 +0,3 @@ | ||
export { c as RpcMethod, b as TokenType, a as TransactionType, d as parseManifest } from './chunk-AMEBF5QM.js'; | ||
export { c as RpcMethod, e as SigningDataType, b as TokenType, a as TransactionType, d as parseManifest } from './chunk-55P5W75Y.js'; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@avalabs/vm-module-types", | ||
"version": "0.0.0-eth-send-20240711135800", | ||
"version": "0.0.0-eth-send-20240711174340", | ||
"main": "dist/index.cjs", | ||
@@ -11,3 +11,4 @@ "module": "dist/index.js", | ||
"viem": "2.17.0", | ||
"@metamask/rpc-errors": "6.3.0" | ||
"@metamask/rpc-errors": "6.3.0", | ||
"ethers": "6.8.1" | ||
}, | ||
@@ -17,4 +18,7 @@ "devDependencies": { | ||
"@internal/tsup-config": "0.0.1", | ||
"eslint-config-custom": "0.0.0-eth-send-20240711135800" | ||
"eslint-config-custom": "0.0.0-eth-send-20240711174340" | ||
}, | ||
"peerDependencies": { | ||
"ethers": "^6.8.1" | ||
}, | ||
"scripts": { | ||
@@ -21,0 +25,0 @@ "build": "tsup", |
import { object, string, boolean, z } from 'zod'; | ||
import type { Address } from 'viem'; | ||
import type { TransactionRequest } from 'ethers'; | ||
import type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors'; | ||
@@ -59,2 +60,3 @@ | ||
dappInfo: DappInfo; | ||
context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer | ||
}; | ||
@@ -236,1 +238,73 @@ | ||
export type Hex = `0x${string}`; | ||
export type DisplayData = { | ||
title: string; | ||
chain: { | ||
chainId: Caip2ChainId; | ||
name: string; | ||
logoUrl?: string; | ||
}; | ||
messageDetails?: string; | ||
transactionDetails?: { | ||
website: string; | ||
from: string; | ||
to: string; | ||
data?: string; | ||
}; | ||
networkFeeSelector?: boolean; | ||
}; | ||
/** | ||
* Enum for different types of signing data. | ||
*/ | ||
export enum SigningDataType { | ||
// EVM signing data types | ||
EVM_TRANSACTION = 'evm_transaction', | ||
EVM_MESSAGE_ETH_SIGN = 'evm_message_eth_sign', | ||
EVM_MESSAGE_PERSONAL_SIGN = 'evm_message_personal_sign', | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA = 'evm_message_eth_sign_typed_data', | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = 'evm_message_eth_sign_typed_data_v1', | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = 'evm_message_eth_sign_typed_data_v3', | ||
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = 'evm_message_eth_sign_typed_data_v4', | ||
// Avalanche signing data types | ||
AVALANCHE_TRANSACTION = 'avalanche_transaction', | ||
AVALANCHE_MESSAGE = 'avalanche_message', | ||
// Bitcoin signing data types | ||
BTC_TRANSACTION = 'btc_transaction', | ||
} | ||
export type SigningData = | ||
| { | ||
type: SigningDataType.EVM_TRANSACTION; | ||
account: string; | ||
chainId: Caip2ChainId; | ||
data: TransactionRequest; | ||
} | ||
| { | ||
type: SigningDataType.EVM_MESSAGE_ETH_SIGN; | ||
account: string; | ||
chainId: Caip2ChainId; | ||
data: string; | ||
}; | ||
export type ApprovalParams = { | ||
request: RpcRequest; | ||
displayData: DisplayData; | ||
signingData: SigningData; | ||
}; | ||
export type ApprovalResponse = | ||
| { | ||
result: Hex; | ||
} | ||
| { | ||
error: RpcError; | ||
}; | ||
export interface ApprovalController { | ||
requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>; | ||
onTransactionConfirmed: (txHash: Hex) => void; | ||
onTransactionReverted: (txHash: Hex) => void; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
63097
864
0
5
+ Addedethers@6.8.1
+ Added@noble/curves@1.2.0(transitive)
+ Added@noble/hashes@1.3.2(transitive)
+ Added@types/node@18.15.13(transitive)
+ Addedaes-js@4.0.0-beta.5(transitive)
+ Addedethers@6.8.1(transitive)
+ Addedsemver@7.7.1(transitive)
+ Addedtslib@2.4.0(transitive)
+ Addedws@8.5.0(transitive)
- Removedsemver@7.7.0(transitive)