@atomiqlabs/chain-evm 2.0.7 → 2.0.9

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.
@@ -171,11 +171,17 @@ export class EVMSpvVaultContract<ChainId extends string>
171
171
  return tx;
172
172
  }
173
173
 
174
+ /**
175
+ * @inheritDoc
176
+ */
174
177
  async checkWithdrawalTx(tx: SpvWithdrawalTransactionData): Promise<void> {
175
178
  const result = await this.contract.parseBitcoinTx(Buffer.from(tx.btcTx.hex, "hex"));
176
179
  if(result==null) throw new Error("Failed to parse transaction!");
177
180
  }
178
181
 
182
+ /**
183
+ * @inheritDoc
184
+ */
179
185
  createVaultData(
180
186
  owner: string, vaultId: bigint, utxo: string, confirmations: number, tokenData: SpvVaultTokenData[]
181
187
  ): Promise<EVMSpvVaultData> {
@@ -208,12 +214,18 @@ export class EVMSpvVaultContract<ChainId extends string>
208
214
  }
209
215
 
210
216
  //Getters
217
+ /**
218
+ * @inheritDoc
219
+ */
211
220
  async getFronterAddress(owner: string, vaultId: bigint, withdrawal: EVMSpvWithdrawalData): Promise<string | null> {
212
221
  const frontingAddress = await this.contract.getFronterById(owner, vaultId, "0x"+withdrawal.getFrontingId());
213
222
  if(frontingAddress===ZeroAddress) return null;
214
223
  return frontingAddress;
215
224
  }
216
225
 
226
+ /**
227
+ * @inheritDoc
228
+ */
217
229
  async getFronterAddresses(withdrawals: {owner: string, vaultId: bigint, withdrawal: EVMSpvWithdrawalData}[]): Promise<{[btcTxId: string]: string | null}> {
218
230
  const result: {
219
231
  [btcTxId: string]: string | null
@@ -235,6 +247,9 @@ export class EVMSpvVaultContract<ChainId extends string>
235
247
 
236
248
  private vaultParamsCache: PromiseLruCache<string, SpvVaultParametersStructOutput> = new PromiseLruCache<string, SpvVaultParametersStructOutput>(5000);
237
249
 
250
+ /**
251
+ * @inheritDoc
252
+ */
238
253
  async getVaultData(owner: string, vaultId: bigint): Promise<EVMSpvVaultData | null> {
239
254
  const vaultState = await this.contract.getVault(owner, vaultId);
240
255
 
@@ -264,6 +279,9 @@ export class EVMSpvVaultContract<ChainId extends string>
264
279
  return new EVMSpvVaultData(owner, vaultId, vaultState, vaultParams);
265
280
  }
266
281
 
282
+ /**
283
+ * @inheritDoc
284
+ */
267
285
  async getMultipleVaultData(vaults: {owner: string, vaultId: bigint}[]): Promise<{[owner: string]: {[vaultId: string]: EVMSpvVaultData | null}}> {
268
286
  const result: {[owner: string]: {[vaultId: string]: EVMSpvVaultData | null}} = {};
269
287
  let promises: Promise<void>[] = [];
@@ -282,6 +300,9 @@ export class EVMSpvVaultContract<ChainId extends string>
282
300
  return result;
283
301
  }
284
302
 
303
+ /**
304
+ * @inheritDoc
305
+ */
285
306
  async getVaultLatestUtxo(owner: string, vaultId: bigint): Promise<string | null> {
286
307
  const vaultState = await this.contract.getVault(owner, vaultId);
287
308
  const utxo = getVaultUtxoFromState(vaultState);
@@ -289,6 +310,9 @@ export class EVMSpvVaultContract<ChainId extends string>
289
310
  return utxo;
290
311
  }
291
312
 
313
+ /**
314
+ * @inheritDoc
315
+ */
292
316
  async getVaultLatestUtxos(vaults: {owner: string, vaultId: bigint}[]): Promise<{[owner: string]: {[vaultId: string]: string | null}}> {
293
317
  const result: {[owner: string]: {[vaultId: string]: string | null}} = {};
294
318
  let promises: Promise<void>[] = [];
@@ -307,6 +331,9 @@ export class EVMSpvVaultContract<ChainId extends string>
307
331
  return result;
308
332
  }
309
333
 
334
+ /**
335
+ * @inheritDoc
336
+ */
310
337
  async getAllVaults(owner?: string): Promise<EVMSpvVaultData[]> {
311
338
  const openedVaults = new Map<string, SpvVaultParametersStructOutput>();
312
339
  await this.Events.findInContractEventsForward(
@@ -376,6 +403,9 @@ export class EVMSpvVaultContract<ChainId extends string>
376
403
  }
377
404
  }
378
405
 
406
+ /**
407
+ * @inheritDoc
408
+ */
379
409
  async getWithdrawalState(withdrawalTx: EVMSpvWithdrawalData, scStartHeight?: number): Promise<SpvWithdrawalState> {
380
410
  const txHash = Buffer.from(withdrawalTx.getTxId(), "hex").reverse();
381
411
 
@@ -413,6 +443,9 @@ export class EVMSpvVaultContract<ChainId extends string>
413
443
  return result;
414
444
  }
415
445
 
446
+ /**
447
+ * @inheritDoc
448
+ */
416
449
  async getWithdrawalStates(withdrawalTxs: {withdrawal: EVMSpvWithdrawalData, scStartBlockheight?: number}[]): Promise<{[btcTxId: string]: SpvWithdrawalState}> {
417
450
  const result: {[btcTxId: string]: SpvWithdrawalState} = {};
418
451
 
@@ -490,11 +523,17 @@ export class EVMSpvVaultContract<ChainId extends string>
490
523
  return result;
491
524
  }
492
525
 
526
+ /**
527
+ * @inheritDoc
528
+ */
493
529
  getWithdrawalData(btcTx: BtcTx): Promise<EVMSpvWithdrawalData> {
494
530
  return Promise.resolve(new EVMSpvWithdrawalData(btcTx));
495
531
  }
496
532
 
497
533
  //OP_RETURN data encoding/decoding
534
+ /**
535
+ * @inheritDoc
536
+ */
498
537
  fromOpReturnData(data: Buffer): { recipient: string; rawAmounts: bigint[]; executionHash?: string } {
499
538
  return EVMSpvVaultContract.fromOpReturnData(data);
500
539
  }
@@ -524,6 +563,9 @@ export class EVMSpvVaultContract<ChainId extends string>
524
563
  return {executionHash, rawAmounts: [rawAmount0, rawAmount1], recipient: getAddress(recipient)};
525
564
  }
526
565
 
566
+ /**
567
+ * @inheritDoc
568
+ */
527
569
  toOpReturnData(recipient: string, rawAmounts: bigint[], executionHash?: string): Buffer {
528
570
  return EVMSpvVaultContract.toOpReturnData(recipient, rawAmounts, executionHash);
529
571
  }
@@ -553,24 +595,36 @@ export class EVMSpvVaultContract<ChainId extends string>
553
595
  }
554
596
 
555
597
  //Actions
598
+ /**
599
+ * @inheritDoc
600
+ */
556
601
  async claim(signer: EVMSigner, vault: EVMSpvVaultData, txs: {tx: EVMSpvWithdrawalData, storedHeader?: EVMBtcStoredHeader}[], synchronizer?: RelaySynchronizer<any, any, any>, initAta?: boolean, txOptions?: TransactionConfirmationOptions): Promise<string> {
557
602
  const result = await this.txsClaim(signer.getAddress(), vault, txs, synchronizer, initAta, txOptions?.feeRate);
558
603
  const [signature] = await this.Chain.sendAndConfirm(signer, result, txOptions?.waitForConfirmation, txOptions?.abortSignal);
559
604
  return signature;
560
605
  }
561
606
 
607
+ /**
608
+ * @inheritDoc
609
+ */
562
610
  async deposit(signer: EVMSigner, vault: EVMSpvVaultData, rawAmounts: bigint[], txOptions?: TransactionConfirmationOptions): Promise<string> {
563
611
  const result = await this.txsDeposit(signer.getAddress(), vault, rawAmounts, txOptions?.feeRate);
564
612
  const txHashes = await this.Chain.sendAndConfirm(signer, result, txOptions?.waitForConfirmation, txOptions?.abortSignal);
565
613
  return txHashes[txHashes.length - 1];
566
614
  }
567
615
 
616
+ /**
617
+ * @inheritDoc
618
+ */
568
619
  async frontLiquidity(signer: EVMSigner, vault: EVMSpvVaultData, realWithdrawalTx: EVMSpvWithdrawalData, withdrawSequence: number, txOptions?: TransactionConfirmationOptions): Promise<string> {
569
620
  const result = await this.txsFrontLiquidity(signer.getAddress(), vault, realWithdrawalTx, withdrawSequence, txOptions?.feeRate);
570
621
  const txHashes = await this.Chain.sendAndConfirm(signer, result, txOptions?.waitForConfirmation, txOptions?.abortSignal);
571
622
  return txHashes[txHashes.length - 1];
572
623
  }
573
624
 
625
+ /**
626
+ * @inheritDoc
627
+ */
574
628
  async open(signer: EVMSigner, vault: EVMSpvVaultData, txOptions?: TransactionConfirmationOptions): Promise<string> {
575
629
  const result = await this.txsOpen(signer.getAddress(), vault, txOptions?.feeRate);
576
630
  const [signature] = await this.Chain.sendAndConfirm(signer, result, txOptions?.waitForConfirmation, txOptions?.abortSignal);
@@ -578,6 +632,9 @@ export class EVMSpvVaultContract<ChainId extends string>
578
632
  }
579
633
 
580
634
  //Transactions
