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

Cookbock setup fix & add missing examples to README #1447

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ Collection of common use cases for [`near-api-js`](https://github.com/near/near-
| **TRANSACTIONS** | |
| [Get Transaction Status](./transactions/get-tx-status.ts) | Gets transaction status using a tx hash and associated account/contract ID. |
| [Batch Transactions](./transactions/batch-transactions.ts) | Sign and send multiple [transactions](https://docs.near.org/docs/concepts/transaction). |
| [Meta Transaction](./transactions/meta-transaction.ts) | Sign and send [meta transaction](https://docs.near.org/concepts/abstraction/meta-transactions). |
| [Meta Transaction Relayer](./transactions/meta-transaction-relayer.ts) | Send signed [meta transaction via relayer](https://docs.near.org/build/chain-abstraction/meta-transactions). |
| [Traverse Blocks](./transactions/traverse-blocks.ts) | Find transactions between two block hashes. |
| **UTILS** | |
| [Deploy Contract](./utils/deploy-contract.ts) | Deploys a contract using a pre-compiled .wasm file |
| [Calculate Gas](./utils/calculate-gas.ts) | Calculate [gas burnt](https://docs.near.org/docs/concepts/gas) from any contract call. |
| [Read State w/o Account](./utils/get-state.ts) | Read state of a contract without instantiating an account. |
| [Check Account Existence](./utils/check-account-existence.ts) | Check account existence by finding out the state of the account. |
| [Wrap](./utils/wrap-near.ts) & [Unwrap](./utils/unwrap-near.ts) NEAR | Wrap and unwrap NEAR using the `wrap.near` smart contract. |
| [Verify Signature](./utils/verify-signature.ts) | Verify a key pair signature. |

## Requirements

- [NEAR Account](https://docs.near.org/docs/develop/basics/create-account)
- [Node.js](https://nodejs.org/en/download/package-manager/)
- [pnpm](https://pnpm.io/installation)

## Setup
Expand All @@ -42,5 +45,5 @@ cd packages/cookbook
Example:

```bash
node utils/get-state
pnpm getState
```
1 change: 1 addition & 0 deletions packages/cookbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"near-api-js": "workspace:*",
"ts-node": "^10.9.2",
"tsconfig": "workspace:*",
"tsx": "^4.19.2",
"typescript": "5.4.5"
}
}
275 changes: 275 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.