@avalabs/vm-module-types 0.0.0-testAvaInit-20240722154418 → 0.0.0-testGetBalance-20240722173538
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +26 -26
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +1 -11
- package/dist/chunk-FKFLXQOJ.js +5 -0
- package/dist/chunk-FKFLXQOJ.js.map +1 -0
- package/dist/chunk-ISTALLTN.cjs +8 -0
- package/dist/chunk-ISTALLTN.cjs.map +1 -0
- package/dist/chunk-XQGU7MZ4.cjs +7 -0
- package/dist/chunk-XQGU7MZ4.cjs.map +1 -0
- package/dist/chunk-YJHKZHST.js +5 -0
- package/dist/chunk-YJHKZHST.js.map +1 -0
- package/dist/common.cjs +2 -6
- package/dist/common.d.cts +1 -9
- package/dist/common.d.ts +1 -9
- package/dist/common.js +1 -1
- package/dist/index.cjs +7 -11
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/network-fee.d.cts +1 -1
- package/dist/network-fee.d.ts +1 -1
- package/dist/rpc.cjs +5 -5
- package/dist/rpc.d.cts +22 -51
- package/dist/rpc.d.ts +22 -51
- package/dist/rpc.js +1 -1
- package/package.json +8 -8
- package/src/common.ts +0 -9
- package/src/network-fee.ts +1 -1
- package/src/rpc.ts +26 -53
- package/dist/chunk-4BNYMHOY.js +0 -5
- package/dist/chunk-4BNYMHOY.js.map +0 -1
- package/dist/chunk-7FBUAZNW.cjs +0 -8
- package/dist/chunk-7FBUAZNW.cjs.map +0 -1
- package/dist/chunk-VRQJHO4F.cjs +0 -8
- package/dist/chunk-VRQJHO4F.cjs.map +0 -1
- package/dist/chunk-XMGYJ4KK.js +0 -5
- package/dist/chunk-XMGYJ4KK.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @avalabs/vm-module-types@0.0.
|
|
2
|
+
> @avalabs/vm-module-types@0.0.15 build /home/runner/work/vm-modules/vm-modules/packages/types
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/balance.ts, src/coingecko.ts, src/common.ts, src/index.ts, src/manifest.ts, src/module.ts, src/network-fee.ts, src/rpc.ts, src/token.ts, src/transaction-history.ts
|
|
@@ -19,29 +19,29 @@ Generated an empty chunk: "chunk-7U2R34EQ".
|
|
|
19
19
|
[32mCJS[39m [1mdist/chunk-KVTVJNN4.cjs [22m[32m201.00 B[39m
|
|
20
20
|
[32mCJS[39m [1mdist/chunk-BFBDZPL3.cjs [22m[32m1.21 KB[39m
|
|
21
21
|
[32mCJS[39m [1mdist/chunk-JUV577XH.cjs [22m[32m90.00 B[39m
|
|
22
|
-
[32mCJS[39m [1mdist/chunk-
|
|
22
|
+
[32mCJS[39m [1mdist/chunk-XQGU7MZ4.cjs [22m[32m167.00 B[39m
|
|
23
23
|
[32mCJS[39m [1mdist/chunk-OGQBQHLH.cjs [22m[32m90.00 B[39m
|
|
24
24
|
[32mCJS[39m [1mdist/chunk-AILYKQEY.cjs [22m[32m90.00 B[39m
|
|
25
|
-
[32mCJS[39m [1mdist/chunk-
|
|
25
|
+
[32mCJS[39m [1mdist/chunk-ISTALLTN.cjs [22m[32m1.12 KB[39m
|
|
26
26
|
[32mCJS[39m [1mdist/token.cjs [22m[32m260.00 B[39m
|
|
27
27
|
[32mCJS[39m [1mdist/transaction-history.cjs [22m[32m542.00 B[39m
|
|
28
28
|
[32mCJS[39m [1mdist/balance.cjs [22m[32m117.00 B[39m
|
|
29
29
|
[32mCJS[39m [1mdist/coingecko.cjs [22m[32m418.00 B[39m
|
|
30
|
-
[32mCJS[39m [1mdist/common.cjs [22m[
|
|
31
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m1.
|
|
30
|
+
[32mCJS[39m [1mdist/common.cjs [22m[32m263.00 B[39m
|
|
31
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m1.75 KB[39m
|
|
32
32
|
[32mCJS[39m [1mdist/chunk-4PGCXP4C.cjs [22m[32m433.00 B[39m
|
|
33
33
|
[32mCJS[39m [1mdist/manifest.cjs [22m[32m267.00 B[39m
|
|
34
34
|
[32mCJS[39m [1mdist/chunk-74SNNWSF.cjs [22m[32m667.00 B[39m
|
|
35
35
|
[32mCJS[39m [1mdist/module.cjs [22m[32m116.00 B[39m
|
|
36
36
|
[32mCJS[39m [1mdist/network-fee.cjs [22m[32m121.00 B[39m
|
|
37
|
-
[32mCJS[39m [1mdist/rpc.cjs [22m[
|
|
37
|
+
[32mCJS[39m [1mdist/rpc.cjs [22m[32m383.00 B[39m
|
|
38
38
|
[32mCJS[39m [1mdist/chunk-KVTVJNN4.cjs.map [22m[32m653.00 B[39m
|
|
39
39
|
[32mCJS[39m [1mdist/chunk-BFBDZPL3.cjs.map [22m[32m3.69 KB[39m
|
|
40
40
|
[32mCJS[39m [1mdist/chunk-JUV577XH.cjs.map [22m[32m51.00 B[39m
|
|
41
|
-
[32mCJS[39m [1mdist/chunk-
|
|
41
|
+
[32mCJS[39m [1mdist/chunk-XQGU7MZ4.cjs.map [22m[32m838.00 B[39m
|
|
42
42
|
[32mCJS[39m [1mdist/chunk-OGQBQHLH.cjs.map [22m[32m51.00 B[39m
|
|
43
43
|
[32mCJS[39m [1mdist/chunk-AILYKQEY.cjs.map [22m[32m51.00 B[39m
|
|
44
|
-
[32mCJS[39m [1mdist/chunk-
|
|
44
|
+
[32mCJS[39m [1mdist/chunk-ISTALLTN.cjs.map [22m[32m3.72 KB[39m
|
|
45
45
|
[32mCJS[39m [1mdist/token.cjs.map [22m[32m51.00 B[39m
|
|
46
46
|
[32mCJS[39m [1mdist/transaction-history.cjs.map [22m[32m51.00 B[39m
|
|
47
47
|
[32mCJS[39m [1mdist/balance.cjs.map [22m[32m51.00 B[39m
|
|
@@ -54,33 +54,33 @@ Generated an empty chunk: "chunk-7U2R34EQ".
|
|
|
54
54
|
[32mCJS[39m [1mdist/module.cjs.map [22m[32m51.00 B[39m
|
|
55
55
|
[32mCJS[39m [1mdist/network-fee.cjs.map [22m[32m51.00 B[39m
|
|
56
56
|
[32mCJS[39m [1mdist/rpc.cjs.map [22m[32m51.00 B[39m
|
|
57
|
-
[32mCJS[39m ⚡️ Build success in
|
|
57
|
+
[32mCJS[39m ⚡️ Build success in 1601ms
|
|
58
58
|
[32mESM[39m [1mdist/chunk-TSO5BGJ4.js [22m[32m189.00 B[39m
|
|
59
59
|
[32mESM[39m [1mdist/chunk-H6ZZE5M7.js [22m[32m1.18 KB[39m
|
|
60
60
|
[32mESM[39m [1mdist/chunk-BHB5UV3J.js [22m[32m75.00 B[39m
|
|
61
|
-
[32mESM[39m [1mdist/chunk-
|
|
61
|
+
[32mESM[39m [1mdist/chunk-YJHKZHST.js [22m[32m155.00 B[39m
|
|
62
62
|
[32mESM[39m [1mdist/chunk-CUVJNZP5.js [22m[32m75.00 B[39m
|
|
63
63
|
[32mESM[39m [1mdist/chunk-7U2R34EQ.js [22m[32m75.00 B[39m
|
|
64
|
-
[32mESM[39m [1mdist/chunk-
|
|
64
|
+
[32mESM[39m [1mdist/chunk-FKFLXQOJ.js [22m[32m1.11 KB[39m
|
|
65
65
|
[32mESM[39m [1mdist/token.js [22m[32m119.00 B[39m
|
|
66
66
|
[32mESM[39m [1mdist/transaction-history.js [22m[32m195.00 B[39m
|
|
67
67
|
[32mESM[39m [1mdist/balance.js [22m[32m97.00 B[39m
|
|
68
68
|
[32mESM[39m [1mdist/coingecko.js [22m[32m174.00 B[39m
|
|
69
|
-
[32mESM[39m [1mdist/common.js [22m[
|
|
70
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
69
|
+
[32mESM[39m [1mdist/common.js [22m[32m122.00 B[39m
|
|
70
|
+
[32mESM[39m [1mdist/index.js [22m[32m620.00 B[39m
|
|
71
71
|
[32mESM[39m [1mdist/chunk-WOO6UGSQ.js [22m[32m394.00 B[39m
|
|
72
72
|
[32mESM[39m [1mdist/manifest.js [22m[32m126.00 B[39m
|
|
73
73
|
[32mESM[39m [1mdist/chunk-A4YEBDMG.js [22m[32m592.00 B[39m
|
|
74
74
|
[32mESM[39m [1mdist/module.js [22m[32m96.00 B[39m
|
|
75
75
|
[32mESM[39m [1mdist/network-fee.js [22m[32m101.00 B[39m
|
|
76
|
-
[32mESM[39m [1mdist/rpc.js [22m[
|
|
76
|
+
[32mESM[39m [1mdist/rpc.js [22m[32m139.00 B[39m
|
|
77
77
|
[32mESM[39m [1mdist/chunk-TSO5BGJ4.js.map [22m[32m653.00 B[39m
|
|
78
78
|
[32mESM[39m [1mdist/chunk-H6ZZE5M7.js.map [22m[32m3.69 KB[39m
|
|
79
79
|
[32mESM[39m [1mdist/chunk-BHB5UV3J.js.map [22m[32m51.00 B[39m
|
|
80
|
-
[32mESM[39m [1mdist/chunk-
|
|
80
|
+
[32mESM[39m [1mdist/chunk-YJHKZHST.js.map [22m[32m838.00 B[39m
|
|
81
81
|
[32mESM[39m [1mdist/chunk-CUVJNZP5.js.map [22m[32m51.00 B[39m
|
|
82
82
|
[32mESM[39m [1mdist/chunk-7U2R34EQ.js.map [22m[32m51.00 B[39m
|
|
83
|
-
[32mESM[39m [1mdist/chunk-
|
|
83
|
+
[32mESM[39m [1mdist/chunk-FKFLXQOJ.js.map [22m[32m3.72 KB[39m
|
|
84
84
|
[32mESM[39m [1mdist/token.js.map [22m[32m51.00 B[39m
|
|
85
85
|
[32mESM[39m [1mdist/transaction-history.js.map [22m[32m51.00 B[39m
|
|
86
86
|
[32mESM[39m [1mdist/balance.js.map [22m[32m51.00 B[39m
|
|
@@ -93,26 +93,26 @@ Generated an empty chunk: "chunk-7U2R34EQ".
|
|
|
93
93
|
[32mESM[39m [1mdist/module.js.map [22m[32m51.00 B[39m
|
|
94
94
|
[32mESM[39m [1mdist/network-fee.js.map [22m[32m51.00 B[39m
|
|
95
95
|
[32mESM[39m [1mdist/rpc.js.map [22m[32m51.00 B[39m
|
|
96
|
-
[32mESM[39m ⚡️ Build success in
|
|
96
|
+
[32mESM[39m ⚡️ Build success in 1623ms
|
|
97
97
|
[34mDTS[39m Build start
|
|
98
|
-
[32mDTS[39m ⚡️ Build success in
|
|
99
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m1.
|
|
98
|
+
[32mDTS[39m ⚡️ Build success in 10757ms
|
|
99
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m1.12 KB[39m
|
|
100
100
|
[32mDTS[39m [1mdist/coingecko.d.cts [22m[32m1.09 KB[39m
|
|
101
101
|
[32mDTS[39m [1mdist/module.d.cts [22m[32m1.01 KB[39m
|
|
102
102
|
[32mDTS[39m [1mdist/balance.d.cts [22m[32m3.20 KB[39m
|
|
103
103
|
[32mDTS[39m [1mdist/manifest.d.cts [22m[32m6.95 KB[39m
|
|
104
|
-
[32mDTS[39m [1mdist/network-fee.d.cts [22m[
|
|
105
|
-
[32mDTS[39m [1mdist/rpc.d.cts [22m[32m3.
|
|
104
|
+
[32mDTS[39m [1mdist/network-fee.d.cts [22m[32m360.00 B[39m
|
|
105
|
+
[32mDTS[39m [1mdist/rpc.d.cts [22m[32m3.02 KB[39m
|
|
106
106
|
[32mDTS[39m [1mdist/transaction-history.d.cts [22m[32m2.88 KB[39m
|
|
107
|
-
[32mDTS[39m [1mdist/common.d.cts [22m[
|
|
107
|
+
[32mDTS[39m [1mdist/common.d.cts [22m[32m729.00 B[39m
|
|
108
108
|
[32mDTS[39m [1mdist/token.d.cts [22m[32m518.00 B[39m
|
|
109
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.
|
|
109
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.11 KB[39m
|
|
110
110
|
[32mDTS[39m [1mdist/coingecko.d.ts [22m[32m1.09 KB[39m
|
|
111
111
|
[32mDTS[39m [1mdist/module.d.ts [22m[32m1023.00 B[39m
|
|
112
112
|
[32mDTS[39m [1mdist/balance.d.ts [22m[32m3.20 KB[39m
|
|
113
113
|
[32mDTS[39m [1mdist/manifest.d.ts [22m[32m6.95 KB[39m
|
|
114
|
-
[32mDTS[39m [1mdist/network-fee.d.ts [22m[
|
|
115
|
-
[32mDTS[39m [1mdist/rpc.d.ts [22m[32m3.
|
|
114
|
+
[32mDTS[39m [1mdist/network-fee.d.ts [22m[32m360.00 B[39m
|
|
115
|
+
[32mDTS[39m [1mdist/rpc.d.ts [22m[32m3.02 KB[39m
|
|
116
116
|
[32mDTS[39m [1mdist/transaction-history.d.ts [22m[32m2.88 KB[39m
|
|
117
|
-
[32mDTS[39m [1mdist/common.d.ts [22m[
|
|
117
|
+
[32mDTS[39m [1mdist/common.d.ts [22m[32m728.00 B[39m
|
|
118
118
|
[32mDTS[39m [1mdist/token.d.ts [22m[32m518.00 B[39m
|
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
# @avalabs/vm-module-types
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 60d04c7: Add getBalances to avalanche-module
|
|
8
|
-
|
|
9
|
-
## 0.0.16
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- bc48457: add support for all eth_sign methods
|
|
3
|
+
## 0.0.0-testGetBalance-20240722173538
|
|
14
4
|
|
|
15
5
|
## 0.0.15
|
|
16
6
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var t=(e=>(e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e.WALLET_ADD_ETHEREUM_CHAIN="wallet_addEthereumChain",e.WALLET_SWITCH_ETHEREUM_CHAIN="wallet_switchEthereumChain",e.WALLET_GET_ETHEREUM_CHAIN="wallet_getEthereumChain",e))(t||{}),r=(e=>(e.EVM_TRANSACTION="evm_transaction",e.EVM_MESSAGE_ETH_SIGN="evm_message_eth_sign",e.EVM_MESSAGE_PERSONAL_SIGN="evm_message_personal_sign",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA="evm_message_eth_sign_typed_data",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1="evm_message_eth_sign_typed_data_v1",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3="evm_message_eth_sign_typed_data_v3",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4="evm_message_eth_sign_typed_data_v4",e.AVALANCHE_TRANSACTION="avalanche_transaction",e.AVALANCHE_MESSAGE="avalanche_message",e.BTC_TRANSACTION="btc_transaction",e))(r||{});
|
|
2
|
+
|
|
3
|
+
export { t as a, r as b };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-FKFLXQOJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","SigningDataType"],"mappings":"AAIO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WACXA,EAAA,0BAA4B,0BAC5BA,EAAA,6BAA+B,6BAC/BA,EAAA,0BAA4B,0BAXlBA,OAAA,IA8DAC,OAEVA,EAAA,gBAAkB,kBAClBA,EAAA,qBAAuB,uBACvBA,EAAA,0BAA4B,4BAC5BA,EAAA,gCAAkC,kCAClCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCAGrCA,EAAA,sBAAwB,wBACxBA,EAAA,kBAAoB,oBAGpBA,EAAA,gBAAkB,kBAfRA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\n\nexport enum RpcMethod {\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain',\n WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain',\n WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport type DisplayData = {\n title: string;\n network: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n messageDetails?: string;\n transactionDetails?: {\n website: string;\n from: string;\n to: string;\n data?: string;\n };\n networkFeeSelector?: boolean;\n};\n\n/**\n * Enum for different types of signing data.\n */\nexport enum SigningDataType {\n // EVM signing data types\n EVM_TRANSACTION = 'evm_transaction',\n EVM_MESSAGE_ETH_SIGN = 'evm_message_eth_sign',\n EVM_MESSAGE_PERSONAL_SIGN = 'evm_message_personal_sign',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA = 'evm_message_eth_sign_typed_data',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = 'evm_message_eth_sign_typed_data_v1',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = 'evm_message_eth_sign_typed_data_v3',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = 'evm_message_eth_sign_typed_data_v4',\n\n // Avalanche signing data types\n AVALANCHE_TRANSACTION = 'avalanche_transaction',\n AVALANCHE_MESSAGE = 'avalanche_message',\n\n // Bitcoin signing data types\n BTC_TRANSACTION = 'btc_transaction',\n}\n\nexport type SigningData =\n | {\n type: SigningDataType.EVM_TRANSACTION;\n account: string;\n chainId: number;\n data: TransactionRequest;\n }\n | {\n type: SigningDataType.EVM_MESSAGE_ETH_SIGN;\n account: string;\n chainId: number;\n data: string;\n };\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n};\n\nexport type ApprovalResponse =\n | {\n result: Hex;\n }\n | {\n error: RpcError;\n };\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex) => void;\n onTransactionReverted: (txHash: Hex) => void;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var t=(e=>(e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e.WALLET_ADD_ETHEREUM_CHAIN="wallet_addEthereumChain",e.WALLET_SWITCH_ETHEREUM_CHAIN="wallet_switchEthereumChain",e.WALLET_GET_ETHEREUM_CHAIN="wallet_getEthereumChain",e))(t||{}),r=(e=>(e.EVM_TRANSACTION="evm_transaction",e.EVM_MESSAGE_ETH_SIGN="evm_message_eth_sign",e.EVM_MESSAGE_PERSONAL_SIGN="evm_message_personal_sign",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA="evm_message_eth_sign_typed_data",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1="evm_message_eth_sign_typed_data_v1",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3="evm_message_eth_sign_typed_data_v3",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4="evm_message_eth_sign_typed_data_v4",e.AVALANCHE_TRANSACTION="avalanche_transaction",e.AVALANCHE_MESSAGE="avalanche_message",e.BTC_TRANSACTION="btc_transaction",e))(r||{});
|
|
4
|
+
|
|
5
|
+
exports.a = t;
|
|
6
|
+
exports.b = r;
|
|
7
|
+
//# sourceMappingURL=out.js.map
|
|
8
|
+
//# sourceMappingURL=chunk-ISTALLTN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","SigningDataType"],"mappings":"AAIO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WACXA,EAAA,0BAA4B,0BAC5BA,EAAA,6BAA+B,6BAC/BA,EAAA,0BAA4B,0BAXlBA,OAAA,IA8DAC,OAEVA,EAAA,gBAAkB,kBAClBA,EAAA,qBAAuB,uBACvBA,EAAA,0BAA4B,4BAC5BA,EAAA,gCAAkC,kCAClCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCAGrCA,EAAA,sBAAwB,wBACxBA,EAAA,kBAAoB,oBAGpBA,EAAA,gBAAkB,kBAfRA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\n\nexport enum RpcMethod {\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain',\n WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain',\n WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport type DisplayData = {\n title: string;\n network: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n messageDetails?: string;\n transactionDetails?: {\n website: string;\n from: string;\n to: string;\n data?: string;\n };\n networkFeeSelector?: boolean;\n};\n\n/**\n * Enum for different types of signing data.\n */\nexport enum SigningDataType {\n // EVM signing data types\n EVM_TRANSACTION = 'evm_transaction',\n EVM_MESSAGE_ETH_SIGN = 'evm_message_eth_sign',\n EVM_MESSAGE_PERSONAL_SIGN = 'evm_message_personal_sign',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA = 'evm_message_eth_sign_typed_data',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = 'evm_message_eth_sign_typed_data_v1',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = 'evm_message_eth_sign_typed_data_v3',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = 'evm_message_eth_sign_typed_data_v4',\n\n // Avalanche signing data types\n AVALANCHE_TRANSACTION = 'avalanche_transaction',\n AVALANCHE_MESSAGE = 'avalanche_message',\n\n // Bitcoin signing data types\n BTC_TRANSACTION = 'btc_transaction',\n}\n\nexport type SigningData =\n | {\n type: SigningDataType.EVM_TRANSACTION;\n account: string;\n chainId: number;\n data: TransactionRequest;\n }\n | {\n type: SigningDataType.EVM_MESSAGE_ETH_SIGN;\n account: string;\n chainId: number;\n data: string;\n };\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n};\n\nexport type ApprovalResponse =\n | {\n result: Hex;\n }\n | {\n error: RpcError;\n };\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex) => void;\n onTransactionReverted: (txHash: Hex) => void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common.ts"],"names":["Environment"],"mappings":"AA8BO,IAAKA,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n};\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common.ts"],"names":["Environment"],"mappings":"AA8BO,IAAKA,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n};\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
|
package/dist/common.cjs
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, 'Environment', {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, 'NetworkVMType', {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkVRQJHO4F_cjs.a; }
|
|
9
|
+
get: function () { return chunkXQGU7MZ4_cjs.a; }
|
|
14
10
|
});
|
|
15
11
|
//# sourceMappingURL=out.js.map
|
|
16
12
|
//# sourceMappingURL=common.cjs.map
|
package/dist/common.d.cts
CHANGED
|
@@ -17,15 +17,7 @@ type Network = {
|
|
|
17
17
|
};
|
|
18
18
|
explorerUrl?: string;
|
|
19
19
|
logoUri?: string;
|
|
20
|
-
vmName: NetworkVMType;
|
|
21
20
|
};
|
|
22
|
-
declare enum NetworkVMType {
|
|
23
|
-
EVM = "EVM",
|
|
24
|
-
BITCOIN = "BITCOIN",
|
|
25
|
-
AVM = "AVM",
|
|
26
|
-
PVM = "PVM",
|
|
27
|
-
CoreEth = "CoreEth"
|
|
28
|
-
}
|
|
29
21
|
type Storage = {
|
|
30
22
|
get: <T>(id: string) => T | undefined;
|
|
31
23
|
set: <T>(id: string, data: T) => void;
|
|
@@ -37,4 +29,4 @@ declare enum Environment {
|
|
|
37
29
|
DEV = "dev"
|
|
38
30
|
}
|
|
39
31
|
|
|
40
|
-
export { Caip2ChainId, Environment, Hex, Network,
|
|
32
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage };
|
package/dist/common.d.ts
CHANGED
|
@@ -17,15 +17,7 @@ type Network = {
|
|
|
17
17
|
};
|
|
18
18
|
explorerUrl?: string;
|
|
19
19
|
logoUri?: string;
|
|
20
|
-
vmName: NetworkVMType;
|
|
21
20
|
};
|
|
22
|
-
declare enum NetworkVMType {
|
|
23
|
-
EVM = "EVM",
|
|
24
|
-
BITCOIN = "BITCOIN",
|
|
25
|
-
AVM = "AVM",
|
|
26
|
-
PVM = "PVM",
|
|
27
|
-
CoreEth = "CoreEth"
|
|
28
|
-
}
|
|
29
21
|
type Storage = {
|
|
30
22
|
get: <T>(id: string) => T | undefined;
|
|
31
23
|
set: <T>(id: string, data: T) => void;
|
|
@@ -37,4 +29,4 @@ declare enum Environment {
|
|
|
37
29
|
DEV = "dev"
|
|
38
30
|
}
|
|
39
31
|
|
|
40
|
-
export { Caip2ChainId, Environment, Hex, Network,
|
|
32
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage };
|
package/dist/common.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -4,11 +4,11 @@ var chunkKVTVJNN4_cjs = require('./chunk-KVTVJNN4.cjs');
|
|
|
4
4
|
var chunkBFBDZPL3_cjs = require('./chunk-BFBDZPL3.cjs');
|
|
5
5
|
require('./chunk-JUV577XH.cjs');
|
|
6
6
|
var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
|
|
8
8
|
var chunk74SNNWSF_cjs = require('./chunk-74SNNWSF.cjs');
|
|
9
9
|
require('./chunk-OGQBQHLH.cjs');
|
|
10
10
|
require('./chunk-AILYKQEY.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkISTALLTN_cjs = require('./chunk-ISTALLTN.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -38,23 +38,19 @@ Object.defineProperty(exports, 'SimplePriceResponseSchema', {
|
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, 'Environment', {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, 'NetworkVMType', {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () { return chunkVRQJHO4F_cjs.a; }
|
|
41
|
+
get: function () { return chunkXQGU7MZ4_cjs.a; }
|
|
46
42
|
});
|
|
47
43
|
Object.defineProperty(exports, 'parseManifest', {
|
|
48
44
|
enumerable: true,
|
|
49
45
|
get: function () { return chunk74SNNWSF_cjs.a; }
|
|
50
46
|
});
|
|
51
|
-
Object.defineProperty(exports, '
|
|
47
|
+
Object.defineProperty(exports, 'RpcMethod', {
|
|
52
48
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkISTALLTN_cjs.a; }
|
|
54
50
|
});
|
|
55
|
-
Object.defineProperty(exports, '
|
|
51
|
+
Object.defineProperty(exports, 'SigningDataType', {
|
|
56
52
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkISTALLTN_cjs.b; }
|
|
58
54
|
});
|
|
59
55
|
//# sourceMappingURL=out.js.map
|
|
60
56
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Caip2ChainId, Environment, Hex, Network,
|
|
1
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage } from './common.cjs';
|
|
2
2
|
export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema } from './coingecko.cjs';
|
|
3
3
|
export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.cjs';
|
|
4
4
|
export { Manifest, parseManifest } from './manifest.cjs';
|
|
5
5
|
export { Module } from './module.cjs';
|
|
6
6
|
export { NetworkFees } from './network-fee.cjs';
|
|
7
|
-
export { ApprovalController, ApprovalParams, ApprovalResponse,
|
|
7
|
+
export { ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType } from './rpc.cjs';
|
|
8
8
|
export { NetworkContractToken, NetworkToken, TokenType } from './token.cjs';
|
|
9
9
|
export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.cjs';
|
|
10
10
|
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { Caip2ChainId, Environment, Hex, Network,
|
|
1
|
+
export { Caip2ChainId, Environment, Hex, Network, Storage } from './common.js';
|
|
2
2
|
export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema } from './coingecko.js';
|
|
3
3
|
export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.js';
|
|
4
4
|
export { Manifest, parseManifest } from './manifest.js';
|
|
5
5
|
export { Module } from './module.js';
|
|
6
6
|
export { NetworkFees } from './network-fee.js';
|
|
7
|
-
export { ApprovalController, ApprovalParams, ApprovalResponse,
|
|
7
|
+
export { ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType } from './rpc.js';
|
|
8
8
|
export { NetworkContractToken, NetworkToken, TokenType } from './token.js';
|
|
9
9
|
export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.js';
|
|
10
10
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@ export { a as TokenType } from './chunk-TSO5BGJ4.js';
|
|
|
2
2
|
export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-H6ZZE5M7.js';
|
|
3
3
|
import './chunk-BHB5UV3J.js';
|
|
4
4
|
export { b as RawSimplePriceResponseSchema, a as SimplePriceResponseSchema } from './chunk-WOO6UGSQ.js';
|
|
5
|
-
export {
|
|
5
|
+
export { a as Environment } from './chunk-YJHKZHST.js';
|
|
6
6
|
export { a as parseManifest } from './chunk-A4YEBDMG.js';
|
|
7
7
|
import './chunk-CUVJNZP5.js';
|
|
8
8
|
import './chunk-7U2R34EQ.js';
|
|
9
|
-
export {
|
|
9
|
+
export { a as RpcMethod, b as SigningDataType } from './chunk-FKFLXQOJ.js';
|
|
10
10
|
//# sourceMappingURL=out.js.map
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/dist/network-fee.d.cts
CHANGED
package/dist/network-fee.d.ts
CHANGED
package/dist/rpc.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkISTALLTN_cjs = require('./chunk-ISTALLTN.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
Object.defineProperty(exports, '
|
|
7
|
+
Object.defineProperty(exports, 'RpcMethod', {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkISTALLTN_cjs.a; }
|
|
10
10
|
});
|
|
11
|
-
Object.defineProperty(exports, '
|
|
11
|
+
Object.defineProperty(exports, 'SigningDataType', {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkISTALLTN_cjs.b; }
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=out.js.map
|
|
16
16
|
//# sourceMappingURL=rpc.cjs.map
|
package/dist/rpc.d.cts
CHANGED
|
@@ -10,7 +10,10 @@ declare enum RpcMethod {
|
|
|
10
10
|
SIGN_TYPED_DATA_V1 = "eth_signTypedData_v1",
|
|
11
11
|
SIGN_TYPED_DATA = "eth_signTypedData",
|
|
12
12
|
PERSONAL_SIGN = "personal_sign",
|
|
13
|
-
ETH_SIGN = "eth_sign"
|
|
13
|
+
ETH_SIGN = "eth_sign",
|
|
14
|
+
WALLET_ADD_ETHEREUM_CHAIN = "wallet_addEthereumChain",
|
|
15
|
+
WALLET_SWITCH_ETHEREUM_CHAIN = "wallet_switchEthereumChain",
|
|
16
|
+
WALLET_GET_ETHEREUM_CHAIN = "wallet_getEthereumChain"
|
|
14
17
|
}
|
|
15
18
|
type DappInfo = {
|
|
16
19
|
name: string;
|
|
@@ -32,49 +35,13 @@ type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWith
|
|
|
32
35
|
} | {
|
|
33
36
|
error: E;
|
|
34
37
|
};
|
|
35
|
-
interface MessageTypeProperty {
|
|
36
|
-
name: string;
|
|
37
|
-
type: string;
|
|
38
|
-
}
|
|
39
|
-
interface MessageTypes {
|
|
40
|
-
EIP712Domain: MessageTypeProperty[];
|
|
41
|
-
[additionalProperties: string]: MessageTypeProperty[];
|
|
42
|
-
}
|
|
43
|
-
interface TypedData<T extends MessageTypes> {
|
|
44
|
-
types: T;
|
|
45
|
-
primaryType: keyof T;
|
|
46
|
-
domain: Record<string, unknown>;
|
|
47
|
-
message: Record<string, unknown>;
|
|
48
|
-
}
|
|
49
|
-
type TypedDataV1 = {
|
|
50
|
-
name: string;
|
|
51
|
-
type: string;
|
|
52
|
-
value: unknown;
|
|
53
|
-
}[];
|
|
54
|
-
declare enum BannerType {
|
|
55
|
-
WARNING = "warning",
|
|
56
|
-
INFO = "info"
|
|
57
|
-
}
|
|
58
|
-
type Banner = {
|
|
59
|
-
type: BannerType;
|
|
60
|
-
title: string;
|
|
61
|
-
description: string;
|
|
62
|
-
detailedDescription?: string;
|
|
63
|
-
};
|
|
64
38
|
type DisplayData = {
|
|
65
|
-
banner?: Banner;
|
|
66
39
|
title: string;
|
|
67
|
-
dAppInfo?: {
|
|
68
|
-
name: string;
|
|
69
|
-
action: string;
|
|
70
|
-
logoUri?: string;
|
|
71
|
-
};
|
|
72
40
|
network: {
|
|
73
41
|
chainId: number;
|
|
74
42
|
name: string;
|
|
75
43
|
logoUri?: string;
|
|
76
44
|
};
|
|
77
|
-
account?: string;
|
|
78
45
|
messageDetails?: string;
|
|
79
46
|
transactionDetails?: {
|
|
80
47
|
website: string;
|
|
@@ -83,28 +50,32 @@ type DisplayData = {
|
|
|
83
50
|
data?: string;
|
|
84
51
|
};
|
|
85
52
|
networkFeeSelector?: boolean;
|
|
86
|
-
disclaimer?: string;
|
|
87
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Enum for different types of signing data.
|
|
56
|
+
*/
|
|
57
|
+
declare enum SigningDataType {
|
|
58
|
+
EVM_TRANSACTION = "evm_transaction",
|
|
59
|
+
EVM_MESSAGE_ETH_SIGN = "evm_message_eth_sign",
|
|
60
|
+
EVM_MESSAGE_PERSONAL_SIGN = "evm_message_personal_sign",
|
|
61
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA = "evm_message_eth_sign_typed_data",
|
|
62
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = "evm_message_eth_sign_typed_data_v1",
|
|
63
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = "evm_message_eth_sign_typed_data_v3",
|
|
64
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = "evm_message_eth_sign_typed_data_v4",
|
|
65
|
+
AVALANCHE_TRANSACTION = "avalanche_transaction",
|
|
66
|
+
AVALANCHE_MESSAGE = "avalanche_message",
|
|
67
|
+
BTC_TRANSACTION = "btc_transaction"
|
|
68
|
+
}
|
|
88
69
|
type SigningData = {
|
|
89
|
-
type:
|
|
70
|
+
type: SigningDataType.EVM_TRANSACTION;
|
|
90
71
|
account: string;
|
|
91
72
|
chainId: number;
|
|
92
73
|
data: TransactionRequest;
|
|
93
74
|
} | {
|
|
94
|
-
type:
|
|
75
|
+
type: SigningDataType.EVM_MESSAGE_ETH_SIGN;
|
|
95
76
|
account: string;
|
|
96
77
|
chainId: number;
|
|
97
78
|
data: string;
|
|
98
|
-
} | {
|
|
99
|
-
type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;
|
|
100
|
-
account: string;
|
|
101
|
-
chainId: number;
|
|
102
|
-
data: TypedData<MessageTypes> | TypedDataV1;
|
|
103
|
-
} | {
|
|
104
|
-
type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;
|
|
105
|
-
account: string;
|
|
106
|
-
chainId: number;
|
|
107
|
-
data: TypedData<MessageTypes>;
|
|
108
79
|
};
|
|
109
80
|
type ApprovalParams = {
|
|
110
81
|
request: RpcRequest;
|
|
@@ -122,4 +93,4 @@ interface ApprovalController {
|
|
|
122
93
|
onTransactionReverted: (txHash: Hex) => void;
|
|
123
94
|
}
|
|
124
95
|
|
|
125
|
-
export { ApprovalController, ApprovalParams, ApprovalResponse,
|
|
96
|
+
export { ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType };
|
package/dist/rpc.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ declare enum RpcMethod {
|
|
|
10
10
|
SIGN_TYPED_DATA_V1 = "eth_signTypedData_v1",
|
|
11
11
|
SIGN_TYPED_DATA = "eth_signTypedData",
|
|
12
12
|
PERSONAL_SIGN = "personal_sign",
|
|
13
|
-
ETH_SIGN = "eth_sign"
|
|
13
|
+
ETH_SIGN = "eth_sign",
|
|
14
|
+
WALLET_ADD_ETHEREUM_CHAIN = "wallet_addEthereumChain",
|
|
15
|
+
WALLET_SWITCH_ETHEREUM_CHAIN = "wallet_switchEthereumChain",
|
|
16
|
+
WALLET_GET_ETHEREUM_CHAIN = "wallet_getEthereumChain"
|
|
14
17
|
}
|
|
15
18
|
type DappInfo = {
|
|
16
19
|
name: string;
|
|
@@ -32,49 +35,13 @@ type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWith
|
|
|
32
35
|
} | {
|
|
33
36
|
error: E;
|
|
34
37
|
};
|
|
35
|
-
interface MessageTypeProperty {
|
|
36
|
-
name: string;
|
|
37
|
-
type: string;
|
|
38
|
-
}
|
|
39
|
-
interface MessageTypes {
|
|
40
|
-
EIP712Domain: MessageTypeProperty[];
|
|
41
|
-
[additionalProperties: string]: MessageTypeProperty[];
|
|
42
|
-
}
|
|
43
|
-
interface TypedData<T extends MessageTypes> {
|
|
44
|
-
types: T;
|
|
45
|
-
primaryType: keyof T;
|
|
46
|
-
domain: Record<string, unknown>;
|
|
47
|
-
message: Record<string, unknown>;
|
|
48
|
-
}
|
|
49
|
-
type TypedDataV1 = {
|
|
50
|
-
name: string;
|
|
51
|
-
type: string;
|
|
52
|
-
value: unknown;
|
|
53
|
-
}[];
|
|
54
|
-
declare enum BannerType {
|
|
55
|
-
WARNING = "warning",
|
|
56
|
-
INFO = "info"
|
|
57
|
-
}
|
|
58
|
-
type Banner = {
|
|
59
|
-
type: BannerType;
|
|
60
|
-
title: string;
|
|
61
|
-
description: string;
|
|
62
|
-
detailedDescription?: string;
|
|
63
|
-
};
|
|
64
38
|
type DisplayData = {
|
|
65
|
-
banner?: Banner;
|
|
66
39
|
title: string;
|
|
67
|
-
dAppInfo?: {
|
|
68
|
-
name: string;
|
|
69
|
-
action: string;
|
|
70
|
-
logoUri?: string;
|
|
71
|
-
};
|
|
72
40
|
network: {
|
|
73
41
|
chainId: number;
|
|
74
42
|
name: string;
|
|
75
43
|
logoUri?: string;
|
|
76
44
|
};
|
|
77
|
-
account?: string;
|
|
78
45
|
messageDetails?: string;
|
|
79
46
|
transactionDetails?: {
|
|
80
47
|
website: string;
|
|
@@ -83,28 +50,32 @@ type DisplayData = {
|
|
|
83
50
|
data?: string;
|
|
84
51
|
};
|
|
85
52
|
networkFeeSelector?: boolean;
|
|
86
|
-
disclaimer?: string;
|
|
87
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Enum for different types of signing data.
|
|
56
|
+
*/
|
|
57
|
+
declare enum SigningDataType {
|
|
58
|
+
EVM_TRANSACTION = "evm_transaction",
|
|
59
|
+
EVM_MESSAGE_ETH_SIGN = "evm_message_eth_sign",
|
|
60
|
+
EVM_MESSAGE_PERSONAL_SIGN = "evm_message_personal_sign",
|
|
61
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA = "evm_message_eth_sign_typed_data",
|
|
62
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = "evm_message_eth_sign_typed_data_v1",
|
|
63
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = "evm_message_eth_sign_typed_data_v3",
|
|
64
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = "evm_message_eth_sign_typed_data_v4",
|
|
65
|
+
AVALANCHE_TRANSACTION = "avalanche_transaction",
|
|
66
|
+
AVALANCHE_MESSAGE = "avalanche_message",
|
|
67
|
+
BTC_TRANSACTION = "btc_transaction"
|
|
68
|
+
}
|
|
88
69
|
type SigningData = {
|
|
89
|
-
type:
|
|
70
|
+
type: SigningDataType.EVM_TRANSACTION;
|
|
90
71
|
account: string;
|
|
91
72
|
chainId: number;
|
|
92
73
|
data: TransactionRequest;
|
|
93
74
|
} | {
|
|
94
|
-
type:
|
|
75
|
+
type: SigningDataType.EVM_MESSAGE_ETH_SIGN;
|
|
95
76
|
account: string;
|
|
96
77
|
chainId: number;
|
|
97
78
|
data: string;
|
|
98
|
-
} | {
|
|
99
|
-
type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;
|
|
100
|
-
account: string;
|
|
101
|
-
chainId: number;
|
|
102
|
-
data: TypedData<MessageTypes> | TypedDataV1;
|
|
103
|
-
} | {
|
|
104
|
-
type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;
|
|
105
|
-
account: string;
|
|
106
|
-
chainId: number;
|
|
107
|
-
data: TypedData<MessageTypes>;
|
|
108
79
|
};
|
|
109
80
|
type ApprovalParams = {
|
|
110
81
|
request: RpcRequest;
|
|
@@ -122,4 +93,4 @@ interface ApprovalController {
|
|
|
122
93
|
onTransactionReverted: (txHash: Hex) => void;
|
|
123
94
|
}
|
|
124
95
|
|
|
125
|
-
export { ApprovalController, ApprovalParams, ApprovalResponse,
|
|
96
|
+
export { ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, SigningDataType };
|
package/dist/rpc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/vm-module-types",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-testGetBalance-20240722173538",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"dependencies": {
|
|
9
|
+
"zod": "3.23.8",
|
|
9
10
|
"@metamask/rpc-errors": "6.3.0",
|
|
10
|
-
"ethers": "6.8.1"
|
|
11
|
-
"zod": "3.23.8"
|
|
11
|
+
"ethers": "6.8.1"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@avalabs/coingecko-sdk": "2.8.0-alpha.187",
|
|
15
|
-
"@avalabs/glacier-sdk": "2.8.0-alpha.187",
|
|
16
|
-
"@avalabs/utils-sdk": "2.8.0-alpha.187",
|
|
17
|
-
"@types/bn.js": "5.1.5",
|
|
18
|
-
"bn.js": "5.2.1",
|
|
19
14
|
"tsup": "7.2.0",
|
|
15
|
+
"bn.js": "5.2.1",
|
|
16
|
+
"@types/bn.js": "5.1.5",
|
|
17
|
+
"@avalabs/coingecko-sdk": "v2.8.0-alpha.193",
|
|
18
|
+
"@avalabs/glacier-sdk": "v2.8.0-alpha.193",
|
|
19
|
+
"@avalabs/utils-sdk": "2.8.0-alpha.193",
|
|
20
20
|
"@internal/tsup-config": "0.0.1",
|
|
21
21
|
"eslint-config-custom": "0.0.1"
|
|
22
22
|
},
|
package/src/common.ts
CHANGED
|
@@ -17,17 +17,8 @@ export type Network = {
|
|
|
17
17
|
};
|
|
18
18
|
explorerUrl?: string;
|
|
19
19
|
logoUri?: string;
|
|
20
|
-
vmName: NetworkVMType;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
export enum NetworkVMType {
|
|
24
|
-
EVM = 'EVM',
|
|
25
|
-
BITCOIN = 'BITCOIN',
|
|
26
|
-
AVM = 'AVM',
|
|
27
|
-
PVM = 'PVM',
|
|
28
|
-
CoreEth = 'CoreEth',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
22
|
export type Storage = {
|
|
32
23
|
get: <T>(id: string) => T | undefined;
|
|
33
24
|
set: <T>(id: string, data: T) => void;
|
package/src/network-fee.ts
CHANGED
|
@@ -2,6 +2,6 @@ export type NetworkFees = {
|
|
|
2
2
|
low: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint };
|
|
3
3
|
medium: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint };
|
|
4
4
|
high: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint };
|
|
5
|
-
baseFee
|
|
5
|
+
baseFee: bigint;
|
|
6
6
|
isFixedFee: boolean;
|
|
7
7
|
};
|
package/src/rpc.ts
CHANGED
|
@@ -11,6 +11,9 @@ export enum RpcMethod {
|
|
|
11
11
|
SIGN_TYPED_DATA = 'eth_signTypedData',
|
|
12
12
|
PERSONAL_SIGN = 'personal_sign',
|
|
13
13
|
ETH_SIGN = 'eth_sign',
|
|
14
|
+
WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain',
|
|
15
|
+
WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain',
|
|
16
|
+
WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain',
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export type DappInfo = {
|
|
@@ -41,51 +44,13 @@ export type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalD
|
|
|
41
44
|
error: E;
|
|
42
45
|
};
|
|
43
46
|
|
|
44
|
-
export interface MessageTypeProperty {
|
|
45
|
-
name: string;
|
|
46
|
-
type: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface MessageTypes {
|
|
50
|
-
EIP712Domain: MessageTypeProperty[];
|
|
51
|
-
[additionalProperties: string]: MessageTypeProperty[];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface TypedData<T extends MessageTypes> {
|
|
55
|
-
types: T;
|
|
56
|
-
primaryType: keyof T;
|
|
57
|
-
domain: Record<string, unknown>;
|
|
58
|
-
message: Record<string, unknown>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type TypedDataV1 = { name: string; type: string; value: unknown }[];
|
|
62
|
-
|
|
63
|
-
export enum BannerType {
|
|
64
|
-
WARNING = 'warning',
|
|
65
|
-
INFO = 'info',
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type Banner = {
|
|
69
|
-
type: BannerType;
|
|
70
|
-
title: string;
|
|
71
|
-
description: string;
|
|
72
|
-
detailedDescription?: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
47
|
export type DisplayData = {
|
|
76
|
-
banner?: Banner;
|
|
77
48
|
title: string;
|
|
78
|
-
dAppInfo?: {
|
|
79
|
-
name: string;
|
|
80
|
-
action: string;
|
|
81
|
-
logoUri?: string;
|
|
82
|
-
};
|
|
83
49
|
network: {
|
|
84
50
|
chainId: number;
|
|
85
51
|
name: string;
|
|
86
52
|
logoUri?: string;
|
|
87
53
|
};
|
|
88
|
-
account?: string;
|
|
89
54
|
messageDetails?: string;
|
|
90
55
|
transactionDetails?: {
|
|
91
56
|
website: string;
|
|
@@ -94,33 +59,41 @@ export type DisplayData = {
|
|
|
94
59
|
data?: string;
|
|
95
60
|
};
|
|
96
61
|
networkFeeSelector?: boolean;
|
|
97
|
-
disclaimer?: string;
|
|
98
62
|
};
|
|
99
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Enum for different types of signing data.
|
|
66
|
+
*/
|
|
67
|
+
export enum SigningDataType {
|
|
68
|
+
// EVM signing data types
|
|
69
|
+
EVM_TRANSACTION = 'evm_transaction',
|
|
70
|
+
EVM_MESSAGE_ETH_SIGN = 'evm_message_eth_sign',
|
|
71
|
+
EVM_MESSAGE_PERSONAL_SIGN = 'evm_message_personal_sign',
|
|
72
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA = 'evm_message_eth_sign_typed_data',
|
|
73
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = 'evm_message_eth_sign_typed_data_v1',
|
|
74
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = 'evm_message_eth_sign_typed_data_v3',
|
|
75
|
+
EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = 'evm_message_eth_sign_typed_data_v4',
|
|
76
|
+
|
|
77
|
+
// Avalanche signing data types
|
|
78
|
+
AVALANCHE_TRANSACTION = 'avalanche_transaction',
|
|
79
|
+
AVALANCHE_MESSAGE = 'avalanche_message',
|
|
80
|
+
|
|
81
|
+
// Bitcoin signing data types
|
|
82
|
+
BTC_TRANSACTION = 'btc_transaction',
|
|
83
|
+
}
|
|
84
|
+
|
|
100
85
|
export type SigningData =
|
|
101
86
|
| {
|
|
102
|
-
type:
|
|
87
|
+
type: SigningDataType.EVM_TRANSACTION;
|
|
103
88
|
account: string;
|
|
104
89
|
chainId: number;
|
|
105
90
|
data: TransactionRequest;
|
|
106
91
|
}
|
|
107
92
|
| {
|
|
108
|
-
type:
|
|
93
|
+
type: SigningDataType.EVM_MESSAGE_ETH_SIGN;
|
|
109
94
|
account: string;
|
|
110
95
|
chainId: number;
|
|
111
96
|
data: string;
|
|
112
|
-
}
|
|
113
|
-
| {
|
|
114
|
-
type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;
|
|
115
|
-
account: string;
|
|
116
|
-
chainId: number;
|
|
117
|
-
data: TypedData<MessageTypes> | TypedDataV1;
|
|
118
|
-
}
|
|
119
|
-
| {
|
|
120
|
-
type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;
|
|
121
|
-
account: string;
|
|
122
|
-
chainId: number;
|
|
123
|
-
data: TypedData<MessageTypes>;
|
|
124
97
|
};
|
|
125
98
|
|
|
126
99
|
export type ApprovalParams = {
|
package/dist/chunk-4BNYMHOY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common.ts"],"names":["NetworkVMType","Environment"],"mappings":"AAsBO,IAAKA,OACVA,EAAA,IAAM,MACNA,EAAA,QAAU,UACVA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,QAAU,UALAA,OAAA,IAiBAC,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n vmName: NetworkVMType;\n};\n\nexport enum NetworkVMType {\n EVM = 'EVM',\n BITCOIN = 'BITCOIN',\n AVM = 'AVM',\n PVM = 'PVM',\n CoreEth = 'CoreEth',\n}\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
|
package/dist/chunk-7FBUAZNW.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var r=(e=>(e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e))(r||{}),n=(t=>(t.WARNING="warning",t.INFO="info",t))(n||{});
|
|
4
|
-
|
|
5
|
-
exports.a = r;
|
|
6
|
-
exports.b = n;
|
|
7
|
-
//# sourceMappingURL=out.js.map
|
|
8
|
-
//# sourceMappingURL=chunk-7FBUAZNW.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","BannerType"],"mappings":"AAIO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WARDA,OAAA,IA0DAC,OACVA,EAAA,QAAU,UACVA,EAAA,KAAO,OAFGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\n\nexport enum RpcMethod {\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport interface MessageTypeProperty {\n name: string;\n type: string;\n}\n\nexport interface MessageTypes {\n EIP712Domain: MessageTypeProperty[];\n [additionalProperties: string]: MessageTypeProperty[];\n}\n\nexport interface TypedData<T extends MessageTypes> {\n types: T;\n primaryType: keyof T;\n domain: Record<string, unknown>;\n message: Record<string, unknown>;\n}\n\nexport type TypedDataV1 = { name: string; type: string; value: unknown }[];\n\nexport enum BannerType {\n WARNING = 'warning',\n INFO = 'info',\n}\n\nexport type Banner = {\n type: BannerType;\n title: string;\n description: string;\n detailedDescription?: string;\n};\n\nexport type DisplayData = {\n banner?: Banner;\n title: string;\n dAppInfo?: {\n name: string;\n action: string;\n logoUri?: string;\n };\n network: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n account?: string;\n messageDetails?: string;\n transactionDetails?: {\n website: string;\n from: string;\n to: string;\n data?: string;\n };\n networkFeeSelector?: boolean;\n disclaimer?: string;\n};\n\nexport type SigningData =\n | {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n chainId: number;\n data: TransactionRequest;\n }\n | {\n type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;\n account: string;\n chainId: number;\n data: string;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;\n account: string;\n chainId: number;\n data: TypedData<MessageTypes> | TypedDataV1;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;\n account: string;\n chainId: number;\n data: TypedData<MessageTypes>;\n };\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n};\n\nexport type ApprovalResponse =\n | {\n result: Hex;\n }\n | {\n error: RpcError;\n };\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex) => void;\n onTransactionReverted: (txHash: Hex) => void;\n}\n"]}
|
package/dist/chunk-VRQJHO4F.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var r=(t=>(t.EVM="EVM",t.BITCOIN="BITCOIN",t.AVM="AVM",t.PVM="PVM",t.CoreEth="CoreEth",t))(r||{}),i=(e=>(e.PRODUCTION="production",e.DEV="dev",e))(i||{});
|
|
4
|
-
|
|
5
|
-
exports.a = r;
|
|
6
|
-
exports.b = i;
|
|
7
|
-
//# sourceMappingURL=out.js.map
|
|
8
|
-
//# sourceMappingURL=chunk-VRQJHO4F.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common.ts"],"names":["NetworkVMType","Environment"],"mappings":"AAsBO,IAAKA,OACVA,EAAA,IAAM,MACNA,EAAA,QAAU,UACVA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,QAAU,UALAA,OAAA,IAiBAC,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n vmName: NetworkVMType;\n};\n\nexport enum NetworkVMType {\n EVM = 'EVM',\n BITCOIN = 'BITCOIN',\n AVM = 'AVM',\n PVM = 'PVM',\n CoreEth = 'CoreEth',\n}\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
|
package/dist/chunk-XMGYJ4KK.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var r=(e=>(e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e))(r||{}),n=(t=>(t.WARNING="warning",t.INFO="info",t))(n||{});
|
|
2
|
-
|
|
3
|
-
export { r as a, n as b };
|
|
4
|
-
//# sourceMappingURL=out.js.map
|
|
5
|
-
//# sourceMappingURL=chunk-XMGYJ4KK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","BannerType"],"mappings":"AAIO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WARDA,OAAA,IA0DAC,OACVA,EAAA,QAAU,UACVA,EAAA,KAAO,OAFGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\n\nexport enum RpcMethod {\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport interface MessageTypeProperty {\n name: string;\n type: string;\n}\n\nexport interface MessageTypes {\n EIP712Domain: MessageTypeProperty[];\n [additionalProperties: string]: MessageTypeProperty[];\n}\n\nexport interface TypedData<T extends MessageTypes> {\n types: T;\n primaryType: keyof T;\n domain: Record<string, unknown>;\n message: Record<string, unknown>;\n}\n\nexport type TypedDataV1 = { name: string; type: string; value: unknown }[];\n\nexport enum BannerType {\n WARNING = 'warning',\n INFO = 'info',\n}\n\nexport type Banner = {\n type: BannerType;\n title: string;\n description: string;\n detailedDescription?: string;\n};\n\nexport type DisplayData = {\n banner?: Banner;\n title: string;\n dAppInfo?: {\n name: string;\n action: string;\n logoUri?: string;\n };\n network: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n account?: string;\n messageDetails?: string;\n transactionDetails?: {\n website: string;\n from: string;\n to: string;\n data?: string;\n };\n networkFeeSelector?: boolean;\n disclaimer?: string;\n};\n\nexport type SigningData =\n | {\n type: RpcMethod.ETH_SEND_TRANSACTION;\n account: string;\n chainId: number;\n data: TransactionRequest;\n }\n | {\n type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;\n account: string;\n chainId: number;\n data: string;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;\n account: string;\n chainId: number;\n data: TypedData<MessageTypes> | TypedDataV1;\n }\n | {\n type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;\n account: string;\n chainId: number;\n data: TypedData<MessageTypes>;\n };\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n};\n\nexport type ApprovalResponse =\n | {\n result: Hex;\n }\n | {\n error: RpcError;\n };\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex) => void;\n onTransactionReverted: (txHash: Hex) => void;\n}\n"]}
|