File tree Expand file tree Collapse file tree 1 file changed +22
-17
lines changed
packages/engine/src/vaults/impl/ada Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments