(data.primaryNetwork.rewards)
- listPendingPrimaryNetworkRewards - List pending rewards
- listHistoricalPrimaryNetworkRewards - List historical rewards
Lists pending rewards on the Primary Network for the supplied addresses.
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";
const avaCloudSDK = new AvaCloudSDK({
serverURL: "https://api.example.com",
chainId: "43114",
network: "mainnet",
});
async function run() {
const result = await avaCloudSDK.data.primaryNetwork.rewards.listPendingPrimaryNetworkRewards({
addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
network: "mainnet",
nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs",
sortOrder: "asc",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
The standalone function version of this method:
import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataPrimaryNetworkRewardsListPendingPrimaryNetworkRewards } from "@avalabs/avacloud-sdk/funcs/dataPrimaryNetworkRewardsListPendingPrimaryNetworkRewards.js";
// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
serverURL: "https://api.example.com",
chainId: "43114",
network: "mainnet",
});
async function run() {
const res = await dataPrimaryNetworkRewardsListPendingPrimaryNetworkRewards(avaCloudSDK, {
addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
network: "mainnet",
nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs",
sortOrder: "asc",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListPendingPrimaryNetworkRewardsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
options.serverURL |
string | ➖ | An optional server URL to use. |
Promise<operations.ListPendingPrimaryNetworkRewardsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.TooManyRequests | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.BadGateway | 502 | application/json |
errors.ServiceUnavailable | 503 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Lists historical rewards on the Primary Network for the supplied addresses.
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";
const avaCloudSDK = new AvaCloudSDK({
serverURL: "https://api.example.com",
chainId: "43114",
network: "mainnet",
});
async function run() {
const result = await avaCloudSDK.data.primaryNetwork.rewards.listHistoricalPrimaryNetworkRewards({
addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
network: "mainnet",
nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs",
sortOrder: "asc",
currency: "usd",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
The standalone function version of this method:
import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards } from "@avalabs/avacloud-sdk/funcs/dataPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards.js";
// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
serverURL: "https://api.example.com",
chainId: "43114",
network: "mainnet",
});
async function run() {
const res = await dataPrimaryNetworkRewardsListHistoricalPrimaryNetworkRewards(avaCloudSDK, {
addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
network: "mainnet",
nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs",
sortOrder: "asc",
currency: "usd",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListHistoricalPrimaryNetworkRewardsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
options.serverURL |
string | ➖ | An optional server URL to use. |
Promise<operations.ListHistoricalPrimaryNetworkRewardsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.BadRequest | 400 | application/json |
errors.Unauthorized | 401 | application/json |
errors.Forbidden | 403 | application/json |
errors.NotFound | 404 | application/json |
errors.TooManyRequests | 429 | application/json |
errors.InternalServerError | 500 | application/json |
errors.BadGateway | 502 | application/json |
errors.ServiceUnavailable | 503 | application/json |
errors.SDKError | 4XX, 5XX | */* |