@bitgo-beta/abstract-eth 1.2.3-alpha.43 → 1.2.3-alpha.430

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