@mintbase-js/rpc
TypeScript icon, indicating that this package has built-in type declarations

0.6.6 • Public • Published

[//]: # { "title": "@mintbase-js/rpc", "order": "5" }

Installing

npm install @mintbase-js/rpc

Interacting with the NEAR RPC

This module provides a wrapper around common RPC calls used to fetch on-chain data to supplement, or in some cases substitute data provided by the indexer (data module).

Available Modules & Methods

We now accepts rpcUrl on each method, so you can pass your own RPC regarding one of those on the list: https://docs.near.org/api/rpc/providers

getBalance({account: string, rpcUrl: string}): BN

Fetches the balance of a NEAR account (in yocto) by address.

getBlockHeight({rpcUrl: string}): number

Returns the current block height for the configured network.

getTxnStatus({txnHash: string, senderId: string,rpcUrl: string}): TxnStatus

For a transaction hash, determine the status of a transaction on the configured network: pending, success, or failure

payouts({ contractId, tokenId, rpcUrl }): Promise<UiPayout>

Calls a token contract in order to determine the percentage amounts paid out to royalty accounts.

getAccessKeys({accountId: string,rpcUrl: string}): Promise<AccessKey>

Gets all access keys (public key and permissions object) for a given account.

Future

We will be adding more contract view methods here as needs arise.

Readme

Keywords

none

Package Sidebar

Install

npm i @mintbase-js/rpc

Weekly Downloads

207

Version

0.6.6

License

MIT

Unpacked Size

51.9 kB

Total Files

67

Last publish

Collaborators

  • benipsen
  • mintbase-npm