@avalabs/vm-module-types 0.0.16 → 0.0.18

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.
Files changed (46) hide show
  1. package/.turbo/turbo-build.log +116 -104
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +8 -0
  4. package/dist/chunk-2KGTZTXY.cjs +7 -0
  5. package/dist/chunk-2KGTZTXY.cjs.map +1 -0
  6. package/dist/chunk-47KTBBRA.cjs +4 -0
  7. package/dist/chunk-47KTBBRA.cjs.map +1 -0
  8. package/dist/chunk-7Y6UGMPZ.js +5 -0
  9. package/dist/chunk-7Y6UGMPZ.js.map +1 -0
  10. package/dist/chunk-P6AM7I3B.js +3 -0
  11. package/dist/chunk-P6AM7I3B.js.map +1 -0
  12. package/dist/{chunk-XMGYJ4KK.js → chunk-RKFOXZ35.js} +3 -3
  13. package/dist/chunk-RKFOXZ35.js.map +1 -0
  14. package/dist/{chunk-7FBUAZNW.cjs → chunk-YVYCETG2.cjs} +3 -3
  15. package/dist/chunk-YVYCETG2.cjs.map +1 -0
  16. package/dist/index.cjs +7 -6
  17. package/dist/index.d.cts +3 -2
  18. package/dist/index.d.ts +3 -2
  19. package/dist/index.js +3 -2
  20. package/dist/module.d.cts +1 -0
  21. package/dist/module.d.ts +1 -0
  22. package/dist/rpc.cjs +4 -4
  23. package/dist/rpc.d.cts +24 -12
  24. package/dist/rpc.d.ts +24 -12
  25. package/dist/rpc.js +1 -1
  26. package/dist/token.cjs +2 -2
  27. package/dist/token.d.cts +31 -8
  28. package/dist/token.d.ts +31 -8
  29. package/dist/token.js +1 -1
  30. package/dist/transaction-simulation.cjs +6 -0
  31. package/dist/transaction-simulation.cjs.map +1 -0
  32. package/dist/transaction-simulation.d.cts +27 -0
  33. package/dist/transaction-simulation.d.ts +27 -0
  34. package/dist/transaction-simulation.js +3 -0
  35. package/dist/transaction-simulation.js.map +1 -0
  36. package/package.json +1 -1
  37. package/src/index.ts +1 -0
  38. package/src/rpc.ts +26 -13
  39. package/src/token.ts +34 -7
  40. package/src/transaction-simulation.ts +29 -0
  41. package/dist/chunk-7FBUAZNW.cjs.map +0 -1
  42. package/dist/chunk-KVTVJNN4.cjs +0 -7
  43. package/dist/chunk-KVTVJNN4.cjs.map +0 -1
  44. package/dist/chunk-TSO5BGJ4.js +0 -5
  45. package/dist/chunk-TSO5BGJ4.js.map +0 -1
  46. package/dist/chunk-XMGYJ4KK.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.16 build /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.18 build /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > tsup
4
4
 
5
- CLI 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
5
+ CLI 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, src/transaction-simulation.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v7.2.0
8
8
  CLI Using tsup config: /home/runner/work/vm-modules/vm-modules/packages/types/tsup.config.ts
@@ -10,109 +10,121 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- Generated an empty chunk: "chunk-BHB5UV3J".
14
- Generated an empty chunk: "chunk-CUVJNZP5".
15
- Generated an empty chunk: "chunk-7U2R34EQ".
13
+ Generated an empty chunk: "chunk-47KTBBRA".
16
14
  Generated an empty chunk: "chunk-JUV577XH".
17
15
  Generated an empty chunk: "chunk-OGQBQHLH".
18
16
  Generated an empty chunk: "chunk-AILYKQEY".
