Coder Social home page Coder Social logo

js-sdk's People

Contributors

azbang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

js-sdk's Issues

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

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.