Collection of common use cases for near-api-js
.
ACCOUNTS | |
Create Account | Create NEAR accounts without using NEAR Wallet. |
Access Key Rotation | Create and delete access keys for added security. |
TRANSACTIONS | |
Get Transaction Status | Gets transaction status using a tx hash and associated account/contract ID. |
Batch Transactions | Sign and send multiple transactions. |
Meta Transaction | Sign and send meta transaction. |
Meta Transaction Relayer | Send signed meta transaction via relayer. |
Traverse Blocks | Find transactions between two block hashes. |
UTILS | |
Deploy Contract | Deploys a contract using a pre-compiled .wasm file |
Calculate Gas | Calculate gas burnt from any contract call. |
Read State w/o Account | Read state of a contract without instantiating an account. |
Check Account Existence | Check account existence by finding out the state of the account. |
Wrap & Unwrap NEAR | Wrap and unwrap NEAR using the wrap.near smart contract. |
Verify Signature | Verify a key pair signature. |
- Install dependencies
pnpm install
- Navigate to the cookbook directory
cd packages/cookbook
- Run Commands
Example:
pnpm getState