@bitgo-beta/abstract-eth 1.0.2-beta.219 → 1.0.2-beta.2190

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