635
+ /**
636
+ * @inheritDoc
637
+ */
581
638
  async txsClaim(
582
639
  signer: string, vault: EVMSpvVaultData, txs: {
583
640
  tx: EVMSpvWithdrawalData,
@@ -629,6 +686,9 @@ export class EVMSpvVaultContract<ChainId extends string>
629
686
  return evmTxs;
630
687
  }
631
688
 
689
+ /**
690
+ * @inheritDoc
691
+ */
632
692
  async txsDeposit(signer: string, vault: EVMSpvVaultData, rawAmounts: bigint[], feeRate?: string): Promise<EVMTx[]> {
633
693
  if(!vault.isOpened()) throw new Error("Cannot deposit to a closed vault!");
634
694
  feeRate ??= await this.Chain.Fees.getFeeRate();
@@ -668,6 +728,9 @@ export class EVMSpvVaultContract<ChainId extends string>
668
728
  return txs;
669
729
  }
670
730
 
731
+ /**
732
+ * @inheritDoc
733
+ */
671
734
  async txsFrontLiquidity(signer: string, vault: EVMSpvVaultData, realWithdrawalTx: EVMSpvWithdrawalData, withdrawSequence: number, feeRate?: string): Promise<EVMTx[]> {
672
735
  if(!vault.isOpened()) throw new Error("Cannot front on a closed vault!");
673
736
  feeRate ??= await this.Chain.Fees.getFeeRate();
@@ -709,6 +772,9 @@ export class EVMSpvVaultContract<ChainId extends string>
709
772
  return txs;
710
773
  }
711
774
 
775
+ /**
776
+ * @inheritDoc
777
+ */
712
778
  async txsOpen(signer: string, vault: EVMSpvVaultData, feeRate?: string): Promise<EVMTx[]> {
713
779
  if(vault.isOpened()) throw new Error("Cannot open an already opened vault!");
714
780
  feeRate ??= await this.Chain.Fees.getFeeRate();
@@ -759,11 +825,17 @@ export class EVMSpvVaultContract<ChainId extends string>
759
825
  return totalGas;
760
826
  }
761
827
 
828
+ /**
829
+ * @inheritDoc
830
+ */
762
831
  async getClaimFee(signer: string, vault?: EVMSpvVaultData, withdrawalData?: EVMSpvWithdrawalData, feeRate?: string): Promise<bigint> {
763
832
  feeRate ??= await this.Chain.Fees.getFeeRate();
764
833
  return EVMFees.getGasFee(this.getClaimGas(signer, vault, withdrawalData), feeRate);
765
834
  }
766
835
 
836
+ /**
837
+ * @inheritDoc
838
+ */
767
839
  async getFrontFee(signer: string, vault?: EVMSpvVaultData, withdrawalData?: EVMSpvWithdrawalData, feeRate?: string): Promise<bigint> {
768
840
  vault ??= EVMSpvVaultData.randomVault();
769
841
  feeRate ??= await this.Chain.Fees.getFeeRate();
@@ -13,14 +13,23 @@ export class EVMSpvWithdrawalData extends SpvWithdrawalTransactionData {
13
13
  return this.executionHash==null ? ZeroHash : (this.executionHash.startsWith("0x") ? this.executionHash : "0x"+this.executionHash)
14
14
  }
15
15
 
16
+ /**
17
+ * @inheritDoc
18
+ */
16
19
  protected fromOpReturnData(data: Buffer): { recipient: string; rawAmounts: bigint[]; executionHash?: string } {
17
20
  return EVMSpvVaultContract.fromOpReturnData(data);
18
21
  }
19
22
 
23
+ /**
24
+ * @inheritDoc
25
+ */
20
26
  isRecipient(address: string): boolean {
21
27
  return this.getRecipient().toLowerCase()===address.toLowerCase();
22
28
  }
23
29
 
30
+ /**
31
+ * @inheritDoc
32
+ */
24
33
  getFrontingId(): string {
25
34
  const callerFee = this.getCallerFee();
26
35
  const frontingFee = this.getFrontingFee();
@@ -42,6 +51,9 @@ export class EVMSpvWithdrawalData extends SpvWithdrawalTransactionData {
42
51
  return [this.rawAmounts[0] + this.getExecutionFee()[0], this.rawAmounts[1]];
43
52
  }
44
53
 
54
+ /**
55
+ * @inheritDoc
56
+ */
45
57
  serialize(): any {
46
58
  return {
47
59
  type: "EVM",
@@ -109,43 +109,73 @@ export class EVMSwapContract<ChainId extends string = string>
109
109
  this.refundHandlersByAddress[this.timelockRefundHandler.address.toLowerCase()] = this.timelockRefundHandler;
110
110
  }
111
111
 
112
+ /**
113
+ * @inheritDoc
114
+ */
112
115
  async start(): Promise<void> {
113
116
  }
114
117
 
115
118
  ////////////////////////////////////////////
116
119
  //// Signatures
120
+ /**
121
+ * @inheritDoc
122
+ */
117
123
  preFetchForInitSignatureVerification(): Promise<EVMPreFetchVerification> {
118
124
  return this.Init.preFetchForInitSignatureVerification();
119
125
  }
120
126
 
127
+ /**
128
+ * @inheritDoc
129
+ */
121
130
  getInitSignature(signer: EVMSigner, swapData: EVMSwapData, authorizationTimeout: number, preFetchedBlockData?: never, feeRate?: string): Promise<SignatureData> {
122
131
  return this.Init.signSwapInitialization(signer, swapData, authorizationTimeout);
123
132
  }
124
133
 
134
+ /**
135
+ * @inheritDoc
136
+ */
125
137
  isValidInitAuthorization(sender: string, swapData: EVMSwapData, signature: SignatureData, feeRate?: string, preFetchedData?: EVMPreFetchVerification): Promise<Buffer | null> {
126
138
  return this.Init.isSignatureValid(sender, swapData, signature.timeout, signature.prefix, signature.signature, preFetchedData);
127
139
  }
128
140
 
141
+ /**
142
+ * @inheritDoc
143
+ */
129
144
  getInitAuthorizationExpiry(swapData: EVMSwapData, signature: SignatureData, preFetchedData?: EVMPreFetchVerification): Promise<number> {
130
145
  return this.Init.getSignatureExpiry(signature.timeout);
131
146
  }
132
147
 
148
+ /**
149
+ * @inheritDoc
150
+ */
133
151
  isInitAuthorizationExpired(swapData: EVMSwapData, signature: SignatureData): Promise<boolean> {
134
152
  return this.Init.isSignatureExpired(signature.timeout);
135
153
  }
136
154
 
155
+ /**
156
+ * @inheritDoc
157
+ */
137
158
  getRefundSignature(signer: EVMSigner, swapData: EVMSwapData, authorizationTimeout: number): Promise<SignatureData> {
138
159
  return this.Refund.signSwapRefund(signer, swapData, authorizationTimeout);
139
160
  }
140
161
 
162
+ /**
163
+ * @inheritDoc
164
+ */
141
165
  isValidRefundAuthorization(swapData: EVMSwapData, signature: SignatureData): Promise<Buffer | null> {
142
166
  return this.Refund.isSignatureValid(swapData, signature.timeout, signature.prefix, signature.signature);
143
167
  }
144
168
 
169
+ /**
170
+ * @inheritDoc
171
+ */
145
172
  getDataSignature(signer: EVMSigner, data: Buffer): Promise<string> {
146
173
  return this.Chain.Signatures.getDataSignature(signer, data);
147
174
  }
148
175
 
176
+ /**
177
+ * @inheritDoc
178
+ */
149
179
  isValidDataSignature(data: Buffer, signature: string, publicKey: string): Promise<boolean> {
150
180
  return this.Chain.Signatures.isValidDataSignature(data, signature, publicKey);
151
181
  }
@@ -153,10 +183,7 @@ export class EVMSwapContract<ChainId extends string = string>
153
183
  ////////////////////////////////////////////
154
184
  //// Swap data utils
155
185
  /**
156
- * Checks whether the claim is claimable by us, that means not expired, we are claimer & the swap is commited
157
- *
158
- * @param signer
159
- * @param data
186
+ * @inheritDoc
160
187
  */
161
188
  async isClaimable(signer: string, data: EVMSwapData): Promise<boolean> {
162
189
  if(!data.isClaimer(signer)) return false;
@@ -165,9 +192,7 @@ export class EVMSwapContract<ChainId extends string = string>
165
192
  }
166
193
 
167
194
  /**
168
- * Checks whether a swap is commited, i.e. the swap still exists on-chain and was not claimed nor refunded
169
- *
170
- * @param swapData
195
+ * @inheritDoc
171
196
  */
172
197
  async isCommited(swapData: EVMSwapData): Promise<boolean> {
173
198
  const data = await this.contract.getHashState("0x"+swapData.getEscrowHash());
@@ -175,11 +200,7 @@ export class EVMSwapContract<ChainId extends string = string>
175
200
  }
176
201
 
177
202
  /**
178
- * Checks whether the swap is expired, takes into consideration possible on-chain time skew, therefore for claimer
179
- * the swap expires a bit sooner than it should've & for the offerer it expires a bit later
180
- *
181
- * @param signer
182
- * @param data
203
+ * @inheritDoc
183
204
  */
184
205
  isExpired(signer: string, data: EVMSwapData): Promise<boolean> {
185
206
  let currentTimestamp: bigint = BigInt(Math.floor(Date.now()/1000));
@@ -189,11 +210,7 @@ export class EVMSwapContract<ChainId extends string = string>
189
210
  }
190
211
 
191
212
  /**
192
- * Checks if the swap is refundable by us, checks if we are offerer, if the swap is already expired & if the swap
193
- * is still commited
194
- *
195
- * @param signer
196
- * @param data
213
+ * @inheritDoc
197
214
  */
198
215
  async isRequestRefundable(signer: string, data: EVMSwapData): Promise<boolean> {
199
216
  //Swap can only be refunded by the offerer
@@ -202,6 +219,9 @@ export class EVMSwapContract<ChainId extends string = string>
202
219
  return await this.isCommited(data);
203
220
  }
204
221
 
222
+ /**
223
+ * @inheritDoc
224
+ */
205
225
  getHashForTxId(txId: string, confirmations: number) {
206
226
  const chainTxIdHandler = this.claimHandlersBySwapType[ChainSwapType.CHAIN_TXID];
207
227
  if(chainTxIdHandler==null) throw new Error("Claim handler for CHAIN_TXID not found!");
@@ -213,12 +233,7 @@ export class EVMSwapContract<ChainId extends string = string>
213
233
  }
214
234
 
215
235
  /**
216
- * Get the swap payment hash to be used for an on-chain swap, uses poseidon hash of the value
217
- *
218
- * @param outputScript output script required to claim the swap
219
- * @param amount sats sent required to claim the swap
220
- * @param confirmations
221
- * @param nonce swap nonce uniquely identifying the transaction to prevent replay attacks
236
+ * @inheritDoc
222
237
  */
223
238
  getHashForOnchain(outputScript: Buffer, amount: bigint, confirmations: number, nonce?: bigint): Buffer {
224
239
  let result: string;
@@ -246,9 +261,7 @@ export class EVMSwapContract<ChainId extends string = string>
246
261
  }
247
262
 
248
263
  /**
249
- * Get the swap payment hash to be used for a lightning htlc swap, uses poseidon hash of the sha256 hash of the preimage
250
- *
251
- * @param paymentHash payment hash of the HTLC
264
+ * @inheritDoc
252
265
  */
253
266
  getHashForHtlc(paymentHash: Buffer): Buffer {
254
267
  const htlcHandler = this.claimHandlersBySwapType[ChainSwapType.HTLC];
@@ -256,6 +269,9 @@ export class EVMSwapContract<ChainId extends string = string>
256
269
  return Buffer.from(htlcHandler.getCommitment(paymentHash).slice(2), "hex");
257
270
  }
258
271
 
272
+ /**
273
+ * @inheritDoc
274
+ */
259
275
  getExtraData(outputScript: Buffer, amount: bigint, confirmations: number, nonce?: bigint): Buffer {
260
276
  if(nonce==null) nonce = 0n;
261
277
  const txoHash = Buffer.from(sha256(Buffer.concat([
@@ -273,11 +289,7 @@ export class EVMSwapContract<ChainId extends string = string>
273
289
  ////////////////////////////////////////////
274
290
  //// Swap data getters
275
291
  /**
276
- * Gets the status of the specific swap, this also checks if we are offerer/claimer & checks for expiry (to see
277
- * if swap is refundable)
278
- *
279
- * @param signer
280
- * @param data
292
+ * @inheritDoc
281
293
  */
282
294
  async getCommitStatus(signer: string, data: EVMSwapData): Promise<SwapCommitState> {
283
295
  const escrowHash = data.getEscrowHash();
@@ -342,6 +354,9 @@ export class EVMSwapContract<ChainId extends string = string>
342
354
  }
343
355
  }
344
356
 
357
+ /**
358
+ * @inheritDoc
359
+ */
345
360
  async getCommitStatuses(request: { signer: string; swapData: EVMSwapData }[]): Promise<{
346
361
  [p: string]: SwapCommitState
347
362
  }> {
@@ -365,6 +380,9 @@ export class EVMSwapContract<ChainId extends string = string>
365
380
 
366
381
  ////////////////////////////////////////////
367
382
  //// Swap data initializer
383
+ /**
384
+ * @inheritDoc
385
+ */
368
386
  createSwapData(
369
387
  type: ChainSwapType,
370
388
  offerer: string,
@@ -405,12 +423,18 @@ export class EVMSwapContract<ChainId extends string = string>
405
423
 
406
424
  ////////////////////////////////////////////
407
425
  //// Utils
426
+ /**
427
+ * @inheritDoc
428
+ */
408
429
  async getBalance(signer: string, tokenAddress: string, inContract?: boolean): Promise<bigint> {
409
430
  if(inContract) return await this.getIntermediaryBalance(signer, tokenAddress);
410
431
 
411
432
  return await this.Chain.getBalance(signer, tokenAddress);
412
433
  }
413
434
 
435
+ /**
436
+ * @inheritDoc
437
+ */
414
438
  getIntermediaryData(address: string, token: string): Promise<{
415
439
  balance: bigint,
416
440
  reputation: IntermediaryReputationType
@@ -418,6 +442,9 @@ export class EVMSwapContract<ChainId extends string = string>
418
442
  return this.LpVault.getIntermediaryData(address, token);
419
443
  }
420
444
 
445
+ /**
446
+ * @inheritDoc
447
+ */
421
448
  getIntermediaryReputation(address: string, token: string): Promise<IntermediaryReputationType> {
422
449
  return this.LpVault.getIntermediaryReputation(address, token);
423
450
  }
@@ -428,6 +455,9 @@ export class EVMSwapContract<ChainId extends string = string>
428
455
 
429
456
  ////////////////////////////////////////////
430
457
  //// Transaction initializers
458
+ /**
459
+ * @inheritDoc
460
+ */
431
461
  async txsClaimWithSecret(
432
462
  signer: string | EVMSigner,
433
463
  swapData: EVMSwapData,
@@ -440,6 +470,9 @@ export class EVMSwapContract<ChainId extends string = string>
440
470
  return this.Claim.txsClaimWithSecret(typeof(signer)==="string" ? signer : signer.getAddress(), swapData, secret, checkExpiry, feeRate)
441
471
  }
442
472
 
473
+ /**
474
+ * @inheritDoc
475
+ */
443
476
  async txsClaimWithTxData(
444
477
  signer: string | EVMSigner,
445
478
  swapData: EVMSwapData,
@@ -463,28 +496,46 @@ export class EVMSwapContract<ChainId extends string = string>
463
496
  );
464
497
  }
465
498
 
499
+ /**
500
+ * @inheritDoc
501
+ */
466
502
  txsRefund(signer: string, swapData: EVMSwapData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<EVMTx[]> {
467
503
  return this.Refund.txsRefund(signer, swapData, check, feeRate);
468
504
  }
469
505
 
506
+ /**
507
+ * @inheritDoc
508
+ */
470
509
  txsRefundWithAuthorization(signer: string, swapData: EVMSwapData, signature: SignatureData, check?: boolean, initAta?: boolean, feeRate?: string): Promise<EVMTx[]> {
471
510
  return this.Refund.txsRefundWithAuthorization(signer, swapData, signature.timeout, signature.prefix, signature.signature, check, feeRate);
472
511
  }
473
512
 
513
+ /**
514
+ * @inheritDoc
515
+ */
474
516
  txsInit(signer: string, swapData: EVMSwapData, signature: SignatureData, skipChecks?: boolean, feeRate?: string): Promise<EVMTx[]> {
475
517
  return this.Init.txsInit(signer, swapData, signature.timeout, signature.prefix, signature.signature, skipChecks, feeRate);
476
518
  }
477
519
 
520
+ /**
521
+ * @inheritDoc
522
+ */
478
523
  txsWithdraw(signer: string, token: string, amount: bigint, feeRate?: string): Promise<EVMTx[]> {
479
524
  return this.LpVault.txsWithdraw(signer, token, amount, feeRate);
480
525
  }
481
526
 
527
+ /**
528
+ * @inheritDoc
529
+ */
482
530
  txsDeposit(signer: string, token: string, amount: bigint, feeRate?: string): Promise<EVMTx[]> {
483
531
  return this.LpVault.txsDeposit(signer, token, amount, feeRate);
484
532
  }
485
533
 
486
534
  ////////////////////////////////////////////
487
535
  //// Executors
536
+ /**
537
+ * @inheritDoc
538
+ */
488
539
  async claimWithSecret(
489
540
  signer: EVMSigner,
490
541
  swapData: EVMSwapData,
@@ -498,6 +549,9 @@ export class EVMSwapContract<ChainId extends string = string>
498
549
  return signature;
499
550
  }
500
551
 
552
+ /**
553
+ * @inheritDoc
554
+ */
501
555
  async claimWithTxData(
502
556
  signer: EVMSigner,
503
557
  swapData: EVMSwapData,
@@ -520,6 +574,9 @@ export class EVMSwapContract<ChainId extends string = string>
520
574
  return txHashes[txHashes.length - 1];
521
575
  }
522
576
 
577
+ /**
578
+ * @inheritDoc
579
+ */
523
580
  async refund(
524
581
  signer: EVMSigner,
525
582
  swapData: EVMSwapData,
@@ -534,6 +591,9 @@ export class EVMSwapContract<ChainId extends string = string>
534
591
  return signature;
535
592
  }
536
593
 
594
+ /**
595
+ * @inheritDoc
596
+ */
537
597
  async refundWithAuthorization(
538
598
  signer: EVMSigner,
539
599
  swapData: EVMSwapData,
@@ -549,6 +609,9 @@ export class EVMSwapContract<ChainId extends string = string>
549
609
  return txSignature;
550
610
  }
551
611
 
612
+ /**
613
+ * @inheritDoc
614
+ */
552
615
  async init(
553
616
  signer: EVMSigner,
554
617
  swapData: EVMSwapData,
@@ -569,6 +632,9 @@ export class EVMSwapContract<ChainId extends string = string>
569
632
  return txHashes[txHashes.length - 1];
570
633
  }
571
634
 
635
+ /**
636
+ * @inheritDoc
637
+ */
572
638
  async withdraw(
573
639
  signer: EVMSigner,
574
640
  token: string,
@@ -580,6 +646,9 @@ export class EVMSwapContract<ChainId extends string = string>
580
646
  return txId;
581
647
  }
582
648
 
649
+ /**
650
+ * @inheritDoc
651
+ */
583
652
  async deposit(
584
653
  signer: EVMSigner,
585
654
  token: string,
@@ -593,35 +662,50 @@ export class EVMSwapContract<ChainId extends string = string>
593
662
 
594
663
  ////////////////////////////////////////////
595
664
  //// Fees
665
+ /**
666
+ * @inheritDoc
667
+ */
596
668
  getInitPayInFeeRate(offerer?: string, claimer?: string, token?: string, paymentHash?: string): Promise<string> {
597
669
  return this.Chain.Fees.getFeeRate();
598
670
  }
599
671
 
672
+ /**
673
+ * @inheritDoc
674
+ */
600
675
  getInitFeeRate(offerer?: string, claimer?: string, token?: string, paymentHash?: string): Promise<string> {
601
676
  return this.Chain.Fees.getFeeRate();
602
677
  }
603
678
 
679
+ /**
680
+ * @inheritDoc
681
+ */
604
682
  getRefundFeeRate(swapData: EVMSwapData): Promise<string> {
605
683
  return this.Chain.Fees.getFeeRate();
606
684
  }
607
685
 
686
+ /**
687
+ * @inheritDoc
688
+ */
608
689
  getClaimFeeRate(signer: string, swapData: EVMSwapData): Promise<string> {
609
690
  return this.Chain.Fees.getFeeRate();
610
691
  }
611
692
 
693
+ /**
694
+ * @inheritDoc
695
+ */
612
696
  getClaimFee(signer: string, swapData: EVMSwapData, feeRate?: string): Promise<bigint> {
613
697
  return this.Claim.getClaimFee(swapData, feeRate);
614
698
  }
615
699
 
616
700
  /**
617
- * Get the estimated fee of the commit transaction
701
+ * @inheritDoc
618
702
  */
619
703
  getCommitFee(signer: string, swapData: EVMSwapData, feeRate?: string): Promise<bigint> {
620
704
  return this.Init.getInitFee(swapData, feeRate);
621
705
  }
622
706
 
623
707
  /**
624
- * Get the estimated transaction fee of the refund transaction
708
+ * @inheritDoc
625
709
  */
626
710
  getRefundFee(signer: string, swapData: EVMSwapData, feeRate?: string): Promise<bigint> {
627
711
  return this.Refund.getRefundFee(swapData, feeRate);