@avalabs/vm-module-types 0.0.0-testRetry-20240726180414 → 0.0.0-testSkipCI-20240620194941

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 (125) hide show
  1. package/.turbo/turbo-lint.log +1 -1
  2. package/CHANGELOG.md +2 -83
  3. package/README.md +1 -1
  4. package/package.json +3 -19
  5. package/src/index.ts +1 -10
  6. package/src/types.ts +155 -0
  7. package/tsconfig.json +1 -1
  8. package/.turbo/turbo-build.log +0 -130
  9. package/dist/balance.cjs +0 -6
  10. package/dist/balance.cjs.map +0 -1
  11. package/dist/balance.d.cts +0 -124
  12. package/dist/balance.d.ts +0 -124
  13. package/dist/balance.js +0 -3
  14. package/dist/balance.js.map +0 -1
  15. package/dist/chunk-2KGTZTXY.cjs +0 -7
  16. package/dist/chunk-2KGTZTXY.cjs.map +0 -1
  17. package/dist/chunk-47KTBBRA.cjs +0 -4
  18. package/dist/chunk-47KTBBRA.cjs.map +0 -1
  19. package/dist/chunk-4BNYMHOY.js +0 -5
  20. package/dist/chunk-4BNYMHOY.js.map +0 -1
  21. package/dist/chunk-4PGCXP4C.cjs +0 -10
  22. package/dist/chunk-4PGCXP4C.cjs.map +0 -1
  23. package/dist/chunk-74SNNWSF.cjs +0 -9
  24. package/dist/chunk-74SNNWSF.cjs.map +0 -1
  25. package/dist/chunk-7U2R34EQ.js +0 -3
  26. package/dist/chunk-7U2R34EQ.js.map +0 -1
  27. package/dist/chunk-7Y6UGMPZ.js +0 -5
  28. package/dist/chunk-7Y6UGMPZ.js.map +0 -1
  29. package/dist/chunk-A4YEBDMG.js +0 -7
  30. package/dist/chunk-A4YEBDMG.js.map +0 -1
  31. package/dist/chunk-AILYKQEY.cjs +0 -4
  32. package/dist/chunk-AILYKQEY.cjs.map +0 -1
  33. package/dist/chunk-BFBDZPL3.cjs +0 -9
  34. package/dist/chunk-BFBDZPL3.cjs.map +0 -1
  35. package/dist/chunk-BHB5UV3J.js +0 -3
  36. package/dist/chunk-BHB5UV3J.js.map +0 -1
  37. package/dist/chunk-CUVJNZP5.js +0 -3
  38. package/dist/chunk-CUVJNZP5.js.map +0 -1
  39. package/dist/chunk-H6ZZE5M7.js +0 -5
  40. package/dist/chunk-H6ZZE5M7.js.map +0 -1
  41. package/dist/chunk-JUV577XH.cjs +0 -4
  42. package/dist/chunk-JUV577XH.cjs.map +0 -1
  43. package/dist/chunk-OGQBQHLH.cjs +0 -4
  44. package/dist/chunk-OGQBQHLH.cjs.map +0 -1
  45. package/dist/chunk-P6AM7I3B.js +0 -3
  46. package/dist/chunk-P6AM7I3B.js.map +0 -1
  47. package/dist/chunk-RKFOXZ35.js +0 -5
  48. package/dist/chunk-RKFOXZ35.js.map +0 -1
  49. package/dist/chunk-VRQJHO4F.cjs +0 -8
  50. package/dist/chunk-VRQJHO4F.cjs.map +0 -1
  51. package/dist/chunk-WOO6UGSQ.js +0 -7
  52. package/dist/chunk-WOO6UGSQ.js.map +0 -1
  53. package/dist/chunk-YVYCETG2.cjs +0 -8
  54. package/dist/chunk-YVYCETG2.cjs.map +0 -1
  55. package/dist/coingecko.cjs +0 -16
  56. package/dist/coingecko.cjs.map +0 -1
  57. package/dist/coingecko.d.cts +0 -23
  58. package/dist/coingecko.d.ts +0 -23
  59. package/dist/coingecko.js +0 -3
  60. package/dist/coingecko.js.map +0 -1
  61. package/dist/common.cjs +0 -16
  62. package/dist/common.cjs.map +0 -1
  63. package/dist/common.d.cts +0 -40
  64. package/dist/common.d.ts +0 -40
  65. package/dist/common.js +0 -3
  66. package/dist/common.js.map +0 -1
  67. package/dist/index.cjs +0 -61
  68. package/dist/index.cjs.map +0 -1
  69. package/dist/index.d.cts +0 -15
  70. package/dist/index.d.ts +0 -15
  71. package/dist/index.js +0 -12
  72. package/dist/index.js.map +0 -1
  73. package/dist/manifest.cjs +0 -12
  74. package/dist/manifest.cjs.map +0 -1
  75. package/dist/manifest.d.cts +0 -261
  76. package/dist/manifest.d.ts +0 -261
  77. package/dist/manifest.js +0 -3
  78. package/dist/manifest.js.map +0 -1
  79. package/dist/module.cjs +0 -6
  80. package/dist/module.cjs.map +0 -1
  81. package/dist/module.d.cts +0 -25
  82. package/dist/module.d.ts +0 -25
  83. package/dist/module.js +0 -3
  84. package/dist/module.js.map +0 -1
  85. package/dist/network-fee.cjs +0 -6
  86. package/dist/network-fee.cjs.map +0 -1
  87. package/dist/network-fee.d.cts +0 -18
  88. package/dist/network-fee.d.ts +0 -18
  89. package/dist/network-fee.js +0 -3
  90. package/dist/network-fee.js.map +0 -1
  91. package/dist/rpc.cjs +0 -16
  92. package/dist/rpc.cjs.map +0 -1
  93. package/dist/rpc.d.cts +0 -137
  94. package/dist/rpc.d.ts +0 -137
  95. package/dist/rpc.js +0 -3
  96. package/dist/rpc.js.map +0 -1
  97. package/dist/token.cjs +0 -12
  98. package/dist/token.cjs.map +0 -1
  99. package/dist/token.d.cts +0 -48
  100. package/dist/token.d.ts +0 -48
  101. package/dist/token.js +0 -3
  102. package/dist/token.js.map +0 -1
  103. package/dist/transaction-history.cjs +0 -20
  104. package/dist/transaction-history.cjs.map +0 -1
  105. package/dist/transaction-history.d.cts +0 -106
  106. package/dist/transaction-history.d.ts +0 -106
  107. package/dist/transaction-history.js +0 -3
  108. package/dist/transaction-history.js.map +0 -1
  109. package/dist/transaction-simulation.cjs +0 -6
  110. package/dist/transaction-simulation.cjs.map +0 -1
  111. package/dist/transaction-simulation.d.cts +0 -27
  112. package/dist/transaction-simulation.d.ts +0 -27
  113. package/dist/transaction-simulation.js +0 -3
  114. package/dist/transaction-simulation.js.map +0 -1
  115. package/src/balance.ts +0 -146
  116. package/src/coingecko.ts +0 -15
  117. package/src/common.ts +0 -43
  118. package/src/manifest.ts +0 -40
  119. package/src/module.ts +0 -17
  120. package/src/network-fee.ts +0 -7
  121. package/src/rpc.ts +0 -157
  122. package/src/token.ts +0 -52
  123. package/src/transaction-history.ts +0 -113
  124. package/src/transaction-simulation.ts +0 -29
  125. package/tsup.config.ts +0 -4
@@ -1,4 +1,4 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.20 lint /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.3 lint /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > eslint "src/**/*.ts"
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,91 +1,10 @@
1
1
  # @avalabs/vm-module-types
2
2
 
3
- ## 0.0.0-testRetry-20240726180414
4
-
5
- ## 0.0.20
6
-
7
- ### Patch Changes
8
-
9
- - 9bfa82d: Implement balance fetching for BitcoinModule
10
-
11
- ## 0.0.19
12
-
13
- ### Patch Changes
14
-
15
- - 5af458b: Add getBalances to avalanche-module
16
-
17
- ## 0.0.18
18
-
19
- ## 0.0.17
20
-
21
- ### Patch Changes
22
-
23
- - 3590edf: Transaction parsing, validation and simulation for EVM
24
-
25
- ## 0.0.16
26
-
27
- ### Patch Changes
28
-
29
- - bc48457: add support for all eth_sign methods
30
-
31
- ## 0.0.15
32
-
33
- ### Patch Changes
34
-
35
- - f536d58: add module functions to evm-module
36
-
37
- ## 0.0.14
38
-
39
- ### Patch Changes
40
-
41
- - 0593258: add getBalances to evm-module
42
-
43
- ## 0.0.13
44
-
45
- ### Patch Changes
46
-
47
- - af68c81: Add getTransactionHistory to avalanche module
48
- - d9fa0f5: added getNetworkFee to avalanche module
49
-
50
- ## 0.0.12
51
-
52
- ### Patch Changes
53
-
54
- - cd97708: fix: build types package
55
- - d0c2cc9: make module interface more consistent
56
- - 7bc6c6e: add eth_sendTransaction handler
57
-
58
- ## 0.0.11
59
-
60
- ## 0.0.10
61
-
62
- ### Patch Changes
63
-
64
- - 60f36fa: add getTokens function
65
-
66
- ## 0.0.9
67
-
68
- ### Patch Changes
69
-
70
- - 6ffa356: add module functions to evm-module
71
-
72
- ## 0.0.8
73
-
74
- ### Patch Changes
75
-
76
- - d1d080f: test release
77
-
78
- ## 0.0.7
79
-
80
- ### Patch Changes
81
-
82
- - bb98621: Move types to @avalabs/vm-module-types
83
-
84
- ## 0.0.6
3
+ ## 0.0.0-testSkipCI-20240620194941
85
4
 
86
5
  ### Patch Changes
87
6
 
88
- - 1122704: test release
7
+ - fc6fd4e: test release
89
8
 
90
9
  ## 0.0.3
91
10
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- This package exposes the types for the VM modules
5
+ This package exposes the types for the VM modules.
6
6
 
7
7
  ## Installation
8
8
 
package/package.json CHANGED
@@ -1,30 +1,14 @@
1
1
  {
2
2
  "name": "@avalabs/vm-module-types",
3
- "version": "0.0.0-testRetry-20240726180414",
4
- "main": "dist/index.cjs",
5
- "module": "dist/index.js",
6
- "typings": "dist/index.d.ts",
7
- "type": "module",
3
+ "version": "0.0.0-testSkipCI-20240620194941",
4
+ "main": "src/index.ts",
8
5
  "dependencies": {
9
- "zod": "3.23.8",
10
- "@metamask/rpc-errors": "6.3.0",
11
- "ethers": "6.8.1"
6
+ "zod": "3.23.8"
12
7
  },
13
8
  "devDependencies": {
14
- "tsup": "7.2.0",
15
- "bn.js": "5.2.1",
16
- "@types/bn.js": "5.1.5",
17
- "@avalabs/coingecko-sdk": "v2.8.0-alpha.193",
18
- "@avalabs/glacier-sdk": "v2.8.0-alpha.193",
19
- "@avalabs/utils-sdk": "2.8.0-alpha.193",
20
- "@internal/tsup-config": "0.0.1",
21
9
  "eslint-config-custom": "0.0.1"
22
10
  },
23
- "peerDependencies": {
24
- "ethers": "^6.8.1"
25
- },
26
11
  "scripts": {
27
- "build": "tsup",
28
12
  "lint": "eslint \"src/**/*.ts\""
29
13
  }
30
14
  }
package/src/index.ts CHANGED
@@ -1,10 +1 @@
1
- export * from './common';
2
- export * from './coingecko';
3
- export * from './balance';
4
- export * from './manifest';
5
- export * from './module';
6
- export * from './network-fee';
7
- export * from './rpc';
8
- export * from './token';
9
- export * from './transaction-history';
10
- export * from './transaction-simulation';
1
+ export * from './types';
package/src/types.ts ADDED
@@ -0,0 +1,155 @@
1
+ import { object, string, boolean, z } from 'zod';
2
+
3
+ export enum TransactionType {
4
+ BRIDGE = 'Bridge',
5
+ SWAP = 'Swap',
6
+ SEND = 'Send',
7
+ RECEIVE = 'Receive',
8
+ NFT_BUY = 'NFTBuy',
9
+ APPROVE = 'Approve',
10
+ TRANSFER = 'Transfer',
11
+ NFT_SEND = 'NFTSend',
12
+ NFT_RECEIVE = 'NFTReceive',
13
+ AIRDROP = 'Airdrop',
14
+ FILL_ORDER = 'FillOrder',
15
+ UNWRAP = 'Unwrap',
16
+ UNKNOWN = 'UNKNOWN',
17
+ }
18
+
19
+ export enum TokenType {
20
+ NATIVE = 'NATIVE',
21
+ ERC20 = 'ERC20',
22
+ ERC721 = 'ERC721',
23
+ ERC1155 = 'ERC1155',
24
+ }
25
+
26
+ export type NetworkFees = {
27
+ low: { maxPriorityFeePerGas: bigint; maxFeePerGas: bigint };
28
+ medium: { maxPriorityFeePerGas: bigint; maxFeePerGas: bigint };
29
+ high: { maxPriorityFeePerGas: bigint; maxFeePerGas: bigint };
30
+ baseFee: bigint;
31
+ };
32
+
33
+ export interface Module {
34
+ getManifest: () => Manifest | undefined;
35
+ getBalances: () => Promise<string>;
36
+ getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
37
+ getNetworkFee: () => Promise<NetworkFees>;
38
+ getAddress: () => Promise<string>;
39
+ }
40
+
41
+ export type GetTransactionHistory = {
42
+ chainId: number;
43
+ isTestnet: boolean;
44
+ networkToken: NetworkToken;
45
+ explorerUrl: string;
46
+ address: string;
47
+ nextPageToken?: string;
48
+ offset?: number;
49
+ glacierApiUrl?: string;
50
+ };
51
+
52
+ export type TransactionHistoryResponse = {
53
+ transactions: Transaction[];
54
+ nextPageToken?: string;
55
+ };
56
+
57
+ export type Transaction = {
58
+ isContractCall: boolean;
59
+ isIncoming: boolean;
60
+ isOutgoing: boolean;
61
+ isSender: boolean;
62
+ timestamp: number;
63
+ hash: string;
64
+ from: string;
65
+ to: string;
66
+ tokens: TxToken[];
67
+ gasPrice?: string;
68
+ gasUsed: string;
69
+ txType?: TransactionType;
70
+ chainId: string; // chainId from ActiveNetwork used to fetch tx
71
+ method?: string;
72
+ explorerLink: string;
73
+ };
74
+
75
+ export interface TxToken {
76
+ decimal?: string;
77
+ name: string;
78
+ symbol: string;
79
+ amount: string;
80
+ imageUri?: string;
81
+ from?: RichAddress;
82
+ to?: RichAddress;
83
+ collectableTokenId?: string;
84
+ type: TokenType;
85
+ }
86
+
87
+ type RichAddress = {
88
+ /**
89
+ * The contract name.
90
+ */
91
+ name?: string;
92
+ /**
93
+ * The contract symbol.
94
+ */
95
+ symbol?: string;
96
+ /**
97
+ * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.
98
+ */
99
+ decimals?: number;
100
+ /**
101
+ * The logo uri for the address.
102
+ */
103
+ logoUri?: string;
104
+ /**
105
+ * A wallet or contract address in mixed-case checksum encoding.
106
+ */
107
+ address: string;
108
+ };
109
+
110
+ export interface NetworkToken {
111
+ name: string;
112
+ symbol: string;
113
+ description: string;
114
+ decimals: number;
115
+ logoUri: string;
116
+ }
117
+
118
+ const sourceSchema = object({
119
+ checksum: string(),
120
+ location: object({
121
+ npm: object({
122
+ filePath: string(),
123
+ packageName: string(),
124
+ registry: string(),
125
+ }),
126
+ }),
127
+ });
128
+
129
+ const manifestSchema = object({
130
+ name: string(),
131
+ version: string(),
132
+ description: string(),
133
+ sources: object({
134
+ module: sourceSchema,
135
+ provider: sourceSchema.optional(),
136
+ }),
137
+ network: object({
138
+ chainIds: string().array(),
139
+ namespaces: string().array(),
140
+ }),
141
+ cointype: string(),
142
+ permissions: object({
143
+ rpc: object({
144
+ dapps: boolean(),
145
+ methods: string().array(),
146
+ }),
147
+ }),
148
+ manifestVersion: string(),
149
+ });
150
+
151
+ export type Manifest = z.infer<typeof manifestSchema>;
152
+
153
+ export const parseManifest = (params: unknown): z.SafeParseReturnType<unknown, Manifest> => {
154
+ return manifestSchema.safeParse(params);
155
+ };
package/tsconfig.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "extends": "@internal/tsconfig/tsconfig.base.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
- "tsBuildInfoFile": ".tsbuildinfo"
5
+ "composite": true
6
6
  },
