@bitgo-beta/abstract-eth 1.2.3-alpha.49 → 1.2.3-alpha.491

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