Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 134
[QA-1403] Fix "Not enough signers" simulation error in "Claim All Rewards" flow#9012
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
2c080bfadde71184e02ff26dbed57f24543e0bf62e0e03725ea824b7c6da9f25760ffbFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@audius/sdk': patch | ||
| '@audius/spl': patch | ||
| --- | ||
| Fix instanceof check for version mismatches of @solana/web3.js and skip preflight on evaluateAttestations |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import chalk from "chalk"; | ||
| import { program } from "commander"; | ||
| import { initializeAudiusLibs, initializeAudiusSdk } from "./utils.mjs"; | ||
| import { Utils } from '@audius/sdk' | ||
| program.command("claim-reward") | ||
| .description("Claim a challenge reward") | ||
| .argument("<challengeId>", "The ID of the challenge to claim") | ||
| .argument("<specifier>", "The specifier of the challenge to claim") | ||
| .argument("<amount>", "The amount to claim", parseFloat) | ||
| .option("-f, --from [from]", "The account to claim from") | ||
| .action(async (challengeId, specifier, amount, { from }) => { | ||
| const audiusLibs = await initializeAudiusLibs(from) | ||
| // extract privkey and pubkey from hedgehog | ||
| // only works with accounts created via audius-cmd | ||
| const wallet = audiusLibs?.hedgehog?.getWallet() | ||
| const privKey = wallet?.getPrivateKeyString() | ||
| const pubKey = wallet?.getAddressString() | ||
| // Get hashID user id of current user | ||
| const userIdNumber = audiusLibs.userStateManager.getCurrentUserId() | ||
| const userId = Utils.encodeHashId(userIdNumber) | ||
| // init sdk with priv and pub keys as api keys and secret | ||
| // this enables writes via sdk | ||
| const audiusSdk = await initializeAudiusSdk({ apiKey: pubKey, apiSecret: privKey }) | ||
| try { | ||
| const res = await audiusSdk.challenges.claimReward({ userId, challengeId, specifier, amount }); | ||
| console.log(chalk.green("Successfully claimed reward")); | ||
| console.log(chalk.yellow("Transaction Signature:"), res); | ||
| } catch (err) { | ||
| if ('response' in err) { | ||
| console.log(chalk.red('Request ID:'), err.response.headers.get('X-Request-ID')) | ||
| console.log(chalk.red('Request URL:'), err.response.url) | ||
| console.log(chalk.red('Response Body:'), await err.response.text()) | ||
| } | ||
| program.error(err.message); | ||
| } | ||
| process.exit(0); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.