7
7
  "include": ["src"]
8
8
  }
@@ -1,130 +0,0 @@
1
-
2
- > @avalabs/vm-module-types@0.0.20 build /home/runner/work/vm-modules/vm-modules/packages/types
3
- > tsup
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, src/transaction-simulation.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v7.2.0
8
- CLI Using tsup config: /home/runner/work/vm-modules/vm-modules/packages/types/tsup.config.ts
9
- CLI Target: es2021
10
- CLI Cleaning output folder
11
- CJS Build start
12
- ESM Build start
13
- Generated an empty chunk: "chunk-47KTBBRA".
14
- Generated an empty chunk: "chunk-JUV577XH".
15
- Generated an empty chunk: "chunk-OGQBQHLH".
16
- Generated an empty chunk: "chunk-AILYKQEY".
17
- Generated an empty chunk: "chunk-P6AM7I3B".
18
- Generated an empty chunk: "chunk-BHB5UV3J".
19
- Generated an empty chunk: "chunk-CUVJNZP5".
20
- Generated an empty chunk: "chunk-7U2R34EQ".
21
- 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-VRQJHO4F.cjs 276.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/token.cjs 260.00 B
30
- CJS dist/transaction-history.cjs 542.00 B
31
- CJS dist/transaction-simulation.cjs 132.00 B
32
- CJS dist/balance.cjs 117.00 B
33
- CJS dist/coingecko.cjs 418.00 B
34
- CJS dist/common.cjs 386.00 B
35
- CJS dist/index.cjs 1.90 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-VRQJHO4F.cjs.map 1.08 KB
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/token.cjs.map 51.00 B
51
- CJS dist/transaction-history.cjs.map 51.00 B
52
- CJS dist/transaction-simulation.cjs.map 51.00 B
53
- CJS dist/balance.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 1336ms
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-4BNYMHOY.js 257.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 142.00 B
78
- ESM dist/index.js 664.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-4BNYMHOY.js.map 1.08 KB
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 1359ms
107
- DTS Build start
108
- DTS ⚡️ Build success in 10121ms
109
- DTS dist/index.d.cts 1.43 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.81 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 902.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.42 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.80 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 901.00 B
129
- DTS dist/transaction-simulation.d.ts 641.00 B
130
- DTS dist/token.d.ts 1.05 KB
package/dist/balance.cjs DELETED
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- require('./chunk-JUV577XH.cjs');
4
-
5
- //# sourceMappingURL=out.js.map
6
- //# sourceMappingURL=balance.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,124 +0,0 @@
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
- balanceDisplayValue: string;
19
- balanceInCurrency?: number;
20
- balanceCurrencyDisplayValue?: string;
21
- };
22
- type TokenMarketData = {
23
- priceInCurrency?: number;
24
- priceChanges?: {
25
- percentage?: number;
26
- value?: number;
27
- };
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
- balancePerType: {
81
- lockedStaked: number;
82
- lockedStakeable: number;
83
- lockedPlatform: number;
84
- atomicMemoryLocked: number;
85
- atomicMemoryUnlocked: number;
86
- unlockedUnstaked: number;
87
- unlockedStaked: number;
88
- pendingStaked: number;
89
- };
90
- }
91
- interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
92
- available?: BN;
93
- availableInCurrency?: number;
94
- availableDisplayValue?: string;
95
- availableCurrencyDisplayValue?: string;
96
- utxos?: XChainBalances;
97
- balancePerType: {
98
- locked: number;
99
- unlocked: number;
100
- atomicMemoryUnlocked: number;
101
- atomicMemoryLocked: number;
102
- };
103
- }
104
- interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type'> {
105
- type: TokenType.ERC721 | TokenType.ERC1155;
106
- address: string;
107
- description: string;
108
- logoUri: string;
109
- logoSmall: string;
110
- name: string;
111
- symbol: string;
112
- tokenId: string;
113
- attributes: TokenAttribute[];
114
- collectionName: string;
115
- updatedAt?: number;
116
- }
117
- interface TokenAttribute {
118
- name: string;
119
- value: string;
120
- }
121
- type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM | NftTokenWithBalance;
122
- type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
123
-
124
- export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, NftTokenWithBalance, TokenAttribute, TokenBalanceData, TokenMarketData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };