@bitgo-beta/abstract-eth 1.0.2-beta.231 → 1.0.2-beta.2311

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