@avalabs/vm-module-types 0.0.12 → 0.0.15

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 (115) hide show
  1. package/.turbo/turbo-build.log +107 -21
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +19 -0
  4. package/dist/balance.cjs +6 -0
  5. package/dist/balance.d.cts +103 -0
  6. package/dist/balance.d.ts +103 -0
  7. package/dist/balance.js +3 -0
  8. package/dist/chunk-4PGCXP4C.cjs +10 -0
  9. package/dist/chunk-4PGCXP4C.cjs.map +1 -0
  10. package/dist/chunk-74SNNWSF.cjs +9 -0
  11. package/dist/chunk-74SNNWSF.cjs.map +1 -0
  12. package/dist/chunk-7U2R34EQ.js +3 -0
  13. package/dist/chunk-7U2R34EQ.js.map +1 -0
  14. package/dist/chunk-A4YEBDMG.js +7 -0
  15. package/dist/chunk-A4YEBDMG.js.map +1 -0
  16. package/dist/chunk-AILYKQEY.cjs +4 -0
  17. package/dist/chunk-AILYKQEY.cjs.map +1 -0
  18. package/dist/chunk-BFBDZPL3.cjs +9 -0
  19. package/dist/chunk-BFBDZPL3.cjs.map +1 -0
  20. package/dist/chunk-BHB5UV3J.js +3 -0
  21. package/dist/chunk-BHB5UV3J.js.map +1 -0
  22. package/dist/chunk-CUVJNZP5.js +3 -0
  23. package/dist/chunk-CUVJNZP5.js.map +1 -0
  24. package/dist/chunk-FKFLXQOJ.js +5 -0
  25. package/dist/chunk-FKFLXQOJ.js.map +1 -0
  26. package/dist/chunk-H6ZZE5M7.js +5 -0
  27. package/dist/chunk-H6ZZE5M7.js.map +1 -0
  28. package/dist/chunk-ISTALLTN.cjs +8 -0
  29. package/dist/chunk-ISTALLTN.cjs.map +1 -0
  30. package/dist/chunk-JUV577XH.cjs +4 -0
  31. package/dist/chunk-JUV577XH.cjs.map +1 -0
  32. package/dist/chunk-KVTVJNN4.cjs +7 -0
  33. package/dist/chunk-KVTVJNN4.cjs.map +1 -0
  34. package/dist/chunk-OGQBQHLH.cjs +4 -0
  35. package/dist/chunk-OGQBQHLH.cjs.map +1 -0
  36. package/dist/chunk-TSO5BGJ4.js +5 -0
  37. package/dist/chunk-TSO5BGJ4.js.map +1 -0
  38. package/dist/chunk-WOO6UGSQ.js +7 -0
  39. package/dist/chunk-WOO6UGSQ.js.map +1 -0
  40. package/dist/chunk-XQGU7MZ4.cjs +7 -0
  41. package/dist/chunk-XQGU7MZ4.cjs.map +1 -0
  42. package/dist/chunk-YJHKZHST.js +5 -0
  43. package/dist/chunk-YJHKZHST.js.map +1 -0
  44. package/dist/coingecko.cjs +16 -0
  45. package/dist/coingecko.cjs.map +1 -0
  46. package/dist/coingecko.d.cts +23 -0
  47. package/dist/coingecko.d.ts +23 -0
  48. package/dist/coingecko.js +3 -0
  49. package/dist/coingecko.js.map +1 -0
  50. package/dist/common.cjs +12 -0
  51. package/dist/common.cjs.map +1 -0
  52. package/dist/common.d.cts +32 -0
  53. package/dist/common.d.ts +32 -0
  54. package/dist/common.js +3 -0
  55. package/dist/common.js.map +1 -0
  56. package/dist/index.cjs +36 -12
  57. package/dist/index.d.cts +11 -1
  58. package/dist/index.d.ts +11 -1
  59. package/dist/index.js +9 -1
  60. package/dist/manifest.cjs +12 -0
  61. package/dist/manifest.cjs.map +1 -0
  62. package/dist/{types.d.cts → manifest.d.cts} +1 -229
  63. package/dist/{types.d.ts → manifest.d.ts} +1 -229
  64. package/dist/manifest.js +3 -0
  65. package/dist/manifest.js.map +1 -0
  66. package/dist/module.cjs +6 -0
  67. package/dist/module.cjs.map +1 -0
  68. package/dist/module.d.cts +24 -0
  69. package/dist/module.d.ts +24 -0
  70. package/dist/module.js +3 -0
  71. package/dist/module.js.map +1 -0
  72. package/dist/network-fee.cjs +6 -0
  73. package/dist/network-fee.cjs.map +1 -0
  74. package/dist/network-fee.d.cts +18 -0
  75. package/dist/network-fee.d.ts +18 -0
  76. package/dist/network-fee.js +3 -0
  77. package/dist/network-fee.js.map +1 -0
  78. package/dist/rpc.cjs +16 -0
  79. package/dist/rpc.cjs.map +1 -0
  80. package/dist/rpc.d.cts +96 -0
  81. package/dist/rpc.d.ts +96 -0
  82. package/dist/rpc.js +3 -0
  83. package/dist/rpc.js.map +1 -0
  84. package/dist/token.cjs +12 -0
  85. package/dist/token.cjs.map +1 -0
  86. package/dist/token.d.cts +25 -0
  87. package/dist/token.d.ts +25 -0
  88. package/dist/token.js +3 -0
  89. package/dist/token.js.map +1 -0
  90. package/dist/transaction-history.cjs +20 -0
  91. package/dist/transaction-history.cjs.map +1 -0
  92. package/dist/transaction-history.d.cts +106 -0
  93. package/dist/transaction-history.d.ts +106 -0
  94. package/dist/transaction-history.js +3 -0
  95. package/dist/transaction-history.js.map +1 -0
  96. package/package.json +7 -2
  97. package/src/balance.ts +118 -0
  98. package/src/coingecko.ts +15 -0
  99. package/src/common.ts +34 -0
  100. package/src/index.ts +9 -1
  101. package/src/manifest.ts +40 -0
  102. package/src/module.ts +17 -0
  103. package/src/network-fee.ts +7 -0
  104. package/src/rpc.ts +117 -0
  105. package/src/token.ts +25 -0
  106. package/src/transaction-history.ts +113 -0
  107. package/dist/chunk-ODMEO2D7.js +0 -7
  108. package/dist/chunk-ODMEO2D7.js.map +0 -1
  109. package/dist/chunk-TJUF73LQ.cjs +0 -14
  110. package/dist/chunk-TJUF73LQ.cjs.map +0 -1
  111. package/dist/types.cjs +0 -32
  112. package/dist/types.js +0 -3
  113. package/src/types.ts +0 -299
  114. /package/dist/{types.cjs.map → balance.cjs.map} +0 -0
  115. /package/dist/{types.js.map → balance.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.12 build /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.15 build /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > tsup
4
4
 
5
- CLI Building entry: src/index.ts, src/types.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
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,23 +10,109 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- CJS dist/index.cjs 873.00 B
14
- CJS dist/types.cjs 873.00 B
15
- CJS dist/chunk-TJUF73LQ.cjs 1.97 KB
16
- CJS dist/index.cjs.map 51.00 B
17
- CJS dist/types.cjs.map 51.00 B
18
- CJS dist/chunk-TJUF73LQ.cjs.map 8.60 KB
19
- CJS ⚡️ Build success in 659ms
20
- ESM dist/index.js 217.00 B
21
- ESM dist/types.js 217.00 B
22
- ESM dist/chunk-ODMEO2D7.js 1.86 KB
23
- ESM dist/index.js.map 51.00 B
24
- ESM dist/types.js.map 51.00 B
25
- ESM dist/chunk-ODMEO2D7.js.map 8.60 KB
26
- ESM ⚡️ Build success in 664ms
13
+ Generated an empty chunk: "chunk-BHB5UV3J".
14
+ Generated an empty chunk: "chunk-CUVJNZP5".
15
+ Generated an empty chunk: "chunk-7U2R34EQ".
16
+ Generated an empty chunk: "chunk-JUV577XH".
17
+ Generated an empty chunk: "chunk-OGQBQHLH".
18
+ 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-FKFLXQOJ.js 1.11 KB
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/common.js 122.00 B
30
+ ESM dist/coingecko.js 174.00 B
31
+ ESM dist/index.js 620.00 B
32
+ ESM dist/chunk-WOO6UGSQ.js 394.00 B
33
+ ESM dist/manifest.js 126.00 B
34
+ ESM dist/module.js 96.00 B
35
+ ESM dist/chunk-A4YEBDMG.js 592.00 B
36
+ ESM dist/network-fee.js 101.00 B
37
+ ESM dist/rpc.js 139.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-FKFLXQOJ.js.map 3.72 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/common.js.map 51.00 B
49
+ ESM dist/coingecko.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/module.js.map 51.00 B
54
+ ESM dist/chunk-A4YEBDMG.js.map 1.65 KB
55
+ ESM dist/network-fee.js.map 51.00 B
56
+ ESM dist/rpc.js.map 51.00 B
57
+ ESM ⚡️ Build success in 1287ms
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-ISTALLTN.cjs 1.12 KB
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 383.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-ISTALLTN.cjs.map 3.72 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/rpc.cjs.map 51.00 B
95
+ CJS dist/network-fee.cjs.map 51.00 B
96
+ CJS ⚡️ Build success in 1312ms
27
97
  DTS Build start
28
- DTS ⚡️ Build success in 7726ms
29
- DTS dist/types.d.cts 13.11 KB
30
- DTS dist/index.d.cts 469.00 B
31
- DTS dist/types.d.ts 13.11 KB
32
- DTS dist/index.d.ts 468.00 B
98
+ DTS ⚡️ Build success in 8636ms
99
+ DTS dist/index.d.cts 1.12 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 360.00 B
105
+ DTS dist/rpc.d.cts 3.02 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.11 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 360.00 B
115
+ DTS dist/rpc.d.ts 3.02 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
@@ -1,4 +1,4 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.12 lint /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.15 lint /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > eslint "src/**/*.ts"
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @avalabs/vm-module-types
2
2
 
3
+ ## 0.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - f536d58: add module functions to evm-module
8
+
9
+ ## 0.0.14
10
+
11
+ ### Patch Changes
12
+
13
+ - 0593258: add getBalances to evm-module
14
+
15
+ ## 0.0.13
16
+
17
+ ### Patch Changes
18
+
19
+ - af68c81: Add getTransactionHistory to avalanche module
20
+ - d9fa0f5: added getNetworkFee to avalanche module
21
+
3
22
  ## 0.0.12
4
23
 
5
24
  ### Patch Changes
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ require('./chunk-JUV577XH.cjs');
4
+
5
+ //# sourceMappingURL=out.js.map
6
+ //# sourceMappingURL=balance.cjs.map
@@ -0,0 +1,103 @@
1
+ import { Network, Storage } from './common.cjs';
2
+ import { NetworkContractToken, TokenType, NetworkToken } from './token.cjs';
3
+ import BN from 'bn.js';
4
+ import { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
5
+
6
+ type GetBalancesParams = {
7
+ addresses: string[];
8
+ network: Network;
9
+ customTokens?: NetworkContractToken[];
10
+ currency: string;
11
+ storage?: Storage;
12
+ };
13
+ type TokenBalanceData = {
14
+ type: TokenType;
15
+ name: string;
16
+ symbol: string;
17
+ balance: BN;
18
+ balanceInCurrency: number;
19
+ balanceDisplayValue: string;
20
+ balanceCurrencyDisplayValue: string;
21
+ priceInCurrency: number;
22
+ priceChanges?: {
23
+ percentage?: number;
24
+ value?: number;
25
+ };
26
+ };
27
+ type TokenMarketData = {
28
+ marketCap: number;
29
+ change24: number;
30
+ vol24: number;
31
+ };
32
+ type NetworkTokenWithBalance = TokenBalanceDataWithDecimals & NetworkToken & TokenMarketData & {
33
+ coingeckoId: string;
34
+ type: TokenType.NATIVE;
35
+ };
36
+ interface TokenBalanceDataWithDecimals extends TokenBalanceData {
37
+ decimals: number;
38
+ }
39
+ /**
40
+ * EVM TokenWithBalance interface.
41
+ */
42
+ type TokenWithBalanceERC20 = TokenBalanceDataWithDecimals & TokenMarketData & NetworkContractToken & {
43
+ type: TokenType.ERC20;
44
+ };
45
+ type TokenWithBalanceEVM = NetworkTokenWithBalance | TokenWithBalanceERC20;
46
+ /**
47
+ * Bitcoin TokenWithBalance interface.
48
+ */
49
+ interface BitcoinInputUTXO {
50
+ txHash: string;
51
+ txHex?: string;
52
+ index: number;
53
+ value: number;
54
+ script: string;
55
+ blockHeight: number;
56
+ confirmations: number;
57
+ confirmedTime?: string;
58
+ }
59
+ interface BitcoinInputUTXOWithOptionalScript extends Omit<BitcoinInputUTXO, 'script'> {
60
+ script?: string;
61
+ }
62
+ interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
63
+ logoUri: string;
64
+ utxos: BitcoinInputUTXOWithOptionalScript[];
65
+ utxosUnconfirmed?: BitcoinInputUTXOWithOptionalScript[];
66
+ unconfirmedBalance?: BN;
67
+ unconfirmedBalanceDisplayValue?: string;
68
+ unconfirmedBalanceCurrencyDisplayValue?: string;
69
+ unconfirmedBalanceInCurrency?: number;
70
+ }
71
+ /**
72
+ * Avalanche TokenWithBalance interface.
73
+ */
74
+ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
75
+ available?: BN;
76
+ availableInCurrency?: number;
77
+ availableDisplayValue?: string;
78
+ availableCurrencyDisplayValue?: string;
79
+ utxos?: PChainBalance;
80
+ lockedStaked: number;
81
+ lockedStakeable: number;
82
+ lockedPlatform: number;
83
+ atomicMemoryLocked: number;
84
+ atomicMemoryUnlocked: number;
85
+ unlockedUnstaked: number;
86
+ unlockedStaked: number;
87
+ pendingStaked: number;
88
+ }
89
+ interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
90
+ available?: BN;
91
+ availableInCurrency?: number;
92
+ availableDisplayValue?: string;
93
+ availableCurrencyDisplayValue?: string;
94
+ utxos?: XChainBalances;
95
+ locked: number;
96
+ unlocked: number;
97
+ atomicMemoryUnlocked: number;
98
+ atomicMemoryLocked: number;
99
+ }
100
+ type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM;
101
+ type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
102
+
103
+ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };
@@ -0,0 +1,103 @@
1
+ import { Network, Storage } from './common.js';
2
+ import { NetworkContractToken, TokenType, NetworkToken } from './token.js';
3
+ import BN from 'bn.js';
4
+ import { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
5
+
6
+ type GetBalancesParams = {
7
+ addresses: string[];
8
+ network: Network;
9
+ customTokens?: NetworkContractToken[];
10
+ currency: string;
11
+ storage?: Storage;
12
+ };
13
+ type TokenBalanceData = {
14
+ type: TokenType;
15
+ name: string;
16
+ symbol: string;
17
+ balance: BN;
18
+ balanceInCurrency: number;
19
+ balanceDisplayValue: string;
20
+ balanceCurrencyDisplayValue: string;
21
+ priceInCurrency: number;
22
+ priceChanges?: {
23
+ percentage?: number;
24
+ value?: number;
25
+ };
26
+ };
27
+ type TokenMarketData = {
28
+ marketCap: number;
29
+ change24: number;
30
+ vol24: number;
31
+ };
32
+ type NetworkTokenWithBalance = TokenBalanceDataWithDecimals & NetworkToken & TokenMarketData & {
33
+ coingeckoId: string;
34
+ type: TokenType.NATIVE;
35
+ };
36
+ interface TokenBalanceDataWithDecimals extends TokenBalanceData {
37
+ decimals: number;
38
+ }
39
+ /**
40
+ * EVM TokenWithBalance interface.
41
+ */
42
+ type TokenWithBalanceERC20 = TokenBalanceDataWithDecimals & TokenMarketData & NetworkContractToken & {
43
+ type: TokenType.ERC20;
44
+ };
45
+ type TokenWithBalanceEVM = NetworkTokenWithBalance | TokenWithBalanceERC20;
46
+ /**
47
+ * Bitcoin TokenWithBalance interface.
48
+ */
49
+ interface BitcoinInputUTXO {
50
+ txHash: string;
51
+ txHex?: string;
52
+ index: number;
53
+ value: number;
54
+ script: string;
55
+ blockHeight: number;
56
+ confirmations: number;
57
+ confirmedTime?: string;
58
+ }
59
+ interface BitcoinInputUTXOWithOptionalScript extends Omit<BitcoinInputUTXO, 'script'> {
60
+ script?: string;
61
+ }
62
+ interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
63
+ logoUri: string;
64
+ utxos: BitcoinInputUTXOWithOptionalScript[];
65
+ utxosUnconfirmed?: BitcoinInputUTXOWithOptionalScript[];
66
+ unconfirmedBalance?: BN;
67
+ unconfirmedBalanceDisplayValue?: string;
68
+ unconfirmedBalanceCurrencyDisplayValue?: string;
69
+ unconfirmedBalanceInCurrency?: number;
70
+ }
71
+ /**
72
+ * Avalanche TokenWithBalance interface.
73
+ */
74
+ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
75
+ available?: BN;
76
+ availableInCurrency?: number;
77
+ availableDisplayValue?: string;
78
+ availableCurrencyDisplayValue?: string;
79
+ utxos?: PChainBalance;
80
+ lockedStaked: number;
81
+ lockedStakeable: number;
82
+ lockedPlatform: number;
83
+ atomicMemoryLocked: number;
84
+ atomicMemoryUnlocked: number;
85
+ unlockedUnstaked: number;
86
+ unlockedStaked: number;
87
+ pendingStaked: number;
88
+ }
89
+ interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
90
+ available?: BN;
91
+ availableInCurrency?: number;
92
+ availableDisplayValue?: string;
93
+ availableCurrencyDisplayValue?: string;
94
+ utxos?: XChainBalances;
95
+ locked: number;
96
+ unlocked: number;
97
+ atomicMemoryUnlocked: number;
98
+ atomicMemoryLocked: number;
99
+ }
100
+ type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM;
101
+ type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
102
+
103
+ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };
@@ -0,0 +1,3 @@
1
+ import './chunk-BHB5UV3J.js';
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=balance.js.map
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+
5
+ var l=zod.object({price:zod.number().optional().nullable(),change24:zod.number().optional().nullable(),marketCap:zod.number().optional().nullable(),vol24:zod.number().optional().nullable()}),n=zod.record(l),c=zod.record(n),a=zod.record(zod.record(zod.number().nullable().optional()));
6
+
7
+ exports.a = c;
8
+ exports.b = a;
9
+ //# sourceMappingURL=out.js.map
10
+ //# sourceMappingURL=chunk-4PGCXP4C.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/coingecko.ts"],"names":["number","object","record","SimplePriceInCurrency","SimplePriceInCurrencyResponseSchema","SimplePriceResponseSchema","RawSimplePriceResponseSchema"],"mappings":"AAAA,OAAS,UAAAA,EAAQ,UAAAC,EAAQ,UAAAC,MAAiB,MAE1C,IAAMC,EAAwBF,EAAO,CACnC,MAAOD,EAAO,EAAE,SAAS,EAAE,SAAS,EACpC,SAAUA,EAAO,EAAE,SAAS,EAAE,SAAS,EACvC,UAAWA,EAAO,EAAE,SAAS,EAAE,SAAS,EACxC,MAAOA,EAAO,EAAE,SAAS,EAAE,SAAS,CACtC,CAAC,EAEKI,EAAsCF,EAAOC,CAAqB,EAC3DE,EAA4BH,EAAOE,CAAmC,EAGtEE,EAA+BJ,EAAOA,EAAOF,EAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { number, object, record, z } from 'zod';\n\nconst SimplePriceInCurrency = object({\n price: number().optional().nullable(),\n change24: number().optional().nullable(),\n marketCap: number().optional().nullable(),\n vol24: number().optional().nullable(),\n});\n\nconst SimplePriceInCurrencyResponseSchema = record(SimplePriceInCurrency);\nexport const SimplePriceResponseSchema = record(SimplePriceInCurrencyResponseSchema);\nexport type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;\n\nexport const RawSimplePriceResponseSchema = record(record(number().nullable().optional()));\nexport type RawSimplePriceResponse = z.infer<typeof RawSimplePriceResponseSchema>;\n"]}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+
5
+ var n=zod.object({checksum:zod.string(),location:zod.object({npm:zod.object({filePath:zod.string(),packageName:zod.string(),registry:zod.string()})})}),o=zod.object({name:zod.string(),version:zod.string(),description:zod.string(),sources:zod.object({module:n,provider:n.optional()}),network:zod.object({chainIds:zod.string().array(),namespaces:zod.string().array()}),cointype:zod.string(),permissions:zod.object({rpc:zod.object({dapps:zod.boolean(),methods:zod.string().array()})}),manifestVersion:zod.string()}),c=r=>o.safeParse(r);
6
+
7
+ exports.a = c;
8
+ //# sourceMappingURL=out.js.map
9
+ //# sourceMappingURL=chunk-74SNNWSF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/manifest.ts"],"names":["boolean","object","string","sourceSchema","manifestSchema","parseManifest","params"],"mappings":"AAAA,OAAS,WAAAA,EAAS,UAAAC,EAAQ,UAAAC,MAAiB,MAE3C,IAAMC,EAAeF,EAAO,CAC1B,SAAUC,EAAO,EACjB,SAAUD,EAAO,CACf,IAAKA,EAAO,CACV,SAAUC,EAAO,EACjB,YAAaA,EAAO,EACpB,SAAUA,EAAO,CACnB,CAAC,CACH,CAAC,CACH,CAAC,EAEKE,EAAiBH,EAAO,CAC5B,KAAMC,EAAO,EACb,QAASA,EAAO,EAChB,YAAaA,EAAO,EACpB,QAASD,EAAO,CACd,OAAQE,EACR,SAAUA,EAAa,SAAS,CAClC,CAAC,EACD,QAASF,EAAO,CACd,SAAUC,EAAO,EAAE,MAAM,EACzB,WAAYA,EAAO,EAAE,MAAM,CAC7B,CAAC,EACD,SAAUA,EAAO,EACjB,YAAaD,EAAO,CAClB,IAAKA,EAAO,CACV,MAAOD,EAAQ,EACf,QAASE,EAAO,EAAE,MAAM,CAC1B,CAAC,CACH,CAAC,EACD,gBAAiBA,EAAO,CAC1B,CAAC,EAIYG,EAAiBC,GACrBF,EAAe,UAAUE,CAAM","sourcesContent":["import { boolean, object, string, z } from 'zod';\n\nconst sourceSchema = object({\n checksum: string(),\n location: object({\n npm: object({\n filePath: string(),\n packageName: string(),\n registry: string(),\n }),\n }),\n});\n\nconst manifestSchema = object({\n name: string(),\n version: string(),\n description: string(),\n sources: object({\n module: sourceSchema,\n provider: sourceSchema.optional(),\n }),\n network: object({\n chainIds: string().array(),\n namespaces: string().array(),\n }),\n cointype: string(),\n permissions: object({\n rpc: object({\n dapps: boolean(),\n methods: string().array(),\n }),\n }),\n manifestVersion: string(),\n});\n\nexport type Manifest = z.infer<typeof manifestSchema>;\n\nexport const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {\n return manifestSchema.safeParse(params);\n};\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=chunk-7U2R34EQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { object, string, boolean } from 'zod';
2
+
3
+ var n=object({checksum:string(),location:object({npm:object({filePath:string(),packageName:string(),registry:string()})})}),o=object({name:string(),version:string(),description:string(),sources:object({module:n,provider:n.optional()}),network:object({chainIds:string().array(),namespaces:string().array()}),cointype:string(),permissions:object({rpc:object({dapps:boolean(),methods:string().array()})}),manifestVersion:string()}),c=r=>o.safeParse(r);
4
+
5
+ export { c as a };
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=chunk-A4YEBDMG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/manifest.ts"],"names":["boolean","object","string","sourceSchema","manifestSchema","parseManifest","params"],"mappings":"AAAA,OAAS,WAAAA,EAAS,UAAAC,EAAQ,UAAAC,MAAiB,MAE3C,IAAMC,EAAeF,EAAO,CAC1B,SAAUC,EAAO,EACjB,SAAUD,EAAO,CACf,IAAKA,EAAO,CACV,SAAUC,EAAO,EACjB,YAAaA,EAAO,EACpB,SAAUA,EAAO,CACnB,CAAC,CACH,CAAC,CACH,CAAC,EAEKE,EAAiBH,EAAO,CAC5B,KAAMC,EAAO,EACb,QAASA,EAAO,EAChB,YAAaA,EAAO,EACpB,QAASD,EAAO,CACd,OAAQE,EACR,SAAUA,EAAa,SAAS,CAClC,CAAC,EACD,QAASF,EAAO,CACd,SAAUC,EAAO,EAAE,MAAM,EACzB,WAAYA,EAAO,EAAE,MAAM,CAC7B,CAAC,EACD,SAAUA,EAAO,EACjB,YAAaD,EAAO,CAClB,IAAKA,EAAO,CACV,MAAOD,EAAQ,EACf,QAASE,EAAO,EAAE,MAAM,CAC1B,CAAC,CACH,CAAC,EACD,gBAAiBA,EAAO,CAC1B,CAAC,EAIYG,EAAiBC,GACrBF,EAAe,UAAUE,CAAM","sourcesContent":["import { boolean, object, string, z } from 'zod';\n\nconst sourceSchema = object({\n checksum: string(),\n location: object({\n npm: object({\n filePath: string(),\n packageName: string(),\n registry: string(),\n }),\n }),\n});\n\nconst manifestSchema = object({\n name: string(),\n version: string(),\n description: string(),\n sources: object({\n module: sourceSchema,\n provider: sourceSchema.optional(),\n }),\n network: object({\n chainIds: string().array(),\n namespaces: string().array(),\n }),\n cointype: string(),\n permissions: object({\n rpc: object({\n dapps: boolean(),\n methods: string().array(),\n }),\n }),\n manifestVersion: string(),\n});\n\nexport type Manifest = z.infer<typeof manifestSchema>;\n\nexport const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {\n return manifestSchema.safeParse(params);\n};\n"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=out.js.map
4
+ //# sourceMappingURL=chunk-AILYKQEY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var A=(r=>(r.BRIDGE="Bridge",r.SWAP="Swap",r.SEND="Send",r.RECEIVE="Receive",r.NFT_BUY="NFTBuy",r.APPROVE="Approve",r.TRANSFER="Transfer",r.NFT_SEND="NFTSend",r.NFT_RECEIVE="NFTReceive",r.AIRDROP="Airdrop",r.FILL_ORDER="FillOrder",r.UNWRAP="Unwrap",r.UNKNOWN="UNKNOWN",r))(A||{}),o=(e=>(e.ADD_VALIDATOR_TX="AddValidatorTx",e.ADD_SUBNET_VALIDATOR_TX="AddSubnetValidatorTx",e.ADD_DELEGATOR_TX="AddDelegatorTx",e.CREATE_CHAIN_TX="CreateChainTx",e.CREATE_SUBNET_TX="CreateSubnetTx",e.IMPORT_TX="ImportTx",e.EXPORT_TX="ExportTx",e.ADVANCE_TIME_TX="AdvanceTimeTx",e.REWARD_VALIDATOR_TX="RewardValidatorTx",e.REMOVE_SUBNET_VALIDATOR_TX="RemoveSubnetValidatorTx",e.TRANSFORM_SUBNET_TX="TransformSubnetTx",e.ADD_PERMISSIONLESS_VALIDATOR_TX="AddPermissionlessValidatorTx",e.ADD_PERMISSIONLESS_DELEGATOR_TX="AddPermissionlessDelegatorTx",e.BASE_TX="BaseTx",e.TRANSFER_SUBNET_OWNERSHIP_TX="TransferSubnetOwnershipTx",e.UNKNOWN="UNKNOWN",e))(o||{}),E=(t=>(t.BASE_TX="BaseTx",t.CREATE_ASSET_TX="CreateAssetTx",t.OPERATION_TX="OperationTx",t.IMPORT_TX="ImportTx",t.EXPORT_TX="ExportTx",t.UNKNOWN="UNKNOWN",t))(E||{});
4
+
5
+ exports.a = A;
6
+ exports.b = o;
7
+ exports.c = E;
8
+ //# sourceMappingURL=out.js.map
9
+ //# sourceMappingURL=chunk-BFBDZPL3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transaction-history.ts"],"names":["TransactionType","PChainTransactionType","XChainTransactionType"],"mappings":"AAsEO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,SAAW,UACXA,EAAA,YAAc,aACdA,EAAA,QAAU,UACVA,EAAA,WAAa,YACbA,EAAA,OAAS,SACTA,EAAA,QAAU,UAbAA,OAAA,IAgBAC,OACVA,EAAA,iBAAmB,iBACnBA,EAAA,wBAA0B,uBAC1BA,EAAA,iBAAmB,iBACnBA,EAAA,gBAAkB,gBAClBA,EAAA,iBAAmB,iBACnBA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,gBAAkB,gBAClBA,EAAA,oBAAsB,oBACtBA,EAAA,2BAA6B,0BAC7BA,EAAA,oBAAsB,oBACtBA,EAAA,gCAAkC,+BAClCA,EAAA,gCAAkC,+BAClCA,EAAA,QAAU,SACVA,EAAA,6BAA+B,4BAC/BA,EAAA,QAAU,UAhBAA,OAAA,IAmBAC,OACVA,EAAA,QAAU,SACVA,EAAA,gBAAkB,gBAClBA,EAAA,aAAe,cACfA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,QAAU,UANAA,OAAA","sourcesContent":["import type { Network } from './common';\nimport type { TokenType } from './token';\n\nexport type GetTransactionHistory = {\n network: Network;\n address: string;\n nextPageToken?: string;\n offset?: number;\n};\n\nexport type TransactionHistoryResponse = {\n transactions: Transaction[];\n nextPageToken?: string;\n};\n\nexport type Transaction = {\n isContractCall: boolean;\n isIncoming: boolean;\n isOutgoing: boolean;\n isSender: boolean;\n timestamp: number;\n hash: string;\n from: string;\n to: string;\n tokens: TxToken[];\n gasPrice?: string;\n gasUsed: string;\n txType?: TransactionType | PChainTransactionType | XChainTransactionType;\n chainId: string; // chainId from ActiveNetwork used to fetch tx\n method?: string;\n explorerLink: string;\n};\n\nexport interface TxToken {\n decimal?: string;\n name: string;\n symbol: string;\n amount: string;\n imageUri?: string;\n from?: TokenWithAddress;\n to?: TokenWithAddress;\n collectableTokenId?: string;\n type: TokenType;\n}\n\n// this is RichAddress from @avalabs/glacier-sdk,\n// rename it to TokenWithAddress for better understanding\ntype TokenWithAddress = {\n /**\n * The contract name.\n */\n name?: string;\n /**\n * The contract symbol.\n */\n symbol?: string;\n /**\n * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.\n */\n decimals?: number;\n /**\n * The logo uri for the address.\n */\n logoUri?: string;\n /**\n * A wallet or contract address in mixed-case checksum encoding.\n */\n address: string;\n};\n\nexport enum TransactionType {\n BRIDGE = 'Bridge',\n SWAP = 'Swap',\n SEND = 'Send',\n RECEIVE = 'Receive',\n NFT_BUY = 'NFTBuy',\n APPROVE = 'Approve',\n TRANSFER = 'Transfer',\n NFT_SEND = 'NFTSend',\n NFT_RECEIVE = 'NFTReceive',\n AIRDROP = 'Airdrop',\n FILL_ORDER = 'FillOrder',\n UNWRAP = 'Unwrap',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum PChainTransactionType {\n ADD_VALIDATOR_TX = 'AddValidatorTx',\n ADD_SUBNET_VALIDATOR_TX = 'AddSubnetValidatorTx',\n ADD_DELEGATOR_TX = 'AddDelegatorTx',\n CREATE_CHAIN_TX = 'CreateChainTx',\n CREATE_SUBNET_TX = 'CreateSubnetTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n ADVANCE_TIME_TX = 'AdvanceTimeTx',\n REWARD_VALIDATOR_TX = 'RewardValidatorTx',\n REMOVE_SUBNET_VALIDATOR_TX = 'RemoveSubnetValidatorTx',\n TRANSFORM_SUBNET_TX = 'TransformSubnetTx',\n ADD_PERMISSIONLESS_VALIDATOR_TX = 'AddPermissionlessValidatorTx',\n ADD_PERMISSIONLESS_DELEGATOR_TX = 'AddPermissionlessDelegatorTx',\n BASE_TX = 'BaseTx',\n TRANSFER_SUBNET_OWNERSHIP_TX = 'TransferSubnetOwnershipTx',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum XChainTransactionType {\n BASE_TX = 'BaseTx',\n CREATE_ASSET_TX = 'CreateAssetTx',\n OPERATION_TX = 'OperationTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n UNKNOWN = 'UNKNOWN',\n}\n"]}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=chunk-BHB5UV3J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=chunk-CUVJNZP5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ var t=(e=>(e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e.WALLET_ADD_ETHEREUM_CHAIN="wallet_addEthereumChain",e.WALLET_SWITCH_ETHEREUM_CHAIN="wallet_switchEthereumChain",e.WALLET_GET_ETHEREUM_CHAIN="wallet_getEthereumChain",e))(t||{}),r=(e=>(e.EVM_TRANSACTION="evm_transaction",e.EVM_MESSAGE_ETH_SIGN="evm_message_eth_sign",e.EVM_MESSAGE_PERSONAL_SIGN="evm_message_personal_sign",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA="evm_message_eth_sign_typed_data",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1="evm_message_eth_sign_typed_data_v1",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3="evm_message_eth_sign_typed_data_v3",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4="evm_message_eth_sign_typed_data_v4",e.AVALANCHE_TRANSACTION="avalanche_transaction",e.AVALANCHE_MESSAGE="avalanche_message",e.BTC_TRANSACTION="btc_transaction",e))(r||{});
2
+
3
+ export { t as a, r as b };
4
+ //# sourceMappingURL=out.js.map
5
+ //# sourceMappingURL=chunk-FKFLXQOJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","SigningDataType"],"mappings":"AAIO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WACXA,EAAA,0BAA4B,0BAC5BA,EAAA,6BAA+B,6BAC/BA,EAAA,0BAA4B,0BAXlBA,OAAA,IA8DAC,OAEVA,EAAA,gBAAkB,kBAClBA,EAAA,qBAAuB,uBACvBA,EAAA,0BAA4B,4BAC5BA,EAAA,gCAAkC,kCAClCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCAGrCA,EAAA,sBAAwB,wBACxBA,EAAA,kBAAoB,oBAGpBA,EAAA,gBAAkB,kBAfRA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\n\nexport enum RpcMethod {\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain',\n WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain',\n WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport type DisplayData = {\n title: string;\n network: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n messageDetails?: string;\n transactionDetails?: {\n website: string;\n from: string;\n to: string;\n data?: string;\n };\n networkFeeSelector?: boolean;\n};\n\n/**\n * Enum for different types of signing data.\n */\nexport enum SigningDataType {\n // EVM signing data types\n EVM_TRANSACTION = 'evm_transaction',\n EVM_MESSAGE_ETH_SIGN = 'evm_message_eth_sign',\n EVM_MESSAGE_PERSONAL_SIGN = 'evm_message_personal_sign',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA = 'evm_message_eth_sign_typed_data',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = 'evm_message_eth_sign_typed_data_v1',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = 'evm_message_eth_sign_typed_data_v3',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = 'evm_message_eth_sign_typed_data_v4',\n\n // Avalanche signing data types\n AVALANCHE_TRANSACTION = 'avalanche_transaction',\n AVALANCHE_MESSAGE = 'avalanche_message',\n\n // Bitcoin signing data types\n BTC_TRANSACTION = 'btc_transaction',\n}\n\nexport type SigningData =\n | {\n type: SigningDataType.EVM_TRANSACTION;\n account: string;\n chainId: number;\n data: TransactionRequest;\n }\n | {\n type: SigningDataType.EVM_MESSAGE_ETH_SIGN;\n account: string;\n chainId: number;\n data: string;\n };\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n};\n\nexport type ApprovalResponse =\n | {\n result: Hex;\n }\n | {\n error: RpcError;\n };\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex) => void;\n onTransactionReverted: (txHash: Hex) => void;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ var A=(r=>(r.BRIDGE="Bridge",r.SWAP="Swap",r.SEND="Send",r.RECEIVE="Receive",r.NFT_BUY="NFTBuy",r.APPROVE="Approve",r.TRANSFER="Transfer",r.NFT_SEND="NFTSend",r.NFT_RECEIVE="NFTReceive",r.AIRDROP="Airdrop",r.FILL_ORDER="FillOrder",r.UNWRAP="Unwrap",r.UNKNOWN="UNKNOWN",r))(A||{}),o=(e=>(e.ADD_VALIDATOR_TX="AddValidatorTx",e.ADD_SUBNET_VALIDATOR_TX="AddSubnetValidatorTx",e.ADD_DELEGATOR_TX="AddDelegatorTx",e.CREATE_CHAIN_TX="CreateChainTx",e.CREATE_SUBNET_TX="CreateSubnetTx",e.IMPORT_TX="ImportTx",e.EXPORT_TX="ExportTx",e.ADVANCE_TIME_TX="AdvanceTimeTx",e.REWARD_VALIDATOR_TX="RewardValidatorTx",e.REMOVE_SUBNET_VALIDATOR_TX="RemoveSubnetValidatorTx",e.TRANSFORM_SUBNET_TX="TransformSubnetTx",e.ADD_PERMISSIONLESS_VALIDATOR_TX="AddPermissionlessValidatorTx",e.ADD_PERMISSIONLESS_DELEGATOR_TX="AddPermissionlessDelegatorTx",e.BASE_TX="BaseTx",e.TRANSFER_SUBNET_OWNERSHIP_TX="TransferSubnetOwnershipTx",e.UNKNOWN="UNKNOWN",e))(o||{}),E=(t=>(t.BASE_TX="BaseTx",t.CREATE_ASSET_TX="CreateAssetTx",t.OPERATION_TX="OperationTx",t.IMPORT_TX="ImportTx",t.EXPORT_TX="ExportTx",t.UNKNOWN="UNKNOWN",t))(E||{});
2
+
3
+ export { A as a, o as b, E as c };
4
+ //# sourceMappingURL=out.js.map
5
+ //# sourceMappingURL=chunk-H6ZZE5M7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transaction-history.ts"],"names":["TransactionType","PChainTransactionType","XChainTransactionType"],"mappings":"AAsEO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,SAAW,UACXA,EAAA,YAAc,aACdA,EAAA,QAAU,UACVA,EAAA,WAAa,YACbA,EAAA,OAAS,SACTA,EAAA,QAAU,UAbAA,OAAA,IAgBAC,OACVA,EAAA,iBAAmB,iBACnBA,EAAA,wBAA0B,uBAC1BA,EAAA,iBAAmB,iBACnBA,EAAA,gBAAkB,gBAClBA,EAAA,iBAAmB,iBACnBA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,gBAAkB,gBAClBA,EAAA,oBAAsB,oBACtBA,EAAA,2BAA6B,0BAC7BA,EAAA,oBAAsB,oBACtBA,EAAA,gCAAkC,+BAClCA,EAAA,gCAAkC,+BAClCA,EAAA,QAAU,SACVA,EAAA,6BAA+B,4BAC/BA,EAAA,QAAU,UAhBAA,OAAA,IAmBAC,OACVA,EAAA,QAAU,SACVA,EAAA,gBAAkB,gBAClBA,EAAA,aAAe,cACfA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,QAAU,UANAA,OAAA","sourcesContent":["import type { Network } from './common';\nimport type { TokenType } from './token';\n\nexport type GetTransactionHistory = {\n network: Network;\n address: string;\n nextPageToken?: string;\n offset?: number;\n};\n\nexport type TransactionHistoryResponse = {\n transactions: Transaction[];\n nextPageToken?: string;\n};\n\nexport type Transaction = {\n isContractCall: boolean;\n isIncoming: boolean;\n isOutgoing: boolean;\n isSender: boolean;\n timestamp: number;\n hash: string;\n from: string;\n to: string;\n tokens: TxToken[];\n gasPrice?: string;\n gasUsed: string;\n txType?: TransactionType | PChainTransactionType | XChainTransactionType;\n chainId: string; // chainId from ActiveNetwork used to fetch tx\n method?: string;\n explorerLink: string;\n};\n\nexport interface TxToken {\n decimal?: string;\n name: string;\n symbol: string;\n amount: string;\n imageUri?: string;\n from?: TokenWithAddress;\n to?: TokenWithAddress;\n collectableTokenId?: string;\n type: TokenType;\n}\n\n// this is RichAddress from @avalabs/glacier-sdk,\n// rename it to TokenWithAddress for better understanding\ntype TokenWithAddress = {\n /**\n * The contract name.\n */\n name?: string;\n /**\n * The contract symbol.\n */\n symbol?: string;\n /**\n * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.\n */\n decimals?: number;\n /**\n * The logo uri for the address.\n */\n logoUri?: string;\n /**\n * A wallet or contract address in mixed-case checksum encoding.\n */\n address: string;\n};\n\nexport enum TransactionType {\n BRIDGE = 'Bridge',\n SWAP = 'Swap',\n SEND = 'Send',\n RECEIVE = 'Receive',\n NFT_BUY = 'NFTBuy',\n APPROVE = 'Approve',\n TRANSFER = 'Transfer',\n NFT_SEND = 'NFTSend',\n NFT_RECEIVE = 'NFTReceive',\n AIRDROP = 'Airdrop',\n FILL_ORDER = 'FillOrder',\n UNWRAP = 'Unwrap',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum PChainTransactionType {\n ADD_VALIDATOR_TX = 'AddValidatorTx',\n ADD_SUBNET_VALIDATOR_TX = 'AddSubnetValidatorTx',\n ADD_DELEGATOR_TX = 'AddDelegatorTx',\n CREATE_CHAIN_TX = 'CreateChainTx',\n CREATE_SUBNET_TX = 'CreateSubnetTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n ADVANCE_TIME_TX = 'AdvanceTimeTx',\n REWARD_VALIDATOR_TX = 'RewardValidatorTx',\n REMOVE_SUBNET_VALIDATOR_TX = 'RemoveSubnetValidatorTx',\n TRANSFORM_SUBNET_TX = 'TransformSubnetTx',\n ADD_PERMISSIONLESS_VALIDATOR_TX = 'AddPermissionlessValidatorTx',\n ADD_PERMISSIONLESS_DELEGATOR_TX = 'AddPermissionlessDelegatorTx',\n BASE_TX = 'BaseTx',\n TRANSFER_SUBNET_OWNERSHIP_TX = 'TransferSubnetOwnershipTx',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum XChainTransactionType {\n BASE_TX = 'BaseTx',\n CREATE_ASSET_TX = 'CreateAssetTx',\n OPERATION_TX = 'OperationTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n UNKNOWN = 'UNKNOWN',\n}\n"]}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var t=(e=>(e.ETH_SEND_TRANSACTION="eth_sendTransaction",e.SIGN_TYPED_DATA_V3="eth_signTypedData_v3",e.SIGN_TYPED_DATA_V4="eth_signTypedData_v4",e.SIGN_TYPED_DATA_V1="eth_signTypedData_v1",e.SIGN_TYPED_DATA="eth_signTypedData",e.PERSONAL_SIGN="personal_sign",e.ETH_SIGN="eth_sign",e.WALLET_ADD_ETHEREUM_CHAIN="wallet_addEthereumChain",e.WALLET_SWITCH_ETHEREUM_CHAIN="wallet_switchEthereumChain",e.WALLET_GET_ETHEREUM_CHAIN="wallet_getEthereumChain",e))(t||{}),r=(e=>(e.EVM_TRANSACTION="evm_transaction",e.EVM_MESSAGE_ETH_SIGN="evm_message_eth_sign",e.EVM_MESSAGE_PERSONAL_SIGN="evm_message_personal_sign",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA="evm_message_eth_sign_typed_data",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1="evm_message_eth_sign_typed_data_v1",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3="evm_message_eth_sign_typed_data_v3",e.EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4="evm_message_eth_sign_typed_data_v4",e.AVALANCHE_TRANSACTION="avalanche_transaction",e.AVALANCHE_MESSAGE="avalanche_message",e.BTC_TRANSACTION="btc_transaction",e))(r||{});
4
+
5
+ exports.a = t;
6
+ exports.b = r;
7
+ //# sourceMappingURL=out.js.map
8
+ //# sourceMappingURL=chunk-ISTALLTN.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rpc.ts"],"names":["RpcMethod","SigningDataType"],"mappings":"AAIO,IAAKA,OAEVA,EAAA,qBAAuB,sBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,mBAAqB,uBACrBA,EAAA,gBAAkB,oBAClBA,EAAA,cAAgB,gBAChBA,EAAA,SAAW,WACXA,EAAA,0BAA4B,0BAC5BA,EAAA,6BAA+B,6BAC/BA,EAAA,0BAA4B,0BAXlBA,OAAA,IA8DAC,OAEVA,EAAA,gBAAkB,kBAClBA,EAAA,qBAAuB,uBACvBA,EAAA,0BAA4B,4BAC5BA,EAAA,gCAAkC,kCAClCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCACrCA,EAAA,mCAAqC,qCAGrCA,EAAA,sBAAwB,wBACxBA,EAAA,kBAAoB,oBAGpBA,EAAA,gBAAkB,kBAfRA,OAAA","sourcesContent":["import type { TransactionRequest } from 'ethers';\nimport type { Caip2ChainId, Hex } from './common';\nimport type { JsonRpcError, EthereumProviderError, OptionalDataWithOptionalCause } from '@metamask/rpc-errors';\n\nexport enum RpcMethod {\n /* EVM */\n ETH_SEND_TRANSACTION = 'eth_sendTransaction',\n SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3',\n SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4',\n SIGN_TYPED_DATA_V1 = 'eth_signTypedData_v1',\n SIGN_TYPED_DATA = 'eth_signTypedData',\n PERSONAL_SIGN = 'personal_sign',\n ETH_SIGN = 'eth_sign',\n WALLET_ADD_ETHEREUM_CHAIN = 'wallet_addEthereumChain',\n WALLET_SWITCH_ETHEREUM_CHAIN = 'wallet_switchEthereumChain',\n WALLET_GET_ETHEREUM_CHAIN = 'wallet_getEthereumChain',\n}\n\nexport type DappInfo = {\n name: string;\n url: string;\n icon: string;\n};\n\nexport type RpcRequest = {\n requestId: string;\n sessionId: string;\n method: RpcMethod;\n chainId: Caip2ChainId;\n params: unknown;\n dappInfo: DappInfo;\n context?: Record<string, unknown>; // for storing additional context information that's only relevant to the consumer\n};\n\nexport type RpcError =\n | JsonRpcError<OptionalDataWithOptionalCause>\n | EthereumProviderError<OptionalDataWithOptionalCause>;\n\nexport type RpcResponse<R = unknown, E extends RpcError = JsonRpcError<OptionalDataWithOptionalCause>> =\n | {\n result: R;\n }\n | {\n error: E;\n };\n\nexport type DisplayData = {\n title: string;\n network: {\n chainId: number;\n name: string;\n logoUri?: string;\n };\n messageDetails?: string;\n transactionDetails?: {\n website: string;\n from: string;\n to: string;\n data?: string;\n };\n networkFeeSelector?: boolean;\n};\n\n/**\n * Enum for different types of signing data.\n */\nexport enum SigningDataType {\n // EVM signing data types\n EVM_TRANSACTION = 'evm_transaction',\n EVM_MESSAGE_ETH_SIGN = 'evm_message_eth_sign',\n EVM_MESSAGE_PERSONAL_SIGN = 'evm_message_personal_sign',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA = 'evm_message_eth_sign_typed_data',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V1 = 'evm_message_eth_sign_typed_data_v1',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V3 = 'evm_message_eth_sign_typed_data_v3',\n EVM_MESSAGE_ETH_SIGN_TYPED_DATA_V4 = 'evm_message_eth_sign_typed_data_v4',\n\n // Avalanche signing data types\n AVALANCHE_TRANSACTION = 'avalanche_transaction',\n AVALANCHE_MESSAGE = 'avalanche_message',\n\n // Bitcoin signing data types\n BTC_TRANSACTION = 'btc_transaction',\n}\n\nexport type SigningData =\n | {\n type: SigningDataType.EVM_TRANSACTION;\n account: string;\n chainId: number;\n data: TransactionRequest;\n }\n | {\n type: SigningDataType.EVM_MESSAGE_ETH_SIGN;\n account: string;\n chainId: number;\n data: string;\n };\n\nexport type ApprovalParams = {\n request: RpcRequest;\n displayData: DisplayData;\n signingData: SigningData;\n};\n\nexport type ApprovalResponse =\n | {\n result: Hex;\n }\n | {\n error: RpcError;\n };\n\nexport interface ApprovalController {\n requestApproval: (params: ApprovalParams) => Promise<ApprovalResponse>;\n onTransactionConfirmed: (txHash: Hex) => void;\n onTransactionReverted: (txHash: Hex) => void;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=out.js.map
4
+ //# sourceMappingURL=chunk-JUV577XH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=out.js.map
4
+ //# sourceMappingURL=chunk-OGQBQHLH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,7 @@
1
+ import { object, number, record } from 'zod';
2
+
3
+ var l=object({price:number().optional().nullable(),change24:number().optional().nullable(),marketCap:number().optional().nullable(),vol24:number().optional().nullable()}),n=record(l),c=record(n),a=record(record(number().nullable().optional()));
4
+
5
+ export { c as a, a as b };
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=chunk-WOO6UGSQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/coingecko.ts"],"names":["number","object","record","SimplePriceInCurrency","SimplePriceInCurrencyResponseSchema","SimplePriceResponseSchema","RawSimplePriceResponseSchema"],"mappings":"AAAA,OAAS,UAAAA,EAAQ,UAAAC,EAAQ,UAAAC,MAAiB,MAE1C,IAAMC,EAAwBF,EAAO,CACnC,MAAOD,EAAO,EAAE,SAAS,EAAE,SAAS,EACpC,SAAUA,EAAO,EAAE,SAAS,EAAE,SAAS,EACvC,UAAWA,EAAO,EAAE,SAAS,EAAE,SAAS,EACxC,MAAOA,EAAO,EAAE,SAAS,EAAE,SAAS,CACtC,CAAC,EAEKI,EAAsCF,EAAOC,CAAqB,EAC3DE,EAA4BH,EAAOE,CAAmC,EAGtEE,EAA+BJ,EAAOA,EAAOF,EAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { number, object, record, z } from 'zod';\n\nconst SimplePriceInCurrency = object({\n price: number().optional().nullable(),\n change24: number().optional().nullable(),\n marketCap: number().optional().nullable(),\n vol24: number().optional().nullable(),\n});\n\nconst SimplePriceInCurrencyResponseSchema = record(SimplePriceInCurrency);\nexport const SimplePriceResponseSchema = record(SimplePriceInCurrencyResponseSchema);\nexport type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;\n\nexport const RawSimplePriceResponseSchema = record(record(number().nullable().optional()));\nexport type RawSimplePriceResponse = z.infer<typeof RawSimplePriceResponseSchema>;\n"]}