Skip to content

Commit

Permalink
fix hardcoded domain
Browse files Browse the repository at this point in the history
  • Loading branch information
pierregee committed Aug 14, 2023
1 parent c2d841b commit c30e607
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mobile-app/app/api/transaction/transfer_domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export async function transferDomainSigner(
? [evmScript, dvmScript]
: [dvmScript, evmScript];

const [srcDomain, dstDomain] =
convertDirection === ConvertDirection.evmToDvm
? [TRANSFER_DOMAIN_TYPE.EVM, TRANSFER_DOMAIN_TYPE.DVM]
: [TRANSFER_DOMAIN_TYPE.DVM, TRANSFER_DOMAIN_TYPE.EVM];

const signed: TransactionSegWit = await builder.account.transferDomain(
{
items: [
Expand All @@ -46,15 +51,15 @@ export async function transferDomainSigner(
token: Number(sourceTokenId),
amount,
},
domain: TRANSFER_DOMAIN_TYPE.EVM,
domain: srcDomain,
},
dst: {
address: dstScript,
amount: {
token: Number(targetTokenId),
amount,
},
domain: TRANSFER_DOMAIN_TYPE.DVM,
domain: dstDomain,
},
},
],
Expand Down

0 comments on commit c30e607

Please sign in to comment.