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

minterController.ts: api.getContractState is not a function #24

Open
zapletnev opened this issue Jan 18, 2024 · 4 comments
Open

minterController.ts: api.getContractState is not a function #24

zapletnev opened this issue Jan 18, 2024 · 4 comments

Comments

@zapletnev
Copy link

zapletnev commented Jan 18, 2024

  1. Clone the repo
  2. npm install
  3. npx blueprint run -> minterController
  4. The file couldn't be compiled with the error:

TypeError: api.getContractState is not a function

The same problem in the ui-utils.ts file.

@phamthanhphuocloc1995
Copy link

phamthanhphuocloc1995 commented Jun 11, 2024

Same problem ! Any solution for this error ?

@veebull
Copy link

veebull commented Jul 11, 2024

Same problem! Any solution for this type error?

@cemeheeb
Copy link

looks like this repo is died

@cemeheeb
Copy link

i guess i found solution

  1. force cast TonClient | TonClient4 to TonClient4
  2. get seqno of latest block
    const seqno = (await api.getLastBlock()).last.seqno;
  3. use TonClient4 instance to obtain contract state
    const contractState = (await api.getAccount(seqno, minterAddress)).account.state;

getting cell from contract state code:
const stateCode = Cell.fromBase64(contractState.code!);

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

4 participants