@bitgo-beta/abstract-eth 1.2.3-alpha.51 → 1.2.3-alpha.511

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 (178) hide show
  1. package/dist/src/abstractEthLikeCoin.d.ts +20 -9
  2. package/dist/src/abstractEthLikeCoin.d.ts.map +1 -1
  3. package/dist/src/abstractEthLikeCoin.js +46 -15
  4. package/dist/src/abstractEthLikeNewCoins.d.ts +888 -0
  5. package/dist/src/abstractEthLikeNewCoins.d.ts.map +1 -0
  6. package/dist/src/abstractEthLikeNewCoins.js +2664 -0
  7. package/dist/src/ethLikeToken.d.ts +38 -6
  8. package/dist/src/ethLikeToken.d.ts.map +1 -1
  9. package/dist/src/ethLikeToken.js +289 -10
  10. package/dist/src/index.d.ts +2 -0
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/index.js +8 -2
  13. package/dist/src/lib/constants.d.ts +4 -0
  14. package/dist/src/lib/constants.d.ts.map +1 -0
  15. package/dist/src/lib/constants.js +11 -0
  16. package/dist/src/lib/contractCall.d.ts +8 -0
  17. package/dist/src/lib/contractCall.d.ts.map +1 -0
  18. package/dist/src/lib/contractCall.js +17 -0
  19. package/dist/src/lib/decryptionDelegationBuilder.d.ts +90 -0
  20. package/dist/src/lib/decryptionDelegationBuilder.d.ts.map +1 -0
  21. package/dist/src/lib/decryptionDelegationBuilder.js +59 -0
  22. package/dist/src/lib/iface.d.ts +143 -0
  23. package/dist/src/lib/iface.d.ts.map +1 -0
  24. package/dist/src/lib/iface.js +8 -0
  25. package/dist/src/lib/index.d.ts +19 -0
  26. package/dist/src/lib/index.d.ts.map +1 -0
  27. package/dist/src/lib/index.js +60 -0
  28. package/dist/src/lib/keyPair.d.ts +26 -0
  29. package/dist/src/lib/keyPair.d.ts.map +1 -0
  30. package/dist/src/lib/keyPair.js +65 -0
  31. package/dist/src/lib/messages/eip191/eip191Message.d.ts +12 -0
  32. package/dist/src/lib/messages/eip191/eip191Message.d.ts.map +1 -0
  33. package/dist/src/lib/messages/eip191/eip191Message.js +25 -0
  34. package/dist/src/lib/messages/eip191/eip191MessageBuilder.d.ts +19 -0
  35. package/dist/src/lib/messages/eip191/eip191MessageBuilder.d.ts.map +1 -0
  36. package/dist/src/lib/messages/eip191/eip191MessageBuilder.js +27 -0
  37. package/dist/src/lib/messages/eip191/index.d.ts +3 -0
  38. package/dist/src/lib/messages/eip191/index.d.ts.map +1 -0
  39. package/dist/src/lib/messages/eip191/index.js +19 -0
  40. package/dist/src/lib/messages/eip712/eip712Message.d.ts +6 -0
  41. package/dist/src/lib/messages/eip712/eip712Message.d.ts.map +1 -0
  42. package/dist/src/lib/messages/eip712/eip712Message.js +27 -0
  43. package/dist/src/lib/messages/eip712/eip712MessageBuilder.d.ts +7 -0
  44. package/dist/src/lib/messages/eip712/eip712MessageBuilder.d.ts.map +1 -0
  45. package/dist/src/lib/messages/eip712/eip712MessageBuilder.js +15 -0
  46. package/dist/src/lib/messages/eip712/index.d.ts +3 -0
  47. package/dist/src/lib/messages/eip712/index.d.ts.map +1 -0
  48. package/dist/src/lib/messages/eip712/index.js +19 -0
  49. package/dist/src/lib/messages/index.d.ts +4 -0
  50. package/dist/src/lib/messages/index.d.ts.map +1 -0
  51. package/dist/src/lib/messages/index.js +20 -0
  52. package/dist/src/lib/messages/messageBuilderFactory.d.ts +7 -0
  53. package/dist/src/lib/messages/messageBuilderFactory.d.ts.map +1 -0
  54. package/dist/src/lib/messages/messageBuilderFactory.js +23 -0
  55. package/dist/src/lib/transaction.d.ts +69 -0
  56. package/dist/src/lib/transaction.d.ts.map +1 -0
  57. package/dist/src/lib/transaction.js +149 -0
  58. package/dist/src/lib/transactionBuilder.d.ts +313 -0
  59. package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
  60. package/dist/src/lib/transactionBuilder.js +926 -0
  61. package/dist/src/lib/transferBuilder.d.ts +76 -0
  62. package/dist/src/lib/transferBuilder.d.ts.map +1 -0
  63. package/dist/src/lib/transferBuilder.js +307 -0
  64. package/dist/src/lib/transferBuilders/baseNFTTransferBuilder.d.ts +54 -0
  65. package/dist/src/lib/transferBuilders/baseNFTTransferBuilder.d.ts.map +1 -0
  66. package/dist/src/lib/transferBuilders/baseNFTTransferBuilder.js +120 -0
  67. package/dist/src/lib/transferBuilders/index.d.ts +5 -0
  68. package/dist/src/lib/transferBuilders/index.d.ts.map +1 -0
  69. package/dist/src/lib/transferBuilders/index.js +21 -0
  70. package/dist/src/lib/transferBuilders/transferBuilderERC1155.d.ts +17 -0
  71. package/dist/src/lib/transferBuilders/transferBuilderERC1155.d.ts.map +1 -0
  72. package/dist/src/lib/transferBuilders/transferBuilderERC1155.js +96 -0
  73. package/dist/src/lib/transferBuilders/transferBuilderERC721.d.ts +21 -0
  74. package/dist/src/lib/transferBuilders/transferBuilderERC721.d.ts.map +1 -0
  75. package/dist/src/lib/transferBuilders/transferBuilderERC721.js +91 -0
  76. package/dist/src/lib/transferBuilders/transferBuilderERC7984.d.ts +35 -0
  77. package/dist/src/lib/transferBuilders/transferBuilderERC7984.d.ts.map +1 -0
  78. package/dist/src/lib/transferBuilders/transferBuilderERC7984.js +113 -0
  79. package/dist/src/lib/types.d.ts +40 -0
  80. package/dist/src/lib/types.d.ts.map +1 -0
  81. package/dist/src/lib/types.js +140 -0
  82. package/dist/src/lib/utils.d.ts +365 -0
  83. package/dist/src/lib/utils.d.ts.map +1 -0
  84. package/dist/src/lib/utils.js +969 -0
  85. package/dist/src/lib/walletUtil.d.ts +46 -0
  86. package/dist/src/lib/walletUtil.d.ts.map +1 -0
  87. package/dist/src/lib/walletUtil.js +53 -0
  88. package/dist/src/lib/zamaUtils.d.ts +107 -0
  89. package/dist/src/lib/zamaUtils.d.ts.map +1 -0
  90. package/dist/src/lib/zamaUtils.js +220 -0
  91. package/dist/src/types.d.ts +9 -0
  92. package/dist/src/types.d.ts.map +1 -0
  93. package/dist/src/types.js +3 -0
  94. package/dist/test/index.d.ts +2 -0
  95. package/dist/test/index.d.ts.map +1 -0
  96. package/dist/test/index.js +18 -0
  97. package/dist/test/unit/coin.d.ts +8 -0
  98. package/dist/test/unit/coin.d.ts.map +1 -0
  99. package/dist/test/unit/coin.js +577 -0
  100. package/dist/test/unit/decryptionDelegationBuilder.d.ts +2 -0
  101. package/dist/test/unit/decryptionDelegationBuilder.d.ts.map +1 -0
  102. package/dist/test/unit/decryptionDelegationBuilder.js +265 -0
  103. package/dist/test/unit/index.d.ts +8 -0
  104. package/dist/test/unit/index.d.ts.map +1 -0
  105. package/dist/test/unit/index.js +24 -0
  106. package/dist/test/unit/messages/abstractEthMessageBuilderTests.d.ts +3 -0
  107. package/dist/test/unit/messages/abstractEthMessageBuilderTests.d.ts.map +1 -0
  108. package/dist/test/unit/messages/abstractEthMessageBuilderTests.js +110 -0
  109. package/dist/test/unit/messages/abstractEthMessageTestTypes.d.ts +43 -0
  110. package/dist/test/unit/messages/abstractEthMessageTestTypes.d.ts.map +1 -0
  111. package/dist/test/unit/messages/abstractEthMessageTestTypes.js +3 -0
  112. package/dist/test/unit/messages/abstractEthMessagesTests.d.ts +3 -0
  113. package/dist/test/unit/messages/abstractEthMessagesTests.d.ts.map +1 -0
  114. package/dist/test/unit/messages/abstractEthMessagesTests.js +129 -0
  115. package/dist/test/unit/messages/eip191/eip191Message.d.ts +2 -0
  116. package/dist/test/unit/messages/eip191/eip191Message.d.ts.map +1 -0
  117. package/dist/test/unit/messages/eip191/eip191Message.js +15 -0
  118. package/dist/test/unit/messages/eip191/eip191MessageBuilder.d.ts +2 -0
  119. package/dist/test/unit/messages/eip191/eip191MessageBuilder.d.ts.map +1 -0
  120. package/dist/test/unit/messages/eip191/eip191MessageBuilder.js +16 -0
  121. package/dist/test/unit/messages/eip191/fixtures.d.ts +109 -0
  122. package/dist/test/unit/messages/eip191/fixtures.d.ts.map +1 -0
  123. package/dist/test/unit/messages/eip191/fixtures.js +63 -0
  124. package/dist/test/unit/messages/eip712/eip712Message.d.ts +2 -0
  125. package/dist/test/unit/messages/eip712/eip712Message.d.ts.map +1 -0
  126. package/dist/test/unit/messages/eip712/eip712Message.js +15 -0
  127. package/dist/test/unit/messages/eip712/eip712MessageBuilder.d.ts +2 -0
  128. package/dist/test/unit/messages/eip712/eip712MessageBuilder.d.ts.map +1 -0
  129. package/dist/test/unit/messages/eip712/eip712MessageBuilder.js +16 -0
  130. package/dist/test/unit/messages/eip712/fixtures.d.ts +76 -0
  131. package/dist/test/unit/messages/eip712/fixtures.d.ts.map +1 -0
  132. package/dist/test/unit/messages/eip712/fixtures.js +120 -0
  133. package/dist/test/unit/messages/index.d.ts +4 -0
  134. package/dist/test/unit/messages/index.d.ts.map +1 -0
  135. package/dist/test/unit/messages/index.js +20 -0
  136. package/dist/test/unit/messages/messageBuilderFactory.d.ts +2 -0
  137. package/dist/test/unit/messages/messageBuilderFactory.d.ts.map +1 -0
  138. package/dist/test/unit/messages/messageBuilderFactory.js +52 -0
  139. package/dist/test/unit/token.d.ts +2 -0
  140. package/dist/test/unit/token.d.ts.map +1 -0
  141. package/dist/test/unit/token.js +37 -0
  142. package/dist/test/unit/transaction.d.ts +3 -0
  143. package/dist/test/unit/transaction.d.ts.map +1 -0
  144. package/dist/test/unit/transaction.js +73 -0
  145. package/dist/test/unit/transactionBuilder/addressInitialization.d.ts +8 -0
  146. package/dist/test/unit/transactionBuilder/addressInitialization.d.ts.map +1 -0
  147. package/dist/test/unit/transactionBuilder/addressInitialization.js +95 -0
  148. package/dist/test/unit/transactionBuilder/decryptionDelegation.d.ts +3 -0
  149. package/dist/test/unit/transactionBuilder/decryptionDelegation.d.ts.map +1 -0
  150. package/dist/test/unit/transactionBuilder/decryptionDelegation.js +161 -0
  151. package/dist/test/unit/transactionBuilder/flushERC7984.d.ts +3 -0
  152. package/dist/test/unit/transactionBuilder/flushERC7984.d.ts.map +1 -0
  153. package/dist/test/unit/transactionBuilder/flushERC7984.js +292 -0
  154. package/dist/test/unit/transactionBuilder/flushNft.d.ts +2 -0
  155. package/dist/test/unit/transactionBuilder/flushNft.d.ts.map +1 -0
  156. package/dist/test/unit/transactionBuilder/flushNft.js +381 -0
  157. package/dist/test/unit/transactionBuilder/index.d.ts +7 -0
  158. package/dist/test/unit/transactionBuilder/index.d.ts.map +1 -0
  159. package/dist/test/unit/transactionBuilder/index.js +23 -0
  160. package/dist/test/unit/transactionBuilder/send.d.ts +3 -0
  161. package/dist/test/unit/transactionBuilder/send.d.ts.map +1 -0
  162. package/dist/test/unit/transactionBuilder/send.js +197 -0
  163. package/dist/test/unit/transactionBuilder/walletInitialization.d.ts +11 -0
  164. package/dist/test/unit/transactionBuilder/walletInitialization.d.ts.map +1 -0
  165. package/dist/test/unit/transactionBuilder/walletInitialization.js +137 -0
  166. package/dist/test/unit/transferBuilder.d.ts +2 -0
  167. package/dist/test/unit/transferBuilder.d.ts.map +1 -0
  168. package/dist/test/unit/transferBuilder.js +76 -0
  169. package/dist/test/unit/utils.d.ts +2 -0
  170. package/dist/test/unit/utils.d.ts.map +1 -0
  171. package/dist/test/unit/utils.js +214 -0
  172. package/dist/test/unit/zamaUtils.d.ts +2 -0
  173. package/dist/test/unit/zamaUtils.d.ts.map +1 -0
  174. package/dist/test/unit/zamaUtils.js +352 -0
  175. package/dist/tsconfig.tsbuildinfo +1 -8640
  176. package/package.json +34 -10
  177. package/.eslintignore +0 -5
  178. package/CHANGELOG.md +0 -198
@@ -0,0 +1,888 @@
1
+ /**
2
+ * @prettier
3
+ */
4
+ import { AddressCoinSpecific, BitGoBase, BuildNftTransferDataOptions, FeeEstimateOptions, FullySignedTransaction, HalfSignedTransaction, IWallet, KeyPair, MPCSweepRecoveryOptions, MPCSweepTxs, MPCTxs, ParsedTransaction, ParseTransactionOptions, PrebuildTransactionResult, PresignTransactionOptions as BasePresignTransactionOptions, Recipient, SignTransactionOptions as BaseSignTransactionOptions, TransactionParams, TransactionPrebuild as BaseTransactionPrebuild, TransactionRecipient, TypedData, UnsignedTransactionTss, VerifyAddressOptions as BaseVerifyAddressOptions, VerifyTransactionOptions, Wallet, TssVerifyAddressOptions, DeriveAddressOptions, DeriveAddressResult } from '@bitgo-beta/sdk-core';
5
+ import { BaseCoin as StaticsBaseCoin, EthereumNetwork as EthLikeNetwork } from '@bitgo-beta/statics';
6
+ import type * as EthLikeCommon from '@ethereumjs/common';
7
+ import type * as EthLikeTxLib from '@ethereumjs/tx';
8
+ import BN from 'bn.js';
9
+ import { AbstractEthLikeCoin } from './abstractEthLikeCoin';
10
+ import { SendCrossChainRecoveryOptions } from './types';
11
+ /**
12
+ * The prebuilt hop transaction returned from the HSM
13
+ */
14
+ interface HopPrebuild {
15
+ tx: string;
16
+ id: string;
17
+ signature: string;
18
+ paymentId: string;
19
+ gasPrice: number;
20
+ gasLimit: number;
21
+ amount: number;
22
+ recipient: string;
23
+ nonce: number;
24
+ userReqSig: string;
25
+ gasPriceMax: number;
26
+ }
27
+ /**
28
+ * The extra parameters to send to platform build route for hop transactions
29
+ */
30
+ interface HopParams {
31
+ hopParams: {
32
+ gasPriceMax: number;
33
+ userReqSig: string;
34
+ paymentId: string;
35
+ gasLimit: number;
36
+ };
37
+ }
38
+ export interface EIP1559 {
39
+ maxPriorityFeePerGas: number;
40
+ maxFeePerGas: number;
41
+ }
42
+ export interface ReplayProtectionOptions {
43
+ chain: string | number;
44
+ hardfork: string;
45
+ }
46
+ export interface TransactionPrebuild extends BaseTransactionPrebuild {
47
+ hopTransaction?: HopPrebuild;
48
+ buildParams: {
49
+ recipients: Recipient[];
50
+ };
51
+ recipients: TransactionRecipient[];
52
+ nextContractSequenceId: number;
53
+ gasPrice: number;
54
+ gasLimit: number;
55
+ isBatch: boolean;
56
+ coin: string;
57
+ token?: string;
58
+ txInfo?: {
59
+ recipients?: TransactionRecipient[];
60
+ nextContractSequenceId?: number;
61
+ eip1559?: EIP1559;
62
+ isBatch?: boolean;
63
+ };
64
+ }
65
+ export interface SignFinalOptions {
66
+ txPrebuild: {
67
+ eip1559?: EIP1559;
68
+ replayProtectionOptions?: ReplayProtectionOptions;
69
+ gasPrice?: string;
70
+ gasLimit?: string;
71
+ recipients?: Recipient[];
72
+ halfSigned?: {
73
+ expireTime: number;
74
+ contractSequenceId: number;
75
+ backupKeyNonce?: number;
76
+ signature: string;
77
+ txHex?: string;
78
+ };
79
+ nextContractSequenceId?: number;
80
+ hopTransaction?: string;
81
+ backupKeyNonce?: number;
82
+ isBatch?: boolean;
83
+ txHex?: string;
84
+ expireTime?: number;
85
+ txInfo?: {
86
+ recipients?: TransactionRecipient[];
87
+ nextContractSequenceId?: number;
88
+ eip1559?: EIP1559;
89
+ isBatch?: boolean;
90
+ };
91
+ };
92
+ signingKeyNonce?: number;
93
+ walletContractAddress?: string;
94
+ prv: string;
95
+ recipients?: Recipient[];
96
+ common?: EthLikeCommon.default;
97
+ }
98
+ export interface SignTransactionOptions extends BaseSignTransactionOptions, SignFinalOptions {
99
+ isLastSignature?: boolean;
100
+ expireTime?: number;
101
+ sequenceId?: number;
102
+ gasLimit?: number;
103
+ gasPrice?: number;
104
+ custodianTransactionId?: string;
105
+ common?: EthLikeCommon.default;
106
+ walletVersion?: number;
107
+ }
108
+ export type SignedTransaction = HalfSignedTransaction | FullySignedTransaction;
109
+ export interface FeesUsed {
110
+ gasPrice: number;
111
+ gasLimit: number;
112
+ }
113
+ interface PrecreateBitGoOptions {
114
+ enterprise?: string;
115
+ newFeeAddress?: string;
116
+ }
117
+ export interface OfflineVaultTxInfo {
118
+ nextContractSequenceId?: string;
119
+ contractSequenceId?: string;
120
+ tx?: string;
121
+ txHex?: string;
122
+ userKey?: string;
123
+ backupKey?: string;
124
+ coin: string;
125
+ gasPrice: number;
126
+ gasLimit: number;
127
+ recipients: Recipient[];
128
+ walletContractAddress: string;
129
+ amount: string;
130
+ backupKeyNonce: number;
131
+ eip1559?: EIP1559;
132
+ replayProtectionOptions?: ReplayProtectionOptions;
133
+ halfSigned?: HalfSignedTransaction;
134
+ feesUsed?: FeesUsed;
135
+ isEvmBasedCrossChainRecovery?: boolean;
136
+ walletVersion?: number;
137
+ }
138
+ interface UnformattedTxInfo {
139
+ recipient: Recipient;
140
+ }
141
+ export type UnsignedSweepTxMPCv2 = {
142
+ txRequests: {
143
+ transactions: [
144
+ {
145
+ unsignedTx: UnsignedTransactionTss;
146
+ nonce: number;
147
+ signatureShares: [];
148
+ }
149
+ ];
150
+ walletCoin: string;
151
+ }[];
152
+ };
153
+ export type UnsignedBuilConsolidation = {
154
+ transactions: MPCSweepTxs[] | UnsignedSweepTxMPCv2[] | RecoveryInfo[] | OfflineVaultTxInfo[];
155
+ lastScanIndex: number;
156
+ };
157
+ export type RecoverOptionsWithBytes = {
158
+ isTss: true;
159
+ /**
160
+ * @deprecated this is no longer used
161
+ */
162
+ openSSLBytes?: Uint8Array;
163
+ };
164
+ export type NonTSSRecoverOptions = {
165
+ isTss?: false | undefined;
166
+ };
167
+ export type TSSRecoverOptions = RecoverOptionsWithBytes | NonTSSRecoverOptions;
168
+ export type RecoverOptions = {
169
+ userKey: string;
170
+ backupKey: string;
171
+ walletPassphrase?: string;
172
+ walletContractAddress: string;
173
+ recoveryDestination: string;
174
+ krsProvider?: string;
175
+ gasPrice?: number;
176
+ gasLimit?: number;
177
+ eip1559?: EIP1559;
178
+ replayProtectionOptions?: ReplayProtectionOptions;
179
+ bitgoFeeAddress?: string;
180
+ bitgoDestinationAddress?: string;
181
+ tokenContractAddress?: string;
182
+ intendedChain?: string;
183
+ common?: EthLikeCommon.default;
184
+ derivationSeed?: string;
185
+ apiKey?: string;
186
+ isUnsignedSweep?: boolean;
187
+ } & TSSRecoverOptions;
188
+ export type GetBatchExecutionInfoRT = {
189
+ values: [string[], string[]];
190
+ totalAmount: string;
191
+ };
192
+ export interface BuildTransactionParams {
193
+ to: string;
194
+ nonce?: number;
195
+ value: number;
196
+ data?: Buffer;
197
+ gasPrice?: number;
198
+ gasLimit?: number;
199
+ eip1559?: EIP1559;
200
+ replayProtectionOptions?: ReplayProtectionOptions;
201
+ }
202
+ export interface RecoveryInfo {
203
+ id: string;
204
+ tx: string;
205
+ backupKey?: string;
206
+ coin?: string;
207
+ }
208
+ export interface RecoverTokenTransaction {
209
+ halfSigned: {
210
+ recipient: Recipient;
211
+ expireTime: number;
212
+ contractSequenceId: number;
213
+ operationHash: string;
214
+ signature: string;
215
+ gasLimit: number;
216
+ gasPrice: number;
217
+ tokenContractAddress: string;
218
+ walletId: string;
219
+ };
220
+ }
221
+ export interface RecoverTokenOptions {
222
+ tokenContractAddress: string;
223
+ wallet: Wallet;
224
+ recipient: string;
225
+ broadcast?: boolean;
226
+ walletPassphrase?: string;
227
+ prv?: string;
228
+ }
229
+ export interface GetSendMethodArgsOptions {
230
+ recipient: Recipient;
231
+ expireTime: number;
232
+ contractSequenceId: number;
233
+ signature: string;
234
+ }
235
+ export interface SendMethodArgs {
236
+ name: string;
237
+ type: string;
238
+ value: any;
239
+ }
240
+ interface HopTransactionBuildOptions {
241
+ wallet: Wallet;
242
+ recipients: Recipient[];
243
+ walletPassphrase: string;
244
+ }
245
+ export interface BuildOptions {
246
+ hop?: boolean;
247
+ wallet?: Wallet;
248
+ recipients?: Recipient[];
249
+ walletPassphrase?: string;
250
+ [index: string]: unknown;
251
+ }
252
+ interface FeeEstimate {
253
+ gasLimitEstimate: number;
254
+ feeEstimate: number;
255
+ }
256
+ interface EthTransactionParams extends TransactionParams {
257
+ gasPrice?: number;
258
+ gasLimit?: number;
259
+ hopParams?: HopParams;
260
+ hop?: boolean;
261
+ prebuildTx?: PrebuildTransactionResult;
262
+ tokenName?: string;
263
+ feeToken?: string;
264
+ }
265
+ export interface VerifyEthTransactionOptions extends VerifyTransactionOptions {
266
+ txPrebuild: TransactionPrebuild;
267
+ txParams: EthTransactionParams;
268
+ }
269
+ interface PresignTransactionOptions extends TransactionPrebuild, BasePresignTransactionOptions {
270
+ wallet: Wallet;
271
+ }
272
+ interface EthAddressCoinSpecifics extends AddressCoinSpecific {
273
+ forwarderVersion: number;
274
+ salt?: string;
275
+ feeAddress?: string;
276
+ }
277
+ export declare const DEFAULT_SCAN_FACTOR = 20;
278
+ export interface EthConsolidationRecoveryOptions {
279
+ coinName?: string;
280
+ walletContractAddress?: string;
281
+ apiKey?: string;
282
+ isTss?: boolean;
283
+ userKey?: string;
284
+ backupKey?: string;
285
+ walletPassphrase?: string;
286
+ recoveryDestination?: string;
287
+ krsProvider?: string;
288
+ gasPrice?: number;
289
+ gasLimit?: number;
290
+ eip1559?: EIP1559;
291
+ replayProtectionOptions?: ReplayProtectionOptions;
292
+ bitgoFeeAddress?: string;
293
+ bitgoDestinationAddress?: string;
294
+ tokenContractAddress?: string;
295
+ intendedChain?: string;
296
+ common?: EthLikeCommon.default;
297
+ derivationSeed?: string;
298
+ bitgoKey?: string;
299
+ startingScanIndex?: number;
300
+ endingScanIndex?: number;
301
+ ignoreAddressTypes?: unknown;
302
+ }
303
+ export interface VerifyEthAddressOptions extends BaseVerifyAddressOptions {
304
+ baseAddress: string;
305
+ coinSpecific: EthAddressCoinSpecifics;
306
+ forwarderVersion?: number;
307
+ walletVersion?: number;
308
+ }
309
+ export type TssVerifyEthAddressOptions = TssVerifyAddressOptions & VerifyEthAddressOptions;
310
+ /**
311
+ * Keychain with ethAddress for BIP32 wallet verification (V1, V2, V4)
312
+ * Used for wallets that derive addresses using Ethereum addresses from keychains
313
+ */
314
+ export interface KeychainWithEthAddress {
315
+ ethAddress: string;
316
+ pub: string;
317
+ }
318
+ /**
319
+ * BIP32 wallet base address verification options
320
+ * Supports V1, V2, and V4 wallets that use ethAddress-based derivation
321
+ */
322
+ export interface VerifyContractBaseAddressOptions extends VerifyEthAddressOptions {
323
+ walletVersion: number;
324
+ keychains: KeychainWithEthAddress[];
325
+ }
326
+ /**
327
+ * Type guard to check if params are for BIP32 base address verification (V1, V2, V4)
328
+ * These wallet versions use ethAddress for address derivation
329
+ */
330
+ export declare function isVerifyContractBaseAddressOptions(params: VerifyEthAddressOptions | TssVerifyEthAddressOptions): params is VerifyContractBaseAddressOptions;
331
+ export declare const optionalDeps: {
332
+ readonly ethAbi: any;
333
+ readonly ethUtil: any;
334
+ readonly EthTx: typeof EthLikeTxLib;
335
+ readonly EthCommon: typeof EthLikeCommon;
336
+ };
337
+ export declare abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
338
+ static hopTransactionSalt: string;
339
+ protected readonly sendMethodName: 'sendMultiSig' | 'sendMultiSigToken';
340
+ readonly staticsCoin?: Readonly<StaticsBaseCoin>;
341
+ protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
342
+ /**
343
+ * Method to return the coin's network object
344
+ * @returns {EthLikeNetwork | undefined}
345
+ */
346
+ getNetwork(): EthLikeNetwork | undefined;
347
+ /**
348
+ * Evaluates whether an address string is valid for this coin
349
+ * @param {string} address
350
+ * @returns {boolean} True if address is the valid ethlike adderss
351
+ */
352
+ isValidAddress(address: string): boolean;
353
+ /**
354
+ * Flag for sending data along with transactions
355
+ * @returns {boolean} True if okay to send tx data (ETH), false otherwise
356
+ */
357
+ transactionDataAllowed(): boolean;
358
+ /** @inheritDoc */
359
+ supportsMessageSigning(): boolean;
360
+ /** @inheritDoc */
361
+ supportsSigningTypedData(): boolean;
362
+ /**
363
+ * Default expire time for a contract call (1 week)
364
+ * @returns {number} Time in seconds
365
+ */
366
+ getDefaultExpireTime(): number;
367
+ /**
368
+ * Method to get the custom chain common object based on params from recovery
369
+ * @param {number} chainId - the chain id of the custom chain
370
+ * @returns {EthLikeCommon.default}
371
+ */
372
+ static getCustomChainCommon(chainId: number): EthLikeCommon.default;
373
+ /**
374
+ * Gets correct Eth Common object based on params from either recovery or tx building
375
+ * @param {EIP1559} eip1559 - configs that specify whether we should construct an eip1559 tx
376
+ * @param {ReplayProtectionOptions} replayProtectionOptions - check if chain id supports replay protection
377
+ * @returns {EthLikeCommon.default}
378
+ */
379
+ private static getEthLikeCommon;
380
+ /**
381
+ * Method to build the tx object
382
+ * @param {BuildTransactionParams} params - params to build transaction
383
+ * @returns {EthLikeTxLib.FeeMarketEIP1559Transaction | EthLikeTxLib.Transaction}
384
+ */
385
+ static buildTransaction(params: BuildTransactionParams): EthLikeTxLib.FeeMarketEIP1559Transaction | EthLikeTxLib.Transaction;
386
+ /**
387
+ * Query explorer for the balance of an address
388
+ * @param {String} address - the ETHLike address
389
+ * @param {String} apiKey - optional API key to use instead of the one from the environment
390
+ * @returns {BigNumber} address balance
391
+ */
392
+ queryAddressBalance(address: string, apiKey?: string): Promise<any>;
393
+ /**
394
+ * @param {Recipient[]} recipients - the recipients of the transaction
395
+ * @param {number} expireTime - the expire time of the transaction
396
+ * @param {number} contractSequenceId - the contract sequence id of the transaction
397
+ * @returns {string}
398
+ */
399
+ getOperationSha3ForExecuteAndConfirm(recipients: Recipient[], expireTime: number, contractSequenceId: number): string;
400
+ /**
401
+ * Get transfer operation for coin
402
+ * @param {Recipient} recipient - recipient info
403
+ * @param {number} expireTime - expiry time
404
+ * @param {number} contractSequenceId - sequence id
405
+ * @returns {Array} operation array
406
+ */
407
+ getOperation(recipient: Recipient, expireTime: number, contractSequenceId: number): (string | Buffer)[][];
408
+ /**
409
+ * Queries the contract (via explorer API) for the next sequence ID
410
+ * @param {String} address - address of the contract
411
+ * @param {String} apiKey - optional API key to use instead of the one from the environment
412
+ * @returns {Promise<Number>} sequence ID
413
+ */
414
+ querySequenceId(address: string, apiKey?: string): Promise<number>;
415
+ /**
416
+ * Recover an unsupported token from a BitGo multisig wallet
417
+ * This builds a half-signed transaction, for which there will be an admin route to co-sign and broadcast. Optionally
418
+ * the user can set params.broadcast = true and the half-signed tx will be sent to BitGo for cosigning and broadcasting
419
+ * @param {RecoverTokenOptions} params
420
+ * @param {Wallet} params.wallet - the wallet to recover the token from
421
+ * @param {string} params.tokenContractAddress - the contract address of the unsupported token
422
+ * @param {string} params.recipient - the destination address recovered tokens should be sent to
423
+ * @param {string} params.walletPassphrase - the wallet passphrase
424
+ * @param {string} params.prv - the xprv
425
+ * @param {boolean} params.broadcast - if true, we will automatically submit the half-signed tx to BitGo for cosigning and broadcasting
426
+ * @returns {Promise<RecoverTokenTransaction>}
427
+ */
428
+ recoverToken(params: RecoverTokenOptions): Promise<RecoverTokenTransaction>;
429
+ /**
430
+ * Ensure either enterprise or newFeeAddress is passed, to know whether to create new key or use enterprise key
431
+ * @param {PrecreateBitGoOptions} params
432
+ * @param {string} params.enterprise {String} the enterprise id to associate with this key
433
+ * @param {string} params.newFeeAddress {Boolean} create a new fee address (enterprise not needed in this case)
434
+ * @returns {void}
435
+ */
436
+ preCreateBitGo(params: PrecreateBitGoOptions): void;
437
+ /**
438
+ * Queries public block explorer to get the next ETHLike coin's nonce that should be used for the given ETH address
439
+ * @param {string} address
440
+ * @param {string} apiKey - optional API key to use instead of the one from the environment
441
+ * @returns {Promise<number>}
442
+ */
443
+ getAddressNonce(address: string, apiKey?: string): Promise<number>;
444
+ /**
445
+ * Helper function for recover()
446
+ * This transforms the unsigned transaction information into a format the BitGo offline vault expects
447
+ * @param {UnformattedTxInfo} txInfo - tx info
448
+ * @param {EthLikeTxLib.Transaction | EthLikeTxLib.FeeMarketEIP1559Transaction} ethTx - the ethereumjs tx object
449
+ * @param {string} userKey - the user's key
450
+ * @param {string} backupKey - the backup key
451
+ * @param {Buffer} gasPrice - gas price for the tx
452
+ * @param {number} gasLimit - gas limit for the tx
453
+ * @param {EIP1559} eip1559 - eip1559 params
454
+ * @param {ReplayProtectionOptions} replayProtectionOptions - replay protection options
455
+ * @param {apiKey} apiKey - optional apiKey to use when retrieving block chain data
456
+ * @returns {Promise<OfflineVaultTxInfo>}
457
+ */
458
+ formatForOfflineVault(txInfo: UnformattedTxInfo, ethTx: EthLikeTxLib.Transaction | EthLikeTxLib.FeeMarketEIP1559Transaction, userKey: string, backupKey: string, gasPrice: Buffer, gasLimit: number, eip1559?: EIP1559, replayProtectionOptions?: ReplayProtectionOptions, apiKey?: string): Promise<OfflineVaultTxInfo>;
459
+ /**
460
+ * Helper function for recover()
461
+ * This transforms the unsigned transaction information into a format the BitGo offline vault expects
462
+ * @param {UnformattedTxInfo} txInfo - tx info
463
+ * @param {EthLikeTxLib.Transaction | EthLikeTxLib.FeeMarketEIP1559Transaction} ethTx - the ethereumjs tx object
464
+ * @param {string} userKey - the user's key
465
+ * @param {string} backupKey - the backup key
466
+ * @param {Buffer} gasPrice - gas price for the tx
467
+ * @param {number} gasLimit - gas limit for the tx
468
+ * @param {number} backupKeyNonce - the nonce of the backup key address
469
+ * @param {EIP1559} eip1559 - eip1559 params
470
+ * @param {ReplayProtectionOptions} replayProtectionOptions - replay protection options
471
+ * @returns {Promise<OfflineVaultTxInfo>}
472
+ */
473
+ formatForOfflineVaultTSS(txInfo: UnformattedTxInfo, ethTx: EthLikeTxLib.Transaction | EthLikeTxLib.FeeMarketEIP1559Transaction, userKey: string, backupKey: string, gasPrice: Buffer, gasLimit: number, backupKeyNonce: number, eip1559?: EIP1559, replayProtectionOptions?: ReplayProtectionOptions): OfflineVaultTxInfo;
474
+ /**
475
+ * Check whether the gas price passed in by user are within our max and min bounds
476
+ * If they are not set, set them to the defaults
477
+ * @param {number} userGasPrice - user defined gas price
478
+ * @returns {number} the gas price to use for this transaction
479
+ */
480
+ setGasPrice(userGasPrice?: number): number;
481
+ /**
482
+ * Check whether gas limit passed in by user are within our max and min bounds
483
+ * If they are not set, set them to the defaults
484
+ * @param {number} userGasLimit user defined gas limit
485
+ * @returns {number} the gas limit to use for this transaction
486
+ */
487
+ setGasLimit(userGasLimit?: number): number;
488
+ /**
489
+ * Helper function for signTransaction for the rare case that SDK is doing the second signature
490
+ * Note: we are expecting this to be called from the offline vault
491
+ * @param {SignFinalOptions.txPrebuild} params.txPrebuild
492
+ * @param {string} params.prv
493
+ * @returns {{txHex: string}}
494
+ */
495
+ signFinalEthLike(params: SignFinalOptions): Promise<FullySignedTransaction>;
496
+ /**
497
+ * Assemble half-sign prebuilt transaction
498
+ * @param {SignTransactionOptions} params
499
+ */
500
+ signTransaction(params: SignTransactionOptions): Promise<SignedTransaction>;
501
+ /**
502
+ * Method to validate recovery params
503
+ * @param {RecoverOptions} params
504
+ * @returns {void}
505
+ */
506
+ validateRecoveryParams(params: RecoverOptions): void;
507
+ /**
508
+ * Helper which Adds signatures to tx object and re-serializes tx
509
+ * @param {EthLikeCommon.default} ethCommon
510
+ * @param {EthLikeTxLib.FeeMarketEIP1559Transaction | EthLikeTxLib.Transaction} tx
511
+ * @param {ECDSAMethodTypes.Signature} signature
512
+ * @returns {EthLikeTxLib.FeeMarketEIP1559Transaction | EthLikeTxLib.Transaction}
513
+ */
514
+ private getSignedTxFromSignature;
515
+ /**
516
+ * Builds a funds recovery transaction without BitGo
517
+ * @param params
518
+ * @param {string} params.userKey - [encrypted] xprv
519
+ * @param {string} params.backupKey - [encrypted] xprv or xpub if the xprv is held by a KRS provider
520
+ * @param {string} params.walletPassphrase - used to decrypt userKey and backupKey
521
+ * @param {string} params.walletContractAddress - the ETH address of the wallet contract
522
+ * @param {string} params.krsProvider - necessary if backup key is held by KRS
523
+ * @param {string} params.recoveryDestination - target address to send recovered funds to
524
+ * @param {string} params.bitgoFeeAddress - wrong chain wallet fee address for evm based cross chain recovery txn
525
+ * @param {string} params.bitgoDestinationAddress - target bitgo address where fee will be sent for evm based cross chain recovery txn
526
+ */
527
+ recover(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo | UnsignedSweepTxMPCv2>;
528
+ generateForwarderAddress(baseAddress: string, feeAddress: string, forwarderFactoryAddress: string, forwarderImplementationAddress: string, index: number): string;
529
+ deriveAddressFromPublicKey(commonKeychain: string, index: number): string;
530
+ getConsolidationAddress(params: EthConsolidationRecoveryOptions, index: number): string[];
531
+ recoverConsolidations(params: EthConsolidationRecoveryOptions): Promise<UnsignedBuilConsolidation>;
532
+ /**
533
+ * Builds a funds recovery transaction without BitGo for non-TSS transaction
534
+ * @param params
535
+ * @param {string} params.userKey [encrypted] xprv or xpub
536
+ * @param {string} params.backupKey [encrypted] xprv or xpub if the xprv is held by a KRS provider
537
+ * @param {string} params.walletPassphrase used to decrypt userKey and backupKey
538
+ * @param {string} params.walletContractAddress the EthLike address of the wallet contract
539
+ * @param {string} params.krsProvider necessary if backup key is held by KRS
540
+ * @param {string} params.recoveryDestination target address to send recovered funds to
541
+ * @param {string} params.bitgoFeeAddress wrong chain wallet fee address for evm based cross chain recovery txn
542
+ * @param {string} params.bitgoDestinationAddress target bitgo address where fee will be sent for evm based cross chain recovery txn
543
+ * @returns {Promise<RecoveryInfo | OfflineVaultTxInfo>}
544
+ */
545
+ protected recoverEthLike(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo>;
546
+ /**
547
+ * Extract recipients from transaction hex
548
+ * @param txHex - The transaction hex string
549
+ * @returns Array of recipients with address and amount
550
+ */
551
+ private extractRecipientsFromTxHex;
552
+ sendCrossChainRecoveryTransaction(params: SendCrossChainRecoveryOptions): Promise<{
553
+ coin: string;
554
+ txHex?: string;
555
+ txid: string;
556
+ }>;
557
+ buildCrossChainRecoveryTransaction(recoveryId: string): Promise<{
558
+ coin: string;
559
+ txHex: string;
560
+ txid: string;
561
+ walletVersion?: number;
562
+ recipients: Array<{
563
+ address: string;
564
+ amount: string;
565
+ }>;
566
+ }>;
567
+ /**
568
+ * Builds a unsigned (for cold, custody wallet) or
569
+ * half-signed (for hot wallet) evm cross chain recovery transaction with
570
+ * same expected arguments as recover method.
571
+ * This helps recover funds from evm based wrong chain.
572
+ * @param {RecoverOptions} params
573
+ * @returns {Promise<RecoveryInfo | OfflineVaultTxInfo>}
574
+ */
575
+ protected recoverEthLikeforEvmBasedRecovery(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo>;
576
+ /**
577
+ * Query explorer for the balance of an address for a token
578
+ * @param {string} tokenContractAddress - address where the token smart contract is hosted
579
+ * @param {string} walletContractAddress - address of the wallet
580
+ * @param {string} apiKey - optional API key to use instead of the one from the environment
581
+ * @returns {BigNumber} token balaance in base units
582
+ */
583
+ queryAddressTokenBalance(tokenContractAddress: string, walletContractAddress: string, apiKey?: string): Promise<any>;
584
+ recoverEthLikeTokenforEvmBasedRecovery(params: RecoverOptions, bitgoFeeAddressNonce: number, gasLimit: any, gasPrice: any, userKey: any, userSigningKey: any, apiKey?: string): Promise<OfflineVaultTxInfo>;
585
+ /**
586
+ * Validate evm based cross chain recovery params
587
+ * @param params {RecoverOptions}
588
+ * @returns {void}
589
+ */
590
+ validateEvmBasedRecoveryParams(params: RecoverOptions): void;
591
+ /**
592
+ * Return types, values, and total amount in wei to send in a batch transaction, using the method signature
593
+ * `distributeBatch(address[], uint256[])`
594
+ * @param {Recipient[]} recipients - transaction recipients
595
+ * @returns {GetBatchExecutionInfoRT} information needed to execute the batch transaction
596
+ */
597
+ getBatchExecutionInfo(recipients: Recipient[]): GetBatchExecutionInfoRT;
598
+ /**
599
+ * Get the data required to make an ETH function call defined by the given types and values
600
+ *
601
+ * @param {string} functionName - The name of the function being called, e.g. transfer
602
+ * @param types The types of the function call in order
603
+ * @param values The values of the function call in order
604
+ * @return {Buffer} The combined data for the function call
605
+ */
606
+ getMethodCallData: (functionName: any, types: any, values: any) => Buffer<ArrayBuffer>;
607
+ /**
608
+ * Build arguments to call the send method on the wallet contract
609
+ * @param txInfo
610
+ */
611
+ getSendMethodArgs(txInfo: GetSendMethodArgsOptions): SendMethodArgs[];
612
+ /**
613
+ * Recovers a tx with TSS key shares
614
+ * same expected arguments as recover method, but with TSS key shares
615
+ */
616
+ protected recoverTSS(params: RecoverOptions): Promise<RecoveryInfo | OfflineVaultTxInfo | UnsignedSweepTxMPCv2>;
617
+ private getGasValues;
618
+ protected buildUnsignedSweepTxnTSS(params: RecoverOptions): Promise<OfflineVaultTxInfo | UnsignedSweepTxMPCv2>;
619
+ protected buildUnsignedSweepTxnMPCv2(params: RecoverOptions): Promise<UnsignedSweepTxMPCv2>;
620
+ createBroadcastableSweepTransaction(params: MPCSweepRecoveryOptions): Promise<MPCTxs>;
621
+ /**
622
+ * Method to validate recovery params
623
+ * @param {RecoverOptions} params
624
+ * @returns {void}
625
+ */
626
+ private validateUnsignedSweepTSSParams;
627
+ /**
628
+ * Helper function for recover()
629
+ * This transforms the unsigned transaction information into a format the BitGo offline vault expects
630
+ * @param {UnformattedTxInfo} txInfo - tx info
631
+ * @param {LegacyTransaction | FeeMarketEIP1559Transaction} ethTx - the ethereumjs tx object
632
+ * @param {string} derivationPath - the derivationPath
633
+ * @param {number} nonce - the nonce of the backup key address
634
+ * @param {Buffer} gasPrice - gas price for the tx
635
+ * @param {number} gasLimit - gas limit for the tx
636
+ * @param {EIP1559} eip1559 - eip1559 params
637
+ * @param replayProtectionOptions
638
+ * @param commonKeyChain
639
+ * @returns {Promise<OfflineVaultTxInfo>}
640
+ */
641
+ private buildTxRequestForOfflineVaultMPCv2;
642
+ private buildTssRecoveryTxn;
643
+ validateBalanceAndGetTxAmount(baseAddress: string, gasPrice: BN, gasLimit: BN, apiKey?: string): Promise<any>;
644
+ /**
645
+ * Make a query to blockchain explorer for information such as balance, token balance, solidity calls
646
+ * @param query {Object} key-value pairs of parameters to append after /api
647
+ * @param apiKey {string} optional API key to use instead of the one from the environment
648
+ * @returns {Object} response from the blockchain explorer
649
+ */
650
+ recoveryBlockchainExplorerQuery(query: Record<string, string>, apiKey?: string): Promise<any>;
651
+ /**
652
+ * Creates the extra parameters needed to build a hop transaction
653
+ * @param buildParams The original build parameters
654
+ * @returns extra parameters object to merge with the original build parameters object and send to the platform
655
+ */
656
+ createHopTransactionParams(buildParams: HopTransactionBuildOptions): Promise<HopParams>;
657
+ /**
658
+ * Validates that the hop prebuild from the HSM is valid and correct
659
+ * @param {IWallet} wallet - The wallet that the prebuild is for
660
+ * @param {HopPrebuild} hopPrebuild - The prebuild to validate
661
+ * @param {Object} originalParams - The original parameters passed to prebuildTransaction
662
+ * @param {Recipient[]} originalParams.recipients - The original recipients array
663
+ * @returns {void}
664
+ * @throws Error if The prebuild is invalid
665
+ */
666
+ validateHopPrebuild(wallet: IWallet, hopPrebuild: HopPrebuild, originalParams?: {
667
+ recipients: Recipient[];
668
+ }): Promise<void>;
669
+ /**
670
+ * Gets the hop digest for the user to sign. This is validated in the HSM to prove that the user requested this tx
671
+ * @param {string[]} paramsArr - The parameters to hash together for the digest
672
+ * @returns {Buffer}
673
+ */
674
+ static getHopDigest(paramsArr: string[]): Buffer;
675
+ /**
676
+ * Modify prebuild before sending it to the server. Add things like hop transaction params
677
+ * @param {BuildOptions} buildParams - The whitelisted parameters for this prebuild
678
+ * @param {boolean} buildParams.hop - True if this should prebuild a hop tx, else false
679
+ * @param {Recipient[]} buildParams.recipients - The recipients array of this transaction
680
+ * @param {Wallet} buildParams.wallet - The wallet sending this tx
681
+ * @param {string} buildParams.walletPassphrase - the passphrase for this wallet
682
+ * @returns {Promise<BuildOptions>}
683
+ */
684
+ getExtraPrebuildParams(buildParams: BuildOptions): Promise<BuildOptions>;
685
+ /**
686
+ * Modify prebuild after receiving it from the server. Add things like nlocktime
687
+ * @param {TransactionPrebuild} params - The prebuild to modify
688
+ * @returns {TransactionPrebuild} The modified prebuild
689
+ */
690
+ postProcessPrebuild(params: TransactionPrebuild): Promise<TransactionPrebuild>;
691
+ /**
692
+ * Coin-specific things done before signing a transaction, i.e. verification
693
+ * @param {PresignTransactionOptions} params
694
+ * @returns {Promise<PresignTransactionOptions>}
695
+ */
696
+ presignTransaction(params: PresignTransactionOptions): Promise<PresignTransactionOptions>;
697
+ /**
698
+ * Fetch fee estimate information from the server
699
+ * @param {Object} params - The params passed into the function
700
+ * @param {boolean} [params.hop] - True if we should estimate fee for a hop transaction
701
+ * @param {string} [params.recipient] - The recipient of the transaction to estimate a send to
702
+ * @param {string} [params.data] - The ETH tx data to estimate a send for
703
+ * @returns {Object} The fee info returned from the server
704
+ */
705
+ feeEstimate(params: FeeEstimateOptions): Promise<FeeEstimate>;
706
+ /**
707
+ * Generate secp256k1 key pair
708
+ *
709
+ * @param {Buffer} seed
710
+ * @returns {KeyPair} object with generated pub and prv
711
+ */
712
+ generateKeyPair(seed: Buffer): KeyPair;
713
+ parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction>;
714
+ /**
715
+ * Get forwarder factory and implementation addresses for deposit address verification.
716
+ * Forwarders are smart contracts that forward funds to the base wallet address.
717
+ *
718
+ * @param {number | undefined} forwarderVersion - The wallet version
719
+ * @returns {object} Factory and implementation addresses for forwarders
720
+ */
721
+ getForwarderFactoryAddressesAndForwarderImplementationAddress(forwarderVersion: number | undefined): {
722
+ forwarderFactoryAddress: string;
723
+ forwarderImplementationAddress: string;
724
+ };
725
+ /**
726
+ * Get wallet base address factory and implementation addresses.
727
+ * This is used for base address verification for V1, V2, V4, and V5 wallets.
728
+ * The base address is the main wallet contract deployed via CREATE2.
729
+ *
730
+ * @param {number} walletVersion - The wallet version (1, 2, 4, or 5)
731
+ * @returns {object} Factory and implementation addresses for the wallet base address
732
+ * @throws {Error} if wallet version addresses are not configured
733
+ */
734
+ getWalletAddressFactoryAddressesAndImplementationAddress(walletVersion: number): {
735
+ walletFactoryAddress: string;
736
+ walletImplementationAddress: string;
737
+ };
738
+ /**
739
+ * Helper method to create a salt buffer from hex string.
740
+ * Converts a hex salt string to a 32-byte buffer.
741
+ *
742
+ * @param {string} salt - The hex salt string
743
+ * @returns {Buffer} 32-byte salt buffer
744
+ */
745
+ private createSaltBuffer;
746
+ /**
747
+ * Verify BIP32 wallet base address (V1, V2, V4).
748
+ * These wallets use a wallet factory to deploy base addresses with CREATE2.
749
+ * The address is derived from the keychains' ethAddresses and a salt.
750
+ *
751
+ * @param {VerifyBip32BaseAddressOptions} params - Verification parameters
752
+ * @returns {object} Expected and actual addresses for comparison
753
+ */
754
+ private verifyCreate2BaseAddress;
755
+ /**
756
+ * Verify forwarder receive address (deposit address).
757
+ * Forwarder addresses are derived using CREATE2 from the base address and salt.
758
+ *
759
+ * @param {VerifyEthAddressOptions} params - Verification parameters
760
+ * @param {number} forwarderVersion - The forwarder version
761
+ * @returns {object} Expected and actual addresses for comparison
762
+ */
763
+ private verifyForwarderAddress;
764
+ /**
765
+ * Make sure an address is a wallet address and throw an error if it's not.
766
+ * @param {Object} params
767
+ * @param {string} params.address - The derived address string on the network
768
+ * @param {Object} params.coinSpecific - Coin-specific details for the address such as a forwarderVersion
769
+ * @param {string} params.baseAddress - The base address of the wallet on the network
770
+ * @throws {InvalidAddressError}
771
+ * @throws {InvalidAddressVerificationObjectPropertyError}
772
+ * @throws {UnexpectedAddressError}
773
+ * @returns {boolean} True iff address is a wallet address
774
+ */
775
+ isWalletAddress(params: VerifyEthAddressOptions | TssVerifyEthAddressOptions): Promise<boolean>;
776
+ /**
777
+ * Locally derive an ETH wallet receive address from a derivation path, using the wallet's
778
+ * commonKeychain only (no private keys, no network access). The inverse of
779
+ * {@link isWalletAddress}: it *produces* the address via the same secp256k1 MPC derivation
780
+ * that isWalletAddress checks against (`deriveMPCWalletAddress` + `KeyPair.getAddress()`),
781
+ * so derive and verify can never diverge.
782
+ *
783
+ * Supports MPC/TSS wallets only (wallet versions 3, 5, 6). Legacy BIP32 forwarder wallets
784
+ * (versions 1, 2, 4) derive per-index forwarder contract addresses and are handled separately.
785
+ * @param params keychains (commonKeychain), derivation index, walletVersion, and optional SMC seed
786
+ * @returns the derived address, the index used, and the HD derivation path
787
+ */
788
+ deriveAddress(params: DeriveAddressOptions): Promise<DeriveAddressResult>;
789
+ /**
790
+ *
791
+ * @param {TransactionPrebuild} txPrebuild
792
+ * @returns {boolean}
793
+ */
794
+ verifyCoin(txPrebuild: TransactionPrebuild): boolean;
795
+ /**
796
+ * Generate transaction explanation for error reporting
797
+ * @param txPrebuild - Transaction prebuild containing txHex and fee info
798
+ * @returns Stringified JSON explanation
799
+ */
800
+ private getTxExplanation;
801
+ /**
802
+ * Verify if a tss transaction is valid
803
+ *
804
+ * @param {VerifyEthTransactionOptions} params
805
+ * @param {TransactionParams} params.txParams - params object passed to send
806
+ * @param {TransactionPrebuild} params.txPrebuild - prebuild object returned by server
807
+ * @param {Wallet} params.wallet - Wallet object to obtain keys to verify against
808
+ * @returns {boolean}
809
+ * @throws {TxIntentMismatchRecipientError} if transaction recipients don't match user intent
810
+ */
811
+ verifyTssTransaction(params: VerifyEthTransactionOptions): Promise<boolean>;
812
+ /**
813
+ * Verify that a transaction prebuild complies with the original intention
814
+ *
815
+ * @param {VerifyEthTransactionOptions} params
816
+ * @param {TransactionParams} params.txParams - params object passed to send
817
+ * @param {TransactionPrebuild} params.txPrebuild - prebuild object returned by server
818
+ * @param {Wallet} params.wallet - Wallet object to obtain keys to verify against
819
+ * @returns {boolean}
820
+ * @throws {TxIntentMismatchError} if transaction validation fails
821
+ * @throws {TxIntentMismatchRecipientError} if transaction recipients don't match user intent
822
+ */
823
+ verifyTransaction(params: VerifyEthTransactionOptions): Promise<boolean>;
824
+ /**
825
+ * Check if address is valid eth address
826
+ * @param address
827
+ * @returns {boolean}
828
+ */
829
+ /**
830
+ * Verifies an ERC-7984 token enablement (decryption delegation) transaction for multisig wallets.
831
+ *
832
+ * Two wallet shapes are supported:
833
+ *
834
+ * Base-address wallet — txPrebuild targets the Zama ACL contract directly:
835
+ * txParams.recipients : one entry per token, all with the wallet base address, amount '0'
836
+ * txPrebuild.recipients[0] : the Zama ACL contract address
837
+ *
838
+ * Forwarder wallet — txPrebuild targets the forwarder which calls the ACL via callFromParent:
839
+ * txParams.recipients : one entry per token, all with the forwarder address, amount '0'
840
+ * txPrebuild.recipients[0] : the forwarder address (matches txParams recipients)
841
+ *
842
+ * In both cases all amounts must be 0 and all txParams recipients must share the same address.
843
+ */
844
+ private verifyMultisigEnableTokenTransaction;
845
+ private isETHAddress;
846
+ /**
847
+ * Transform message to accommodate specific blockchain requirements.
848
+ * @param {string} message - the message to prepare
849
+ * @return {string} the prepared message as a hex encoded string.
850
+ */
851
+ encodeMessage(message: string): string;
852
+ /**
853
+ * Transform the Typed data to accomodate the blockchain requirements (EIP-712)
854
+ * @param {TypedData} typedData - the typed data to prepare
855
+ * @return {Buffer} a buffer of the result
856
+ */
857
+ encodeTypedData(typedData: TypedData): Buffer;
858
+ /**
859
+ * Build the data to transfer an ERC-721 or ERC-1155 token to another address
860
+ * @param params
861
+ */
862
+ buildNftTransferData(params: BuildNftTransferDataOptions): string;
863
+ /**
864
+ * Fetch the gas price from the explorer
865
+ * @param {string} wrongChainCoin - the coin that we're getting gas price for
866
+ * @param {string} apiKey - optional API key to use instead of the one from the environment
867
+ */
868
+ getGasPriceFromExternalAPI(wrongChainCoin: string, apiKey?: string): Promise<BN>;
869
+ /**
870
+ * Fetch the gas limit from the explorer
871
+ * @param intendedChain
872
+ * @param from
873
+ * @param to
874
+ * @param data
875
+ * @param {string} apiKey - optional API key to use instead of the one from the environment
876
+ */
877
+ getGasLimitFromExternalAPI(intendedChain: string, from: string, to: string, data: string, apiKey?: string): Promise<BN>;
878
+ /**
879
+ * Get the balance of bitgoFeeAddress to ensure funds are available to pay fees
880
+ * @param bitgoFeeAddress
881
+ * @param gasPrice
882
+ * @param gasLimit
883
+ * @param apiKey - optional API key to use instead of the one from the environment
884
+ */
885
+ ensureSufficientBalance(bitgoFeeAddress: string, gasPrice: BN, gasLimit: BN, apiKey?: string): Promise<void>;
886
+ }
887
+ export {};
888
+ //# sourceMappingURL=abstractEthLikeNewCoins.d.ts.map