@talismn/balances 0.0.0-pr2075-20250710142256 → 0.0.0-pr2076-20250703120513

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 (163) hide show
  1. package/dist/declarations/src/BalanceModule.d.ts +84 -0
  2. package/dist/declarations/src/TalismanBalancesDatabase.d.ts +11 -0
  3. package/dist/declarations/src/{getMiniMetadatas/index.d.ts → getMiniMetadata/getMiniMetadatas.d.ts} +1 -2
  4. package/dist/declarations/src/getMiniMetadata/getUpdatedMiniMetadatas.d.ts +4 -0
  5. package/dist/declarations/src/getMiniMetadata/index.d.ts +5 -0
  6. package/dist/declarations/src/index.d.ts +2 -2
  7. package/dist/declarations/src/modules/EvmErc20Module.d.ts +30 -0
  8. package/dist/declarations/src/modules/EvmNativeModule.d.ts +27 -0
  9. package/dist/declarations/src/modules/EvmUniswapV2Module.d.ts +37 -0
  10. package/dist/declarations/src/modules/SubstrateAssetsModule.d.ts +40 -0
  11. package/dist/declarations/src/modules/SubstrateForeignAssetsModule.d.ts +40 -0
  12. package/dist/declarations/src/modules/SubstrateNativeModule/index.d.ts +21 -0
  13. package/dist/declarations/src/modules/SubstrateNativeModule/subscribeBase.d.ts +5 -0
  14. package/dist/declarations/src/modules/SubstrateNativeModule/subscribeNompoolStaking.d.ts +5 -0
  15. package/dist/declarations/src/modules/SubstrateNativeModule/subscribeSubtensorStaking.d.ts +5 -0
  16. package/dist/declarations/src/modules/SubstrateNativeModule/types.d.ts +32 -0
  17. package/dist/declarations/src/modules/SubstrateNativeModule/util/QueryCache.d.ts +13 -0
  18. package/dist/declarations/src/modules/SubstrateNativeModule/util/SubNativeBalanceError.d.ts +5 -0
  19. package/dist/declarations/src/modules/SubstrateNativeModule/util/asObservable.d.ts +10 -0
  20. package/dist/declarations/src/modules/SubstrateNativeModule/util/buildQueries.d.ts +14 -0
  21. package/dist/declarations/src/modules/SubstrateNativeModule/util/mergeBalances.d.ts +13 -0
  22. package/dist/declarations/src/modules/SubstrateNativeModule/util/sortChains.d.ts +1 -0
  23. package/dist/declarations/src/modules/SubstrateNativeModule/util/systemProperties.d.ts +5 -0
  24. package/dist/declarations/src/modules/SubstratePsp22Module.d.ts +40 -0
  25. package/dist/declarations/src/modules/SubstrateTokensModule.d.ts +43 -0
  26. package/dist/declarations/src/modules/abis/erc20.d.ts +227 -0
  27. package/dist/declarations/src/modules/abis/index.d.ts +0 -2
  28. package/dist/declarations/src/modules/index.d.ts +154 -41
  29. package/dist/declarations/src/modules/util/InferBalanceModuleTypes.d.ts +30 -0
  30. package/dist/declarations/src/modules/util/RpcStateQueryHelper.d.ts +19 -0
  31. package/dist/declarations/src/modules/util/balances.d.ts +8 -0
  32. package/dist/declarations/src/modules/util/buildStorageCoders.d.ts +43 -0
  33. package/dist/declarations/src/modules/util/decodeOutput.d.ts +13 -0
  34. package/dist/declarations/src/modules/util/detectTransferMethod.d.ts +11 -0
  35. package/dist/declarations/src/modules/util/getAddresssesByTokenByNetwork.d.ts +3 -0
  36. package/dist/declarations/src/modules/util/getUniqueChainIds.d.ts +5 -0
  37. package/dist/declarations/src/modules/util/index.d.ts +9 -0
  38. package/dist/declarations/src/modules/{substrate-psp22/util.d.ts → util/makeContractCaller.d.ts} +1 -2
  39. package/dist/declarations/src/modules/util/storageCompression.d.ts +9 -0
  40. package/dist/declarations/src/plugins.d.ts +17 -0
  41. package/dist/declarations/src/types/addresses.d.ts +3 -0
  42. package/dist/declarations/src/types/balances.d.ts +5 -24
  43. package/dist/declarations/src/types/balancetypes.d.ts +25 -3
  44. package/dist/declarations/src/types/index.d.ts +0 -2
  45. package/dist/declarations/src/types/minimetadatas.d.ts +13 -4
  46. package/dist/declarations/src/upgrades/2024-01-25-upgradeRemoveSymbolFromNativeTokenId.d.ts +2 -0
  47. package/dist/declarations/src/upgrades/2024-03-19-upgradeBalancesDataBlob.d.ts +2 -0
  48. package/dist/declarations/src/upgrades/index.d.ts +2 -0
  49. package/dist/declarations/src/version.d.ts +1 -1
  50. package/dist/talismn-balances.cjs.dev.js +5378 -5016
  51. package/dist/talismn-balances.cjs.prod.js +5378 -5016
  52. package/dist/talismn-balances.esm.js +5320 -4965
  53. package/package.json +15 -13
  54. package/plugins/dist/talismn-balances-plugins.cjs.d.ts +1 -0
  55. package/plugins/dist/talismn-balances-plugins.cjs.dev.js +2 -0
  56. package/plugins/dist/talismn-balances-plugins.cjs.js +7 -0
  57. package/plugins/dist/talismn-balances-plugins.cjs.prod.js +2 -0
  58. package/plugins/dist/talismn-balances-plugins.esm.js +1 -0
  59. package/plugins/package.json +4 -0
  60. package/dist/declarations/src/BalancesProvider.d.ts +0 -30
  61. package/dist/declarations/src/modules/evm-erc20/config.d.ts +0 -3
  62. package/dist/declarations/src/modules/evm-erc20/fetchBalances.d.ts +0 -3
  63. package/dist/declarations/src/modules/evm-erc20/fetchTokens.d.ts +0 -3
  64. package/dist/declarations/src/modules/evm-erc20/getMiniMetadata.d.ts +0 -3
  65. package/dist/declarations/src/modules/evm-erc20/getTransferCallData.d.ts +0 -3
  66. package/dist/declarations/src/modules/evm-erc20/index.d.ts +0 -2
  67. package/dist/declarations/src/modules/evm-erc20/module.d.ts +0 -3
  68. package/dist/declarations/src/modules/evm-erc20/subscribeBalances.d.ts +0 -3
  69. package/dist/declarations/src/modules/evm-erc20/types.d.ts +0 -14
  70. package/dist/declarations/src/modules/evm-erc20/utils.d.ts +0 -6
  71. package/dist/declarations/src/modules/evm-native/config.d.ts +0 -3
  72. package/dist/declarations/src/modules/evm-native/fetchBalances.d.ts +0 -3
  73. package/dist/declarations/src/modules/evm-native/fetchTokens.d.ts +0 -3
  74. package/dist/declarations/src/modules/evm-native/getMiniMetadata.d.ts +0 -3
  75. package/dist/declarations/src/modules/evm-native/getTransferCallData.d.ts +0 -3
  76. package/dist/declarations/src/modules/evm-native/index.d.ts +0 -2
  77. package/dist/declarations/src/modules/evm-native/module.d.ts +0 -3
  78. package/dist/declarations/src/modules/evm-native/subscribeBalances.d.ts +0 -3
  79. package/dist/declarations/src/modules/evm-native/types.d.ts +0 -13
  80. package/dist/declarations/src/modules/evm-uniswapv2/config.d.ts +0 -3
  81. package/dist/declarations/src/modules/evm-uniswapv2/fetchBalances.d.ts +0 -3
  82. package/dist/declarations/src/modules/evm-uniswapv2/fetchTokens.d.ts +0 -3
  83. package/dist/declarations/src/modules/evm-uniswapv2/getMiniMetadata.d.ts +0 -3
  84. package/dist/declarations/src/modules/evm-uniswapv2/getTransferCallData.d.ts +0 -3
  85. package/dist/declarations/src/modules/evm-uniswapv2/index.d.ts +0 -2
  86. package/dist/declarations/src/modules/evm-uniswapv2/module.d.ts +0 -3
  87. package/dist/declarations/src/modules/evm-uniswapv2/subscribeBalances.d.ts +0 -3
  88. package/dist/declarations/src/modules/evm-uniswapv2/types.d.ts +0 -14
  89. package/dist/declarations/src/modules/evm-uniswapv2/utils.d.ts +0 -12
  90. package/dist/declarations/src/modules/shared/buildNetworkStorageCoders.d.ts +0 -13
  91. package/dist/declarations/src/modules/shared/errors.d.ts +0 -11
  92. package/dist/declarations/src/modules/shared/fetchRuntimeCallResult.d.ts +0 -2
  93. package/dist/declarations/src/modules/shared/index.d.ts +0 -6
  94. package/dist/declarations/src/modules/shared/rpcQueryPack.d.ts +0 -10
  95. package/dist/declarations/src/modules/shared/types.d.ts +0 -7
  96. package/dist/declarations/src/modules/shared/utils.d.ts +0 -6
  97. package/dist/declarations/src/modules/substrate-assets/buildQueries.d.ts +0 -5
  98. package/dist/declarations/src/modules/substrate-assets/config.d.ts +0 -5
  99. package/dist/declarations/src/modules/substrate-assets/fetchBalances.d.ts +0 -3
  100. package/dist/declarations/src/modules/substrate-assets/fetchTokens.d.ts +0 -3
  101. package/dist/declarations/src/modules/substrate-assets/getMiniMetadata.d.ts +0 -3
  102. package/dist/declarations/src/modules/substrate-assets/getTransferCallData.d.ts +0 -3
  103. package/dist/declarations/src/modules/substrate-assets/index.d.ts +0 -2
  104. package/dist/declarations/src/modules/substrate-assets/module.d.ts +0 -3
  105. package/dist/declarations/src/modules/substrate-assets/subscribeBalances.d.ts +0 -3
  106. package/dist/declarations/src/modules/substrate-assets/types.d.ts +0 -14
  107. package/dist/declarations/src/modules/substrate-foreignassets/buildQueries.d.ts +0 -6
  108. package/dist/declarations/src/modules/substrate-foreignassets/config.d.ts +0 -3
  109. package/dist/declarations/src/modules/substrate-foreignassets/fetchBalances.d.ts +0 -3
  110. package/dist/declarations/src/modules/substrate-foreignassets/fetchTokens.d.ts +0 -3
  111. package/dist/declarations/src/modules/substrate-foreignassets/getMiniMetadata.d.ts +0 -3
  112. package/dist/declarations/src/modules/substrate-foreignassets/getTransferCallData.d.ts +0 -3
  113. package/dist/declarations/src/modules/substrate-foreignassets/index.d.ts +0 -2
  114. package/dist/declarations/src/modules/substrate-foreignassets/module.d.ts +0 -3
  115. package/dist/declarations/src/modules/substrate-foreignassets/subscribeBalances.d.ts +0 -3
  116. package/dist/declarations/src/modules/substrate-foreignassets/types.d.ts +0 -14
  117. package/dist/declarations/src/modules/substrate-hydration/config.d.ts +0 -3
  118. package/dist/declarations/src/modules/substrate-hydration/fetchBalances.d.ts +0 -3
  119. package/dist/declarations/src/modules/substrate-hydration/fetchTokens.d.ts +0 -3
  120. package/dist/declarations/src/modules/substrate-hydration/getMiniMetadata.d.ts +0 -3
  121. package/dist/declarations/src/modules/substrate-hydration/getTransferCallData.d.ts +0 -3
  122. package/dist/declarations/src/modules/substrate-hydration/index.d.ts +0 -2
  123. package/dist/declarations/src/modules/substrate-hydration/module.d.ts +0 -3
  124. package/dist/declarations/src/modules/substrate-hydration/subscribeBalances.d.ts +0 -3
  125. package/dist/declarations/src/modules/substrate-hydration/types.d.ts +0 -14
  126. package/dist/declarations/src/modules/substrate-native/bittensor/getSubtensorStakingBalances.d.ts +0 -9
  127. package/dist/declarations/src/modules/substrate-native/config.d.ts +0 -3
  128. package/dist/declarations/src/modules/substrate-native/fetchBalances.d.ts +0 -3
  129. package/dist/declarations/src/modules/substrate-native/fetchTokens.d.ts +0 -8
  130. package/dist/declarations/src/modules/substrate-native/getMiniMetadata.d.ts +0 -3
  131. package/dist/declarations/src/modules/substrate-native/getTransferCallData.d.ts +0 -3
  132. package/dist/declarations/src/modules/substrate-native/index.d.ts +0 -4
  133. package/dist/declarations/src/modules/substrate-native/module.d.ts +0 -3
  134. package/dist/declarations/src/modules/substrate-native/queries/buildBaseQueries.d.ts +0 -17
  135. package/dist/declarations/src/modules/substrate-native/queries/buildNomPoolQueries.d.ts +0 -5
  136. package/dist/declarations/src/modules/substrate-native/subscribeBalances.d.ts +0 -3
  137. package/dist/declarations/src/modules/substrate-native/types.d.ts +0 -25
  138. package/dist/declarations/src/modules/substrate-psp22/config.d.ts +0 -3
  139. package/dist/declarations/src/modules/substrate-psp22/fetchBalances.d.ts +0 -3
  140. package/dist/declarations/src/modules/substrate-psp22/fetchTokens.d.ts +0 -3
  141. package/dist/declarations/src/modules/substrate-psp22/getMiniMetadata.d.ts +0 -3
  142. package/dist/declarations/src/modules/substrate-psp22/getTransferCallData.d.ts +0 -3
  143. package/dist/declarations/src/modules/substrate-psp22/index.d.ts +0 -2
  144. package/dist/declarations/src/modules/substrate-psp22/module.d.ts +0 -3
  145. package/dist/declarations/src/modules/substrate-psp22/subscribeBalances.d.ts +0 -3
  146. package/dist/declarations/src/modules/substrate-psp22/types.d.ts +0 -14
  147. package/dist/declarations/src/modules/substrate-tokens/buildQueries.d.ts +0 -5
  148. package/dist/declarations/src/modules/substrate-tokens/config.d.ts +0 -5
  149. package/dist/declarations/src/modules/substrate-tokens/fetchBalances.d.ts +0 -3
  150. package/dist/declarations/src/modules/substrate-tokens/fetchTokens.d.ts +0 -3
  151. package/dist/declarations/src/modules/substrate-tokens/getMiniMetadata.d.ts +0 -3
  152. package/dist/declarations/src/modules/substrate-tokens/getTransferCallData.d.ts +0 -3
  153. package/dist/declarations/src/modules/substrate-tokens/index.d.ts +0 -2
  154. package/dist/declarations/src/modules/substrate-tokens/module.d.ts +0 -3
  155. package/dist/declarations/src/modules/substrate-tokens/subscribeBalances.d.ts +0 -3
  156. package/dist/declarations/src/modules/substrate-tokens/types.d.ts +0 -23
  157. package/dist/declarations/src/types/IBalanceModule.d.ts +0 -87
  158. package/dist/declarations/src/types/chainConnectors.d.ts +0 -6
  159. /package/dist/declarations/src/{getMiniMetadatas → getMiniMetadata}/getMetadataRpc.d.ts +0 -0
  160. /package/dist/declarations/src/{getMiniMetadatas → getMiniMetadata}/getSpecVersion.d.ts +0 -0
  161. /package/dist/declarations/src/modules/{substrate-native/util/lockTypes.d.ts → SubstrateNativeModule/util/balanceLockTypes.d.ts} +0 -0
  162. /package/dist/declarations/src/modules/{substrate-native → SubstrateNativeModule}/util/nompoolAccountId.d.ts +0 -0
  163. /package/dist/declarations/src/modules/{substrate-native/bittensor → SubstrateNativeModule/util}/subtensor.d.ts +0 -0
