From 31a99ca9164929af8ecdd4ace4f134685b6c9f98 Mon Sep 17 00:00:00 2001 From: agrippa Date: Sun, 6 Aug 2023 17:16:00 -0400 Subject: [PATCH] remove switchboard plugin UI (#1753) --- README.md | 58 - SwitchboardVotePlugin/SwitchboardIdl.ts | 9694 ----------------- .../SwitchboardQueueVoterClient.ts | 86 - SwitchboardVotePlugin/gameofnodes.json | 218 - .../store/switchboardStore.ts | 59 - SwitchboardVotePlugin/switchboard_v2.json | 5316 --------- actions/switchboardRefreshVoterWeight.ts | 21 - .../ProposalVotingPower/getNumTokens.ts | 2 - components/ProposalVotingPower/index.tsx | 11 +- .../SwitchboardPermissionCard.tsx | 86 - .../TokenBalance/TokenBalanceCardWrapper.tsx | 21 +- constants/plugins.ts | 7 +- hooks/useGovernanceAssets.ts | 8 - hooks/useRealm.tsx | 12 - hooks/useVotingPlugins.ts | 201 +- .../AddressValidator/index.tsx | 2 - models/voteWeights.ts | 79 - package.json | 3 - .../instructions/Switchboard/AdmitOracle.tsx | 160 - .../instructions/Switchboard/RevokeOracle.tsx | 152 - pages/dao/[symbol]/proposal/new.tsx | 4 - stores/useVotePluginsClientStore.tsx | 22 - utils/uiTypes/VotePlugin.ts | 33 +- utils/uiTypes/proposalCreationTypes.ts | 12 - yarn.lock | 39 +- 25 files changed, 10 insertions(+), 16296 deletions(-) delete mode 100644 SwitchboardVotePlugin/SwitchboardIdl.ts delete mode 100644 SwitchboardVotePlugin/SwitchboardQueueVoterClient.ts delete mode 100644 SwitchboardVotePlugin/gameofnodes.json delete mode 100644 SwitchboardVotePlugin/store/switchboardStore.ts delete mode 100644 SwitchboardVotePlugin/switchboard_v2.json delete mode 100644 actions/switchboardRefreshVoterWeight.ts delete mode 100644 components/TokenBalance/SwitchboardPermissionCard.tsx delete mode 100644 pages/dao/[symbol]/proposal/components/instructions/Switchboard/AdmitOracle.tsx delete mode 100644 pages/dao/[symbol]/proposal/components/instructions/Switchboard/RevokeOracle.tsx diff --git a/README.md b/README.md index c241f8a34f..e69de29bb2 100644 --- a/README.md +++ b/README.md @@ -1,58 +0,0 @@ -# Switchboard Add-in Support - -## To set this up for development with Switchboard, the first step is to get [this](https://github.com/switchboard-xyz/switchboard-core/blob/main/switchboard_v2/tests/addin-tests.ts) to work. - -- [Install Anchor](https://www.anchor-lang.com/docs/installation) if you don't currently have it installed. -- navigate to the `switchboard_v2` directory within `switchboard-core` and run `anchor test`. This will build switchboardv2 and run the addin-tests.ts script, which will set up a realm, governance, queue, oracles, permissions, and proposal. -- you will need to make sure the pubkeys of the governance program and switchboard program throughout the codebase are pointed to your local pubkeys of those programs: -- you can determine the pubkeys of the localnet switchboardv2 and governance programs by navigating to `switchboard-core/switchboard_v2/target/deploy` and running `solana-keygen pubkey switchboard_v2-keypair.json` and `solana-keygen pubkey spl_governance-keypair.json` respectively -- You'll need to set the `declare_id!(...)` in Switchboardv2's `lib.rs` to point at your localnet switchboard program's pubkey, and you'll need to set Switchboardv2's `lib.rs` `GOVERNANCE_PID` variable to the spl_governance pubkey. -- you'll also need to ensure that `sbv2.ts` variable GOVERNANCE_PID points at the correct pubkey for your localnet governance program -- when you want to run the UI, start a local validator by running `solana-test-validator`. This will created a directory called `test-ledger` in the location you run the command. -- run the addin test suite, `anchor test` -- start the governance-ui by running `yarn dev` - -## Working on governance-ui - -- most of the work is in `hooks/useRealm.ts` and `hooks/useVotingPlugins.ts` in the governance-ui. The UI work is in `components/TokenBalance` - -## Changing dependencies -Whenever you change dependencies (adding, removing, or updating, either in package.json or yarn.lock), there are various files that must be kept up-to-date. - -`yarn.lock`: -- Run yarn again after your changes to ensure yarn.lock has been properly updated. -- Run `yarn deduplicate` to remove duplicate dependencies from the lockfile. - -The `allow-scripts` configuration in `package.json`: -- Run `yarn allow-scripts auto` to update the `allow-scripts` configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. -- Alternatively update the `allow-scripts` section manually. -- Review each new package to determine whether the install script needs to run or not, testing if necessary. -- Use `npx can-i-ignore-scripts` to help assessing whether scripts are needed - -# NextJS Typescript Boilerplate - -Bootstrap a developer-friendly NextJS app configured with: - -- [Typescript](https://www.typescriptlang.org/) -- Linting with [ESLint](https://eslint.org/) -- Formatting with [Prettier](https://prettier.io/) -- Linting, typechecking and formatting on by default using [`husky`](https://github.com/typicode/husky) for commit hooks -- Testing with [Jest](https://jestjs.io/) and [`react-testing-library`](https://testing-library.com/docs/react-testing-library/intro) - -## Deploy your own - -Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-typescript-eslint-jest&project-name=with-typescript-eslint-jest&repository-name=with-typescript-eslint-jest) - -## How to use - -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example: - -```bash -npx create-next-app --example with-typescript-eslint-jest with-typescript-eslint-jest-app -# or -yarn create next-app --example with-typescript-eslint-jest with-typescript-eslint-jest-app -``` - -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). diff --git a/SwitchboardVotePlugin/SwitchboardIdl.ts b/SwitchboardVotePlugin/SwitchboardIdl.ts deleted file mode 100644 index 479a5bc112..0000000000 --- a/SwitchboardVotePlugin/SwitchboardIdl.ts +++ /dev/null @@ -1,9694 +0,0 @@ -export type Switchboard = { - version: '0.1.0' - name: 'switchboard_v2' - instructions: [ - { - name: 'aggregatorAddJob' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'job' - isMut: true - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorAddJobParams' - } - } - ] - }, - { - name: 'aggregatorInit' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: false - }, - { - name: 'queue' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorInitParams' - } - } - ] - }, - { - name: 'aggregatorLock' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: true - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorLockParams' - } - } - ] - }, - { - name: 'aggregatorOpenRound' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'oracleQueue' - isMut: true - isSigner: false - }, - { - name: 'queueAuthority' - isMut: false - isSigner: false - }, - { - name: 'permission' - isMut: true - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'payoutWallet' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'dataBuffer' - isMut: false - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorOpenRoundParams' - } - } - ] - }, - { - name: 'aggregatorRemoveJob' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'job' - isMut: true - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorRemoveJobParams' - } - } - ] - }, - { - name: 'aggregatorSaveResult' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'oracle' - isMut: true - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: true - }, - { - name: 'oracleQueue' - isMut: false - isSigner: false - }, - { - name: 'queueAuthority' - isMut: false - isSigner: false - }, - { - name: 'feedPermission' - isMut: true - isSigner: false - }, - { - name: 'oraclePermission' - isMut: false - isSigner: false - }, - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'historyBuffer' - isMut: true - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSaveResultParams' - } - } - ] - }, - { - name: 'aggregatorSetAuthority' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'newAuthority' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetAuthorityParams' - } - } - ] - }, - { - name: 'aggregatorSetBatchSize' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetBatchSizeParams' - } - } - ] - }, - { - name: 'aggregatorSetHistoryBuffer' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'buffer' - isMut: true - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetHistoryBufferParams' - } - } - ] - }, - { - name: 'aggregatorSetMinJobs' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetMinJobsParams' - } - } - ] - }, - { - name: 'aggregatorSetMinOracles' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetMinOraclesParams' - } - } - ] - }, - { - name: 'aggregatorSetQueue' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'queue' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetQueueParams' - } - } - ] - }, - { - name: 'aggregatorSetUpdateInterval' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetUpdateIntervalParams' - } - } - ] - }, - { - name: 'aggregatorSetVarianceThreshold' - accounts: [ - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'AggregatorSetVarianceThresholdParams' - } - } - ] - }, - { - name: 'crankInit' - accounts: [ - { - name: 'crank' - isMut: true - isSigner: true - }, - { - name: 'queue' - isMut: false - isSigner: false - }, - { - name: 'buffer' - isMut: true - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: false - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'CrankInitParams' - } - } - ] - }, - { - name: 'crankPop' - accounts: [ - { - name: 'crank' - isMut: true - isSigner: false - }, - { - name: 'oracleQueue' - isMut: true - isSigner: false - }, - { - name: 'queueAuthority' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'payoutWallet' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'crankDataBuffer' - isMut: true - isSigner: false - }, - { - name: 'queueDataBuffer' - isMut: false - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'CrankPopParams' - } - } - ] - }, - { - name: 'crankPush' - accounts: [ - { - name: 'crank' - isMut: true - isSigner: false - }, - { - name: 'aggregator' - isMut: true - isSigner: false - }, - { - name: 'oracleQueue' - isMut: true - isSigner: false - }, - { - name: 'queueAuthority' - isMut: false - isSigner: false - }, - { - name: 'permission' - isMut: false - isSigner: false - }, - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'dataBuffer' - isMut: true - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'CrankPushParams' - } - } - ] - }, - { - name: 'jobInit' - accounts: [ - { - name: 'job' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'JobInitParams' - } - } - ] - }, - { - name: 'leaseExtend' - accounts: [ - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'aggregator' - isMut: false - isSigner: false - }, - { - name: 'queue' - isMut: false - isSigner: false - }, - { - name: 'funder' - isMut: true - isSigner: false - }, - { - name: 'owner' - isMut: true - isSigner: true - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'LeaseExtendParams' - } - } - ] - }, - { - name: 'leaseInit' - accounts: [ - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'queue' - isMut: true - isSigner: false - }, - { - name: 'aggregator' - isMut: false - isSigner: false - }, - { - name: 'funder' - isMut: true - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: true - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'owner' - isMut: true - isSigner: true - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'LeaseInitParams' - } - } - ] - }, - { - name: 'leaseSetAuthority' - accounts: [ - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'withdrawAuthority' - isMut: false - isSigner: true - }, - { - name: 'newAuthority' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'LeaseSetAuthorityParams' - } - } - ] - }, - { - name: 'leaseWithdraw' - accounts: [ - { - name: 'lease' - isMut: true - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'aggregator' - isMut: false - isSigner: false - }, - { - name: 'queue' - isMut: false - isSigner: false - }, - { - name: 'withdrawAuthority' - isMut: false - isSigner: true - }, - { - name: 'withdrawAccount' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'LeaseWithdrawParams' - } - } - ] - }, - { - name: 'oracleHeartbeat' - accounts: [ - { - name: 'oracle' - isMut: true - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: true - }, - { - name: 'tokenAccount' - isMut: false - isSigner: false - }, - { - name: 'gcOracle' - isMut: true - isSigner: false - }, - { - name: 'oracleQueue' - isMut: true - isSigner: false - }, - { - name: 'permission' - isMut: false - isSigner: false - }, - { - name: 'dataBuffer' - isMut: true - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'OracleHeartbeatParams' - } - } - ] - }, - { - name: 'oracleInit' - accounts: [ - { - name: 'oracle' - isMut: true - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: false - }, - { - name: 'wallet' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'queue' - isMut: false - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: false - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'OracleInitParams' - } - } - ] - }, - { - name: 'oracleQueueInit' - accounts: [ - { - name: 'oracleQueue' - isMut: true - isSigner: true - }, - { - name: 'authority' - isMut: false - isSigner: false - }, - { - name: 'buffer' - isMut: true - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: false - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - }, - { - name: 'mint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'OracleQueueInitParams' - } - } - ] - }, - { - name: 'oracleQueueSetRewards' - accounts: [ - { - name: 'queue' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'OracleQueueSetRewardsParams' - } - } - ] - }, - { - name: 'oracleQueueVrfConfig' - accounts: [ - { - name: 'queue' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'OracleQueueVrfConfigParams' - } - } - ] - }, - { - name: 'oracleWithdraw' - accounts: [ - { - name: 'oracle' - isMut: true - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: true - }, - { - name: 'tokenAccount' - isMut: true - isSigner: false - }, - { - name: 'withdrawAccount' - isMut: true - isSigner: false - }, - { - name: 'oracleQueue' - isMut: true - isSigner: false - }, - { - name: 'permission' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: true - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'OracleWithdrawParams' - } - } - ] - }, - { - name: 'permissionInit' - accounts: [ - { - name: 'permission' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: false - }, - { - name: 'granter' - isMut: false - isSigner: false - }, - { - name: 'grantee' - isMut: false - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: true - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'PermissionInitParams' - } - } - ] - }, - { - name: 'permissionSet' - accounts: [ - { - name: 'permission' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'PermissionSetParams' - } - } - ] - }, - { - name: 'permissionSetVoterWeight' - accounts: [ - { - name: 'permission' - isMut: false - isSigner: false - }, - { - name: 'permissionAuthority' - isMut: false - isSigner: false - }, - { - name: 'oracle' - isMut: false - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: true - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'govProgram' - isMut: false - isSigner: false - }, - { - name: 'daoMint' - isMut: false - isSigner: false - }, - { - name: 'spawnRecord' - isMut: true - isSigner: false - }, - { - name: 'voterWeight' - isMut: true - isSigner: false - }, - { - name: 'tokenOwnerRecord' - isMut: true - isSigner: false - }, - { - name: 'realm' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'PermissionSetVoterWeightParams' - } - } - ] - }, - { - name: 'programConfig' - accounts: [ - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'daoMint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'ProgramConfigParams' - } - } - ] - }, - { - name: 'programInit' - accounts: [ - { - name: 'state' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: false - }, - { - name: 'tokenMint' - isMut: true - isSigner: false - }, - { - name: 'vault' - isMut: true - isSigner: false - }, - { - name: 'payer' - isMut: true - isSigner: false - }, - { - name: 'systemProgram' - isMut: false - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'daoMint' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'ProgramInitParams' - } - } - ] - }, - { - name: 'vaultTransfer' - accounts: [ - { - name: 'state' - isMut: false - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'to' - isMut: true - isSigner: false - }, - { - name: 'vault' - isMut: true - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'VaultTransferParams' - } - } - ] - }, - { - name: 'vrfInit' - accounts: [ - { - name: 'vrf' - isMut: true - isSigner: false - }, - { - name: 'authority' - isMut: false - isSigner: false - }, - { - name: 'oracleQueue' - isMut: false - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'VrfInitParams' - } - } - ] - }, - { - name: 'vrfProve' - accounts: [ - { - name: 'vrf' - isMut: true - isSigner: false - }, - { - name: 'oracle' - isMut: false - isSigner: false - }, - { - name: 'randomnessProducer' - isMut: false - isSigner: true - } - ] - args: [ - { - name: 'params' - type: { - defined: 'VrfProveParams' - } - } - ] - }, - { - name: 'vrfProveAndVerify' - accounts: [ - { - name: 'vrf' - isMut: true - isSigner: false - }, - { - name: 'callbackPid' - isMut: false - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'oracle' - isMut: false - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: true - }, - { - name: 'oracleWallet' - isMut: true - isSigner: false - }, - { - name: 'instructionsSysvar' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'VrfProveAndVerifyParams' - } - } - ] - }, - { - name: 'vrfRequestRandomness' - accounts: [ - { - name: 'authority' - isMut: false - isSigner: true - }, - { - name: 'vrf' - isMut: true - isSigner: false - }, - { - name: 'oracleQueue' - isMut: true - isSigner: false - }, - { - name: 'queueAuthority' - isMut: false - isSigner: false - }, - { - name: 'dataBuffer' - isMut: false - isSigner: false - }, - { - name: 'permission' - isMut: true - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'payerWallet' - isMut: true - isSigner: false - }, - { - name: 'payerAuthority' - isMut: false - isSigner: true - }, - { - name: 'recentBlockhashes' - isMut: false - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'VrfRequestRandomnessParams' - } - } - ] - }, - { - name: 'vrfVerify' - accounts: [ - { - name: 'vrf' - isMut: true - isSigner: false - }, - { - name: 'callbackPid' - isMut: false - isSigner: false - }, - { - name: 'tokenProgram' - isMut: false - isSigner: false - }, - { - name: 'escrow' - isMut: true - isSigner: false - }, - { - name: 'programState' - isMut: false - isSigner: false - }, - { - name: 'oracle' - isMut: false - isSigner: false - }, - { - name: 'oracleAuthority' - isMut: false - isSigner: false - }, - { - name: 'oracleWallet' - isMut: true - isSigner: false - }, - { - name: 'instructionsSysvar' - isMut: false - isSigner: false - } - ] - args: [ - { - name: 'params' - type: { - defined: 'VrfVerifyParams' - } - } - ] - } - ] - accounts: [ - { - name: 'SbState' - type: { - kind: 'struct' - fields: [ - { - name: 'authority' - type: 'publicKey' - }, - { - name: 'tokenMint' - type: 'publicKey' - }, - { - name: 'tokenVault' - type: 'publicKey' - }, - { - name: 'daoMint' - type: 'publicKey' - }, - { - name: 'ebuf' - type: { - array: ['u8', 992] - } - } - ] - } - }, - { - name: 'AggregatorAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 128] - } - }, - { - name: 'reserved1' - type: { - array: ['u8', 32] - } - }, - { - name: 'queuePubkey' - type: 'publicKey' - }, - { - name: 'oracleRequestBatchSize' - type: 'u32' - }, - { - name: 'minOracleResults' - type: 'u32' - }, - { - name: 'minJobResults' - type: 'u32' - }, - { - name: 'minUpdateDelaySeconds' - type: 'u32' - }, - { - name: 'startAfter' - type: 'i64' - }, - { - name: 'varianceThreshold' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'forceReportPeriod' - type: 'i64' - }, - { - name: 'expiration' - type: 'i64' - }, - { - name: 'consecutiveFailureCount' - type: 'u64' - }, - { - name: 'nextAllowedUpdateTime' - type: 'i64' - }, - { - name: 'isLocked' - type: 'bool' - }, - { - name: 'crankPubkey' - type: 'publicKey' - }, - { - name: 'latestConfirmedRound' - type: { - defined: 'AggregatorRound' - } - }, - { - name: 'currentRound' - type: { - defined: 'AggregatorRound' - } - }, - { - name: 'jobPubkeysData' - type: { - array: ['publicKey', 16] - } - }, - { - name: 'jobHashes' - type: { - array: [ - { - defined: 'Hash' - }, - 16 - ] - } - }, - { - name: 'jobPubkeysSize' - type: 'u32' - }, - { - name: 'jobsChecksum' - type: { - array: ['u8', 32] - } - }, - { - name: 'authority' - type: 'publicKey' - }, - { - name: 'historyBuffer' - type: 'publicKey' - }, - { - name: 'previousConfirmedRoundResult' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'previousConfirmedRoundSlot' - type: 'u64' - }, - { - name: 'disableCrank' - type: 'bool' - }, - { - name: 'jobWeights' - type: { - array: ['u8', 16] - } - }, - { - name: 'ebuf' - type: { - array: ['u8', 147] - } - } - ] - } - }, - { - name: 'PermissionAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'authority' - type: 'publicKey' - }, - { - name: 'permissions' - type: 'u32' - }, - { - name: 'granter' - type: 'publicKey' - }, - { - name: 'grantee' - type: 'publicKey' - }, - { - name: 'expiration' - type: 'i64' - }, - { - name: 'ebuf' - type: { - array: ['u8', 256] - } - } - ] - } - }, - { - name: 'RealmSpawnRecordAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'ebuf' - type: { - array: ['u8', 256] - } - } - ] - } - }, - { - name: 'LeaseAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'escrow' - type: 'publicKey' - }, - { - name: 'queue' - type: 'publicKey' - }, - { - name: 'aggregator' - type: 'publicKey' - }, - { - name: 'tokenProgram' - type: 'publicKey' - }, - { - name: 'isActive' - type: 'bool' - }, - { - name: 'crankRowCount' - type: 'u32' - }, - { - name: 'createdAt' - type: 'i64' - }, - { - name: 'updateCount' - type: 'u128' - }, - { - name: 'withdrawAuthority' - type: 'publicKey' - }, - { - name: 'ebuf' - type: { - array: ['u8', 256] - } - } - ] - } - }, - { - name: 'OracleQueueAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 64] - } - }, - { - name: 'authority' - type: 'publicKey' - }, - { - name: 'oracleTimeout' - type: 'u32' - }, - { - name: 'reward' - type: 'u64' - }, - { - name: 'minStake' - type: 'u64' - }, - { - name: 'slashingEnabled' - type: 'bool' - }, - { - name: 'varianceToleranceMultiplier' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'feedProbationPeriod' - type: 'u32' - }, - { - name: 'currIdx' - type: 'u32' - }, - { - name: 'size' - type: 'u32' - }, - { - name: 'gcIdx' - type: 'u32' - }, - { - name: 'consecutiveFeedFailureLimit' - type: 'u64' - }, - { - name: 'consecutiveOracleFailureLimit' - type: 'u64' - }, - { - name: 'unpermissionedFeedsEnabled' - type: 'bool' - }, - { - name: 'unpermissionedVrfEnabled' - type: 'bool' - }, - { - name: 'curatorRewardCut' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'lockLeaseFunding' - type: 'bool' - }, - { - name: 'mint' - type: 'publicKey' - }, - { - name: 'ebuf' - type: { - array: ['u8', 969] - } - }, - { - name: 'maxSize' - type: 'u32' - }, - { - name: 'dataBuffer' - type: 'publicKey' - } - ] - } - }, - { - name: 'CrankAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 64] - } - }, - { - name: 'queuePubkey' - type: 'publicKey' - }, - { - name: 'pqSize' - type: 'u32' - }, - { - name: 'maxRows' - type: 'u32' - }, - { - name: 'jitterModifier' - type: 'u8' - }, - { - name: 'ebuf' - type: { - array: ['u8', 255] - } - }, - { - name: 'dataBuffer' - type: 'publicKey' - } - ] - } - }, - { - name: 'OracleAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 128] - } - }, - { - name: 'oracleAuthority' - type: 'publicKey' - }, - { - name: 'lastHeartbeat' - type: 'i64' - }, - { - name: 'numInUse' - type: 'u32' - }, - { - name: 'tokenAccount' - type: 'publicKey' - }, - { - name: 'queuePubkey' - type: 'publicKey' - }, - { - name: 'metrics' - type: { - defined: 'OracleMetrics' - } - }, - { - name: 'ebuf' - type: { - array: ['u8', 256] - } - } - ] - } - }, - { - name: 'JobAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 64] - } - }, - { - name: 'authority' - type: 'publicKey' - }, - { - name: 'expiration' - type: 'i64' - }, - { - name: 'hash' - type: { - array: ['u8', 32] - } - }, - { - name: 'data' - type: 'bytes' - }, - { - name: 'referenceCount' - type: 'u32' - }, - { - name: 'totalSpent' - type: 'u64' - }, - { - name: 'createdAt' - type: 'i64' - } - ] - } - }, - { - name: 'VrfAccountData' - type: { - kind: 'struct' - fields: [ - { - name: 'status' - type: { - defined: 'VrfStatus' - } - }, - { - name: 'counter' - type: 'u128' - }, - { - name: 'authority' - type: 'publicKey' - }, - { - name: 'oracleQueue' - type: 'publicKey' - }, - { - name: 'escrow' - type: 'publicKey' - }, - { - name: 'callback' - type: { - defined: 'CallbackZC' - } - }, - { - name: 'batchSize' - type: 'u32' - }, - { - name: 'builders' - type: { - array: [ - { - defined: 'VrfBuilder' - }, - 8 - ] - } - }, - { - name: 'buildersLen' - type: 'u32' - }, - { - name: 'testMode' - type: 'bool' - }, - { - name: 'currentRound' - type: { - defined: 'VrfRound' - } - }, - { - name: 'ebuf' - type: { - array: ['u8', 1024] - } - } - ] - } - } - ] - types: [ - { - name: 'AggregatorAddJobParams' - type: { - kind: 'struct' - fields: [ - { - name: 'weight' - type: { - option: 'u8' - } - } - ] - } - }, - { - name: 'AggregatorInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 128] - } - }, - { - name: 'batchSize' - type: 'u32' - }, - { - name: 'minOracleResults' - type: 'u32' - }, - { - name: 'minJobResults' - type: 'u32' - }, - { - name: 'minUpdateDelaySeconds' - type: 'u32' - }, - { - name: 'startAfter' - type: 'i64' - }, - { - name: 'varianceThreshold' - type: { - defined: 'BorshDecimal' - } - }, - { - name: 'forceReportPeriod' - type: 'i64' - }, - { - name: 'expiration' - type: 'i64' - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'disableCrank' - type: 'bool' - } - ] - } - }, - { - name: 'AggregatorLockParams' - type: { - kind: 'struct' - fields: [] - } - }, - { - name: 'AggregatorOpenRoundParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'leaseBump' - type: 'u8' - }, - { - name: 'permissionBump' - type: 'u8' - }, - { - name: 'jitter' - type: 'u8' - } - ] - } - }, - { - name: 'AggregatorRemoveJobParams' - type: { - kind: 'struct' - fields: [ - { - name: 'jobIdx' - type: 'u32' - } - ] - } - }, - { - name: 'AggregatorSaveResultParams' - type: { - kind: 'struct' - fields: [ - { - name: 'oracleIdx' - type: 'u32' - }, - { - name: 'error' - type: 'bool' - }, - { - name: 'value' - type: { - defined: 'BorshDecimal' - } - }, - { - name: 'jobsChecksum' - type: { - array: ['u8', 32] - } - }, - { - name: 'minResponse' - type: { - defined: 'BorshDecimal' - } - }, - { - name: 'maxResponse' - type: { - defined: 'BorshDecimal' - } - }, - { - name: 'feedPermissionBump' - type: 'u8' - }, - { - name: 'oraclePermissionBump' - type: 'u8' - }, - { - name: 'leaseBump' - type: 'u8' - }, - { - name: 'stateBump' - type: 'u8' - } - ] - } - }, - { - name: 'AggregatorSetAuthorityParams' - type: { - kind: 'struct' - fields: [] - } - }, - { - name: 'AggregatorSetBatchSizeParams' - type: { - kind: 'struct' - fields: [ - { - name: 'batchSize' - type: 'u32' - } - ] - } - }, - { - name: 'AggregatorSetHistoryBufferParams' - type: { - kind: 'struct' - fields: [] - } - }, - { - name: 'AggregatorSetMinJobsParams' - type: { - kind: 'struct' - fields: [ - { - name: 'minJobResults' - type: 'u32' - } - ] - } - }, - { - name: 'AggregatorSetMinOraclesParams' - type: { - kind: 'struct' - fields: [ - { - name: 'minOracleResults' - type: 'u32' - } - ] - } - }, - { - name: 'AggregatorSetQueueParams' - type: { - kind: 'struct' - fields: [] - } - }, - { - name: 'AggregatorSetUpdateIntervalParams' - type: { - kind: 'struct' - fields: [ - { - name: 'newInterval' - type: 'u32' - } - ] - } - }, - { - name: 'AggregatorSetVarianceThresholdParams' - type: { - kind: 'struct' - fields: [ - { - name: 'varianceThreshold' - type: { - defined: 'BorshDecimal' - } - } - ] - } - }, - { - name: 'CrankInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: 'bytes' - }, - { - name: 'metadata' - type: 'bytes' - }, - { - name: 'crankSize' - type: 'u32' - } - ] - } - }, - { - name: 'CrankPopParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'leaseBumps' - type: 'bytes' - }, - { - name: 'permissionBumps' - type: 'bytes' - }, - { - name: 'nonce' - type: { - option: 'u32' - } - }, - { - name: 'failOpenOnAccountMismatch' - type: { - option: 'bool' - } - } - ] - } - }, - { - name: 'CrankPushParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'permissionBump' - type: 'u8' - } - ] - } - }, - { - name: 'JobInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'expiration' - type: 'i64' - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'data' - type: 'bytes' - } - ] - } - }, - { - name: 'LeaseExtendParams' - type: { - kind: 'struct' - fields: [ - { - name: 'loadAmount' - type: 'u64' - }, - { - name: 'leaseBump' - type: 'u8' - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'walletBumps' - type: 'bytes' - } - ] - } - }, - { - name: 'LeaseInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'loadAmount' - type: 'u64' - }, - { - name: 'withdrawAuthority' - type: 'publicKey' - }, - { - name: 'leaseBump' - type: 'u8' - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'walletBumps' - type: 'bytes' - } - ] - } - }, - { - name: 'LeaseSetAuthorityParams' - type: { - kind: 'struct' - fields: [] - } - }, - { - name: 'LeaseWithdrawParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'leaseBump' - type: 'u8' - }, - { - name: 'amount' - type: 'u64' - } - ] - } - }, - { - name: 'OracleHeartbeatParams' - type: { - kind: 'struct' - fields: [ - { - name: 'permissionBump' - type: 'u8' - } - ] - } - }, - { - name: 'OracleInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: 'bytes' - }, - { - name: 'metadata' - type: 'bytes' - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'oracleBump' - type: 'u8' - } - ] - } - }, - { - name: 'OracleQueueInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'name' - type: { - array: ['u8', 32] - } - }, - { - name: 'metadata' - type: { - array: ['u8', 64] - } - }, - { - name: 'reward' - type: 'u64' - }, - { - name: 'minStake' - type: 'u64' - }, - { - name: 'feedProbationPeriod' - type: 'u32' - }, - { - name: 'oracleTimeout' - type: 'u32' - }, - { - name: 'slashingEnabled' - type: 'bool' - }, - { - name: 'varianceToleranceMultiplier' - type: { - defined: 'BorshDecimal' - } - }, - { - name: 'consecutiveFeedFailureLimit' - type: 'u64' - }, - { - name: 'consecutiveOracleFailureLimit' - type: 'u64' - }, - { - name: 'queueSize' - type: 'u32' - }, - { - name: 'unpermissionedFeeds' - type: 'bool' - }, - { - name: 'unpermissionedVrf' - type: 'bool' - } - ] - } - }, - { - name: 'OracleQueueSetRewardsParams' - type: { - kind: 'struct' - fields: [ - { - name: 'rewards' - type: 'u64' - } - ] - } - }, - { - name: 'OracleQueueVrfConfigParams' - type: { - kind: 'struct' - fields: [ - { - name: 'unpermissionedVrfEnabled' - type: 'bool' - } - ] - } - }, - { - name: 'OracleWithdrawParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'permissionBump' - type: 'u8' - }, - { - name: 'amount' - type: 'u64' - } - ] - } - }, - { - name: 'PermissionInitParams' - type: { - kind: 'struct' - fields: [] - } - }, - { - name: 'PermissionSetParams' - type: { - kind: 'struct' - fields: [ - { - name: 'permission' - type: { - defined: 'SwitchboardPermission' - } - }, - { - name: 'enable' - type: 'bool' - } - ] - } - }, - { - name: 'PermissionSetVoterWeightParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - } - ] - } - }, - { - name: 'ProgramConfigParams' - type: { - kind: 'struct' - fields: [ - { - name: 'token' - type: 'publicKey' - }, - { - name: 'bump' - type: 'u8' - }, - { - name: 'daoMint' - type: 'publicKey' - } - ] - } - }, - { - name: 'ProgramInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - } - ] - } - }, - { - name: 'VaultTransferParams' - type: { - kind: 'struct' - fields: [ - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'amount' - type: 'u64' - } - ] - } - }, - { - name: 'VrfInitParams' - type: { - kind: 'struct' - fields: [ - { - name: 'callback' - type: { - defined: 'Callback' - } - }, - { - name: 'stateBump' - type: 'u8' - } - ] - } - }, - { - name: 'VrfProveParams' - type: { - kind: 'struct' - fields: [ - { - name: 'proof' - type: 'bytes' - }, - { - name: 'idx' - type: 'u32' - } - ] - } - }, - { - name: 'VrfProveAndVerifyParams' - type: { - kind: 'struct' - fields: [ - { - name: 'nonce' - type: { - option: 'u32' - } - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'idx' - type: 'u32' - }, - { - name: 'proof' - type: 'bytes' - } - ] - } - }, - { - name: 'VrfRequestRandomnessParams' - type: { - kind: 'struct' - fields: [ - { - name: 'permissionBump' - type: 'u8' - }, - { - name: 'stateBump' - type: 'u8' - } - ] - } - }, - { - name: 'VrfVerifyParams' - type: { - kind: 'struct' - fields: [ - { - name: 'nonce' - type: { - option: 'u32' - } - }, - { - name: 'stateBump' - type: 'u8' - }, - { - name: 'idx' - type: 'u32' - } - ] - } - }, - { - name: 'Hash' - type: { - kind: 'struct' - fields: [ - { - name: 'data' - type: { - array: ['u8', 32] - } - } - ] - } - }, - { - name: 'AggregatorRound' - type: { - kind: 'struct' - fields: [ - { - name: 'numSuccess' - type: 'u32' - }, - { - name: 'numError' - type: 'u32' - }, - { - name: 'isClosed' - type: 'bool' - }, - { - name: 'roundOpenSlot' - type: 'u64' - }, - { - name: 'roundOpenTimestamp' - type: 'i64' - }, - { - name: 'result' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'stdDeviation' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'minResponse' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'maxResponse' - type: { - defined: 'SwitchboardDecimal' - } - }, - { - name: 'oraclePubkeysData' - type: { - array: ['publicKey', 16] - } - }, - { - name: 'mediansData' - type: { - array: [ - { - defined: 'SwitchboardDecimal' - }, - 16 - ] - } - }, - { - name: 'currentPayout' - type: { - array: ['i64', 16] - } - }, - { - name: 'mediansFulfilled' - type: { - array: ['bool', 16] - } - }, - { - name: 'errorsFulfilled' - type: { - array: ['bool', 16] - } - } - ] - } - }, - { - name: 'AggregatorHistoryRow' - type: { - kind: 'struct' - fields: [ - { - name: 'timestamp' - type: 'i64' - }, - { - name: 'value' - type: { - defined: 'SwitchboardDecimal' - } - } - ] - } - }, - { - name: 'SwitchboardDecimal' - type: { - kind: 'struct' - fields: [ - { - name: 'mantissa' - type: 'i128' - }, - { - name: 'scale' - type: 'u32' - } - ] - } - }, - { - name: 'CrankRow' - type: { - kind: 'struct' - fields: [ - { - name: 'pubkey' - type: 'publicKey' - }, - { - name: 'nextTimestamp' - type: 'i64' - } - ] - } - }, - { - name: 'OracleMetrics' - type: { - kind: 'struct' - fields: [ - { - name: 'consecutiveSuccess' - type: 'u64' - }, - { - name: 'consecutiveError' - type: 'u64' - }, - { - name: 'consecutiveDisagreement' - type: 'u64' - }, - { - name: 'consecutiveLateResponse' - type: 'u64' - }, - { - name: 'consecutiveFailure' - type: 'u64' - }, - { - name: 'totalSuccess' - type: 'u128' - }, - { - name: 'totalError' - type: 'u128' - }, - { - name: 'totalDisagreement' - type: 'u128' - }, - { - name: 'totalLateResponse' - type: 'u128' - } - ] - } - }, - { - name: 'BorshDecimal' - type: { - kind: 'struct' - fields: [ - { - name: 'mantissa' - type: 'i128' - }, - { - name: 'scale' - type: 'u32' - } - ] - } - }, - { - name: 'EcvrfProofZC' - type: { - kind: 'struct' - fields: [ - { - name: 'gamma' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'c' - type: { - defined: 'Scalar' - } - }, - { - name: 's' - type: { - defined: 'Scalar' - } - } - ] - } - }, - { - name: 'Scalar' - type: { - kind: 'struct' - fields: [ - { - name: 'bytes' - type: { - array: ['u8', 32] - } - } - ] - } - }, - { - name: 'FieldElementZC' - type: { - kind: 'struct' - fields: [ - { - name: 'bytes' - type: { - array: ['u64', 5] - } - } - ] - } - }, - { - name: 'CompletedPointZC' - type: { - kind: 'struct' - fields: [ - { - name: 'x' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'y' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'z' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 't' - type: { - defined: 'FieldElementZC' - } - } - ] - } - }, - { - name: 'EdwardsPointZC' - type: { - kind: 'struct' - fields: [ - { - name: 'x' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'y' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'z' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 't' - type: { - defined: 'FieldElementZC' - } - } - ] - } - }, - { - name: 'ProjectivePointZC' - type: { - kind: 'struct' - fields: [ - { - name: 'x' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'y' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'z' - type: { - defined: 'FieldElementZC' - } - } - ] - } - }, - { - name: 'EcvrfIntermediate' - type: { - kind: 'struct' - fields: [ - { - name: 'r' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'nS' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'd' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 't13' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 't15' - type: { - defined: 'FieldElementZC' - } - } - ] - } - }, - { - name: 'VrfBuilder' - type: { - kind: 'struct' - fields: [ - { - name: 'producer' - type: 'publicKey' - }, - { - name: 'status' - type: { - defined: 'VrfStatus' - } - }, - { - name: 'reprProof' - type: { - array: ['u8', 80] - } - }, - { - name: 'proof' - type: { - defined: 'EcvrfProofZC' - } - }, - { - name: 'yPoint' - type: 'publicKey' - }, - { - name: 'stage' - type: 'u32' - }, - { - name: 'stage1Out' - type: { - defined: 'EcvrfIntermediate' - } - }, - { - name: 'r1' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'r2' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'stage3Out' - type: { - defined: 'EcvrfIntermediate' - } - }, - { - name: 'hPoint' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'sReduced' - type: { - defined: 'Scalar' - } - }, - { - name: 'yPointBuilder' - type: { - array: [ - { - defined: 'FieldElementZC' - }, - 3 - ] - } - }, - { - name: 'yRistrettoPoint' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'mulRound' - type: 'u8' - }, - { - name: 'hashPointsRound' - type: 'u8' - }, - { - name: 'mulTmp1' - type: { - defined: 'CompletedPointZC' - } - }, - { - name: 'uPoint1' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'uPoint2' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'vPoint1' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'vPoint2' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'uPoint' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'vPoint' - type: { - defined: 'EdwardsPointZC' - } - }, - { - name: 'u1' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'u2' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'invertee' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'y' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'z' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'p1Bytes' - type: { - array: ['u8', 32] - } - }, - { - name: 'p2Bytes' - type: { - array: ['u8', 32] - } - }, - { - name: 'p3Bytes' - type: { - array: ['u8', 32] - } - }, - { - name: 'p4Bytes' - type: { - array: ['u8', 32] - } - }, - { - name: 'cPrimeHashbuf' - type: { - array: ['u8', 16] - } - }, - { - name: 'm1' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'm2' - type: { - defined: 'FieldElementZC' - } - }, - { - name: 'txRemaining' - type: 'u32' - }, - { - name: 'verified' - type: 'bool' - }, - { - name: 'result' - type: { - array: ['u8', 32] - } - } - ] - } - }, - { - name: 'AccountMetaZC' - type: { - kind: 'struct' - fields: [ - { - name: 'pubkey' - type: 'publicKey' - }, - { - name: 'isSigner' - type: 'bool' - }, - { - name: 'isWritable' - type: 'bool' - } - ] - } - }, - { - name: 'AccountMetaBorsh' - type: { - kind: 'struct' - fields: [ - { - name: 'pubkey' - type: 'publicKey' - }, - { - name: 'isSigner' - type: 'bool' - }, - { - name: 'isWritable' - type: 'bool' - } - ] - } - }, - { - name: 'CallbackZC' - type: { - kind: 'struct' - fields: [ - { - name: 'programId' - type: 'publicKey' - }, - { - name: 'accounts' - type: { - array: [ - { - defined: 'AccountMetaZC' - }, - 32 - ] - } - }, - { - name: 'accountsLen' - type: 'u32' - }, - { - name: 'ixData' - type: { - array: ['u8', 1024] - } - }, - { - name: 'ixDataLen' - type: 'u32' - } - ] - } - }, - { - name: 'Callback' - type: { - kind: 'struct' - fields: [ - { - name: 'programId' - type: 'publicKey' - }, - { - name: 'accounts' - type: { - vec: { - defined: 'AccountMetaBorsh' - } - } - }, - { - name: 'ixData' - type: 'bytes' - } - ] - } - }, - { - name: 'VrfRound' - type: { - kind: 'struct' - fields: [ - { - name: 'alpha' - type: { - array: ['u8', 256] - } - }, - { - name: 'alphaLen' - type: 'u32' - }, - { - name: 'requestSlot' - type: 'u64' - }, - { - name: 'requestTimestamp' - type: 'i64' - }, - { - name: 'result' - type: { - array: ['u8', 32] - } - }, - { - name: 'numVerified' - type: 'u32' - }, - { - name: 'ebuf' - type: { - array: ['u8', 256] - } - } - ] - } - }, - { - name: 'Lanes' - type: { - kind: 'enum' - variants: [ - { - name: 'C' - }, - { - name: 'D' - }, - { - name: 'AB' - }, - { - name: 'AC' - }, - { - name: 'CD' - }, - { - name: 'AD' - }, - { - name: 'BC' - }, - { - name: 'ABCD' - } - ] - } - }, - { - name: 'Shuffle' - type: { - kind: 'enum' - variants: [ - { - name: 'AAAA' - }, - { - name: 'BBBB' - }, - { - name: 'CACA' - }, - { - name: 'DBBD' - }, - { - name: 'ADDA' - }, - { - name: 'CBCB' - }, - { - name: 'ABAB' - }, - { - name: 'BADC' - }, - { - name: 'BACD' - }, - { - name: 'ABDC' - } - ] - } - }, - { - name: 'Shuffle' - type: { - kind: 'enum' - variants: [ - { - name: 'AAAA' - }, - { - name: 'BBBB' - }, - { - name: 'BADC' - }, - { - name: 'BACD' - }, - { - name: 'ADDA' - }, - { - name: 'CBCB' - }, - { - name: 'ABDC' - }, - { - name: 'ABAB' - }, - { - name: 'DBBD' - }, - { - name: 'CACA' - } - ] - } - }, - { - name: 'Lanes' - type: { - kind: 'enum' - variants: [ - { - name: 'D' - }, - { - name: 'C' - }, - { - name: 'AB' - }, - { - name: 'AC' - }, - { - name: 'AD' - }, - { - name: 'BCD' - } - ] - } - }, - { - name: 'Error' - type: { - kind: 'enum' - variants: [ - { - name: 'InvalidPublicKey' - }, - { - name: 'SerializationError' - }, - { - name: 'DeserializationError' - }, - { - name: 'InvalidDataError' - } - ] - } - }, - { - name: 'SwitchboardPermission' - type: { - kind: 'enum' - variants: [ - { - name: 'PermitOracleHeartbeat' - }, - { - name: 'PermitOracleQueueUsage' - }, - { - name: 'PermitVrfRequests' - } - ] - } - }, - { - name: 'OracleResponseType' - type: { - kind: 'enum' - variants: [ - { - name: 'TypeSuccess' - }, - { - name: 'TypeError' - }, - { - name: 'TypeDisagreement' - }, - { - name: 'TypeNoResponse' - } - ] - } - }, - { - name: 'VrfStatus' - type: { - kind: 'enum' - variants: [ - { - name: 'StatusNone' - }, - { - name: 'StatusRequesting' - }, - { - name: 'StatusVerifying' - }, - { - name: 'StatusVerified' - }, - { - name: 'StatusCallbackSuccess' - }, - { - name: 'StatusVerifyFailure' - } - ] - } - } - ] - events: [ - { - name: 'AggregatorInitEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - } - ] - }, - { - name: 'VrfRequestRandomnessEvent' - fields: [ - { - name: 'vrfPubkey' - type: 'publicKey' - index: true - }, - { - name: 'oraclePubkeys' - type: { - vec: 'publicKey' - } - index: false - }, - { - name: 'loadAmount' - type: 'u64' - index: false - }, - { - name: 'existingAmount' - type: 'u64' - index: false - } - ] - }, - { - name: 'VrfRequestEvent' - fields: [ - { - name: 'vrfPubkey' - type: 'publicKey' - index: true - }, - { - name: 'oraclePubkeys' - type: { - vec: 'publicKey' - } - index: false - } - ] - }, - { - name: 'VrfProveEvent' - fields: [ - { - name: 'vrfPubkey' - type: 'publicKey' - index: true - }, - { - name: 'oraclePubkey' - type: 'publicKey' - index: true - }, - { - name: 'authorityPubkey' - type: 'publicKey' - index: false - } - ] - }, - { - name: 'VrfVerifyEvent' - fields: [ - { - name: 'vrfPubkey' - type: 'publicKey' - index: true - }, - { - name: 'oraclePubkey' - type: 'publicKey' - index: true - }, - { - name: 'authorityPubkey' - type: 'publicKey' - index: false - }, - { - name: 'amount' - type: 'u64' - index: false - } - ] - }, - { - name: 'VrfCallbackPerformedEvent' - fields: [ - { - name: 'vrfPubkey' - type: 'publicKey' - index: true - }, - { - name: 'oraclePubkey' - type: 'publicKey' - index: true - }, - { - name: 'amount' - type: 'u64' - index: false - } - ] - }, - { - name: 'AggregatorOpenRoundEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'oraclePubkeys' - type: { - vec: 'publicKey' - } - index: false - }, - { - name: 'jobPubkeys' - type: { - vec: 'publicKey' - } - index: false - }, - { - name: 'remainingFunds' - type: 'u64' - index: false - }, - { - name: 'queueAuthority' - type: 'publicKey' - index: false - } - ] - }, - { - name: 'AggregatorValueUpdateEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'value' - type: { - defined: 'BorshDecimal' - } - index: false - }, - { - name: 'slot' - type: 'u64' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - }, - { - name: 'oraclePubkeys' - type: { - vec: 'publicKey' - } - index: false - }, - { - name: 'oracleValues' - type: { - vec: { - defined: 'BorshDecimal' - } - } - index: false - } - ] - }, - { - name: 'OracleRewardEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'leasePubkey' - type: 'publicKey' - index: false - }, - { - name: 'oraclePubkey' - type: 'publicKey' - index: false - }, - { - name: 'walletPubkey' - type: 'publicKey' - index: false - }, - { - name: 'amount' - type: 'u64' - index: false - }, - { - name: 'roundSlot' - type: 'u64' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'OracleWithdrawEvent' - fields: [ - { - name: 'oraclePubkey' - type: 'publicKey' - index: false - }, - { - name: 'walletPubkey' - type: 'publicKey' - index: false - }, - { - name: 'destinationWallet' - type: 'publicKey' - index: false - }, - { - name: 'previousAmount' - type: 'u64' - index: false - }, - { - name: 'newAmount' - type: 'u64' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'LeaseWithdrawEvent' - fields: [ - { - name: 'leasePubkey' - type: 'publicKey' - index: false - }, - { - name: 'walletPubkey' - type: 'publicKey' - index: false - }, - { - name: 'previousAmount' - type: 'u64' - index: false - }, - { - name: 'newAmount' - type: 'u64' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'OracleSlashEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'leasePubkey' - type: 'publicKey' - index: false - }, - { - name: 'oraclePubkey' - type: 'publicKey' - index: false - }, - { - name: 'walletPubkey' - type: 'publicKey' - index: false - }, - { - name: 'amount' - type: 'u64' - index: false - }, - { - name: 'roundSlot' - type: 'u64' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'LeaseFundEvent' - fields: [ - { - name: 'leasePubkey' - type: 'publicKey' - index: false - }, - { - name: 'funder' - type: 'publicKey' - index: false - }, - { - name: 'amount' - type: 'u64' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'ProbationBrokenEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'queuePubkey' - type: 'publicKey' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'FeedPermissionRevokedEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'timestamp' - type: 'i64' - index: false - } - ] - }, - { - name: 'GarbageCollectFailureEvent' - fields: [ - { - name: 'queuePubkey' - type: 'publicKey' - index: false - } - ] - }, - { - name: 'OracleBootedEvent' - fields: [ - { - name: 'queuePubkey' - type: 'publicKey' - index: false - }, - { - name: 'oraclePubkey' - type: 'publicKey' - index: false - } - ] - }, - { - name: 'CrankLeaseInsufficientFundsEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'leasePubkey' - type: 'publicKey' - index: false - } - ] - }, - { - name: 'CrankPopExpectedFailureEvent' - fields: [ - { - name: 'feedPubkey' - type: 'publicKey' - index: false - }, - { - name: 'leasePubkey' - type: 'publicKey' - index: false - } - ] - } - ] - errors: [ - { - code: 6000 - name: 'ArrayOperationError' - msg: 'Illegal operation on a Switchboard array.' - }, - { - code: 6001 - name: 'QueueOperationError' - msg: 'Illegal operation on a Switchboard queue.' - }, - { - code: 6002 - name: 'IncorrectProgramOwnerError' - msg: 'An account required to be owned by the program has a different owner.' - }, - { - code: 6003 - name: 'InvalidAggregatorRound' - msg: 'Aggregator is not currently populated with a valid round.' - }, - { - code: 6004 - name: 'TooManyAggregatorJobs' - msg: 'Aggregator cannot fit any more jobs.' - }, - { - code: 6005 - name: 'AggregatorCurrentRoundClosed' - msg: "Aggregator's current round is closed. No results are being accepted." - }, - { - code: 6006 - name: 'AggregatorInvalidSaveResult' - msg: 'Aggregator received an invalid save result instruction.' - }, - { - code: 6007 - name: 'InvalidStrDecimalConversion' - msg: 'Failed to convert string to decimal format.' - }, - { - code: 6008 - name: 'AccountLoaderMissingSignature' - msg: 'AccountLoader account is missing a required signature.' - }, - { - code: 6009 - name: 'MissingRequiredSignature' - msg: 'Account is missing a required signature.' - }, - { - code: 6010 - name: 'ArrayOverflowError' - msg: 'The attempted action will overflow a zero-copy account array.' - }, - { - code: 6011 - name: 'ArrayUnderflowError' - msg: 'The attempted action will underflow a zero-copy account array.' - }, - { - code: 6012 - name: 'PubkeyNotFoundError' - msg: 'The queried public key was not found.' - }, - { - code: 6013 - name: 'AggregatorIllegalRoundOpenCall' - msg: 'Aggregator round open called too early.' - }, - { - code: 6014 - name: 'AggregatorIllegalRoundCloseCall' - msg: 'Aggregator round close called too early.' - }, - { - code: 6015 - name: 'AggregatorClosedError' - msg: 'Aggregator is closed. Illegal action.' - }, - { - code: 6016 - name: 'IllegalOracleIdxError' - msg: 'Illegal oracle index.' - }, - { - code: 6017 - name: 'OracleAlreadyRespondedError' - msg: 'The provided oracle has already responded this round.' - }, - { - code: 6018 - name: 'ProtoDeserializeError' - msg: 'Failed to deserialize protocol buffer.' - }, - { - code: 6019 - name: 'UnauthorizedStateUpdateError' - msg: 'Unauthorized program state modification attempted.' - }, - { - code: 6020 - name: 'MissingOracleAccountsError' - msg: 'Not enough oracle accounts provided to closeRounds.' - }, - { - code: 6021 - name: 'OracleMismatchError' - msg: 'An unexpected oracle account was provided for the transaction.' - }, - { - code: 6022 - name: 'CrankMaxCapacityError' - msg: "Attempted to push to a Crank that's at capacity" - }, - { - code: 6023 - name: 'AggregatorLeaseInsufficientFunds' - msg: 'Aggregator update call attempted but attached lease has insufficient funds.' - }, - { - code: 6024 - name: 'IncorrectTokenAccountMint' - msg: 'The provided token account does not point to the Switchboard token mint.' - }, - { - code: 6025 - name: 'InvalidEscrowAccount' - msg: 'An invalid escrow account was provided.' - }, - { - code: 6026 - name: 'CrankEmptyError' - msg: 'Crank empty. Pop failed.' - }, - { - code: 6027 - name: 'PdaDeriveError' - msg: 'Failed to derive a PDA from the provided seed.' - }, - { - code: 6028 - name: 'AggregatorAccountNotFound' - msg: 'Aggregator account missing from provided account list.' - }, - { - code: 6029 - name: 'PermissionAccountNotFound' - msg: 'Permission account missing from provided account list.' - }, - { - code: 6030 - name: 'LeaseAccountDeriveFailure' - msg: 'Failed to derive a lease account.' - }, - { - code: 6031 - name: 'PermissionAccountDeriveFailure' - msg: 'Failed to derive a permission account.' - }, - { - code: 6032 - name: 'EscrowAccountNotFound' - msg: 'Escrow account missing from provided account list.' - }, - { - code: 6033 - name: 'LeaseAccountNotFound' - msg: 'Lease account missing from provided account list.' - }, - { - code: 6034 - name: 'DecimalConversionError' - msg: 'Decimal conversion method failed.' - }, - { - code: 6035 - name: 'PermissionDenied' - msg: 'Permission account is missing required flags for the given action.' - }, - { - code: 6036 - name: 'QueueAtCapacity' - msg: 'Oracle queue is at lease capacity.' - }, - { - code: 6037 - name: 'ExcessiveCrankRowsError' - msg: 'Data feed is already pushed on a crank.' - }, - { - code: 6038 - name: 'AggregatorLockedError' - msg: 'Aggregator is locked, no setting modifications or job additions allowed.' - }, - { - code: 6039 - name: 'AggregatorInvalidBatchSizeError' - msg: 'Aggregator invalid batch size.' - }, - { - code: 6040 - name: 'AggregatorJobChecksumMismatch' - msg: 'Oracle provided an incorrect aggregator job checksum.' - }, - { - code: 6041 - name: 'IntegerOverflowError' - msg: 'An integer overflow occurred.' - }, - { - code: 6042 - name: 'InvalidUpdatePeriodError' - msg: 'Minimum update period is 5 seconds.' - }, - { - code: 6043 - name: 'NoResultsError' - msg: 'Aggregator round evaluation attempted with no results.' - }, - { - code: 6044 - name: 'InvalidExpirationError' - msg: 'An expiration constraint was broken.' - }, - { - code: 6045 - name: 'InsufficientStakeError' - msg: 'An account provided insufficient stake for action.' - }, - { - code: 6046 - name: 'LeaseInactiveError' - msg: 'The provided lease account is not active.' - }, - { - code: 6047 - name: 'NoAggregatorJobsFound' - msg: 'No jobs are currently included in the aggregator.' - }, - { - code: 6048 - name: 'IntegerUnderflowError' - msg: 'An integer underflow occurred.' - }, - { - code: 6049 - name: 'OracleQueueMismatch' - msg: 'An invalid oracle queue account was provided.' - }, - { - code: 6050 - name: 'OracleWalletMismatchError' - msg: 'An unexpected oracle wallet account was provided for the transaction.' - }, - { - code: 6051 - name: 'InvalidBufferAccountError' - msg: 'An invalid buffer account was provided.' - }, - { - code: 6052 - name: 'InsufficientOracleQueueError' - msg: 'Insufficient oracle queue size.' - }, - { - code: 6053 - name: 'InvalidAuthorityError' - msg: 'Invalid authority account provided.' - }, - { - code: 6054 - name: 'InvalidTokenAccountMintError' - msg: 'A provided token wallet is associated with an incorrect mint.' - }, - { - code: 6055 - name: 'ExcessiveLeaseWithdrawlError' - msg: 'You must leave enough funds to perform at least 1 update in the lease.' - }, - { - code: 6056 - name: 'InvalideHistoryAccountError' - msg: 'Invalid history account provided.' - }, - { - code: 6057 - name: 'InvalidLeaseAccountEscrowError' - msg: 'Invalid lease account escrow.' - }, - { - code: 6058 - name: 'InvalidCrankAccountError' - msg: 'Invalid crank provided.' - }, - { - code: 6059 - name: 'CrankNoElementsReadyError' - msg: 'No elements ready to be popped.' - }, - { - code: 6060 - name: 'IndexOutOfBoundsError' - msg: 'Index out of bounds' - }, - { - code: 6061 - name: 'VrfInvalidRequestError' - msg: 'Invalid vrf request params' - }, - { - code: 6062 - name: 'VrfInvalidProofSubmissionError' - msg: 'Vrf proof failed to verify' - }, - { - code: 6063 - name: 'VrfVerifyError' - msg: 'Error in verifying vrf proof.' - }, - { - code: 6064 - name: 'VrfCallbackError' - msg: 'Vrf callback function failed.' - }, - { - code: 6065 - name: 'VrfCallbackParamsError' - msg: 'Invalid vrf callback params provided.' - }, - { - code: 6066 - name: 'VrfCallbackAlreadyCalledError' - msg: 'Vrf callback has already been triggered.' - }, - { - code: 6067 - name: 'VrfInvalidPubkeyError' - msg: 'The provided pubkey is invalid to use in ecvrf proofs' - }, - { - code: 6068 - name: 'VrfTooManyVerifyCallsError' - msg: 'Number of required verify calls exceeded' - }, - { - code: 6069 - name: 'VrfRequestAlreadyLaunchedError' - msg: 'Vrf request is already pending' - }, - { - code: 6070 - name: 'VrfInsufficientVerificationError' - msg: 'Insufficient amount of proofs collected for VRF callback' - }, - { - code: 6071 - name: 'InvalidVrfProducerError' - msg: 'An incorrect oracle attempted to submit a proof' - }, - { - code: 6072 - name: 'InvalidGovernancePidError' - msg: 'Invalid SPLGovernance Account Supplied' - }, - { - code: 6073 - name: 'InvalidGovernanceAccountError' - msg: 'An Invalid Governance Account was supplied' - }, - { - code: 6074 - name: 'MissingOptionalAccount' - msg: 'Expected an optional account' - }, - { - code: 6075 - name: 'InvalidSpawnRecordOwner' - msg: 'Invalid Owner for Spawn Record' - }, - { - code: 6076 - name: 'NoopError' - msg: 'Noop error' - }, - { - code: 6077 - name: 'MissingRequiredAccountsError' - msg: 'A required instruction account was not included' - }, - { - code: 6078 - name: 'InvalidMintError' - msg: 'Invalid mint account passed for instruction' - }, - { - code: 6079 - name: 'InvalidTokenAccountKeyError' - msg: 'An invalid token account was passed into the instruction' - }, - { - code: 6080 - name: 'InvalidJobAccountError' - msg: '' - } - ] -} - -export const IDL: Switchboard = { - version: '0.1.0', - name: 'switchboard_v2', - instructions: [ - { - name: 'aggregatorAddJob', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'job', - isMut: true, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorAddJobParams', - }, - }, - ], - }, - { - name: 'aggregatorInit', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: false, - }, - { - name: 'queue', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorInitParams', - }, - }, - ], - }, - { - name: 'aggregatorLock', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: true, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorLockParams', - }, - }, - ], - }, - { - name: 'aggregatorOpenRound', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: true, - isSigner: false, - }, - { - name: 'queueAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'permission', - isMut: true, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'payoutWallet', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'dataBuffer', - isMut: false, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorOpenRoundParams', - }, - }, - ], - }, - { - name: 'aggregatorRemoveJob', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'job', - isMut: true, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorRemoveJobParams', - }, - }, - ], - }, - { - name: 'aggregatorSaveResult', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'oracle', - isMut: true, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'oracleQueue', - isMut: false, - isSigner: false, - }, - { - name: 'queueAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'feedPermission', - isMut: true, - isSigner: false, - }, - { - name: 'oraclePermission', - isMut: false, - isSigner: false, - }, - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'historyBuffer', - isMut: true, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSaveResultParams', - }, - }, - ], - }, - { - name: 'aggregatorSetAuthority', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'newAuthority', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetAuthorityParams', - }, - }, - ], - }, - { - name: 'aggregatorSetBatchSize', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetBatchSizeParams', - }, - }, - ], - }, - { - name: 'aggregatorSetHistoryBuffer', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'buffer', - isMut: true, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetHistoryBufferParams', - }, - }, - ], - }, - { - name: 'aggregatorSetMinJobs', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetMinJobsParams', - }, - }, - ], - }, - { - name: 'aggregatorSetMinOracles', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetMinOraclesParams', - }, - }, - ], - }, - { - name: 'aggregatorSetQueue', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'queue', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetQueueParams', - }, - }, - ], - }, - { - name: 'aggregatorSetUpdateInterval', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetUpdateIntervalParams', - }, - }, - ], - }, - { - name: 'aggregatorSetVarianceThreshold', - accounts: [ - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'AggregatorSetVarianceThresholdParams', - }, - }, - ], - }, - { - name: 'crankInit', - accounts: [ - { - name: 'crank', - isMut: true, - isSigner: true, - }, - { - name: 'queue', - isMut: false, - isSigner: false, - }, - { - name: 'buffer', - isMut: true, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: false, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'CrankInitParams', - }, - }, - ], - }, - { - name: 'crankPop', - accounts: [ - { - name: 'crank', - isMut: true, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: true, - isSigner: false, - }, - { - name: 'queueAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'payoutWallet', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'crankDataBuffer', - isMut: true, - isSigner: false, - }, - { - name: 'queueDataBuffer', - isMut: false, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'CrankPopParams', - }, - }, - ], - }, - { - name: 'crankPush', - accounts: [ - { - name: 'crank', - isMut: true, - isSigner: false, - }, - { - name: 'aggregator', - isMut: true, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: true, - isSigner: false, - }, - { - name: 'queueAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'permission', - isMut: false, - isSigner: false, - }, - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'dataBuffer', - isMut: true, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'CrankPushParams', - }, - }, - ], - }, - { - name: 'jobInit', - accounts: [ - { - name: 'job', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'JobInitParams', - }, - }, - ], - }, - { - name: 'leaseExtend', - accounts: [ - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'aggregator', - isMut: false, - isSigner: false, - }, - { - name: 'queue', - isMut: false, - isSigner: false, - }, - { - name: 'funder', - isMut: true, - isSigner: false, - }, - { - name: 'owner', - isMut: true, - isSigner: true, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'LeaseExtendParams', - }, - }, - ], - }, - { - name: 'leaseInit', - accounts: [ - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'queue', - isMut: true, - isSigner: false, - }, - { - name: 'aggregator', - isMut: false, - isSigner: false, - }, - { - name: 'funder', - isMut: true, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: true, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'owner', - isMut: true, - isSigner: true, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'LeaseInitParams', - }, - }, - ], - }, - { - name: 'leaseSetAuthority', - accounts: [ - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'withdrawAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'newAuthority', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'LeaseSetAuthorityParams', - }, - }, - ], - }, - { - name: 'leaseWithdraw', - accounts: [ - { - name: 'lease', - isMut: true, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'aggregator', - isMut: false, - isSigner: false, - }, - { - name: 'queue', - isMut: false, - isSigner: false, - }, - { - name: 'withdrawAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'withdrawAccount', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'LeaseWithdrawParams', - }, - }, - ], - }, - { - name: 'oracleHeartbeat', - accounts: [ - { - name: 'oracle', - isMut: true, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'tokenAccount', - isMut: false, - isSigner: false, - }, - { - name: 'gcOracle', - isMut: true, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: true, - isSigner: false, - }, - { - name: 'permission', - isMut: false, - isSigner: false, - }, - { - name: 'dataBuffer', - isMut: true, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'OracleHeartbeatParams', - }, - }, - ], - }, - { - name: 'oracleInit', - accounts: [ - { - name: 'oracle', - isMut: true, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'wallet', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'queue', - isMut: false, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: false, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'OracleInitParams', - }, - }, - ], - }, - { - name: 'oracleQueueInit', - accounts: [ - { - name: 'oracleQueue', - isMut: true, - isSigner: true, - }, - { - name: 'authority', - isMut: false, - isSigner: false, - }, - { - name: 'buffer', - isMut: true, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: false, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - { - name: 'mint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'OracleQueueInitParams', - }, - }, - ], - }, - { - name: 'oracleQueueSetRewards', - accounts: [ - { - name: 'queue', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'OracleQueueSetRewardsParams', - }, - }, - ], - }, - { - name: 'oracleQueueVrfConfig', - accounts: [ - { - name: 'queue', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'OracleQueueVrfConfigParams', - }, - }, - ], - }, - { - name: 'oracleWithdraw', - accounts: [ - { - name: 'oracle', - isMut: true, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'tokenAccount', - isMut: true, - isSigner: false, - }, - { - name: 'withdrawAccount', - isMut: true, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: true, - isSigner: false, - }, - { - name: 'permission', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: true, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'OracleWithdrawParams', - }, - }, - ], - }, - { - name: 'permissionInit', - accounts: [ - { - name: 'permission', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: false, - }, - { - name: 'granter', - isMut: false, - isSigner: false, - }, - { - name: 'grantee', - isMut: false, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: true, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'PermissionInitParams', - }, - }, - ], - }, - { - name: 'permissionSet', - accounts: [ - { - name: 'permission', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'PermissionSetParams', - }, - }, - ], - }, - { - name: 'permissionSetVoterWeight', - accounts: [ - { - name: 'permission', - isMut: false, - isSigner: false, - }, - { - name: 'permissionAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'oracle', - isMut: false, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: true, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'govProgram', - isMut: false, - isSigner: false, - }, - { - name: 'daoMint', - isMut: false, - isSigner: false, - }, - { - name: 'spawnRecord', - isMut: true, - isSigner: false, - }, - { - name: 'voterWeight', - isMut: true, - isSigner: false, - }, - { - name: 'tokenOwnerRecord', - isMut: true, - isSigner: false, - }, - { - name: 'realm', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'PermissionSetVoterWeightParams', - }, - }, - ], - }, - { - name: 'programConfig', - accounts: [ - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'daoMint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'ProgramConfigParams', - }, - }, - ], - }, - { - name: 'programInit', - accounts: [ - { - name: 'state', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: false, - }, - { - name: 'tokenMint', - isMut: true, - isSigner: false, - }, - { - name: 'vault', - isMut: true, - isSigner: false, - }, - { - name: 'payer', - isMut: true, - isSigner: false, - }, - { - name: 'systemProgram', - isMut: false, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'daoMint', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'ProgramInitParams', - }, - }, - ], - }, - { - name: 'vaultTransfer', - accounts: [ - { - name: 'state', - isMut: false, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'to', - isMut: true, - isSigner: false, - }, - { - name: 'vault', - isMut: true, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'VaultTransferParams', - }, - }, - ], - }, - { - name: 'vrfInit', - accounts: [ - { - name: 'vrf', - isMut: true, - isSigner: false, - }, - { - name: 'authority', - isMut: false, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: false, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'VrfInitParams', - }, - }, - ], - }, - { - name: 'vrfProve', - accounts: [ - { - name: 'vrf', - isMut: true, - isSigner: false, - }, - { - name: 'oracle', - isMut: false, - isSigner: false, - }, - { - name: 'randomnessProducer', - isMut: false, - isSigner: true, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'VrfProveParams', - }, - }, - ], - }, - { - name: 'vrfProveAndVerify', - accounts: [ - { - name: 'vrf', - isMut: true, - isSigner: false, - }, - { - name: 'callbackPid', - isMut: false, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'oracle', - isMut: false, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'oracleWallet', - isMut: true, - isSigner: false, - }, - { - name: 'instructionsSysvar', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'VrfProveAndVerifyParams', - }, - }, - ], - }, - { - name: 'vrfRequestRandomness', - accounts: [ - { - name: 'authority', - isMut: false, - isSigner: true, - }, - { - name: 'vrf', - isMut: true, - isSigner: false, - }, - { - name: 'oracleQueue', - isMut: true, - isSigner: false, - }, - { - name: 'queueAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'dataBuffer', - isMut: false, - isSigner: false, - }, - { - name: 'permission', - isMut: true, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'payerWallet', - isMut: true, - isSigner: false, - }, - { - name: 'payerAuthority', - isMut: false, - isSigner: true, - }, - { - name: 'recentBlockhashes', - isMut: false, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'VrfRequestRandomnessParams', - }, - }, - ], - }, - { - name: 'vrfVerify', - accounts: [ - { - name: 'vrf', - isMut: true, - isSigner: false, - }, - { - name: 'callbackPid', - isMut: false, - isSigner: false, - }, - { - name: 'tokenProgram', - isMut: false, - isSigner: false, - }, - { - name: 'escrow', - isMut: true, - isSigner: false, - }, - { - name: 'programState', - isMut: false, - isSigner: false, - }, - { - name: 'oracle', - isMut: false, - isSigner: false, - }, - { - name: 'oracleAuthority', - isMut: false, - isSigner: false, - }, - { - name: 'oracleWallet', - isMut: true, - isSigner: false, - }, - { - name: 'instructionsSysvar', - isMut: false, - isSigner: false, - }, - ], - args: [ - { - name: 'params', - type: { - defined: 'VrfVerifyParams', - }, - }, - ], - }, - ], - accounts: [ - { - name: 'SbState', - type: { - kind: 'struct', - fields: [ - { - name: 'authority', - type: 'publicKey', - }, - { - name: 'tokenMint', - type: 'publicKey', - }, - { - name: 'tokenVault', - type: 'publicKey', - }, - { - name: 'daoMint', - type: 'publicKey', - }, - { - name: 'ebuf', - type: { - array: ['u8', 992], - }, - }, - ], - }, - }, - { - name: 'AggregatorAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 128], - }, - }, - { - name: 'reserved1', - type: { - array: ['u8', 32], - }, - }, - { - name: 'queuePubkey', - type: 'publicKey', - }, - { - name: 'oracleRequestBatchSize', - type: 'u32', - }, - { - name: 'minOracleResults', - type: 'u32', - }, - { - name: 'minJobResults', - type: 'u32', - }, - { - name: 'minUpdateDelaySeconds', - type: 'u32', - }, - { - name: 'startAfter', - type: 'i64', - }, - { - name: 'varianceThreshold', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'forceReportPeriod', - type: 'i64', - }, - { - name: 'expiration', - type: 'i64', - }, - { - name: 'consecutiveFailureCount', - type: 'u64', - }, - { - name: 'nextAllowedUpdateTime', - type: 'i64', - }, - { - name: 'isLocked', - type: 'bool', - }, - { - name: 'crankPubkey', - type: 'publicKey', - }, - { - name: 'latestConfirmedRound', - type: { - defined: 'AggregatorRound', - }, - }, - { - name: 'currentRound', - type: { - defined: 'AggregatorRound', - }, - }, - { - name: 'jobPubkeysData', - type: { - array: ['publicKey', 16], - }, - }, - { - name: 'jobHashes', - type: { - array: [ - { - defined: 'Hash', - }, - 16, - ], - }, - }, - { - name: 'jobPubkeysSize', - type: 'u32', - }, - { - name: 'jobsChecksum', - type: { - array: ['u8', 32], - }, - }, - { - name: 'authority', - type: 'publicKey', - }, - { - name: 'historyBuffer', - type: 'publicKey', - }, - { - name: 'previousConfirmedRoundResult', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'previousConfirmedRoundSlot', - type: 'u64', - }, - { - name: 'disableCrank', - type: 'bool', - }, - { - name: 'jobWeights', - type: { - array: ['u8', 16], - }, - }, - { - name: 'ebuf', - type: { - array: ['u8', 147], - }, - }, - ], - }, - }, - { - name: 'PermissionAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'authority', - type: 'publicKey', - }, - { - name: 'permissions', - type: 'u32', - }, - { - name: 'granter', - type: 'publicKey', - }, - { - name: 'grantee', - type: 'publicKey', - }, - { - name: 'expiration', - type: 'i64', - }, - { - name: 'ebuf', - type: { - array: ['u8', 256], - }, - }, - ], - }, - }, - { - name: 'RealmSpawnRecordAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'ebuf', - type: { - array: ['u8', 256], - }, - }, - ], - }, - }, - { - name: 'LeaseAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'escrow', - type: 'publicKey', - }, - { - name: 'queue', - type: 'publicKey', - }, - { - name: 'aggregator', - type: 'publicKey', - }, - { - name: 'tokenProgram', - type: 'publicKey', - }, - { - name: 'isActive', - type: 'bool', - }, - { - name: 'crankRowCount', - type: 'u32', - }, - { - name: 'createdAt', - type: 'i64', - }, - { - name: 'updateCount', - type: 'u128', - }, - { - name: 'withdrawAuthority', - type: 'publicKey', - }, - { - name: 'ebuf', - type: { - array: ['u8', 256], - }, - }, - ], - }, - }, - { - name: 'OracleQueueAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 64], - }, - }, - { - name: 'authority', - type: 'publicKey', - }, - { - name: 'oracleTimeout', - type: 'u32', - }, - { - name: 'reward', - type: 'u64', - }, - { - name: 'minStake', - type: 'u64', - }, - { - name: 'slashingEnabled', - type: 'bool', - }, - { - name: 'varianceToleranceMultiplier', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'feedProbationPeriod', - type: 'u32', - }, - { - name: 'currIdx', - type: 'u32', - }, - { - name: 'size', - type: 'u32', - }, - { - name: 'gcIdx', - type: 'u32', - }, - { - name: 'consecutiveFeedFailureLimit', - type: 'u64', - }, - { - name: 'consecutiveOracleFailureLimit', - type: 'u64', - }, - { - name: 'unpermissionedFeedsEnabled', - type: 'bool', - }, - { - name: 'unpermissionedVrfEnabled', - type: 'bool', - }, - { - name: 'curatorRewardCut', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'lockLeaseFunding', - type: 'bool', - }, - { - name: 'mint', - type: 'publicKey', - }, - { - name: 'ebuf', - type: { - array: ['u8', 969], - }, - }, - { - name: 'maxSize', - type: 'u32', - }, - { - name: 'dataBuffer', - type: 'publicKey', - }, - ], - }, - }, - { - name: 'CrankAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 64], - }, - }, - { - name: 'queuePubkey', - type: 'publicKey', - }, - { - name: 'pqSize', - type: 'u32', - }, - { - name: 'maxRows', - type: 'u32', - }, - { - name: 'jitterModifier', - type: 'u8', - }, - { - name: 'ebuf', - type: { - array: ['u8', 255], - }, - }, - { - name: 'dataBuffer', - type: 'publicKey', - }, - ], - }, - }, - { - name: 'OracleAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 128], - }, - }, - { - name: 'oracleAuthority', - type: 'publicKey', - }, - { - name: 'lastHeartbeat', - type: 'i64', - }, - { - name: 'numInUse', - type: 'u32', - }, - { - name: 'tokenAccount', - type: 'publicKey', - }, - { - name: 'queuePubkey', - type: 'publicKey', - }, - { - name: 'metrics', - type: { - defined: 'OracleMetrics', - }, - }, - { - name: 'ebuf', - type: { - array: ['u8', 256], - }, - }, - ], - }, - }, - { - name: 'JobAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 64], - }, - }, - { - name: 'authority', - type: 'publicKey', - }, - { - name: 'expiration', - type: 'i64', - }, - { - name: 'hash', - type: { - array: ['u8', 32], - }, - }, - { - name: 'data', - type: 'bytes', - }, - { - name: 'referenceCount', - type: 'u32', - }, - { - name: 'totalSpent', - type: 'u64', - }, - { - name: 'createdAt', - type: 'i64', - }, - ], - }, - }, - { - name: 'VrfAccountData', - type: { - kind: 'struct', - fields: [ - { - name: 'status', - type: { - defined: 'VrfStatus', - }, - }, - { - name: 'counter', - type: 'u128', - }, - { - name: 'authority', - type: 'publicKey', - }, - { - name: 'oracleQueue', - type: 'publicKey', - }, - { - name: 'escrow', - type: 'publicKey', - }, - { - name: 'callback', - type: { - defined: 'CallbackZC', - }, - }, - { - name: 'batchSize', - type: 'u32', - }, - { - name: 'builders', - type: { - array: [ - { - defined: 'VrfBuilder', - }, - 8, - ], - }, - }, - { - name: 'buildersLen', - type: 'u32', - }, - { - name: 'testMode', - type: 'bool', - }, - { - name: 'currentRound', - type: { - defined: 'VrfRound', - }, - }, - { - name: 'ebuf', - type: { - array: ['u8', 1024], - }, - }, - ], - }, - }, - ], - types: [ - { - name: 'AggregatorAddJobParams', - type: { - kind: 'struct', - fields: [ - { - name: 'weight', - type: { - option: 'u8', - }, - }, - ], - }, - }, - { - name: 'AggregatorInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 128], - }, - }, - { - name: 'batchSize', - type: 'u32', - }, - { - name: 'minOracleResults', - type: 'u32', - }, - { - name: 'minJobResults', - type: 'u32', - }, - { - name: 'minUpdateDelaySeconds', - type: 'u32', - }, - { - name: 'startAfter', - type: 'i64', - }, - { - name: 'varianceThreshold', - type: { - defined: 'BorshDecimal', - }, - }, - { - name: 'forceReportPeriod', - type: 'i64', - }, - { - name: 'expiration', - type: 'i64', - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'disableCrank', - type: 'bool', - }, - ], - }, - }, - { - name: 'AggregatorLockParams', - type: { - kind: 'struct', - fields: [], - }, - }, - { - name: 'AggregatorOpenRoundParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'leaseBump', - type: 'u8', - }, - { - name: 'permissionBump', - type: 'u8', - }, - { - name: 'jitter', - type: 'u8', - }, - ], - }, - }, - { - name: 'AggregatorRemoveJobParams', - type: { - kind: 'struct', - fields: [ - { - name: 'jobIdx', - type: 'u32', - }, - ], - }, - }, - { - name: 'AggregatorSaveResultParams', - type: { - kind: 'struct', - fields: [ - { - name: 'oracleIdx', - type: 'u32', - }, - { - name: 'error', - type: 'bool', - }, - { - name: 'value', - type: { - defined: 'BorshDecimal', - }, - }, - { - name: 'jobsChecksum', - type: { - array: ['u8', 32], - }, - }, - { - name: 'minResponse', - type: { - defined: 'BorshDecimal', - }, - }, - { - name: 'maxResponse', - type: { - defined: 'BorshDecimal', - }, - }, - { - name: 'feedPermissionBump', - type: 'u8', - }, - { - name: 'oraclePermissionBump', - type: 'u8', - }, - { - name: 'leaseBump', - type: 'u8', - }, - { - name: 'stateBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'AggregatorSetAuthorityParams', - type: { - kind: 'struct', - fields: [], - }, - }, - { - name: 'AggregatorSetBatchSizeParams', - type: { - kind: 'struct', - fields: [ - { - name: 'batchSize', - type: 'u32', - }, - ], - }, - }, - { - name: 'AggregatorSetHistoryBufferParams', - type: { - kind: 'struct', - fields: [], - }, - }, - { - name: 'AggregatorSetMinJobsParams', - type: { - kind: 'struct', - fields: [ - { - name: 'minJobResults', - type: 'u32', - }, - ], - }, - }, - { - name: 'AggregatorSetMinOraclesParams', - type: { - kind: 'struct', - fields: [ - { - name: 'minOracleResults', - type: 'u32', - }, - ], - }, - }, - { - name: 'AggregatorSetQueueParams', - type: { - kind: 'struct', - fields: [], - }, - }, - { - name: 'AggregatorSetUpdateIntervalParams', - type: { - kind: 'struct', - fields: [ - { - name: 'newInterval', - type: 'u32', - }, - ], - }, - }, - { - name: 'AggregatorSetVarianceThresholdParams', - type: { - kind: 'struct', - fields: [ - { - name: 'varianceThreshold', - type: { - defined: 'BorshDecimal', - }, - }, - ], - }, - }, - { - name: 'CrankInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: 'bytes', - }, - { - name: 'metadata', - type: 'bytes', - }, - { - name: 'crankSize', - type: 'u32', - }, - ], - }, - }, - { - name: 'CrankPopParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'leaseBumps', - type: 'bytes', - }, - { - name: 'permissionBumps', - type: 'bytes', - }, - { - name: 'nonce', - type: { - option: 'u32', - }, - }, - { - name: 'failOpenOnAccountMismatch', - type: { - option: 'bool', - }, - }, - ], - }, - }, - { - name: 'CrankPushParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'permissionBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'JobInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'expiration', - type: 'i64', - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'data', - type: 'bytes', - }, - ], - }, - }, - { - name: 'LeaseExtendParams', - type: { - kind: 'struct', - fields: [ - { - name: 'loadAmount', - type: 'u64', - }, - { - name: 'leaseBump', - type: 'u8', - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'walletBumps', - type: 'bytes', - }, - ], - }, - }, - { - name: 'LeaseInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'loadAmount', - type: 'u64', - }, - { - name: 'withdrawAuthority', - type: 'publicKey', - }, - { - name: 'leaseBump', - type: 'u8', - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'walletBumps', - type: 'bytes', - }, - ], - }, - }, - { - name: 'LeaseSetAuthorityParams', - type: { - kind: 'struct', - fields: [], - }, - }, - { - name: 'LeaseWithdrawParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'leaseBump', - type: 'u8', - }, - { - name: 'amount', - type: 'u64', - }, - ], - }, - }, - { - name: 'OracleHeartbeatParams', - type: { - kind: 'struct', - fields: [ - { - name: 'permissionBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'OracleInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: 'bytes', - }, - { - name: 'metadata', - type: 'bytes', - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'oracleBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'OracleQueueInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'name', - type: { - array: ['u8', 32], - }, - }, - { - name: 'metadata', - type: { - array: ['u8', 64], - }, - }, - { - name: 'reward', - type: 'u64', - }, - { - name: 'minStake', - type: 'u64', - }, - { - name: 'feedProbationPeriod', - type: 'u32', - }, - { - name: 'oracleTimeout', - type: 'u32', - }, - { - name: 'slashingEnabled', - type: 'bool', - }, - { - name: 'varianceToleranceMultiplier', - type: { - defined: 'BorshDecimal', - }, - }, - { - name: 'consecutiveFeedFailureLimit', - type: 'u64', - }, - { - name: 'consecutiveOracleFailureLimit', - type: 'u64', - }, - { - name: 'queueSize', - type: 'u32', - }, - { - name: 'unpermissionedFeeds', - type: 'bool', - }, - { - name: 'unpermissionedVrf', - type: 'bool', - }, - ], - }, - }, - { - name: 'OracleQueueSetRewardsParams', - type: { - kind: 'struct', - fields: [ - { - name: 'rewards', - type: 'u64', - }, - ], - }, - }, - { - name: 'OracleQueueVrfConfigParams', - type: { - kind: 'struct', - fields: [ - { - name: 'unpermissionedVrfEnabled', - type: 'bool', - }, - ], - }, - }, - { - name: 'OracleWithdrawParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'permissionBump', - type: 'u8', - }, - { - name: 'amount', - type: 'u64', - }, - ], - }, - }, - { - name: 'PermissionInitParams', - type: { - kind: 'struct', - fields: [], - }, - }, - { - name: 'PermissionSetParams', - type: { - kind: 'struct', - fields: [ - { - name: 'permission', - type: { - defined: 'SwitchboardPermission', - }, - }, - { - name: 'enable', - type: 'bool', - }, - ], - }, - }, - { - name: 'PermissionSetVoterWeightParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'ProgramConfigParams', - type: { - kind: 'struct', - fields: [ - { - name: 'token', - type: 'publicKey', - }, - { - name: 'bump', - type: 'u8', - }, - { - name: 'daoMint', - type: 'publicKey', - }, - ], - }, - }, - { - name: 'ProgramInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'VaultTransferParams', - type: { - kind: 'struct', - fields: [ - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'amount', - type: 'u64', - }, - ], - }, - }, - { - name: 'VrfInitParams', - type: { - kind: 'struct', - fields: [ - { - name: 'callback', - type: { - defined: 'Callback', - }, - }, - { - name: 'stateBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'VrfProveParams', - type: { - kind: 'struct', - fields: [ - { - name: 'proof', - type: 'bytes', - }, - { - name: 'idx', - type: 'u32', - }, - ], - }, - }, - { - name: 'VrfProveAndVerifyParams', - type: { - kind: 'struct', - fields: [ - { - name: 'nonce', - type: { - option: 'u32', - }, - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'idx', - type: 'u32', - }, - { - name: 'proof', - type: 'bytes', - }, - ], - }, - }, - { - name: 'VrfRequestRandomnessParams', - type: { - kind: 'struct', - fields: [ - { - name: 'permissionBump', - type: 'u8', - }, - { - name: 'stateBump', - type: 'u8', - }, - ], - }, - }, - { - name: 'VrfVerifyParams', - type: { - kind: 'struct', - fields: [ - { - name: 'nonce', - type: { - option: 'u32', - }, - }, - { - name: 'stateBump', - type: 'u8', - }, - { - name: 'idx', - type: 'u32', - }, - ], - }, - }, - { - name: 'Hash', - type: { - kind: 'struct', - fields: [ - { - name: 'data', - type: { - array: ['u8', 32], - }, - }, - ], - }, - }, - { - name: 'AggregatorRound', - type: { - kind: 'struct', - fields: [ - { - name: 'numSuccess', - type: 'u32', - }, - { - name: 'numError', - type: 'u32', - }, - { - name: 'isClosed', - type: 'bool', - }, - { - name: 'roundOpenSlot', - type: 'u64', - }, - { - name: 'roundOpenTimestamp', - type: 'i64', - }, - { - name: 'result', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'stdDeviation', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'minResponse', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'maxResponse', - type: { - defined: 'SwitchboardDecimal', - }, - }, - { - name: 'oraclePubkeysData', - type: { - array: ['publicKey', 16], - }, - }, - { - name: 'mediansData', - type: { - array: [ - { - defined: 'SwitchboardDecimal', - }, - 16, - ], - }, - }, - { - name: 'currentPayout', - type: { - array: ['i64', 16], - }, - }, - { - name: 'mediansFulfilled', - type: { - array: ['bool', 16], - }, - }, - { - name: 'errorsFulfilled', - type: { - array: ['bool', 16], - }, - }, - ], - }, - }, - { - name: 'AggregatorHistoryRow', - type: { - kind: 'struct', - fields: [ - { - name: 'timestamp', - type: 'i64', - }, - { - name: 'value', - type: { - defined: 'SwitchboardDecimal', - }, - }, - ], - }, - }, - { - name: 'SwitchboardDecimal', - type: { - kind: 'struct', - fields: [ - { - name: 'mantissa', - type: 'i128', - }, - { - name: 'scale', - type: 'u32', - }, - ], - }, - }, - { - name: 'CrankRow', - type: { - kind: 'struct', - fields: [ - { - name: 'pubkey', - type: 'publicKey', - }, - { - name: 'nextTimestamp', - type: 'i64', - }, - ], - }, - }, - { - name: 'OracleMetrics', - type: { - kind: 'struct', - fields: [ - { - name: 'consecutiveSuccess', - type: 'u64', - }, - { - name: 'consecutiveError', - type: 'u64', - }, - { - name: 'consecutiveDisagreement', - type: 'u64', - }, - { - name: 'consecutiveLateResponse', - type: 'u64', - }, - { - name: 'consecutiveFailure', - type: 'u64', - }, - { - name: 'totalSuccess', - type: 'u128', - }, - { - name: 'totalError', - type: 'u128', - }, - { - name: 'totalDisagreement', - type: 'u128', - }, - { - name: 'totalLateResponse', - type: 'u128', - }, - ], - }, - }, - { - name: 'BorshDecimal', - type: { - kind: 'struct', - fields: [ - { - name: 'mantissa', - type: 'i128', - }, - { - name: 'scale', - type: 'u32', - }, - ], - }, - }, - { - name: 'EcvrfProofZC', - type: { - kind: 'struct', - fields: [ - { - name: 'gamma', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'c', - type: { - defined: 'Scalar', - }, - }, - { - name: 's', - type: { - defined: 'Scalar', - }, - }, - ], - }, - }, - { - name: 'Scalar', - type: { - kind: 'struct', - fields: [ - { - name: 'bytes', - type: { - array: ['u8', 32], - }, - }, - ], - }, - }, - { - name: 'FieldElementZC', - type: { - kind: 'struct', - fields: [ - { - name: 'bytes', - type: { - array: ['u64', 5], - }, - }, - ], - }, - }, - { - name: 'CompletedPointZC', - type: { - kind: 'struct', - fields: [ - { - name: 'x', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'y', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'z', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 't', - type: { - defined: 'FieldElementZC', - }, - }, - ], - }, - }, - { - name: 'EdwardsPointZC', - type: { - kind: 'struct', - fields: [ - { - name: 'x', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'y', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'z', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 't', - type: { - defined: 'FieldElementZC', - }, - }, - ], - }, - }, - { - name: 'ProjectivePointZC', - type: { - kind: 'struct', - fields: [ - { - name: 'x', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'y', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'z', - type: { - defined: 'FieldElementZC', - }, - }, - ], - }, - }, - { - name: 'EcvrfIntermediate', - type: { - kind: 'struct', - fields: [ - { - name: 'r', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'nS', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'd', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 't13', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 't15', - type: { - defined: 'FieldElementZC', - }, - }, - ], - }, - }, - { - name: 'VrfBuilder', - type: { - kind: 'struct', - fields: [ - { - name: 'producer', - type: 'publicKey', - }, - { - name: 'status', - type: { - defined: 'VrfStatus', - }, - }, - { - name: 'reprProof', - type: { - array: ['u8', 80], - }, - }, - { - name: 'proof', - type: { - defined: 'EcvrfProofZC', - }, - }, - { - name: 'yPoint', - type: 'publicKey', - }, - { - name: 'stage', - type: 'u32', - }, - { - name: 'stage1Out', - type: { - defined: 'EcvrfIntermediate', - }, - }, - { - name: 'r1', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'r2', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'stage3Out', - type: { - defined: 'EcvrfIntermediate', - }, - }, - { - name: 'hPoint', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'sReduced', - type: { - defined: 'Scalar', - }, - }, - { - name: 'yPointBuilder', - type: { - array: [ - { - defined: 'FieldElementZC', - }, - 3, - ], - }, - }, - { - name: 'yRistrettoPoint', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'mulRound', - type: 'u8', - }, - { - name: 'hashPointsRound', - type: 'u8', - }, - { - name: 'mulTmp1', - type: { - defined: 'CompletedPointZC', - }, - }, - { - name: 'uPoint1', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'uPoint2', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'vPoint1', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'vPoint2', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'uPoint', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'vPoint', - type: { - defined: 'EdwardsPointZC', - }, - }, - { - name: 'u1', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'u2', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'invertee', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'y', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'z', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'p1Bytes', - type: { - array: ['u8', 32], - }, - }, - { - name: 'p2Bytes', - type: { - array: ['u8', 32], - }, - }, - { - name: 'p3Bytes', - type: { - array: ['u8', 32], - }, - }, - { - name: 'p4Bytes', - type: { - array: ['u8', 32], - }, - }, - { - name: 'cPrimeHashbuf', - type: { - array: ['u8', 16], - }, - }, - { - name: 'm1', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'm2', - type: { - defined: 'FieldElementZC', - }, - }, - { - name: 'txRemaining', - type: 'u32', - }, - { - name: 'verified', - type: 'bool', - }, - { - name: 'result', - type: { - array: ['u8', 32], - }, - }, - ], - }, - }, - { - name: 'AccountMetaZC', - type: { - kind: 'struct', - fields: [ - { - name: 'pubkey', - type: 'publicKey', - }, - { - name: 'isSigner', - type: 'bool', - }, - { - name: 'isWritable', - type: 'bool', - }, - ], - }, - }, - { - name: 'AccountMetaBorsh', - type: { - kind: 'struct', - fields: [ - { - name: 'pubkey', - type: 'publicKey', - }, - { - name: 'isSigner', - type: 'bool', - }, - { - name: 'isWritable', - type: 'bool', - }, - ], - }, - }, - { - name: 'CallbackZC', - type: { - kind: 'struct', - fields: [ - { - name: 'programId', - type: 'publicKey', - }, - { - name: 'accounts', - type: { - array: [ - { - defined: 'AccountMetaZC', - }, - 32, - ], - }, - }, - { - name: 'accountsLen', - type: 'u32', - }, - { - name: 'ixData', - type: { - array: ['u8', 1024], - }, - }, - { - name: 'ixDataLen', - type: 'u32', - }, - ], - }, - }, - { - name: 'Callback', - type: { - kind: 'struct', - fields: [ - { - name: 'programId', - type: 'publicKey', - }, - { - name: 'accounts', - type: { - vec: { - defined: 'AccountMetaBorsh', - }, - }, - }, - { - name: 'ixData', - type: 'bytes', - }, - ], - }, - }, - { - name: 'VrfRound', - type: { - kind: 'struct', - fields: [ - { - name: 'alpha', - type: { - array: ['u8', 256], - }, - }, - { - name: 'alphaLen', - type: 'u32', - }, - { - name: 'requestSlot', - type: 'u64', - }, - { - name: 'requestTimestamp', - type: 'i64', - }, - { - name: 'result', - type: { - array: ['u8', 32], - }, - }, - { - name: 'numVerified', - type: 'u32', - }, - { - name: 'ebuf', - type: { - array: ['u8', 256], - }, - }, - ], - }, - }, - { - name: 'Lanes', - type: { - kind: 'enum', - variants: [ - { - name: 'C', - }, - { - name: 'D', - }, - { - name: 'AB', - }, - { - name: 'AC', - }, - { - name: 'CD', - }, - { - name: 'AD', - }, - { - name: 'BC', - }, - { - name: 'ABCD', - }, - ], - }, - }, - { - name: 'Shuffle', - type: { - kind: 'enum', - variants: [ - { - name: 'AAAA', - }, - { - name: 'BBBB', - }, - { - name: 'CACA', - }, - { - name: 'DBBD', - }, - { - name: 'ADDA', - }, - { - name: 'CBCB', - }, - { - name: 'ABAB', - }, - { - name: 'BADC', - }, - { - name: 'BACD', - }, - { - name: 'ABDC', - }, - ], - }, - }, - { - name: 'Shuffle', - type: { - kind: 'enum', - variants: [ - { - name: 'AAAA', - }, - { - name: 'BBBB', - }, - { - name: 'BADC', - }, - { - name: 'BACD', - }, - { - name: 'ADDA', - }, - { - name: 'CBCB', - }, - { - name: 'ABDC', - }, - { - name: 'ABAB', - }, - { - name: 'DBBD', - }, - { - name: 'CACA', - }, - ], - }, - }, - { - name: 'Lanes', - type: { - kind: 'enum', - variants: [ - { - name: 'D', - }, - { - name: 'C', - }, - { - name: 'AB', - }, - { - name: 'AC', - }, - { - name: 'AD', - }, - { - name: 'BCD', - }, - ], - }, - }, - { - name: 'Error', - type: { - kind: 'enum', - variants: [ - { - name: 'InvalidPublicKey', - }, - { - name: 'SerializationError', - }, - { - name: 'DeserializationError', - }, - { - name: 'InvalidDataError', - }, - ], - }, - }, - { - name: 'SwitchboardPermission', - type: { - kind: 'enum', - variants: [ - { - name: 'PermitOracleHeartbeat', - }, - { - name: 'PermitOracleQueueUsage', - }, - { - name: 'PermitVrfRequests', - }, - ], - }, - }, - { - name: 'OracleResponseType', - type: { - kind: 'enum', - variants: [ - { - name: 'TypeSuccess', - }, - { - name: 'TypeError', - }, - { - name: 'TypeDisagreement', - }, - { - name: 'TypeNoResponse', - }, - ], - }, - }, - { - name: 'VrfStatus', - type: { - kind: 'enum', - variants: [ - { - name: 'StatusNone', - }, - { - name: 'StatusRequesting', - }, - { - name: 'StatusVerifying', - }, - { - name: 'StatusVerified', - }, - { - name: 'StatusCallbackSuccess', - }, - { - name: 'StatusVerifyFailure', - }, - ], - }, - }, - ], - events: [ - { - name: 'AggregatorInitEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - ], - }, - { - name: 'VrfRequestRandomnessEvent', - fields: [ - { - name: 'vrfPubkey', - type: 'publicKey', - index: true, - }, - { - name: 'oraclePubkeys', - type: { - vec: 'publicKey', - }, - index: false, - }, - { - name: 'loadAmount', - type: 'u64', - index: false, - }, - { - name: 'existingAmount', - type: 'u64', - index: false, - }, - ], - }, - { - name: 'VrfRequestEvent', - fields: [ - { - name: 'vrfPubkey', - type: 'publicKey', - index: true, - }, - { - name: 'oraclePubkeys', - type: { - vec: 'publicKey', - }, - index: false, - }, - ], - }, - { - name: 'VrfProveEvent', - fields: [ - { - name: 'vrfPubkey', - type: 'publicKey', - index: true, - }, - { - name: 'oraclePubkey', - type: 'publicKey', - index: true, - }, - { - name: 'authorityPubkey', - type: 'publicKey', - index: false, - }, - ], - }, - { - name: 'VrfVerifyEvent', - fields: [ - { - name: 'vrfPubkey', - type: 'publicKey', - index: true, - }, - { - name: 'oraclePubkey', - type: 'publicKey', - index: true, - }, - { - name: 'authorityPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'amount', - type: 'u64', - index: false, - }, - ], - }, - { - name: 'VrfCallbackPerformedEvent', - fields: [ - { - name: 'vrfPubkey', - type: 'publicKey', - index: true, - }, - { - name: 'oraclePubkey', - type: 'publicKey', - index: true, - }, - { - name: 'amount', - type: 'u64', - index: false, - }, - ], - }, - { - name: 'AggregatorOpenRoundEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'oraclePubkeys', - type: { - vec: 'publicKey', - }, - index: false, - }, - { - name: 'jobPubkeys', - type: { - vec: 'publicKey', - }, - index: false, - }, - { - name: 'remainingFunds', - type: 'u64', - index: false, - }, - { - name: 'queueAuthority', - type: 'publicKey', - index: false, - }, - ], - }, - { - name: 'AggregatorValueUpdateEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'value', - type: { - defined: 'BorshDecimal', - }, - index: false, - }, - { - name: 'slot', - type: 'u64', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - { - name: 'oraclePubkeys', - type: { - vec: 'publicKey', - }, - index: false, - }, - { - name: 'oracleValues', - type: { - vec: { - defined: 'BorshDecimal', - }, - }, - index: false, - }, - ], - }, - { - name: 'OracleRewardEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'leasePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'oraclePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'walletPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'amount', - type: 'u64', - index: false, - }, - { - name: 'roundSlot', - type: 'u64', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'OracleWithdrawEvent', - fields: [ - { - name: 'oraclePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'walletPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'destinationWallet', - type: 'publicKey', - index: false, - }, - { - name: 'previousAmount', - type: 'u64', - index: false, - }, - { - name: 'newAmount', - type: 'u64', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'LeaseWithdrawEvent', - fields: [ - { - name: 'leasePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'walletPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'previousAmount', - type: 'u64', - index: false, - }, - { - name: 'newAmount', - type: 'u64', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'OracleSlashEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'leasePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'oraclePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'walletPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'amount', - type: 'u64', - index: false, - }, - { - name: 'roundSlot', - type: 'u64', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'LeaseFundEvent', - fields: [ - { - name: 'leasePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'funder', - type: 'publicKey', - index: false, - }, - { - name: 'amount', - type: 'u64', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'ProbationBrokenEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'queuePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'FeedPermissionRevokedEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'timestamp', - type: 'i64', - index: false, - }, - ], - }, - { - name: 'GarbageCollectFailureEvent', - fields: [ - { - name: 'queuePubkey', - type: 'publicKey', - index: false, - }, - ], - }, - { - name: 'OracleBootedEvent', - fields: [ - { - name: 'queuePubkey', - type: 'publicKey', - index: false, - }, - { - name: 'oraclePubkey', - type: 'publicKey', - index: false, - }, - ], - }, - { - name: 'CrankLeaseInsufficientFundsEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'leasePubkey', - type: 'publicKey', - index: false, - }, - ], - }, - { - name: 'CrankPopExpectedFailureEvent', - fields: [ - { - name: 'feedPubkey', - type: 'publicKey', - index: false, - }, - { - name: 'leasePubkey', - type: 'publicKey', - index: false, - }, - ], - }, - ], - errors: [ - { - code: 6000, - name: 'ArrayOperationError', - msg: 'Illegal operation on a Switchboard array.', - }, - { - code: 6001, - name: 'QueueOperationError', - msg: 'Illegal operation on a Switchboard queue.', - }, - { - code: 6002, - name: 'IncorrectProgramOwnerError', - msg: - 'An account required to be owned by the program has a different owner.', - }, - { - code: 6003, - name: 'InvalidAggregatorRound', - msg: 'Aggregator is not currently populated with a valid round.', - }, - { - code: 6004, - name: 'TooManyAggregatorJobs', - msg: 'Aggregator cannot fit any more jobs.', - }, - { - code: 6005, - name: 'AggregatorCurrentRoundClosed', - msg: - "Aggregator's current round is closed. No results are being accepted.", - }, - { - code: 6006, - name: 'AggregatorInvalidSaveResult', - msg: 'Aggregator received an invalid save result instruction.', - }, - { - code: 6007, - name: 'InvalidStrDecimalConversion', - msg: 'Failed to convert string to decimal format.', - }, - { - code: 6008, - name: 'AccountLoaderMissingSignature', - msg: 'AccountLoader account is missing a required signature.', - }, - { - code: 6009, - name: 'MissingRequiredSignature', - msg: 'Account is missing a required signature.', - }, - { - code: 6010, - name: 'ArrayOverflowError', - msg: 'The attempted action will overflow a zero-copy account array.', - }, - { - code: 6011, - name: 'ArrayUnderflowError', - msg: 'The attempted action will underflow a zero-copy account array.', - }, - { - code: 6012, - name: 'PubkeyNotFoundError', - msg: 'The queried public key was not found.', - }, - { - code: 6013, - name: 'AggregatorIllegalRoundOpenCall', - msg: 'Aggregator round open called too early.', - }, - { - code: 6014, - name: 'AggregatorIllegalRoundCloseCall', - msg: 'Aggregator round close called too early.', - }, - { - code: 6015, - name: 'AggregatorClosedError', - msg: 'Aggregator is closed. Illegal action.', - }, - { - code: 6016, - name: 'IllegalOracleIdxError', - msg: 'Illegal oracle index.', - }, - { - code: 6017, - name: 'OracleAlreadyRespondedError', - msg: 'The provided oracle has already responded this round.', - }, - { - code: 6018, - name: 'ProtoDeserializeError', - msg: 'Failed to deserialize protocol buffer.', - }, - { - code: 6019, - name: 'UnauthorizedStateUpdateError', - msg: 'Unauthorized program state modification attempted.', - }, - { - code: 6020, - name: 'MissingOracleAccountsError', - msg: 'Not enough oracle accounts provided to closeRounds.', - }, - { - code: 6021, - name: 'OracleMismatchError', - msg: 'An unexpected oracle account was provided for the transaction.', - }, - { - code: 6022, - name: 'CrankMaxCapacityError', - msg: "Attempted to push to a Crank that's at capacity", - }, - { - code: 6023, - name: 'AggregatorLeaseInsufficientFunds', - msg: - 'Aggregator update call attempted but attached lease has insufficient funds.', - }, - { - code: 6024, - name: 'IncorrectTokenAccountMint', - msg: - 'The provided token account does not point to the Switchboard token mint.', - }, - { - code: 6025, - name: 'InvalidEscrowAccount', - msg: 'An invalid escrow account was provided.', - }, - { - code: 6026, - name: 'CrankEmptyError', - msg: 'Crank empty. Pop failed.', - }, - { - code: 6027, - name: 'PdaDeriveError', - msg: 'Failed to derive a PDA from the provided seed.', - }, - { - code: 6028, - name: 'AggregatorAccountNotFound', - msg: 'Aggregator account missing from provided account list.', - }, - { - code: 6029, - name: 'PermissionAccountNotFound', - msg: 'Permission account missing from provided account list.', - }, - { - code: 6030, - name: 'LeaseAccountDeriveFailure', - msg: 'Failed to derive a lease account.', - }, - { - code: 6031, - name: 'PermissionAccountDeriveFailure', - msg: 'Failed to derive a permission account.', - }, - { - code: 6032, - name: 'EscrowAccountNotFound', - msg: 'Escrow account missing from provided account list.', - }, - { - code: 6033, - name: 'LeaseAccountNotFound', - msg: 'Lease account missing from provided account list.', - }, - { - code: 6034, - name: 'DecimalConversionError', - msg: 'Decimal conversion method failed.', - }, - { - code: 6035, - name: 'PermissionDenied', - msg: 'Permission account is missing required flags for the given action.', - }, - { - code: 6036, - name: 'QueueAtCapacity', - msg: 'Oracle queue is at lease capacity.', - }, - { - code: 6037, - name: 'ExcessiveCrankRowsError', - msg: 'Data feed is already pushed on a crank.', - }, - { - code: 6038, - name: 'AggregatorLockedError', - msg: - 'Aggregator is locked, no setting modifications or job additions allowed.', - }, - { - code: 6039, - name: 'AggregatorInvalidBatchSizeError', - msg: 'Aggregator invalid batch size.', - }, - { - code: 6040, - name: 'AggregatorJobChecksumMismatch', - msg: 'Oracle provided an incorrect aggregator job checksum.', - }, - { - code: 6041, - name: 'IntegerOverflowError', - msg: 'An integer overflow occurred.', - }, - { - code: 6042, - name: 'InvalidUpdatePeriodError', - msg: 'Minimum update period is 5 seconds.', - }, - { - code: 6043, - name: 'NoResultsError', - msg: 'Aggregator round evaluation attempted with no results.', - }, - { - code: 6044, - name: 'InvalidExpirationError', - msg: 'An expiration constraint was broken.', - }, - { - code: 6045, - name: 'InsufficientStakeError', - msg: 'An account provided insufficient stake for action.', - }, - { - code: 6046, - name: 'LeaseInactiveError', - msg: 'The provided lease account is not active.', - }, - { - code: 6047, - name: 'NoAggregatorJobsFound', - msg: 'No jobs are currently included in the aggregator.', - }, - { - code: 6048, - name: 'IntegerUnderflowError', - msg: 'An integer underflow occurred.', - }, - { - code: 6049, - name: 'OracleQueueMismatch', - msg: 'An invalid oracle queue account was provided.', - }, - { - code: 6050, - name: 'OracleWalletMismatchError', - msg: - 'An unexpected oracle wallet account was provided for the transaction.', - }, - { - code: 6051, - name: 'InvalidBufferAccountError', - msg: 'An invalid buffer account was provided.', - }, - { - code: 6052, - name: 'InsufficientOracleQueueError', - msg: 'Insufficient oracle queue size.', - }, - { - code: 6053, - name: 'InvalidAuthorityError', - msg: 'Invalid authority account provided.', - }, - { - code: 6054, - name: 'InvalidTokenAccountMintError', - msg: 'A provided token wallet is associated with an incorrect mint.', - }, - { - code: 6055, - name: 'ExcessiveLeaseWithdrawlError', - msg: - 'You must leave enough funds to perform at least 1 update in the lease.', - }, - { - code: 6056, - name: 'InvalideHistoryAccountError', - msg: 'Invalid history account provided.', - }, - { - code: 6057, - name: 'InvalidLeaseAccountEscrowError', - msg: 'Invalid lease account escrow.', - }, - { - code: 6058, - name: 'InvalidCrankAccountError', - msg: 'Invalid crank provided.', - }, - { - code: 6059, - name: 'CrankNoElementsReadyError', - msg: 'No elements ready to be popped.', - }, - { - code: 6060, - name: 'IndexOutOfBoundsError', - msg: 'Index out of bounds', - }, - { - code: 6061, - name: 'VrfInvalidRequestError', - msg: 'Invalid vrf request params', - }, - { - code: 6062, - name: 'VrfInvalidProofSubmissionError', - msg: 'Vrf proof failed to verify', - }, - { - code: 6063, - name: 'VrfVerifyError', - msg: 'Error in verifying vrf proof.', - }, - { - code: 6064, - name: 'VrfCallbackError', - msg: 'Vrf callback function failed.', - }, - { - code: 6065, - name: 'VrfCallbackParamsError', - msg: 'Invalid vrf callback params provided.', - }, - { - code: 6066, - name: 'VrfCallbackAlreadyCalledError', - msg: 'Vrf callback has already been triggered.', - }, - { - code: 6067, - name: 'VrfInvalidPubkeyError', - msg: 'The provided pubkey is invalid to use in ecvrf proofs', - }, - { - code: 6068, - name: 'VrfTooManyVerifyCallsError', - msg: 'Number of required verify calls exceeded', - }, - { - code: 6069, - name: 'VrfRequestAlreadyLaunchedError', - msg: 'Vrf request is already pending', - }, - { - code: 6070, - name: 'VrfInsufficientVerificationError', - msg: 'Insufficient amount of proofs collected for VRF callback', - }, - { - code: 6071, - name: 'InvalidVrfProducerError', - msg: 'An incorrect oracle attempted to submit a proof', - }, - { - code: 6072, - name: 'InvalidGovernancePidError', - msg: 'Invalid SPLGovernance Account Supplied', - }, - { - code: 6073, - name: 'InvalidGovernanceAccountError', - msg: 'An Invalid Governance Account was supplied', - }, - { - code: 6074, - name: 'MissingOptionalAccount', - msg: 'Expected an optional account', - }, - { - code: 6075, - name: 'InvalidSpawnRecordOwner', - msg: 'Invalid Owner for Spawn Record', - }, - { - code: 6076, - name: 'NoopError', - msg: 'Noop error', - }, - { - code: 6077, - name: 'MissingRequiredAccountsError', - msg: 'A required instruction account was not included', - }, - { - code: 6078, - name: 'InvalidMintError', - msg: 'Invalid mint account passed for instruction', - }, - { - code: 6079, - name: 'InvalidTokenAccountKeyError', - msg: 'An invalid token account was passed into the instruction', - }, - { - code: 6080, - name: 'InvalidJobAccountError', - msg: '', - }, - ], -} diff --git a/SwitchboardVotePlugin/SwitchboardQueueVoterClient.ts b/SwitchboardVotePlugin/SwitchboardQueueVoterClient.ts deleted file mode 100644 index 559d27af33..0000000000 --- a/SwitchboardVotePlugin/SwitchboardQueueVoterClient.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Program, Provider } from '@coral-xyz/anchor' -import { PublicKey, Transaction } from '@solana/web3.js' -import { Switchboard, IDL } from './SwitchboardIdl' -//import { NftVoter, IDL } from './nft_voter'; - -export const SWITCHBOARD_ID = new PublicKey( - '7PMP6yE6qb3XzBQr5TK2GhuruYayZzBnT8U92ySaLESC' -) - -export const SWITCHBOARD_ADDIN_ID = new PublicKey( - 'B4EDDdMh5CmB6B9DeMmZmFvRzEgyHR5zWktf6httcMk6' -) - -export const SWITCHBOARD_GRANT_AUTHORITY = new PublicKey( - '5wD32vPTeBk3UJfTCQUpa4KbrHZ5xxc8f4eLnqTPNW8L' -) - -export const SWITCHBOARD_REVOKE_AUTHORITY = new PublicKey( - '9rkK8T8wnYXZ1SSC6g2ZhbnyL5K5v546XSbNJv7og87b' -) -/* -const QUEUE_LIST: PublicKey[] = [ - new PublicKey('7QN4mJo9U58XMeHEyfY6ckKxAkVLkqVtcWjwgNU6xaE'), -] */ - -export class SwitchboardQueueVoterClient { - constructor(public program: Program, public devnet?: boolean) {} - - static async connect( - provider: Provider, - devnet?: boolean - ): Promise { - // alternatively we could fetch from chain - // const idl = await Program.fetchIdl(VSR_ID, provider); - const idl = IDL - - return new SwitchboardQueueVoterClient( - new Program(idl as Switchboard, SWITCHBOARD_ID, provider), - devnet - ) - } -} - -export async function grantPermissionTx( - program: Program, - grantAuthority: PublicKey, - switchboardProgram: PublicKey, - permission: PublicKey -): Promise { - const [addinState] = await PublicKey.findProgramAddress( - [Buffer.from('state')], - program.programId - ) - - return await program.methods - .grantPermission() - .accounts({ - state: addinState, - grantAuthority: grantAuthority, - switchboardProgram: switchboardProgram, - permission: permission, - }) - .transaction() -} - -export async function revokePermissionTx( - program: Program, - revokeAuthority: PublicKey, - switchboardProgram: PublicKey, - permission: PublicKey -): Promise { - const [addinState] = await PublicKey.findProgramAddress( - [Buffer.from('state')], - program.programId - ) - - return await program.methods - .revokePermission() - .accounts({ - state: addinState, - revokeAuthority: revokeAuthority, - switchboardProgram: switchboardProgram, - permission: permission, - }) - .transaction() -} diff --git a/SwitchboardVotePlugin/gameofnodes.json b/SwitchboardVotePlugin/gameofnodes.json deleted file mode 100644 index 4008bed3d8..0000000000 --- a/SwitchboardVotePlugin/gameofnodes.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "version": "0.1.0", - "name": "gameofnodes", - "instructions": [ - { - "name": "initialize", - "accounts": [ - { - "name": "state", - "isMut": true, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "grantAuthority", - "type": "publicKey" - }, - { - "name": "revokeAuthority", - "type": "publicKey" - } - ] - }, - { - "name": "grantPermission", - "accounts": [ - { - "name": "state", - "isMut": false, - "isSigner": false - }, - { - "name": "grantAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "switchboardProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "revokePermission", - "accounts": [ - { - "name": "state", - "isMut": false, - "isSigner": false - }, - { - "name": "revokeAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "switchboardProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - } - ], - "args": [] - }, - { - "name": "permissionSetVoterWeight", - "accounts": [ - { - "name": "permission", - "isMut": false, - "isSigner": false - }, - { - "name": "permissionAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "oracle", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "sbState", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "govProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "daoMint", - "isMut": false, - "isSigner": false - }, - { - "name": "spawnRecord", - "isMut": true, - "isSigner": false - }, - { - "name": "voterWeight", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenOwnerRecord", - "isMut": true, - "isSigner": false - }, - { - "name": "realm", - "isMut": false, - "isSigner": false - } - ], - "args": [] - } - ], - "accounts": [ - { - "name": "State", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "grantAuthority", - "type": "publicKey" - }, - { - "name": "revokeAuthority", - "type": "publicKey" - } - ] - } - }, - { - "name": "RealmSpawnRecordAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "spawner", - "type": "publicKey" - }, - { - "name": "spawnerPrivilege", - "type": "bool" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 256] - } - } - ] - } - } - ], - "errors": [ - { - "code": 6000, - "name": "InvalidGovernanceAccountError", - "msg": "Invalid Governance Account" - } - ], - "metadata": { - "address": "B4EDDdMh5CmB6B9DeMmZmFvRzEgyHR5zWktf6httcMk6" - } -} diff --git a/SwitchboardVotePlugin/store/switchboardStore.ts b/SwitchboardVotePlugin/store/switchboardStore.ts deleted file mode 100644 index 4a0ff9d88e..0000000000 --- a/SwitchboardVotePlugin/store/switchboardStore.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { BN } from '@coral-xyz/anchor' -import create, { State } from 'zustand' -import { PublicKey, TransactionInstruction } from '@solana/web3.js' -import { VotingClient } from '@utils/uiTypes/VotePlugin' - -interface SwitchboardPluginStore extends State { - state: { - votingPower: BN - isLoading: boolean - oracleKeys: Array - instructions: Array - } - setVotingPower: (votingPower: BN) => void - setIsLoading: (val: boolean) => void - setOracleKeys: (keys: Array, votingClient: VotingClient) => void - setInstructions: ( - instructions: Array, - votingClient: VotingClient - ) => void -} - -const defaultState = { - votingPower: new BN(0), - isLoading: false, - oracleKeys: [], - instructions: [], -} - -const useSwitchboardPluginStore = create( - (set, _get) => ({ - state: { - ...defaultState, - }, - setIsLoading: (val) => { - set((s) => { - s.state.isLoading = val - }) - }, - setVotingPower: (votingPower) => { - set((s) => { - s.state.votingPower = votingPower - }) - }, - setOracleKeys: (oracleKeys, votingClient) => { - votingClient._setOracles(oracleKeys) - set((s) => { - s.state.oracleKeys = oracleKeys - }) - }, - setInstructions: (instructions, votingClient) => { - votingClient._setInstructions(instructions) - set((s) => { - s.state.instructions = instructions - }) - }, - }) -) - -export default useSwitchboardPluginStore diff --git a/SwitchboardVotePlugin/switchboard_v2.json b/SwitchboardVotePlugin/switchboard_v2.json deleted file mode 100644 index 0809111d32..0000000000 --- a/SwitchboardVotePlugin/switchboard_v2.json +++ /dev/null @@ -1,5316 +0,0 @@ -{ - "version": "0.1.0", - "name": "switchboard_v2", - "instructions": [ - { - "name": "aggregatorAddJob", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "job", - "isMut": true, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorAddJobParams" - } - } - ] - }, - { - "name": "aggregatorInit", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorInitParams" - } - } - ] - }, - { - "name": "aggregatorLock", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorLockParams" - } - } - ] - }, - { - "name": "aggregatorOpenRound", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "queueAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "payoutWallet", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "dataBuffer", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorOpenRoundParams" - } - } - ] - }, - { - "name": "aggregatorRemoveJob", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "job", - "isMut": true, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorRemoveJobParams" - } - } - ] - }, - { - "name": "aggregatorSaveResult", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "oracle", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "oracleQueue", - "isMut": false, - "isSigner": false - }, - { - "name": "queueAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "feedPermission", - "isMut": true, - "isSigner": false - }, - { - "name": "oraclePermission", - "isMut": false, - "isSigner": false - }, - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "historyBuffer", - "isMut": true, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSaveResultParams" - } - } - ] - }, - { - "name": "aggregatorSetAuthority", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetAuthorityParams" - } - } - ] - }, - { - "name": "aggregatorSetBatchSize", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetBatchSizeParams" - } - } - ] - }, - { - "name": "aggregatorSetForceReportPeriod", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetForceReportPeriodParams" - } - } - ] - }, - { - "name": "aggregatorSetHistoryBuffer", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "buffer", - "isMut": true, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetHistoryBufferParams" - } - } - ] - }, - { - "name": "aggregatorSetMinJobs", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetMinJobsParams" - } - } - ] - }, - { - "name": "aggregatorSetMinOracles", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetMinOraclesParams" - } - } - ] - }, - { - "name": "aggregatorSetQueue", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetQueueParams" - } - } - ] - }, - { - "name": "aggregatorSetUpdateInterval", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetUpdateIntervalParams" - } - } - ] - }, - { - "name": "aggregatorSetVarianceThreshold", - "accounts": [ - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "AggregatorSetVarianceThresholdParams" - } - } - ] - }, - { - "name": "crankInit", - "accounts": [ - { - "name": "crank", - "isMut": true, - "isSigner": true - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - }, - { - "name": "buffer", - "isMut": true, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "CrankInitParams" - } - } - ] - }, - { - "name": "bufferRelayerInit", - "accounts": [ - { - "name": "bufferRelayer", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - }, - { - "name": "job", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "associatedTokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "rent", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "BufferRelayerInitParams" - } - } - ] - }, - { - "name": "bufferRelayerOpenRound", - "accounts": [ - { - "name": "bufferRelayer", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "dataBuffer", - "isMut": true, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "BufferRelayerOpenRoundParams" - } - } - ] - }, - { - "name": "bufferRelayerSaveResult", - "accounts": [ - { - "name": "bufferRelayer", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "oracle", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "dataBuffer", - "isMut": true, - "isSigner": false - }, - { - "name": "queueAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleWallet", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "BufferRelayerSaveResultParams" - } - } - ] - }, - { - "name": "crankPop", - "accounts": [ - { - "name": "crank", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "queueAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "payoutWallet", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "crankDataBuffer", - "isMut": true, - "isSigner": false - }, - { - "name": "queueDataBuffer", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "CrankPopParams" - } - } - ] - }, - { - "name": "crankPush", - "accounts": [ - { - "name": "crank", - "isMut": true, - "isSigner": false - }, - { - "name": "aggregator", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "queueAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "permission", - "isMut": false, - "isSigner": false - }, - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "dataBuffer", - "isMut": true, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "CrankPushParams" - } - } - ] - }, - { - "name": "jobInit", - "accounts": [ - { - "name": "job", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "JobInitParams" - } - } - ] - }, - { - "name": "leaseExtend", - "accounts": [ - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "aggregator", - "isMut": false, - "isSigner": false - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - }, - { - "name": "funder", - "isMut": true, - "isSigner": false - }, - { - "name": "owner", - "isMut": true, - "isSigner": true - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "LeaseExtendParams" - } - } - ] - }, - { - "name": "leaseInit", - "accounts": [ - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "queue", - "isMut": true, - "isSigner": false - }, - { - "name": "aggregator", - "isMut": false, - "isSigner": false - }, - { - "name": "funder", - "isMut": true, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "owner", - "isMut": true, - "isSigner": true - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "LeaseInitParams" - } - } - ] - }, - { - "name": "leaseSetAuthority", - "accounts": [ - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "withdrawAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "LeaseSetAuthorityParams" - } - } - ] - }, - { - "name": "leaseWithdraw", - "accounts": [ - { - "name": "lease", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "aggregator", - "isMut": false, - "isSigner": false - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - }, - { - "name": "withdrawAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "withdrawAccount", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "LeaseWithdrawParams" - } - } - ] - }, - { - "name": "oracleHeartbeat", - "accounts": [ - { - "name": "oracle", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "tokenAccount", - "isMut": false, - "isSigner": false - }, - { - "name": "gcOracle", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "permission", - "isMut": false, - "isSigner": false - }, - { - "name": "dataBuffer", - "isMut": true, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "OracleHeartbeatParams" - } - } - ] - }, - { - "name": "oracleInit", - "accounts": [ - { - "name": "oracle", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "wallet", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "queue", - "isMut": false, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "OracleInitParams" - } - } - ] - }, - { - "name": "oracleQueueInit", - "accounts": [ - { - "name": "oracleQueue", - "isMut": true, - "isSigner": true - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "buffer", - "isMut": true, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "mint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "OracleQueueInitParams" - } - } - ] - }, - { - "name": "oracleQueueSetRewards", - "accounts": [ - { - "name": "queue", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "OracleQueueSetRewardsParams" - } - } - ] - }, - { - "name": "oracleQueueVrfConfig", - "accounts": [ - { - "name": "queue", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "OracleQueueVrfConfigParams" - } - } - ] - }, - { - "name": "oracleWithdraw", - "accounts": [ - { - "name": "oracle", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "tokenAccount", - "isMut": true, - "isSigner": false - }, - { - "name": "withdrawAccount", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "OracleWithdrawParams" - } - } - ] - }, - { - "name": "permissionInit", - "accounts": [ - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "granter", - "isMut": false, - "isSigner": false - }, - { - "name": "grantee", - "isMut": false, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "PermissionInitParams" - } - } - ] - }, - { - "name": "permissionSet", - "accounts": [ - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "PermissionSetParams" - } - } - ] - }, - { - "name": "permissionSetVoterWeight", - "accounts": [ - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "permissionAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "oracle", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "govProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "daoMint", - "isMut": false, - "isSigner": false - }, - { - "name": "spawnRecord", - "isMut": true, - "isSigner": false - }, - { - "name": "voterWeight", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenOwnerRecord", - "isMut": true, - "isSigner": false - }, - { - "name": "realm", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "PermissionSetVoterWeightParams" - } - } - ] - }, - { - "name": "programConfig", - "accounts": [ - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "daoMint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "ProgramConfigParams" - } - } - ] - }, - { - "name": "programInit", - "accounts": [ - { - "name": "state", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenMint", - "isMut": true, - "isSigner": false - }, - { - "name": "vault", - "isMut": true, - "isSigner": false - }, - { - "name": "payer", - "isMut": true, - "isSigner": true - }, - { - "name": "systemProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "daoMint", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "ProgramInitParams" - } - } - ] - }, - { - "name": "vaultTransfer", - "accounts": [ - { - "name": "state", - "isMut": false, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "to", - "isMut": true, - "isSigner": false - }, - { - "name": "vault", - "isMut": true, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "VaultTransferParams" - } - } - ] - }, - { - "name": "vrfInit", - "accounts": [ - { - "name": "vrf", - "isMut": true, - "isSigner": false - }, - { - "name": "authority", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": false, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "VrfInitParams" - } - } - ] - }, - { - "name": "vrfProve", - "accounts": [ - { - "name": "vrf", - "isMut": true, - "isSigner": false - }, - { - "name": "oracle", - "isMut": false, - "isSigner": false - }, - { - "name": "randomnessProducer", - "isMut": false, - "isSigner": true - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "VrfProveParams" - } - } - ] - }, - { - "name": "vrfProveAndVerify", - "accounts": [ - { - "name": "vrf", - "isMut": true, - "isSigner": false - }, - { - "name": "callbackPid", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "oracle", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "oracleWallet", - "isMut": true, - "isSigner": false - }, - { - "name": "instructionsSysvar", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "VrfProveAndVerifyParams" - } - } - ] - }, - { - "name": "vrfRequestRandomness", - "accounts": [ - { - "name": "authority", - "isMut": false, - "isSigner": true - }, - { - "name": "vrf", - "isMut": true, - "isSigner": false - }, - { - "name": "oracleQueue", - "isMut": true, - "isSigner": false - }, - { - "name": "queueAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "dataBuffer", - "isMut": false, - "isSigner": false - }, - { - "name": "permission", - "isMut": true, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "payerWallet", - "isMut": true, - "isSigner": false - }, - { - "name": "payerAuthority", - "isMut": false, - "isSigner": true - }, - { - "name": "recentBlockhashes", - "isMut": false, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "VrfRequestRandomnessParams" - } - } - ] - }, - { - "name": "vrfVerify", - "accounts": [ - { - "name": "vrf", - "isMut": true, - "isSigner": false - }, - { - "name": "callbackPid", - "isMut": false, - "isSigner": false - }, - { - "name": "tokenProgram", - "isMut": false, - "isSigner": false - }, - { - "name": "escrow", - "isMut": true, - "isSigner": false - }, - { - "name": "programState", - "isMut": false, - "isSigner": false - }, - { - "name": "oracle", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleAuthority", - "isMut": false, - "isSigner": false - }, - { - "name": "oracleWallet", - "isMut": true, - "isSigner": false - }, - { - "name": "instructionsSysvar", - "isMut": false, - "isSigner": false - } - ], - "args": [ - { - "name": "params", - "type": { - "defined": "VrfVerifyParams" - } - } - ] - } - ], - "accounts": [ - { - "name": "SbState", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "tokenMint", - "type": "publicKey" - }, - { - "name": "tokenVault", - "type": "publicKey" - }, - { - "name": "daoMint", - "type": "publicKey" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 992] - } - } - ] - } - }, - { - "name": "TaskSpecRecord", - "type": { - "kind": "struct", - "fields": [ - { - "name": "hash", - "type": { - "defined": "Hash" - } - } - ] - } - }, - { - "name": "AggregatorAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 128] - } - }, - { - "name": "reserved1", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "queuePubkey", - "type": "publicKey" - }, - { - "name": "oracleRequestBatchSize", - "type": "u32" - }, - { - "name": "minOracleResults", - "type": "u32" - }, - { - "name": "minJobResults", - "type": "u32" - }, - { - "name": "minUpdateDelaySeconds", - "type": "u32" - }, - { - "name": "startAfter", - "type": "i64" - }, - { - "name": "varianceThreshold", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "forceReportPeriod", - "type": "i64" - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "consecutiveFailureCount", - "type": "u64" - }, - { - "name": "nextAllowedUpdateTime", - "type": "i64" - }, - { - "name": "isLocked", - "type": "bool" - }, - { - "name": "crankPubkey", - "type": "publicKey" - }, - { - "name": "latestConfirmedRound", - "type": { - "defined": "AggregatorRound" - } - }, - { - "name": "currentRound", - "type": { - "defined": "AggregatorRound" - } - }, - { - "name": "jobPubkeysData", - "type": { - "array": ["publicKey", 16] - } - }, - { - "name": "jobHashes", - "type": { - "array": [ - { - "defined": "Hash" - }, - 16 - ] - } - }, - { - "name": "jobPubkeysSize", - "type": "u32" - }, - { - "name": "jobsChecksum", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "historyBuffer", - "type": "publicKey" - }, - { - "name": "previousConfirmedRoundResult", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "previousConfirmedRoundSlot", - "type": "u64" - }, - { - "name": "disableCrank", - "type": "bool" - }, - { - "name": "jobWeights", - "type": { - "array": ["u8", 16] - } - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 147] - } - } - ] - } - }, - { - "name": "PermissionAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "permissions", - "type": "u32" - }, - { - "name": "granter", - "type": "publicKey" - }, - { - "name": "grantee", - "type": "publicKey" - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 256] - } - } - ] - } - }, - { - "name": "RealmSpawnRecordAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "ebuf", - "type": { - "array": ["u8", 256] - } - } - ] - } - }, - { - "name": "LeaseAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "escrow", - "type": "publicKey" - }, - { - "name": "queue", - "type": "publicKey" - }, - { - "name": "aggregator", - "type": "publicKey" - }, - { - "name": "tokenProgram", - "type": "publicKey" - }, - { - "name": "isActive", - "type": "bool" - }, - { - "name": "crankRowCount", - "type": "u32" - }, - { - "name": "createdAt", - "type": "i64" - }, - { - "name": "updateCount", - "type": "u128" - }, - { - "name": "withdrawAuthority", - "type": "publicKey" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 256] - } - } - ] - } - }, - { - "name": "OracleQueueAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 64] - } - }, - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "oracleTimeout", - "type": "u32" - }, - { - "name": "reward", - "type": "u64" - }, - { - "name": "minStake", - "type": "u64" - }, - { - "name": "slashingEnabled", - "type": "bool" - }, - { - "name": "varianceToleranceMultiplier", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "feedProbationPeriod", - "type": "u32" - }, - { - "name": "currIdx", - "type": "u32" - }, - { - "name": "size", - "type": "u32" - }, - { - "name": "gcIdx", - "type": "u32" - }, - { - "name": "consecutiveFeedFailureLimit", - "type": "u64" - }, - { - "name": "consecutiveOracleFailureLimit", - "type": "u64" - }, - { - "name": "unpermissionedFeedsEnabled", - "type": "bool" - }, - { - "name": "unpermissionedVrfEnabled", - "type": "bool" - }, - { - "name": "curatorRewardCut", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "lockLeaseFunding", - "type": "bool" - }, - { - "name": "mint", - "type": "publicKey" - }, - { - "name": "enableBufferRelayers", - "type": "bool" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 968] - } - }, - { - "name": "maxSize", - "type": "u32" - }, - { - "name": "dataBuffer", - "type": "publicKey" - } - ] - } - }, - { - "name": "CrankAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 64] - } - }, - { - "name": "queuePubkey", - "type": "publicKey" - }, - { - "name": "pqSize", - "type": "u32" - }, - { - "name": "maxRows", - "type": "u32" - }, - { - "name": "jitterModifier", - "type": "u8" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 255] - } - }, - { - "name": "dataBuffer", - "type": "publicKey" - } - ] - } - }, - { - "name": "OracleAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 128] - } - }, - { - "name": "oracleAuthority", - "type": "publicKey" - }, - { - "name": "lastHeartbeat", - "type": "i64" - }, - { - "name": "numInUse", - "type": "u32" - }, - { - "name": "tokenAccount", - "type": "publicKey" - }, - { - "name": "queuePubkey", - "type": "publicKey" - }, - { - "name": "metrics", - "type": { - "defined": "OracleMetrics" - } - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 256] - } - } - ] - } - }, - { - "name": "JobAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 64] - } - }, - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "hash", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "data", - "type": "bytes" - }, - { - "name": "referenceCount", - "type": "u32" - }, - { - "name": "totalSpent", - "type": "u64" - }, - { - "name": "createdAt", - "type": "i64" - } - ] - } - }, - { - "name": "VrfAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "status", - "type": { - "defined": "VrfStatus" - } - }, - { - "name": "counter", - "type": "u128" - }, - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "oracleQueue", - "type": "publicKey" - }, - { - "name": "escrow", - "type": "publicKey" - }, - { - "name": "callback", - "type": { - "defined": "CallbackZC" - } - }, - { - "name": "batchSize", - "type": "u32" - }, - { - "name": "builders", - "type": { - "array": [ - { - "defined": "VrfBuilder" - }, - 8 - ] - } - }, - { - "name": "buildersLen", - "type": "u32" - }, - { - "name": "testMode", - "type": "bool" - }, - { - "name": "currentRound", - "type": { - "defined": "VrfRound" - } - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 1024] - } - } - ] - } - }, - { - "name": "BufferRelayerAccountData", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "queuePubkey", - "type": "publicKey" - }, - { - "name": "escrow", - "type": "publicKey" - }, - { - "name": "authority", - "type": "publicKey" - }, - { - "name": "jobPubkey", - "type": "publicKey" - }, - { - "name": "jobHash", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "minUpdateDelaySeconds", - "type": "u32" - }, - { - "name": "isLocked", - "type": "bool" - }, - { - "name": "currentRound", - "type": { - "defined": "BufferRelayerRound" - } - }, - { - "name": "latestConfirmedRound", - "type": { - "defined": "BufferRelayerRound" - } - }, - { - "name": "result", - "type": "bytes" - } - ] - } - } - ], - "types": [ - { - "name": "AggregatorAddJobParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "weight", - "type": { - "option": "u8" - } - } - ] - } - }, - { - "name": "AggregatorInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 128] - } - }, - { - "name": "batchSize", - "type": "u32" - }, - { - "name": "minOracleResults", - "type": "u32" - }, - { - "name": "minJobResults", - "type": "u32" - }, - { - "name": "minUpdateDelaySeconds", - "type": "u32" - }, - { - "name": "startAfter", - "type": "i64" - }, - { - "name": "varianceThreshold", - "type": { - "defined": "BorshDecimal" - } - }, - { - "name": "forceReportPeriod", - "type": "i64" - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "disableCrank", - "type": "bool" - } - ] - } - }, - { - "name": "AggregatorLockParams", - "type": { - "kind": "struct", - "fields": [] - } - }, - { - "name": "AggregatorOpenRoundParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "leaseBump", - "type": "u8" - }, - { - "name": "permissionBump", - "type": "u8" - }, - { - "name": "jitter", - "type": "u8" - } - ] - } - }, - { - "name": "AggregatorRemoveJobParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "jobIdx", - "type": "u32" - } - ] - } - }, - { - "name": "AggregatorSaveResultParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "oracleIdx", - "type": "u32" - }, - { - "name": "error", - "type": "bool" - }, - { - "name": "value", - "type": { - "defined": "BorshDecimal" - } - }, - { - "name": "jobsChecksum", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "minResponse", - "type": { - "defined": "BorshDecimal" - } - }, - { - "name": "maxResponse", - "type": { - "defined": "BorshDecimal" - } - }, - { - "name": "feedPermissionBump", - "type": "u8" - }, - { - "name": "oraclePermissionBump", - "type": "u8" - }, - { - "name": "leaseBump", - "type": "u8" - }, - { - "name": "stateBump", - "type": "u8" - } - ] - } - }, - { - "name": "AggregatorSetAuthorityParams", - "type": { - "kind": "struct", - "fields": [] - } - }, - { - "name": "AggregatorSetBatchSizeParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "batchSize", - "type": "u32" - } - ] - } - }, - { - "name": "AggregatorSetForceReportPeriodParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "forceReportPeriod", - "type": "u32" - } - ] - } - }, - { - "name": "AggregatorSetHistoryBufferParams", - "type": { - "kind": "struct", - "fields": [] - } - }, - { - "name": "AggregatorSetMinJobsParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "minJobResults", - "type": "u32" - } - ] - } - }, - { - "name": "AggregatorSetMinOraclesParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "minOracleResults", - "type": "u32" - } - ] - } - }, - { - "name": "AggregatorSetQueueParams", - "type": { - "kind": "struct", - "fields": [] - } - }, - { - "name": "AggregatorSetUpdateIntervalParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "newInterval", - "type": "u32" - } - ] - } - }, - { - "name": "AggregatorSetVarianceThresholdParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "varianceThreshold", - "type": { - "defined": "BorshDecimal" - } - } - ] - } - }, - { - "name": "BufferRelayerInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "minUpdateDelaySeconds", - "type": "u32" - }, - { - "name": "stateBump", - "type": "u8" - } - ] - } - }, - { - "name": "BufferRelayerOpenRoundParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "permissionBump", - "type": "u8" - } - ] - } - }, - { - "name": "BufferRelayerSaveResultParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "permissionBump", - "type": "u8" - }, - { - "name": "result", - "type": "bytes" - }, - { - "name": "success", - "type": "bool" - } - ] - } - }, - { - "name": "CrankInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "bytes" - }, - { - "name": "metadata", - "type": "bytes" - }, - { - "name": "crankSize", - "type": "u32" - } - ] - } - }, - { - "name": "CrankPopParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "leaseBumps", - "type": "bytes" - }, - { - "name": "permissionBumps", - "type": "bytes" - }, - { - "name": "nonce", - "type": { - "option": "u32" - } - }, - { - "name": "failOpenOnAccountMismatch", - "type": { - "option": "bool" - } - } - ] - } - }, - { - "name": "CrankPushParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "permissionBump", - "type": "u8" - } - ] - } - }, - { - "name": "JobInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "expiration", - "type": "i64" - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "data", - "type": "bytes" - } - ] - } - }, - { - "name": "LeaseExtendParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "loadAmount", - "type": "u64" - }, - { - "name": "leaseBump", - "type": "u8" - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "walletBumps", - "type": "bytes" - } - ] - } - }, - { - "name": "LeaseInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "loadAmount", - "type": "u64" - }, - { - "name": "withdrawAuthority", - "type": "publicKey" - }, - { - "name": "leaseBump", - "type": "u8" - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "walletBumps", - "type": "bytes" - } - ] - } - }, - { - "name": "LeaseSetAuthorityParams", - "type": { - "kind": "struct", - "fields": [] - } - }, - { - "name": "LeaseWithdrawParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "leaseBump", - "type": "u8" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "OracleHeartbeatParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "permissionBump", - "type": "u8" - } - ] - } - }, - { - "name": "OracleInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": "bytes" - }, - { - "name": "metadata", - "type": "bytes" - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "oracleBump", - "type": "u8" - } - ] - } - }, - { - "name": "OracleQueueInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "name", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "metadata", - "type": { - "array": ["u8", 64] - } - }, - { - "name": "reward", - "type": "u64" - }, - { - "name": "minStake", - "type": "u64" - }, - { - "name": "feedProbationPeriod", - "type": "u32" - }, - { - "name": "oracleTimeout", - "type": "u32" - }, - { - "name": "slashingEnabled", - "type": "bool" - }, - { - "name": "varianceToleranceMultiplier", - "type": { - "defined": "BorshDecimal" - } - }, - { - "name": "consecutiveFeedFailureLimit", - "type": "u64" - }, - { - "name": "consecutiveOracleFailureLimit", - "type": "u64" - }, - { - "name": "queueSize", - "type": "u32" - }, - { - "name": "unpermissionedFeeds", - "type": "bool" - }, - { - "name": "unpermissionedVrf", - "type": "bool" - }, - { - "name": "enableBufferRelayers", - "type": "bool" - } - ] - } - }, - { - "name": "OracleQueueSetRewardsParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "rewards", - "type": "u64" - } - ] - } - }, - { - "name": "OracleQueueVrfConfigParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "unpermissionedVrfEnabled", - "type": "bool" - } - ] - } - }, - { - "name": "OracleWithdrawParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "permissionBump", - "type": "u8" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "PermissionInitParams", - "type": { - "kind": "struct", - "fields": [] - } - }, - { - "name": "PermissionSetParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "permission", - "type": { - "defined": "SwitchboardPermission" - } - }, - { - "name": "enable", - "type": "bool" - } - ] - } - }, - { - "name": "PermissionSetVoterWeightParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - } - ] - } - }, - { - "name": "ProgramConfigParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "token", - "type": "publicKey" - }, - { - "name": "bump", - "type": "u8" - }, - { - "name": "daoMint", - "type": "publicKey" - } - ] - } - }, - { - "name": "ProgramInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - } - ] - } - }, - { - "name": "VaultTransferParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "amount", - "type": "u64" - } - ] - } - }, - { - "name": "VrfInitParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "callback", - "type": { - "defined": "Callback" - } - }, - { - "name": "stateBump", - "type": "u8" - } - ] - } - }, - { - "name": "VrfProveParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "proof", - "type": "bytes" - }, - { - "name": "idx", - "type": "u32" - } - ] - } - }, - { - "name": "VrfProveAndVerifyParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "nonce", - "type": { - "option": "u32" - } - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "idx", - "type": "u32" - }, - { - "name": "proof", - "type": "bytes" - } - ] - } - }, - { - "name": "VrfRequestRandomnessParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "permissionBump", - "type": "u8" - }, - { - "name": "stateBump", - "type": "u8" - } - ] - } - }, - { - "name": "VrfVerifyParams", - "type": { - "kind": "struct", - "fields": [ - { - "name": "nonce", - "type": { - "option": "u32" - } - }, - { - "name": "stateBump", - "type": "u8" - }, - { - "name": "idx", - "type": "u32" - } - ] - } - }, - { - "name": "Callback", - "type": { - "kind": "struct", - "fields": [ - { - "name": "programId", - "type": "publicKey" - }, - { - "name": "accounts", - "type": { - "vec": { - "defined": "AccountMetaBorsh" - } - } - }, - { - "name": "ixData", - "type": "bytes" - } - ] - } - }, - { - "name": "EcvrfProofZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "gamma", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "c", - "type": { - "defined": "Scalar" - } - }, - { - "name": "s", - "type": { - "defined": "Scalar" - } - } - ] - } - }, - { - "name": "Scalar", - "type": { - "kind": "struct", - "fields": [ - { - "name": "bytes", - "type": { - "array": ["u8", 32] - } - } - ] - } - }, - { - "name": "FieldElementZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "bytes", - "type": { - "array": ["u64", 5] - } - } - ] - } - }, - { - "name": "CompletedPointZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "x", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "y", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "z", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "t", - "type": { - "defined": "FieldElementZC" - } - } - ] - } - }, - { - "name": "EdwardsPointZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "x", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "y", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "z", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "t", - "type": { - "defined": "FieldElementZC" - } - } - ] - } - }, - { - "name": "ProjectivePointZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "x", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "y", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "z", - "type": { - "defined": "FieldElementZC" - } - } - ] - } - }, - { - "name": "EcvrfIntermediate", - "type": { - "kind": "struct", - "fields": [ - { - "name": "r", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "nS", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "d", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "t13", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "t15", - "type": { - "defined": "FieldElementZC" - } - } - ] - } - }, - { - "name": "Hash", - "type": { - "kind": "struct", - "fields": [ - { - "name": "data", - "type": { - "array": ["u8", 32] - } - } - ] - } - }, - { - "name": "AggregatorRound", - "type": { - "kind": "struct", - "fields": [ - { - "name": "numSuccess", - "type": "u32" - }, - { - "name": "numError", - "type": "u32" - }, - { - "name": "isClosed", - "type": "bool" - }, - { - "name": "roundOpenSlot", - "type": "u64" - }, - { - "name": "roundOpenTimestamp", - "type": "i64" - }, - { - "name": "result", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "stdDeviation", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "minResponse", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "maxResponse", - "type": { - "defined": "SwitchboardDecimal" - } - }, - { - "name": "oraclePubkeysData", - "type": { - "array": ["publicKey", 16] - } - }, - { - "name": "mediansData", - "type": { - "array": [ - { - "defined": "SwitchboardDecimal" - }, - 16 - ] - } - }, - { - "name": "currentPayout", - "type": { - "array": ["i64", 16] - } - }, - { - "name": "mediansFulfilled", - "type": { - "array": ["bool", 16] - } - }, - { - "name": "errorsFulfilled", - "type": { - "array": ["bool", 16] - } - } - ] - } - }, - { - "name": "AggregatorHistoryRow", - "type": { - "kind": "struct", - "fields": [ - { - "name": "timestamp", - "type": "i64" - }, - { - "name": "value", - "type": { - "defined": "SwitchboardDecimal" - } - } - ] - } - }, - { - "name": "SwitchboardDecimal", - "type": { - "kind": "struct", - "fields": [ - { - "name": "mantissa", - "type": "i128" - }, - { - "name": "scale", - "type": "u32" - } - ] - } - }, - { - "name": "CrankRow", - "type": { - "kind": "struct", - "fields": [ - { - "name": "pubkey", - "type": "publicKey" - }, - { - "name": "nextTimestamp", - "type": "i64" - } - ] - } - }, - { - "name": "OracleMetrics", - "type": { - "kind": "struct", - "fields": [ - { - "name": "consecutiveSuccess", - "type": "u64" - }, - { - "name": "consecutiveError", - "type": "u64" - }, - { - "name": "consecutiveDisagreement", - "type": "u64" - }, - { - "name": "consecutiveLateResponse", - "type": "u64" - }, - { - "name": "consecutiveFailure", - "type": "u64" - }, - { - "name": "totalSuccess", - "type": "u128" - }, - { - "name": "totalError", - "type": "u128" - }, - { - "name": "totalDisagreement", - "type": "u128" - }, - { - "name": "totalLateResponse", - "type": "u128" - } - ] - } - }, - { - "name": "VrfBuilder", - "type": { - "kind": "struct", - "fields": [ - { - "name": "producer", - "type": "publicKey" - }, - { - "name": "status", - "type": { - "defined": "VrfStatus" - } - }, - { - "name": "reprProof", - "type": { - "array": ["u8", 80] - } - }, - { - "name": "proof", - "type": { - "defined": "EcvrfProofZC" - } - }, - { - "name": "yPoint", - "type": "publicKey" - }, - { - "name": "stage", - "type": "u32" - }, - { - "name": "stage1Out", - "type": { - "defined": "EcvrfIntermediate" - } - }, - { - "name": "r1", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "r2", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "stage3Out", - "type": { - "defined": "EcvrfIntermediate" - } - }, - { - "name": "hPoint", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "sReduced", - "type": { - "defined": "Scalar" - } - }, - { - "name": "yPointBuilder", - "type": { - "array": [ - { - "defined": "FieldElementZC" - }, - 3 - ] - } - }, - { - "name": "yRistrettoPoint", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "mulRound", - "type": "u8" - }, - { - "name": "hashPointsRound", - "type": "u8" - }, - { - "name": "mulTmp1", - "type": { - "defined": "CompletedPointZC" - } - }, - { - "name": "uPoint1", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "uPoint2", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "vPoint1", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "vPoint2", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "uPoint", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "vPoint", - "type": { - "defined": "EdwardsPointZC" - } - }, - { - "name": "u1", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "u2", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "invertee", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "y", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "z", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "p1Bytes", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "p2Bytes", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "p3Bytes", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "p4Bytes", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "cPrimeHashbuf", - "type": { - "array": ["u8", 16] - } - }, - { - "name": "m1", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "m2", - "type": { - "defined": "FieldElementZC" - } - }, - { - "name": "txRemaining", - "type": "u32" - }, - { - "name": "verified", - "type": "bool" - }, - { - "name": "result", - "type": { - "array": ["u8", 32] - } - } - ] - } - }, - { - "name": "AccountMetaZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "pubkey", - "type": "publicKey" - }, - { - "name": "isSigner", - "type": "bool" - }, - { - "name": "isWritable", - "type": "bool" - } - ] - } - }, - { - "name": "AccountMetaBorsh", - "type": { - "kind": "struct", - "fields": [ - { - "name": "pubkey", - "type": "publicKey" - }, - { - "name": "isSigner", - "type": "bool" - }, - { - "name": "isWritable", - "type": "bool" - } - ] - } - }, - { - "name": "CallbackZC", - "type": { - "kind": "struct", - "fields": [ - { - "name": "programId", - "type": "publicKey" - }, - { - "name": "accounts", - "type": { - "array": [ - { - "defined": "AccountMetaZC" - }, - 32 - ] - } - }, - { - "name": "accountsLen", - "type": "u32" - }, - { - "name": "ixData", - "type": { - "array": ["u8", 1024] - } - }, - { - "name": "ixDataLen", - "type": "u32" - } - ] - } - }, - { - "name": "VrfRound", - "type": { - "kind": "struct", - "fields": [ - { - "name": "alpha", - "type": { - "array": ["u8", 256] - } - }, - { - "name": "alphaLen", - "type": "u32" - }, - { - "name": "requestSlot", - "type": "u64" - }, - { - "name": "requestTimestamp", - "type": "i64" - }, - { - "name": "result", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "numVerified", - "type": "u32" - }, - { - "name": "ebuf", - "type": { - "array": ["u8", 256] - } - } - ] - } - }, - { - "name": "BufferRelayerRound", - "type": { - "kind": "struct", - "fields": [ - { - "name": "numSuccess", - "type": "u32" - }, - { - "name": "numError", - "type": "u32" - }, - { - "name": "roundOpenSlot", - "type": "u64" - }, - { - "name": "roundOpenTimestamp", - "type": "i64" - }, - { - "name": "oraclePubkey", - "type": "publicKey" - } - ] - } - }, - { - "name": "BorshDecimal", - "type": { - "kind": "struct", - "fields": [ - { - "name": "mantissa", - "type": "i128" - }, - { - "name": "scale", - "type": "u32" - } - ] - } - }, - { - "name": "Lanes", - "type": { - "kind": "enum", - "variants": [ - { - "name": "C" - }, - { - "name": "D" - }, - { - "name": "AB" - }, - { - "name": "AC" - }, - { - "name": "CD" - }, - { - "name": "AD" - }, - { - "name": "BC" - }, - { - "name": "ABCD" - } - ] - } - }, - { - "name": "Shuffle", - "type": { - "kind": "enum", - "variants": [ - { - "name": "AAAA" - }, - { - "name": "BBBB" - }, - { - "name": "CACA" - }, - { - "name": "DBBD" - }, - { - "name": "ADDA" - }, - { - "name": "CBCB" - }, - { - "name": "ABAB" - }, - { - "name": "BADC" - }, - { - "name": "BACD" - }, - { - "name": "ABDC" - } - ] - } - }, - { - "name": "Shuffle", - "type": { - "kind": "enum", - "variants": [ - { - "name": "AAAA" - }, - { - "name": "BBBB" - }, - { - "name": "BADC" - }, - { - "name": "BACD" - }, - { - "name": "ADDA" - }, - { - "name": "CBCB" - }, - { - "name": "ABDC" - }, - { - "name": "ABAB" - }, - { - "name": "DBBD" - }, - { - "name": "CACA" - } - ] - } - }, - { - "name": "Lanes", - "type": { - "kind": "enum", - "variants": [ - { - "name": "D" - }, - { - "name": "C" - }, - { - "name": "AB" - }, - { - "name": "AC" - }, - { - "name": "AD" - }, - { - "name": "BCD" - } - ] - } - }, - { - "name": "Error", - "type": { - "kind": "enum", - "variants": [ - { - "name": "InvalidPublicKey" - }, - { - "name": "SerializationError", - "fields": [ - { - "defined": "bincode::Error" - } - ] - }, - { - "name": "DeserializationError", - "fields": [ - { - "defined": "bincode::Error" - } - ] - }, - { - "name": "InvalidDataError" - } - ] - } - }, - { - "name": "SwitchboardPermission", - "type": { - "kind": "enum", - "variants": [ - { - "name": "PermitOracleHeartbeat" - }, - { - "name": "PermitOracleQueueUsage" - }, - { - "name": "PermitVrfRequests" - } - ] - } - }, - { - "name": "OracleResponseType", - "type": { - "kind": "enum", - "variants": [ - { - "name": "TypeSuccess" - }, - { - "name": "TypeError" - }, - { - "name": "TypeDisagreement" - }, - { - "name": "TypeNoResponse" - } - ] - } - }, - { - "name": "VrfStatus", - "type": { - "kind": "enum", - "variants": [ - { - "name": "StatusNone" - }, - { - "name": "StatusRequesting" - }, - { - "name": "StatusVerifying" - }, - { - "name": "StatusVerified" - }, - { - "name": "StatusCallbackSuccess" - }, - { - "name": "StatusVerifyFailure" - } - ] - } - } - ], - "events": [ - { - "name": "AggregatorInitEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "VrfRequestRandomnessEvent", - "fields": [ - { - "name": "vrfPubkey", - "type": "publicKey", - "index": true - }, - { - "name": "oraclePubkeys", - "type": { - "vec": "publicKey" - }, - "index": false - }, - { - "name": "loadAmount", - "type": "u64", - "index": false - }, - { - "name": "existingAmount", - "type": "u64", - "index": false - } - ] - }, - { - "name": "VrfRequestEvent", - "fields": [ - { - "name": "vrfPubkey", - "type": "publicKey", - "index": true - }, - { - "name": "oraclePubkeys", - "type": { - "vec": "publicKey" - }, - "index": false - } - ] - }, - { - "name": "VrfProveEvent", - "fields": [ - { - "name": "vrfPubkey", - "type": "publicKey", - "index": true - }, - { - "name": "oraclePubkey", - "type": "publicKey", - "index": true - }, - { - "name": "authorityPubkey", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "VrfVerifyEvent", - "fields": [ - { - "name": "vrfPubkey", - "type": "publicKey", - "index": true - }, - { - "name": "oraclePubkey", - "type": "publicKey", - "index": true - }, - { - "name": "authorityPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "amount", - "type": "u64", - "index": false - } - ] - }, - { - "name": "VrfCallbackPerformedEvent", - "fields": [ - { - "name": "vrfPubkey", - "type": "publicKey", - "index": true - }, - { - "name": "oraclePubkey", - "type": "publicKey", - "index": true - }, - { - "name": "amount", - "type": "u64", - "index": false - } - ] - }, - { - "name": "AggregatorOpenRoundEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "oraclePubkeys", - "type": { - "vec": "publicKey" - }, - "index": false - }, - { - "name": "jobPubkeys", - "type": { - "vec": "publicKey" - }, - "index": false - }, - { - "name": "remainingFunds", - "type": "u64", - "index": false - }, - { - "name": "queueAuthority", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "AggregatorValueUpdateEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "value", - "type": { - "defined": "BorshDecimal" - }, - "index": false - }, - { - "name": "slot", - "type": "u64", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - }, - { - "name": "oraclePubkeys", - "type": { - "vec": "publicKey" - }, - "index": false - }, - { - "name": "oracleValues", - "type": { - "vec": { - "defined": "BorshDecimal" - } - }, - "index": false - } - ] - }, - { - "name": "OracleRewardEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "leasePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "oraclePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "walletPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "amount", - "type": "u64", - "index": false - }, - { - "name": "roundSlot", - "type": "u64", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "OracleWithdrawEvent", - "fields": [ - { - "name": "oraclePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "walletPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "destinationWallet", - "type": "publicKey", - "index": false - }, - { - "name": "previousAmount", - "type": "u64", - "index": false - }, - { - "name": "newAmount", - "type": "u64", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "LeaseWithdrawEvent", - "fields": [ - { - "name": "leasePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "walletPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "previousAmount", - "type": "u64", - "index": false - }, - { - "name": "newAmount", - "type": "u64", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "OracleSlashEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "leasePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "oraclePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "walletPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "amount", - "type": "u64", - "index": false - }, - { - "name": "roundSlot", - "type": "u64", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "LeaseFundEvent", - "fields": [ - { - "name": "leasePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "funder", - "type": "publicKey", - "index": false - }, - { - "name": "amount", - "type": "u64", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "ProbationBrokenEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "queuePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "FeedPermissionRevokedEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "GarbageCollectFailureEvent", - "fields": [ - { - "name": "queuePubkey", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "OracleBootedEvent", - "fields": [ - { - "name": "queuePubkey", - "type": "publicKey", - "index": false - }, - { - "name": "oraclePubkey", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "AggregatorCrankEvictionEvent", - "fields": [ - { - "name": "crankPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "aggregatorPubkey", - "type": "publicKey", - "index": true - }, - { - "name": "reason", - "type": { - "option": "u32" - }, - "index": false - }, - { - "name": "timestamp", - "type": "i64", - "index": false - } - ] - }, - { - "name": "CrankLeaseInsufficientFundsEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "leasePubkey", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "CrankPopExpectedFailureEvent", - "fields": [ - { - "name": "feedPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "leasePubkey", - "type": "publicKey", - "index": false - } - ] - }, - { - "name": "BufferRelayerOpenRoundEvent", - "fields": [ - { - "name": "relayerPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "jobPubkey", - "type": "publicKey", - "index": false - }, - { - "name": "oraclePubkeys", - "type": { - "vec": "publicKey" - }, - "index": false - }, - { - "name": "remainingFunds", - "type": "u64", - "index": false - }, - { - "name": "queue", - "type": "publicKey", - "index": false - } - ] - } - ], - "errors": [ - { - "code": 6000, - "name": "ArrayOperationError", - "msg": "Illegal operation on a Switchboard array." - }, - { - "code": 6001, - "name": "QueueOperationError", - "msg": "Illegal operation on a Switchboard queue." - }, - { - "code": 6002, - "name": "IncorrectProgramOwnerError", - "msg": "An account required to be owned by the program has a different owner." - }, - { - "code": 6003, - "name": "InvalidAggregatorRound", - "msg": "Aggregator is not currently populated with a valid round." - }, - { - "code": 6004, - "name": "TooManyAggregatorJobs", - "msg": "Aggregator cannot fit any more jobs." - }, - { - "code": 6005, - "name": "AggregatorCurrentRoundClosed", - "msg": "Aggregator's current round is closed. No results are being accepted." - }, - { - "code": 6006, - "name": "AggregatorInvalidSaveResult", - "msg": "Aggregator received an invalid save result instruction." - }, - { - "code": 6007, - "name": "InvalidStrDecimalConversion", - "msg": "Failed to convert string to decimal format." - }, - { - "code": 6008, - "name": "AccountLoaderMissingSignature", - "msg": "AccountLoader account is missing a required signature." - }, - { - "code": 6009, - "name": "MissingRequiredSignature", - "msg": "Account is missing a required signature." - }, - { - "code": 6010, - "name": "ArrayOverflowError", - "msg": "The attempted action will overflow a zero-copy account array." - }, - { - "code": 6011, - "name": "ArrayUnderflowError", - "msg": "The attempted action will underflow a zero-copy account array." - }, - { - "code": 6012, - "name": "PubkeyNotFoundError", - "msg": "The queried public key was not found." - }, - { - "code": 6013, - "name": "AggregatorIllegalRoundOpenCall", - "msg": "Aggregator round open called too early." - }, - { - "code": 6014, - "name": "AggregatorIllegalRoundCloseCall", - "msg": "Aggregator round close called too early." - }, - { - "code": 6015, - "name": "AggregatorClosedError", - "msg": "Aggregator is closed. Illegal action." - }, - { - "code": 6016, - "name": "IllegalOracleIdxError", - "msg": "Illegal oracle index." - }, - { - "code": 6017, - "name": "OracleAlreadyRespondedError", - "msg": "The provided oracle has already responded this round." - }, - { - "code": 6018, - "name": "ProtoDeserializeError", - "msg": "Failed to deserialize protocol buffer." - }, - { - "code": 6019, - "name": "UnauthorizedStateUpdateError", - "msg": "Unauthorized program state modification attempted." - }, - { - "code": 6020, - "name": "MissingOracleAccountsError", - "msg": "Not enough oracle accounts provided to closeRounds." - }, - { - "code": 6021, - "name": "OracleMismatchError", - "msg": "An unexpected oracle account was provided for the transaction." - }, - { - "code": 6022, - "name": "CrankMaxCapacityError", - "msg": "Attempted to push to a Crank that's at capacity" - }, - { - "code": 6023, - "name": "AggregatorLeaseInsufficientFunds", - "msg": "Aggregator update call attempted but attached lease has insufficient funds." - }, - { - "code": 6024, - "name": "IncorrectTokenAccountMint", - "msg": "The provided token account does not point to the Switchboard token mint." - }, - { - "code": 6025, - "name": "InvalidEscrowAccount", - "msg": "An invalid escrow account was provided." - }, - { - "code": 6026, - "name": "CrankEmptyError", - "msg": "Crank empty. Pop failed." - }, - { - "code": 6027, - "name": "PdaDeriveError", - "msg": "Failed to derive a PDA from the provided seed." - }, - { - "code": 6028, - "name": "AggregatorAccountNotFound", - "msg": "Aggregator account missing from provided account list." - }, - { - "code": 6029, - "name": "PermissionAccountNotFound", - "msg": "Permission account missing from provided account list." - }, - { - "code": 6030, - "name": "LeaseAccountDeriveFailure", - "msg": "Failed to derive a lease account." - }, - { - "code": 6031, - "name": "PermissionAccountDeriveFailure", - "msg": "Failed to derive a permission account." - }, - { - "code": 6032, - "name": "EscrowAccountNotFound", - "msg": "Escrow account missing from provided account list." - }, - { - "code": 6033, - "name": "LeaseAccountNotFound", - "msg": "Lease account missing from provided account list." - }, - { - "code": 6034, - "name": "DecimalConversionError", - "msg": "Decimal conversion method failed." - }, - { - "code": 6035, - "name": "PermissionDenied", - "msg": "Permission account is missing required flags for the given action." - }, - { - "code": 6036, - "name": "QueueAtCapacity", - "msg": "Oracle queue is at lease capacity." - }, - { - "code": 6037, - "name": "ExcessiveCrankRowsError", - "msg": "Data feed is already pushed on a crank." - }, - { - "code": 6038, - "name": "AggregatorLockedError", - "msg": "Aggregator is locked, no setting modifications or job additions allowed." - }, - { - "code": 6039, - "name": "AggregatorInvalidBatchSizeError", - "msg": "Aggregator invalid batch size." - }, - { - "code": 6040, - "name": "AggregatorJobChecksumMismatch", - "msg": "Oracle provided an incorrect aggregator job checksum." - }, - { - "code": 6041, - "name": "IntegerOverflowError", - "msg": "An integer overflow occurred." - }, - { - "code": 6042, - "name": "InvalidUpdatePeriodError", - "msg": "Minimum update period is 5 seconds." - }, - { - "code": 6043, - "name": "NoResultsError", - "msg": "Aggregator round evaluation attempted with no results." - }, - { - "code": 6044, - "name": "InvalidExpirationError", - "msg": "An expiration constraint was broken." - }, - { - "code": 6045, - "name": "InsufficientStakeError", - "msg": "An account provided insufficient stake for action." - }, - { - "code": 6046, - "name": "LeaseInactiveError", - "msg": "The provided lease account is not active." - }, - { - "code": 6047, - "name": "NoAggregatorJobsFound", - "msg": "No jobs are currently included in the aggregator." - }, - { - "code": 6048, - "name": "IntegerUnderflowError", - "msg": "An integer underflow occurred." - }, - { - "code": 6049, - "name": "OracleQueueMismatch", - "msg": "An invalid oracle queue account was provided." - }, - { - "code": 6050, - "name": "OracleWalletMismatchError", - "msg": "An unexpected oracle wallet account was provided for the transaction." - }, - { - "code": 6051, - "name": "InvalidBufferAccountError", - "msg": "An invalid buffer account was provided." - }, - { - "code": 6052, - "name": "InsufficientOracleQueueError", - "msg": "Insufficient oracle queue size." - }, - { - "code": 6053, - "name": "InvalidAuthorityError", - "msg": "Invalid authority account provided." - }, - { - "code": 6054, - "name": "InvalidTokenAccountMintError", - "msg": "A provided token wallet is associated with an incorrect mint." - }, - { - "code": 6055, - "name": "ExcessiveLeaseWithdrawlError", - "msg": "You must leave enough funds to perform at least 1 update in the lease." - }, - { - "code": 6056, - "name": "InvalideHistoryAccountError", - "msg": "Invalid history account provided." - }, - { - "code": 6057, - "name": "InvalidLeaseAccountEscrowError", - "msg": "Invalid lease account escrow." - }, - { - "code": 6058, - "name": "InvalidCrankAccountError", - "msg": "Invalid crank provided." - }, - { - "code": 6059, - "name": "CrankNoElementsReadyError", - "msg": "No elements ready to be popped." - }, - { - "code": 6060, - "name": "IndexOutOfBoundsError", - "msg": "Index out of bounds" - }, - { - "code": 6061, - "name": "VrfInvalidRequestError", - "msg": "Invalid vrf request params" - }, - { - "code": 6062, - "name": "VrfInvalidProofSubmissionError", - "msg": "Vrf proof failed to verify" - }, - { - "code": 6063, - "name": "VrfVerifyError", - "msg": "Error in verifying vrf proof." - }, - { - "code": 6064, - "name": "VrfCallbackError", - "msg": "Vrf callback function failed." - }, - { - "code": 6065, - "name": "VrfCallbackParamsError", - "msg": "Invalid vrf callback params provided." - }, - { - "code": 6066, - "name": "VrfCallbackAlreadyCalledError", - "msg": "Vrf callback has already been triggered." - }, - { - "code": 6067, - "name": "VrfInvalidPubkeyError", - "msg": "The provided pubkey is invalid to use in ecvrf proofs" - }, - { - "code": 6068, - "name": "VrfTooManyVerifyCallsError", - "msg": "Number of required verify calls exceeded" - }, - { - "code": 6069, - "name": "VrfRequestAlreadyLaunchedError", - "msg": "Vrf request is already pending" - }, - { - "code": 6070, - "name": "VrfInsufficientVerificationError", - "msg": "Insufficient amount of proofs collected for VRF callback" - }, - { - "code": 6071, - "name": "InvalidVrfProducerError", - "msg": "An incorrect oracle attempted to submit a proof" - }, - { - "code": 6072, - "name": "InvalidGovernancePidError", - "msg": "Invalid SPLGovernance Account Supplied" - }, - { - "code": 6073, - "name": "InvalidGovernanceAccountError", - "msg": "An Invalid Governance Account was supplied" - }, - { - "code": 6074, - "name": "MissingOptionalAccount", - "msg": "Expected an optional account" - }, - { - "code": 6075, - "name": "InvalidSpawnRecordOwner", - "msg": "Invalid Owner for Spawn Record" - }, - { - "code": 6076, - "name": "NoopError", - "msg": "Noop error" - }, - { - "code": 6077, - "name": "MissingRequiredAccountsError", - "msg": "A required instruction account was not included" - }, - { - "code": 6078, - "name": "InvalidMintError", - "msg": "Invalid mint account passed for instruction" - }, - { - "code": 6079, - "name": "InvalidTokenAccountKeyError", - "msg": "An invalid token account was passed into the instruction" - }, - { - "code": 6080, - "name": "InvalidJobAccountError", - "msg": "" - }, - { - "code": 6081, - "name": "VoterStakeRegistryError", - "msg": "" - }, - { - "code": 6082, - "name": "AccountDiscriminatorMismatch", - "msg": "Account discriminator did not match." - } - ], - "metadata": { - "address": "7PMP6yE6qb3XzBQr5TK2GhuruYayZzBnT8U92ySaLESC" - } -} diff --git a/actions/switchboardRefreshVoterWeight.ts b/actions/switchboardRefreshVoterWeight.ts deleted file mode 100644 index 366be1775f..0000000000 --- a/actions/switchboardRefreshVoterWeight.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Transaction } from '@solana/web3.js' -import { sendTransaction } from '@utils/send' - -export const sbRefreshWeight = async ( - voterWeightInstructions, - connection, - wallet -) => { - /*const voterWeightInstructions = useSwitchboardPluginStore((s) => s.state.instructions); - const connection = useLegacyConnectionContext() - const wallet = useWalletOnePointOh()*/ - - const transaction = new Transaction().add(voterWeightInstructions) - - await sendTransaction({ - transaction: transaction, - wallet: wallet, - signers: [], - connection: connection.current, - }) -} diff --git a/components/ProposalVotingPower/getNumTokens.ts b/components/ProposalVotingPower/getNumTokens.ts index 9d2d29531c..37cad87d77 100644 --- a/components/ProposalVotingPower/getNumTokens.ts +++ b/components/ProposalVotingPower/getNumTokens.ts @@ -6,7 +6,6 @@ import { getMintDecimalAmount } from '@tools/sdk/units' import type { VoteRegistryVoterWeight, VoteNftWeight, - SwitchboardQueueVoteWeight, SimpleGatedVoterWeight, VoterWeight, } from '../../models/voteWeights' @@ -15,7 +14,6 @@ import type { RealmInfo } from '../../models/registry/api' type OwnVoterWeight = | VoteRegistryVoterWeight | VoteNftWeight - | SwitchboardQueueVoteWeight | SimpleGatedVoterWeight | VoterWeight diff --git a/components/ProposalVotingPower/index.tsx b/components/ProposalVotingPower/index.tsx index ae8dba538d..9979835c7c 100644 --- a/components/ProposalVotingPower/index.tsx +++ b/components/ProposalVotingPower/index.tsx @@ -1,9 +1,6 @@ import classNames from 'classnames' -import { - GATEWAY_PLUGINS_PKS, - SWITCHBOARD_PLUGINS_PKS, -} from '@constants/plugins' +import { GATEWAY_PLUGINS_PKS } from '@constants/plugins' import TokenBalanceCardWrapper from '@components/TokenBalance/TokenBalanceCardWrapper' import { option } from '@tools/core/option' @@ -25,11 +22,7 @@ export default function ProposalVotingPower(props: Props) { const isUsingGatewayPlugin = currentPluginPk && GATEWAY_PLUGINS_PKS.includes(currentPluginPk.toBase58()) - const isUsingSwitchboardPlugin = - currentPluginPk && - SWITCHBOARD_PLUGINS_PKS.includes(currentPluginPk.toBase58()) - - if (isUsingGatewayPlugin || isUsingSwitchboardPlugin) { + if (isUsingGatewayPlugin) { return } diff --git a/components/TokenBalance/SwitchboardPermissionCard.tsx b/components/TokenBalance/SwitchboardPermissionCard.tsx deleted file mode 100644 index f05c394a91..0000000000 --- a/components/TokenBalance/SwitchboardPermissionCard.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import Button from '@components/Button' -//import Loading from '@components/Loading' -//import NFTSelector from '@components/NFTS/NFTSelector' -import { ChevronRightIcon } from '@heroicons/react/outline' -import useQueryContext from '@hooks/useQueryContext' -import useRealm from '@hooks/useRealm' -import useWalletOnePointOh from '@hooks/useWalletOnePointOh' -import { getTokenOwnerRecordAddress } from '@solana/spl-governance' -import Link from 'next/link' -import { useState, useEffect } from 'react' -import useSwitchboardPluginStore from 'SwitchboardVotePlugin/store/switchboardStore' -import { sbRefreshWeight } from '../../actions/switchboardRefreshVoterWeight' -import { useRealmQuery } from '@hooks/queries/realm' -import useLegacyConnectionContext from '@hooks/useLegacyConnectionContext' - -const SwitchboardPermissionCard = () => { - const { fmtUrlWithCluster } = useQueryContext() - const wallet = useWalletOnePointOh() - const connected = !!wallet?.connected - - const switchboardVoterWeight = useSwitchboardPluginStore( - (s) => s.state.votingPower - ) - const switchboardRefreshInstructions = useSwitchboardPluginStore( - (s) => s.state.instructions - ) - - const [tokenOwnerRecordPk, setTokenOwneRecordPk] = useState('') - const realm = useRealmQuery().data?.result - const { symbol } = useRealm() - const connection = useLegacyConnectionContext() - - useEffect(() => { - const getTokenOwnerRecord = async () => { - const defaultMint = realm!.account.communityMint - const tokenOwnerRecordAddress = await getTokenOwnerRecordAddress( - realm!.owner, - realm!.pubkey, - defaultMint!, - wallet!.publicKey! - ) - setTokenOwneRecordPk(tokenOwnerRecordAddress.toBase58()) - } - if (realm && wallet?.connected) { - getTokenOwnerRecord() - } - // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO please fix, it can cause difficult bugs. You might wanna check out https://bobbyhadz.com/blog/react-hooks-exhaustive-deps for info. -@asktree - }, [realm?.pubkey.toBase58(), wallet?.connected]) - return ( - <> -
-

Your Queue Voting Rights:

- - - View - - - -
-
- {(() => { - if (switchboardVoterWeight.isZero()) { - return You do not have voting rights - } else { - return You have voting rights! - } - })()} -
- - - ) -} -export default SwitchboardPermissionCard diff --git a/components/TokenBalance/TokenBalanceCardWrapper.tsx b/components/TokenBalance/TokenBalanceCardWrapper.tsx index ade79b6a7f..529795c4c6 100644 --- a/components/TokenBalance/TokenBalanceCardWrapper.tsx +++ b/components/TokenBalance/TokenBalanceCardWrapper.tsx @@ -4,11 +4,7 @@ import useRealm from '@hooks/useRealm' import dynamic from 'next/dynamic' import { ChevronRightIcon } from '@heroicons/react/solid' import useQueryContext from '@hooks/useQueryContext' -import { - GATEWAY_PLUGINS_PKS, - NFT_PLUGINS_PKS, - SWITCHBOARD_PLUGINS_PKS, -} from '@constants/plugins' +import { GATEWAY_PLUGINS_PKS, NFT_PLUGINS_PKS } from '@constants/plugins' import GatewayCard from '@components/Gateway/GatewayCard' import ClaimUnreleasedNFTs from './ClaimUnreleasedNFTs' import Link from 'next/link' @@ -39,10 +35,6 @@ const TokenBalanceCard = dynamic(() => import('./TokenBalanceCard')) const NftVotingPower = dynamic( () => import('../ProposalVotingPower/NftVotingPower') ) -// const NftBalanceCard = dynamic(() => import('./NftBalanceCard')) -const SwitchboardPermissionCard = dynamic( - () => import('./SwitchboardPermissionCard') -) const GovernancePowerTitle = () => { const { symbol } = useRealm() @@ -87,9 +79,6 @@ const TokenBalanceCardInner = ({ currentPluginPk && NFT_PLUGINS_PKS.includes(currentPluginPk?.toBase58()) const isGatewayMode = currentPluginPk && GATEWAY_PLUGINS_PKS.includes(currentPluginPk?.toBase58()) - const isSwitchboardMode = - currentPluginPk && - SWITCHBOARD_PLUGINS_PKS.includes(currentPluginPk?.toBase58()) if ( vsrMode === 'default' && @@ -143,13 +132,7 @@ const TokenBalanceCardInner = ({ ) } - if ( - isSwitchboardMode && - (!ownTokenRecord || - ownTokenRecord.account.governingTokenDepositAmount.isZero()) - ) { - return - } + //Default return ( <> diff --git a/constants/plugins.ts b/constants/plugins.ts index e1513b1880..b3e5733bd9 100644 --- a/constants/plugins.ts +++ b/constants/plugins.ts @@ -1,4 +1,3 @@ -import { SWITCHBOARD_ADDIN_ID } from 'SwitchboardVotePlugin/SwitchboardQueueVoterClient' import * as heliumVsrSdk from '@helium/voter-stake-registry-sdk' import { DEFAULT_NFT_VOTER_PLUGIN } from '@tools/constants' @@ -22,8 +21,4 @@ export const NFT_PLUGINS_PKS: string[] = [ export const GATEWAY_PLUGINS_PKS: string[] = [ 'Ggatr3wgDLySEwA2qEjt1oiw4BUzp5yMLJyz21919dq6', 'GgathUhdrCWRHowoRKACjgWhYHfxCEdBi5ViqYN6HVxk', // v2, supporting composition -] - -export const SWITCHBOARD_PLUGINS_PKS: string[] = [ - SWITCHBOARD_ADDIN_ID.toBase58(), -] +] \ No newline at end of file diff --git a/hooks/useGovernanceAssets.ts b/hooks/useGovernanceAssets.ts index 1e171e4c1a..e71469bf7b 100644 --- a/hooks/useGovernanceAssets.ts +++ b/hooks/useGovernanceAssets.ts @@ -817,14 +817,6 @@ export default function useGovernanceAssets() { ███████ ███ ███ ██ ██ ██████ ██ ██ ██████ ██████ ██ ██ ██ ██ ██████ */ - [Instructions.SwitchboardAdmitOracle]: { - name: 'Admit Oracle to Queue', - packageId: PackageEnum.Switchboard, - }, - [Instructions.SwitchboardRevokeOracle]: { - name: 'Remove Oracle from Queue', - packageId: PackageEnum.Switchboard, - }, [Instructions.SwitchboardFundOracle]: { name: 'Fund Oracle', packageId: PackageEnum.Switchboard, diff --git a/hooks/useRealm.tsx b/hooks/useRealm.tsx index 5c5271a80d..88e44117fc 100644 --- a/hooks/useRealm.tsx +++ b/hooks/useRealm.tsx @@ -6,24 +6,20 @@ import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore' import { SimpleGatedVoterWeight, VoteNftWeight, - SwitchboardQueueVoteWeight, VoteRegistryVoterWeight, VoterWeight, } from '../models/voteWeights' import { NFT_PLUGINS_PKS, VSR_PLUGIN_PKS, - SWITCHBOARD_PLUGINS_PKS, GATEWAY_PLUGINS_PKS, HELIUM_VSR_PLUGINS_PKS, } from '../constants/plugins' import useGatewayPluginStore from '../GatewayPlugin/store/gatewayPluginStore' -import useSwitchboardPluginStore from 'SwitchboardVotePlugin/store/switchboardStore' import useHeliumVsrStore from 'HeliumVotePlugin/hooks/useHeliumVsrStore' import { BN } from '@coral-xyz/anchor' import { PublicKey } from '@solana/web3.js' import { useVsrMode } from './useVsrMode' -import useWalletOnePointOh from './useWalletOnePointOh' import { useRealmQuery } from './queries/realm' import { useUserCommunityTokenOwnerRecord, @@ -44,8 +40,6 @@ export default function useRealm() { const router = useRouter() const { symbol } = router.query - const wallet = useWalletOnePointOh() - const connected = !!wallet?.connected const { data: tokenAccounts } = useUserTokenAccountsQuery() const realm = useRealmQuery().data?.result const realmInfo = useSelectedRealmInfo() @@ -58,7 +52,6 @@ export default function useRealm() { const heliumVotingPower = useHeliumVsrStore((s) => s.state.votingPower) const nftVotingPower = useNftPluginStore((s) => s.state.votingPower) const gatewayVotingPower = useGatewayPluginStore((s) => s.state.votingPower) - const sbVotingPower = useSwitchboardPluginStore((s) => s.state.votingPower) const currentPluginPk = config?.account?.communityTokenConfig.voterWeightAddin const ownTokenRecord = useUserCommunityTokenOwnerRecord().data?.result @@ -109,7 +102,6 @@ export default function useRealm() { ownTokenRecord, votingPower, nftVotingPower, - sbVotingPower, gatewayVotingPower, ownCouncilTokenRecord, heliumVotingPower @@ -169,7 +161,6 @@ const getVoterWeight = ( ownTokenRecord: ProgramAccount | undefined, votingPower: BN, nftVotingPower: BN, - sbVotingPower: BN, gatewayVotingPower: BN, ownCouncilTokenRecord: ProgramAccount | undefined, heliumVotingPower: BN @@ -196,9 +187,6 @@ const getVoterWeight = ( nftVotingPower ) } - if (SWITCHBOARD_PLUGINS_PKS.includes(currentPluginPk.toBase58())) { - return new SwitchboardQueueVoteWeight(ownTokenRecord, sbVotingPower) - } if (GATEWAY_PLUGINS_PKS.includes(currentPluginPk.toBase58())) { return new SimpleGatedVoterWeight( ownTokenRecord, diff --git a/hooks/useVotingPlugins.ts b/hooks/useVotingPlugins.ts index a93c5c7b5d..4fbb9022c3 100644 --- a/hooks/useVotingPlugins.ts +++ b/hooks/useVotingPlugins.ts @@ -1,25 +1,10 @@ import { useCallback, useEffect, useMemo } from 'react' import { getNfts } from '@utils/tokens' -import { PublicKey, TransactionInstruction } from '@solana/web3.js' import useNftPluginStore from 'NftVotePlugin/store/nftPluginStore' -import useSwitchboardPluginStore from 'SwitchboardVotePlugin/store/switchboardStore' -import { - SWITCHBOARD_ID, - SWITCHBOARD_ADDIN_ID, -} from 'SwitchboardVotePlugin/SwitchboardQueueVoterClient' import useVotePluginsClientStore from 'stores/useVotePluginsClientStore' -import { - getMaxVoterWeightRecord, - getVoterWeightRecord, - getGovernanceAccount, - Governance, -} from '@solana/spl-governance' +import { getMaxVoterWeightRecord } from '@solana/spl-governance' import { getMaxVoterWeightRecord as getPluginMaxVoterWeightRecord } from '@utils/plugin/accounts' import { notify } from '@utils/notifications' -import * as anchor from '@coral-xyz/anchor' -import * as sbv2 from '@switchboard-xyz/switchboard-v2' -import sbIdl from 'SwitchboardVotePlugin/switchboard_v2.json' -import gonIdl from 'SwitchboardVotePlugin/gameofnodes.json' import useGatewayPluginStore from '../GatewayPlugin/store/gatewayPluginStore' import { getGatekeeperNetwork } from '../GatewayPlugin/sdk/accounts' @@ -35,7 +20,6 @@ import { HELIUM_VSR_PLUGINS_PKS, VSR_PLUGIN_PKS, GATEWAY_PLUGINS_PKS, - SWITCHBOARD_PLUGINS_PKS, } from '../constants/plugins' import useUserOrDelegator from './useUserOrDelegator' @@ -52,7 +36,6 @@ export function useVotingPlugins() { handleSetHeliumVsrClient, handleSetNftClient, handleSetGatewayClient, - //handleSetSwitchboardClient, handleSetNftRegistrar, handleSetGatewayRegistrar, handleSetCurrentRealmVotingClient, @@ -71,7 +54,6 @@ export function useVotingPlugins() { // @asktree: you should select what you need from stores, not use entire thing const heliumStore = useHeliumVsrStore() const gatewayStore = useGatewayPluginStore() - const switchboardStore = useSwitchboardPluginStore() const wallet = useWalletOnePointOh() const connection = useLegacyConnectionContext() const connected = !!wallet?.connected @@ -80,8 +62,6 @@ export function useVotingPlugins() { currentClient, vsrClient, gatewayClient, - //switchboardClient, - //pythClient, nftClient, nftMintRegistrar, heliumVsrClient, @@ -89,7 +69,6 @@ export function useVotingPlugins() { s.state.currentRealmVotingClient, s.state.vsrClient, s.state.gatewayClient, - //s.state.switchboardClient, s.state.nftClient, s.state.nftMintRegistrar, s.state.heliumVsrClient, @@ -159,7 +138,6 @@ export function useVotingPlugins() { } } handleSetNftClient(wallet, connection) - //handleSetSwitchboardClient(wallet, connection) handleSetGatewayClient(wallet, connection) } }, [ @@ -247,24 +225,6 @@ export function useVotingPlugins() { } } - /* - const handleSwitchboardPlugin = () => { - if ( - switchboardClient && - currentPluginPk && - SWITCHBOARD_PLUGINS_PKS.includes(currentPluginPk.toBase58()) - ) { - // Switchboard: don't think we need this - //handleSetNftRegistrar(nftClient!, realm) - if (connected) { - handleSetCurrentRealmVotingClient({ - client: switchboardClient, - realm, - walletPk: wallet?.publicKey, - }) - } - } - } */ if ( realm && (!currentClient || @@ -278,7 +238,6 @@ export function useVotingPlugins() { handleGatewayPlugin() handleVsrPlugin() handleHeliumVsrPlugin() - //handleSwitchboardPlugin() } }, [ currentClient, @@ -317,155 +276,6 @@ export function useVotingPlugins() { } }, [connection, nftClient, setNftMaxVoterWeight, realm]) - const handleGetSwitchboardVoting = useCallback(async () => { - console.log('im doing switchboard stuff') - if (!wallet || !wallet.publicKey || !realm) { - return - } - - switchboardStore.setIsLoading(true) - - try { - const options = anchor.AnchorProvider.defaultOptions() - const provider = new anchor.AnchorProvider( - connection.current, - (wallet as unknown) as anchor.Wallet, - options - ) - - let idl = await anchor.Program.fetchIdl(sbv2.SBV2_MAINNET_PID, provider) - if (!idl) { - idl = sbIdl as anchor.Idl - } - - let addinIdl = await anchor.Program.fetchIdl( - SWITCHBOARD_ADDIN_ID, - provider - ) - if (!addinIdl) { - addinIdl = gonIdl as anchor.Idl - } - - const switchboardProgram = new anchor.Program( - idl, - SWITCHBOARD_ID, - provider - ) - - const addinProgram = new anchor.Program( - addinIdl, - SWITCHBOARD_ADDIN_ID, - provider - ) - - const allOracles = await switchboardProgram.account.oracleAccountData.all() - const oData = allOracles.map(({ publicKey, account }) => { - return { - oracleData: account as any, - oracle: publicKey, - } - }) - - const myNodesForRealm: PublicKey[] = [] - const setVoterWeightInstructions: TransactionInstruction[] = [] - - for (const { oracle, oracleData } of oData) { - if (!wallet || !wallet.publicKey || !realm || !oData) { - continue - } - const queuePk = oracleData.queuePubkey as PublicKey - - const [addinState] = await PublicKey.findProgramAddress( - [Buffer.from('state')], - addinProgram.programId - ) - - const addinStateData = await addinProgram.account.state.fetch( - addinState - ) - const queue = await switchboardProgram.account.oracleQueueAccountData.fetch( - queuePk - ) - const queueAuthority = queue.authority as PublicKey - const grantAuthority = addinStateData.grantAuthority as PublicKey - try { - const g = await getGovernanceAccount( - provider.connection, - grantAuthority, - Governance - ) - if ( - g.account.realm.equals(realm.pubkey) && - oracleData.oracleAuthority.equals(wallet.publicKey) - ) { - myNodesForRealm.push(oracle) - const [p] = sbv2.PermissionAccount.fromSeed( - switchboardProgram as any, - queueAuthority, - queuePk, - oracle - ) - - const ix = await p.setVoterWeightTx({ - govProgram: realm.owner, - pubkeySigner: wallet.publicKey, - addinProgram: addinProgram as any, - realm: realm.pubkey, - }) - - setVoterWeightInstructions.push(ix.instructions[0]) - } - } catch (e) { - console.log(e) - } - } - - switchboardStore.setOracleKeys(myNodesForRealm, currentClient) - switchboardStore.setInstructions( - setVoterWeightInstructions, - currentClient - ) - - try { - const [voterWeightRecord] = PublicKey.findProgramAddressSync( - [Buffer.from('VoterWeightRecord'), myNodesForRealm[0].toBytes()], - SWITCHBOARD_ADDIN_ID - ) - - try { - const vwr = await getVoterWeightRecord( - connection.current, - voterWeightRecord - ) - if (vwr && vwr.account.realm.equals(realm.pubkey)) { - // get voting power - switchboardStore.setVotingPower(vwr.account.voterWeight) - } else { - // 'no sb governance' - switchboardStore.setVotingPower(new anchor.BN(0)) - } - } catch (e) { - console.log("Couldn't get voter weight record. Setting to zero.") - switchboardStore.setVotingPower(new anchor.BN(0)) - } - } catch (e) { - console.log("Couldn't get VWR") - console.log(e) - } - } catch (e) { - console.log(e) - } - switchboardStore.setIsLoading(false) - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ - connection, - currentClient, - realm, - //switchboardStore, - wallet, - ]) - const handleGetHeliumVsrVoting = useCallback(async () => { if ( realm && @@ -540,12 +350,6 @@ export function useVotingPlugins() { ]) useEffect(() => { - if ( - currentPluginPk && - SWITCHBOARD_PLUGINS_PKS.includes(currentPluginPk.toBase58()) - ) { - handleGetSwitchboardVoting() - } if (usedCollectionsPks.length && realm) { if (connected && currentClient.walletPk?.toBase58()) { handleGetNfts() @@ -553,8 +357,6 @@ export function useVotingPlugins() { handleMaxVoterWeight() } else if (realm) { handleGetHeliumVsrVoting() - // @asktree: guys please dont spam network reqs even if your plugin isnt used - // handleGetSwitchboardVoting() } else { setVotingNfts([], currentClient, nftMintRegistrar) setNftMaxVoterWeight(null) @@ -565,7 +367,6 @@ export function useVotingPlugins() { currentPluginPk, handleGetHeliumVsrVoting, handleGetNfts, - handleGetSwitchboardVoting, handleMaxVoterWeight, nftMintRegistrar, realm, diff --git a/hub/components/EditRealmConfig/AddressValidator/index.tsx b/hub/components/EditRealmConfig/AddressValidator/index.tsx index 72c5b056af..2eac172368 100644 --- a/hub/components/EditRealmConfig/AddressValidator/index.tsx +++ b/hub/components/EditRealmConfig/AddressValidator/index.tsx @@ -5,7 +5,6 @@ import { VSR_PLUGIN_PKS, NFT_PLUGINS_PKS, GATEWAY_PLUGINS_PKS, - SWITCHBOARD_PLUGINS_PKS, } from '@constants/plugins'; import { Program, AnchorProvider } from '@coral-xyz/anchor'; import { PublicKey } from '@solana/web3.js'; @@ -20,7 +19,6 @@ const RECOGNIZED_PLUGINS = new Set([ ...VSR_PLUGIN_PKS, ...NFT_PLUGINS_PKS, ...GATEWAY_PLUGINS_PKS, - ...SWITCHBOARD_PLUGINS_PKS, ]); interface Props { diff --git a/models/voteWeights.ts b/models/voteWeights.ts index 13bec0b08a..8c32860123 100644 --- a/models/voteWeights.ts +++ b/models/voteWeights.ts @@ -238,85 +238,6 @@ export class VoteNftWeight implements VoterWeightInterface { } } -export class SwitchboardQueueVoteWeight implements VoterWeightInterface { - communityTokenRecord: ProgramAccount | undefined - votingPower: BN - councilTokenRecord: ProgramAccount | undefined - - constructor( - communityTokenRecord: ProgramAccount | undefined, - votingPower: BN - ) { - this.communityTokenRecord = communityTokenRecord - this.councilTokenRecord = undefined - this.votingPower = votingPower - } - - // Checks if the voter has any voting weight - hasAnyWeight() { - return !this.votingPower.isZero() - } - - // Returns first available tokenRecord - getTokenRecord() { - if (this.communityTokenRecord) { - return this.communityTokenRecord.pubkey - } - throw new Error('Current wallet has no Token Owner Records') - } - - hasMinCommunityWeight(minCommunityWeight: BN) { - return ( - this.communityTokenRecord && this.votingPower.cmp(minCommunityWeight) >= 0 - ) - } - hasMinCouncilWeight(_minCouncilWeight: BN) { - return false - } - - canCreateProposal(_config: GovernanceConfig) { - return this.votingPower.gt(new BN(0)) - } - canCreateGovernanceUsingCommunityTokens(realm: ProgramAccount) { - return true - return this.hasMinCommunityWeight( - realm.account.config.minCommunityTokensToCreateGovernance - ) - } - canCreateGovernanceUsingCouncilTokens() { - return false - } - canCreateGovernance(realm: ProgramAccount) { - return true - return ( - this.canCreateGovernanceUsingCommunityTokens(realm) || - this.canCreateGovernanceUsingCouncilTokens() - ) - } - hasMinAmountToVote(mintPk: PublicKey) { - return true - const isCommunity = - this.communityTokenRecord?.account.governingTokenMint.toBase58() === - mintPk.toBase58() - const isCouncil = - this.councilTokenRecord?.account.governingTokenMint.toBase58() === - mintPk.toBase58() - if (isCouncil) { - return !this.councilTokenRecord?.account.governingTokenDepositAmount.isZero() - } - if (isCommunity) { - return !this.votingPower.isZero() - } - } - - getTokenRecordToCreateProposal(_config: GovernanceConfig) { - if (this.communityTokenRecord !== undefined) { - return this.communityTokenRecord - } - throw new Error('Not enough vote weight to create proposal') - } -} - export class VoterWeight implements VoterWeightInterface { communityTokenRecord: ProgramAccount | undefined councilTokenRecord: ProgramAccount | undefined diff --git a/package.json b/package.json index 1c03f2a301..9a3646e0e6 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,6 @@ "@sqds/iframe-adapter": "1.0.16", "@streamflow/stream": "3.0.16", "@switchboard-xyz/solana.js": "2.2.0", - "@switchboard-xyz/switchboard-v2": "0.0.174", "@tailwindcss/line-clamp": "0.4.2", "@tanstack/react-query": "4.14.3", "@tanstack/react-query-devtools": "4.29.6", @@ -227,7 +226,6 @@ "@coral-xyz/borsh": "0.27.0", "bignumber.js": "9.0.2", "lodash": "4.17.21", - "@switchboard-xyz/switchboard-v2/mocha": "10.1.0", "**/@cardinal/certificates/mocha": "10.1.0", "**/@cardinal/stake-pool/mocha": "10.1.0", "@sentry/nextjs/**/ansi-regex": "3.0.1", @@ -266,7 +264,6 @@ "@solana/web3.js>bigint-buffer": false, "@solana/web3.js>rpc-websockets>bufferutil": true, "@solana/web3.js>rpc-websockets>utf-8-validate": true, - "@switchboard-xyz/switchboard-v2>protobufjs": false, "@testing-library/react>@testing-library/dom>aria-query>@babel/runtime-corejs3>core-js-pure": false, "draft-js>fbjs>core-js": false, "goblingold-sdk": false diff --git a/pages/dao/[symbol]/proposal/components/instructions/Switchboard/AdmitOracle.tsx b/pages/dao/[symbol]/proposal/components/instructions/Switchboard/AdmitOracle.tsx deleted file mode 100644 index c6aa20421b..0000000000 --- a/pages/dao/[symbol]/proposal/components/instructions/Switchboard/AdmitOracle.tsx +++ /dev/null @@ -1,160 +0,0 @@ -import React, { useContext, useEffect, useState } from 'react' -import { - ProgramAccount, - serializeInstructionToBase64, - Governance, - getGovernance, -} from '@solana/spl-governance' -import { SwitchboardAdmitOracleForm } from '@utils/uiTypes/proposalCreationTypes' -import { PublicKey } from '@solana/web3.js' -import Input from '@components/inputs/Input' -import * as sbv2 from '@switchboard-xyz/switchboard-v2' -import * as anchor from '@coral-xyz/anchor' -import sbIdl from 'SwitchboardVotePlugin/switchboard_v2.json' -import gonIdl from 'SwitchboardVotePlugin/gameofnodes.json' -import { - SWITCHBOARD_ID, - SWITCHBOARD_ADDIN_ID, - SWITCHBOARD_GRANT_AUTHORITY, - grantPermissionTx, -} from 'SwitchboardVotePlugin/SwitchboardQueueVoterClient' -import { NewProposalContext } from '../../../new' -import { UiInstruction } from '@utils/uiTypes/proposalCreationTypes' -import useWalletOnePointOh from '@hooks/useWalletOnePointOh' -import useLegacyConnectionContext from '@hooks/useLegacyConnectionContext' - -const SwitchboardAdmitOracle = ({ - index, -}: { - index: number - governance: ProgramAccount | null -}) => { - const [form, setForm] = useState({ - oraclePubkey: undefined, - queuePubkey: undefined, - }) - const connection = useLegacyConnectionContext() - const wallet = useWalletOnePointOh() - const { handleSetInstructions } = useContext(NewProposalContext) - - useEffect(() => { - handleSetInstructions( - { - governedAccount: SWITCHBOARD_GRANT_AUTHORITY, - getInstruction, - }, - index - ) - // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO please fix, it can cause difficult bugs. You might wanna check out https://bobbyhadz.com/blog/react-hooks-exhaustive-deps for info. -@asktree - }, [form]) - - async function getInstruction(): Promise { - const options = anchor.AnchorProvider.defaultOptions() - const provider = new anchor.AnchorProvider( - connection.current, - (wallet as unknown) as anchor.Wallet, - options - ) - - const switchboardProgram = new anchor.Program( - sbIdl as anchor.Idl, - SWITCHBOARD_ID, - provider - ) - - const addinProgram = new anchor.Program( - gonIdl as anchor.Idl, - SWITCHBOARD_ADDIN_ID, - provider - ) - - const [addinState] = await PublicKey.findProgramAddress( - [Buffer.from('state')], - addinProgram.programId - ) - - let qPk - if (form === undefined) { - qPk = PublicKey.default - } else { - qPk = form.queuePubkey - } - let oPk - if (form === undefined) { - oPk = PublicKey.default - } else { - oPk = form.oraclePubkey - } - const p = sbv2.PermissionAccount.fromSeed( - switchboardProgram as any, - addinState, - new PublicKey(qPk), - new PublicKey(oPk) - )[0] - console.log('P:', p) - - const grantTx = await grantPermissionTx( - addinProgram, - SWITCHBOARD_GRANT_AUTHORITY, - SWITCHBOARD_ID, - p.publicKey - ) - - const gov = await getGovernance( - connection.current, - SWITCHBOARD_GRANT_AUTHORITY - ) - return { - serializedInstruction: serializeInstructionToBase64( - grantTx.instructions[0] - ), - isValid: true, - governance: gov, - } - } - - return ( - <> - { - let oPk - if (form === undefined) { - oPk = PublicKey.default - } else { - oPk = form.oraclePubkey - } - return oPk - })()} - onChange={(text) => { - setForm({ - ...form, - ['oraclePubkey']: new PublicKey(text.target.value), - }) - }} - /> - { - let qPk - if (form === undefined) { - qPk = PublicKey.default - } else { - qPk = form.queuePubkey - } - return qPk - })()} - onChange={(text) => { - setForm({ - ...form, - ['queuePubkey']: new PublicKey(text.target.value), - }) - }} - /> - - ) -} - -export default SwitchboardAdmitOracle diff --git a/pages/dao/[symbol]/proposal/components/instructions/Switchboard/RevokeOracle.tsx b/pages/dao/[symbol]/proposal/components/instructions/Switchboard/RevokeOracle.tsx deleted file mode 100644 index e338f41ebf..0000000000 --- a/pages/dao/[symbol]/proposal/components/instructions/Switchboard/RevokeOracle.tsx +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ -import React, { useContext, useEffect, useState } from 'react' -//import { ForesightHasMarketId } from '@utils/uiTypes/proposalCreationTypes' -import { - ProgramAccount, - serializeInstructionToBase64, - Governance, - getGovernance, -} from '@solana/spl-governance' -/*import { - governance as foresightGov, - utils, - consts, -} from '@foresight-tmp/foresight-sdk'*/ -import { SwitchboardRevokeOracleForm } from '@utils/uiTypes/proposalCreationTypes' -import { PublicKey } from '@solana/web3.js' -import Input from '@components/inputs/Input' -import * as sbv2 from '@switchboard-xyz/switchboard-v2' -import * as anchor from '@coral-xyz/anchor' -import sbIdl from 'SwitchboardVotePlugin/switchboard_v2.json' -import gonIdl from 'SwitchboardVotePlugin/gameofnodes.json' -import { - SWITCHBOARD_ID, - SWITCHBOARD_ADDIN_ID, - SWITCHBOARD_REVOKE_AUTHORITY, - revokePermissionTx, -} from 'SwitchboardVotePlugin/SwitchboardQueueVoterClient' -import { NewProposalContext } from '../../../new' -import { UiInstruction } from '@utils/uiTypes/proposalCreationTypes' -import useWalletOnePointOh from '@hooks/useWalletOnePointOh' -import useLegacyConnectionContext from '@hooks/useLegacyConnectionContext' - -const SwitchboardRevokeOracle = ({ - index, -}: { - index: number - governance: ProgramAccount | null -}) => { - const [form, setForm] = useState({ - oraclePubkey: undefined, - queuePubkey: undefined, - }) - const connection = useLegacyConnectionContext() - const wallet = useWalletOnePointOh() - const { handleSetInstructions } = useContext(NewProposalContext) - - useEffect(() => { - handleSetInstructions( - { - governedAccount: SWITCHBOARD_REVOKE_AUTHORITY, - getInstruction, - }, - index - ) - // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO please fix, it can cause difficult bugs. You might wanna check out https://bobbyhadz.com/blog/react-hooks-exhaustive-deps for info. -@asktree - }, [form]) - - async function getInstruction(): Promise { - const options = anchor.AnchorProvider.defaultOptions() - const provider = new anchor.AnchorProvider( - connection.current, - (wallet as unknown) as anchor.Wallet, - options - ) - - const switchboardProgram = new anchor.Program( - sbIdl as anchor.Idl, - SWITCHBOARD_ID, - provider - ) - - const addinProgram = new anchor.Program( - gonIdl as anchor.Idl, - SWITCHBOARD_ADDIN_ID, - provider - ) - - const [addinState] = await PublicKey.findProgramAddress( - [Buffer.from('state')], - addinProgram.programId - ) - - let qPk - if (form === undefined) { - qPk = PublicKey.default - } else { - qPk = form.queuePubkey - } - let oPk - if (form === undefined) { - oPk = PublicKey.default - } else { - oPk = form.oraclePubkey - } - - const p = sbv2.PermissionAccount.fromSeed( - switchboardProgram as any, - addinState, - new PublicKey(qPk), - new PublicKey(oPk) - )[0] - - const revokeTx = await revokePermissionTx( - addinProgram, - SWITCHBOARD_REVOKE_AUTHORITY, - SWITCHBOARD_ID, - p.publicKey - ) - - const gov = await getGovernance( - connection.current, - SWITCHBOARD_REVOKE_AUTHORITY - ) - return { - serializedInstruction: serializeInstructionToBase64( - revokeTx.instructions[0] - ), - isValid: true, - governance: gov, - } - } - - return ( - <> - { - setForm({ - ...form, - ['oraclePubkey']: new PublicKey(text.target.value), - }) - //setGovernance(); - }} - /> - { - setForm({ - ...form, - ['queuePubkey']: new PublicKey(text.target.value), - }) - }} - /> - - ) -} - -export default SwitchboardRevokeOracle diff --git a/pages/dao/[symbol]/proposal/new.tsx b/pages/dao/[symbol]/proposal/new.tsx index 2bdeaa8a08..bbe04ed781 100644 --- a/pages/dao/[symbol]/proposal/new.tsx +++ b/pages/dao/[symbol]/proposal/new.tsx @@ -52,8 +52,6 @@ import FriktionDeposit from './components/instructions/Friktion/FriktionDeposit' import CreateNftPluginRegistrar from './components/instructions/NftVotingPlugin/CreateRegistrar' import CreateNftPluginMaxVoterWeightRecord from './components/instructions/NftVotingPlugin/CreateMaxVoterWeightRecord' import ConfigureNftPluginCollection from './components/instructions/NftVotingPlugin/ConfigureCollection' -import SwitchboardAdmitOracle from './components/instructions/Switchboard/AdmitOracle' -import SwitchboardRevokeOracle from './components/instructions/Switchboard/RevokeOracle' import SwitchboardFundOracle from './components/instructions/Switchboard/FundOracle' import WithdrawFromOracle from './components/instructions/Switchboard/WithdrawFromOracle' import FriktionWithdraw from './components/instructions/Friktion/FriktionWithdraw' @@ -451,8 +449,6 @@ const New = () => { [Instructions.PsyFinanceBurnWriterForQuote]: PsyFinanceBurnWriterTokenForQuote, [Instructions.PsyFinanceClaimUnderlyingPostExpiration]: PsyFinanceClaimUnderlyingPostExpiration, [Instructions.PsyFinanceExerciseOption]: PsyFinanceExerciseOption, - [Instructions.SwitchboardAdmitOracle]: SwitchboardAdmitOracle, - [Instructions.SwitchboardRevokeOracle]: SwitchboardRevokeOracle, [Instructions.SwitchboardFundOracle]: SwitchboardFundOracle, [Instructions.WithdrawFromOracle]: WithdrawFromOracle, [Instructions.RefreshSolendObligation]: RefreshObligation, diff --git a/stores/useVotePluginsClientStore.tsx b/stores/useVotePluginsClientStore.tsx index 379499c1a4..732881f87f 100644 --- a/stores/useVotePluginsClientStore.tsx +++ b/stores/useVotePluginsClientStore.tsx @@ -1,6 +1,5 @@ import create, { State } from 'zustand' import { GatewayClient } from '@solana/governance-program-library' -import { SwitchboardQueueVoterClient } from '../SwitchboardVotePlugin/SwitchboardQueueVoterClient' import { getRegistrarPDA, Registrar } from 'VoteStakeRegistry/sdk/accounts' import { getRegistrarPDA as getPluginRegistrarPDA } from '@utils/plugin/accounts' import { AnchorProvider, Wallet } from '@coral-xyz/anchor' @@ -28,7 +27,6 @@ interface UseVotePluginsClientStore extends State { heliumVsrClient: HeliumVsrClient | undefined nftClient: NftVoterClient | undefined gatewayClient: GatewayClient | undefined - switchboardClient: SwitchboardQueueVoterClient | undefined nftMintRegistrar: any gatewayRegistrar: any currentRealmVotingClient: VotingClient @@ -51,10 +49,6 @@ interface UseVotePluginsClientStore extends State { wallet: SignerWalletAdapter | undefined, connection: ConnectionContext ) => void - handleSetSwitchboardClient: ( - wallet: SignerWalletAdapter | undefined, - connection: ConnectionContext - ) => void handleSetGatewayClient: ( wallet: SignerWalletAdapter | undefined, connection: ConnectionContext @@ -87,7 +81,6 @@ const defaultState = { heliumVsrClient: undefined, nftClient: undefined, gatewayClient: undefined, - switchboardClient: undefined, voteStakeRegistryRegistrar: null, heliumVsrRegistrar: null, voteStakeRegistryRegistrarPk: null, @@ -216,21 +209,6 @@ const useVotePluginsClientStore = create( s.state.gatewayRegistrar = existingRegistrar }) }, - handleSetSwitchboardClient: async (wallet, connection) => { - const options = AnchorProvider.defaultOptions() - const provider = new AnchorProvider( - connection.current, - (wallet as unknown) as Wallet, - options - ) - const switchboardClient = await SwitchboardQueueVoterClient.connect( - provider, - connection.cluster === 'devnet' - ) - set((s) => { - s.state.switchboardClient = switchboardClient - }) - }, handleSetCurrentRealmVotingClient: ({ client, realm, walletPk }) => { set((s) => { s.state.currentRealmVotingClient = new VotingClient({ diff --git a/utils/uiTypes/VotePlugin.ts b/utils/uiTypes/VotePlugin.ts index c53c134c10..00f5b371f6 100644 --- a/utils/uiTypes/VotePlugin.ts +++ b/utils/uiTypes/VotePlugin.ts @@ -1,8 +1,5 @@ import { GatewayClient } from '@solana/governance-program-library' -import { - SwitchboardQueueVoterClient, - SWITCHBOARD_ADDIN_ID, -} from '../../SwitchboardVotePlugin/SwitchboardQueueVoterClient' + import { ProgramAccount, Realm, @@ -69,7 +66,6 @@ export enum VotingClientType { VsrClient, HeliumVsrClient, NftVoterClient, - SwitchboardVoterClient, GatewayClient, } @@ -97,7 +93,6 @@ export type Client = | VsrClient | HeliumVsrClient | NftVoterClient - | SwitchboardQueueVoterClient | GatewayClient //Abstract for common functions that plugins will implement @@ -134,10 +129,7 @@ export class VotingClient { this.clientType = VotingClientType.NftVoterClient this.noClient = false } - if (this.client instanceof SwitchboardQueueVoterClient) { - this.clientType = VotingClientType.SwitchboardVoterClient - this.noClient = false - } + if (this.client instanceof GatewayClient) { this.clientType = VotingClientType.GatewayClient this.noClient = false @@ -297,15 +289,6 @@ export class VotingClient { instructions.push(updateVoterWeightRecordIx) return { voterWeightPk, maxVoterWeightRecord: undefined } } - - if (this.client instanceof SwitchboardQueueVoterClient) { - instructions.push(this.instructions[0]) - const [vwr] = await PublicKey.findProgramAddress( - [Buffer.from('VoterWeightRecord'), this.oracles[0].toBytes()], - SWITCHBOARD_ADDIN_ID - ) - return { voterWeightPk: vwr, maxVoterWeightRecord: undefined } - } } withCastPluginVote = async ( instructions: TransactionInstruction[], @@ -334,15 +317,6 @@ export class VotingClient { return props } - if (this.client instanceof SwitchboardQueueVoterClient) { - const props = await this.withUpdateVoterWeightRecord( - instructions, - tokenOwnerRecord, - 'castVote' - ) - return props - } - if (this.client instanceof GatewayClient) { // get the gateway plugin vote instruction const instruction = await getVoteInstruction( @@ -725,9 +699,6 @@ export class VotingClient { _setCurrentVoterGatewayToken = (gatewayToken: PublicKey) => { this.gatewayToken = gatewayToken } - _setOracles = (oracles: PublicKey[]) => { - this.oracles = oracles - } _setInstructions = (instructions: TransactionInstruction[]) => { this.instructions = instructions } diff --git a/utils/uiTypes/proposalCreationTypes.ts b/utils/uiTypes/proposalCreationTypes.ts index dc20799916..ccc1881592 100644 --- a/utils/uiTypes/proposalCreationTypes.ts +++ b/utils/uiTypes/proposalCreationTypes.ts @@ -292,16 +292,6 @@ export interface EmptyInstructionForm { governedAccount: AssetAccount | undefined } -export interface SwitchboardAdmitOracleForm { - oraclePubkey: PublicKey | undefined - queuePubkey: PublicKey | undefined -} - -export interface SwitchboardRevokeOracleForm { - oraclePubkey: PublicKey | undefined - queuePubkey: PublicKey | undefined -} - export interface CreateAssociatedTokenAccountForm { governedAccount?: AssetAccount splTokenMint?: string @@ -471,8 +461,6 @@ export enum Instructions { SerumUpdateGovConfigAuthority, SerumUpdateGovConfigParams, StakeValidator, - SwitchboardAdmitOracle, - SwitchboardRevokeOracle, SwitchboardFundOracle, WithdrawFromOracle, Transfer, diff --git a/yarn.lock b/yarn.lock index 7914f434c9..f2bae5e376 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4734,18 +4734,6 @@ bs58 "^4.0.1" superstruct "^0.15.2" -"@solana/spl-governance@^0.0.34": - version "0.0.34" - resolved "https://registry.yarnpkg.com/@solana/spl-governance/-/spl-governance-0.0.34.tgz#c61d81d356dbcee961bbc85e5d3538846fea57ad" - integrity sha512-tZppBiiVkUa5v+B/Ds+TqZ4yxR/vaIYLRxBk7x6R22dwk4/9SU87bVE60kRdDqTdMzqScFxIMdhaGl/fCX533A== - dependencies: - "@solana/web3.js" "^1.22.0" - bignumber.js "^9.0.1" - bn.js "^5.1.3" - borsh "^0.3.1" - bs58 "^4.0.1" - superstruct "^0.15.2" - "@solana/spl-token-registry@0.2.3775", "@solana/spl-token-registry@^0.2.1107": version "0.2.3775" resolved "https://registry.yarnpkg.com/@solana/spl-token-registry/-/spl-token-registry-0.2.3775.tgz#96abffc351fe156917aedb8bba7db94600abed6e" @@ -4762,15 +4750,6 @@ "@solana/web3.js" "^1.42.0" bn.js "^5.1.3" -"@solana/spl-token-v3@npm:@solana/spl-token@0.3.6": - version "0.3.6" - resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.6.tgz#35473ad2ed71fe91e5754a2ac72901e1b8b26a42" - integrity sha512-P9pTXjDIRvVbjr3J0mCnSamYqLnICeds7IoH1/Ro2R9OBuOHdp5pqKZoscfZ3UYrgnCWUc1bc9M2m/YPHjw+1g== - dependencies: - "@solana/buffer-layout" "^4.0.0" - "@solana/buffer-layout-utils" "^0.2.0" - buffer "^6.0.3" - "@solana/spl-token@0.1.8", "@solana/spl-token@^0.1.5", "@solana/spl-token@^0.1.6", "@solana/spl-token@^0.1.8": version "0.1.8" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6" @@ -5542,7 +5521,7 @@ dependencies: tslib "^2.4.0" -"@switchboard-xyz/common@^2.1.7", "@switchboard-xyz/common@^2.2.3": +"@switchboard-xyz/common@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@switchboard-xyz/common/-/common-2.2.3.tgz#f4d39cea8cea9354ad369f749462fa37152c4ec9" integrity sha512-E4NQf9aXdOiul+sySAbFPAW9k0qz4wRTfqrU7cEa8nRIvUkg6VIZ+5JfajHv/VfK9UOD+6ZfMBxq2+dHkiz9zw== @@ -5590,20 +5569,6 @@ typedoc "^0.22.15" ws "^7.4.6" -"@switchboard-xyz/switchboard-v2@0.0.174": - version "0.0.174" - resolved "https://registry.yarnpkg.com/@switchboard-xyz/switchboard-v2/-/switchboard-v2-0.0.174.tgz#0657b554b5e33d8069354f9be2218b04c0b90e61" - integrity sha512-50gdcVrpRE4CcJF6unVxTYVrsBID9BJ0pe965OWKZyt/kMoIeL9vO+n+pSR9epyyy/9ocKiSDNJ+azadMtcgqA== - dependencies: - "@coral-xyz/anchor" "^0.26.0" - "@solana/spl-governance" "^0.0.34" - "@solana/spl-token-v3" "npm:@solana/spl-token@0.3.6" - "@solana/web3.js" "^1.66.2" - "@switchboard-xyz/common" "^2.1.7" - big.js "^6.2.1" - lodash "^4.17.21" - mocha "^9.1.1" - "@switchboard-xyz/switchboard-v2@^0.0.34": version "0.0.34" resolved "https://registry.yarnpkg.com/@switchboard-xyz/switchboard-v2/-/switchboard-v2-0.0.34.tgz#5e10d4c061536a544d2c24b3d1c1796fe2489865" @@ -13599,7 +13564,7 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mocha@10.1.0, mocha@^9.1.1, mocha@^9.1.4, mocha@^9.2.0: +mocha@10.1.0, mocha@^9.1.4, mocha@^9.2.0: version "10.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.1.0.tgz#dbf1114b7c3f9d0ca5de3133906aea3dfc89ef7a" integrity sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg==