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

TypeError: Cannot read property 'decimal' of undefined when signing contract #1

Open
Wabinab opened this issue Feb 2, 2024 · 0 comments

Comments

@Wabinab
Copy link

Wabinab commented Feb 2, 2024

Hi.

I tried to make a transaction using here wallet, but this problem in the title keeps popping up.
here-wallet-sign-transaction-failure

I wonder if it has anything to do with the sdk. I don't directly use this sdk, but via near-wallet-selector. After logging in, I perform the call as below:

import { providers } from 'near-api-js';

async call(method: string, args = {}, deposit = "0") {
    if (this.get_account_id() == null) {
      console.error("please sign in.");
      return;
    }
    const gas = '30000000000000';
    const outcome = await this.wallet.signAndSendTransaction({
      signerId: this.account_id,
      receiverId: this.contract_id,
      actions: [{
        type: 'FunctionCall',
        params: {
          methodName: method,
          args,
          gas,
          deposit
        },
      }]
    });

    return providers.getTransactionLastResult(outcome);
  }

and an example function that cause the error looks like this (it's located in a service file in Angular):

this.walletService.call('activate_receipt', {}, utils.format.parseNearAmount("0.1") ?? "0")

(Note: the above function isn't the only one causing the error. Calling other functions also cause the decimal error).

I wonder what was causing the error. In essence, running the same code in MyNearWallet is successful; yet, it doesn't pass with Here Wallet.

The code is run on testnet. Wallet is connected to testnet as well.

Though one notice one thing: despite wallerhere.testnet (the connected account) having positive non-zero balance, it displays the account balance as $0. Does that affect it?

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