@avalabs/avalanche-module
Advanced tools
Comparing version 0.0.0-CP-8870-20240709202505 to 0.0.0-build-test-20240711134904
# @avalabs/avalanche-module | ||
## 0.0.0-CP-8870-20240709202505 | ||
## 0.0.0-build-test-20240711134904 | ||
@@ -8,3 +8,3 @@ ### Patch Changes | ||
- 02560da: Created Avalanche module | ||
- Updated dependencies [1ba779a] | ||
- @avalabs/vm-module-types@0.0.0-CP-8870-20240709202505 | ||
- Updated dependencies [a159b24] | ||
- @avalabs/vm-module-types@0.0.0-build-test-20240711134904 |
@@ -1,3 +0,2 @@ | ||
import * as _metamask_rpc_errors from '@metamask/rpc-errors'; | ||
import { Module, Manifest, GetNetworkFeeParams, NetworkFees, GetTransactionHistory, RpcRequest, Chain } from '@avalabs/vm-module-types'; | ||
import { Module, Manifest, GetNetworkFeeParams, NetworkFees, GetTransactionHistory, RpcRequest } from '@avalabs/vm-module-types'; | ||
@@ -13,4 +12,4 @@ declare class AvalancheModule implements Module { | ||
getTokens(_: number): Promise<never[]>; | ||
onRpcRequest(request: RpcRequest, _chain: Chain): Promise<{ | ||
error: _metamask_rpc_errors.JsonRpcError<_metamask_rpc_errors.OptionalDataWithOptionalCause>; | ||
onRpcRequest(request: RpcRequest): Promise<{ | ||
error: Error; | ||
}>; | ||
@@ -17,0 +16,0 @@ } |
import { parseManifest } from '@avalabs/vm-module-types'; | ||
import { rpcErrors } from '@metamask/rpc-errors'; | ||
var r={name:"AVM",description:"",version:"0.0.1",sources:{module:{checksum:"",location:{npm:{filePath:"dist/bundle.js",packageName:"@avalabs/avalanche-module",registry:"https://registry.npmjs.org"}}},provider:{checksum:"",location:{npm:{filePath:"dist/provider.js",packageName:"@avalabs/avalanche-module",registry:"https://registry.npmjs.org"}}}},network:{chainIds:["avax:2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM","avax:2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm","avax:11111111111111111111111111111111LpoYY","avax:fuji-11111111111111111111111111111111LpoYY"],namespaces:["avax"]},cointype:"",permissions:{rpc:{dapps:!0,methods:["avalanche_sendTransaction","avalanche_*"]}},manifestVersion:"0.0"};var s=class{getAddress(){return Promise.resolve("Avalanche address")}getBalances(){return Promise.resolve("Avalanche balances")}getManifest(){let e=parseManifest(r);return e.success?e.data:void 0}getNetworkFee(e){return Promise.resolve({low:{maxPriorityFeePerGas:0n,maxFeePerGas:0n},medium:{maxPriorityFeePerGas:0n,maxFeePerGas:0n},high:{maxPriorityFeePerGas:0n,maxFeePerGas:0n},baseFee:0n})}getTransactionHistory(e){return Promise.resolve({transactions:[]})}getTokens(e){return Promise.resolve([])}async onRpcRequest(e,i){switch(e.method){default:return {error:rpcErrors.methodNotSupported(`Method ${e.method} not supported`)}}}}; | ||
var r={name:"AVM",description:"",version:"0.0.1",sources:{module:{checksum:"",location:{npm:{filePath:"dist/bundle.js",packageName:"@avalabs/avalanche-module",registry:"https://registry.npmjs.org"}}},provider:{checksum:"",location:{npm:{filePath:"dist/provider.js",packageName:"@avalabs/avalanche-module",registry:"https://registry.npmjs.org"}}}},network:{chainIds:["avax:2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM","avax:2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm","avax:11111111111111111111111111111111LpoYY","avax:fuji-11111111111111111111111111111111LpoYY"],namespaces:["avax"]},cointype:"",permissions:{rpc:{dapps:!0,methods:["avalanche_sendTransaction","avalanche_*"]}},manifestVersion:"0.0"};var s=class{getAddress(){return Promise.resolve("Avalanche address")}getBalances(){return Promise.resolve("Avalanche balances")}getManifest(){let e=parseManifest(r);return e.success?e.data:void 0}getNetworkFee(e){return Promise.resolve({low:{maxPriorityFeePerGas:0n,maxFeePerGas:0n},medium:{maxPriorityFeePerGas:0n,maxFeePerGas:0n},high:{maxPriorityFeePerGas:0n,maxFeePerGas:0n},baseFee:0n})}getTransactionHistory(e){return Promise.resolve({transactions:[]})}getTokens(e){return Promise.resolve([])}async onRpcRequest(e){switch(e.method){default:return {error:new Error(`Method ${e.method} not supported`)}}}}; | ||
@@ -6,0 +5,0 @@ export { s as AvalancheModule }; |
{ | ||
"name": "@avalabs/avalanche-module", | ||
"version": "0.0.0-CP-8870-20240709202505", | ||
"version": "0.0.0-build-test-20240711134904", | ||
"main": "dist/index.cjs", | ||
@@ -9,4 +9,3 @@ "module": "dist/index.js", | ||
"dependencies": { | ||
"@avalabs/vm-module-types": "0.0.0-CP-8870-20240709202505", | ||
"@metamask/rpc-errors": "6.3.0" | ||
"@avalabs/vm-module-types": "0.0.0-build-test-20240711134904" | ||
}, | ||
@@ -19,3 +18,3 @@ "devDependencies": { | ||
"@internal/tsup-config": "0.0.1", | ||
"eslint-config-custom": "0.0.0-CP-8870-20240709202505" | ||
"eslint-config-custom": "0.0.1" | ||
}, | ||
@@ -22,0 +21,0 @@ "scripts": { |
@@ -1,1 +0,50 @@ | ||
export * from './module'; | ||
import type { | ||
Module, | ||
Manifest, | ||
NetworkFees, | ||
GetTransactionHistory, | ||
RpcRequest, | ||
GetNetworkFeeParams, | ||
} from '@avalabs/vm-module-types'; | ||
import { parseManifest } from '@avalabs/vm-module-types'; | ||
import ManifestJson from './manifest.json'; | ||
export class AvalancheModule implements Module { | ||
getAddress(): Promise<string> { | ||
return Promise.resolve('Avalanche address'); | ||
} | ||
getBalances(): Promise<string> { | ||
return Promise.resolve('Avalanche balances'); | ||
} | ||
getManifest(): Manifest | undefined { | ||
const result = parseManifest(ManifestJson); | ||
return result.success ? result.data : undefined; | ||
} | ||
getNetworkFee(_: GetNetworkFeeParams): Promise<NetworkFees> { | ||
return Promise.resolve({ | ||
low: { maxPriorityFeePerGas: 0n, maxFeePerGas: 0n }, | ||
medium: { maxPriorityFeePerGas: 0n, maxFeePerGas: 0n }, | ||
high: { maxPriorityFeePerGas: 0n, maxFeePerGas: 0n }, | ||
baseFee: 0n, | ||
}); | ||
} | ||
getTransactionHistory(_: GetTransactionHistory) { | ||
return Promise.resolve({ transactions: [] }); | ||
} | ||
getTokens(_: number) { | ||
return Promise.resolve([]); | ||
} | ||
async onRpcRequest(request: RpcRequest) { | ||
// TODO implement the RPC request handler | ||
switch (request.method) { | ||
default: | ||
return { error: new Error(`Method ${request.method} not supported`) }; | ||
} | ||
} | ||
} |
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
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
1
17310
18
150
+ Added@avalabs/vm-module-types@0.0.0-build-test-20240711134904(transitive)
- Removed@metamask/rpc-errors@6.3.0
- Removed@adraffy/ens-normalize@1.10.0(transitive)
- Removed@avalabs/vm-module-types@0.0.0-CP-8870-20240709202505(transitive)
- Removed@ethereumjs/common@3.2.0(transitive)
- Removed@ethereumjs/rlp@4.0.1(transitive)
- Removed@ethereumjs/tx@4.2.0(transitive)
- Removed@ethereumjs/util@8.1.0(transitive)
- Removed@metamask/rpc-errors@6.3.0(transitive)
- Removed@metamask/superstruct@3.1.0(transitive)
- Removed@metamask/utils@8.5.0(transitive)
- Removed@noble/curves@1.4.01.4.2(transitive)
- Removed@noble/hashes@1.4.01.7.1(transitive)
- Removed@scure/base@1.1.91.2.4(transitive)
- Removed@scure/bip32@1.4.0(transitive)
- Removed@scure/bip39@1.3.0(transitive)
- Removed@types/debug@4.1.12(transitive)
- Removed@types/ms@2.1.0(transitive)
- Removedabitype@1.0.5(transitive)
- Removedcrc-32@1.2.2(transitive)
- Removeddebug@4.4.0(transitive)
- Removedethereum-cryptography@2.2.1(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedisows@1.0.4(transitive)
- Removedmicro-ftch@0.3.1(transitive)
- Removedms@2.1.3(transitive)
- Removedpony-cause@2.1.11(transitive)
- Removedsemver@7.6.3(transitive)
- Removeduuid@9.0.1(transitive)
- Removedviem@2.17.0(transitive)
- Removedws@8.17.1(transitive)
Updated@avalabs/vm-module-types@0.0.0-build-test-20240711134904