0.2.8 • Published 1 month ago

@cosmic-lab/epoch-sdk v0.2.8

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 month ago

Installation

yarn add @cosmic-lab/sdk
# or
npm install @cosmic-lab/sdk

Env

To get started check out .env.example. Most likely you are targeting the production environment and not running the server locally:

# devnet is used for the demo, once Epoch launches the only usable RPC is mainnet
# this URL configurable so that private RPCs can be used with better latency and rate limits
RPC_URL=https://api.devnet.solana.com
# dev or prod
# dev is for local development, which applies to very few individuals
# prod is for the production server (api.epoch.fm), which likely applies to you
ENV=prod

Usage

// automatically constructued from the `.env` file if it isn't initialized already
// EpochClient is a singleton, so it's safe to import it from anywhere without explicit construction (new EpochClient(...))
// and use directly as EpochClient.instance rather than storing in a variable, such as this line below:
const client = EpochClient.instance;

// If using during the demo period when everything is on devnet, you can airdrop yourself Epoch tokens!
await client.airdrop(connectedWallet);

// sign up or log in if already registered
const epochUser: EpochUser | null = await client.connect(walletContext);
0.2.7

1 month ago

0.2.8

1 month ago

0.2.6

1 month ago

0.2.5

1 month ago

0.2.1

1 month ago

0.2.0

1 month ago

0.2.3

1 month ago

0.2.2

1 month ago

0.2.4

1 month ago

0.1.0

1 month ago