19
- ESM dist/chunk-TSO5BGJ4.js 189.00 B
20
- ESM dist/chunk-H6ZZE5M7.js 1.18 KB
21
- ESM dist/chunk-BHB5UV3J.js 75.00 B
22
- ESM dist/chunk-YJHKZHST.js 155.00 B
23
- ESM dist/chunk-CUVJNZP5.js 75.00 B
24
- ESM dist/chunk-7U2R34EQ.js 75.00 B
25
- ESM dist/chunk-XMGYJ4KK.js 446.00 B
26
- ESM dist/token.js 119.00 B
27
- ESM dist/transaction-history.js 195.00 B
28
- ESM dist/balance.js 97.00 B
29
- ESM dist/coingecko.js 174.00 B
30
- ESM dist/common.js 122.00 B
31
- ESM dist/index.js 615.00 B
32
- ESM dist/chunk-WOO6UGSQ.js 394.00 B
33
- ESM dist/manifest.js 126.00 B
34
- ESM dist/chunk-A4YEBDMG.js 592.00 B
35
- ESM dist/module.js 96.00 B
36
- ESM dist/network-fee.js 101.00 B
37
- ESM dist/rpc.js 134.00 B
38
- ESM dist/chunk-TSO5BGJ4.js.map 653.00 B
39
- ESM dist/chunk-H6ZZE5M7.js.map 3.69 KB
40
- ESM dist/chunk-BHB5UV3J.js.map 51.00 B
41
- ESM dist/chunk-YJHKZHST.js.map 838.00 B
42
- ESM dist/chunk-CUVJNZP5.js.map 51.00 B
43
- ESM dist/chunk-7U2R34EQ.js.map 51.00 B
44
- ESM dist/chunk-XMGYJ4KK.js.map 3.70 KB
45
- ESM dist/token.js.map 51.00 B
46
- ESM dist/transaction-history.js.map 51.00 B
47
- ESM dist/balance.js.map 51.00 B
48
- ESM dist/coingecko.js.map 51.00 B
49
- ESM dist/common.js.map 51.00 B
50
- ESM dist/index.js.map 51.00 B
51
- ESM dist/chunk-WOO6UGSQ.js.map 1.24 KB
52
- ESM dist/manifest.js.map 51.00 B
53
- ESM dist/chunk-A4YEBDMG.js.map 1.65 KB
54
- ESM dist/module.js.map 51.00 B
55
- ESM dist/network-fee.js.map 51.00 B
56
- ESM dist/rpc.js.map 51.00 B
57
- ESM ⚡️ Build success in 1331ms
58
- CJS dist/chunk-KVTVJNN4.cjs 201.00 B
59
- CJS dist/chunk-BFBDZPL3.cjs 1.21 KB
60
- CJS dist/chunk-JUV577XH.cjs 90.00 B
61
- CJS dist/chunk-XQGU7MZ4.cjs 167.00 B
62
- CJS dist/chunk-OGQBQHLH.cjs 90.00 B
63
- CJS dist/chunk-AILYKQEY.cjs 90.00 B
64
- CJS dist/chunk-7FBUAZNW.cjs 465.00 B
65
- CJS dist/token.cjs 260.00 B
66
- CJS dist/transaction-history.cjs 542.00 B
67
- CJS dist/balance.cjs 117.00 B
68
- CJS dist/coingecko.cjs 418.00 B
69
- CJS dist/common.cjs 263.00 B
70
- CJS dist/index.cjs 1.75 KB
71
- CJS dist/chunk-4PGCXP4C.cjs 433.00 B
72
- CJS dist/manifest.cjs 267.00 B
73
- CJS dist/chunk-74SNNWSF.cjs 667.00 B
74
- CJS dist/module.cjs 116.00 B
75
- CJS dist/network-fee.cjs 121.00 B
76
- CJS dist/rpc.cjs 378.00 B
77
- CJS dist/chunk-KVTVJNN4.cjs.map 653.00 B
78
- CJS dist/chunk-BFBDZPL3.cjs.map 3.69 KB
79
- CJS dist/chunk-JUV577XH.cjs.map 51.00 B
80
- CJS dist/chunk-XQGU7MZ4.cjs.map 838.00 B
81
- CJS dist/chunk-OGQBQHLH.cjs.map 51.00 B
82
- CJS dist/chunk-AILYKQEY.cjs.map 51.00 B
83
- CJS dist/chunk-7FBUAZNW.cjs.map 3.70 KB
84
- CJS dist/token.cjs.map 51.00 B
85
- CJS dist/transaction-history.cjs.map 51.00 B
86
- CJS dist/balance.cjs.map 51.00 B
87
- CJS dist/coingecko.cjs.map 51.00 B
88
- CJS dist/common.cjs.map 51.00 B
89
- CJS dist/index.cjs.map 51.00 B
90
- CJS dist/chunk-4PGCXP4C.cjs.map 1.24 KB
91
- CJS dist/manifest.cjs.map 51.00 B
92
- CJS dist/chunk-74SNNWSF.cjs.map 1.65 KB
93
- CJS dist/module.cjs.map 51.00 B
94
- CJS dist/network-fee.cjs.map 51.00 B
95
- CJS dist/rpc.cjs.map 51.00 B
96
- CJS ⚡️ Build success in 1333ms
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
+ CJS dist/chunk-2KGTZTXY.cjs 219.00 B
22
+ CJS dist/chunk-BFBDZPL3.cjs 1.21 KB
23
+ CJS dist/chunk-47KTBBRA.cjs 90.00 B
24
+ CJS dist/chunk-JUV577XH.cjs 90.00 B
25
+ CJS dist/chunk-XQGU7MZ4.cjs 167.00 B
26
+ CJS dist/chunk-OGQBQHLH.cjs 90.00 B
27
+ CJS dist/chunk-AILYKQEY.cjs 90.00 B
28
+ CJS dist/chunk-YVYCETG2.cjs 483.00 B
29
+ CJS dist/transaction-history.cjs 542.00 B
30
+ CJS dist/token.cjs 260.00 B
31
+ CJS dist/balance.cjs 117.00 B
32
+ CJS dist/transaction-simulation.cjs 132.00 B
33
+ CJS dist/coingecko.cjs 418.00 B
34
+ CJS dist/common.cjs 263.00 B
35
+ CJS dist/index.cjs 1.78 KB
36
+ CJS dist/chunk-4PGCXP4C.cjs 433.00 B
37
+ CJS dist/manifest.cjs 267.00 B
38
+ CJS dist/chunk-74SNNWSF.cjs 667.00 B
39
+ CJS dist/module.cjs 116.00 B
40
+ CJS dist/network-fee.cjs 121.00 B
41
+ CJS dist/rpc.cjs 377.00 B
42
+ CJS dist/chunk-2KGTZTXY.cjs.map 1.18 KB
43
+ CJS dist/chunk-BFBDZPL3.cjs.map 3.69 KB
44
+ CJS dist/chunk-47KTBBRA.cjs.map 51.00 B
45
+ CJS dist/chunk-JUV577XH.cjs.map 51.00 B
46
+ CJS dist/chunk-XQGU7MZ4.cjs.map 838.00 B
47
+ CJS dist/chunk-OGQBQHLH.cjs.map 51.00 B
48
+ CJS dist/chunk-AILYKQEY.cjs.map 51.00 B
49
+ CJS dist/chunk-YVYCETG2.cjs.map 4.03 KB
50
+ CJS dist/transaction-history.cjs.map 51.00 B
51
+ CJS dist/token.cjs.map 51.00 B
52
+ CJS dist/balance.cjs.map 51.00 B
53
+ CJS dist/transaction-simulation.cjs.map 51.00 B
54
+ CJS dist/coingecko.cjs.map 51.00 B
55
+ CJS dist/common.cjs.map 51.00 B
56
+ CJS dist/index.cjs.map 51.00 B
57
+ CJS dist/chunk-4PGCXP4C.cjs.map 1.24 KB
58
+ CJS dist/manifest.cjs.map 51.00 B
59
+ CJS dist/chunk-74SNNWSF.cjs.map 1.65 KB
60
+ CJS dist/module.cjs.map 51.00 B
61
+ CJS dist/network-fee.cjs.map 51.00 B
62
+ CJS dist/rpc.cjs.map 51.00 B
63
+ CJS ⚡️ Build success in 1341ms
64
+ ESM dist/chunk-7Y6UGMPZ.js 207.00 B
65
+ ESM dist/chunk-H6ZZE5M7.js 1.18 KB
66
+ ESM dist/chunk-P6AM7I3B.js 75.00 B
67
+ ESM dist/chunk-BHB5UV3J.js 75.00 B
68
+ ESM dist/chunk-YJHKZHST.js 155.00 B
69
+ ESM dist/chunk-CUVJNZP5.js 75.00 B
70
+ ESM dist/chunk-7U2R34EQ.js 75.00 B
71
+ ESM dist/chunk-RKFOXZ35.js 464.00 B
72
+ ESM dist/token.js 119.00 B
73
+ ESM dist/transaction-history.js 195.00 B
74
+ ESM dist/transaction-simulation.js 112.00 B
75
+ ESM dist/balance.js 97.00 B
76
+ ESM dist/coingecko.js 174.00 B
77
+ ESM dist/common.js 122.00 B
78
+ ESM dist/index.js 644.00 B
79
+ ESM dist/chunk-WOO6UGSQ.js 394.00 B
80
+ ESM dist/manifest.js 126.00 B
81
+ ESM dist/chunk-A4YEBDMG.js 592.00 B
82
+ ESM dist/module.js 96.00 B
83
+ ESM dist/network-fee.js 101.00 B
84
+ ESM dist/rpc.js 133.00 B
85
+ ESM dist/chunk-7Y6UGMPZ.js.map 1.18 KB
86
+ ESM dist/chunk-H6ZZE5M7.js.map 3.69 KB
87
+ ESM dist/chunk-P6AM7I3B.js.map 51.00 B
88
+ ESM dist/chunk-BHB5UV3J.js.map 51.00 B
89
+ ESM dist/chunk-YJHKZHST.js.map 838.00 B
90
+ ESM dist/chunk-CUVJNZP5.js.map 51.00 B
91
+ ESM dist/chunk-7U2R34EQ.js.map 51.00 B
92
+ ESM dist/chunk-RKFOXZ35.js.map 4.03 KB
93
+ ESM dist/token.js.map 51.00 B
94
+ ESM dist/transaction-history.js.map 51.00 B
95
+ ESM dist/transaction-simulation.js.map 51.00 B
96
+ ESM dist/balance.js.map 51.00 B
97
+ ESM dist/coingecko.js.map 51.00 B
98
+ ESM dist/common.js.map 51.00 B
99
+ ESM dist/index.js.map 51.00 B
100
+ ESM dist/chunk-WOO6UGSQ.js.map 1.24 KB
101
+ ESM dist/manifest.js.map 51.00 B
102
+ ESM dist/chunk-A4YEBDMG.js.map 1.65 KB
103
+ ESM dist/module.js.map 51.00 B
104
+ ESM dist/network-fee.js.map 51.00 B
105
+ ESM dist/rpc.js.map 51.00 B
106
+ ESM ⚡️ Build success in 1371ms
97
107
  DTS Build start
98
- DTS ⚡️ Build success in 9763ms
99
- DTS dist/index.d.cts 1.18 KB
100
- DTS dist/coingecko.d.cts 1.09 KB
101
- DTS dist/module.d.cts 1.01 KB
102
- DTS dist/balance.d.cts 3.20 KB
103
- DTS dist/manifest.d.cts 6.95 KB
104
- DTS dist/network-fee.d.cts 361.00 B
105
- DTS dist/rpc.d.cts 3.33 KB
106
- DTS dist/transaction-history.d.cts 2.88 KB
107
- DTS dist/common.d.cts 729.00 B
108
- DTS dist/token.d.cts 518.00 B
109
- DTS dist/index.d.ts 1.17 KB
110
- DTS dist/coingecko.d.ts 1.09 KB
111
- DTS dist/module.d.ts 1023.00 B
112
- DTS dist/balance.d.ts 3.20 KB
113
- DTS dist/manifest.d.ts 6.95 KB
114
- DTS dist/network-fee.d.ts 361.00 B
115
- DTS dist/rpc.d.ts 3.33 KB
116
- DTS dist/transaction-history.d.ts 2.88 KB
117
- DTS dist/common.d.ts 728.00 B
118
- DTS dist/token.d.ts 518.00 B
108
+ DTS ⚡️ Build success in 9634ms
109
+ DTS dist/index.d.cts 1.36 KB
110
+ DTS dist/coingecko.d.cts 1.09 KB
111
+ DTS dist/module.d.cts 1.04 KB
112
+ DTS dist/balance.d.cts 3.20 KB
113
+ DTS dist/manifest.d.cts 6.95 KB
114
+ DTS dist/network-fee.d.cts 361.00 B
115
+ DTS dist/rpc.d.cts 3.65 KB
116
+ DTS dist/transaction-history.d.cts 2.88 KB
117
+ DTS dist/common.d.cts 729.00 B
118
+ DTS dist/transaction-simulation.d.cts 642.00 B
119
+ DTS dist/token.d.cts 1.05 KB
120
+ DTS dist/index.d.ts 1.35 KB
121
+ DTS dist/coingecko.d.ts 1.09 KB
122
+ DTS dist/module.d.ts 1.04 KB
123
+ DTS dist/balance.d.ts 3.20 KB
124
+ DTS dist/manifest.d.ts 6.95 KB
125
+ DTS dist/network-fee.d.ts 361.00 B
126
+ DTS dist/rpc.d.ts 3.65 KB
127
+ DTS dist/transaction-history.d.ts 2.88 KB
128
+ DTS dist/common.d.ts 728.00 B
129
+ DTS dist/transaction-simulation.d.ts 641.00 B
130
+ DTS dist/token.d.ts 1.05 KB
@@ -1,4 +1,4 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.16 lint /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.18 lint /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > eslint "src/**/*.ts"
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @avalabs/vm-module-types
2
2
 
3
+ ## 0.0.18
4
+
5
+ ## 0.0.17
6
+
7
+ ### Patch Changes
8
+
9
+ - 3590edf: Transaction parsing, validation and simulation for EVM
10
+
3
11
  ## 0.0.16
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var e=(r=>(r.NATIVE="NATIVE",r.ERC20="ERC20",r.ERC721="ERC721",r.ERC1155="ERC1155",r.NONERC="NONERC",r))(e||{});
4
+
5
+ exports.a = e;
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=chunk-2KGTZTXY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/token.ts"],"names":["TokenType"],"mappings":"AAAO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,OAAS,SALCA,OAAA","sourcesContent":["export enum TokenType {\n NATIVE = 'NATIVE',\n ERC20 = 'ERC20',\n ERC721 = 'ERC721',\n ERC1155 = 'ERC1155',\n NONERC = 'NONERC',\n}\n\nexport interface NetworkToken {\n name: string;\n symbol: string;\n decimals: number;\n logoUri?: string;\n description?: string;\n}\n\nexport type NetworkContractToken = ERC20Token | ERC1155Token | ERC721Token | NONERCToken;\n\nexport interface ERC20Token {\n address: string;\n chainId?: number;\n color?: string;\n type: TokenType.ERC20;\n decimals: number;\n logoUri?: string;\n name: string;\n symbol: string;\n}\n\nexport interface ERC1155Token {\n address: string;\n type: TokenType.ERC1155;\n logoUri?: string;\n name?: string;\n symbol?: string;\n}\n\nexport interface ERC721Token {\n address: string;\n type: TokenType.ERC721;\n logoUri?: string;\n name?: string;\n symbol?: string;\n}\n\nexport interface NONERCToken {\n address: string;\n type: TokenType.NONERC;\n logoUri?: string;\n name?: string;\n symbol?: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=out.js.map
4
+ //# sourceMappingURL=chunk-47KTBBRA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ var e=(r=>(r.NATIVE="NATIVE",r.ERC20="ERC20",r.ERC721="ERC721",r.ERC1155="ERC1155",r.NONERC="NONERC",r))(e||{});
2
+
3
+ export { e as a };
4
+ //# sourceMappingURL=out.js.map
5
+ //# sourceMappingURL=chunk-7Y6UGMPZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/token.ts"],"names":["TokenType"],"mappings":"AAAO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,OAAS,SALCA,OAAA","sourcesContent":["export enum TokenType {\n NATIVE = 'NATIVE',\n ERC20 = 'ERC20',\n ERC721 = 'ERC721',\n ERC1155 = 'ERC1155',\n NONERC = 'NONERC',\n}\n\nexport interface NetworkToken {\n name: string;\n symbol: string;\n decimals: number;\n logoUri?: string;\n description?: string;\n}\n\nexport type NetworkContractToken = ERC20Token | ERC1155Token | ERC721Token | NONERCToken;\n\nexport interface ERC20Token {\n address: string;\n chainId?: number;\n color?: string;\n type: TokenType.ERC20;\n decimals: number;\n logoUri?: string;\n name: string;\n symbol: string;\n}\n\nexport interface ERC1155Token {\n address: string;\n type: TokenType.ERC1155;\n logoUri?: string;\n name?: string;\n symbol?: string;\n}\n\nexport interface ERC721Token {\n address: string;\n type: TokenType.ERC721;\n logoUri?: string;\n name?: string;\n symbol?: string;\n}\n\nexport interface NONERCToken {\n address: string;\n type: TokenType.NONERC;\n logoUri?: string;\n name?: string;\n symbol?: string;\n}\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=chunk-P6AM7I3B.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
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||{});
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||{}),a=(t=>(t.WARNING="Warning",t.DANGER="Danger",t.INFO="Info",t))(a||{});
2
2
 
3
- export { r as a, n as b };
3
+ export { r as a, a as b };
4
4
  //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-XMGYJ4KK.js.map
5
+ //# sourceMappingURL=chunk-RKFOXZ35.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","AlertType"],"mappings":"AAKO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WARDA,OAAA,IAsFAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAHGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\nimport type { BalanceChange, TokenApprovals } from './transaction-simulation';\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 type DisplayData = {\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 type?: string;\n };\n networkFeeSelector?: boolean;\n disclaimer?: string;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\n};\n\nexport enum AlertType {\n WARNING = 'Warning',\n DANGER = 'Danger',\n INFO = 'Info',\n}\n\nexport type AlertDetails = {\n title: string;\n description: string;\n detailedDescription?: string;\n actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\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"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
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||{});
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||{}),a=(t=>(t.WARNING="Warning",t.DANGER="Danger",t.INFO="Info",t))(a||{});
4
4
 
5
5
  exports.a = r;
6
- exports.b = n;
6
+ exports.b = a;
7
7
  //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-7FBUAZNW.cjs.map
8
+ //# sourceMappingURL=chunk-YVYCETG2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","AlertType"],"mappings":"AAKO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WARDA,OAAA,IAsFAC,OACVA,EAAA,QAAU,UACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAHGA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\nimport type { BalanceChange, TokenApprovals } from './transaction-simulation';\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 type DisplayData = {\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 type?: string;\n };\n networkFeeSelector?: boolean;\n disclaimer?: string;\n alert?: Alert;\n balanceChange?: BalanceChange;\n tokenApprovals?: TokenApprovals;\n};\n\nexport enum AlertType {\n WARNING = 'Warning',\n DANGER = 'Danger',\n INFO = 'Info',\n}\n\nexport type AlertDetails = {\n title: string;\n description: string;\n detailedDescription?: string;\n actionTitles?: {\n proceed: string;\n reject: string;\n };\n};\n\nexport type Alert = {\n type: AlertType;\n details: AlertDetails;\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/index.cjs CHANGED
@@ -1,20 +1,21 @@
1
1
  'use strict';
2
2
 
3
- var chunkKVTVJNN4_cjs = require('./chunk-KVTVJNN4.cjs');
3
+ var chunk2KGTZTXY_cjs = require('./chunk-2KGTZTXY.cjs');
4
4
  var chunkBFBDZPL3_cjs = require('./chunk-BFBDZPL3.cjs');
5
+ require('./chunk-47KTBBRA.cjs');
5
6
  require('./chunk-JUV577XH.cjs');
6
7
  var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
7
8
  var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
8
9
  var chunk74SNNWSF_cjs = require('./chunk-74SNNWSF.cjs');
9
10
  require('./chunk-OGQBQHLH.cjs');
10
11
  require('./chunk-AILYKQEY.cjs');
11
- var chunk7FBUAZNW_cjs = require('./chunk-7FBUAZNW.cjs');
12
+ var chunkYVYCETG2_cjs = require('./chunk-YVYCETG2.cjs');
12
13
 
13
14
 
14
15
 
15
16
  Object.defineProperty(exports, 'TokenType', {
16
17
  enumerable: true,
17
- get: function () { return chunkKVTVJNN4_cjs.a; }
18
+ get: function () { return chunk2KGTZTXY_cjs.a; }
18
19
  });
19
20
  Object.defineProperty(exports, 'PChainTransactionType', {
20
21
  enumerable: true,
@@ -44,13 +45,13 @@ Object.defineProperty(exports, 'parseManifest', {
44
45
  enumerable: true,
45
46
  get: function () { return chunk74SNNWSF_cjs.a; }
46
47
  });
47
- Object.defineProperty(exports, 'BannerType', {
48
+ Object.defineProperty(exports, 'AlertType', {
48
49
  enumerable: true,
49
- get: function () { return chunk7FBUAZNW_cjs.b; }
50
+ get: function () { return chunkYVYCETG2_cjs.b; }
50
51
  });
51
52
  Object.defineProperty(exports, 'RpcMethod', {
52
53
  enumerable: true,
53
- get: function () { return chunk7FBUAZNW_cjs.a; }
54
+ get: function () { return chunkYVYCETG2_cjs.a; }
54
55
  });
55
56
  //# sourceMappingURL=out.js.map
56
57
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -4,9 +4,10 @@ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenB
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, Banner, BannerType, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 } from './rpc.cjs';
8
- export { NetworkContractToken, NetworkToken, TokenType } from './token.cjs';
7
+ export { Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 } from './rpc.cjs';
8
+ export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType } from './token.cjs';
9
9
  export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.cjs';
10
+ export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.cjs';
10
11
  import 'zod';
11
12
  import 'bn.js';
12
13
  import '@avalabs/glacier-sdk';
package/dist/index.d.ts CHANGED
@@ -4,9 +4,10 @@ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenB
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, Banner, BannerType, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 } from './rpc.js';
8
- export { NetworkContractToken, NetworkToken, TokenType } from './token.js';
7
+ export { Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 } from './rpc.js';
8
+ export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType } from './token.js';
9
9
  export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.js';
10
+ export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.js';
10
11
  import 'zod';
11
12
  import 'bn.js';
12
13
  import '@avalabs/glacier-sdk';
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
- export { a as TokenType } from './chunk-TSO5BGJ4.js';
1
+ export { a as TokenType } from './chunk-7Y6UGMPZ.js';
2
2
  export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-H6ZZE5M7.js';
3
+ import './chunk-P6AM7I3B.js';
3
4
  import './chunk-BHB5UV3J.js';
4
5
  export { b as RawSimplePriceResponseSchema, a as SimplePriceResponseSchema } from './chunk-WOO6UGSQ.js';
5
6
  export { a as Environment } from './chunk-YJHKZHST.js';
6
7
  export { a as parseManifest } from './chunk-A4YEBDMG.js';
7
8
  import './chunk-CUVJNZP5.js';
8
9
  import './chunk-7U2R34EQ.js';
9
- export { b as BannerType, a as RpcMethod } from './chunk-XMGYJ4KK.js';
10
+ export { b as AlertType, a as RpcMethod } from './chunk-RKFOXZ35.js';
10
11
  //# sourceMappingURL=out.js.map
11
12
  //# sourceMappingURL=index.js.map
package/dist/module.d.cts CHANGED
@@ -10,6 +10,7 @@ import '@avalabs/glacier-sdk';
10
10
  import 'zod';
11
11
  import 'ethers';
12
12
  import '@metamask/rpc-errors';
13
+ import './transaction-simulation.cjs';
13
14
 
14
15
  interface Module {
15
16
  getManifest: () => Manifest | undefined;
package/dist/module.d.ts CHANGED
@@ -10,6 +10,7 @@ import '@avalabs/glacier-sdk';
10
10
  import 'zod';
11
11
  import 'ethers';
12
12
  import '@metamask/rpc-errors';
13
+ import './transaction-simulation.js';
13
14
 
14
15
  interface Module {
15
16
  getManifest: () => Manifest | undefined;
package/dist/rpc.cjs CHANGED
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunk7FBUAZNW_cjs = require('./chunk-7FBUAZNW.cjs');
3
+ var chunkYVYCETG2_cjs = require('./chunk-YVYCETG2.cjs');
4
4
 
5
5
 
6
6
 
7
- Object.defineProperty(exports, 'BannerType', {
7
+ Object.defineProperty(exports, 'AlertType', {
8
8
  enumerable: true,
9
- get: function () { return chunk7FBUAZNW_cjs.b; }
9
+ get: function () { return chunkYVYCETG2_cjs.b; }
10
10
  });
11
11
  Object.defineProperty(exports, 'RpcMethod', {
12
12
  enumerable: true,
13
- get: function () { return chunk7FBUAZNW_cjs.a; }
13
+ get: function () { return chunkYVYCETG2_cjs.a; }
14
14
  });
15
15
  //# sourceMappingURL=out.js.map
16
16
  //# sourceMappingURL=rpc.cjs.map
package/dist/rpc.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { TransactionRequest } from 'ethers';
2
2
  import { Caip2ChainId, Hex } from './common.cjs';
3
3
  import { JsonRpcError, OptionalDataWithOptionalCause, EthereumProviderError } from '@metamask/rpc-errors';
4
+ import { BalanceChange, TokenApprovals } from './transaction-simulation.cjs';
4
5
  import './token.cjs';
5
6
 
6
7
  declare enum RpcMethod {
@@ -51,18 +52,7 @@ type TypedDataV1 = {
51
52
  type: string;
52
53
  value: unknown;
53
54
  }[];
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
55
  type DisplayData = {
65
- banner?: Banner;
66
56
  title: string;
67
57
  dAppInfo?: {
68
58
  name: string;
@@ -81,9 +71,31 @@ type DisplayData = {
81
71
  from: string;
82
72
  to: string;
83
73
  data?: string;
74
+ type?: string;
84
75
  };
85
76
  networkFeeSelector?: boolean;
86
77
  disclaimer?: string;
78
+ alert?: Alert;
79
+ balanceChange?: BalanceChange;
80
+ tokenApprovals?: TokenApprovals;
81
+ };
82
+ declare enum AlertType {
83
+ WARNING = "Warning",
84
+ DANGER = "Danger",
85
+ INFO = "Info"
86
+ }
87
+ type AlertDetails = {
88
+ title: string;
89
+ description: string;
90
+ detailedDescription?: string;
91
+ actionTitles?: {
92
+ proceed: string;
93
+ reject: string;
94
+ };
95
+ };
96
+ type Alert = {
97
+ type: AlertType;
98
+ details: AlertDetails;
87
99
  };
88
100
  type SigningData = {
89
101
  type: RpcMethod.ETH_SEND_TRANSACTION;
@@ -122,4 +134,4 @@ interface ApprovalController {
122
134
  onTransactionReverted: (txHash: Hex) => void;
123
135
  }
124
136
 
125
- export { ApprovalController, ApprovalParams, ApprovalResponse, Banner, BannerType, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 };
137
+ export { Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 };
package/dist/rpc.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { TransactionRequest } from 'ethers';
2
2
  import { Caip2ChainId, Hex } from './common.js';
3
3
  import { JsonRpcError, OptionalDataWithOptionalCause, EthereumProviderError } from '@metamask/rpc-errors';
4
+ import { BalanceChange, TokenApprovals } from './transaction-simulation.js';
4
5
  import './token.js';
5
6
 
6
7
  declare enum RpcMethod {
@@ -51,18 +52,7 @@ type TypedDataV1 = {
51
52
  type: string;
52
53
  value: unknown;
53
54
  }[];
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
55
  type DisplayData = {
65
- banner?: Banner;
66
56
  title: string;
67
57
  dAppInfo?: {
68
58
  name: string;
@@ -81,9 +71,31 @@ type DisplayData = {
81
71
  from: string;
82
72
  to: string;
83
73
  data?: string;
74
+ type?: string;
84
75
  };
85
76
  networkFeeSelector?: boolean;
86
77
  disclaimer?: string;
78
+ alert?: Alert;
79
+ balanceChange?: BalanceChange;
80
+ tokenApprovals?: TokenApprovals;
81
+ };
82
+ declare enum AlertType {
83
+ WARNING = "Warning",
84
+ DANGER = "Danger",
85
+ INFO = "Info"
86
+ }
87
+ type AlertDetails = {
88
+ title: string;
89
+ description: string;
90
+ detailedDescription?: string;
91
+ actionTitles?: {
92
+ proceed: string;
93
+ reject: string;
94
+ };
95
+ };
96
+ type Alert = {
97
+ type: AlertType;
98
+ details: AlertDetails;
87
99
  };
88
100
  type SigningData = {
89
101
  type: RpcMethod.ETH_SEND_TRANSACTION;
@@ -122,4 +134,4 @@ interface ApprovalController {
122
134
  onTransactionReverted: (txHash: Hex) => void;
123
135
  }
124
136
 
125
- export { ApprovalController, ApprovalParams, ApprovalResponse, Banner, BannerType, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 };
137
+ export { Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, ApprovalResponse, DappInfo, DisplayData, MessageTypeProperty, MessageTypes, RpcError, RpcMethod, RpcRequest, RpcResponse, SigningData, TypedData, TypedDataV1 };
package/dist/rpc.js CHANGED
@@ -1,3 +1,3 @@
1
- export { b as BannerType, a as RpcMethod } from './chunk-XMGYJ4KK.js';
1
+ export { b as AlertType, a as RpcMethod } from './chunk-RKFOXZ35.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=rpc.js.map
package/dist/token.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkKVTVJNN4_cjs = require('./chunk-KVTVJNN4.cjs');
3
+ var chunk2KGTZTXY_cjs = require('./chunk-2KGTZTXY.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, 'TokenType', {
8
8
  enumerable: true,
9
- get: function () { return chunkKVTVJNN4_cjs.a; }
9
+ get: function () { return chunk2KGTZTXY_cjs.a; }
10
10
  });
11
11
  //# sourceMappingURL=out.js.map
12
12
  //# sourceMappingURL=token.cjs.map
package/dist/token.d.cts CHANGED
@@ -1,3 +1,10 @@
1
+ declare enum TokenType {
2
+ NATIVE = "NATIVE",
3
+ ERC20 = "ERC20",
4
+ ERC721 = "ERC721",
5
+ ERC1155 = "ERC1155",
6
+ NONERC = "NONERC"
7
+ }
1
8
  interface NetworkToken {
2
9
  name: string;
3
10
  symbol: string;
@@ -5,21 +12,37 @@ interface NetworkToken {
5
12
  logoUri?: string;
6
13
  description?: string;
7
14
  }
8
- interface NetworkContractToken {
15
+ type NetworkContractToken = ERC20Token | ERC1155Token | ERC721Token | NONERCToken;
16
+ interface ERC20Token {
9
17
  address: string;
10
18
  chainId?: number;
11
19
  color?: string;
12
- contractType: string;
20
+ type: TokenType.ERC20;
13
21
  decimals: number;
14
22
  logoUri?: string;
15
23
  name: string;
16
24
  symbol: string;
17
25
  }
18
- declare enum TokenType {
19
- NATIVE = "NATIVE",
20
- ERC20 = "ERC20",
21
- ERC721 = "ERC721",
22
- ERC1155 = "ERC1155"
26
+ interface ERC1155Token {
27
+ address: string;
28
+ type: TokenType.ERC1155;
29
+ logoUri?: string;
30
+ name?: string;
31
+ symbol?: string;
32
+ }
33
+ interface ERC721Token {
34
+ address: string;
35
+ type: TokenType.ERC721;
36
+ logoUri?: string;
37
+ name?: string;
38
+ symbol?: string;
39
+ }
40
+ interface NONERCToken {
41
+ address: string;
42
+ type: TokenType.NONERC;
43
+ logoUri?: string;
44
+ name?: string;
45
+ symbol?: string;
23
46
  }
24
47
 
25
- export { NetworkContractToken, NetworkToken, TokenType };
48
+ export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType };
package/dist/token.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ declare enum TokenType {
2
+ NATIVE = "NATIVE",
3
+ ERC20 = "ERC20",
4
+ ERC721 = "ERC721",
5
+ ERC1155 = "ERC1155",
6
+ NONERC = "NONERC"
7
+ }
1
8
  interface NetworkToken {
2
9
  name: string;
3
10
  symbol: string;
@@ -5,21 +12,37 @@ interface NetworkToken {
5
12
  logoUri?: string;
6
13
  description?: string;
7
14
  }
8
- interface NetworkContractToken {
15
+ type NetworkContractToken = ERC20Token | ERC1155Token | ERC721Token | NONERCToken;
16
+ interface ERC20Token {
9
17
  address: string;
10
18
  chainId?: number;
11
19
  color?: string;
12
- contractType: string;
20
+ type: TokenType.ERC20;
13
21
  decimals: number;
14
22
  logoUri?: string;
15
23
  name: string;
16
24
  symbol: string;
17
25
  }
18
- declare enum TokenType {
19
- NATIVE = "NATIVE",
20
- ERC20 = "ERC20",
21
- ERC721 = "ERC721",
22
- ERC1155 = "ERC1155"
26
+ interface ERC1155Token {
27
+ address: string;
28
+ type: TokenType.ERC1155;
29
+ logoUri?: string;
30
+ name?: string;
31
+ symbol?: string;
32
+ }
33
+ interface ERC721Token {
34
+ address: string;
35
+ type: TokenType.ERC721;
36
+ logoUri?: string;
37
+ name?: string;
38
+ symbol?: string;
39
+ }
40
+ interface NONERCToken {
41
+ address: string;
42
+ type: TokenType.NONERC;
43
+ logoUri?: string;
44
+ name?: string;
45
+ symbol?: string;
23
46
  }
24
47
 
25
- export { NetworkContractToken, NetworkToken, TokenType };
48
+ export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType };
package/dist/token.js CHANGED
@@ -1,3 +1,3 @@
1
- export { a as TokenType } from './chunk-TSO5BGJ4.js';
1
+ export { a as TokenType } from './chunk-7Y6UGMPZ.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=token.js.map
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ require('./chunk-47KTBBRA.cjs');
4
+
5
+ //# sourceMappingURL=out.js.map
6
+ //# sourceMappingURL=transaction-simulation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { NetworkContractToken, NetworkToken } from './token.cjs';
2
+
3
+ type BalanceChange = {
4
+ ins: TokenDiff[];
5
+ outs: TokenDiff[];
6
+ };
7
+ type TokenDiff = {
8
+ token: NetworkContractToken | NetworkToken;
9
+ items: TokenDiffItem[];
10
+ };
11
+ type TokenDiffItem = {
12
+ displayValue: string;
13
+ usdPrice: string | undefined;
14
+ };
15
+ type TokenApproval = {
16
+ token: NetworkContractToken;
17
+ spenderAddress: string;
18
+ value?: string;
19
+ usdPrice?: string;
20
+ logoUri?: string;
21
+ };
22
+ type TokenApprovals = {
23
+ isEditable: boolean;
24
+ approvals: TokenApproval[];
25
+ };
26
+
27
+ export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem };
@@ -0,0 +1,27 @@
1
+ import { NetworkContractToken, NetworkToken } from './token.js';
2
+
3
+ type BalanceChange = {
4
+ ins: TokenDiff[];
5
+ outs: TokenDiff[];
6
+ };
7
+ type TokenDiff = {
8
+ token: NetworkContractToken | NetworkToken;
9
+ items: TokenDiffItem[];
10
+ };
11
+ type TokenDiffItem = {
12
+ displayValue: string;
13
+ usdPrice: string | undefined;
14
+ };
15
+ type TokenApproval = {
16
+ token: NetworkContractToken;
17
+ spenderAddress: string;
18
+ value?: string;
19
+ usdPrice?: string;
20
+ logoUri?: string;
21
+ };
22
+ type TokenApprovals = {
23
+ isEditable: boolean;
24
+ approvals: TokenApproval[];
25
+ };
26
+
27
+ export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem };
@@ -0,0 +1,3 @@
1
+ import './chunk-P6AM7I3B.js';
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=transaction-simulation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/vm-module-types",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@ export * from './network-fee';
7
7
  export * from './rpc';
8
8
  export * from './token';
9
9
  export * from './transaction-history';
10
+ export * from './transaction-simulation';
package/src/rpc.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { TransactionRequest } from 'ethers';
2
2
  import type { Caip2ChainId, Hex } from './common';
3
3
  import type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';
4
+ import type { BalanceChange, TokenApprovals } from './transaction-simulation';
4
5
 
5
6
  export enum RpcMethod {
6
7
  /* EVM */
@@ -60,20 +61,7 @@ export interface TypedData<T extends MessageTypes> {
60
61
 
61
62
  export type TypedDataV1 = { name: string; type: string; value: unknown }[];
62
63
 
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
64
  export type DisplayData = {
76
- banner?: Banner;
77
65
  title: string;
78
66
  dAppInfo?: {
79
67
  name: string;
@@ -92,9 +80,34 @@ export type DisplayData = {
92
80
  from: string;
93
81
  to: string;
94
82
  data?: string;
83
+ type?: string;
95
84
  };
96
85
  networkFeeSelector?: boolean;
97
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;
98
111
  };
99
112
 
100
113
  export type SigningData =
package/src/token.ts CHANGED
@@ -1,3 +1,11 @@
1
+ export enum TokenType {
2
+ NATIVE = 'NATIVE',
3
+ ERC20 = 'ERC20',
4
+ ERC721 = 'ERC721',
5
+ ERC1155 = 'ERC1155',
6
+ NONERC = 'NONERC',
7
+ }
8
+
1
9
  export interface NetworkToken {
2
10
  name: string;
3
11
  symbol: string;
@@ -6,20 +14,39 @@ export interface NetworkToken {
6
14
  description?: string;
7
15
  }
8
16
 
9
- export interface NetworkContractToken {
17
+ export type NetworkContractToken = ERC20Token | ERC1155Token | ERC721Token | NONERCToken;
18
+
19
+ export interface ERC20Token {
10
20
  address: string;
11
21
  chainId?: number;
12
22
  color?: string;
13
- contractType: string;
23
+ type: TokenType.ERC20;
14
24
  decimals: number;
15
25
  logoUri?: string;
16
26
  name: string;
17
27
  symbol: string;
18
28
  }
19
29
 
20
- export enum TokenType {
21
- NATIVE = 'NATIVE',
22
- ERC20 = 'ERC20',
23
- ERC721 = 'ERC721',
24
- ERC1155 = 'ERC1155',
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;
25
52
  }
@@ -0,0 +1,29 @@
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
+ };
@@ -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"]}
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var t=(r=>(r.NATIVE="NATIVE",r.ERC20="ERC20",r.ERC721="ERC721",r.ERC1155="ERC1155",r))(t||{});
4
-
5
- exports.a = t;
6
- //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-KVTVJNN4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/token.ts"],"names":["TokenType"],"mappings":"AAmBO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,QAAU,UAJAA,OAAA","sourcesContent":["export interface NetworkToken {\n name: string;\n symbol: string;\n decimals: number;\n logoUri?: string;\n description?: string;\n}\n\nexport interface NetworkContractToken {\n address: string;\n chainId?: number;\n color?: string;\n contractType: string;\n decimals: number;\n logoUri?: string;\n name: string;\n symbol: string;\n}\n\nexport enum TokenType {\n NATIVE = 'NATIVE',\n ERC20 = 'ERC20',\n ERC721 = 'ERC721',\n ERC1155 = 'ERC1155',\n}\n"]}
@@ -1,5 +0,0 @@
1
- var t=(r=>(r.NATIVE="NATIVE",r.ERC20="ERC20",r.ERC721="ERC721",r.ERC1155="ERC1155",r))(t||{});
2
-
3
- export { t as a };
4
- //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-TSO5BGJ4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/token.ts"],"names":["TokenType"],"mappings":"AAmBO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,QAAU,UAJAA,OAAA","sourcesContent":["export interface NetworkToken {\n name: string;\n symbol: string;\n decimals: number;\n logoUri?: string;\n description?: string;\n}\n\nexport interface NetworkContractToken {\n address: string;\n chainId?: number;\n color?: string;\n contractType: string;\n decimals: number;\n logoUri?: string;\n name: string;\n symbol: string;\n}\n\nexport enum TokenType {\n NATIVE = 'NATIVE',\n ERC20 = 'ERC20',\n ERC721 = 'ERC721',\n ERC1155 = 'ERC1155',\n}\n"]}
@@ -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"]}