Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return more information about the results of contract calls #1052

Open
beilunyang opened this issue Jan 3, 2023 · 0 comments
Open

return more information about the results of contract calls #1052

beilunyang opened this issue Jan 3, 2023 · 0 comments

Comments

@beilunyang
Copy link

Is your feature request related to a problem? Please describe.
I'm developing a cli tool using near-api-js that executes ft_transfer. I want to get the transaction hash of ft_transfer. But now near-api-js only returns result.status.SuccessValue.
Related code:

return getTransactionLastResult(rawResult);

Describe the solution you'd like
I would like to be able to provide a parameter that allows the user to control whether or not to return information about the results of all contract calls

 private async _changeMethod({ args, methodName, gas, amount, meta, callbackUrl, raw }: ChangeMethodOptions) {
        validateBNLike({ gas, amount });

        const rawResult = await this.account.functionCall({
            contractId: this.contractId,
            methodName,
            args,
            gas,
            attachedDeposit: amount,
            walletMeta: meta,
            walletCallbackUrl: callbackUrl
        });

       // control by raw parameters
       if (raw) {
           return rawResult
      }
      return getTransactionLastResult(rawResult);
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant