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

Update Rewards Examples API Key Usage #35

Merged
merged 1 commit into from
May 10, 2024
Merged
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
9 changes: 7 additions & 2 deletions examples/cosmos/list-rewards.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { StakingClient } from '../../src/client/staking-client';

// Defines which address and rewards we want to see
// Address can be substituted with any Cosmos validator.
const address: string = 'cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en';

const filter: string = `address='${address}' AND period_end_time > '2024-03-25T00:00:00Z' AND period_end_time < '2024-03-27T00:00:00Z'`;

const client = new StakingClient();
// Set your api key name and private key here. Get your keys from here: https://portal.cdp.coinbase.com/access/api
const apiKeyName: string = 'your-api-key-name';
const apiPrivateKey: string = 'your-api-private-key';

const client = new StakingClient(apiKeyName, apiPrivateKey);

// Loops through rewards array and prints each reward
client.Cosmos.listRewards(filter).then((resp) => {
Expand Down
8 changes: 6 additions & 2 deletions examples/cosmos/list-stakes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { StakingClient } from '../../src/client/staking-client';

// TODO: Replace address as per your requirement.
// Address can be substituted with any Cosmos validator.
const address: string = 'cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en';

const client = new StakingClient();
// Set your api key name and private key here. Get your keys from here: https://portal.cdp.coinbase.com/access/api
const apiKeyName: string = 'your-api-key-name';
const apiPrivateKey: string = 'your-api-private-key';

const client = new StakingClient(apiKeyName, apiPrivateKey);

async function listStakes(): Promise<void> {
if (address === '') {
Expand Down
9 changes: 7 additions & 2 deletions examples/ethereum/list-rewards.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { StakingClient } from '../../src/client/staking-client';

// Defines which address and rewards we want to see
// Address can be substituted with any Ethereum validator.
const address: string =
'0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474';

const filter: string = `address='${address}' AND period_end_time > '2024-02-25T00:00:00Z' AND period_end_time < '2024-02-27T00:00:00Z'`;

const client = new StakingClient();
// Set your api key name and private key here. Get your keys from here: https://portal.cdp.coinbase.com/access/api
const apiKeyName: string = 'your-api-key-name';
const apiPrivateKey: string = 'your-api-private-key';

const client = new StakingClient(apiKeyName, apiPrivateKey);

// Loops through rewards array and prints each reward
client.Ethereum.listRewards(filter).then((resp) => {
Expand Down
8 changes: 6 additions & 2 deletions examples/ethereum/list-stakes.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { StakingClient } from '../../src/client/staking-client';

// TODO: Replace address as per your requirement.
// Address can be substituted with any Ethereum validator.
const address: string =
'0xac53512c39d0081ca4437c285305eb423f474e6153693c12fbba4a3df78bcaa3422b31d800c5bea71c1b017168a60474';

const client = new StakingClient();
// Set your api key name and private key here. Get your keys from here: https://portal.cdp.coinbase.com/access/api
const apiKeyName: string = 'your-api-key-name';
const apiPrivateKey: string = 'your-api-private-key';

const client = new StakingClient(apiKeyName, apiPrivateKey);

async function listStakes(): Promise<void> {
if (address === '') {
Expand Down
8 changes: 6 additions & 2 deletions examples/solana/list-rewards.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { StakingClient } from '../../src/client/staking-client';

// TODO: Replace address as per your requirement.
// Address can be substituted with any Solana validator.
const address: string = 'beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar';

const client = new StakingClient();
// Set your api key name and private key here. Get your keys from here: https://portal.cdp.coinbase.com/access/api
const apiKeyName: string = 'your-api-key-name';
const apiPrivateKey: string = 'your-api-private-key';

const client = new StakingClient(apiKeyName, apiPrivateKey);

async function listRewards(): Promise<void> {
if (address === '') {
Expand Down
Loading