Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anataliocs/avail-api-example
Typescript scripts that demonstrate interacting with an Avail node.
https://github.com/anataliocs/avail-api-example
blockchain npm ts-node typescript web3
Last synced: about 1 month ago
JSON representation
Typescript scripts that demonstrate interacting with an Avail node.
- Host: GitHub
- URL: https://github.com/anataliocs/avail-api-example
- Owner: anataliocs
- Created: 2024-01-04T04:02:33.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-04T04:04:56.000Z (12 months ago)
- Last Synced: 2024-04-14T02:02:41.382Z (8 months ago)
- Topics: blockchain, npm, ts-node, typescript, web3
- Language: TypeScript
- Homepage: https://docs.spheron.network/marketplace-guide/avail/
- Size: 56.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Avail API Use Cases
Typescript `ts-node` scripts that demonstrate interacting with an Avail node.
Run an [Avail node on Spheron](https://docs.spheron.network/marketplace-guide/avail/)
### Install
Install:
```
npm i
```Install ts-node if needed
```
npm i -g ts-node
```### Create Local Config
Update: `config.ts`
```typescript
export default {
mnemonic: "", // The secret seed value for account used to sign transactions
ApiURL: "", // Api url
app_id: 0, // Application id
amount: 0, // Amount of tokens to transfer
receiver: "" // Receiver address
}
```Connect to a node:
```
ts-node connect.ts
```Subscribes to new blocks:
```
ts-node listen_new_blocks.ts
```