@bitgo-beta/abstract-eth 1.0.2-beta.233 → 1.0.2-beta.2330

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