Import
Signature
Create an Algodv2 client for a named network or custom endpoint. Connects to public AlgoNode endpoints for “mainnet” and “testnet”, or default credentials (port 4001, token of 64 ‘a’s) for “localnet”. For private networks, pass the node’s URL explicitly.

Parameters

string
required
Network name (‘mainnet’, ‘testnet’, ‘localnet’, or CAIP-2 string).
string
Optional custom algod base URL.
string
Optional authentication token or header.

Returns

algosdk.Algodv2
Configured Algodv2 client.

Throws

  • UnknownNetworkError: If network has no default endpoint and url is omitted.

Example

Source: src/index.ts