coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.61k stars 1.32k forks source link

Where is the API of the anchor NPM library? #1398

Closed daweth closed 2 years ago

daweth commented 2 years ago

Ethers.js has comprehensive documentation of every single object in its library.

https://docs.ethers.io/v5/api/

I cannot find something similar for Anchor.

All I'm trying to do is decode BN using Anchor.BN but I cannot find any reference on Anchor.BN. Maybe I need to look at the library code directly to accomplish this simple task.

daweth commented 2 years ago

Taking a look at the dependencies

@project-serum/anchor@0.20.1 │ ├─ @project-serum/borsh@^0.2.2 │ ├─ @solana/web3.js@^1.17.0 │ ├─ base64-js@^1.5.1 │ ├─ bn.js@^5.1.2 │ ├─ bs58@^4.0.1 │ ├─ buffer-layout@^1.2.2 │ ├─ camelcase@^5.3.1 │ ├─ crypto-hash@^1.3.0 │ ├─ eventemitter3@^4.0.7 │ ├─ find@^0.3.0 │ ├─ js-sha256@^0.9.0 │ ├─ pako@^2.0.3 │ ├─ snake-case@^3.0.4 │ └─ toml@^3.0.0

anchor.BN is simply BN.js. So we can find API documentation here:

https://www.npmjs.com/package/bn.js?activeTab=readme

armaniferrante commented 2 years ago

@daweth API docs are here https://project-serum.github.io/anchor/ts/index.html