@@ -0,0 +1,227 @@
1
+ export declare const erc20Abi: readonly [{
2
+ readonly constant: true;
3
+ readonly inputs: readonly [];
4
+ readonly name: "name";
5
+ readonly outputs: readonly [{
6
+ readonly name: "";
7
+ readonly type: "string";
8
+ }];
9
+ readonly payable: false;
10
+ readonly stateMutability: "view";
11
+ readonly type: "function";
12
+ }, {
13
+ readonly constant: false;
14
+ readonly inputs: readonly [{
15
+ readonly name: "_spender";
16
+ readonly type: "address";
17
+ }, {
18
+ readonly name: "_value";
19
+ readonly type: "uint256";
20
+ }];
21
+ readonly name: "approve";
22
+ readonly outputs: readonly [{
23
+ readonly name: "";
24
+ readonly type: "bool";
25
+ }];
26
+ readonly payable: false;
27
+ readonly stateMutability: "nonpayable";
28
+ readonly type: "function";
29
+ }, {
30
+ readonly constant: true;
31
+ readonly inputs: readonly [];
32
+ readonly name: "totalSupply";
33
+ readonly outputs: readonly [{
34
+ readonly name: "";
35
+ readonly type: "uint256";
36
+ }];
37
+ readonly payable: false;
38
+ readonly stateMutability: "view";
39
+ readonly type: "function";
40
+ }, {
41
+ readonly constant: false;
42
+ readonly inputs: readonly [{
43
+ readonly name: "_from";
44
+ readonly type: "address";
45
+ }, {
46
+ readonly name: "_to";
47
+ readonly type: "address";
48
+ }, {
49
+ readonly name: "_value";
50
+ readonly type: "uint256";
51
+ }];
52
+ readonly name: "transferFrom";
53
+ readonly outputs: readonly [{
54
+ readonly name: "";
55
+ readonly type: "bool";
56
+ }];
57
+ readonly payable: false;
58
+ readonly stateMutability: "nonpayable";
59
+ readonly type: "function";
60
+ }, {
61
+ readonly constant: true;
62
+ readonly inputs: readonly [];
63
+ readonly name: "decimals";
64
+ readonly outputs: readonly [{
65
+ readonly name: "";
66
+ readonly type: "uint8";
67
+ }];
68
+ readonly payable: false;
69
+ readonly stateMutability: "view";
70
+ readonly type: "function";
71
+ }, {
72
+ readonly constant: false;
73
+ readonly inputs: readonly [{
74
+ readonly name: "_to";
75
+ readonly type: "address";
76
+ }, {
77
+ readonly name: "_value";
78
+ readonly type: "uint256";
79
+ }, {
80
+ readonly name: "_data";
81
+ readonly type: "bytes";
82
+ }];
83
+ readonly name: "transferAndCall";
84
+ readonly outputs: readonly [{
85
+ readonly name: "success";
86
+ readonly type: "bool";
87
+ }];
88
+ readonly payable: false;
89
+ readonly stateMutability: "nonpayable";
90
+ readonly type: "function";
91
+ }, {
92
+ readonly constant: false;
93
+ readonly inputs: readonly [{
94
+ readonly name: "_spender";
95
+ readonly type: "address";
96
+ }, {
97
+ readonly name: "_subtractedValue";
98
+ readonly type: "uint256";
99
+ }];
100
+ readonly name: "decreaseApproval";
101
+ readonly outputs: readonly [{
102
+ readonly name: "success";
103
+ readonly type: "bool";
104
+ }];
105
+ readonly payable: false;
106
+ readonly stateMutability: "nonpayable";
107
+ readonly type: "function";
108
+ }, {
109
+ readonly constant: true;
110
+ readonly inputs: readonly [{
111
+ readonly name: "_owner";
112
+ readonly type: "address";
113
+ }];
114
+ readonly name: "balanceOf";
115
+ readonly outputs: readonly [{
116
+ readonly name: "balance";
117
+ readonly type: "uint256";
118
+ }];
119
+ readonly payable: false;
120
+ readonly stateMutability: "view";
121
+ readonly type: "function";
122
+ }, {
123
+ readonly constant: true;
124
+ readonly inputs: readonly [];
125
+ readonly name: "symbol";
126
+ readonly outputs: readonly [{
127
+ readonly name: "";
128
+ readonly type: "string";
129
+ }];
130
+ readonly payable: false;
131
+ readonly stateMutability: "view";
132
+ readonly type: "function";
133
+ }, {
134
+ readonly constant: false;
135
+ readonly inputs: readonly [{
136
+ readonly name: "_to";
137
+ readonly type: "address";
138
+ }, {
139
+ readonly name: "_value";
140
+ readonly type: "uint256";
141
+ }];
142
+ readonly name: "transfer";
143
+ readonly outputs: readonly [{
144
+ readonly name: "success";
145
+ readonly type: "bool";
146
+ }];
147
+ readonly payable: false;
148
+ readonly stateMutability: "nonpayable";
149
+ readonly type: "function";
150
+ }, {
151
+ readonly constant: false;
152
+ readonly inputs: readonly [{
153
+ readonly name: "_spender";
154
+ readonly type: "address";
155
+ }, {
156
+ readonly name: "_addedValue";
157
+ readonly type: "uint256";
158
+ }];
159
+ readonly name: "increaseApproval";
160
+ readonly outputs: readonly [{
161
+ readonly name: "success";
162
+ readonly type: "bool";
163
+ }];
164
+ readonly payable: false;
165
+ readonly stateMutability: "nonpayable";
166
+ readonly type: "function";
167
+ }, {
168
+ readonly constant: true;
169
+ readonly inputs: readonly [{
170
+ readonly name: "_owner";
171
+ readonly type: "address";
172
+ }, {
173
+ readonly name: "_spender";
174
+ readonly type: "address";
175
+ }];
176
+ readonly name: "allowance";
177
+ readonly outputs: readonly [{
178
+ readonly name: "remaining";
179
+ readonly type: "uint256";
180
+ }];
181
+ readonly payable: false;
182
+ readonly stateMutability: "view";
183
+ readonly type: "function";
184
+ }, {
185
+ readonly inputs: readonly [];
186
+ readonly payable: false;
187
+ readonly stateMutability: "nonpayable";
188
+ readonly type: "constructor";
189
+ }, {
190
+ readonly anonymous: false;
191
+ readonly inputs: readonly [{
192
+ readonly indexed: true;
193
+ readonly name: "from";
194
+ readonly type: "address";
195
+ }, {
196
+ readonly indexed: true;
197
+ readonly name: "to";
198
+ readonly type: "address";
199
+ }, {
200
+ readonly indexed: false;
201
+ readonly name: "value";
202
+ readonly type: "uint256";
203
+ }, {
204
+ readonly indexed: false;
205
+ readonly name: "data";
206
+ readonly type: "bytes";
207
+ }];
208
+ readonly name: "Transfer";
209
+ readonly type: "event";
210
+ }, {
211
+ readonly anonymous: false;
212
+ readonly inputs: readonly [{
213
+ readonly indexed: true;
214
+ readonly name: "owner";
215
+ readonly type: "address";
216
+ }, {
217
+ readonly indexed: true;
218
+ readonly name: "spender";
219
+ readonly type: "address";
220
+ }, {
221
+ readonly indexed: false;
222
+ readonly name: "value";
223
+ readonly type: "uint256";
224
+ }];
225
+ readonly name: "Approval";
226
+ readonly type: "event";
227
+ }];
@@ -1,3 +1 @@
1
1
  export * from "./multicall";
2
- export * from "./erc20BalancesAggregator";
3
- export * from "./uniswapV2Pair";
@@ -1,4 +1,20 @@
1
- export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanceModule<"substrate-native", {
1
+ export declare const defaultBalanceModules: (import("..").NewBalanceModule<"evm-erc20", {
2
+ id: string;
3
+ networkId: string;
4
+ decimals: number;
5
+ symbol: string;
6
+ type: "evm-erc20";
7
+ platform: "ethereum";
8
+ contractAddress: `0x${string}`;
9
+ isDefault?: boolean | undefined;
10
+ name?: string | undefined;
11
+ logo?: string | undefined;
12
+ coingeckoId?: string | undefined;
13
+ noDiscovery?: boolean | undefined;
14
+ mirrorOf?: string | undefined;
15
+ isCustom?: boolean | undefined;
16
+ }, import("..").DefaultChainMeta, undefined, {
17
+ contractAddress: `0x${string}`;
2
18
  symbol?: string | undefined;
3
19
  networkId?: string | undefined;
4
20
  isDefault?: boolean | undefined;
@@ -8,16 +24,20 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
8
24
  coingeckoId?: string | undefined;
9
25
  noDiscovery?: boolean | undefined;
10
26
  mirrorOf?: string | undefined;
11
- }, {
12
- disable?: boolean | undefined;
13
- }, {
14
- disable?: boolean | undefined;
15
- useLegacyTransferableCalculation?: boolean | undefined;
16
- existentialDeposit?: string | undefined;
17
- nominationPoolsPalletId?: string | undefined;
18
- hasSubtensorPallet?: boolean | undefined;
19
- }> | import("../types/IBalanceModule").IBalanceModule<"substrate-assets", {
20
- assetId: string;
27
+ }> | import("..").NewBalanceModule<"evm-native", {
28
+ id: string;
29
+ networkId: string;
30
+ decimals: number;
31
+ symbol: string;
32
+ type: "evm-native";
33
+ platform: "ethereum";
34
+ isDefault?: boolean | undefined;
35
+ name?: string | undefined;
36
+ logo?: string | undefined;
37
+ coingeckoId?: string | undefined;
38
+ noDiscovery?: boolean | undefined;
39
+ mirrorOf?: string | undefined;
40
+ }, import("..").DefaultChainMeta, undefined, {
21
41
  symbol?: string | undefined;
22
42
  networkId?: string | undefined;
23
43
  isDefault?: boolean | undefined;
@@ -27,8 +47,39 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
27
47
  coingeckoId?: string | undefined;
28
48
  noDiscovery?: boolean | undefined;
29
49
  mirrorOf?: string | undefined;
30
- }, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"substrate-hydration", {
31
- onChainId: number;
50
+ }> | import("..").NewBalanceModule<"evm-uniswapv2", {
51
+ id: string;
52
+ networkId: string;
53
+ decimals: number;
54
+ symbol: string;
55
+ type: "evm-uniswapv2";
56
+ platform: "ethereum";
57
+ contractAddress: `0x${string}`;
58
+ symbol0: string;
59
+ symbol1: string;
60
+ decimals0: number;
61
+ decimals1: number;
62
+ tokenAddress0: `0x${string}`;
63
+ tokenAddress1: `0x${string}`;
64
+ isDefault?: boolean | undefined;
65
+ name?: string | undefined;
66
+ logo?: string | undefined;
67
+ coingeckoId?: string | undefined;
68
+ noDiscovery?: boolean | undefined;
69
+ mirrorOf?: string | undefined;
70
+ isCustom?: boolean | undefined;
71
+ coingeckoId0?: string | undefined;
72
+ coingeckoId1?: string | undefined;
73
+ }, import("..").DefaultChainMeta, undefined, {
74
+ contractAddress: `0x${string}`;
75
+ symbol0?: string | undefined;
76
+ symbol1?: string | undefined;
77
+ decimals0?: number | undefined;
78
+ decimals1?: number | undefined;
79
+ tokenAddress0?: `0x${string}` | undefined;
80
+ tokenAddress1?: `0x${string}` | undefined;
81
+ coingeckoId0?: string | undefined;
82
+ coingeckoId1?: string | undefined;
32
83
  symbol?: string | undefined;
33
84
  networkId?: string | undefined;
34
85
  isDefault?: boolean | undefined;
@@ -38,8 +89,24 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
38
89
  coingeckoId?: string | undefined;
39
90
  noDiscovery?: boolean | undefined;
40
91
  mirrorOf?: string | undefined;
41
- }, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"substrate-foreignassets", {
42
- onChainId: string;
92
+ }> | import("..").NewBalanceModule<"substrate-assets", {
93
+ id: string;
94
+ networkId: string;
95
+ decimals: number;
96
+ symbol: string;
97
+ type: "substrate-assets";
98
+ platform: "polkadot";
99
+ assetId: string;
100
+ existentialDeposit: string;
101
+ isDefault?: boolean | undefined;
102
+ name?: string | undefined;
103
+ logo?: string | undefined;
104
+ coingeckoId?: string | undefined;
105
+ noDiscovery?: boolean | undefined;
106
+ mirrorOf?: string | undefined;
107
+ isFrozen?: boolean | undefined;
108
+ }, import("./SubstrateAssetsModule").SubAssetsChainMeta, undefined, {
109
+ assetId: string;
43
110
  symbol?: string | undefined;
44
111
  networkId?: string | undefined;
45
112
  isDefault?: boolean | undefined;
@@ -49,8 +116,24 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
49
116
  coingeckoId?: string | undefined;
50
117
  noDiscovery?: boolean | undefined;
51
118
  mirrorOf?: string | undefined;
52
- }, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"substrate-psp22", {
53
- contractAddress: string;
119
+ }, import("./SubstrateAssetsModule").SubAssetsTransferParams> | import("..").NewBalanceModule<"substrate-foreignassets", {
120
+ id: string;
121
+ networkId: string;
122
+ decimals: number;
123
+ symbol: string;
124
+ type: "substrate-foreignassets";
125
+ platform: "polkadot";
126
+ onChainId: string;
127
+ existentialDeposit: string;
128
+ isDefault?: boolean | undefined;
129
+ name?: string | undefined;
130
+ logo?: string | undefined;
131
+ coingeckoId?: string | undefined;
132
+ noDiscovery?: boolean | undefined;
133
+ mirrorOf?: string | undefined;
134
+ isFrozen?: boolean | undefined;
135
+ }, import("..").DefaultChainMeta, undefined, {
136
+ onChainId: string;
54
137
  symbol?: string | undefined;
55
138
  networkId?: string | undefined;
56
139
  isDefault?: boolean | undefined;
@@ -60,24 +143,23 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
60
143
  coingeckoId?: string | undefined;
61
144
  noDiscovery?: boolean | undefined;
62
145
  mirrorOf?: string | undefined;
63
- }, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"substrate-tokens", {
64
- symbol: string;
146
+ }, import("./SubstrateForeignAssetsModule").SubForeignAssetsTransferParams> | import("..").NewBalanceModule<"substrate-native", {
147
+ id: string;
148
+ networkId: string;
65
149
  decimals: number;
150
+ symbol: string;
151
+ type: "substrate-native";
152
+ platform: "polkadot";
66
153
  existentialDeposit: string;
67
- onChainId: string | number;
68
- networkId?: string | undefined;
69
154
  isDefault?: boolean | undefined;
70
155
  name?: string | undefined;
71
156
  logo?: string | undefined;
72
157
  coingeckoId?: string | undefined;
73
158
  noDiscovery?: boolean | undefined;
74
159
  mirrorOf?: string | undefined;
160
+ }, import("./SubstrateNativeModule").SubNativeChainMeta, {
161
+ disable?: boolean | undefined;
75
162
  }, {
76
- palletId?: string | undefined;
77
- }, {
78
- palletId: string;
79
- }> | import("../types/IBalanceModule").IBalanceModule<"evm-erc20", {
80
- contractAddress: `0x${string}`;
81
163
  symbol?: string | undefined;
82
164
  networkId?: string | undefined;
83
165
  isDefault?: boolean | undefined;
@@ -87,8 +169,22 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
87
169
  coingeckoId?: string | undefined;
88
170
  noDiscovery?: boolean | undefined;
89
171
  mirrorOf?: string | undefined;
90
- }, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"evm-uniswapv2", {
91
- contractAddress: `0x${string}`;
172
+ }, import("./SubstrateNativeModule").SubNativeTransferParams> | import("..").NewBalanceModule<"substrate-psp22", {
173
+ id: string;
174
+ networkId: string;
175
+ decimals: number;
176
+ symbol: string;
177
+ type: "substrate-psp22";
178
+ platform: "polkadot";
179
+ contractAddress: string;
180
+ isDefault?: boolean | undefined;
181
+ name?: string | undefined;
182
+ logo?: string | undefined;
183
+ coingeckoId?: string | undefined;
184
+ noDiscovery?: boolean | undefined;
185
+ mirrorOf?: string | undefined;
186
+ }, import("..").DefaultChainMeta, undefined, {
187
+ contractAddress: string;
92
188
  symbol?: string | undefined;
93
189
  networkId?: string | undefined;
94
190
  isDefault?: boolean | undefined;
@@ -98,7 +194,26 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
98
194
  coingeckoId?: string | undefined;
99
195
  noDiscovery?: boolean | undefined;
100
196
  mirrorOf?: string | undefined;
101
- }, unknown, unknown> | import("../types/IBalanceModule").IBalanceModule<"evm-native", {
197
+ }, import("./SubstratePsp22Module").SubPsp22TransferParams> | import("..").NewBalanceModule<"substrate-tokens", {
198
+ id: string;
199
+ networkId: string;
200
+ decimals: number;
201
+ symbol: string;
202
+ type: "substrate-tokens";
203
+ platform: "polkadot";
204
+ onChainId: string | number;
205
+ existentialDeposit: string;
206
+ isDefault?: boolean | undefined;
207
+ name?: string | undefined;
208
+ logo?: string | undefined;
209
+ coingeckoId?: string | undefined;
210
+ noDiscovery?: boolean | undefined;
211
+ mirrorOf?: string | undefined;
212
+ }, import("./SubstrateTokensModule").SubTokensChainMeta, {
213
+ palletId?: string | undefined;
214
+ }, {
215
+ onChainId: string | number;
216
+ existentialDeposit?: string | undefined;
102
217
  symbol?: string | undefined;
103
218
  networkId?: string | undefined;
104
219
  isDefault?: boolean | undefined;
@@ -108,16 +223,14 @@ export declare const BALANCE_MODULES: (import("../types/IBalanceModule").IBalanc
108
223
  coingeckoId?: string | undefined;
109
224
  noDiscovery?: boolean | undefined;
110
225
  mirrorOf?: string | undefined;
111
- }, unknown, unknown>)[];
112
- export type AnyBalanceModule = (typeof BALANCE_MODULES)[number];
113
- export * from "./evm-native";
114
- export * from "./evm-erc20";
115
- export * from "./evm-uniswapv2";
116
- export * from "./substrate-native";
117
- export * from "./substrate-assets";
118
- export * from "./substrate-foreignassets";
119
- export * from "./substrate-hydration";
120
- export * from "./substrate-psp22";
121
- export * from "./substrate-tokens";
226
+ }, import("./SubstrateTokensModule").SubTokensTransferParams>)[];
227
+ export * from "./EvmErc20Module";
228
+ export * from "./EvmNativeModule";
229
+ export * from "./EvmUniswapV2Module";
230
+ export * from "./SubstrateAssetsModule";
231
+ export * from "./SubstrateForeignAssetsModule";
232
+ export * from "./SubstrateNativeModule";
233
+ export * from "./SubstratePsp22Module";
234
+ export * from "./SubstrateTokensModule";
235
+ export * from "./util";
122
236
  export * from "./abis";
