-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README updates for Partial ETH rewards
- Loading branch information
Showing
2 changed files
with
48 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { StakingClient } from '../../src/client/staking-client'; | ||
|
||
// 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'`; | ||
|
||
// 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); | ||
|
||
// Defines which address and rewards we want to see | ||
const address: string = | ||
'0x60c7e246344ae3856cf9abe3a2e258d495fc39e0'; | ||
const filter: string = `address='${address}' AND period_end_time > '2024-05-01T00:00:00Z' AND period_end_time < '2024-05-02T00:00:00Z'`; | ||
|
||
// Loops through rewards array and prints each reward | ||
client.Ethereum.listRewards(filter).then((resp) => { | ||
var list = async function () { | ||
Check failure on line 15 in examples/ethereum/list-rewards.ts
|
||
const resp = await client.Ethereum.listRewards(filter) | ||
resp.rewards!.forEach((reward) => { | ||
console.log(JSON.stringify(reward, null, 2)); | ||
}); | ||
}); | ||
} | ||
|
||
list(); | ||