File tree Expand file tree Collapse file tree 2 files changed +11
-21
lines changed
examples/developer-hub-javascript/fxrp-gasless Expand file tree Collapse file tree 2 files changed +11
-21
lines changed Original file line number Diff line number Diff line change 77 */
88
99// 1. Import the necessary libraries
10- import { ethers , Contract , Wallet , Provider } from "ethers" ;
10+ import { ethers , Contract , type Wallet , type Provider } from "ethers" ;
1111import { erc20Abi , type TypedDataDomain , type TypedData } from "viem" ;
1212import { GaslessPaymentForwarder__factory } from "../typechain-types/factories/contracts/GaslessPaymentForwarder__factory" ;
1313
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {
2121 type TypedDataDomain ,
2222 type TypedData ,
2323} from "viem" ;
24- import express , { Request , Response } from "express" ;
24+ import express , { type Request , type Response } from "express" ;
2525import cors from "cors" ;
2626import "dotenv/config" ;
2727import type { GaslessPaymentForwarder } from "../typechain-types/contracts/GaslessPaymentForwarder" ;
@@ -215,27 +215,17 @@ export class GaslessRelayer {
215215 }
216216
217217 // Execute the payment
218- let tx : ethers . ContractTransactionResponse ;
219- try {
220- tx = await this . forwarder . executePayment (
221- from ,
222- to ,
223- amount ,
224- deadline ,
225- signature ,
226- { gasLimit } ,
227- ) ;
228- } catch ( sendError ) {
229- throw sendError ;
230- }
218+ const tx = await this . forwarder . executePayment (
219+ from ,
220+ to ,
221+ amount ,
222+ deadline ,
223+ signature ,
224+ { gasLimit } ,
225+ ) ;
231226
232227 // Wait for confirmation
233- let receipt : ethers . TransactionReceipt | null ;
234- try {
235- receipt = await tx . wait ( ) ;
236- } catch ( waitError ) {
237- throw waitError ;
238- }
228+ const receipt = await tx . wait ( ) ;
239229
240230 return {
241231 success : true ,
You can’t perform that action at this time.
0 commit comments