123
- export * from "../types/IBalanceModule";
@@ -0,0 +1,30 @@
1
+ import { BalanceModule, NewBalanceModule } from "../../BalanceModule";
2
+ export type AnyBalanceModule = BalanceModule<any, any, any, any, any, any>;
3
+ export type AnyNewBalanceModule = NewBalanceModule<any, any, any, any, any, any>;
4
+ /**
5
+ * The following `Infer*` collection of generic types can be used when you want to
6
+ * extract one of the generic type arguments from an existing BalanceModule.
7
+ *
8
+ * For example, you might want to write a function which can accept any BalanceModule
9
+ * as an input, and then return the specific TokenType for that module:
10
+ * function getTokens<T extends AnyBalanceModule>(module: T): InferTokenType<T>
11
+ *
12
+ * Or for another example, you might want a function which can take any BalanceModule `type`
13
+ * string as input, and then return some data associated with that module with the correct type:
14
+ * function getChainMeta<T extends AnyBalanceModule>(type: InferModuleType<T>): InferChainMeta<T> | undefined
15
+ */
16
+ type InferBalanceModuleTypes<T extends AnyNewBalanceModule> = T extends NewBalanceModule<infer TModuleType, infer TTokenType, infer TChainMeta, infer TModuleConfig, infer TTokenConfig, infer TTransferParams> ? {
17
+ TModuleType: TModuleType;
18
+ TTokenType: TTokenType;
19
+ TChainMeta: TChainMeta;
20
+ TModuleConfig: TModuleConfig;
21
+ TTokenConfig: TTokenConfig;
22
+ TTransferParams: TTransferParams;
23
+ } : never;
24
+ export type InferModuleType<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TModuleType"];
25
+ export type InferTokenType<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TTokenType"];
26
+ export type InferChainMeta<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TChainMeta"];
27
+ export type InferModuleConfig<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TModuleConfig"];
28
+ export type InferTransferParams<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TTransferParams"];
29
+ export type InferTTokenConfig<T extends AnyNewBalanceModule> = InferBalanceModuleTypes<T>["TTokenConfig"];
30
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ChainConnector } from "@talismn/chain-connector";
2
+ import { SubscriptionCallback, UnsubscribeFn } from "../../types";
3
+ /**
4
+ * Pass some these into an `RpcStateQueryHelper` in order to easily batch multiple state queries into the one rpc call.
5
+ */
6
+ export type RpcStateQuery<T> = {
7
+ chainId: string;
8
+ stateKey: string;
9
+ decodeResult: (change: string | null) => T;
10
+ };
11
+ /**
12
+ * Used by a variety of balance modules to help batch multiple state queries into the one rpc call.
13
+ */
14
+ export declare class RpcStateQueryHelper<T> {
15
+ #private;
16
+ constructor(chainConnector: ChainConnector, queries: Array<RpcStateQuery<T>>);
17
+ subscribe(callback: SubscriptionCallback<T[]>, timeout?: number | false, subscribeMethod?: string, responseMethod?: string, unsubscribeMethod?: string): Promise<UnsubscribeFn>;
18
+ fetch(method?: string): Promise<T[]>;
19
+ }
@@ -0,0 +1,8 @@
1
+ import { BalanceModule, DefaultChainMeta, DefaultModuleConfig, DefaultTransferParams, ExtendableChainMeta, ExtendableModuleConfig, ExtendableTransferParams, SelectableTokenType, SubscriptionResultWithStatus } from "../../BalanceModule";
2
+ import { AddressesByToken, Balances, SubscriptionCallback, UnsubscribeFn } from "../../types";
3
+ /**
4
+ * Wraps a BalanceModule's fetch/subscribe methods with a single `balances` method.
5
+ * This `balances` method will subscribe if a callback parameter is provided, or otherwise fetch.
6
+ */
7
+ export declare function balances<TModuleType extends string, TTokenType extends SelectableTokenType, TChainMeta extends ExtendableChainMeta = DefaultChainMeta, TModuleConfig extends ExtendableModuleConfig = DefaultModuleConfig, TTransferParams extends ExtendableTransferParams = DefaultTransferParams>(balanceModule: BalanceModule<TModuleType, TTokenType, TChainMeta, TModuleConfig, TTransferParams>, addressesByToken: AddressesByToken<TTokenType>): Promise<Balances>;
8
+ export declare function balances<TModuleType extends string, TTokenType extends SelectableTokenType, TChainMeta extends ExtendableChainMeta = DefaultChainMeta, TModuleConfig extends ExtendableModuleConfig = DefaultModuleConfig, TTransferParams extends ExtendableTransferParams = DefaultTransferParams>(balanceModule: BalanceModule<TModuleType, TTokenType, TChainMeta, TModuleConfig, TTransferParams>, addressesByToken: AddressesByToken<TTokenType>, callback: SubscriptionCallback<Balances | SubscriptionResultWithStatus>): Promise<UnsubscribeFn>;
@@ -0,0 +1,43 @@
1
+ import { DotNetwork, DotNetworkId, NetworkId } from "@talismn/chaindata-provider";
2
+ import { getDynamicBuilder } from "@talismn/scale";
3
+ import { MiniMetadata } from "../../types";
4
+ import { AnyNewBalanceModule } from "./InferBalanceModuleTypes";
5
+ export type StorageCoders<TCoders extends {
6
+ [key: string]: [string, string];
7
+ }> = Map<string, {
8
+ [Property in keyof TCoders]: ReturnType<ReturnType<typeof getDynamicBuilder>["buildStorage"]> | undefined;
9
+ }>;
10
+ export declare const buildStorageCoders: <TBalanceModule extends AnyNewBalanceModule, TCoders extends {
11
+ [key: string]: [string, string] | ((params: {
12
+ chainId: string;
13
+ }) => [string, string]);
14
+ }>({ chainIds, chains, miniMetadatas, coders, }: {
15
+ chainIds: DotNetworkId[];
16
+ chains: Record<NetworkId, DotNetwork>;
17
+ miniMetadatas: Map<DotNetworkId, MiniMetadata<TBalanceModule>>;
18
+ coders: TCoders;
19
+ }) => Map<string, { [Property in keyof TCoders]: {
20
+ args: [import("scale-ts").Encoder<any[]>, import("scale-ts").Decoder<any[]>] & {
21
+ enc: import("scale-ts").Encoder<any[]>;
22
+ dec: import("scale-ts").Decoder<any[]>;
23
+ } & {
24
+ inner: import("@talismn/scale").Codec<any>[];
25
+ };
26
+ keys: {
27
+ enc: (...args: any[]) => string;
28
+ dec: (value: string) => any[];
29
+ };
30
+ value: import("@talismn/scale").Codec<any>;
31
+ len: number;
32
+ fallback: any;
33
+ } | undefined; }>;
34
+ type NetworkCoders = {
35
+ [key: string]: [string, string];
36
+ };
37
+ type NetworkStorageCoders<TCoders extends NetworkCoders> = {
38
+ [Property in keyof TCoders]: ReturnType<ReturnType<typeof getDynamicBuilder>["buildStorage"]> | undefined;
39
+ };
40
+ export declare const buildNetworkStorageCoders: <TCoders extends {
41
+ [key: string]: [string, string];
42
+ }>(chainId: DotNetworkId, miniMetadata: MiniMetadata, coders: TCoders) => NetworkStorageCoders<TCoders> | null;
43
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Abi } from "@polkadot/api-contract";
2
+ import { TypeRegistry } from "@polkadot/types";
3
+ import { ContractExecResult } from "@polkadot/types/interfaces";
4
+ /**
5
+ * Decodes & unwraps outputs and errors of a given result, contract, and method.
6
+ * Parsed error message can be found in `decodedOutput` if `isError` is true.
7
+ * SOURCE: https://github.com/paritytech/contracts-ui (GPL-3.0-only)
8
+ */
9
+ export declare function decodeOutput({ result }: Pick<ContractExecResult, "result" | "debugMessage">, registry: TypeRegistry, abi: Abi, method: string): {
10
+ output: any;
11
+ decodedOutput: string;
12
+ isError: boolean;
13
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ *
3
+ * Detect Balances::transfer -> Balances::transfer_allow_death migration
4
+ * https://github.com/paritytech/substrate/pull/12951
5
+ *
6
+ * `transfer_allow_death` is the preferred method,
7
+ * so if something goes wrong during detection, we should assume the chain has migrated
8
+ * @param metadataRpc string containing the hashed RPC metadata for the chain
9
+ * @returns
10
+ */
11
+ export declare const detectTransferMethod: (metadataRpc: `0x${string}`) => "transfer_allow_death" | "transfer";
@@ -0,0 +1,3 @@
1
+ import { NetworkId, TokenId } from "@talismn/chaindata-provider";
2
+ import { Address } from "../../types";
3
+ export declare const getAddresssesByTokenByNetwork: (addressesByToken: Record<TokenId, Address[]>) => Record<NetworkId, Record<TokenId, Address[]>>;
@@ -0,0 +1,5 @@
1
+ import { NetworkId, TokenList } from "@talismn/chaindata-provider";
2
+ import { AddressesByToken } from "../../types";
3
+ export declare const getUniqueChainIds: (addressesByToken: AddressesByToken<{
4
+ id: string;
5
+ }>, tokens: TokenList) => NetworkId[];
@@ -0,0 +1,9 @@
1
+ export * from "./balances";
2
+ export * from "./buildStorageCoders";
3
+ export * from "./decodeOutput";
4
+ export * from "./detectTransferMethod";
5
+ export * from "./getUniqueChainIds";
6
+ export * from "./InferBalanceModuleTypes";
7
+ export * from "./makeContractCaller";
8
+ export * from "./RpcStateQueryHelper";
9
+ export * from "./storageCompression";
@@ -1,5 +1,4 @@
1
1
  import { TypeRegistry } from "@polkadot/types";
2
- import { ContractExecResult } from "@polkadot/types/interfaces";
3
2
  import { ChainConnector } from "@talismn/chain-connector";
4
3
  export declare const makeContractCaller: ({ chainConnector, chainId, registry, }: {
5
4
  chainConnector: ChainConnector;
@@ -7,4 +6,4 @@ export declare const makeContractCaller: ({ chainConnector, chainId, registry, }
7
6
  registry: TypeRegistry;
8
7
  }) => <T extends Uint8Array | {
9
8
  toU8a: () => Uint8Array;
10
- }>(callFrom: string, contractAddress: string, inputData: T) => Promise<ContractExecResult>;
9
+ }>(callFrom: string, contractAddress: string, inputData: T) => Promise<import("@polkadot/types/interfaces").ContractExecResult>;
@@ -0,0 +1,9 @@
1
+ import { Table } from "dexie";
2
+ import { BalanceJson } from "../../types";
3
+ export type StoredBalanceJson = Omit<BalanceJson, "status">;
4
+ export declare const configureStore: (dbTable?: Table) => {
5
+ persistData: (balances: StoredBalanceJson[]) => Promise<void>;
6
+ retrieveData: () => Promise<StoredBalanceJson[]>;
7
+ };
8
+ export declare const compress: (balances: StoredBalanceJson[]) => Uint8Array<ArrayBufferLike>;
9
+ export declare const decompress: (data: Uint8Array | ArrayBuffer) => StoredBalanceJson[];