Skip to content

Commit

Permalink
feat: trycatch
Browse files Browse the repository at this point in the history
  • Loading branch information
borcherd committed Mar 1, 2024
1 parent cfd76fd commit aa2c543
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1459,21 +1459,25 @@ async function prepareClaimLinkSenderTx({
chainId: string
contractVersion?: string
}) {
if (!provider) {
provider = await getDefaultProvider(chainId)
}
try {
if (!provider) {
provider = await getDefaultProvider(chainId)
}

if (contractVersion == null) {
contractVersion = getLatestContractVersion({ chainId, type: 'normal' })
}
if (contractVersion == null) {
contractVersion = getLatestContractVersion({ chainId, type: 'normal' })
}

const contract = await getContract(chainId, provider, contractVersion)
const contract = await getContract(chainId, provider, contractVersion)

const tx = await contract.populateTransaction.withdrawDepositSender(depositIndex)
const tx = await contract.populateTransaction.withdrawDepositSender(depositIndex)

const x = ethersV5ToPeanutTx(tx)
const convertedTx = ethersV5ToPeanutTx(tx)

return x
return convertedTx
} catch (error) {
throw new interfaces.SDKStatus(interfaces.EClaimLinkStatusCodes.ERROR, error)
}
}

/**
Expand Down

0 comments on commit aa2c543

Please sign in to comment.