@avalabs/vm-module-types 0.0.23 → 0.1.0
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/LICENSE +9 -0
- package/package.json +6 -1
- package/.turbo/turbo-build.log +0 -140
- package/.turbo/turbo-lint.log +0 -4
- package/CHANGELOG.md +0 -108
- package/src/account.ts +0 -37
- package/src/balance.ts +0 -145
- package/src/coingecko.ts +0 -15
- package/src/common.ts +0 -43
- package/src/index.ts +0 -11
- package/src/manifest.ts +0 -40
- package/src/module.ts +0 -18
- package/src/network-fee.ts +0 -7
- package/src/rpc.ts +0 -157
- package/src/token.ts +0 -52
- package/src/transaction-history.ts +0 -113
- package/src/transaction-simulation.ts +0 -29
- package/tsconfig.json +0 -8
- package/tsup.config.ts +0 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Copyright (C) 2021, Ava Labs, Inc. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Subject to the limited license below (**”License””), you may not, and you may not permit anyone else to, copy, reproduce, aggregate, republish, download, post, distribute, license, sublicense, reverse engineer, modify, or create derivative works based on this software (collectively, **“Software”**).
|
|
4
|
+
|
|
5
|
+
You are hereby granted a limited, non-exclusive, non-sublicensable and non-transferable license to download and use the Software as-is solely (i) for use in connection with the Avalanche Public Blockchain platform, having a NetworkID of 1 (Mainnet) or 5 (Fuji), and associated blockchains, comprised exclusively of the Avalanche X-Chain, C-Chain, P-Chain and any subnets linked to the P-Chain (**“Avalanche Authorized Platform”**) or (ii) for non-production, testing or research purposes without any commercial application within the Avalanche ecosystem (**“Non-Commercial Use”**); provided that, in each case, you may not use or allow use of the Software (a) in connection with any forks of the Avalanche Authorized Platform, (b) in any manner not operationally connected to the Avalanche Authorized Platform other than for Non-Commercial Use, or (c) to the extent the number of monthly active users or the number of total installs of any software that uses the Software across all versions thereof exceeds 10,000 at any time. You may not modify or alter the Software in any way.
|
|
6
|
+
|
|
7
|
+
You hereby acknowledge and agree to the terms set forth at www.avalabs.org/important-notice.
|
|
8
|
+
|
|
9
|
+
**TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, AND AVA LABS EXPRESSLY DISCLAIMS AND EXCLUDES ALL REPRESENTATIONS, WARRANTIES AND OTHER TERMS AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION BY OPERATION OF LAW OR BY CUSTOM, STATUTE OR OTHERWISE, AND INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY, TERM, OR CONDITION OF NON-INFRINGEMENT, MERCHANTABILITY, TITLE, OR FITNESS FOR PARTICULAR PURPOSE. YOU USE THE SOFTWARE AT YOUR OWN RISK. AVA LABS EXPRESSLY DISCLAIMS ALL LIABILITY (INCLUDING FOR ALL DIRECT, CONSEQUENTIAL OR OTHER DAMAGES OR LOSSES) RELATED TO ANY USE OF THE SOFTWARE.**
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/vm-module-types",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"manifest.json"
|
|
11
|
+
],
|
|
12
|
+
"license": "Limited Ecosystem License",
|
|
8
13
|
"dependencies": {
|
|
9
14
|
"zod": "3.23.8",
|
|
10
15
|
"@metamask/rpc-errors": "6.3.0",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @avalabs/vm-module-types@0.0.23 build /home/runner/work/vm-modules/vm-modules/packages/types
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
[34mCLI[39m Building entry: src/account.ts, 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, src/transaction-simulation.ts
|
|
6
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v7.2.0
|
|
8
|
-
[34mCLI[39m Using tsup config: /home/runner/work/vm-modules/vm-modules/packages/types/tsup.config.ts
|
|
9
|
-
[34mCLI[39m Target: es2021
|
|
10
|
-
[34mCLI[39m Cleaning output folder
|
|
11
|
-
[34mCJS[39m Build start
|
|
12
|
-
[34mESM[39m Build start
|
|
13
|
-
Generated an empty chunk: "chunk-47KTBBRA".
|
|
14
|
-
Generated an empty chunk: "chunk-JUV577XH".
|
|
15
|
-
Generated an empty chunk: "chunk-OGQBQHLH".
|
|
16
|
-
Generated an empty chunk: "chunk-AILYKQEY".
|
|
17
|
-
Generated an empty chunk: "chunk-P6AM7I3B".
|
|
18
|
-
Generated an empty chunk: "chunk-BHB5UV3J".
|
|
19
|
-
Generated an empty chunk: "chunk-CUVJNZP5".
|
|
20
|
-
Generated an empty chunk: "chunk-7U2R34EQ".
|
|
21
|
-
[32mCJS[39m [1mdist/chunk-YVYCETG2.cjs [22m[32m483.00 B[39m
|
|
22
|
-
[32mCJS[39m [1mdist/chunk-2KGTZTXY.cjs [22m[32m219.00 B[39m
|
|
23
|
-
[32mCJS[39m [1mdist/chunk-B6DAZDIA.cjs [22m[32m1.21 KB[39m
|
|
24
|
-
[32mCJS[39m [1mdist/chunk-47KTBBRA.cjs [22m[32m90.00 B[39m
|
|
25
|
-
[32mCJS[39m [1mdist/chunk-TCBFAMPS.cjs [22m[32m240.00 B[39m
|
|
26
|
-
[32mCJS[39m [1mdist/chunk-JUV577XH.cjs [22m[32m90.00 B[39m
|
|
27
|
-
[32mCJS[39m [1mdist/chunk-VRQJHO4F.cjs [22m[32m276.00 B[39m
|
|
28
|
-
[32mCJS[39m [1mdist/chunk-OGQBQHLH.cjs [22m[32m90.00 B[39m
|
|
29
|
-
[32mCJS[39m [1mdist/chunk-AILYKQEY.cjs [22m[32m90.00 B[39m
|
|
30
|
-
[32mCJS[39m [1mdist/rpc.cjs [22m[32m377.00 B[39m
|
|
31
|
-
[32mCJS[39m [1mdist/token.cjs [22m[32m260.00 B[39m
|
|
32
|
-
[32mCJS[39m [1mdist/transaction-history.cjs [22m[32m542.00 B[39m
|
|
33
|
-
[32mCJS[39m [1mdist/transaction-simulation.cjs [22m[32m132.00 B[39m
|
|
34
|
-
[32mCJS[39m [1mdist/account.cjs [22m[32m263.00 B[39m
|
|
35
|
-
[32mCJS[39m [1mdist/balance.cjs [22m[32m117.00 B[39m
|
|
36
|
-
[32mCJS[39m [1mdist/coingecko.cjs [22m[32m418.00 B[39m
|
|
37
|
-
[32mCJS[39m [1mdist/common.cjs [22m[32m386.00 B[39m
|
|
38
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m2.07 KB[39m
|
|
39
|
-
[32mCJS[39m [1mdist/chunk-4PGCXP4C.cjs [22m[32m433.00 B[39m
|
|
40
|
-
[32mCJS[39m [1mdist/manifest.cjs [22m[32m267.00 B[39m
|
|
41
|
-
[32mCJS[39m [1mdist/chunk-74SNNWSF.cjs [22m[32m667.00 B[39m
|
|
42
|
-
[32mCJS[39m [1mdist/module.cjs [22m[32m116.00 B[39m
|
|
43
|
-
[32mCJS[39m [1mdist/network-fee.cjs [22m[32m121.00 B[39m
|
|
44
|
-
[32mCJS[39m [1mdist/chunk-YVYCETG2.cjs.map [22m[32m4.03 KB[39m
|
|
45
|
-
[32mCJS[39m [1mdist/chunk-2KGTZTXY.cjs.map [22m[32m1.18 KB[39m
|
|
46
|
-
[32mCJS[39m [1mdist/chunk-B6DAZDIA.cjs.map [22m[32m3.72 KB[39m
|
|
47
|
-
[32mCJS[39m [1mdist/chunk-47KTBBRA.cjs.map [22m[32m51.00 B[39m
|
|
48
|
-
[32mCJS[39m [1mdist/chunk-TCBFAMPS.cjs.map [22m[32m997.00 B[39m
|
|
49
|
-
[32mCJS[39m [1mdist/chunk-JUV577XH.cjs.map [22m[32m51.00 B[39m
|
|
50
|
-
[32mCJS[39m [1mdist/chunk-VRQJHO4F.cjs.map [22m[32m1.08 KB[39m
|
|
51
|
-
[32mCJS[39m [1mdist/chunk-OGQBQHLH.cjs.map [22m[32m51.00 B[39m
|
|
52
|
-
[32mCJS[39m [1mdist/chunk-AILYKQEY.cjs.map [22m[32m51.00 B[39m
|
|
53
|
-
[32mCJS[39m [1mdist/rpc.cjs.map [22m[32m51.00 B[39m
|
|
54
|
-
[32mCJS[39m [1mdist/token.cjs.map [22m[32m51.00 B[39m
|
|
55
|
-
[32mCJS[39m [1mdist/transaction-history.cjs.map [22m[32m51.00 B[39m
|
|
56
|
-
[32mCJS[39m [1mdist/transaction-simulation.cjs.map [22m[32m51.00 B[39m
|
|
57
|
-
[32mCJS[39m [1mdist/account.cjs.map [22m[32m51.00 B[39m
|
|
58
|
-
[32mCJS[39m [1mdist/balance.cjs.map [22m[32m51.00 B[39m
|
|
59
|
-
[32mCJS[39m [1mdist/coingecko.cjs.map [22m[32m51.00 B[39m
|
|
60
|
-
[32mCJS[39m [1mdist/common.cjs.map [22m[32m51.00 B[39m
|
|
61
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m51.00 B[39m
|
|
62
|
-
[32mCJS[39m [1mdist/chunk-4PGCXP4C.cjs.map [22m[32m1.24 KB[39m
|
|
63
|
-
[32mCJS[39m [1mdist/manifest.cjs.map [22m[32m51.00 B[39m
|
|
64
|
-
[32mCJS[39m [1mdist/chunk-74SNNWSF.cjs.map [22m[32m1.65 KB[39m
|
|
65
|
-
[32mCJS[39m [1mdist/module.cjs.map [22m[32m51.00 B[39m
|
|
66
|
-
[32mCJS[39m [1mdist/network-fee.cjs.map [22m[32m51.00 B[39m
|
|
67
|
-
[32mCJS[39m ⚡️ Build success in 1489ms
|
|
68
|
-
[32mESM[39m [1mdist/chunk-RKFOXZ35.js [22m[32m464.00 B[39m
|
|
69
|
-
[32mESM[39m [1mdist/chunk-7Y6UGMPZ.js [22m[32m207.00 B[39m
|
|
70
|
-
[32mESM[39m [1mdist/chunk-7JLXTNPE.js [22m[32m1.18 KB[39m
|
|
71
|
-
[32mESM[39m [1mdist/chunk-P6AM7I3B.js [22m[32m75.00 B[39m
|
|
72
|
-
[32mESM[39m [1mdist/chunk-RIBT5FN6.js [22m[32m228.00 B[39m
|
|
73
|
-
[32mESM[39m [1mdist/chunk-BHB5UV3J.js [22m[32m75.00 B[39m
|
|
74
|
-
[32mESM[39m [1mdist/chunk-4BNYMHOY.js [22m[32m257.00 B[39m
|
|
75
|
-
[32mESM[39m [1mdist/chunk-CUVJNZP5.js [22m[32m75.00 B[39m
|
|
76
|
-
[32mESM[39m [1mdist/chunk-7U2R34EQ.js [22m[32m75.00 B[39m
|
|
77
|
-
[32mESM[39m [1mdist/rpc.js [22m[32m133.00 B[39m
|
|
78
|
-
[32mESM[39m [1mdist/token.js [22m[32m119.00 B[39m
|
|
79
|
-
[32mESM[39m [1mdist/transaction-history.js [22m[32m195.00 B[39m
|
|
80
|
-
[32mESM[39m [1mdist/transaction-simulation.js [22m[32m112.00 B[39m
|
|
81
|
-
[32mESM[39m [1mdist/account.js [22m[32m122.00 B[39m
|
|
82
|
-
[32mESM[39m [1mdist/balance.js [22m[32m97.00 B[39m
|
|
83
|
-
[32mESM[39m [1mdist/coingecko.js [22m[32m174.00 B[39m
|
|
84
|
-
[32mESM[39m [1mdist/common.js [22m[32m142.00 B[39m
|
|
85
|
-
[32mESM[39m [1mdist/index.js [22m[32m719.00 B[39m
|
|
86
|
-
[32mESM[39m [1mdist/chunk-WOO6UGSQ.js [22m[32m394.00 B[39m
|
|
87
|
-
[32mESM[39m [1mdist/manifest.js [22m[32m126.00 B[39m
|
|
88
|
-
[32mESM[39m [1mdist/chunk-A4YEBDMG.js [22m[32m592.00 B[39m
|
|
89
|
-
[32mESM[39m [1mdist/module.js [22m[32m96.00 B[39m
|
|
90
|
-
[32mESM[39m [1mdist/network-fee.js [22m[32m101.00 B[39m
|
|
91
|
-
[32mESM[39m [1mdist/chunk-RKFOXZ35.js.map [22m[32m4.03 KB[39m
|
|
92
|
-
[32mESM[39m [1mdist/chunk-7Y6UGMPZ.js.map [22m[32m1.18 KB[39m
|
|
93
|
-
[32mESM[39m [1mdist/chunk-7JLXTNPE.js.map [22m[32m3.72 KB[39m
|
|
94
|
-
[32mESM[39m [1mdist/chunk-P6AM7I3B.js.map [22m[32m51.00 B[39m
|
|
95
|
-
[32mESM[39m [1mdist/chunk-RIBT5FN6.js.map [22m[32m997.00 B[39m
|
|
96
|
-
[32mESM[39m [1mdist/chunk-BHB5UV3J.js.map [22m[32m51.00 B[39m
|
|
97
|
-
[32mESM[39m [1mdist/chunk-4BNYMHOY.js.map [22m[32m1.08 KB[39m
|
|
98
|
-
[32mESM[39m [1mdist/chunk-CUVJNZP5.js.map [22m[32m51.00 B[39m
|
|
99
|
-
[32mESM[39m [1mdist/chunk-7U2R34EQ.js.map [22m[32m51.00 B[39m
|
|
100
|
-
[32mESM[39m [1mdist/rpc.js.map [22m[32m51.00 B[39m
|
|
101
|
-
[32mESM[39m [1mdist/token.js.map [22m[32m51.00 B[39m
|
|
102
|
-
[32mESM[39m [1mdist/transaction-history.js.map [22m[32m51.00 B[39m
|
|
103
|
-
[32mESM[39m [1mdist/transaction-simulation.js.map [22m[32m51.00 B[39m
|
|
104
|
-
[32mESM[39m [1mdist/account.js.map [22m[32m51.00 B[39m
|
|
105
|
-
[32mESM[39m [1mdist/balance.js.map [22m[32m51.00 B[39m
|
|
106
|
-
[32mESM[39m [1mdist/coingecko.js.map [22m[32m51.00 B[39m
|
|
107
|
-
[32mESM[39m [1mdist/common.js.map [22m[32m51.00 B[39m
|
|
108
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m51.00 B[39m
|
|
109
|
-
[32mESM[39m [1mdist/chunk-WOO6UGSQ.js.map [22m[32m1.24 KB[39m
|
|
110
|
-
[32mESM[39m [1mdist/manifest.js.map [22m[32m51.00 B[39m
|
|
111
|
-
[32mESM[39m [1mdist/chunk-A4YEBDMG.js.map [22m[32m1.65 KB[39m
|
|
112
|
-
[32mESM[39m [1mdist/module.js.map [22m[32m51.00 B[39m
|
|
113
|
-
[32mESM[39m [1mdist/network-fee.js.map [22m[32m51.00 B[39m
|
|
114
|
-
[32mESM[39m ⚡️ Build success in 1500ms
|
|
115
|
-
[34mDTS[39m Build start
|
|
116
|
-
[32mDTS[39m ⚡️ Build success in 10489ms
|
|
117
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m1.53 KB[39m
|
|
118
|
-
[32mDTS[39m [1mdist/coingecko.d.cts [22m[32m1.09 KB[39m
|
|
119
|
-
[32mDTS[39m [1mdist/module.d.cts [22m[32m1.13 KB[39m
|
|
120
|
-
[32mDTS[39m [1mdist/account.d.cts [22m[32m841.00 B[39m
|
|
121
|
-
[32mDTS[39m [1mdist/balance.d.cts [22m[32m3.80 KB[39m
|
|
122
|
-
[32mDTS[39m [1mdist/manifest.d.cts [22m[32m6.95 KB[39m
|
|
123
|
-
[32mDTS[39m [1mdist/network-fee.d.cts [22m[32m361.00 B[39m
|
|
124
|
-
[32mDTS[39m [1mdist/rpc.d.cts [22m[32m3.65 KB[39m
|
|
125
|
-
[32mDTS[39m [1mdist/transaction-history.d.cts [22m[32m2.91 KB[39m
|
|
126
|
-
[32mDTS[39m [1mdist/common.d.cts [22m[32m902.00 B[39m
|
|
127
|
-
[32mDTS[39m [1mdist/transaction-simulation.d.cts [22m[32m642.00 B[39m
|
|
128
|
-
[32mDTS[39m [1mdist/token.d.cts [22m[32m1.05 KB[39m
|
|
129
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.52 KB[39m
|
|
130
|
-
[32mDTS[39m [1mdist/coingecko.d.ts [22m[32m1.09 KB[39m
|
|
131
|
-
[32mDTS[39m [1mdist/module.d.ts [22m[32m1.12 KB[39m
|
|
132
|
-
[32mDTS[39m [1mdist/account.d.ts [22m[32m841.00 B[39m
|
|
133
|
-
[32mDTS[39m [1mdist/balance.d.ts [22m[32m3.80 KB[39m
|
|
134
|
-
[32mDTS[39m [1mdist/manifest.d.ts [22m[32m6.95 KB[39m
|
|
135
|
-
[32mDTS[39m [1mdist/network-fee.d.ts [22m[32m361.00 B[39m
|
|
136
|
-
[32mDTS[39m [1mdist/rpc.d.ts [22m[32m3.65 KB[39m
|
|
137
|
-
[32mDTS[39m [1mdist/transaction-history.d.ts [22m[32m2.91 KB[39m
|
|
138
|
-
[32mDTS[39m [1mdist/common.d.ts [22m[32m901.00 B[39m
|
|
139
|
-
[32mDTS[39m [1mdist/transaction-simulation.d.ts [22m[32m641.00 B[39m
|
|
140
|
-
[32mDTS[39m [1mdist/token.d.ts [22m[32m1.05 KB[39m
|
package/.turbo/turbo-lint.log
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
# @avalabs/vm-module-types
|
|
2
|
-
|
|
3
|
-
## 0.0.23
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- fbdefd2: Replace BN with bigint
|
|
8
|
-
|
|
9
|
-
## 0.0.22
|
|
10
|
-
|
|
11
|
-
## 0.0.21
|
|
12
|
-
|
|
13
|
-
## 0.0.20
|
|
14
|
-
|
|
15
|
-
### Patch Changes
|
|
16
|
-
|
|
17
|
-
- 9bfa82d: Implement balance fetching for BitcoinModule
|
|
18
|
-
|
|
19
|
-
## 0.0.19
|
|
20
|
-
|
|
21
|
-
### Patch Changes
|
|
22
|
-
|
|
23
|
-
- 5af458b: Add getBalances to avalanche-module
|
|
24
|
-
|
|
25
|
-
## 0.0.18
|
|
26
|
-
|
|
27
|
-
## 0.0.17
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- 3590edf: Transaction parsing, validation and simulation for EVM
|
|
32
|
-
|
|
33
|
-
## 0.0.16
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- bc48457: add support for all eth_sign methods
|
|
38
|
-
|
|
39
|
-
## 0.0.15
|
|
40
|
-
|
|
41
|
-
### Patch Changes
|
|
42
|
-
|
|
43
|
-
- f536d58: add module functions to evm-module
|
|
44
|
-
|
|
45
|
-
## 0.0.14
|
|
46
|
-
|
|
47
|
-
### Patch Changes
|
|
48
|
-
|
|
49
|
-
- 0593258: add getBalances to evm-module
|
|
50
|
-
|
|
51
|
-
## 0.0.13
|
|
52
|
-
|
|
53
|
-
### Patch Changes
|
|
54
|
-
|
|
55
|
-
- af68c81: Add getTransactionHistory to avalanche module
|
|
56
|
-
- d9fa0f5: added getNetworkFee to avalanche module
|
|
57
|
-
|
|
58
|
-
## 0.0.12
|
|
59
|
-
|
|
60
|
-
### Patch Changes
|
|
61
|
-
|
|
62
|
-
- cd97708: fix: build types package
|
|
63
|
-
- d0c2cc9: make module interface more consistent
|
|
64
|
-
- 7bc6c6e: add eth_sendTransaction handler
|
|
65
|
-
|
|
66
|
-
## 0.0.11
|
|
67
|
-
|
|
68
|
-
## 0.0.10
|
|
69
|
-
|
|
70
|
-
### Patch Changes
|
|
71
|
-
|
|
72
|
-
- 60f36fa: add getTokens function
|
|
73
|
-
|
|
74
|
-
## 0.0.9
|
|
75
|
-
|
|
76
|
-
### Patch Changes
|
|
77
|
-
|
|
78
|
-
- 6ffa356: add module functions to evm-module
|
|
79
|
-
|
|
80
|
-
## 0.0.8
|
|
81
|
-
|
|
82
|
-
### Patch Changes
|
|
83
|
-
|
|
84
|
-
- d1d080f: test release
|
|
85
|
-
|
|
86
|
-
## 0.0.7
|
|
87
|
-
|
|
88
|
-
### Patch Changes
|
|
89
|
-
|
|
90
|
-
- bb98621: Move types to @avalabs/vm-module-types
|
|
91
|
-
|
|
92
|
-
## 0.0.6
|
|
93
|
-
|
|
94
|
-
### Patch Changes
|
|
95
|
-
|
|
96
|
-
- 1122704: test release
|
|
97
|
-
|
|
98
|
-
## 0.0.3
|
|
99
|
-
|
|
100
|
-
### Patch Changes
|
|
101
|
-
|
|
102
|
-
- 0b0c52e: Move types to @avalabs/vm-module-types
|
|
103
|
-
|
|
104
|
-
## 0.0.2
|
|
105
|
-
|
|
106
|
-
### Patch Changes
|
|
107
|
-
|
|
108
|
-
- 4b7d5e9: Move types from packages-internal/types to packages/types
|
package/src/account.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export enum WalletType {
|
|
2
|
-
// Primary wallet types
|
|
3
|
-
Mnemonic = 'mnemonic',
|
|
4
|
-
Ledger = 'ledger',
|
|
5
|
-
LedgerLive = 'ledger-live',
|
|
6
|
-
Keystone = 'keystone',
|
|
7
|
-
Seedless = 'seedless',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type GetAddressParams = {
|
|
11
|
-
walletType: WalletType;
|
|
12
|
-
accountIndex: number;
|
|
13
|
-
xpub: string;
|
|
14
|
-
xpubXP?: string;
|
|
15
|
-
isTestnet?: boolean;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type GetAddressResponse = Record<string, string>;
|
|
19
|
-
|
|
20
|
-
export type PubKeyType = {
|
|
21
|
-
evm: string;
|
|
22
|
-
/**
|
|
23
|
-
* Public keys used for X/P chain are from a different derivation path.
|
|
24
|
-
*/
|
|
25
|
-
xp?: string;
|
|
26
|
-
btcWalletPolicyDetails?: BtcWalletPolicyDetails;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type BtcWalletPolicyDetails = {
|
|
30
|
-
hmacHex: string;
|
|
31
|
-
/**
|
|
32
|
-
* Extended public key of m/44'/60'/n
|
|
33
|
-
*/
|
|
34
|
-
xpub: string;
|
|
35
|
-
masterFingerprint: string;
|
|
36
|
-
name: string;
|
|
37
|
-
};
|
package/src/balance.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import type { Storage, Network } from './common';
|
|
2
|
-
import type { NetworkContractToken, NetworkToken, TokenType } from './token';
|
|
3
|
-
import type { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
|
|
4
|
-
|
|
5
|
-
export type GetBalancesParams = {
|
|
6
|
-
addresses: string[];
|
|
7
|
-
network: Network;
|
|
8
|
-
customTokens?: NetworkContractToken[];
|
|
9
|
-
currency: string;
|
|
10
|
-
storage?: Storage;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type TokenBalanceData = {
|
|
14
|
-
type: TokenType;
|
|
15
|
-
name: string;
|
|
16
|
-
symbol: string;
|
|
17
|
-
balance: bigint;
|
|
18
|
-
balanceDisplayValue: string;
|
|
19
|
-
balanceInCurrency?: number;
|
|
20
|
-
balanceCurrencyDisplayValue?: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type TokenMarketData = {
|
|
24
|
-
priceInCurrency?: number;
|
|
25
|
-
priceChanges?: {
|
|
26
|
-
percentage?: number;
|
|
27
|
-
value?: number;
|
|
28
|
-
};
|
|
29
|
-
marketCap?: number;
|
|
30
|
-
change24?: number;
|
|
31
|
-
vol24?: number;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type NetworkTokenWithBalance = TokenBalanceDataWithDecimals &
|
|
35
|
-
NetworkToken &
|
|
36
|
-
TokenMarketData & {
|
|
37
|
-
coingeckoId: string;
|
|
38
|
-
type: TokenType.NATIVE;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
interface TokenBalanceDataWithDecimals extends TokenBalanceData {
|
|
42
|
-
decimals: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* EVM TokenWithBalance interface.
|
|
47
|
-
*/
|
|
48
|
-
export type TokenWithBalanceERC20 = TokenBalanceDataWithDecimals &
|
|
49
|
-
TokenMarketData &
|
|
50
|
-
NetworkContractToken & {
|
|
51
|
-
type: TokenType.ERC20;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type TokenWithBalanceEVM = NetworkTokenWithBalance | TokenWithBalanceERC20;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Bitcoin TokenWithBalance interface.
|
|
58
|
-
*/
|
|
59
|
-
interface BitcoinInputUTXO {
|
|
60
|
-
txHash: string;
|
|
61
|
-
txHex?: string;
|
|
62
|
-
index: number;
|
|
63
|
-
value: number;
|
|
64
|
-
script: string;
|
|
65
|
-
blockHeight: number;
|
|
66
|
-
confirmations: number;
|
|
67
|
-
confirmedTime?: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface BitcoinInputUTXOWithOptionalScript extends Omit<BitcoinInputUTXO, 'script'> {
|
|
71
|
-
script?: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
|
|
75
|
-
logoUri: string;
|
|
76
|
-
utxos: BitcoinInputUTXOWithOptionalScript[];
|
|
77
|
-
utxosUnconfirmed?: BitcoinInputUTXOWithOptionalScript[];
|
|
78
|
-
unconfirmedBalance?: bigint;
|
|
79
|
-
unconfirmedBalanceDisplayValue?: string;
|
|
80
|
-
unconfirmedBalanceCurrencyDisplayValue?: string;
|
|
81
|
-
unconfirmedBalanceInCurrency?: number;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Avalanche TokenWithBalance interface.
|
|
86
|
-
*/
|
|
87
|
-
export interface TokenWithBalancePVM extends NetworkTokenWithBalance {
|
|
88
|
-
available?: bigint;
|
|
89
|
-
availableInCurrency?: number;
|
|
90
|
-
availableDisplayValue?: string;
|
|
91
|
-
availableCurrencyDisplayValue?: string;
|
|
92
|
-
utxos?: PChainBalance;
|
|
93
|
-
balancePerType: {
|
|
94
|
-
lockedStaked: number;
|
|
95
|
-
lockedStakeable: number;
|
|
96
|
-
lockedPlatform: number;
|
|
97
|
-
atomicMemoryLocked: number;
|
|
98
|
-
atomicMemoryUnlocked: number;
|
|
99
|
-
unlockedUnstaked: number;
|
|
100
|
-
unlockedStaked: number;
|
|
101
|
-
pendingStaked: number;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
|
|
106
|
-
available?: bigint;
|
|
107
|
-
availableInCurrency?: number;
|
|
108
|
-
availableDisplayValue?: string;
|
|
109
|
-
availableCurrencyDisplayValue?: string;
|
|
110
|
-
utxos?: XChainBalances;
|
|
111
|
-
balancePerType: {
|
|
112
|
-
locked: number;
|
|
113
|
-
unlocked: number;
|
|
114
|
-
atomicMemoryUnlocked: number;
|
|
115
|
-
atomicMemoryLocked: number;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type'> {
|
|
120
|
-
type: TokenType.ERC721 | TokenType.ERC1155;
|
|
121
|
-
address: string;
|
|
122
|
-
description: string;
|
|
123
|
-
logoUri: string;
|
|
124
|
-
logoSmall: string;
|
|
125
|
-
name: string;
|
|
126
|
-
symbol: string;
|
|
127
|
-
tokenId: string;
|
|
128
|
-
attributes: TokenAttribute[];
|
|
129
|
-
collectionName: string;
|
|
130
|
-
updatedAt?: number;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface TokenAttribute {
|
|
134
|
-
name: string;
|
|
135
|
-
value: string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export type TokenWithBalance =
|
|
139
|
-
| TokenWithBalanceEVM
|
|
140
|
-
| TokenWithBalanceBTC
|
|
141
|
-
| TokenWithBalancePVM
|
|
142
|
-
| TokenWithBalanceAVM
|
|
143
|
-
| NftTokenWithBalance;
|
|
144
|
-
|
|
145
|
-
export type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
|
package/src/coingecko.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { number, object, record, z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const SimplePriceInCurrency = object({
|
|
4
|
-
price: number().optional().nullable(),
|
|
5
|
-
change24: number().optional().nullable(),
|
|
6
|
-
marketCap: number().optional().nullable(),
|
|
7
|
-
vol24: number().optional().nullable(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const SimplePriceInCurrencyResponseSchema = record(SimplePriceInCurrency);
|
|
11
|
-
export const SimplePriceResponseSchema = record(SimplePriceInCurrencyResponseSchema);
|
|
12
|
-
export type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
|
|
13
|
-
|
|
14
|
-
export const RawSimplePriceResponseSchema = record(record(number().nullable().optional()));
|
|
15
|
-
export type RawSimplePriceResponse = z.infer<typeof RawSimplePriceResponseSchema>;
|
package/src/common.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { NetworkToken } from './token';
|
|
2
|
-
|
|
3
|
-
export type Network = {
|
|
4
|
-
isTestnet?: boolean;
|
|
5
|
-
chainId: number;
|
|
6
|
-
chainName: string;
|
|
7
|
-
rpcUrl: string;
|
|
8
|
-
utilityAddresses?: {
|
|
9
|
-
multicall: string;
|
|
10
|
-
};
|
|
11
|
-
networkToken: NetworkToken;
|
|
12
|
-
pricingProviders?: {
|
|
13
|
-
coingecko: {
|
|
14
|
-
assetPlatformId?: string;
|
|
15
|
-
nativeTokenId?: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
explorerUrl?: string;
|
|
19
|
-
logoUri?: string;
|
|
20
|
-
vmName: NetworkVMType;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export enum NetworkVMType {
|
|
24
|
-
EVM = 'EVM',
|
|
25
|
-
BITCOIN = 'BITCOIN',
|
|
26
|
-
AVM = 'AVM',
|
|
27
|
-
PVM = 'PVM',
|
|
28
|
-
CoreEth = 'CoreEth',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type Storage = {
|
|
32
|
-
get: <T>(id: string) => T | undefined;
|
|
33
|
-
set: <T>(id: string, data: T) => void;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type Caip2ChainId = string;
|
|
37
|
-
|
|
38
|
-
export type Hex = `0x${string}`;
|
|
39
|
-
|
|
40
|
-
export enum Environment {
|
|
41
|
-
PRODUCTION = 'production',
|
|
42
|
-
DEV = 'dev',
|
|
43
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './coingecko';
|
|
3
|
-
export * from './balance';
|
|
4
|
-
export * from './manifest';
|
|
5
|
-
export * from './module';
|
|
6
|
-
export * from './network-fee';
|
|
7
|
-
export * from './rpc';
|
|
8
|
-
export * from './token';
|
|
9
|
-
export * from './transaction-history';
|
|
10
|
-
export * from './transaction-simulation';
|
|
11
|
-
export * from './account';
|
package/src/manifest.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { boolean, object, string, z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const sourceSchema = object({
|
|
4
|
-
checksum: string(),
|
|
5
|
-
location: object({
|
|
6
|
-
npm: object({
|
|
7
|
-
filePath: string(),
|
|
8
|
-
packageName: string(),
|
|
9
|
-
registry: string(),
|
|
10
|
-
}),
|
|
11
|
-
}),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const manifestSchema = object({
|
|
15
|
-
name: string(),
|
|
16
|
-
version: string(),
|
|
17
|
-
description: string(),
|
|
18
|
-
sources: object({
|
|
19
|
-
module: sourceSchema,
|
|
20
|
-
provider: sourceSchema.optional(),
|
|
21
|
-
}),
|
|
22
|
-
network: object({
|
|
23
|
-
chainIds: string().array(),
|
|
24
|
-
namespaces: string().array(),
|
|
25
|
-
}),
|
|
26
|
-
cointype: string(),
|
|
27
|
-
permissions: object({
|
|
28
|
-
rpc: object({
|
|
29
|
-
dapps: boolean(),
|
|
30
|
-
methods: string().array(),
|
|
31
|
-
}),
|
|
32
|
-
}),
|
|
33
|
-
manifestVersion: string(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export type Manifest = z.infer<typeof manifestSchema>;
|
|
37
|
-
|
|
38
|
-
export const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {
|
|
39
|
-
return manifestSchema.safeParse(params);
|
|
40
|
-
};
|
package/src/module.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { GetAddressParams, GetAddressResponse } from './account';
|
|
2
|
-
import type { GetBalancesParams, GetBalancesResponse } from './balance';
|
|
3
|
-
import type { Network } from './common';
|
|
4
|
-
import type { Manifest } from './manifest';
|
|
5
|
-
import type { NetworkFees } from './network-fee';
|
|
6
|
-
import type { RpcRequest, RpcResponse } from './rpc';
|
|
7
|
-
import type { NetworkContractToken } from './token';
|
|
8
|
-
import type { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history';
|
|
9
|
-
|
|
10
|
-
export interface Module {
|
|
11
|
-
getManifest: () => Manifest | undefined;
|
|
12
|
-
getBalances: (params: GetBalancesParams) => Promise<GetBalancesResponse>;
|
|
13
|
-
getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
|
|
14
|
-
getNetworkFee: (network: Network) => Promise<NetworkFees>;
|
|
15
|
-
getAddress: (params: GetAddressParams) => Promise<GetAddressResponse>;
|
|
16
|
-
getTokens: (network: Network) => Promise<NetworkContractToken[]>;
|
|
17
|
-
onRpcRequest: (request: RpcRequest, chain: Network) => Promise<RpcResponse>;
|
|
18
|
-
}
|
package/src/network-fee.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type NetworkFees = {
|
|
2
|
-
low: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint };
|
|
3
|
-
medium: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint };
|
|
4
|
-
high: { maxFeePerGas: bigint; maxPriorityFeePerGas?: bigint };
|
|
5
|
-
baseFee?: bigint;
|
|
6
|
-
isFixedFee: boolean;
|
|
7
|
-
};
|
package/src/rpc.ts
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import type { TransactionRequest } from 'ethers';
|
|
2
|
-
import type { Caip2ChainId, Hex } from './common';
|
|
3
|
-
import type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';
|
|
4
|
-
import type { BalanceChange, TokenApprovals } from './transaction-simulation';
|
|
5
|
-
|
|
6
|
-
export enum RpcMethod {
|
|
7
|
-
/* EVM */
|
|
8
|
-
ETH_SEND_TRANSACTION = 'eth_sendTransaction',
|
|
9
|
-
SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',
|
|
10
|
-
SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',
|
|
11
|
-
SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',
|
|
12
|
-
SIGN_TYPED_DATA = 'eth_signTypedData',
|
|
13
|
-
PERSONAL_SIGN = 'personal_sign',
|
|
14
|
-
ETH_SIGN = 'eth_sign',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type DappInfo = {
|
|
18
|
-
name: string;
|
|
19
|
-
url: string;
|
|
20
|
-
icon: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type RpcRequest = {
|
|
24
|
-
requestId: string;
|
|
25
|
-
sessionId: string;
|
|
26
|
-
method: RpcMethod;
|
|
27
|
-
chainId: Caip2ChainId;
|
|
28
|
-
params: unknown;
|
|
29
|
-
dappInfo: DappInfo;
|
|
30
|
-
context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type RpcError =
|
|
34
|
-
| JsonRpcError<OptionalDataWithOptionalCause>
|
|
35
|
-
| EthereumProviderError<OptionalDataWithOptionalCause>;
|
|
36
|
-
|
|
37
|
-
export type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =
|
|
38
|
-
| {
|
|
39
|
-
result: R;
|
|
40
|
-
}
|
|
41
|
-
| {
|
|
42
|
-
error: E;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export interface MessageTypeProperty {
|
|
46
|
-
name: string;
|
|
47
|
-
type: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface MessageTypes {
|
|
51
|
-
EIP712Domain: MessageTypeProperty[];
|
|
52
|
-
[additionalProperties: string]: MessageTypeProperty[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface TypedData<T extends MessageTypes> {
|
|
56
|
-
types: T;
|
|
57
|
-
primaryType: keyof T;
|
|
58
|
-
domain: Record<string, unknown>;
|
|
59
|
-
message: Record<string, unknown>;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type TypedDataV1 = { name: string; type: string; value: unknown }[];
|
|
63
|
-
|
|
64
|
-
export type DisplayData = {
|
|
65
|
-
title: string;
|
|
66
|
-
dAppInfo?: {
|
|
67
|
-
name: string;
|
|
68
|
-
action: string;
|
|
69
|
-
logoUri?: string;
|
|
70
|
-
};
|
|
71
|
-
network: {
|
|
72
|
-
chainId: number;
|
|
73
|
-
name: string;
|
|
74
|
-
logoUri?: string;
|
|
75
|
-
};
|
|
76
|
-
account?: string;
|
|
77
|
-
messageDetails?: string;
|
|
78
|
-
transactionDetails?: {
|
|
79
|
-
website: string;
|
|
80
|
-
from: string;
|
|
81
|
-
to: string;
|
|
82
|
-
data?: string;
|
|
83
|
-
type?: string;
|
|
84
|
-
};
|
|
85
|
-
networkFeeSelector?: boolean;
|
|
86
|
-
disclaimer?: string;
|
|
87
|
-
alert?: Alert;
|
|
88
|
-
balanceChange?: BalanceChange;
|
|
89
|
-
tokenApprovals?: TokenApprovals;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export enum AlertType {
|
|
93
|
-
WARNING = 'Warning',
|
|
94
|
-
DANGER = 'Danger',
|
|
95
|
-
INFO = 'Info',
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export type AlertDetails = {
|
|
99
|
-
title: string;
|
|
100
|
-
description: string;
|
|
101
|
-
detailedDescription?: string;
|
|
102
|
-
actionTitles?: {
|
|
103
|
-
proceed: string;
|
|
104
|
-
reject: string;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export type Alert = {
|
|
109
|
-
type: AlertType;
|
|
110
|
-
details: AlertDetails;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export type SigningData =
|
|
114
|
-
| {
|
|
115
|
-
type: RpcMethod.ETH_SEND_TRANSACTION;
|
|
116
|
-
account: string;
|
|
117
|
-
chainId: number;
|
|
118
|
-
data: TransactionRequest;
|
|
119
|
-
}
|
|
120
|
-
| {
|
|
121
|
-
type: RpcMethod.ETH_SIGN | RpcMethod.PERSONAL_SIGN;
|
|
122
|
-
account: string;
|
|
123
|
-
chainId: number;
|
|
124
|
-
data: string;
|
|
125
|
-
}
|
|
126
|
-
| {
|
|
127
|
-
type: RpcMethod.SIGN_TYPED_DATA | RpcMethod.SIGN_TYPED_DATA_V1;
|
|
128
|
-
account: string;
|
|
129
|
-
chainId: number;
|
|
130
|
-
data: TypedData<MessageTypes> | TypedDataV1;
|
|
131
|
-
}
|
|
132
|
-
| {
|
|
133
|
-
type: RpcMethod.SIGN_TYPED_DATA_V3 | RpcMethod.SIGN_TYPED_DATA_V4;
|
|
134
|
-
account: string;
|
|
135
|
-
chainId: number;
|
|
136
|
-
data: TypedData<MessageTypes>;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export type ApprovalParams = {
|
|
140
|
-
request: RpcRequest;
|
|
141
|
-
displayData: DisplayData;
|
|
142
|
-
signingData: SigningData;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export type ApprovalResponse =
|
|
146
|
-
| {
|
|
147
|
-
result: Hex;
|
|
148
|
-
}
|
|
149
|
-
| {
|
|
150
|
-
error: RpcError;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export interface ApprovalController {
|
|
154
|
-
requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;
|
|
155
|
-
onTransactionConfirmed: (txHash: Hex) => void;
|
|
156
|
-
onTransactionReverted: (txHash: Hex) => void;
|
|
157
|
-
}
|
package/src/token.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export enum TokenType {
|
|
2
|
-
NATIVE = 'NATIVE',
|
|
3
|
-
ERC20 = 'ERC20',
|
|
4
|
-
ERC721 = 'ERC721',
|
|
5
|
-
ERC1155 = 'ERC1155',
|
|
6
|
-
NONERC = 'NONERC',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface NetworkToken {
|
|
10
|
-
name: string;
|
|
11
|
-
symbol: string;
|
|
12
|
-
decimals: number;
|
|
13
|
-
logoUri?: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type NetworkContractToken = ERC20Token | ERC1155Token | ERC721Token | NONERCToken;
|
|
18
|
-
|
|
19
|
-
export interface ERC20Token {
|
|
20
|
-
address: string;
|
|
21
|
-
chainId?: number;
|
|
22
|
-
color?: string;
|
|
23
|
-
type: TokenType.ERC20;
|
|
24
|
-
decimals: number;
|
|
25
|
-
logoUri?: string;
|
|
26
|
-
name: string;
|
|
27
|
-
symbol: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface ERC1155Token {
|
|
31
|
-
address: string;
|
|
32
|
-
type: TokenType.ERC1155;
|
|
33
|
-
logoUri?: string;
|
|
34
|
-
name?: string;
|
|
35
|
-
symbol?: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ERC721Token {
|
|
39
|
-
address: string;
|
|
40
|
-
type: TokenType.ERC721;
|
|
41
|
-
logoUri?: string;
|
|
42
|
-
name?: string;
|
|
43
|
-
symbol?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface NONERCToken {
|
|
47
|
-
address: string;
|
|
48
|
-
type: TokenType.NONERC;
|
|
49
|
-
logoUri?: string;
|
|
50
|
-
name?: string;
|
|
51
|
-
symbol?: string;
|
|
52
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import type { Network } from './common';
|
|
2
|
-
import type { TokenType } from './token';
|
|
3
|
-
|
|
4
|
-
export type GetTransactionHistory = {
|
|
5
|
-
network: Network;
|
|
6
|
-
address: string;
|
|
7
|
-
nextPageToken?: string;
|
|
8
|
-
offset?: number;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type TransactionHistoryResponse = {
|
|
12
|
-
transactions: Transaction[];
|
|
13
|
-
nextPageToken?: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type Transaction = {
|
|
17
|
-
isContractCall: boolean;
|
|
18
|
-
isIncoming: boolean;
|
|
19
|
-
isOutgoing: boolean;
|
|
20
|
-
isSender: boolean;
|
|
21
|
-
timestamp: number;
|
|
22
|
-
hash: string;
|
|
23
|
-
from: string;
|
|
24
|
-
to: string;
|
|
25
|
-
tokens: TxToken[];
|
|
26
|
-
gasPrice?: string;
|
|
27
|
-
gasUsed: string;
|
|
28
|
-
txType?: TransactionType | PChainTransactionType | XChainTransactionType | 'CreateAssetTx' | 'OperationTx';
|
|
29
|
-
chainId: string; // chainId from ActiveNetwork used to fetch tx
|
|
30
|
-
method?: string;
|
|
31
|
-
explorerLink: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export interface TxToken {
|
|
35
|
-
decimal?: string;
|
|
36
|
-
name: string;
|
|
37
|
-
symbol: string;
|
|
38
|
-
amount: string;
|
|
39
|
-
imageUri?: string;
|
|
40
|
-
from?: TokenWithAddress;
|
|
41
|
-
to?: TokenWithAddress;
|
|
42
|
-
collectableTokenId?: string;
|
|
43
|
-
type: TokenType;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// this is RichAddress from @avalabs/glacier-sdk,
|
|
47
|
-
// rename it to TokenWithAddress for better understanding
|
|
48
|
-
type TokenWithAddress = {
|
|
49
|
-
/**
|
|
50
|
-
* The contract name.
|
|
51
|
-
*/
|
|
52
|
-
name?: string;
|
|
53
|
-
/**
|
|
54
|
-
* The contract symbol.
|
|
55
|
-
*/
|
|
56
|
-
symbol?: string;
|
|
57
|
-
/**
|
|
58
|
-
* The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.
|
|
59
|
-
*/
|
|
60
|
-
decimals?: number;
|
|
61
|
-
/**
|
|
62
|
-
* The logo uri for the address.
|
|
63
|
-
*/
|
|
64
|
-
logoUri?: string;
|
|
65
|
-
/**
|
|
66
|
-
* A wallet or contract address in mixed-case checksum encoding.
|
|
67
|
-
*/
|
|
68
|
-
address: string;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export enum TransactionType {
|
|
72
|
-
BRIDGE = 'Bridge',
|
|
73
|
-
SWAP = 'Swap',
|
|
74
|
-
SEND = 'Send',
|
|
75
|
-
RECEIVE = 'Receive',
|
|
76
|
-
NFT_BUY = 'NFTBuy',
|
|
77
|
-
APPROVE = 'Approve',
|
|
78
|
-
TRANSFER = 'Transfer',
|
|
79
|
-
NFT_SEND = 'NFTSend',
|
|
80
|
-
NFT_RECEIVE = 'NFTReceive',
|
|
81
|
-
AIRDROP = 'Airdrop',
|
|
82
|
-
FILL_ORDER = 'FillOrder',
|
|
83
|
-
UNWRAP = 'Unwrap',
|
|
84
|
-
UNKNOWN = 'UNKNOWN',
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export enum PChainTransactionType {
|
|
88
|
-
ADD_VALIDATOR_TX = 'AddValidatorTx',
|
|
89
|
-
ADD_SUBNET_VALIDATOR_TX = 'AddSubnetValidatorTx',
|
|
90
|
-
ADD_DELEGATOR_TX = 'AddDelegatorTx',
|
|
91
|
-
CREATE_CHAIN_TX = 'CreateChainTx',
|
|
92
|
-
CREATE_SUBNET_TX = 'CreateSubnetTx',
|
|
93
|
-
IMPORT_TX = 'ImportTx',
|
|
94
|
-
EXPORT_TX = 'ExportTx',
|
|
95
|
-
ADVANCE_TIME_TX = 'AdvanceTimeTx',
|
|
96
|
-
REWARD_VALIDATOR_TX = 'RewardValidatorTx',
|
|
97
|
-
REMOVE_SUBNET_VALIDATOR_TX = 'RemoveSubnetValidatorTx',
|
|
98
|
-
TRANSFORM_SUBNET_TX = 'TransformSubnetTx',
|
|
99
|
-
ADD_PERMISSIONLESS_VALIDATOR_TX = 'AddPermissionlessValidatorTx',
|
|
100
|
-
ADD_PERMISSIONLESS_DELEGATOR_TX = 'AddPermissionlessDelegatorTx',
|
|
101
|
-
BASE_TX = 'BaseTx',
|
|
102
|
-
TRANSFER_SUBNET_OWNERSHIP_TX = 'TransferSubnetOwnershipTx',
|
|
103
|
-
UNKNOWN = 'UNKNOWN',
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export enum XChainTransactionType {
|
|
107
|
-
BASE_TX = 'BaseTx',
|
|
108
|
-
CREATE_ASSET_TX = 'CreateAssetTx',
|
|
109
|
-
OPERATION_TX = 'OperationTx',
|
|
110
|
-
IMPORT_TX = 'ImportTx',
|
|
111
|
-
EXPORT_TX = 'ExportTx',
|
|
112
|
-
UNKNOWN = 'UNKNOWN',
|
|
113
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { NetworkContractToken, NetworkToken } from './token';
|
|
2
|
-
|
|
3
|
-
export type BalanceChange = {
|
|
4
|
-
ins: TokenDiff[];
|
|
5
|
-
outs: TokenDiff[];
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type TokenDiff = {
|
|
9
|
-
token: NetworkContractToken | NetworkToken;
|
|
10
|
-
items: TokenDiffItem[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type TokenDiffItem = {
|
|
14
|
-
displayValue: string;
|
|
15
|
-
usdPrice: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type TokenApproval = {
|
|
19
|
-
token: NetworkContractToken;
|
|
20
|
-
spenderAddress: string;
|
|
21
|
-
value?: string;
|
|
22
|
-
usdPrice?: string;
|
|
23
|
-
logoUri?: string;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type TokenApprovals = {
|
|
27
|
-
isEditable: boolean;
|
|
28
|
-
approvals: TokenApproval[];
|
|
29
|
-
};
|
package/tsconfig.json
DELETED
package/tsup.config.ts
DELETED