Skip to content

Commit e4016d2

Browse files
fix: ada transfer (#3991)
1 parent d2cd03a commit e4016d2

File tree

1 file changed

+22
-17
lines changed
  • packages/engine/src/vaults/impl/ada

1 file changed

+22
-17
lines changed

packages/engine/src/vaults/impl/ada/Vault.ts

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -432,23 +432,28 @@ export default class Vault extends VaultBase {
432432
sdk.ensureSDKReady(),
433433
]);
434434

435-
const amountBN = new BigNumber(amount).shiftedBy(decimals);
436-
const output = tokenAddress
437-
? {
438-
address: to,
439-
amount: undefined,
440-
assets: [
441-
{
442-
quantity: amountBN.toFixed(),
443-
unit: tokenAddress,
444-
},
445-
],
446-
}
447-
: {
448-
address: to,
449-
amount: amountBN.toFixed(),
450-
assets: [],
451-
};
435+
const amountBN = new BigNumber(amount);
436+
437+
let output;
438+
if (tokenAddress) {
439+
output = {
440+
address: to,
441+
amount: undefined,
442+
assets: [
443+
{
444+
quantity: amountBN.shiftedBy(token.decimals).toFixed(),
445+
unit: tokenAddress,
446+
},
447+
],
448+
};
449+
} else {
450+
output = {
451+
address: to,
452+
amount: amountBN.shiftedBy(decimals).toFixed(),
453+
assets: [],
454+
};
455+
}
456+
452457
const CardanoApi = await sdk.getCardanoApi();
453458
let txPlan: Awaited<ReturnType<typeof CardanoApi.composeTxPlan>>;
454459
try {

0 commit comments

Comments
 (0)