Skip to content

how to decode action from transaction? #68

Description

@dev-dantealighieri

hi, I'm trying to decode Action from SignedTransaction object, I can decode memo and quantity, but unable to decode from and to into string objects.

here's what I do.

const transaction = Transaction.from(signedTransaction);
const action = Action.from(transaction.actions[0]);

const abi = await contractKit.load('eosin.token');
const decodedAction = action.decodeData(abi.abi) as any;

// from is Uint64, but I need address of account, e.g `garlicbutter`
const from = decodedAction?.from?.value; // ❌
const to = decodedAction?.to?.value.toString(); // ❌
const amount = decodedAction?.quantity?.value; // ✅
const memo = decodedAction?.memo;  // ✅

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions