diff --git a/.changeset/soft-eyes-dress.md b/.changeset/soft-eyes-dress.md new file mode 100644 index 000000000..f435e69c0 --- /dev/null +++ b/.changeset/soft-eyes-dress.md @@ -0,0 +1,6 @@ +--- +"@codama/dynamic-client": minor +"@codama/errors": minor +--- + +Add `dynamic-client` - a runtime Solana instruction builder diff --git a/.github/actions/setup-anchor/action.yml b/.github/actions/setup-anchor/action.yml new file mode 100644 index 000000000..28a15d791 --- /dev/null +++ b/.github/actions/setup-anchor/action.yml @@ -0,0 +1,63 @@ +name: Setup Anchor CLI +description: Install Rust toolchain and a pinned Anchor CLI version via AVM with caching for CI. + +inputs: + anchor-version: + description: Anchor CLI version to install (e.g. 0.32.1) + required: true + rust-version: + description: Rust toolchain version to install (e.g. 1.93.0) + required: true + cargo-lock-path: + description: Path to Cargo.lock for cache key hashing + required: false + default: packages/dynamic-client/test/programs/anchor/Cargo.lock + build-target-path: + description: Path to the build target directory to cache + required: false + default: packages/dynamic-client/test/programs/anchor/target + +runs: + using: composite + steps: + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ inputs.rust-version }} + + - name: Cache Rust and Anchor toolchain + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin/avm + ~/.avm + ${{ inputs.build-target-path }} + key: ${{ runner.os }}-rust-anchor-${{ inputs.rust-version }}-${{ inputs.anchor-version }}-${{ inputs.cargo-lock-path && hashFiles(inputs.cargo-lock-path) || 'no-lock' }} + restore-keys: | + ${{ runner.os }}-rust-anchor-${{ inputs.rust-version }}-${{ inputs.anchor-version }}- + ${{ runner.os }}-rust-anchor-${{ inputs.rust-version }}- + + - name: Install Anchor (pinned) + shell: bash + run: | + set -euo pipefail + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + echo "$HOME/.avm/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.cargo/bin:$HOME/.avm/bin:$PATH" + + desired="${{ inputs.anchor-version }}" + + # Install AVM if needed. + if ! command -v avm >/dev/null 2>&1; then + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev + cargo install --git https://github.com/coral-xyz/anchor avm --locked + fi + + # Ensure the desired Anchor version exists and is active. + avm install "$desired" + avm use "$desired" + + anchor --version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9bb5e5b0..67b4e94a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,9 @@ env: DO_NOT_TRACK: '1' NODE_VERSION: 20 CODAMA_VERSION: 1.x - SOLANA_VERSION: 2.1.9 + SOLANA_VERSION: 3.1.8 + ANCHOR_VERSION: '0.32.1' + RUST_VERSION: '1.93.0' jobs: lint: @@ -50,6 +52,12 @@ jobs: with: version: ${{ env.SOLANA_VERSION }} + - name: Setup Anchor + uses: ./.github/actions/setup-anchor + with: + anchor-version: ${{ env.ANCHOR_VERSION }} + rust-version: ${{ env.RUST_VERSION }} + - name: Install pnpm uses: pnpm/action-setup@v3 diff --git a/eslint.config.mjs b/eslint.config.mjs index 633207579..4d4fc10f3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -3,7 +3,7 @@ import { defineConfig } from 'eslint/config'; export default defineConfig([ { - ignores: ['**/dist/**', '**/e2e/**'], + ignores: ['**/dist/**', '**/e2e/**', '**/generated/**', '**/target/**'], }, { files: ['**/*.ts', '**/*.(c|m)?js'], diff --git a/packages/dynamic-client/.gitignore b/packages/dynamic-client/.gitignore new file mode 100644 index 000000000..e8fa2340a --- /dev/null +++ b/packages/dynamic-client/.gitignore @@ -0,0 +1,4 @@ +dist/ +test/programs/anchor/.anchor/ +test/programs/anchor/target/ +test/programs/generated/ diff --git a/packages/dynamic-client/.prettierignore b/packages/dynamic-client/.prettierignore new file mode 100644 index 000000000..4110a286a --- /dev/null +++ b/packages/dynamic-client/.prettierignore @@ -0,0 +1,7 @@ +dist/ +test/e2e/ +test-ledger/ +target/ +CHANGELOG.md +generated/ +idls/ \ No newline at end of file diff --git a/packages/dynamic-client/LICENSE b/packages/dynamic-client/LICENSE new file mode 100644 index 000000000..2db0266e0 --- /dev/null +++ b/packages/dynamic-client/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2025 Codama + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/dynamic-client/README.md b/packages/dynamic-client/README.md new file mode 100644 index 000000000..777ce247d --- /dev/null +++ b/packages/dynamic-client/README.md @@ -0,0 +1,242 @@ +# Codama ➤ Dynamic Client + +[![npm][npm-image]][npm-url] +[![npm-downloads][npm-downloads-image]][npm-url] + +[npm-downloads-image]: https://img.shields.io/npm/dm/@codama/dynamic-client.svg?style=flat +[npm-image]: https://img.shields.io/npm/v/@codama/dynamic-client.svg?style=flat&label=%40codama%2Fdynamic-client +[npm-url]: https://www.npmjs.com/package/@codama/dynamic-client + +This package provides a runtime Solana instruction builder that dynamically constructs `Instruction` (`@solana/instructions`) from Codama IDL and provides type generation for full TypeScript type safety. + +## Installation + +```sh +pnpm install @codama/dynamic-client +``` + +> [!NOTE] +> This package is **not** included in the main [`codama`](../library) package. + +## Quick Start + +### Untyped + +```ts +import { createProgramClient } from '@codama/dynamic-client'; +import idl from './my-program-idl.json'; + +const client = createProgramClient(idl); + +const instruction = await client.methods + .transferSol({ amount: 1_000_000_000 }) + .accounts({ source: senderAddress, destination: receiverAddress }) + .instruction(); +``` + +### Typed with generated types + +```ts +import { createProgramClient } from '@codama/dynamic-client'; +import type { MyProgramClient } from './generated/my-program-types'; +import idl from './my-program-idl.json'; + +const client = createProgramClient(idl); +// client.methods, .accounts(), args are now fully typed +``` + +## API Reference + +### `createProgramClient(idl, options?)` + +Creates a program client from a Codama IDL. + +| Parameter | Type | Description | +| ------------------- | ------------------ | ----------------------------------------- | +| `idl` | `object \| string` | Codama IDL object or JSON string | +| `options.programId` | `AddressInput` | Override the program address from the IDL | + +Returns a `ProgramClient` (or `T` when a type parameter is provided). + +### `ProgramClient` + +```ts +type InstructionName = CamelCaseString; +type AccountName = CamelCaseString; + +type ProgramClient = { + methods: Record ProgramMethodBuilder>; + pdas?: Record Promise>; + programAddress: Address; + instructions: Map; + root: RootNode; +}; +``` + +### `ProgramMethodBuilder` (fluent API) + +```ts +client.methods + .myInstruction(args) // provide instruction arguments + .accounts(accounts) // provide account addresses + .signers(['accountName']) // optionally mark ambiguous accounts as signers + .resolvers({ customResolver: async (argumentsInput, accountsInput) => {} }) // optionally provide custom resolver according to resolverValueNode in IDL + .instruction(); // Promise +``` + +### `AddressInput` + +Accepts any of: + +- `Address` (from `@solana/addresses`) +- Legacy `PublicKey` (any object with `.toBase58()`) +- Base58 string + +## Accounts + +### Automatic resolution rules + +Accounts (pda, program ids) with `defaultValue` are resolved automatically, hence can be omitted. + +| Account scenario | Type in `.accounts()` | Auto resolution | +| --------------------------------------------------------------- | ------------------------------ | -------------------------------------------------------------------------------------------- | +| Required account without `defaultValue` | `{ system: Address }` | No | +| Required account with `defaultValue`
(PDA, programId, etc.) | `{ system?: Address }` | Auto-resolved to `defaultValue` if omitted | +| Optional account (`isOptional: true`)
without `defaultValue` | `{ system: Address \| null }` | Resolved via `optionalAccountStrategy`,
if provided as `null` | +| Optional account (`isOptional: true`)
with `defaultValue` | `{ system?: Address \| null }` | - `null` resolves via `optionalAccountStrategy`
- `undefined` resolves via `defaultValue` | + +### Auto-resolved account addresses + +Accounts with `defaultValue` in the IDL are automatically resolved when omitted from `.accounts()`. This includes: + +- **PDA accounts** — derived from seeds defined in the IDL +- **Program IDs** — resolved to known program addresses (e.g., System Program, Token Program) +- **Constants** — resolved from constant value nodes + +You can always override auto-derived accounts by providing an explicit address. + +### Optional accounts + +Pass `null` for optional accounts to be resolved according to `optionalAccountStrategy` (either will be `omitted` or replaced on `programId`): + +```ts +.accounts({ + authority, + program: programAddress, + programData: null, // optional - resolved via optionalAccountStrategy +}) +``` + +### Ambiguous signers + +When an account has `isSigner: 'either'` in the IDL, use `.signers()` to explicitly mark it: + +```ts +.accounts({ owner: ownerAddress }) +.signers(['owner']) +``` + +### Custom resolvers + +When an account or argument is `resolverValueNode` in the IDL, provide a custom resolver function `.resolvers({ [resolverName]: async fn })` to help with account/arguments resolution: + +```ts +client.methods + .create({ tokenStandard: 'NonFungible' }) + .accounts({ owner: ownerAddress }) + .resolvers({ + resolveIsNonFungible: async (argumentsInput, accountsInput) => { + return argumentsInput.tokenStandard === 'NonFungible'; + }, + }); +``` + +## PDA Derivation + +### Standalone + +```ts +const [address, bump] = await client.pdas.canonical({ + program: programAddress, + seed: 'idl', +}); +``` + +### Auto-derived in instructions + +Accounts with `pdaValueNode` defaults are resolved automatically. Seeds are pulled from other accounts and arguments in the instruction: + +```ts +// metadata PDA is auto-derived from program + seed +const ix = await client.methods + .initialize({ seed: 'idl', data: myData /* ... */ }) + .accounts({ authority, program: programAddress, programData }) + .instruction(); +``` + +Nested/dependent PDAs (where one PDA seed references another PDA) are resolved recursively. + +## Arguments + +Arguments with `defaultValueStrategy: 'omitted'` (e.g., discriminators) are auto-encoded and should not be provided. + +## Error Handling + +All errors are instances of `CodamaError` from `@codama/errors`: + +```ts +import { CodamaError, isCodamaError, CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING } from '@codama/dynamic-client'; + +try { + const ix = await client.methods.transferSol({ amount: 100 }).accounts({}).instruction(); +} catch (err) { + if (isCodamaError(err, CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING)) { + console.error(`Missing account: ${err.context.accountName}`); + } +} +``` + +## CLI + +The package includes a CLI for generating TypeScript types from Codama IDL files. + +```sh +npx @codama/dynamic-client generate-client-types +``` + +Example: + +```sh +npx @codama/dynamic-client generate-client-types ./idl/codama.json ./generated +``` + +This reads the IDL file and writes a `*-types.ts` file to the output directory containing strongly-typed interfaces for all instructions, accounts, arguments, PDAs, and the program client. + +### `generateClientTypes(idl)` + +The same is available as a TypeScript function: + +```ts +import { generateClientTypes } from '@codama/dynamic-client'; +import type { RootNode } from 'codama'; +import { readFileSync, writeFileSync } from 'node:fs'; + +const idl: RootNode = JSON.parse(readFileSync('./my-program-idl.json', 'utf-8')); +const typesSource = generateClientTypes(idl); +writeFileSync('./generated/my-program-idl-types.ts', typesSource); +``` + +## Utilities + +```ts +import { toAddress, isPublicKeyLike } from '@codama/dynamic-client'; + +// Convert any AddressInput to Address +const addr = toAddress('11111111111111111111111111111111'); +const addr2 = toAddress(new PublicKey('...')); + +// Type guard for legacy PublicKey objects +if (isPublicKeyLike(value)) { + const addr = toAddress(value); +} +``` diff --git a/packages/dynamic-client/bin/cli.cjs b/packages/dynamic-client/bin/cli.cjs new file mode 100644 index 000000000..0e2d748a0 --- /dev/null +++ b/packages/dynamic-client/bin/cli.cjs @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +const run = require('../dist/cli.cjs').run; + +run(process.argv); diff --git a/packages/dynamic-client/package.json b/packages/dynamic-client/package.json new file mode 100644 index 000000000..b4cae64a9 --- /dev/null +++ b/packages/dynamic-client/package.json @@ -0,0 +1,91 @@ +{ + "name": "@codama/dynamic-client", + "version": "0.0.1", + "description": "Tool to dynamically build instructions based on Codama IDLs", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/codama-idl/codama", + "directory": "packages/dynamic-client" + }, + "bugs": { + "url": "http://github.com/codama-idl/codama/issues" + }, + "bin": { + "dynamic-client": "./bin/cli.cjs" + }, + "exports": { + "types": "./dist/types/index.d.ts", + "react-native": "./dist/index.react-native.mjs", + "browser": { + "import": "./dist/index.browser.mjs", + "require": "./dist/index.browser.cjs" + }, + "node": { + "import": "./dist/index.node.mjs", + "require": "./dist/index.node.cjs" + } + }, + "browser": { + "./dist/index.node.cjs": "./dist/index.browser.cjs", + "./dist/index.node.mjs": "./dist/index.browser.mjs" + }, + "main": "./dist/index.node.cjs", + "module": "./dist/index.node.mjs", + "react-native": "./dist/index.react-native.mjs", + "types": "./dist/types/index.d.ts", + "type": "commonjs", + "files": [ + "./dist/types", + "./dist/index.*", + "./dist/cli.*", + "./bin/*" + ], + "sideEffects": false, + "keywords": [ + "solana", + "framework", + "standard", + "specifications", + "dynamic client" + ], + "scripts": { + "build": "rimraf dist && tsup && tsc -p ./tsconfig.declarations.json", + "dev": "vitest --project node", + "lint": "pnpm generate-program-types && eslint . && prettier --check .", + "lint:fix": "pnpm generate-program-types && eslint --fix . && prettier --write .", + "test": "pnpm test:setup && pnpm test:types && pnpm test:treeshakability && pnpm test:unit", + "test:setup": "pnpm test:anchor:build && ( [ -n \"$CI\" ] || pnpm generate-idl-from-anchor ) && pnpm generate-program-types", + "test:anchor:build": "cd test/programs/anchor && anchor build", + "test:treeshakability": "for file in dist/index.*.mjs; do agadoo $file; done", + "test:types": "tsc --noEmit", + "test:unit": "vitest run", + "generate-idl-from-anchor": "node ./scripts/generate-idl-from-anchor.mjs", + "generate-program-types": "for f in test/programs/idls/*.json; do node ./bin/cli.cjs generate-client-types \"$f\" ./test/programs/generated; done" + }, + "dependencies": { + "@codama/dynamic-codecs": "workspace:*", + "@codama/errors": "workspace:*", + "@solana/addresses": "^5.3.0", + "@solana/codecs": "^5.3.0", + "@solana/instructions": "^5.3.0", + "codama": "workspace:*", + "commander": "^14.0.2", + "superstruct": "^2.0.2" + }, + "devDependencies": { + "@codama/nodes-from-anchor": "workspace:*", + "@codama/renderers-core": "workspace:*", + "@metaplex-foundation/mpl-token-metadata-kit": "^0.0.2", + "@solana-program/program-metadata": "^0.5.1", + "@solana-program/token": "0.10.0", + "@solana-program/token-2022": "^0.9.0", + "@solana/kit": "6.5.0", + "litesvm": "1.0.0", + "sas-lib": "^1.0.10" + }, + "browserslist": [ + "supports bigint and not dead", + "maintained node versions" + ] +} diff --git a/packages/dynamic-client/scripts/generate-idl-from-anchor.mjs b/packages/dynamic-client/scripts/generate-idl-from-anchor.mjs new file mode 100644 index 000000000..c1e6dba97 --- /dev/null +++ b/packages/dynamic-client/scripts/generate-idl-from-anchor.mjs @@ -0,0 +1,28 @@ +import { readFileSync } from 'node:fs'; +import path from 'node:path'; + +import { rootNodeFromAnchor } from '@codama/nodes-from-anchor'; +import { writeFile } from '@codama/renderers-core'; +import { createFromRoot } from 'codama'; + +// This script generates Codama IDL from Anchor programs for tests. +const packageRoot = process.cwd(); +const programs = ['example', 'blog']; + +for (const program of programs) { + const idlPath = path.join(packageRoot, 'test', 'programs', 'anchor', 'target', 'idl', `${program}.json`); + console.log(`Start generation from IDL: ${idlPath}`); + const idl = JSON.parse(readFileSync(idlPath, 'utf-8')); + + console.log('Creating codama client..'); + const codama = createFromRoot(rootNodeFromAnchor(idl)); + + const pathToIdl = path.join(packageRoot, 'test', 'programs', 'idls', `${program}-idl.json`); + console.log(`Writing Codama IDL to: ${pathToIdl}`); + + const codamaJson = JSON.parse(codama.getJson()); + const json = JSON.stringify(codamaJson, null, 4) + '\n'; + + writeFile(pathToIdl, json); + console.log(`Done: ${program}`); +} diff --git a/packages/dynamic-client/src/cli/commands/generate-client-types/generate-client-types-from-file.ts b/packages/dynamic-client/src/cli/commands/generate-client-types/generate-client-types-from-file.ts new file mode 100644 index 000000000..7d6c86672 --- /dev/null +++ b/packages/dynamic-client/src/cli/commands/generate-client-types/generate-client-types-from-file.ts @@ -0,0 +1,59 @@ +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import path from 'node:path'; + +import { createFromJson, type RootNode } from 'codama'; + +import { generateClientTypes } from './generate-client-types'; + +export function generateClientTypesFromFile(codamaIdlPath: string, outputDirPath: string) { + const idlPath = path.resolve(codamaIdlPath); + const outputDir = path.resolve(outputDirPath); + + if (!existsSync(idlPath)) { + console.error(`Error: IDL file not found: ${idlPath}`); + process.exit(1); + } + + console.log(`Reading IDL from: ${idlPath}`); + + let idlJson: string; + try { + idlJson = readFileSync(idlPath, 'utf-8'); + } catch (err) { + console.error(`Error reading IDL file: ${err instanceof Error ? err.message : String(err)}`); + process.exit(1); + } + + let idl: RootNode; + try { + idl = createFromJson(idlJson).getRoot(); + } catch (err) { + console.error( + `Error: ${idlPath} is not valid Codama JSON: ${err instanceof Error ? err.message : String(err)}`, + ); + process.exit(1); + } + + let types: string = ''; + try { + console.log(`Generating types for program: ${idl.program.name}`); + types = generateClientTypes(idl); + } catch (err) { + console.error(`Error generating client types: ${err instanceof Error ? err.message : String(err)}`); + process.exit(1); + } + + try { + mkdirSync(outputDir, { recursive: true }); + const fileName = path.basename(idlPath); + const outputFile = fileName.replace(/\.json$/, '-types.ts'); + const outputPath = path.join(outputDir, outputFile); + + console.log(`Writing types to: ${outputPath}`); + writeFileSync(outputPath, types, 'utf-8'); + console.log('Done!'); + } catch (err) { + console.error(`Error writing generated types: ${err instanceof Error ? err.message : String(err)}`); + process.exit(1); + } +} diff --git a/packages/dynamic-client/src/cli/commands/generate-client-types/generate-client-types.ts b/packages/dynamic-client/src/cli/commands/generate-client-types/generate-client-types.ts new file mode 100644 index 000000000..da002e47d --- /dev/null +++ b/packages/dynamic-client/src/cli/commands/generate-client-types/generate-client-types.ts @@ -0,0 +1,333 @@ +import type { + DefinedTypeNode, + InstructionAccountNode, + InstructionInputValueNode, + InstructionNode, + PdaNode, + RootNode, + TypeNode, +} from 'codama'; + +import { OPTIONAL_NODE_KINDS } from '../../../shared/nodes'; + +/** + * Generate TypeScript type for program client. + */ +export function generateClientTypes(idl: RootNode): string { + const programName = toPascalCase(idl.program.name); + const definedTypes = idl.program.definedTypes ?? []; + + const pdaMap = collectPdaNodesFromIdl(idl); + + const hasPdas = pdaMap.size > 0; + const addressImports = hasPdas ? 'Address, ProgramDerivedAddress' : 'Address'; + + let output = `/** + * Auto-generated types for strongly-typed ProgramClient + * DO NOT EDIT - Generated by @codama/dynamic-client generate-client-types + * + * Note: When the IDL contains types that cannot be resolved (e.g. unsupported + * kind, missing definition), argument types fall back to \`unknown\` instead of + * \`any\`. Consumers should narrow these values before use. + */ + +import type { InstructionNode, RootNode } from 'codama'; +import type { ${addressImports} } from '@solana/addresses'; +import type { Instruction } from '@solana/instructions'; + +export type ResolverFn< + TArgumentsInput = Record, + TAccountsInput = Record +> = (argumentsInput: TArgumentsInput, accountsInput: TAccountsInput) => Promise; + +/** + * Method builder interface. + */ +export type MethodBuilder> = { + accounts(accounts: TAccounts): MethodBuilder; + resolvers(resolvers: Partial): MethodBuilder; + signers(signers: TSigners): MethodBuilder; + instruction(): Promise; +}; + +`; + + for (const ix of idl.program.instructions) { + const typeName = toPascalCase(ix.name); + + // Build args interface + const args = ix.arguments.filter(arg => arg.defaultValueStrategy !== 'omitted'); + const remainingAccountArgs = (ix.remainingAccounts ?? []).filter(ra => ra.value.kind === 'argumentValueNode'); + let argsRef = 'void'; + if (args.length > 0 || remainingAccountArgs.length > 0) { + const argsInterfaceName = `${typeName}Args`; + output += `export type ${argsInterfaceName} = {\n`; + for (const arg of args) { + const tsType = codamaTypeToTS(arg.type, definedTypes); + const isOptional = OPTIONAL_NODE_KINDS.includes(arg.type.kind); + const sep = isOptional ? '?:' : ':'; + output += ` ${arg.name}${sep} ${tsType};\n`; + } + for (const ra of remainingAccountArgs) { + const sep = ra.isOptional ? '?:' : ':'; + output += ` ${ra.value.name}${sep} Address[];\n`; + } + output += '};\n\n'; + argsRef = argsInterfaceName; + } + + // Build accounts interface + // these ValueNodes don't have default value and must be provided if required. + const nonResolvableValueNodes = ['payerValueNode', 'identityValueNode']; + function isAccAutoResolvable(acc: InstructionAccountNode): boolean { + if (acc.defaultValue == null) return false; + return !nonResolvableValueNodes.includes(acc.defaultValue.kind); + } + const accountsInterfaceName = `${typeName}Accounts`; + if (ix.accounts.length > 0) { + output += `export type ${accountsInterfaceName} = {\n`; + for (const acc of ix.accounts) { + // Omittable accounts have a defaultValue that can be auto-resolved, so they can be omitted from .accounts(). + // When null: resolved via optionalAccountStrategy. + // When undefined: resolved via defaultValue. + const omittable = isAccAutoResolvable(acc) ? '?' : ''; + const type = acc.isOptional ? 'Address | null' : 'Address'; + output += ` ${acc.name}${omittable}: ${type};\n`; + } + output += '} & Record;\n\n'; + } else { + output += `export type ${accountsInterfaceName} = Record;\n\n`; + } + + // Collect all ambiguous isSigner: "either" account names + const eitherSignerAccounts = ix.accounts.filter(acc => acc.isSigner === 'either').map(acc => `'${acc.name}'`); + if (eitherSignerAccounts.length > 0) { + output += `export type ${typeName}Signers = (${eitherSignerAccounts.join(' | ')})[];\n\n`; + } + + // Collect resolver names for this instruction + const resolverNames = collectResolverNames(ix); + let resolversRef = ''; + if (resolverNames.size > 0) { + const resolversTypeName = `${typeName}Resolvers`; + output += `export type ${resolversTypeName} = {\n`; + for (const name of resolverNames) { + output += ` ${name}: ResolverFn<${argsRef === 'void' ? 'Record' : argsRef}, ${accountsInterfaceName}>;\n`; + } + output += '};\n\n'; + resolversRef = resolversTypeName; + } + + // Generate method type + const hasRequiredArgs = args.some(arg => !OPTIONAL_NODE_KINDS.includes(arg.type.kind)); + const hasRequiredRemainingAccounts = remainingAccountArgs.some(ra => !ra.isOptional); + const allArgsOptional = !hasRequiredArgs && !hasRequiredRemainingAccounts; + const argsParam = argsRef === 'void' ? '' : allArgsOptional ? `args?: ${argsRef}` : `args: ${argsRef}`; + const signersGeneric = eitherSignerAccounts.length > 0 ? `${typeName}Signers` : 'string[]'; + const resolversGeneric = resolversRef ? `, ${resolversRef}` : ''; + const methodSignature = `(${argsParam}) => MethodBuilder<${accountsInterfaceName}, ${signersGeneric}${resolversGeneric}>`; + output += `export type ${typeName}Method = ${methodSignature};\n\n`; + } + + output += `/** + * Strongly-typed methods for ${programName}. + */ +export type ${programName}Methods = {\n`; + + for (const ix of idl.program.instructions) { + const typeName = toPascalCase(ix.name); + output += ` ${ix.name}: ${typeName}Method;\n`; + } + + output += '};\n\n'; + + // Generate PDA seed types and pdas namespace + if (pdaMap.size > 0) { + for (const [pdaName, pdaNode] of pdaMap) { + const typeName = toPascalCase(pdaName); + const variableSeeds = (pdaNode.seeds ?? []).filter(s => s.kind === 'variablePdaSeedNode'); + if (variableSeeds.length > 0) { + output += `export type ${typeName}PdaSeeds = {\n`; + for (const seed of variableSeeds) { + const tsType = seed.type ? codamaTypeToTS(seed.type, definedTypes) : 'unknown'; + output += ` ${seed.name}: ${tsType};\n`; + } + output += '};\n\n'; + } + } + + output += `/**\n * Strongly-typed PDAs for ${programName}.\n */\n`; + output += `export type ${programName}Pdas = {\n`; + for (const [pdaName, pdaNode] of pdaMap) { + const typeName = toPascalCase(pdaName); + const variableSeeds = (pdaNode.seeds ?? []).filter(s => s.kind === 'variablePdaSeedNode'); + const seedsParam = + variableSeeds.length > 0 ? `seeds: ${typeName}PdaSeeds` : `seeds?: Record`; + output += ` ${pdaName}: (${seedsParam}) => Promise;\n`; + } + output += '};\n\n'; + } + + const pdasProp = pdaMap.size > 0 ? ` pdas: ${programName}Pdas;\n` : ''; + output += `/** + * Strongly-typed program client for ${programName}. + */ +export type ${programName}ProgramClient = { + methods: ${programName}Methods; +${pdasProp} programAddress: Address; + root: RootNode; + instructions: Map; +}; +`; + + return output; +} + +/** + * Convert Codama type to TypeScript type string. + */ +function codamaTypeToTS(type: TypeNode | undefined, definedTypes: DefinedTypeNode[]): string { + if (!type || typeof type !== 'object') return 'unknown'; + + switch (type.kind) { + case 'numberTypeNode': + return ['u64', 'u128', 'i64', 'i128'].includes(type.format ?? '') ? 'number | bigint' : 'number'; + case 'publicKeyTypeNode': + return 'Address'; + case 'stringTypeNode': + return 'string'; + case 'booleanTypeNode': + return 'boolean'; + case 'optionTypeNode': + return `${codamaTypeToTS(type.item, definedTypes)} | null`; + case 'remainderOptionTypeNode': + case 'zeroableOptionTypeNode': + return `${codamaTypeToTS(type.item, definedTypes)} | null`; + case 'bytesTypeNode': + return 'Uint8Array'; + case 'fixedSizeTypeNode': + case 'sizePrefixTypeNode': + case 'hiddenPrefixTypeNode': + case 'preOffsetTypeNode': + case 'postOffsetTypeNode': + case 'hiddenSuffixTypeNode': + case 'sentinelTypeNode': + return codamaTypeToTS(type.type, definedTypes); + case 'amountTypeNode': + case 'solAmountTypeNode': + return 'number | bigint'; + case 'structTypeNode': { + if (!type.fields || type.fields.length === 0) return '{}'; + const fields = type.fields + .filter(f => f.defaultValueStrategy !== 'omitted') + .map(f => `${f.name}: ${codamaTypeToTS(f.type, definedTypes)}`); + if (fields.length === 0) return '{}'; + return `{ ${fields.join('; ')} }`; + } + case 'enumTypeNode': { + if (!type.variants || type.variants.length === 0) return 'unknown'; + const allEmpty = type.variants.every(v => v.kind === 'enumEmptyVariantTypeNode'); + if (allEmpty) { + return type.variants.map(v => `'${v.name}'`).join(' | '); + } + // Enum with struct/tuple variants — discriminated union + const variantTypes = type.variants.map(v => { + if (v.kind === 'enumEmptyVariantTypeNode') { + return `{ __kind: '${v.name}' }`; + } + if (v.kind === 'enumStructVariantTypeNode' && v.struct) { + const inner = codamaTypeToTS(v.struct, definedTypes); + return `{ __kind: '${v.name}' } & ${inner}`; + } + if (v.kind === 'enumTupleVariantTypeNode' && v.tuple) { + const inner = codamaTypeToTS(v.tuple, definedTypes); + return `{ __kind: '${v.name}'; fields: ${inner} }`; + } + return `{ __kind: '${v.name}' }`; + }); + return variantTypes.join(' | '); + } + case 'tupleTypeNode': { + if (!type.items || type.items.length === 0) return '[]'; + const items = type.items.map(i => codamaTypeToTS(i, definedTypes)); + return `[${items.join(', ')}]`; + } + case 'arrayTypeNode': + case 'setTypeNode': { + const itemType = codamaTypeToTS(type.item, definedTypes); + const needsParens = itemType.includes(' | ') || itemType.includes(' & '); + return needsParens ? `(${itemType})[]` : `${itemType}[]`; + } + case 'mapTypeNode': { + const v = codamaTypeToTS(type.value, definedTypes); + return `Record`; + } + case 'definedTypeLinkNode': { + if (!type.name) return 'unknown'; + const def = definedTypes.find(d => d.name === type.name); + if (!def) return 'unknown'; + return codamaTypeToTS(def.type, definedTypes); + } + case 'dateTimeTypeNode': { + return codamaTypeToTS(type.number, definedTypes); + } + default: + type['kind'] satisfies never; + return 'unknown'; + } +} + +function collectPdaNodesFromIdl(idl: RootNode): Map { + const pdas = new Map(); + + for (const pda of idl.program.pdas ?? []) { + pdas.set(pda.name, pda); + } + + for (const ix of idl.program.instructions) { + for (const acc of ix.accounts) { + if (!acc.defaultValue || acc.defaultValue.kind !== 'pdaValueNode') continue; + const pdaDef = acc.defaultValue.pda; + if (!pdaDef || pdaDef.kind !== 'pdaNode') continue; + if (!pdas.has(pdaDef.name)) { + pdas.set(pdaDef.name, pdaDef); + } + } + } + + return pdas; +} + +/** + * Collects all unique resolverValueNode names from an instruction's accounts and arguments. + */ +function collectResolverNames(ix: InstructionNode): Set { + const names = new Set(); + + function extractResolverNodeName(node: InstructionInputValueNode | undefined): void { + if (!node) return; + if (node.kind === 'resolverValueNode' && node.name) { + names.add(node.name); + } else if (node.kind === 'conditionalValueNode') { + extractResolverNodeName(node.condition); + extractResolverNodeName(node.ifTrue); + extractResolverNodeName(node.ifFalse); + } + } + + for (const acc of ix.accounts) { + extractResolverNodeName(acc.defaultValue); + } + for (const arg of ix.arguments) { + extractResolverNodeName(arg.defaultValue); + } + + return names; +} + +function toPascalCase(str: string): string { + return str + .split(/[-_]/) + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(''); +} diff --git a/packages/dynamic-client/src/cli/commands/generate-client-types/register-command.ts b/packages/dynamic-client/src/cli/commands/generate-client-types/register-command.ts new file mode 100644 index 000000000..7e6a8d7ae --- /dev/null +++ b/packages/dynamic-client/src/cli/commands/generate-client-types/register-command.ts @@ -0,0 +1,14 @@ +import type { Command } from 'commander'; + +import { generateClientTypesFromFile } from './generate-client-types-from-file'; + +export function registerGenerateClientTypesCommand(program: Command): void { + program + .command('generate-client-types') + .description('Generate TypeScript types from a Codama IDL JSON file') + .argument('', 'Path to a Codama IDL JSON file (e.g., ./idl/codama.json)') + .argument('', 'Path to the output directory for the generated .ts file, e.g., ./generated') + .action((idlArg: string, outputDirArg: string) => { + generateClientTypesFromFile(idlArg, outputDirArg); + }); +} diff --git a/packages/dynamic-client/src/cli/commands/index.ts b/packages/dynamic-client/src/cli/commands/index.ts new file mode 100644 index 000000000..c85642d49 --- /dev/null +++ b/packages/dynamic-client/src/cli/commands/index.ts @@ -0,0 +1,7 @@ +import type { Command } from 'commander'; + +import { registerGenerateClientTypesCommand } from './generate-client-types/register-command'; + +export function registerCommands(program: Command): void { + registerGenerateClientTypesCommand(program); +} diff --git a/packages/dynamic-client/src/cli/index.ts b/packages/dynamic-client/src/cli/index.ts new file mode 100644 index 000000000..88a375bd0 --- /dev/null +++ b/packages/dynamic-client/src/cli/index.ts @@ -0,0 +1,13 @@ +import { createProgram } from './program'; + +const program = createProgram(); + +export function run(argv: string[]): void { + // Show help when invoked with no arguments. + if (argv.length <= 2) { + program.outputHelp(); + return; + } + + program.parse(argv); +} diff --git a/packages/dynamic-client/src/cli/program.ts b/packages/dynamic-client/src/cli/program.ts new file mode 100644 index 000000000..e2dac6bf3 --- /dev/null +++ b/packages/dynamic-client/src/cli/program.ts @@ -0,0 +1,12 @@ +import { Command } from 'commander'; + +import { registerCommands } from './commands'; + +export function createProgram(): Command { + const program = new Command(); + + program.name('dynamic-client').description('CLI for @codama/dynamic-client').showHelpAfterError(true); + + registerCommands(program); + return program; +} diff --git a/packages/dynamic-client/src/index.ts b/packages/dynamic-client/src/index.ts new file mode 100644 index 000000000..ab2d412b3 --- /dev/null +++ b/packages/dynamic-client/src/index.ts @@ -0,0 +1,40 @@ +export type { ProgramDerivedAddress } from '@solana/addresses'; + +export { isPublicKeyLike, toAddress } from './shared/address'; +export type { AddressInput, PublicKeyLike } from './shared/address'; + +export { CodamaError, isCodamaError } from '@codama/errors'; +export { + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY, + CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, + CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, +} from '@codama/errors'; + +export type { AccountsInput, ArgumentsInput } from './shared/types'; + +export { createProgramClient } from './program-client/create-program-client'; +export type { + CreateProgramClientOptions, + IdlInput, + ProgramClient, + ProgramMethodBuilder, +} from './program-client/create-program-client'; + +export { generateClientTypes } from './cli/commands/generate-client-types/generate-client-types'; diff --git a/packages/dynamic-client/src/instruction-encoding/accounts/create-account-meta.ts b/packages/dynamic-client/src/instruction-encoding/accounts/create-account-meta.ts new file mode 100644 index 000000000..056fc47b6 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/accounts/create-account-meta.ts @@ -0,0 +1,181 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { Address } from '@solana/addresses'; +import type { AccountMeta } from '@solana/instructions'; +import { AccountRole } from '@solana/instructions'; +import { type InstructionAccountNode, type InstructionNode, isNode, type RootNode } from 'codama'; + +import { isConvertibleAddress, toAddress } from '../../shared/address'; +import type { AccountsInput, ArgumentsInput, EitherSigners, ResolversInput } from '../../shared/types'; +import { formatValueType, safeStringify } from '../../shared/util'; +import { resolveAccountAddress } from '../resolvers/resolve-account-address'; + +type ResolvedAccount = { + address: Address | null; + optional: boolean; + role: AccountRole; +}; + +type ResolvedAccountWithAddress = ResolvedAccount & { address: Address }; + +/** + * Resolves account addresses and creates AccountMeta for each account in the instruction by evaluating their default values. + * Handles optional accounts based on the instruction's optionalAccountStrategy. + * Throws errors if required accounts are missing or cannot be resolved. + */ +export async function createAccountMeta( + root: RootNode, + ixNode: InstructionNode, + argumentsInput: ArgumentsInput = {}, + accountsInput: AccountsInput = {}, + signers: EitherSigners = [], + resolversInput: ResolversInput = {}, +): Promise { + const programAddress = toAddress(root.program.publicKey); + const resolvedAccounts = await Promise.all( + ixNode.accounts.map>(async ixAccountNode => { + const accountAddressInput = accountsInput?.[ixAccountNode.name]; + + const isAccountProvided = accountAddressInput !== undefined && accountAddressInput !== null; + // Accounts with default values can be omitted, as they can be resolved from default value + if (!isAccountProvided && !ixAccountNode.isOptional && !ixAccountNode.defaultValue) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, { + accountName: ixAccountNode.name, + instructionName: ixNode.name, + }); + } + + let resolvedAccountAddress: Address | null = null; + if (!isAccountProvided) { + resolvedAccountAddress = await resolveAccountAddress({ + accountAddressInput, + accountsInput, + argumentsInput, + ixAccountNode, + ixNode, + resolutionPath: [], + resolversInput, + root, + }); + } + + const finalAddress = isAccountProvided ? toAddress(accountAddressInput) : resolvedAccountAddress; + + // Optional accounts resolved via "programId" optionalAccountStrategy get the program address, + // which cannot be writable on-chain — downgrade to readonly. + // E.g. PMP's setData instruction `buffer` account. (isWritable, isOptional and "programId" strategy). + // But when buffer is null it resolves to the program address which cannot be writable, hence must be downgraded to readonly. + const role = + ixAccountNode.isOptional && + !isAccountProvided && + ixNode.optionalAccountStrategy === 'programId' && + finalAddress === programAddress + ? getReadonlyAccountRole(ixAccountNode, signers) + : getAccountRole(ixAccountNode, signers); + + return { + address: finalAddress, + optional: Boolean(ixAccountNode.isOptional), + role, + }; + }), + ); + + const accountMetas: AccountMeta[] = resolvedAccounts + // Filter out optional accounts with "omitted" strategy (nulls). + .filter((acc): acc is ResolvedAccountWithAddress => acc.address !== null) + .map(acc => ({ + address: acc.address, + role: acc.role, + })); + + // Resolve remaining accounts from argument values + // https://github.com/codama-idl/codama/blob/main/packages/nodes/docs/InstructionRemainingAccountsNode.md + for (const remainingNode of ixNode.remainingAccounts ?? []) { + if (!isNode(remainingNode.value, 'argumentValueNode')) { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['argumentValueNode'], + kind: remainingNode.value.kind, + node: remainingNode.value, + }); + } + const addresses = argumentsInput[remainingNode.value.name]; + + if (addresses === undefined) { + // Required remaining accounts must be provided. + if (!remainingNode.isOptional) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, { + argumentName: remainingNode.value.name, + instructionName: ixNode.name, + }); + } + // Optional remaining accounts can be safely omitted. + continue; + } + + if (!Array.isArray(addresses)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT, { + argumentName: remainingNode.value.name, + expectedType: 'Address[]', + value: safeStringify(addresses), + }); + } + const role = getRemainingAccountRole(remainingNode.isSigner, remainingNode.isWritable); + for (let i = 0; i < addresses.length; i++) { + const addr: unknown = addresses[i]; + if (!isConvertibleAddress(addr)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, { + accountName: `${remainingNode.value.name}[${i}]`, + actualType: formatValueType(addr), + expectedType: 'Address | PublicKey', + }); + } + accountMetas.push({ address: toAddress(addr), role }); + } + } + + return accountMetas; +} + +// TODO: 'either' is treated as signer — this works for Token Program multisig signers, +// but may need refinement for programs where 'either' accounts are sometimes non-signers. +function getRemainingAccountRole(isSigner?: boolean | 'either', isWritable?: boolean): AccountRole { + const signer = isSigner === true || isSigner === 'either'; + const writable = isWritable === true; + if (writable && signer) return AccountRole.WRITABLE_SIGNER; + if (writable) return AccountRole.WRITABLE; + if (signer) return AccountRole.READONLY_SIGNER; + return AccountRole.READONLY; +} + +function getAccountRole(acc: InstructionAccountNode, signers: string[] | undefined): AccountRole { + const isSigner = isSignerAccount(acc, signers ?? []); + if (acc.isWritable && isSigner) { + return AccountRole.WRITABLE_SIGNER; + } + if (acc.isWritable) { + return AccountRole.WRITABLE; + } + if (isSigner) { + return AccountRole.READONLY_SIGNER; + } + return AccountRole.READONLY; +} + +function getReadonlyAccountRole(acc: InstructionAccountNode, signers: string[] | undefined): AccountRole { + const isSigner = isSignerAccount(acc, signers ?? []); + return isSigner ? AccountRole.READONLY_SIGNER : AccountRole.READONLY; +} + +function isSignerAccount(acc: InstructionAccountNode, signers: string[]) { + if (acc.isSigner === 'either') { + return signers.includes(acc.name); + } + return acc.isSigner === true; +} diff --git a/packages/dynamic-client/src/instruction-encoding/accounts/index.ts b/packages/dynamic-client/src/instruction-encoding/accounts/index.ts new file mode 100644 index 000000000..c5f1a1f47 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/accounts/index.ts @@ -0,0 +1,2 @@ +export { createAccountMeta } from './create-account-meta'; +export { createAccountsInputValidator } from './validate-accounts-input'; diff --git a/packages/dynamic-client/src/instruction-encoding/accounts/validate-accounts-input.ts b/packages/dynamic-client/src/instruction-encoding/accounts/validate-accounts-input.ts new file mode 100644 index 000000000..7eb7f30e3 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/accounts/validate-accounts-input.ts @@ -0,0 +1,49 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, + CodamaError, +} from '@codama/errors'; +import { camelCase, type InstructionNode } from 'codama'; +import { assert, StructError } from 'superstruct'; + +import type { AccountsInput } from '../../shared/types'; +import { safeStringify } from '../../shared/util'; +import { createIxAccountsValidator } from '../validators'; + +/** + * Creates a validation function for InstructionAccountNodes. + * Pre-built superstruct validator ensures all required accounts are provided and have valid addresses. + * Skips validation for instructions without accounts. + */ +export function createAccountsInputValidator(ixNode: InstructionNode) { + const validator = ixNode.accounts.length ? createIxAccountsValidator(ixNode.accounts) : null; + + return (accountsInput: AccountsInput = {}) => { + if (!validator) return; + + try { + assert(accountsInput, validator); + } catch (error) { + if (error instanceof StructError) { + const key = error.key as string; + const value = error.value as unknown; + if (value == null) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, { + accountName: camelCase(key), + instructionName: ixNode.name, + }); + } else { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, { + accountName: camelCase(key), + value: safeStringify(value), + }); + } + } + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, { + cause: error, + message: 'Unexpected validation error', + }); + } + }; +} diff --git a/packages/dynamic-client/src/instruction-encoding/arguments/encode-instruction-arguments.ts b/packages/dynamic-client/src/instruction-encoding/arguments/encode-instruction-arguments.ts new file mode 100644 index 000000000..bedd3d85d --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/arguments/encode-instruction-arguments.ts @@ -0,0 +1,115 @@ +import { getNodeCodec, type ReadonlyUint8Array } from '@codama/dynamic-codecs'; +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import { type Codec, mergeBytes } from '@solana/codecs'; +import type { InstructionNode, RootNode } from 'codama'; +import { visitOrElse } from 'codama'; + +import type { ArgumentsInput } from '../../shared/types'; +import { + createDefaultValueEncoderVisitor, + createInputValueTransformer, + DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS, +} from '../visitors'; +import { isOmittedArgument, isOptionalArgument } from './shared'; + +/** + * Encodes all instruction arguments into a single byte array. + * Iterates over each InstructionArgumentNode and encodes based on its category: + * + * Omitted arguments use their default value. + * Optional arguments are encoded as null. + * Required arguments are transformed from user input and then encoded. + */ +export function encodeInstructionArguments( + root: RootNode, + ix: InstructionNode, + argumentsInput: ArgumentsInput = {}, +): ReadonlyUint8Array { + const chunks = ix.arguments.map(ixArgumentNode => { + const input = argumentsInput?.[ixArgumentNode.name]; + const nodeCodec = getNodeCodec([root, root.program, ix, ixArgumentNode]); + if (isOmittedArgument(ixArgumentNode)) { + return encodeOmittedArgument(ix, ixArgumentNode, nodeCodec); + } else if (isOptionalArgument(ixArgumentNode, input)) { + return encodeOptionalArgument(ix, ixArgumentNode, nodeCodec); + } else { + return encodeRequiredArgument(root, ix, ixArgumentNode, input, nodeCodec); + } + }); + + return mergeBytes(chunks as Uint8Array[]); +} + +function encodeOmittedArgument( + ix: InstructionNode, + ixArgumentNode: InstructionNode['arguments'][number], + nodeCodec: Codec, +): ReadonlyUint8Array { + const defaultValue = ixArgumentNode.defaultValue; + if (defaultValue === undefined) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING, { + argumentName: ixArgumentNode.name, + instructionName: ix.name, + }); + } + + const visitor = createDefaultValueEncoderVisitor(nodeCodec); + return visitOrElse(defaultValue, visitor, node => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS], + kind: node.kind, + node, + }); + }); +} + +function encodeOptionalArgument( + ix: InstructionNode, + ixArgumentNode: InstructionNode['arguments'][number], + nodeCodec: Codec, +): ReadonlyUint8Array { + try { + return nodeCodec.encode(null); + } catch (error) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT, { + argumentName: ixArgumentNode.name, + cause: error, + instructionName: ix.name, + }); + } +} + +function encodeRequiredArgument( + root: RootNode, + ix: InstructionNode, + ixArgumentNode: InstructionNode['arguments'][number], + input: ArgumentsInput[string], + nodeCodec: Codec, +): ReadonlyUint8Array { + if (input === undefined) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, { + argumentName: ixArgumentNode.name, + instructionName: ix.name, + }); + } + + const transformer = createInputValueTransformer(ixArgumentNode.type, root, { + bytesEncoding: 'base16', + }); + const transformedInput = transformer(input); + try { + return nodeCodec.encode(transformedInput); + } catch (error) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT, { + argumentName: ixArgumentNode.name, + cause: error, + instructionName: ix.name, + }); + } +} diff --git a/packages/dynamic-client/src/instruction-encoding/arguments/index.ts b/packages/dynamic-client/src/instruction-encoding/arguments/index.ts new file mode 100644 index 000000000..d674d812a --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/arguments/index.ts @@ -0,0 +1,3 @@ +export { encodeInstructionArguments } from './encode-instruction-arguments'; +export { createArgumentsInputValidator } from './validate-arguments-input'; +export { resolveArgumentDefaultsFromCustomResolvers } from './resolve-argument-from-custom-resolvers'; diff --git a/packages/dynamic-client/src/instruction-encoding/arguments/resolve-argument-from-custom-resolvers.ts b/packages/dynamic-client/src/instruction-encoding/arguments/resolve-argument-from-custom-resolvers.ts new file mode 100644 index 000000000..7a92ae77e --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/arguments/resolve-argument-from-custom-resolvers.ts @@ -0,0 +1,46 @@ +import { CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, CodamaError } from '@codama/errors'; +import type { InstructionNode } from 'codama'; +import { isNode } from 'codama'; + +import type { AccountsInput, ArgumentsInput, ResolversInput } from '../../shared/types'; +import { isOmittedArgument } from './shared'; + +/** + * Resolves argument defaults from user-provided resolvers. + * For each argument that has a ResolverValueNode and is not provided by argumentsInput, + * try to invoke the corresponding resolver function and fill ArgumentsInput with the resolved values. + */ +export async function resolveArgumentDefaultsFromCustomResolvers( + ixNode: InstructionNode, + argumentsInput: ArgumentsInput = {}, + accountsInput: AccountsInput = {}, + resolversInput: ResolversInput = {}, +): Promise { + const resolvedArgumentsInput = { ...argumentsInput }; + + const allArguments = [...ixNode.arguments, ...(ixNode.extraArguments ?? [])]; + for (const argumentNode of allArguments) { + if (resolvedArgumentsInput[argumentNode.name] !== undefined) continue; + if (isOmittedArgument(argumentNode)) continue; + if (!isNode(argumentNode.defaultValue, 'resolverValueNode')) continue; + + const resolverFn = resolversInput[argumentNode.defaultValue.name]; + // If no resolver provided — skip and let the encoding step handle it: + // Optional arguments will be encoded as none + // Required arguments will emit error + if (!resolverFn) continue; + + try { + resolvedArgumentsInput[argumentNode.name] = await resolverFn(resolvedArgumentsInput, accountsInput); + } catch (error) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, { + cause: error, + resolverName: argumentNode.defaultValue.name, + targetKind: 'instructionArgumentNode', + targetName: argumentNode.name, + }); + } + } + + return resolvedArgumentsInput; +} diff --git a/packages/dynamic-client/src/instruction-encoding/arguments/shared.ts b/packages/dynamic-client/src/instruction-encoding/arguments/shared.ts new file mode 100644 index 000000000..38f84e364 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/arguments/shared.ts @@ -0,0 +1,11 @@ +import type { InstructionArgumentNode } from 'codama'; + +import { OPTIONAL_NODE_KINDS } from '../../shared/nodes'; + +export function isOmittedArgument(node: InstructionArgumentNode) { + return node.defaultValueStrategy === 'omitted'; +} + +export function isOptionalArgument(ixArgumentNode: InstructionArgumentNode, input: unknown) { + return OPTIONAL_NODE_KINDS.includes(ixArgumentNode.type.kind) && (input === null || input === undefined); +} diff --git a/packages/dynamic-client/src/instruction-encoding/arguments/validate-arguments-input.ts b/packages/dynamic-client/src/instruction-encoding/arguments/validate-arguments-input.ts new file mode 100644 index 000000000..1dff479c0 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/arguments/validate-arguments-input.ts @@ -0,0 +1,110 @@ +import { CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, CodamaError } from '@codama/errors'; +import type { InstructionNode, RootNode } from 'codama'; +import type { Failure } from 'superstruct'; +import { assert, StructError } from 'superstruct'; + +import type { ArgumentsInput } from '../../shared/types'; +import { safeStringify } from '../../shared/util'; +import { createIxArgumentsValidator } from '../validators'; +import { isOmittedArgument } from './shared'; + +/** + * Creates a cached validation function for InstructionArgumentNodes. + * + * Skips "omitted" arguments. + * Arguments with resolverValueNode defaults are expected to use optionTypeNode and NOT filtered out here. + * Optional validation allows undefined so custom resolvers will fill default values after validation. + */ +export function createArgumentsInputValidator(root: RootNode, ixNode: InstructionNode) { + const requiredArguments = ixNode.arguments.filter(arg => arg?.defaultValueStrategy !== 'omitted'); + const validator = requiredArguments.length + ? createIxArgumentsValidator(ixNode.name, requiredArguments, root.program.definedTypes) + : null; + + return (argumentsInput: ArgumentsInput = {}) => { + // Ensure arguments with "omitted" defaultValueStrategy are not provided in argumentsInput. + validateOmittedArguments(ixNode, argumentsInput); + + if (!validator) return; + + const filteredInput = filterRemainingAccountArguments(ixNode, argumentsInput); + + try { + assert(filteredInput, validator); + } catch (error) { + if (!(error instanceof StructError)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, { + cause: error, + message: 'Unexpected validation error', + }); + } + const formattedMessage = error.failures().map(failure => { + const fieldPath = formatFailurePath(failure); + const value = formatFailureValue(failure.value); + return `Invalid argument "${fieldPath}", value: ${value}. ${failure.message}\n`; + }); + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, { + cause: error, + message: formattedMessage.join(''), + }); + } + }; +} + +/** + * Formats a full dotted path from failure, e.g. "command", "innerStruct.pubkey", "enumsArray[1]" + */ +function formatFailurePath(failure: Failure): string { + const path = failure.path; + if (!path || path.length === 0) return String(failure.key ?? ''); + return path + .map((segment, i) => { + if (typeof segment === 'number') { + return `[${segment}]`; + } + return `${i === 0 ? '' : '.'}${String(segment)}`; + }) + .join(''); +} + +/** + * Formats failure values for error messages, truncating long values and stringifying objects. + */ +const MAX_VALUE_LENGTH = 120; +function formatFailureValue(value: unknown): string { + const raw = typeof value === 'object' ? safeStringify(value) : String(value as unknown); + return raw.length > MAX_VALUE_LENGTH ? `${raw.slice(0, MAX_VALUE_LENGTH)}...` : raw; +} + +/** + * Ensures that arguments with "omitted" defaultValueStrategy are not provided by the user (e.g. discriminator). + */ +function validateOmittedArguments(ixNode: InstructionNode, argumentsInput: ArgumentsInput = {}) { + ixNode.arguments.filter(isOmittedArgument).forEach(ixArgumentNode => { + if (Object.hasOwn(argumentsInput, ixArgumentNode.name)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, { + message: 'Omitted argument must not be provided', + }); + } + }); +} + +function getRemainingAccountArgNames(ixNode: InstructionNode): string[] { + return (ixNode.remainingAccounts ?? []) + .filter(node => node.value.kind === 'argumentValueNode') + .map(node => node.value.name); +} + +/** + * Filters out remaining account argument names from the arguments input. + * So superstruct's object() doesn't reject them as extra keys. + */ +function filterRemainingAccountArguments(ixNode: InstructionNode, argumentsInput: ArgumentsInput): ArgumentsInput { + const remainingAccountArgNames = getRemainingAccountArgNames(ixNode); + if (!remainingAccountArgNames.length) { + return argumentsInput; + } + + const remainingAccountArgNamesSet = new Set(remainingAccountArgNames); + return Object.fromEntries(Object.entries(argumentsInput).filter(([key]) => !remainingAccountArgNamesSet.has(key))); +} diff --git a/packages/dynamic-client/src/instruction-encoding/index.ts b/packages/dynamic-client/src/instruction-encoding/index.ts new file mode 100644 index 000000000..958a5b3d6 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/index.ts @@ -0,0 +1,22 @@ +// accounts +export { createAccountMeta } from './accounts/create-account-meta'; +export { createAccountsInputValidator } from './accounts/validate-accounts-input'; + +// arguments +export { encodeInstructionArguments } from './arguments/encode-instruction-arguments'; +export { createArgumentsInputValidator } from './arguments/validate-arguments-input'; +export { resolveArgumentDefaultsFromCustomResolvers } from './arguments/resolve-argument-from-custom-resolvers'; + +// visitors +export { + ACCOUNT_DEFAULT_VALUE_SUPPORTED_NODE_KINDS, + createAccountDefaultValueVisitor, +} from './visitors/account-default-value'; +export { createConditionNodeValueVisitor } from './visitors/condition-node-value'; +export { + createDefaultValueEncoderVisitor, + DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS, +} from './visitors/default-value-encoder'; +export { createInputValueTransformer, createInputValueTransformerVisitor } from './visitors/input-value-transformer'; +export { createPdaSeedValueVisitor, PDA_SEED_VALUE_SUPPORTED_NODE_KINDS } from './visitors/pda-seed-value'; +export { createValueNodeVisitor, VALUE_NODE_SUPPORTED_NODE_KINDS } from './visitors/value-node-value'; diff --git a/packages/dynamic-client/src/instruction-encoding/instructions.ts b/packages/dynamic-client/src/instruction-encoding/instructions.ts new file mode 100644 index 000000000..91e4d55cc --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/instructions.ts @@ -0,0 +1,53 @@ +import { address } from '@solana/addresses'; +import type { InstructionNode, RootNode } from 'codama'; + +import type { BuildIxFn } from '../shared/types'; +import { createAccountMeta, createAccountsInputValidator } from './accounts'; +import { + createArgumentsInputValidator, + encodeInstructionArguments, + resolveArgumentDefaultsFromCustomResolvers, +} from './arguments'; + +/** + * Creates an instruction builder for a given InstructionNode. + */ +export function createIxBuilder(root: RootNode, ixNode: InstructionNode): BuildIxFn { + const programAddress = address(root.program.publicKey); + const validateArguments = createArgumentsInputValidator(root, ixNode); + const validateAccounts = createAccountsInputValidator(ixNode); + + return async (argumentsInput, accountsInput, signers, resolversInput) => { + // Validate arguments according to Codama schema. + validateArguments(argumentsInput); + + // Ensure required accounts are present and validate provided pubkey addresses. + validateAccounts(accountsInput); + + // Resolve arguments that depend on custom resolvers. + const enrichedArgumentsInput = await resolveArgumentDefaultsFromCustomResolvers( + ixNode, + argumentsInput, + accountsInput, + resolversInput, + ); + + // Encode arguments into buffer. + const argumentsData = encodeInstructionArguments(root, ixNode, enrichedArgumentsInput); + + const accountsData = await createAccountMeta( + root, + ixNode, + enrichedArgumentsInput, + accountsInput, + signers, + resolversInput, + ); + + return { + accounts: accountsData, + data: argumentsData, + programAddress, + }; + }; +} diff --git a/packages/dynamic-client/src/instruction-encoding/resolvers/index.ts b/packages/dynamic-client/src/instruction-encoding/resolvers/index.ts new file mode 100644 index 000000000..954fbecf3 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/resolvers/index.ts @@ -0,0 +1,5 @@ +export { resolveAccountAddress } from './resolve-account-address'; +export { resolveAccountValueNodeAddress } from './resolve-account-value-node-address'; +export { resolveConditionalValueNodeCondition } from './resolve-conditional'; +export { resolvePDAAddress } from './resolve-pda-address'; +export type { BaseResolutionContext, ResolutionPath } from './types'; diff --git a/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-account-address.ts b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-account-address.ts new file mode 100644 index 000000000..a5170e7c6 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-account-address.ts @@ -0,0 +1,105 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { Address } from '@solana/addresses'; +import type { InstructionAccountNode, InstructionNode, RootNode } from 'codama'; +import { visitOrElse } from 'codama'; + +import { type AddressInput, toAddress } from '../../shared/address'; +import { safeStringify } from '../../shared/util'; +import { + ACCOUNT_DEFAULT_VALUE_SUPPORTED_NODE_KINDS, + createAccountDefaultValueVisitor, +} from '../visitors/account-default-value'; +import type { BaseResolutionContext } from './types'; + +type ResolveAccountAddressContext = BaseResolutionContext & { + accountAddressInput?: AddressInput | null | undefined; + ixAccountNode: InstructionAccountNode; +}; + +/** + * Resolves the address of an instruction account node via either defaultValue or optionalAccountStrategy. + */ +export async function resolveAccountAddress({ + root, + ixNode, + ixAccountNode, + argumentsInput, + accountsInput, + resolutionPath, + resolversInput, + accountAddressInput, +}: ResolveAccountAddressContext): Promise
{ + // Optional accounts explicitly provided as null should be resolved based on optionalAccountStrategy + if (accountAddressInput === null && ixAccountNode.isOptional) { + return resolveOptionalAccountWithStrategy(root, ixNode, ixAccountNode); + } + + if (ixAccountNode.defaultValue) { + const visitor = createAccountDefaultValueVisitor({ + accountAddressInput, + accountsInput, + argumentsInput, + ixAccountNode, + ixNode, + resolutionPath, + resolversInput, + root, + }); + + const addressValue = await visitOrElse(ixAccountNode.defaultValue, visitor, node => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...ACCOUNT_DEFAULT_VALUE_SUPPORTED_NODE_KINDS], + kind: node.kind, + node, + }); + }); + + // conditionalValueNode with ifFalse branch returns null. + // This should be resolved via optionalAccountStrategy for optional accounts. + if (addressValue === null && ixAccountNode.isOptional) { + return resolveOptionalAccountWithStrategy(root, ixNode, ixAccountNode); + } + + return addressValue; + } + + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, { + accountName: ixAccountNode.name, + instructionName: ixNode.name, + }); +} + +/** + * Optional account resolution via instruction strategy. + * With "programId" strategy, optional accounts are resolved to programId. + * With "omitted" strategy, optional accounts must be excluded from accounts list. + */ +function resolveOptionalAccountWithStrategy( + root: RootNode, + ixNode: InstructionNode, + ixAccountNode: InstructionAccountNode, +) { + if (!ixAccountNode.isOptional) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, { + message: `resolveOptionalAccountWithStrategy called for non-optional account: ${ixAccountNode.name}`, + }); + } + switch (ixNode.optionalAccountStrategy) { + case 'omitted': + return null; + case 'programId': + return toAddress(root.program.publicKey); + default: + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY, { + accountName: ixAccountNode.name, + instructionName: ixNode.name, + strategy: safeStringify(ixNode.optionalAccountStrategy), + }); + } +} diff --git a/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-account-value-node-address.ts b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-account-value-node-address.ts new file mode 100644 index 000000000..c80f394f4 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-account-value-node-address.ts @@ -0,0 +1,63 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY, + CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, + CodamaError, +} from '@codama/errors'; +import type { Address } from '@solana/addresses'; +import type { AccountValueNode } from 'codama'; + +import { toAddress } from '../../shared/address'; +import { resolveAccountAddress } from './resolve-account-address'; +import type { BaseResolutionContext, ResolutionPath } from './types'; + +/** + * Resolves an AccountValueNode reference to an Address. + * + * Shared logic for resolving account references across visitors: + * Checks if the user provided the account address in accountsInput. + * Finds the referenced InstructionAccountNode. + * Delegates to resolveAccountAddress for default value resolution. + */ +export async function resolveAccountValueNodeAddress( + node: AccountValueNode, + ctx: BaseResolutionContext, +): Promise
{ + const { accountsInput, ixNode, resolutionPath } = ctx; + + // Check if user provided the account address. + const providedAddress = accountsInput?.[node.name]; + if (providedAddress !== undefined && providedAddress !== null) { + return toAddress(providedAddress); + } + + // Find the referenced account in the instruction. + const referencedIxAccountNode = ixNode.accounts.find(acc => acc.name === node.name); + if (!referencedIxAccountNode) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, { + instructionName: ixNode.name, + referencedName: node.name, + }); + } + + // Detect circular dependencies before recursing. + detectCircularDependency(node.name, resolutionPath); + + return await resolveAccountAddress({ + accountAddressInput: providedAddress, + accountsInput: ctx.accountsInput, + argumentsInput: ctx.argumentsInput, + ixAccountNode: referencedIxAccountNode, + ixNode, + resolutionPath: [...resolutionPath, node.name], + resolversInput: ctx.resolversInput, + root: ctx.root, + }); +} + +export function detectCircularDependency(nodeName: string, resolutionPath: ResolutionPath) { + if (resolutionPath.includes(nodeName)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY, { + chain: [...resolutionPath, nodeName].join(' -> '), + }); + } +} diff --git a/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-conditional.ts b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-conditional.ts new file mode 100644 index 000000000..03d3f5264 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-conditional.ts @@ -0,0 +1,86 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { ConditionalValueNode, InstructionAccountNode, InstructionInputValueNode } from 'codama'; +import { isNode, visitOrElse } from 'codama'; + +import { getMaybeNodeKind } from '../../shared/util'; +import { CONDITION_NODE_SUPPORTED_NODE_KINDS, createConditionNodeValueVisitor } from '../visitors/condition-node-value'; +import { createValueNodeVisitor, VALUE_NODE_SUPPORTED_NODE_KINDS } from '../visitors/value-node-value'; +import type { BaseResolutionContext } from './types'; + +export type ResolveConditionalContext = BaseResolutionContext & { + conditionalValueNode: ConditionalValueNode; + ixAccountNode: InstructionAccountNode; +}; + +/** + * Evaluates a ConditionalValueNode's condition. + * Returns the matching branch (ifTrue or ifFalse) as an InstructionInputValueNode or undefined if no branch matches. + */ +export async function resolveConditionalValueNodeCondition({ + root, + ixNode, + ixAccountNode, + conditionalValueNode, + argumentsInput, + accountsInput, + resolutionPath, + resolversInput, +}: ResolveConditionalContext): Promise { + if (!isNode(conditionalValueNode, 'conditionalValueNode')) { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['conditionalValueNode'], + kind: getMaybeNodeKind(conditionalValueNode), + node: conditionalValueNode, + }); + } + const { condition, value: expectedValueNode, ifTrue, ifFalse } = conditionalValueNode; + + if (!expectedValueNode && !ifTrue && !ifFalse) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, { + message: `Invalid conditionalValueNode: missing value and branches for account ${ixAccountNode.name} in ${ixNode.name}`, + }); + } + + // Resolve the condition value of ConditionalValueNode. + const conditionVisitor = createConditionNodeValueVisitor({ + accountsInput, + argumentsInput, + ixNode, + resolutionPath, + resolversInput, + root, + }); + const actualProvidedValue = await visitOrElse(condition, conditionVisitor, condNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...CONDITION_NODE_SUPPORTED_NODE_KINDS], + kind: condNode.kind, + node: condNode, + }); + }); + + if (!expectedValueNode) { + return actualProvidedValue ? ifTrue : ifFalse; + } + + // If expectedValueNode exists, the condition must be equal to expected value. + const valueVisitor = createValueNodeVisitor(); + const expectedValue = visitOrElse(expectedValueNode, valueVisitor, valueNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: valueNode.kind, + node: valueNode, + }); + }); + + if (typeof expectedValue.value === 'object' || typeof actualProvidedValue === 'object') { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, { + message: 'Deep equality comparison not yet supported for conditional value', + }); + } + + return actualProvidedValue === expectedValue.value ? ifTrue : ifFalse; +} diff --git a/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-pda-address.ts b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-pda-address.ts new file mode 100644 index 000000000..0ca8e2f43 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/resolvers/resolve-pda-address.ts @@ -0,0 +1,214 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, + CODAMA_ERROR__LINKED_NODE_NOT_FOUND, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { Address, ProgramDerivedAddress } from '@solana/addresses'; +import { address, getProgramDerivedAddress } from '@solana/addresses'; +import type { ReadonlyUint8Array } from '@solana/codecs'; +import type { Node, PdaNode, PdaSeedValueNode, PdaValueNode, RegisteredPdaSeedNode, VariablePdaSeedNode } from 'codama'; +import { isNode, visitOrElse } from 'codama'; + +import { getMaybeNodeKind } from '../../shared/util'; +import { createPdaSeedValueVisitor, PDA_SEED_VALUE_SUPPORTED_NODE_KINDS } from '../visitors/pda-seed-value'; +import type { BaseResolutionContext } from './types'; + +export type ResolvePDAAddressContext = BaseResolutionContext & { + pdaValueNode: PdaValueNode; +}; + +/** + * Derives a PDA from a PdaValueNode. + * Encodes each seed (ConstantPdaSeedNode and VariablePdaSeedNode) into bytes and computes the address. + */ +export async function resolvePDAAddress({ + root, + ixNode, + argumentsInput = {}, + accountsInput = {}, + pdaValueNode, + resolutionPath, + resolversInput, +}: ResolvePDAAddressContext): Promise { + if (!isNode(pdaValueNode, 'pdaValueNode')) { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['pdaValueNode'], + kind: getMaybeNodeKind(pdaValueNode), + node: pdaValueNode, + }); + } + + const pdaNode = resolvePdaNode(pdaValueNode, root.program.pdas); + const programId = address(pdaNode.programId || root.program.publicKey); + + const seedValues = await Promise.all( + pdaNode.seeds.map(async seedNode => { + if (seedNode.kind === 'constantPdaSeedNode') { + return await resolveConstantPdaSeed({ + accountsInput, + argumentsInput, + ixNode, + programId, + resolutionPath, + resolversInput, + root, + seedNode, + }); + } + + if (seedNode.kind === 'variablePdaSeedNode') { + const variableSeedValueNodes = pdaValueNode.seeds; + const seedName = seedNode.name; + const variableSeedValueNode = variableSeedValueNodes.find(node => node.name === seedName); + + if (!variableSeedValueNode) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, { + instructionName: ixNode.name, + referencedName: seedName, + }); + } + + return await resolveVariablePdaSeed({ + accountsInput, + argumentsInput, + ixNode, + programId, + resolutionPath, + resolversInput, + root, + seedNode, + variableSeedValueNode, + }); + } + + throw new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { + kind: getMaybeNodeKind(seedNode) ?? 'unknown', + }); + }), + ); + + return await getProgramDerivedAddress({ + programAddress: programId, + seeds: seedValues, + }); +} + +function resolvePdaNode(pdaDefaultValue: PdaValueNode, pdas: PdaNode[]): PdaNode { + if (isNode(pdaDefaultValue.pda, 'pdaLinkNode')) { + const linkedPda = pdas.find(p => p.name === pdaDefaultValue.pda.name); + if (!linkedPda) { + throw new CodamaError(CODAMA_ERROR__LINKED_NODE_NOT_FOUND, { + kind: 'pdaLinkNode', + linkNode: pdaDefaultValue.pda, + name: pdaDefaultValue.pda.name, + path: [], + }); + } + return linkedPda; + } + + if (isNode(pdaDefaultValue.pda, 'pdaNode')) { + return pdaDefaultValue.pda; + } + + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['pdaLinkNode', 'pdaNode'], + kind: getMaybeNodeKind(pdaDefaultValue.pda), + node: pdaDefaultValue.pda, + }); +} + +type ResolvePdaSeedContext = BaseResolutionContext & { + programId: Address; + seedNode: VariablePdaSeedNode; + variableSeedValueNode: PdaSeedValueNode; +}; +function resolveVariablePdaSeed({ + accountsInput = {}, + argumentsInput = {}, + ixNode, + programId, + resolutionPath, + resolversInput, + root, + seedNode, + variableSeedValueNode, +}: ResolvePdaSeedContext): Promise { + if (!isNode(variableSeedValueNode, 'pdaSeedValueNode')) { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['pdaSeedValueNode'], + kind: getMaybeNodeKind(variableSeedValueNode), + node: variableSeedValueNode as Node, + }); + } + + if (seedNode.name !== variableSeedValueNode.name) { + // Sanity check: this should not happen. + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, { + message: `Mismatched PDA seed names: expected [${seedNode.name}], got [${variableSeedValueNode.name}]`, + }); + } + + const visitor = createPdaSeedValueVisitor({ + accountsInput, + argumentsInput, + ixNode, + programId, + resolutionPath, + resolversInput, + root, + seedTypeNode: seedNode.type, + }); + + return visitOrElse(variableSeedValueNode.value, visitor, node => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...PDA_SEED_VALUE_SUPPORTED_NODE_KINDS], + kind: node.kind, + node, + }); + }); +} + +type ResolveConstantPdaSeedContext = BaseResolutionContext & { + programId: Address; + seedNode: RegisteredPdaSeedNode; +}; +function resolveConstantPdaSeed({ + accountsInput, + argumentsInput, + ixNode, + programId, + resolutionPath, + resolversInput, + root, + seedNode, +}: ResolveConstantPdaSeedContext): Promise { + if (!isNode(seedNode, 'constantPdaSeedNode')) { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['constantPdaSeedNode'], + kind: seedNode.kind, + node: seedNode, + }); + } + + const visitor = createPdaSeedValueVisitor({ + accountsInput, + argumentsInput, + ixNode, + programId, + resolutionPath, + resolversInput, + root, + seedTypeNode: seedNode.type, + }); + return visitOrElse(seedNode.value, visitor, node => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...PDA_SEED_VALUE_SUPPORTED_NODE_KINDS], + kind: node.kind, + node, + }); + }); +} diff --git a/packages/dynamic-client/src/instruction-encoding/resolvers/types.ts b/packages/dynamic-client/src/instruction-encoding/resolvers/types.ts new file mode 100644 index 000000000..fc37639a3 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/resolvers/types.ts @@ -0,0 +1,19 @@ +import type { InstructionNode, RootNode } from 'codama'; + +import type { AccountsInput, ArgumentsInput, ResolversInput } from '../../shared/types'; + +// Array of node names being resolved to detect circular dependencies. +export type ResolutionPath = readonly string[]; + +/** + * Shared context threaded through the account/PDA resolution pipeline. + * Individual resolvers/visitors extend this with domain-specific fields. + */ +export type BaseResolutionContext = { + accountsInput: AccountsInput | undefined; + argumentsInput: ArgumentsInput | undefined; + ixNode: InstructionNode; + resolutionPath: ResolutionPath; + resolversInput: ResolversInput | undefined; + root: RootNode; +}; diff --git a/packages/dynamic-client/src/instruction-encoding/validators.ts b/packages/dynamic-client/src/instruction-encoding/validators.ts new file mode 100644 index 000000000..6c349906a --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/validators.ts @@ -0,0 +1,514 @@ +import { isAddress } from '@solana/addresses'; +import type { + ArrayTypeNode, + CountNode, + DefinedTypeNode, + EnumVariantTypeNode, + InstructionAccountNode, + InstructionArgumentNode, + SetTypeNode, + TypeNode, +} from 'codama'; +import { + array, + boolean, + define, + intersection, + number, + object, + size, + string, + Struct, + StructError, + tuple, +} from 'superstruct'; + +import { isPublicKeyLike } from '../shared/address'; +import { getMemoizedUtf8Encoder } from '../shared/codecs'; +import { formatValueType, getMaybeNodeKind, safeStringify } from '../shared/util'; + +type StructUnknown = Struct; + +/** + * Creates a superstruct validator for InstructionAccountNodes. + * + * if node is optional, then validate only if it's provided. + * if node has defaultValue, then consider it as optional and validate only if it's provided because it will be resolved from defaultValue. + */ +export function createIxAccountsValidator(ixAccountNodes: InstructionAccountNode[]): StructUnknown { + const shape = ixAccountNodes.reduce>((acc, node) => { + acc[node.name] = node.isOptional || node.defaultValue ? OptionalSolanaAddressValidator : SolanaAddressValidator; + return acc; + }, {}); + return object(shape) as StructUnknown; +} + +/** + * Creates a superstruct validator for instruction InstructionArgumentNodes. + */ +export function createIxArgumentsValidator( + ixNodeName: string, + ixArgumentNodes: InstructionArgumentNode[], + definedTypes: DefinedTypeNode[], +): StructUnknown { + const shape = ixArgumentNodes.reduce>((acc, argumentNode, index) => { + if (!argumentNode.type) { + throw new Error(`Argument ${argumentNode.name} of instruction ${ixNodeName} does not have a type`); + } + acc[argumentNode.name] = createValidatorForTypeNode( + `${ixNodeName}_${argumentNode.name}_${index}`, + argumentNode.type, + definedTypes, + ); + return acc; + }, {}); + return object(shape) as StructUnknown; +} + +function createValidatorForTypeNode(nodeName: string, node: TypeNode, definedTypes: DefinedTypeNode[]): StructUnknown { + if (!node) { + throw new Error( + `Node ${nodeName} is not defined. ${definedTypes.length} defined types were provided: ${definedTypes.map(t => t.name).join(', ')}`, + ); + } + switch (node.kind) { + case 'arrayTypeNode': { + return ArrayValidator(`${nodeName}_array`, node, definedTypes); + } + case 'booleanTypeNode': { + return boolean() as StructUnknown; + } + case 'numberTypeNode': { + const format = node.format; + if (format === 'u64' || format === 'u128' || format === 'i64' || format === 'i128') { + return NumberOrBigintValidator; + } + return number() as StructUnknown; + } + case 'publicKeyTypeNode': { + return SolanaAddressValidator; + } + case 'setTypeNode': { + // array of unique items + return intersection([ + UniqueItemsValidator, + ArrayValidator(`${nodeName}_set`, node, definedTypes), + ]) as StructUnknown; + } + case 'stringTypeNode': { + return string() as StructUnknown; + } + case 'fixedSizeTypeNode': { + // fixedSizeTypeNode wraps an inner type and constrains its byte size + if (node.type.kind === 'stringTypeNode') { + // For fixed-size strings, validate that UTF-8 bytes fit within the size + return StringValidatorForFixedSize(node.size); + } + if (node.type.kind === 'bytesTypeNode') { + // For fixed-size bytes, validate exact byte length + return BytesWithSizeValidator(node.size); + } + // For other types, delegate to the inner type validator + // The size constraint is handled during encoding + return createValidatorForTypeNode(`${nodeName}_fixed_size`, node.type, definedTypes); + } + case 'bytesTypeNode': { + return BytesLikeValidator; + } + case 'dateTimeTypeNode': { + return createValidatorForTypeNode(`${nodeName}_date_time`, node.number, definedTypes); + } + case 'definedTypeLinkNode': { + const definedType = definedTypes.find(d => d.name === node.name); + if (!definedType) { + throw new Error(`Undefined type: ${node.name} ${node.kind}`); + } + return createValidatorForTypeNode(`${nodeName}_defined_type`, definedType.type, definedTypes); + } + case 'mapTypeNode': { + const keyValidator = createValidatorForTypeNode( + `${nodeName}_map_key_${node.key.kind}`, + node.key, + definedTypes, + ); + const valueValidator = createValidatorForTypeNode( + `${nodeName}_map_value_${node.value.kind}`, + node.value, + definedTypes, + ); + const sizeValidator = MapCountValidator(node.count); + const keyValueValidator = KeyValueValidator(nodeName, keyValidator, valueValidator); + if (sizeValidator) { + return intersection([keyValueValidator, sizeValidator]) as StructUnknown; + } + return keyValueValidator; + } + case 'structTypeNode': { + const structShape = node.fields.reduce>((acc, field) => { + acc[field.name] = createValidatorForTypeNode( + `${nodeName}_struct_${field.name}`, + field.type, + definedTypes, + ); + return acc; + }, {}); + return object(structShape) as StructUnknown; + } + case 'tupleTypeNode': { + const validators = node.items.map((typeNode, index) => + createValidatorForTypeNode(`${nodeName}_tuple${typeNode.kind}_${index}`, typeNode, definedTypes), + ); + return tuple(validators as [StructUnknown, ...StructUnknown[]]) as StructUnknown; + } + case 'zeroableOptionTypeNode': { + const innerValidator = createValidatorForTypeNode( + `${nodeName}_zeroable_option_item`, + node.item, + definedTypes, + ); + return ZeroableOptionValidator(`${nodeName}_zeroable_option`, innerValidator); + } + case 'optionTypeNode': { + // TODO: Do we need to validate node.fixed and node.prefix of OptionTypeNode? + const SomeValueValidator = createValidatorForTypeNode(`${nodeName}_option_item`, node.item, definedTypes); + return OptionValueValidator(`${nodeName}_option`, SomeValueValidator); + } + case 'remainderOptionTypeNode': { + const innerValidator = RemainderOptionTypeItemValidator( + `${nodeName}_remainder_option_item`, + node.item, + definedTypes, + ); + return OptionValueValidator(`${nodeName}_remainder_option`, innerValidator); + } + case 'hiddenPrefixTypeNode': + case 'hiddenSuffixTypeNode': + case 'sentinelTypeNode': + case 'postOffsetTypeNode': + case 'preOffsetTypeNode': + case 'sizePrefixTypeNode': { + return createValidatorForTypeNode(`${nodeName}_size_prefix`, node.type, definedTypes); + } + case 'enumTypeNode': { + return EnumVariantValidator(nodeName, node.variants, definedTypes); + } + case 'amountTypeNode': { + return AmountTypeValidator(nodeName); + } + case 'solAmountTypeNode': { + return AmountTypeValidator(nodeName); + } + default: { + node['kind'] satisfies never; + throw new Error(`Validator for TypeNode "${nodeName}" kind: ${getMaybeNodeKind(node)} is not implemented!`); + } + } +} + +function RemainderOptionTypeItemValidator( + nodeName: string, + itemNode: TypeNode, + definedTypes: DefinedTypeNode[], +): StructUnknown { + if (itemNode.kind === 'fixedSizeTypeNode' && itemNode.type.kind === 'stringTypeNode') { + // For fixed-size strings in remainder options, accept any string + return StringValidatorForFixedSize(itemNode.size); + } + + if (itemNode.kind === 'definedTypeLinkNode') { + const definedType = definedTypes.find(d => d.name === itemNode.name); + if (definedType?.type.kind === 'fixedSizeTypeNode' && definedType.type.type.kind === 'stringTypeNode') { + return StringValidatorForFixedSize(definedType.type.size); + } + } + + return createValidatorForTypeNode(nodeName, itemNode, definedTypes); +} + +function StringValidatorForFixedSize(maxSize: number): StructUnknown { + return define(`StringForFixedSize_max_${maxSize}`, (value: unknown) => { + if (typeof value !== 'string') { + return `Expected a string, received: ${formatValueType(value)}`; + } + const encoder = getMemoizedUtf8Encoder(); + const bytes = encoder.encode(value); + return ( + bytes.length <= maxSize || + `String exceeds max size: ${bytes.length} bytes (UTF-8), limit is ${maxSize} bytes` + ); + }) as StructUnknown; +} + +/** + * Validator for enum variants. + * Handles both scalar enums and enums with data. + */ +function EnumVariantValidator( + nodeName: string, + variants: EnumVariantTypeNode[], + definedTypes: DefinedTypeNode[], +): StructUnknown { + const variantMap = new Map(variants.map(v => [v.name, v])); + const variantNames = Array.from(variantMap.keys()); + + // Eagerly build per-variant payload validators for struct and tuple variants + const variantValidators = new Map(); + for (const variant of variants) { + if (variant.kind === 'enumStructVariantTypeNode') { + variantValidators.set( + variant.name, + createValidatorForTypeNode(`${nodeName}_${variant.name}`, variant.struct, definedTypes), + ); + } else if (variant.kind === 'enumTupleVariantTypeNode') { + variantValidators.set( + variant.name, + createValidatorForTypeNode(`${nodeName}_${variant.name}`, variant.tuple, definedTypes), + ); + } + } + + return define(`${nodeName}_EnumVariant`, (value: unknown) => { + // Scalar enum: plain string variant name (e.g. 'foo', 'bar') + if (typeof value === 'string') + return ( + variantMap.has(value) || `Invalid enum value "${value}". Expected one of: ${variantNames.join(', ')}` + ); + + // Data enum variant: object with __kind (e.g. { __kind: 'tokenTransfer', amount: 1000 }) + if (typeof value === 'object' && value !== null && '__kind' in value) { + const kind = (value as Record)['__kind']; + if (typeof kind !== 'string') { + return `Expected __kind to be a string, received: ${formatValueType(kind)}`; + } + const variant = variantMap.get(kind); + if (!variant) { + return `Invalid enum variant "${kind}". Expected one of: ${variantNames.join(', ')}`; + } + + if (variant.kind === 'enumEmptyVariantTypeNode') { + return true; + } + + // Validations of enum payloads + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { __kind: _, ...rest } = value as Record; + const payloadValidator = variantValidators.get(kind); + if (!payloadValidator) { + return true; + } + + if (variant.kind === 'enumStructVariantTypeNode') { + const [structError] = payloadValidator.validate(rest); + return structError ? formatErrorForEnumTypeNode(kind, structError) : true; + } + + if (variant.kind === 'enumTupleVariantTypeNode') { + const fields = (rest as { fields?: unknown }).fields; + const [structError] = payloadValidator.validate(fields); + return structError ? formatErrorForEnumTypeNode(kind, structError) : true; + } + } + + return `Expected an enum variant (string or object with __kind), received: ${formatValueType(value)}`; + }) as StructUnknown; +} + +function formatErrorForEnumTypeNode(enumVariantKind: string, error: StructError) { + const failures = error.failures(); + const first = failures?.[0]; + if (first) { + return `Enum variant "${enumVariantKind}" has invalid "${String(first.key)}"`; + } + return `Enum variant "${enumVariantKind}" has invalid payload`; +} + +const SolanaAddressValidator: StructUnknown = /* @__PURE__ */ define('SolanaAddress', (value: unknown) => { + if (typeof value === 'string') { + return isAddress(value) || `Expected a valid Solana address (base58), received string: "${value}"`; + } + if (isPublicKeyLike(value)) { + return isAddress(value.toBase58()) || 'Expected a valid Solana address, received an invalid PublicKey'; + } + return `Expected a Solana address (base58 string or PublicKey), received: ${formatValueType(value)}`; +}); + +const OptionalSolanaAddressValidator: StructUnknown = /* @__PURE__ */ define( + 'OptionalSolanaAddress', + (value: unknown) => { + if (value === undefined || value === null) return true; + const [error] = SolanaAddressValidator.validate(value); + if (!error) return true; + return error.failures()[0]?.message ?? 'Expected a valid Solana address or null/undefined'; + }, +); + +const NumberOrBigintValidator: StructUnknown = /* @__PURE__ */ define('NumberOrBigint', (value: unknown) => { + if (typeof value === 'number') { + return Number.isSafeInteger(value) || `Expected a safe integer, received unsafe number: ${value}`; + } + if (typeof value === 'bigint') return true; + return `Expected a number or bigint, received: ${formatValueType(value)}`; +}); + +const BytesLikeValidator: StructUnknown = /* @__PURE__ */ define('BytesLike', (value: unknown) => { + if (value instanceof Uint8Array) return true; + if (!Array.isArray(value)) { + return `Expected a Uint8Array or number[] (bytes 0-255), received: ${formatValueType(value)}`; + } + const invalidIndex = value.findIndex(n => typeof n !== 'number' || !Number.isInteger(n) || n < 0 || n > 255); + if (invalidIndex !== -1) { + return `Expected byte values (integers 0-255), invalid element at index ${invalidIndex}: ${String(value[invalidIndex])}`; + } + return true; +}); + +/** + * Validator for bytes that must be exactly a specific size. + * Used for fixedSizeTypeNode wrapping bytesTypeNode. + */ +function BytesWithSizeValidator(exactSize: number): StructUnknown { + return define(`BytesWithSize_${exactSize}`, (value: unknown) => { + if (value instanceof Uint8Array) { + return value.length === exactSize || `Expected exactly ${exactSize} bytes, received ${value.length} bytes`; + } + if (!Array.isArray(value)) { + return `Expected a Uint8Array or number[] of exactly ${exactSize} bytes, received: ${formatValueType(value)}`; + } + if (value.length !== exactSize) { + return `Expected exactly ${exactSize} bytes, received ${value.length} elements`; + } + const invalidIndex = value.findIndex(n => typeof n !== 'number' || !Number.isInteger(n) || n < 0 || n > 255); + if (invalidIndex !== -1) { + return `Expected byte values (integers 0-255), invalid element at index ${invalidIndex}: ${String(value[invalidIndex])}`; + } + return true; + }) as StructUnknown; +} + +// Validates value only if it is not null or undefined (i.e. if it's provided). +// SomeValueValidator validates the provided value (i.e. Some(value)). +function OptionValueValidator(name: string, SomeValueValidator: StructUnknown): StructUnknown { + return define(`${name}_OptionValueValidator`, (value: unknown) => { + if (value === null || value === undefined) return true; + const [error] = SomeValueValidator.validate(value); + if (!error) return true; + return error.failures()[0]?.message ?? 'Invalid value for optional field'; + }) as StructUnknown; +} + +// Validates zeroable option: null is valid, otherwise validates the inner validator. +function ZeroableOptionValidator(name: string, innerValidator: StructUnknown): StructUnknown { + return define(name, (value: unknown) => { + if (value == null) return true; + const [error] = innerValidator.validate(value); + if (!error) return true; + return error.failures()[0]?.message ?? 'Expected a valid value or null for zeroable option'; + }) as StructUnknown; +} + +// Checks that all items in the array are unique. +const UniqueItemsValidator: StructUnknown = /* @__PURE__ */ define('UniqueItems', (value: unknown) => { + if (!Array.isArray(value)) { + return `Expected an array with unique items, received: ${formatValueType(value)}`; + } + + const unique = new Map(); + for (let i = 0; i < value.length; i++) { + const key = safeStringify(value[i]); + const index = unique.get(key); + if (index !== undefined) { + return `Expected all items to be unique, found duplicate at indices ${index} and ${i}`; + } + unique.set(key, i); + } + return true; +}) as StructUnknown; + +// Validates every key of an object according to KeyValidator. +// Validates every value of an object according to ValueValidator. +// Used in MapTypeNode, where the keys and values are of the same type. +function KeyValueValidator(name: string, KeyValidator: StructUnknown, ValueValidator: StructUnknown): StructUnknown { + return define(`${name}_KeyValueValidator`, (value: unknown) => { + if (typeof value !== 'object' || value === null) { + return `Expected a map (object), received: ${formatValueType(value)}`; + } + const record = value as Record; + const invalidKeys: string[] = []; + const invalidValues: string[] = []; + for (const key of Object.keys(record)) { + if (KeyValidator.validate(key)[0]) invalidKeys.push(key); + if (ValueValidator.validate(record[key])[0]) invalidValues.push(key); + } + if (!invalidKeys.length && !invalidValues.length) return true; + const parts: string[] = []; + if (invalidKeys.length) parts.push(`invalid keys: ${invalidKeys.join(', ')}`); + if (invalidValues.length) parts.push(`invalid values: ${invalidValues.join(', ')}`); + return `Map validation failed: ${parts.join('; ')}`; + }) as StructUnknown; +} + +function MapCountValidator(node: CountNode): StructUnknown | null { + switch (node.kind) { + case 'fixedCountNode': + return KeysLengthValidator(node.value); + case 'remainderCountNode': + case 'prefixedCountNode': + return null; // the number of items is unknown or arbitrary, like vec![] + default: + throw new Error(`Unsupported map count type: ${getMaybeNodeKind(node)}`); + } +} + +// Validates the number of keys in an object +// Can be used in MapTypeNode with "fixed" CountNode type +function KeysLengthValidator(count: number): StructUnknown { + return define(`KeysLengthValidator_len_${count}`, (value: unknown) => { + if (typeof value !== 'object' || value === null) { + return `Expected a map with exactly ${count} entries, received: ${formatValueType(value)}`; + } + const actual = Object.keys(value).length; + return actual === count || `Expected exactly ${count} map entries, received ${actual}`; + }) as StructUnknown; +} + +// Handles both fixed-size and variable-size arrays +function ArrayValidator( + nodeName: string, + node: ArrayTypeNode | SetTypeNode, + definedTypes: DefinedTypeNode[], +): StructUnknown { + // First define a validator for every array item + const itemValidator = createValidatorForTypeNode(nodeName, node.item, definedTypes); + // Then validate CountNode representing array size: + // https://github.com/codama-idl/codama/blob/main/packages/nodes/docs/typeNodes/ArrayTypeNode.md + switch (node.count.kind) { + case 'fixedCountNode': { + return size(array(itemValidator), node.count.value) as StructUnknown; + } + case 'remainderCountNode': + case 'prefixedCountNode': { + return array(itemValidator) as StructUnknown; + } + default: { + // This should be unreachable with the current `CountNode` union but helps + // guard against future Codama expansions. + throw new Error(`Node: ${nodeName}. Unsupported array count type`); + } + } +} + +/** + * Validator for amountTypeNode and solAmountTypeNode. + * Accepts number, bigint. + */ +function AmountTypeValidator(nodeName: string): StructUnknown { + return define(`AmountType_${nodeName}`, (value: unknown) => { + if (typeof value === 'number') { + return Number.isSafeInteger(value) || `Expected a safe integer, received unsafe number: ${value}`; + } + if (typeof value === 'bigint') { + return true; + } + return `Expected a number or bigint, received: ${formatValueType(value)}`; + }) as StructUnknown; +} diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/account-default-value.ts b/packages/dynamic-client/src/instruction-encoding/visitors/account-default-value.ts new file mode 100644 index 000000000..89a8e0f88 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/account-default-value.ts @@ -0,0 +1,228 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { Address } from '@solana/addresses'; +import { address } from '@solana/addresses'; +import type { Visitor } from 'codama'; +import type { + AccountBumpValueNode, + AccountValueNode, + ArgumentValueNode, + ConditionalValueNode, + IdentityValueNode, + InstructionAccountNode, + PayerValueNode, + PdaValueNode, + ProgramIdValueNode, + PublicKeyValueNode, + ResolverValueNode, +} from 'codama'; +import { visitOrElse } from 'codama'; + +import type { AddressInput } from '../../shared/address'; +import { isConvertibleAddress, toAddress } from '../../shared/address'; +import { formatValueType, safeStringify } from '../../shared/util'; +import { resolveAccountValueNodeAddress } from '../resolvers/resolve-account-value-node-address'; +import { resolveConditionalValueNodeCondition } from '../resolvers/resolve-conditional'; +import { resolvePDAAddress } from '../resolvers/resolve-pda-address'; +import type { BaseResolutionContext } from '../resolvers/types'; + +type AccountDefaultValueVisitorContext = BaseResolutionContext & { + accountAddressInput: AddressInput | null | undefined; + ixAccountNode: InstructionAccountNode; +}; + +export const ACCOUNT_DEFAULT_VALUE_SUPPORTED_NODE_KINDS = [ + 'accountBumpValueNode', + 'accountValueNode', + 'argumentValueNode', + 'conditionalValueNode', + 'identityValueNode', + 'payerValueNode', + 'pdaValueNode', + 'programIdValueNode', + 'publicKeyValueNode', + 'resolverValueNode', +] as const; + +type AccountDefaultValueSupportedNodeKind = (typeof ACCOUNT_DEFAULT_VALUE_SUPPORTED_NODE_KINDS)[number]; + +/** + * Visitor for resolving InstructionInputValueNode types to Address values for account resolution. + */ +export function createAccountDefaultValueVisitor( + ctx: AccountDefaultValueVisitorContext, +): Visitor, AccountDefaultValueSupportedNodeKind> { + const { + root, + ixNode, + ixAccountNode, + accountAddressInput, + argumentsInput, + accountsInput, + resolversInput, + resolutionPath, + } = ctx; + + return { + visitAccountBumpValue: async (_node: AccountBumpValueNode) => { + return await Promise.reject( + new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE, { + nodeKind: 'accountBumpValueNode', + }), + ); + }, + + visitAccountValue: async (node: AccountValueNode) => { + return await resolveAccountValueNodeAddress(node, { + accountsInput, + argumentsInput, + ixNode, + resolutionPath, + resolversInput, + root, + }); + }, + + visitArgumentValue: async (node: ArgumentValueNode) => { + const argValue = argumentsInput?.[node.name]; + if (argValue === undefined || argValue === null) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, { + argumentName: node.name, + instructionName: ixNode.name, + }); + } + + if (!isConvertibleAddress(argValue)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, { + accountName: ixAccountNode.name, + actualType: formatValueType(argValue), + expectedType: 'Address | PublicKey', + }); + } + + return await Promise.resolve(toAddress(argValue)); + }, + + visitConditionalValue: async (conditionalValueNode: ConditionalValueNode) => { + // ifTrue or ifFalse branch of ConditionalValueNode. + const resolvedInputValueNode = await resolveConditionalValueNodeCondition({ + accountsInput, + argumentsInput, + conditionalValueNode, + ixAccountNode, + ixNode, + resolutionPath, + resolversInput, + root, + }); + + if (resolvedInputValueNode === undefined) { + // No matching branch (e.g. conditional with no ifFalse and falsy condition). + // Return null to signal "unresolved" to apply optionalAccountStrategy. + if (ixAccountNode.isOptional) { + return null; + } + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, { + accountName: ixAccountNode.name, + instructionName: ixNode.name, + }); + } + // Recursively resolve the chosen branch. + const visitor = createAccountDefaultValueVisitor(ctx); + const addressValue = await visitOrElse(resolvedInputValueNode, visitor, innerNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...ACCOUNT_DEFAULT_VALUE_SUPPORTED_NODE_KINDS], + kind: innerNode.kind, + node: innerNode, + }); + }); + return addressValue; + }, + + visitIdentityValue: async (_node: IdentityValueNode) => { + if (accountAddressInput === undefined || accountAddressInput === null) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, { + accountName: ixAccountNode.name, + instructionName: ixNode.name, + }); + } + return await Promise.resolve(toAddress(accountAddressInput)); + }, + + visitPayerValue: async (_node: PayerValueNode) => { + if (accountAddressInput === undefined || accountAddressInput === null) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, { + accountName: ixAccountNode.name, + instructionName: ixNode.name, + }); + } + return await Promise.resolve(toAddress(accountAddressInput)); + }, + + visitPdaValue: async (node: PdaValueNode) => { + const pda = await resolvePDAAddress({ + accountsInput, + argumentsInput, + ixNode, + pdaValueNode: node, + resolutionPath, + resolversInput, + root, + }); + if (pda === null) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, { + accountName: ixAccountNode.name, + }); + } + return pda[0]; + }, + + visitProgramIdValue: async (_node: ProgramIdValueNode) => { + return await Promise.resolve(address(root.program.publicKey)); + }, + + visitPublicKeyValue: async (node: PublicKeyValueNode) => { + return await Promise.resolve(address(node.publicKey)); + }, + + visitResolverValue: async (node: ResolverValueNode) => { + const resolverFn = resolversInput?.[node.name]; + if (!resolverFn) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING, { + accountName: ixAccountNode.name, + resolverName: node.name, + }); + } + let result: unknown; + try { + result = await resolverFn(argumentsInput ?? {}, accountsInput ?? {}); + } catch (error) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, { + cause: error, + resolverName: node.name, + targetKind: 'instructionAccountNode', + targetName: ixAccountNode.name, + }); + } + + if (!isConvertibleAddress(result)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, { + accountName: ixAccountNode.name, + value: safeStringify(result), + }); + } + + return toAddress(result); + }, + }; +} diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/condition-node-value.ts b/packages/dynamic-client/src/instruction-encoding/visitors/condition-node-value.ts new file mode 100644 index 000000000..47bc5f56d --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/condition-node-value.ts @@ -0,0 +1,68 @@ +import { CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, CodamaError } from '@codama/errors'; +import type { Visitor } from 'codama'; +import type { AccountValueNode, ArgumentValueNode, ResolverValueNode } from 'codama'; + +import { resolveAccountValueNodeAddress } from '../resolvers/resolve-account-value-node-address'; +import type { BaseResolutionContext } from '../resolvers/types'; + +export const CONDITION_NODE_SUPPORTED_NODE_KINDS = [ + 'accountValueNode', + 'argumentValueNode', + 'resolverValueNode', +] as const; + +type ConditionNodeSupportedNodeKind = (typeof CONDITION_NODE_SUPPORTED_NODE_KINDS)[number]; + +/** + * Visitor for resolving condition nodes in ConditionalValueNode. + * Returns the runtime value of the condition (from accounts or arguments). + */ +export function createConditionNodeValueVisitor( + ctx: BaseResolutionContext, +): Visitor, ConditionNodeSupportedNodeKind> { + const { root, ixNode, argumentsInput, accountsInput, resolutionPath, resolversInput } = ctx; + + return { + visitAccountValue: async (node: AccountValueNode) => { + // If the user explicitly provides null for a conditional account, + // return it for the conditionalValueNode ifFalse branch. + const accountAddressInput = accountsInput?.[node.name]; + if (accountAddressInput === null) { + return null; + } + + return await resolveAccountValueNodeAddress(node, { + accountsInput, + argumentsInput, + ixNode, + resolutionPath, + resolversInput, + root, + }); + }, + + visitArgumentValue: async (node: ArgumentValueNode) => { + const argInput = argumentsInput?.[node.name]; + return await Promise.resolve(argInput); + }, + + visitResolverValue: async (node: ResolverValueNode) => { + const resolverFn = resolversInput?.[node.name]; + if (!resolverFn) { + // ConditionalValueNode evaluates condition and based on result it chooses to take either ifTrue or ifFalse branch. + // If resolver is not provided, we assume condition is false and return undefined instead of throwing an error to take ifFalse branch. + return undefined; + } + try { + return await resolverFn(argumentsInput ?? {}, accountsInput ?? {}); + } catch (error) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, { + cause: error, + resolverName: node.name, + targetKind: 'conditionalValueNode', + targetName: node.name, + }); + } + }, + }; +} diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/default-value-encoder.ts b/packages/dynamic-client/src/instruction-encoding/visitors/default-value-encoder.ts new file mode 100644 index 000000000..79b453b97 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/default-value-encoder.ts @@ -0,0 +1,43 @@ +import type { ReadonlyUint8Array } from '@solana/codecs'; +import type { Visitor } from 'codama'; +import type { + BooleanValueNode, + BytesValueNode, + EnumValueNode, + NumberValueNode, + PublicKeyValueNode, + StringValueNode, +} from 'codama'; + +export const DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS = [ + 'booleanValueNode', + 'bytesValueNode', + 'enumValueNode', + 'noneValueNode', + 'numberValueNode', + 'publicKeyValueNode', + 'stringValueNode', +] as const; + +type DefaultValueEncoderSupportedNodeKind = (typeof DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS)[number]; + +/** + * Visitor for encoding default (omitted) values for instruction arguments. + * + * Today, Anchor/Codama primarily uses omitted defaults for discriminators + * (`bytesValueNode`), but this visitor is intentionally extensible as we + * expand node coverage over time. + */ +export function createDefaultValueEncoderVisitor(codec: { + encode: (value: unknown) => ReadonlyUint8Array; +}): Visitor { + return { + visitBooleanValue: (node: BooleanValueNode) => codec.encode(node.boolean), + visitBytesValue: (node: BytesValueNode) => codec.encode([node.encoding, node.data]), + visitEnumValue: (node: EnumValueNode) => codec.encode(node.variant), + visitNoneValue: () => codec.encode(null), + visitNumberValue: (node: NumberValueNode) => codec.encode(node.number), + visitPublicKeyValue: (node: PublicKeyValueNode) => codec.encode(node.publicKey), + visitStringValue: (node: StringValueNode) => codec.encode(node.string), + }; +} diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/index.ts b/packages/dynamic-client/src/instruction-encoding/visitors/index.ts new file mode 100644 index 000000000..d920d49cd --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/index.ts @@ -0,0 +1,6 @@ +export { createAccountDefaultValueVisitor } from './account-default-value'; +export { createConditionNodeValueVisitor } from './condition-node-value'; +export { createDefaultValueEncoderVisitor, DEFAULT_VALUE_ENCODER_SUPPORTED_NODE_KINDS } from './default-value-encoder'; +export { createPdaSeedValueVisitor } from './pda-seed-value'; +export { createValueNodeVisitor } from './value-node-value'; +export { createInputValueTransformer, createInputValueTransformerVisitor } from './input-value-transformer'; diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/input-value-transformer.ts b/packages/dynamic-client/src/instruction-encoding/visitors/input-value-transformer.ts new file mode 100644 index 000000000..88be2f236 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/input-value-transformer.ts @@ -0,0 +1,374 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, + CODAMA_ERROR__LINKED_NODE_NOT_FOUND, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { BytesEncoding, Node, RootNode, TypeNode, Visitor } from 'codama'; +import { isNode, pascalCase, visitOrElse } from 'codama'; + +import { isUint8Array, uint8ArrayToEncodedString } from '../../shared/bytes-encoding'; +import { formatValueType, isObjectRecord } from '../../shared/util'; + +/** + * Type nodes that the input value transformer can process. + * Includes all StandaloneTypeNode kinds plus definedTypeLinkNode. + */ +export const INPUT_VALUE_TRANSFORMER_SUPPORTED_NODE_KINDS = [ + 'amountTypeNode', + 'arrayTypeNode', + 'booleanTypeNode', + 'bytesTypeNode', + 'dateTimeTypeNode', + 'definedTypeLinkNode', + 'enumTypeNode', + 'fixedSizeTypeNode', + 'hiddenPrefixTypeNode', + 'hiddenSuffixTypeNode', + 'mapTypeNode', + 'numberTypeNode', + 'optionTypeNode', + 'postOffsetTypeNode', + 'preOffsetTypeNode', + 'publicKeyTypeNode', + 'remainderOptionTypeNode', + 'sentinelTypeNode', + 'setTypeNode', + 'sizePrefixTypeNode', + 'solAmountTypeNode', + 'stringTypeNode', + 'structFieldTypeNode', + 'structTypeNode', + 'tupleTypeNode', + 'zeroableOptionTypeNode', +] as const; + +export type TransformableTypeNodeKind = (typeof INPUT_VALUE_TRANSFORMER_SUPPORTED_NODE_KINDS)[number]; + +export type InputValueTransformerOptions = { + bytesEncoding?: BytesEncoding; +}; + +/** + * A transformer function that converts user input to Codama codec-compatible format. + */ +export type InputTransformer = (input: unknown) => unknown; + +function unexpectedNodeFallback(node: Node): never { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...INPUT_VALUE_TRANSFORMER_SUPPORTED_NODE_KINDS], + kind: node.kind, + node, + }); +} + +export function createInputValueTransformerVisitor( + root: RootNode, + options: InputValueTransformerOptions = {}, +): Visitor { + const bytesEncoding = options.bytesEncoding ?? 'base16'; + + const visitor: Visitor = { + visitAmountType(node) { + return visitOrElse(node.number, visitor, unexpectedNodeFallback); + }, + + visitArrayType(node) { + const itemTransform = visitOrElse(node.item, visitor, unexpectedNodeFallback); + return (input: unknown) => { + if (!Array.isArray(input)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'array', + nodeKind: 'arrayTypeNode', + }); + } + return input.map(itemTransform); + }; + }, + + visitBooleanType() { + return (input: unknown) => input; + }, + + visitBytesType() { + return (input: unknown) => { + if (isUint8Array(input)) { + return [bytesEncoding, uint8ArrayToEncodedString(input, bytesEncoding)]; + } + // Accept number[] by coercing to Uint8Array. + if (Array.isArray(input) && input.every(item => typeof item === 'number')) { + return [bytesEncoding, uint8ArrayToEncodedString(new Uint8Array(input), bytesEncoding)]; + } + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'Uint8Array | number[]', + nodeKind: 'bytesTypeNode', + }); + }; + }, + + visitDateTimeType(node) { + return visitOrElse(node.number, visitor, unexpectedNodeFallback); + }, + + visitDefinedTypeLink(node) { + const definedType = root.program.definedTypes.find(dt => dt.name === node.name); + if (!definedType) { + throw new CodamaError(CODAMA_ERROR__LINKED_NODE_NOT_FOUND, { + kind: 'definedTypeLinkNode', + linkNode: node, + name: node.name, + path: [], + }); + } + return visitOrElse(definedType.type, visitor, unexpectedNodeFallback); + }, + + visitEnumType(node) { + // Scalar enums pass through (just numbers/strings) + // Data enums need variant transformation with PascalCase __kind + // Because @codama/dynamic-codecs applies pascalCase() to variant names when building discriminated union codecs: + // @see https://github.com/codama-idl/codama/blob/main/packages/dynamic-codecs/src/codecs.ts#L199 + return (input: unknown) => { + if (typeof input === 'number' || typeof input === 'string') { + return input; + } + + if (!isObjectRecord(input)) { + return input; + } + + if (!('__kind' in input)) { + return input; + } + + const { __kind, ...rest } = input; + const kindObj = { __kind: pascalCase(String(__kind)) }; + const variantNode = node.variants.find(v => v.name === __kind); + + if (!variantNode) { + const availableVariants = node.variants.map(v => v.name).join(', '); + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: `variant '${String(__kind)}'`, + expectedType: `one of [${availableVariants}]`, + nodeKind: 'enumTypeNode', + }); + } + + if (isNode(variantNode, 'enumEmptyVariantTypeNode')) { + return { ...input, ...kindObj }; + } + + if (isNode(variantNode, 'enumStructVariantTypeNode')) { + const structTransform = visitOrElse(variantNode.struct, visitor, unexpectedNodeFallback); + const transformedFields = structTransform(rest); + if (!isObjectRecord(transformedFields)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(transformedFields), + expectedType: 'object', + nodeKind: 'enumStructVariantTypeNode', + }); + } + return { ...kindObj, ...transformedFields }; + } + + if (isNode(variantNode, 'enumTupleVariantTypeNode')) { + const tupleTransform = visitOrElse(variantNode.tuple, visitor, unexpectedNodeFallback); + if (!('fields' in rest) || !Array.isArray(rest.fields)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(rest.fields ?? rest), + expectedType: 'array (fields)', + nodeKind: 'enumTupleVariantTypeNode', + }); + } + return { ...kindObj, fields: tupleTransform(rest.fields) }; + } + + return input; + }; + }, + + visitFixedSizeType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitHiddenPrefixType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitHiddenSuffixType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitMapType(node) { + // Maps are represented as objects in dynamic-codecs + const valueTransform = visitOrElse(node.value, visitor, unexpectedNodeFallback); + return (input: unknown) => { + if (!isObjectRecord(input)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'object', + nodeKind: 'mapTypeNode', + }); + } + const result: Record = {}; + for (const [key, value] of Object.entries(input)) { + result[key] = valueTransform(value); + } + return result; + }; + }, + + // Primitive types (pass through) + visitNumberType() { + return (input: unknown) => input; + }, + + visitOptionType(node) { + const innerTransform = visitOrElse(node.item, visitor, unexpectedNodeFallback); + return (input: unknown) => { + if (input === null || input === undefined) return input; + return innerTransform(input); + }; + }, + + visitPostOffsetType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitPreOffsetType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitPublicKeyType() { + return (input: unknown) => input; + }, + + visitRemainderOptionType(node) { + const innerTransform = visitOrElse(node.item, visitor, unexpectedNodeFallback); + return (input: unknown) => { + if (input === null || input === undefined) return input; + return innerTransform(input); + }; + }, + + visitSentinelType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitSetType(node) { + // Sets are represented as arrays in dynamic-codecs + const itemTransform = visitOrElse(node.item, visitor, unexpectedNodeFallback); + return (input: unknown) => { + if (!Array.isArray(input)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'array', + nodeKind: 'setTypeNode', + }); + } + return input.map(itemTransform); + }; + }, + + visitSizePrefixType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitSolAmountType(node) { + return visitOrElse(node.number, visitor, unexpectedNodeFallback); + }, + + visitStringType() { + return (input: unknown) => input; + }, + + visitStructFieldType(node) { + return visitOrElse(node.type, visitor, unexpectedNodeFallback); + }, + + visitStructType(node) { + const fieldTransformers = node.fields.map(field => { + const transform = visitOrElse(field, visitor, unexpectedNodeFallback); + return { name: field.name, transform }; + }); + return (input: unknown) => { + if (!isObjectRecord(input)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'object', + nodeKind: 'structTypeNode', + }); + } + const result = { ...input } as Record; + for (const { name, transform } of fieldTransformers) { + if (name in result) { + result[name] = transform(result[name]); + } + } + return result; + }; + }, + + visitTupleType(node) { + const itemTransforms = node.items.map(item => visitOrElse(item, visitor, unexpectedNodeFallback)); + return (input: unknown) => { + if (!Array.isArray(input)) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'array', + nodeKind: 'tupleTypeNode', + }); + } + if (input.length !== itemTransforms.length) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: `array(length:${input.length})`, + expectedType: `array(length:${itemTransforms.length})`, + nodeKind: 'tupleTypeNode', + }); + } + return input.map((value: unknown, index) => itemTransforms[index](value)); + }; + }, + + visitZeroableOptionType(node) { + const innerTransform = visitOrElse(node.item, visitor, unexpectedNodeFallback); + return (input: unknown) => { + if (input === null || input === undefined) return input; + return innerTransform(input); + }; + }, + }; + + return visitor; +} + +/** + * Creates a transformer function that converts user input to codec-compatible input format. + * For example: user input Uint8Array for binary data but @codama/dynamic-codecs expects [BytesEncoding, string] as input + * + * @param typeNode - The Codama type node describing the expected structure + * @param root - Root node for resolving definedTypeLinkNode references + * @param options - Configuration options (encoding preference) + * @returns Transformer function that converts input to codec format + * + * @example + * const transformer = createInputValueTransformer( + * bytesTypeNode(), + * root, + * { bytesEncoding: 'base16' } + * ); + * + * const input = new Uint8Array([72, 101, 108, 108, 111]); + * const transformed = transformer(input); // => ['base16', '48656c6c6f'] + * Usage with codec: codamaCodec.encode(['base16', '48656c6c6f']) + */ +export function createInputValueTransformer( + typeNode: TypeNode, + root: RootNode, + options?: InputValueTransformerOptions, +): InputTransformer { + const visitor = createInputValueTransformerVisitor(root, options); + return visitOrElse(typeNode, visitor, unexpectedNodeFallback); +} diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/pda-seed-value.ts b/packages/dynamic-client/src/instruction-encoding/visitors/pda-seed-value.ts new file mode 100644 index 000000000..25b00da66 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/pda-seed-value.ts @@ -0,0 +1,177 @@ +import { getNodeCodec } from '@codama/dynamic-codecs'; +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { Address } from '@solana/addresses'; +import type { ReadonlyUint8Array } from '@solana/codecs'; +import type { + AccountValueNode, + ArgumentValueNode, + BooleanValueNode, + BytesValueNode, + ConstantValueNode, + NoneValueNode, + NumberValueNode, + ProgramIdValueNode, + PublicKeyValueNode, + SomeValueNode, + StringValueNode, + TypeNode, + Visitor, +} from 'codama'; +import { isNode, visitOrElse } from 'codama'; + +import { toAddress } from '../../shared/address'; +import { getCodecFromBytesEncoding } from '../../shared/bytes-encoding'; +import { getMemoizedAddressEncoder, getMemoizedBooleanEncoder, getMemoizedUtf8Codec } from '../../shared/codecs'; +import { resolveAccountValueNodeAddress } from '../resolvers/resolve-account-value-node-address'; +import type { BaseResolutionContext } from '../resolvers/types'; +import { createInputValueTransformer } from './input-value-transformer'; + +export const PDA_SEED_VALUE_SUPPORTED_NODE_KINDS = [ + 'accountValueNode', + 'argumentValueNode', + 'booleanValueNode', + 'bytesValueNode', + 'constantValueNode', + 'noneValueNode', + 'numberValueNode', + 'programIdValueNode', + 'publicKeyValueNode', + 'someValueNode', + 'stringValueNode', +] as const; + +type PdaSeedValueSupportedNodeKind = (typeof PDA_SEED_VALUE_SUPPORTED_NODE_KINDS)[number]; + +type PdaSeedValueVisitorContext = BaseResolutionContext & { + programId: Address; + seedTypeNode?: TypeNode; +}; + +/** + * Visitor for resolving PdaSeedValueNode value to raw bytes. + * Supports recursive resolution of dependent PDAs (accounts that are themselves auto-derived PDAs). + * This is used for both: + * - Variable seeds (e.g. seeds based on instruction accounts/arguments), and + * - Constant seeds (e.g. bytes/string/programId/publicKey constants). + */ +export function createPdaSeedValueVisitor( + ctx: PdaSeedValueVisitorContext, +): Visitor, PdaSeedValueSupportedNodeKind> { + const { root, ixNode, programId, seedTypeNode, resolversInput, resolutionPath } = ctx; + const accountsInput = ctx.accountsInput ?? {}; + const argumentsInput = ctx.argumentsInput ?? {}; + + return { + visitAccountValue: async (node: AccountValueNode) => { + const resolvedAddress = await resolveAccountValueNodeAddress(node, { + accountsInput, + argumentsInput, + ixNode, + resolutionPath, + resolversInput, + root, + }); + + if (resolvedAddress === null) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, { + accountName: node.name, + }); + } + + return getMemoizedAddressEncoder().encode(resolvedAddress); + }, + + visitArgumentValue: async (node: ArgumentValueNode) => { + const ixArgumentNode = ixNode.arguments.find(arg => arg.name === node.name); + if (!ixArgumentNode) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, { + instructionName: ixNode.name, + referencedName: node.name, + }); + } + const argInput = argumentsInput[node.name]; + + // Use the PDA seed's declared type (e.g. plain stringTypeNode) rather than + // the instruction argument's type (e.g. sizePrefixTypeNode) so the seed + // bytes match what the on-chain program derives. + const typeNode = seedTypeNode ?? ixArgumentNode.type; + + if (argInput === undefined || argInput === null) { + // optional remainderOptionTypeNode seeds encodes to zero bytes. + if (isNode(typeNode, 'remainderOptionTypeNode')) { + return new Uint8Array(0); + } + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, { + argumentName: node.name, + instructionName: ixNode.name, + }); + } + const codec = getNodeCodec([root, root.program, ixNode, { ...ixArgumentNode, type: typeNode }]); + const transformer = createInputValueTransformer(typeNode, root, { + bytesEncoding: 'base16', + }); + const transformedInput = transformer(argInput); + return await Promise.resolve(codec.encode(transformedInput)); + }, + + visitBooleanValue: async (node: BooleanValueNode) => + await Promise.resolve(getMemoizedBooleanEncoder().encode(node.boolean)), + + visitBytesValue: async (node: BytesValueNode) => { + const encodedValue = getCodecFromBytesEncoding(node.encoding).encode(node.data); + return await Promise.resolve(encodedValue); + }, + + visitConstantValue: async (node: ConstantValueNode) => { + const innerVisitor = createPdaSeedValueVisitor(ctx); + return await visitOrElse(node.value, innerVisitor, innerNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...PDA_SEED_VALUE_SUPPORTED_NODE_KINDS], + kind: innerNode.kind, + node: innerNode, + }); + }); + }, + + visitNoneValue: async (_node: NoneValueNode) => await Promise.resolve(new Uint8Array(0)), + + visitNumberValue: async (node: NumberValueNode) => { + // Sanity check: a violation here indicates a malformed IDL, not a user input error. + if (!Number.isInteger(node.number) || node.number < 0 || node.number > 0xff) { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, { + message: `NumberValueNode PDA seed is out of range: must be a valid u8 (0–255), got ${node.number}`, + }); + } + return await Promise.resolve(new Uint8Array([node.number])); + }, + + visitProgramIdValue: async (_node: ProgramIdValueNode) => { + return await Promise.resolve(getMemoizedAddressEncoder().encode(toAddress(programId))); + }, + + visitPublicKeyValue: async (node: PublicKeyValueNode) => { + return await Promise.resolve(getMemoizedAddressEncoder().encode(toAddress(node.publicKey))); + }, + + visitSomeValue: async (node: SomeValueNode) => { + const innerVisitor = createPdaSeedValueVisitor(ctx); + return await visitOrElse(node.value, innerVisitor, innerNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...PDA_SEED_VALUE_SUPPORTED_NODE_KINDS], + kind: innerNode.kind, + node: innerNode, + }); + }); + }, + + visitStringValue: async (node: StringValueNode) => + await Promise.resolve(getMemoizedUtf8Codec().encode(node.string)), + }; +} diff --git a/packages/dynamic-client/src/instruction-encoding/visitors/value-node-value.ts b/packages/dynamic-client/src/instruction-encoding/visitors/value-node-value.ts new file mode 100644 index 000000000..fbdda4923 --- /dev/null +++ b/packages/dynamic-client/src/instruction-encoding/visitors/value-node-value.ts @@ -0,0 +1,185 @@ +import { CODAMA_ERROR__UNEXPECTED_NODE_KIND, CodamaError } from '@codama/errors'; +import { address } from '@solana/addresses'; +import type { Visitor } from 'codama'; +import type { + ArrayValueNode, + BooleanValueNode, + BytesValueNode, + ConstantValueNode, + EnumValueNode, + MapValueNode, + NoneValueNode, + NumberValueNode, + PublicKeyValueNode, + SetValueNode, + SomeValueNode, + StringValueNode, + StructValueNode, + TupleValueNode, +} from 'codama'; +import { visitOrElse } from 'codama'; + +type ResolvedValue = { + encoding?: string; + kind: string; + value: unknown; +}; + +export const VALUE_NODE_SUPPORTED_NODE_KINDS = [ + 'arrayValueNode', + 'booleanValueNode', + 'bytesValueNode', + 'constantValueNode', + 'enumValueNode', + 'mapValueNode', + 'noneValueNode', + 'numberValueNode', + 'publicKeyValueNode', + 'setValueNode', + 'someValueNode', + 'stringValueNode', + 'structValueNode', + 'tupleValueNode', +] as const; + +type ValueNodeSupportedNodeKind = (typeof VALUE_NODE_SUPPORTED_NODE_KINDS)[number]; + +/** + * Visitor for resolving regular ValueNode types to their typed values. + */ +export function createValueNodeVisitor(): Visitor { + const visitor: Visitor = { + visitArrayValue: (node: ArrayValueNode) => ({ + kind: node.kind, + value: node.items.map(item => + visitOrElse(item, visitor, n => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: n.kind, + node: n, + }); + }), + ), + }), + + visitBooleanValue: (node: BooleanValueNode) => ({ + kind: node.kind, + value: node.boolean, + }), + + visitBytesValue: (node: BytesValueNode) => ({ + encoding: node.encoding, + kind: node.kind, + value: node.data, + }), + + visitConstantValue: (node: ConstantValueNode) => { + return visitOrElse(node.value, visitor, innerNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: innerNode.kind, + node: innerNode, + }); + }); + }, + + visitEnumValue: (node: EnumValueNode) => ({ + kind: node.kind, + value: node.variant, + }), + + visitMapValue: (node: MapValueNode) => ({ + kind: node.kind, + value: node.entries.map(entry => ({ + key: visitOrElse(entry.key, visitor, n => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: n.kind, + node: n, + }); + }), + value: visitOrElse(entry.value, visitor, n => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: n.kind, + node: n, + }); + }), + })), + }), + + visitNoneValue: (node: NoneValueNode) => ({ + kind: node.kind, + value: null, + }), + + visitNumberValue: (node: NumberValueNode) => ({ + kind: node.kind, + value: node.number, + }), + + visitPublicKeyValue: (node: PublicKeyValueNode) => ({ + kind: node.kind, + value: address(node.publicKey), + }), + + visitSetValue: (node: SetValueNode) => ({ + kind: node.kind, + value: node.items.map(item => + visitOrElse(item, visitor, n => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: n.kind, + node: n, + }); + }), + ), + }), + + visitSomeValue: (node: SomeValueNode) => { + return visitOrElse(node.value, visitor, innerNode => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: innerNode.kind, + node: innerNode, + }); + }); + }, + + visitStringValue: (node: StringValueNode) => ({ + kind: node.kind, + value: node.string, + }), + + visitStructValue: (node: StructValueNode) => ({ + kind: node.kind, + value: Object.fromEntries( + node.fields.map(field => [ + field.name, + visitOrElse(field.value, visitor, n => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: n.kind, + node: n, + }); + }), + ]), + ), + }), + + visitTupleValue: (node: TupleValueNode) => ({ + kind: node.kind, + value: node.items.map(item => + visitOrElse(item, visitor, n => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: [...VALUE_NODE_SUPPORTED_NODE_KINDS], + kind: n.kind, + node: n, + }); + }), + ), + }), + }; + + return visitor; +} diff --git a/packages/dynamic-client/src/program-client/collect-pdas.ts b/packages/dynamic-client/src/program-client/collect-pdas.ts new file mode 100644 index 000000000..1e2fca677 --- /dev/null +++ b/packages/dynamic-client/src/program-client/collect-pdas.ts @@ -0,0 +1,29 @@ +import { isNode, type PdaNode, type RootNode } from 'codama'; + +/** + * Collects unique PDA definitions from the IDL. + * + * Scans both `root.program.pdas` (registered PDAs) and inline + * `pdaValueNode > pdaNode` definitions inside instruction account + * `defaultValue` nodes. Deduplicates by PDA name. + */ +export function collectPdaNodes(root: RootNode): Map { + const pdas = new Map(); + + for (const pda of root.program.pdas) { + pdas.set(pda.name, pda); + } + + for (const ix of root.program.instructions) { + for (const acc of ix.accounts) { + if (!acc.defaultValue || !isNode(acc.defaultValue, 'pdaValueNode')) continue; + if (!isNode(acc.defaultValue.pda, 'pdaNode')) continue; + const pdaNode = acc.defaultValue.pda; + if (!pdas.has(pdaNode.name)) { + pdas.set(pdaNode.name, pdaNode); + } + } + } + + return pdas; +} diff --git a/packages/dynamic-client/src/program-client/create-program-client.ts b/packages/dynamic-client/src/program-client/create-program-client.ts new file mode 100644 index 000000000..3e464ea9c --- /dev/null +++ b/packages/dynamic-client/src/program-client/create-program-client.ts @@ -0,0 +1,139 @@ +import { + CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND, + CodamaError, +} from '@codama/errors'; +import { type Address, address, type ProgramDerivedAddress } from '@solana/addresses'; +import type { Instruction } from '@solana/instructions'; +import type { InstructionNode, RootNode } from 'codama'; +import { createFromJson, updateProgramsVisitor } from 'codama'; + +import type { AddressInput } from '../shared/address'; +import { toAddress } from '../shared/address'; +import type { AccountsInput, ArgumentsInput, ResolversInput } from '../shared/types'; +import { collectPdaNodes } from './collect-pdas'; +import { deriveStandalonePDA } from './derive-standalone-pda'; +import { MethodsBuilder } from './methods-builder'; + +export type IdlInput = object | string; + +export type CreateProgramClientOptions = { + /** + * Optional override for the program id. + * If not provided, uses `root.program.publicKey` from the IDL. + */ + programId?: AddressInput; +}; + +export type ProgramClient = { + /** Quick lookup by instruction name. */ + instructions: Map; + /** Anchor-like facade namespace for building instructions. */ + methods: Record ProgramMethodBuilder>; + /** Anchor-like facade namespace for standalone PDA derivation. */ + pdas?: Record) => Promise>; + /** Program id as an `Address`. */ + programAddress: Address; + /** Parsed Codama root node for advanced use-cases. */ + root: RootNode; +}; + +export type ProgramMethodBuilder = { + accounts(accounts: AccountsInput): ProgramMethodBuilder; + instruction(): Promise; + resolvers(resolvers: ResolversInput): ProgramMethodBuilder; + signers(signers: string[]): ProgramMethodBuilder; +}; + +/** + * Creates a program client from a Codama IDL. + * + * For type safety, generate types and pass as a generic. See the README.md for details. + */ +export function createProgramClient( + idl: IdlInput, + options: CreateProgramClientOptions = {}, +): TClient { + const json = typeof idl === 'string' ? idl : JSON.stringify(idl); + const codama = createFromJson(json); + + if (options.programId) { + codama.update( + updateProgramsVisitor({ + [codama.getRoot().program.name]: { + publicKey: toAddress(options.programId), + }, + }), + ); + } + + const root = codama.getRoot(); + const programAddress = address(root.program.publicKey); + + const instructions = new Map(); + for (const ix of root.program.instructions) { + instructions.set(ix.name, ix); + } + + const methods = new Proxy( + {}, + { + get(_target, prop) { + if (typeof prop !== 'string' || PASSTHROUGH_PROPS.has(prop)) return undefined; + + const ixNode = instructions.get(prop); + if (!ixNode) { + if (prop in Object.prototype) return undefined; + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND, { + availableIxs: [...instructions.keys()], + instructionName: prop, + }); + } + + return (args?: ArgumentsInput) => new MethodsBuilder(root, ixNode, args) as ProgramMethodBuilder; + }, + has(target, prop) { + return Reflect.has(target, prop) || (typeof prop === 'string' && instructions.has(prop)); + }, + }, + ) as ProgramClient['methods']; + + const pdaNodes = collectPdaNodes(root); + + const pdas = + pdaNodes.size === 0 + ? undefined + : (new Proxy( + {}, + { + get(_target, prop) { + if (typeof prop !== 'string' || PASSTHROUGH_PROPS.has(prop)) return undefined; + + const pdaNode = pdaNodes.get(prop); + if (!pdaNode) { + if (prop in Object.prototype) return undefined; + const available = [...pdaNodes.keys()].join(', '); + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND, { + available, + pdaName: prop, + }); + } + + return (seeds?: Record) => deriveStandalonePDA(root, pdaNode, seeds); + }, + has(target, prop) { + return Reflect.has(target, prop) || (typeof prop === 'string' && pdaNodes.has(prop)); + }, + }, + ) as ProgramClient['pdas']); + + return { + instructions, + methods, + pdas, + programAddress, + root, + } as unknown as TClient; +} + +const PASSTHROUGH_PROPS = new Set(['then', 'toJSON', 'valueOf', 'toString']); diff --git a/packages/dynamic-client/src/program-client/derive-standalone-pda.ts b/packages/dynamic-client/src/program-client/derive-standalone-pda.ts new file mode 100644 index 000000000..6bad59d16 --- /dev/null +++ b/packages/dynamic-client/src/program-client/derive-standalone-pda.ts @@ -0,0 +1,139 @@ +import { getNodeCodec } from '@codama/dynamic-codecs'; +import { + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, + CODAMA_ERROR__UNEXPECTED_NODE_KIND, + CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, + CodamaError, +} from '@codama/errors'; +import type { Address, ProgramDerivedAddress } from '@solana/addresses'; +import { getProgramDerivedAddress } from '@solana/addresses'; +import type { ReadonlyUint8Array } from '@solana/codecs'; +import type { InstructionNode, PdaNode, RegisteredPdaSeedNode, RootNode, VariablePdaSeedNode } from 'codama'; +import { camelCase, isNode, visitOrElse } from 'codama'; + +import { + createInputValueTransformer, + createPdaSeedValueVisitor, + PDA_SEED_VALUE_SUPPORTED_NODE_KINDS, +} from '../instruction-encoding'; +import { toAddress } from '../shared/address'; +import { getMemoizedUtf8Encoder } from '../shared/codecs'; +import { formatValueType, getMaybeNodeKind } from '../shared/util'; + +/** + * Minimal InstructionNode stub to satisfy constant PDA seeds requirements. + * Constant seeds only use programIdValue / publicKeyValue / bytesValue / stringValue, none of which reference instruction arguments or accounts + */ +const STANDALONE_IX_NODE: InstructionNode = { + accounts: [], + arguments: [], + kind: 'instructionNode', + name: '__standalone__' as InstructionNode['name'], +}; + +/** + * Derives a PDA from a standalone `PdaNode` and user-supplied seed values, + * without requiring an instruction context. + */ +export async function deriveStandalonePDA( + root: RootNode, + pdaNode: PdaNode, + seedInputs: Record = {}, +): Promise { + const programAddress = toAddress(pdaNode.programId || root.program.publicKey); + const seedValues = await Promise.all( + pdaNode.seeds.map(async (seedNode): Promise => { + if (seedNode.kind === 'constantPdaSeedNode') { + return await resolveStandaloneConstantSeed(root, programAddress, seedNode); + } + if (seedNode.kind === 'variablePdaSeedNode') { + return await resolveStandaloneVariableSeed(root, seedNode, seedInputs); + } + throw new CodamaError(CODAMA_ERROR__UNRECOGNIZED_NODE_KIND, { + kind: getMaybeNodeKind(seedNode) ?? 'unknown', + }); + }), + ); + + return await getProgramDerivedAddress({ programAddress, seeds: seedValues }); +} + +function resolveStandaloneConstantSeed( + root: RootNode, + programAddress: Address, + seedNode: RegisteredPdaSeedNode, +): Promise { + if (!isNode(seedNode, 'constantPdaSeedNode')) { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: ['constantPdaSeedNode'], + kind: seedNode.kind, + node: seedNode, + }); + } + const visitor = createPdaSeedValueVisitor({ + accountsInput: undefined, + argumentsInput: undefined, + ixNode: STANDALONE_IX_NODE, + programId: programAddress, + resolutionPath: [], + resolversInput: undefined, + root, + }); + return visitOrElse(seedNode.value, visitor, node => { + throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, { + expectedKinds: Array.from(PDA_SEED_VALUE_SUPPORTED_NODE_KINDS), + kind: node.kind, + node, + }); + }); +} + +function resolveStandaloneVariableSeed( + root: RootNode, + seedNode: VariablePdaSeedNode, + seedInputs: Record, +): Promise { + const input = seedInputs[seedNode.name]; + const typeNode = seedNode.type; + + // remainderOptionTypeNode seeds are optional — null means zero bytes. + if (input === undefined || input === null) { + if (isNode(typeNode, 'remainderOptionTypeNode')) { + return Promise.resolve(new Uint8Array(0)); + } + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, { + argumentName: seedNode.name, + instructionName: camelCase('standaloneSeedNode'), + }); + } + + // For simple string seeds encode directly with UTF-8 (no length prefix) + if (isNode(typeNode, 'stringTypeNode')) { + if (typeof input !== 'string') { + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, { + actualType: formatValueType(input), + expectedType: 'string', + nodeKind: 'stringTypeNode', + }); + } + return Promise.resolve(getMemoizedUtf8Encoder().encode(input)); + } + + // Create a synthetic instructionArgumentNode so getNodeCodec can resolve the type. + // The seed's declared type is used directly (no size-prefix wrapper). + const syntheticArgNode = createSyntheticArgNode(seedNode); + const codec = getNodeCodec([root, root.program, syntheticArgNode]); + const transformer = createInputValueTransformer(typeNode, root, { bytesEncoding: 'base16' }); + const transformedInput = transformer(input); + return Promise.resolve(codec.encode(transformedInput)); +} + +function createSyntheticArgNode(seedNode: VariablePdaSeedNode) { + return { + docs: [] as string[], + kind: 'instructionArgumentNode' as const, + name: seedNode.name, + type: seedNode.type, + }; +} diff --git a/packages/dynamic-client/src/program-client/methods-builder.ts b/packages/dynamic-client/src/program-client/methods-builder.ts new file mode 100644 index 000000000..5aa047bf6 --- /dev/null +++ b/packages/dynamic-client/src/program-client/methods-builder.ts @@ -0,0 +1,41 @@ +import type { Instruction } from '@solana/instructions'; +import type { InstructionNode, RootNode } from 'codama'; + +import { createIxBuilder } from '../instruction-encoding/instructions'; +import type { AccountsInput, ArgumentsInput, EitherSigners, ResolversInput } from '../shared/types'; + +export class MethodsBuilder { + private _accounts?: AccountsInput; + // "either" signers Account names + private _signers?: EitherSigners; + // Custom resolver functions for ResolverValueNode + private _resolvers?: ResolversInput; + + constructor( + private readonly root: RootNode, + private readonly ixNode: InstructionNode, + private readonly args?: ArgumentsInput, + ) {} + + accounts(accounts: AccountsInput) { + this._accounts = accounts; + return this; + } + + // Explicitly provide Account names which must be Signers. + // This is to help InstructionAccountNode resolution with ambiguous isSigner: "either". Other signers will be auto-resolved + signers(signers: EitherSigners) { + this._signers = signers; + return this; + } + + resolvers(resolvers: ResolversInput) { + this._resolvers = resolvers; + return this; + } + + async instruction(): Promise { + const build = createIxBuilder(this.root, this.ixNode); + return await build(this.args, this._accounts, this._signers, this._resolvers); + } +} diff --git a/packages/dynamic-client/src/shared/address.ts b/packages/dynamic-client/src/shared/address.ts new file mode 100644 index 000000000..d135e3d9d --- /dev/null +++ b/packages/dynamic-client/src/shared/address.ts @@ -0,0 +1,32 @@ +import { CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS, CodamaError } from '@codama/errors'; +import type { Address } from '@solana/addresses'; +import { address, isAddress } from '@solana/addresses'; + +import { safeStringify } from './util'; + +/** + * Accept both modern Address strings and legacy PublicKey-like objects. + * We intentionally use duck-typing to avoid hard dependency on @solana/web3.js types. + */ +export type PublicKeyLike = { toBase58(): string }; + +export type AddressInput = Address | PublicKeyLike | string; + +export function isPublicKeyLike(value: unknown): value is PublicKeyLike { + const obj = value as Record; + return typeof value === 'object' && value !== null && 'toBase58' in obj && typeof obj.toBase58 === 'function'; +} + +export function toAddress(input: AddressInput): Address { + if (isPublicKeyLike(input)) return address(input.toBase58()); + if (typeof input === 'string' && isAddress(input)) return address(input); + + throw new CodamaError(CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS, { + value: safeStringify(input), + }); +} + +export function isConvertibleAddress(value: unknown): value is AddressInput { + if (value == null) return false; + return isPublicKeyLike(value) || (typeof value === 'string' && isAddress(value)); +} diff --git a/packages/dynamic-client/src/shared/bytes-encoding.ts b/packages/dynamic-client/src/shared/bytes-encoding.ts new file mode 100644 index 000000000..81f4ebaf3 --- /dev/null +++ b/packages/dynamic-client/src/shared/bytes-encoding.ts @@ -0,0 +1,40 @@ +import { CODAMA_ERROR__UNRECOGNIZED_BYTES_ENCODING, CodamaError } from '@codama/errors'; +import type { BytesEncoding } from 'codama'; + +import { getMemoizedBase16Codec, getMemoizedBase58Codec, getMemoizedBase64Codec, getMemoizedUtf8Codec } from './codecs'; +import { safeStringify } from './util'; + +/** + * Converts Uint8Array to encoded string based on encoding type. + * Uses @solana/codecs encoders internally for consistent encoding/decoding. + */ +export function uint8ArrayToEncodedString(bytes: Uint8Array, encoding: BytesEncoding): string { + const codec = getCodecFromBytesEncoding(encoding); + return codec.decode(bytes); +} + +/** + * Gets the appropriate codec for a given bytes encoding format. + */ +export function getCodecFromBytesEncoding(encoding: BytesEncoding) { + switch (encoding) { + case 'base16': + return getMemoizedBase16Codec(); + case 'base58': + return getMemoizedBase58Codec(); + case 'base64': + return getMemoizedBase64Codec(); + case 'utf8': + return getMemoizedUtf8Codec(); + default: + throw new CodamaError(CODAMA_ERROR__UNRECOGNIZED_BYTES_ENCODING, { + encoding: safeStringify(encoding as unknown), + }); + } +} +/** + * Type guard to check if a value is a Uint8Array. + */ +export function isUint8Array(value: unknown): value is Uint8Array { + return value instanceof Uint8Array; +} diff --git a/packages/dynamic-client/src/shared/codecs.ts b/packages/dynamic-client/src/shared/codecs.ts new file mode 100644 index 000000000..39423f8b2 --- /dev/null +++ b/packages/dynamic-client/src/shared/codecs.ts @@ -0,0 +1,54 @@ +import { getAddressEncoder } from '@solana/addresses'; +import type { Encoder } from '@solana/codecs'; +import { + getBase16Codec, + getBase58Codec, + getBase64Codec, + getBooleanEncoder, + getUtf8Codec, + getUtf8Encoder, +} from '@solana/codecs'; + +// Memoized encoders and codecs to avoid unnecessary re-instantiation. + +let addressEncoder: ReturnType | undefined; +export function getMemoizedAddressEncoder() { + if (!addressEncoder) addressEncoder = getAddressEncoder(); + return addressEncoder; +} + +let utf8Encoder: ReturnType | undefined; +export function getMemoizedUtf8Encoder() { + if (!utf8Encoder) utf8Encoder = getUtf8Encoder(); + return utf8Encoder; +} + +let booleanEncoder: Encoder | undefined; +export function getMemoizedBooleanEncoder() { + if (!booleanEncoder) booleanEncoder = getBooleanEncoder(); + return booleanEncoder; +} + +let utf8Codec: ReturnType | undefined; +export function getMemoizedUtf8Codec() { + if (!utf8Codec) utf8Codec = getUtf8Codec(); + return utf8Codec; +} + +let base16Codec: ReturnType | undefined; +export function getMemoizedBase16Codec() { + if (!base16Codec) base16Codec = getBase16Codec(); + return base16Codec; +} + +let base58Codec: ReturnType | undefined; +export function getMemoizedBase58Codec() { + if (!base58Codec) base58Codec = getBase58Codec(); + return base58Codec; +} + +let base64Codec: ReturnType | undefined; +export function getMemoizedBase64Codec() { + if (!base64Codec) base64Codec = getBase64Codec(); + return base64Codec; +} diff --git a/packages/dynamic-client/src/shared/nodes.ts b/packages/dynamic-client/src/shared/nodes.ts new file mode 100644 index 000000000..2960cbb4f --- /dev/null +++ b/packages/dynamic-client/src/shared/nodes.ts @@ -0,0 +1 @@ +export const OPTIONAL_NODE_KINDS = ['optionTypeNode', 'zeroableOptionTypeNode', 'remainderOptionTypeNode']; diff --git a/packages/dynamic-client/src/shared/types.ts b/packages/dynamic-client/src/shared/types.ts new file mode 100644 index 000000000..b30903311 --- /dev/null +++ b/packages/dynamic-client/src/shared/types.ts @@ -0,0 +1,20 @@ +import type { Instruction } from '@solana/instructions'; + +import type { AddressInput } from './address'; + +// Note: optional accounts may be explicitly set to null. +export type AccountsInput = Partial>; +export type ArgumentsInput = Partial>; +type AccountName = string; +export type EitherSigners = AccountName[]; + +export type ResolverFn = (argumentsInput: ArgumentsInput, accountsInput: AccountsInput) => Promise; +export type ResolversInput = Record; + +type TBuildIxFn = ( + argumentsInput?: ArgumentsInput, + accountsInput?: AccountsInput, + signers?: EitherSigners, + resolversInput?: ResolversInput, +) => Promise; +export type BuildIxFn = TBuildIxFn; diff --git a/packages/dynamic-client/src/shared/util.ts b/packages/dynamic-client/src/shared/util.ts new file mode 100644 index 000000000..0a8bf69c1 --- /dev/null +++ b/packages/dynamic-client/src/shared/util.ts @@ -0,0 +1,34 @@ +import type { NodeKind } from 'codama'; + +/** + * Checks if a value is a plain object record (struct-like). + */ +export function isObjectRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && Object.getPrototypeOf(value) === Object.prototype; +} + +/** Returns the `NodeKind` of a node or `null`. */ +export function getMaybeNodeKind(node: unknown): NodeKind | null { + if (!isObjectRecord(node)) return null; + return (node as { kind: NodeKind }).kind ?? null; +} + +export function formatValueType(value: unknown): string { + if (value === null) return 'null'; + if (Array.isArray(value)) return `array (length ${value.length})`; + if (value instanceof Uint8Array) return `Uint8Array (length ${value.length})`; + if (typeof value === 'object') return 'object'; + return typeof value; +} + +/** + * Serializes a value for use in error messages and diagnostic output. + * Converts BigInt to strings, always returns a string and never throws. + */ +export function safeStringify(value: unknown): string { + try { + return JSON.stringify(value, (_key, v: unknown) => (typeof v === 'bigint' ? String(v) : v)); + } catch { + return `non-serializable ${formatValueType(value)}`; + } +} diff --git a/packages/dynamic-client/src/types/index.ts b/packages/dynamic-client/src/types/index.ts new file mode 100644 index 000000000..8c0003e90 --- /dev/null +++ b/packages/dynamic-client/src/types/index.ts @@ -0,0 +1,8 @@ +export type { AddressInput, PublicKeyLike } from '../shared/address'; +export type { AccountsInput, ArgumentsInput } from '../shared/types'; +export type { + CreateProgramClientOptions, + IdlInput, + ProgramClient, + ProgramMethodBuilder, +} from '../program-client/create-program-client'; diff --git a/packages/dynamic-client/test/programs/anchor/Anchor.toml b/packages/dynamic-client/test/programs/anchor/Anchor.toml new file mode 100644 index 000000000..da27ee238 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/Anchor.toml @@ -0,0 +1,19 @@ +[toolchain] + +[features] +resolution = true +skip-lint = false + +[programs.localnet] +anchor-codama = "5xjPsgMHuoj4MrAPJVBrTomk5UAZvCxVtAdcWwgheoZs" +blog = "1rAs9KgDjEnMVrU1nJPWVhN4b6W4VEBxzcNJoeJpbVR" + +[registry] +url = "https://api.apr.dev" + +[provider] +cluster = "Localnet" +wallet = "~/.config/solana/id.json" + +[scripts] +test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.spec.ts" diff --git a/packages/dynamic-client/test/programs/anchor/Cargo.lock b/packages/dynamic-client/test/programs/anchor/Cargo.lock new file mode 100644 index 000000000..a5403d6bb --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/Cargo.lock @@ -0,0 +1,3013 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm-siv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "polyval", + "subtle", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anchor-attribute-access-control" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a883ca44ef14b2113615fc6d3a85fefc68b5002034e88db37f7f1f802f88aa9" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-account" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c4d97763b29030412b4b80715076377edc9cc63bc3c9e667297778384b9fd2" +dependencies = [ + "anchor-syn", + "bs58", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-constant" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae3328bbf9bbd517a51621b1ba6cbec06cbbc25e8cfc7403bddf69bcf088206" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-error" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2398a6d9e16df1ee9d7d37d970a8246756de898c8dd16ef6bdbe4da20cf39a" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-event" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f12758f4ec2f0e98d4d56916c6fe95cb23d74b8723dd902c762c5ef46ebe7b65" +dependencies = [ + "anchor-syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-attribute-program" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7193b5af2649813584aae6e3569c46fd59616a96af2083c556b13136c3830f" +dependencies = [ + "anchor-lang-idl", + "anchor-syn", + "anyhow", + "bs58", + "heck", + "proc-macro2", + "quote", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-accounts" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d332d1a13c0fca1a446de140b656e66110a5e8406977dcb6a41e5d6f323760b0" +dependencies = [ + "anchor-syn", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8656e4af182edaeae665fa2d2d7ee81148518b5bd0be9a67f2a381bb17da7d46" +dependencies = [ + "anchor-syn", + "borsh-derive-internal", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-space" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcff2a083560cd79817db07d89a4de39a2c4b2eaa00c1742cf0df49b25ff2bed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "anchor-lang" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67d85d5376578f12d840c29ff323190f6eecd65b00a0b5f2b2f232751d049cc" +dependencies = [ + "anchor-attribute-access-control", + "anchor-attribute-account", + "anchor-attribute-constant", + "anchor-attribute-error", + "anchor-attribute-event", + "anchor-attribute-program", + "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", + "anchor-lang-idl", + "base64 0.21.7", + "bincode", + "borsh 0.10.4", + "bytemuck", + "solana-account-info", + "solana-clock", + "solana-cpi", + "solana-define-syscall", + "solana-feature-gate-interface", + "solana-instruction", + "solana-instructions-sysvar", + "solana-invoke", + "solana-loader-v3-interface 3.0.0", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", + "thiserror 1.0.69", +] + +[[package]] +name = "anchor-lang-idl" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e8599d21995f68e296265aa5ab0c3cef582fd58afec014d01bd0bce18a4418" +dependencies = [ + "anchor-lang-idl-spec", + "anyhow", + "heck", + "regex", + "serde", + "serde_json", + "sha2 0.10.9", +] + +[[package]] +name = "anchor-lang-idl-spec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" +dependencies = [ + "anyhow", + "serde", +] + +[[package]] +name = "anchor-spl" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3397ab3fc5b198bbfe55d827ff58bd69f2a8d3f9f71c3732c23c2093fec4d3ef" +dependencies = [ + "anchor-lang", + "spl-associated-token-account", + "spl-pod", + "spl-token", + "spl-token-2022", + "spl-token-group-interface", + "spl-token-metadata-interface", +] + +[[package]] +name = "anchor-syn" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93b69aa7d099b59378433f6d7e20e1008fc10c69e48b220270e5b3f2ec4c8be" +dependencies = [ + "anyhow", + "bs58", + "cargo_toml", + "heck", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.9", + "syn 1.0.109", + "thiserror 1.0.69", +] + +[[package]] +name = "anyhow" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "blake3" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blog" +version = "0.1.0" +dependencies = [ + "anchor-lang", +] + +[[package]] +name = "borsh" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" +dependencies = [ + "borsh-derive 0.10.4", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" +dependencies = [ + "borsh-derive 1.6.0", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" +dependencies = [ + "once_cell", + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "bv" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" +dependencies = [ + "feature-probe", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cargo_toml" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" +dependencies = [ + "serde", + "toml 0.8.23", +] + +[[package]] +name = "cc" +version = "1.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "web-sys", +] + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rand_core 0.6.4", + "rustc_version", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "derivation-path" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "example" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-spl", +] + +[[package]] +name = "feature-probe" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "five8" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75b8549488b4715defcb0d8a8a1c1c76a80661b5fa106b4ca0e7fce59d7d875" +dependencies = [ + "five8_core", +] + +[[package]] +name = "five8_const" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26dec3da8bc3ef08f2c04f61eab298c3ab334523e55f076354d6d6f613799a7b" +dependencies = [ + "five8_core", +] + +[[package]] +name = "five8_core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2551bf44bc5f776c15044b9b94153a00198be06743e262afaaa61f11ac7523a5" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "js-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" + +[[package]] +name = "libsecp256k1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +dependencies = [ + "arrayref", + "base64 0.12.3", + "digest 0.9.0", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.7.3", + "serde", + "sha2 0.9.9", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml 0.5.11", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit 0.23.10+spec-1.0.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qstring" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "quote" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "solana-account" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f949fe4edaeaea78c844023bfc1c898e0b1f5a100f8a8d2d0f85d0a7b090258" +dependencies = [ + "solana-account-info", + "solana-clock", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "solana-account-info" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8f5152a288ef1912300fc6efa6c2d1f9bb55d9398eb6c72326360b8063987da" +dependencies = [ + "bincode", + "serde", + "solana-program-error", + "solana-program-memory", + "solana-pubkey", +] + +[[package]] +name = "solana-address-lookup-table-interface" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1673f67efe870b64a65cb39e6194be5b26527691ce5922909939961a6e6b395" +dependencies = [ + "bincode", + "bytemuck", + "serde", + "serde_derive", + "solana-clock", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-slot-hashes", +] + +[[package]] +name = "solana-atomic-u64" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52e52720efe60465b052b9e7445a01c17550666beec855cce66f44766697bc2" +dependencies = [ + "parking_lot", +] + +[[package]] +name = "solana-big-mod-exp" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75db7f2bbac3e62cfd139065d15bcda9e2428883ba61fc8d27ccb251081e7567" +dependencies = [ + "num-bigint", + "num-traits", + "solana-define-syscall", +] + +[[package]] +name = "solana-bincode" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a3787b8cf9c9fe3dd360800e8b70982b9e5a8af9e11c354b6665dd4a003adc" +dependencies = [ + "bincode", + "serde", + "solana-instruction", +] + +[[package]] +name = "solana-blake3-hasher" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0801e25a1b31a14494fc80882a036be0ffd290efc4c2d640bfcca120a4672" +dependencies = [ + "blake3", + "solana-define-syscall", + "solana-hash", + "solana-sanitize", +] + +[[package]] +name = "solana-borsh" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718333bcd0a1a7aed6655aa66bef8d7fb047944922b2d3a18f49cbc13e73d004" +dependencies = [ + "borsh 0.10.4", + "borsh 1.6.0", +] + +[[package]] +name = "solana-clock" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb482ab70fced82ad3d7d3d87be33d466a3498eb8aa856434ff3c0dfc2e2e31" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-cpi" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc71126edddc2ba014622fc32d0f5e2e78ec6c5a1e0eb511b85618c09e9ea11" +dependencies = [ + "solana-account-info", + "solana-define-syscall", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-stable-layout", +] + +[[package]] +name = "solana-curve25519" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae4261b9a8613d10e77ac831a8fa60b6fa52b9b103df46d641deff9f9812a23" +dependencies = [ + "bytemuck", + "bytemuck_derive", + "curve25519-dalek", + "solana-define-syscall", + "subtle", + "thiserror 2.0.18", +] + +[[package]] +name = "solana-decode-error" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c781686a18db2f942e70913f7ca15dc120ec38dcab42ff7557db2c70c625a35" +dependencies = [ + "num-traits", +] + +[[package]] +name = "solana-define-syscall" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ae3e2abcf541c8122eafe9a625d4d194b4023c20adde1e251f94e056bb1aee2" + +[[package]] +name = "solana-derivation-path" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939756d798b25c5ec3cca10e06212bdca3b1443cb9bb740a38124f58b258737b" +dependencies = [ + "derivation-path", + "qstring", + "uriparse", +] + +[[package]] +name = "solana-epoch-rewards" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b575d3dd323b9ea10bb6fe89bf6bf93e249b215ba8ed7f68f1a3633f384db7" +dependencies = [ + "serde", + "serde_derive", + "solana-hash", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-epoch-schedule" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fce071fbddecc55d727b1d7ed16a629afe4f6e4c217bc8d00af3b785f6f67ed" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-example-mocks" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84461d56cbb8bb8d539347151e0525b53910102e4bced875d49d5139708e39d3" +dependencies = [ + "serde", + "serde_derive", + "solana-address-lookup-table-interface", + "solana-clock", + "solana-hash", + "solana-instruction", + "solana-keccak-hasher", + "solana-message", + "solana-nonce", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", + "thiserror 2.0.18", +] + +[[package]] +name = "solana-feature-gate-interface" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f5c5382b449e8e4e3016fb05e418c53d57782d8b5c30aa372fc265654b956d" +dependencies = [ + "bincode", + "serde", + "serde_derive", + "solana-account", + "solana-account-info", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-fee-calculator" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89bc408da0fb3812bc3008189d148b4d3e08252c79ad810b245482a3f70cd8d" +dependencies = [ + "log", + "serde", + "serde_derive", +] + +[[package]] +name = "solana-hash" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b96e9f0300fa287b545613f007dfe20043d7812bee255f418c1eb649c93b63" +dependencies = [ + "borsh 1.6.0", + "bytemuck", + "bytemuck_derive", + "five8", + "js-sys", + "serde", + "serde_derive", + "solana-atomic-u64", + "solana-sanitize", + "wasm-bindgen", +] + +[[package]] +name = "solana-instruction" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab5682934bd1f65f8d2c16f21cb532526fcc1a09f796e2cacdb091eee5774ad" +dependencies = [ + "bincode", + "borsh 1.6.0", + "getrandom 0.2.17", + "js-sys", + "num-traits", + "serde", + "serde_derive", + "serde_json", + "solana-define-syscall", + "solana-pubkey", + "wasm-bindgen", +] + +[[package]] +name = "solana-instructions-sysvar" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0e85a6fad5c2d0c4f5b91d34b8ca47118fc593af706e523cdbedf846a954f57" +dependencies = [ + "bitflags", + "solana-account-info", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-serialize-utils", + "solana-sysvar-id", +] + +[[package]] +name = "solana-invoke" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f5693c6de226b3626658377168b0184e94e8292ff16e3d31d4766e65627565" +dependencies = [ + "solana-account-info", + "solana-define-syscall", + "solana-instruction", + "solana-program-entrypoint", + "solana-stable-layout", +] + +[[package]] +name = "solana-keccak-hasher" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7aeb957fbd42a451b99235df4942d96db7ef678e8d5061ef34c9b34cae12f79" +dependencies = [ + "sha3", + "solana-define-syscall", + "solana-hash", + "solana-sanitize", +] + +[[package]] +name = "solana-last-restart-slot" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6360ac2fdc72e7463565cd256eedcf10d7ef0c28a1249d261ec168c1b55cdd" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-loader-v2-interface" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ab08006dad78ae7cd30df8eea0539e207d08d91eaefb3e1d49a446e1c49654" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "solana-loader-v3-interface" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4be76cfa9afd84ca2f35ebc09f0da0f0092935ccdac0595d98447f259538c2" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-loader-v3-interface" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f7162a05b8b0773156b443bccd674ea78bb9aa406325b467ea78c06c99a63a2" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-loader-v4-interface" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "706a777242f1f39a83e2a96a2a6cb034cb41169c6ecbee2cf09cb873d9659e7e" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-system-interface", +] + +[[package]] +name = "solana-message" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1796aabce376ff74bf89b78d268fa5e683d7d7a96a0a4e4813ec34de49d5314b" +dependencies = [ + "bincode", + "blake3", + "lazy_static", + "serde", + "serde_derive", + "solana-bincode", + "solana-hash", + "solana-instruction", + "solana-pubkey", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", + "solana-system-interface", + "solana-transaction-error", + "wasm-bindgen", +] + +[[package]] +name = "solana-msg" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36a1a14399afaabc2781a1db09cb14ee4cc4ee5c7a5a3cfcc601811379a8092" +dependencies = [ + "solana-define-syscall", +] + +[[package]] +name = "solana-native-token" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61515b880c36974053dd499c0510066783f0cc6ac17def0c7ef2a244874cf4a9" + +[[package]] +name = "solana-nonce" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703e22eb185537e06204a5bd9d509b948f0066f2d1d814a6f475dafb3ddf1325" +dependencies = [ + "serde", + "serde_derive", + "solana-fee-calculator", + "solana-hash", + "solana-pubkey", + "solana-sha256-hasher", +] + +[[package]] +name = "solana-program" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98eca145bd3545e2fbb07166e895370576e47a00a7d824e325390d33bf467210" +dependencies = [ + "bincode", + "blake3", + "borsh 0.10.4", + "borsh 1.6.0", + "bs58", + "bytemuck", + "console_error_panic_hook", + "console_log", + "getrandom 0.2.17", + "lazy_static", + "log", + "memoffset", + "num-bigint", + "num-derive", + "num-traits", + "rand 0.8.5", + "serde", + "serde_bytes", + "serde_derive", + "solana-account-info", + "solana-address-lookup-table-interface", + "solana-atomic-u64", + "solana-big-mod-exp", + "solana-bincode", + "solana-blake3-hasher", + "solana-borsh", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-define-syscall", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-example-mocks", + "solana-feature-gate-interface", + "solana-fee-calculator", + "solana-hash", + "solana-instruction", + "solana-instructions-sysvar", + "solana-keccak-hasher", + "solana-last-restart-slot", + "solana-loader-v2-interface", + "solana-loader-v3-interface 5.0.0", + "solana-loader-v4-interface", + "solana-message", + "solana-msg", + "solana-native-token", + "solana-nonce", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-secp256k1-recover", + "solana-serde-varint", + "solana-serialize-utils", + "solana-sha256-hasher", + "solana-short-vec", + "solana-slot-hashes", + "solana-slot-history", + "solana-stable-layout", + "solana-stake-interface", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", + "solana-vote-interface", + "thiserror 2.0.18", + "wasm-bindgen", +] + +[[package]] +name = "solana-program-entrypoint" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ce041b1a0ed275290a5008ee1a4a6c48f5054c8a3d78d313c08958a06aedbd" +dependencies = [ + "solana-account-info", + "solana-msg", + "solana-program-error", + "solana-pubkey", +] + +[[package]] +name = "solana-program-error" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee2e0217d642e2ea4bee237f37bd61bb02aec60da3647c48ff88f6556ade775" +dependencies = [ + "borsh 1.6.0", + "num-traits", + "serde", + "serde_derive", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-pubkey", +] + +[[package]] +name = "solana-program-memory" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a5426090c6f3fd6cfdc10685322fede9ca8e5af43cd6a59e98bfe4e91671712" +dependencies = [ + "solana-define-syscall", +] + +[[package]] +name = "solana-program-option" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc677a2e9bc616eda6dbdab834d463372b92848b2bfe4a1ed4e4b4adba3397d0" + +[[package]] +name = "solana-program-pack" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "319f0ef15e6e12dc37c597faccb7d62525a509fec5f6975ecb9419efddeb277b" +dependencies = [ + "solana-program-error", +] + +[[package]] +name = "solana-pubkey" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b62adb9c3261a052ca1f999398c388f1daf558a1b492f60a6d9e64857db4ff1" +dependencies = [ + "borsh 0.10.4", + "borsh 1.6.0", + "bytemuck", + "bytemuck_derive", + "curve25519-dalek", + "five8", + "five8_const", + "getrandom 0.2.17", + "js-sys", + "num-traits", + "serde", + "serde_derive", + "solana-atomic-u64", + "solana-decode-error", + "solana-define-syscall", + "solana-sanitize", + "solana-sha256-hasher", + "wasm-bindgen", +] + +[[package]] +name = "solana-rent" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1aea8fdea9de98ca6e8c2da5827707fb3842833521b528a713810ca685d2480" +dependencies = [ + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", +] + +[[package]] +name = "solana-sanitize" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f1bc1357b8188d9c4a3af3fc55276e56987265eb7ad073ae6f8180ee54cecf" + +[[package]] +name = "solana-sdk-ids" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5d8b9cc68d5c88b062a33e23a6466722467dde0035152d8fb1afbcdf350a5f" +dependencies = [ + "solana-pubkey", +] + +[[package]] +name = "solana-sdk-macro" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86280da8b99d03560f6ab5aca9de2e38805681df34e0bb8f238e69b29433b9df" +dependencies = [ + "bs58", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "solana-secp256k1-recover" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa3120b6cdaa270f39444f5093a90a7b03d296d362878f7a6991d6de3bbe496" +dependencies = [ + "libsecp256k1", + "solana-define-syscall", + "thiserror 2.0.18", +] + +[[package]] +name = "solana-security-txt" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "156bb61a96c605fa124e052d630dba2f6fb57e08c7d15b757e1e958b3ed7b3fe" +dependencies = [ + "hashbrown 0.15.2", +] + +[[package]] +name = "solana-seed-derivable" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beb82b5adb266c6ea90e5cf3967235644848eac476c5a1f2f9283a143b7c97f" +dependencies = [ + "solana-derivation-path", +] + +[[package]] +name = "solana-seed-phrase" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36187af2324f079f65a675ec22b31c24919cb4ac22c79472e85d819db9bbbc15" +dependencies = [ + "hmac", + "pbkdf2", + "sha2 0.10.9", +] + +[[package]] +name = "solana-serde-varint" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a7e155eba458ecfb0107b98236088c3764a09ddf0201ec29e52a0be40857113" +dependencies = [ + "serde", +] + +[[package]] +name = "solana-serialize-utils" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "817a284b63197d2b27afdba829c5ab34231da4a9b4e763466a003c40ca4f535e" +dependencies = [ + "solana-instruction", + "solana-pubkey", + "solana-sanitize", +] + +[[package]] +name = "solana-sha256-hasher" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa3feb32c28765f6aa1ce8f3feac30936f16c5c3f7eb73d63a5b8f6f8ecdc44" +dependencies = [ + "sha2 0.10.9", + "solana-define-syscall", + "solana-hash", +] + +[[package]] +name = "solana-short-vec" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c54c66f19b9766a56fa0057d060de8378676cb64987533fa088861858fc5a69" +dependencies = [ + "serde", +] + +[[package]] +name = "solana-signature" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c8ec8e657aecfc187522fc67495142c12f35e55ddeca8698edbb738b8dbd8c" +dependencies = [ + "five8", + "solana-sanitize", +] + +[[package]] +name = "solana-signer" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c41991508a4b02f021c1342ba00bcfa098630b213726ceadc7cb032e051975b" +dependencies = [ + "solana-pubkey", + "solana-signature", + "solana-transaction-error", +] + +[[package]] +name = "solana-slot-hashes" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8691982114513763e88d04094c9caa0376b867a29577939011331134c301ce" +dependencies = [ + "serde", + "serde_derive", + "solana-hash", + "solana-sdk-ids", + "solana-sysvar-id", +] + +[[package]] +name = "solana-slot-history" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ccc1b2067ca22754d5283afb2b0126d61eae734fc616d23871b0943b0d935e" +dependencies = [ + "bv", + "serde", + "serde_derive", + "solana-sdk-ids", + "solana-sysvar-id", +] + +[[package]] +name = "solana-stable-layout" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f14f7d02af8f2bc1b5efeeae71bc1c2b7f0f65cd75bcc7d8180f2c762a57f54" +dependencies = [ + "solana-instruction", + "solana-pubkey", +] + +[[package]] +name = "solana-stake-interface" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5269e89fde216b4d7e1d1739cf5303f8398a1ff372a81232abbee80e554a838c" +dependencies = [ + "borsh 0.10.4", + "borsh 1.6.0", + "num-traits", + "serde", + "serde_derive", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-program-error", + "solana-pubkey", + "solana-system-interface", + "solana-sysvar-id", +] + +[[package]] +name = "solana-system-interface" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94d7c18cb1a91c6be5f5a8ac9276a1d7c737e39a21beba9ea710ab4b9c63bc90" +dependencies = [ + "js-sys", + "num-traits", + "serde", + "serde_derive", + "solana-decode-error", + "solana-instruction", + "solana-pubkey", + "wasm-bindgen", +] + +[[package]] +name = "solana-sysvar" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c3595f95069f3d90f275bb9bd235a1973c4d059028b0a7f81baca2703815db" +dependencies = [ + "base64 0.22.1", + "bincode", + "bytemuck", + "bytemuck_derive", + "lazy_static", + "serde", + "serde_derive", + "solana-account-info", + "solana-clock", + "solana-define-syscall", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-fee-calculator", + "solana-hash", + "solana-instruction", + "solana-instructions-sysvar", + "solana-last-restart-slot", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-pubkey", + "solana-rent", + "solana-sanitize", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-slot-hashes", + "solana-slot-history", + "solana-stake-interface", + "solana-sysvar-id", +] + +[[package]] +name = "solana-sysvar-id" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5762b273d3325b047cfda250787f8d796d781746860d5d0a746ee29f3e8812c1" +dependencies = [ + "solana-pubkey", + "solana-sdk-ids", +] + +[[package]] +name = "solana-transaction-error" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a9dc8fdb61c6088baab34fc3a8b8473a03a7a5fd404ed8dd502fa79b67cb1" +dependencies = [ + "solana-instruction", + "solana-sanitize", +] + +[[package]] +name = "solana-vote-interface" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b80d57478d6599d30acc31cc5ae7f93ec2361a06aefe8ea79bc81739a08af4c3" +dependencies = [ + "bincode", + "num-derive", + "num-traits", + "serde", + "serde_derive", + "solana-clock", + "solana-decode-error", + "solana-hash", + "solana-instruction", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-serde-varint", + "solana-serialize-utils", + "solana-short-vec", + "solana-system-interface", +] + +[[package]] +name = "solana-zk-sdk" +version = "2.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b9fc6ec37d16d0dccff708ed1dd6ea9ba61796700c3bb7c3b401973f10f63b" +dependencies = [ + "aes-gcm-siv", + "base64 0.22.1", + "bincode", + "bytemuck", + "bytemuck_derive", + "curve25519-dalek", + "itertools", + "js-sys", + "merlin", + "num-derive", + "num-traits", + "rand 0.8.5", + "serde", + "serde_derive", + "serde_json", + "sha3", + "solana-derivation-path", + "solana-instruction", + "solana-pubkey", + "solana-sdk-ids", + "solana-seed-derivable", + "solana-seed-phrase", + "solana-signature", + "solana-signer", + "subtle", + "thiserror 2.0.18", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "spl-associated-token-account" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae179d4a26b3c7a20c839898e6aed84cb4477adf108a366c95532f058aea041b" +dependencies = [ + "borsh 1.6.0", + "num-derive", + "num-traits", + "solana-program", + "spl-associated-token-account-client", + "spl-token", + "spl-token-2022", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-associated-token-account-client" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f8349dbcbe575f354f9a533a21f272f3eb3808a49e2fdc1c34393b88ba76cb" +dependencies = [ + "solana-instruction", + "solana-pubkey", +] + +[[package]] +name = "spl-discriminator" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7398da23554a31660f17718164e31d31900956054f54f52d5ec1be51cb4f4b3" +dependencies = [ + "bytemuck", + "solana-program-error", + "solana-sha256-hasher", + "spl-discriminator-derive", +] + +[[package]] +name = "spl-discriminator-derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" +dependencies = [ + "quote", + "spl-discriminator-syn", + "syn 2.0.114", +] + +[[package]] +name = "spl-discriminator-syn" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d1dbc82ab91422345b6df40a79e2b78c7bce1ebb366da323572dd60b7076b67" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.9", + "syn 2.0.114", + "thiserror 1.0.69", +] + +[[package]] +name = "spl-elgamal-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65edfeed09cd4231e595616aa96022214f9c9d2be02dea62c2b30d5695a6833a" +dependencies = [ + "bytemuck", + "solana-account-info", + "solana-cpi", + "solana-instruction", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-system-interface", + "solana-sysvar", + "solana-zk-sdk", + "spl-pod", + "spl-token-confidential-transfer-proof-extraction", +] + +[[package]] +name = "spl-memo" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f09647c0974e33366efeb83b8e2daebb329f0420149e74d3a4bd2c08cf9f7cb" +dependencies = [ + "solana-account-info", + "solana-instruction", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-pubkey", +] + +[[package]] +name = "spl-pod" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d994afaf86b779104b4a95ba9ca75b8ced3fdb17ee934e38cb69e72afbe17799" +dependencies = [ + "borsh 1.6.0", + "bytemuck", + "bytemuck_derive", + "num-derive", + "num-traits", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "solana-program-option", + "solana-pubkey", + "solana-zk-sdk", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-program-error" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cdebc8b42553070b75aa5106f071fef2eb798c64a7ec63375da4b1f058688c6" +dependencies = [ + "num-derive", + "num-traits", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "spl-program-error-derive", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-program-error-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2539e259c66910d78593475540e8072f0b10f0f61d7607bbf7593899ed52d0" +dependencies = [ + "proc-macro2", + "quote", + "sha2 0.10.9", + "syn 2.0.114", +] + +[[package]] +name = "spl-tlv-account-resolution" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1408e961215688715d5a1063cbdcf982de225c45f99c82b4f7d7e1dd22b998d7" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-token" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053067c6a82c705004f91dae058b11b4780407e9ccd6799dc9e7d0fab5f242da" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-account-info", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-sysvar", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-token-2022" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f0dfbb079eebaee55e793e92ca5f433744f4b71ee04880bfd6beefba5973e5" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "num_enum", + "solana-account-info", + "solana-clock", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-native-token", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-program-option", + "solana-program-pack", + "solana-pubkey", + "solana-rent", + "solana-sdk-ids", + "solana-security-txt", + "solana-system-interface", + "solana-sysvar", + "solana-zk-sdk", + "spl-elgamal-registry", + "spl-memo", + "spl-pod", + "spl-token", + "spl-token-confidential-transfer-ciphertext-arithmetic", + "spl-token-confidential-transfer-proof-extraction", + "spl-token-confidential-transfer-proof-generation", + "spl-token-group-interface", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "spl-type-length-value", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-token-confidential-transfer-ciphertext-arithmetic" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cddd52bfc0f1c677b41493dafa3f2dbbb4b47cf0990f08905429e19dc8289b35" +dependencies = [ + "base64 0.22.1", + "bytemuck", + "solana-curve25519", + "solana-zk-sdk", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-extraction" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe2629860ff04c17bafa9ba4bed8850a404ecac81074113e1f840dbd0ebb7bd6" +dependencies = [ + "bytemuck", + "solana-account-info", + "solana-curve25519", + "solana-instruction", + "solana-instructions-sysvar", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "solana-sdk-ids", + "solana-zk-sdk", + "spl-pod", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-token-confidential-transfer-proof-generation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa27b9174bea869a7ebf31e0be6890bce90b1a4288bc2bbf24bd413f80ae3fde" +dependencies = [ + "curve25519-dalek", + "solana-zk-sdk", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-token-group-interface" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5597b4cd76f85ce7cd206045b7dc22da8c25516573d42d267c8d1fd128db5129" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-token-metadata-interface" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304d6e06f0de0c13a621464b1fd5d4b1bebf60d15ca71a44d3839958e0da16ee" +dependencies = [ + "borsh 1.6.0", + "num-derive", + "num-traits", + "solana-borsh", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-type-length-value", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-transfer-hook-interface" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e905b849b6aba63bde8c4badac944ebb6c8e6e14817029cbe1bc16829133bd" +dependencies = [ + "arrayref", + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-cpi", + "solana-decode-error", + "solana-instruction", + "solana-msg", + "solana-program-error", + "solana-pubkey", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-tlv-account-resolution", + "spl-type-length-value", + "thiserror 2.0.18", +] + +[[package]] +name = "spl-type-length-value" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d417eb548214fa822d93f84444024b4e57c13ed6719d4dcc68eec24fb481e9f5" +dependencies = [ + "bytemuck", + "num-derive", + "num-traits", + "solana-account-info", + "solana-decode-error", + "solana-msg", + "solana-program-error", + "spl-discriminator", + "spl-pod", + "thiserror 2.0.18", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-ident" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.114", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "zerocopy" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "zmij" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7" diff --git a/packages/dynamic-client/test/programs/anchor/Cargo.toml b/packages/dynamic-client/test/programs/anchor/Cargo.toml new file mode 100644 index 000000000..92e201f94 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/Cargo.toml @@ -0,0 +1,12 @@ +[workspace] +members = ["programs/*"] +resolver = "2" + +[profile.release] +overflow-checks = true +lto = "fat" +codegen-units = 1 +[profile.release.build-override] +opt-level = 3 +incremental = false +codegen-units = 1 diff --git a/packages/dynamic-client/test/programs/anchor/programs/blog/Cargo.toml b/packages/dynamic-client/test/programs/anchor/programs/blog/Cargo.toml new file mode 100644 index 000000000..8c14f4312 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/blog/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "blog" +version = "0.1.0" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "blog" + + +[features] +default = [] +cpi = ["no-entrypoint"] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +idl-build = ["anchor-lang/idl-build"] + + +[dependencies] +anchor-lang = "=0.32.1" diff --git a/packages/dynamic-client/test/programs/anchor/programs/blog/Xargo.toml b/packages/dynamic-client/test/programs/anchor/programs/blog/Xargo.toml new file mode 100644 index 000000000..475fb71ed --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/blog/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/packages/dynamic-client/test/programs/anchor/programs/blog/src/lib.rs b/packages/dynamic-client/test/programs/anchor/programs/blog/src/lib.rs new file mode 100644 index 000000000..a230895b3 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/blog/src/lib.rs @@ -0,0 +1,358 @@ +#![allow(unexpected_cfgs)] +use anchor_lang::prelude::*; + +declare_id!("1rAs9KgDjEnMVrU1nJPWVhN4b6W4VEBxzcNJoeJpbVR"); + +#[program] +pub mod blog { + use super::*; + + pub fn create_profile(ctx: Context, username: String) -> Result<()> { + let profile = &mut ctx.accounts.profile; + profile.authority = ctx.accounts.authority.key(); + profile.username = username; + profile.post_count = 0; + profile.bump = ctx.bumps.profile; + Ok(()) + } + + pub fn create_post( + ctx: Context, + title: String, + content: String, + ) -> Result<()> { + let profile = &mut ctx.accounts.profile; + let post = &mut ctx.accounts.post; + + post.author = profile.key(); + post.id = profile.post_count; + post.title = title; + post.content = content; + post.bump = ctx.bumps.post; + + profile.post_count += 1; + Ok(()) + } + + pub fn update_post( + ctx: Context, + _post_id: u64, + title: String, + content: String, + ) -> Result<()> { + let post = &mut ctx.accounts.post; + post.title = title; + post.content = content; + Ok(()) + } + + pub fn create_category(ctx: Context, name: String) -> Result<()> { + let category = &mut ctx.accounts.category; + category.creator = ctx.accounts.creator.key(); + category.name = name; + category.bump = ctx.bumps.category; + Ok(()) + } + + pub fn subscribe(ctx: Context) -> Result<()> { + let subscription = &mut ctx.accounts.subscription; + subscription.follower = ctx.accounts.follower.key(); + subscription.author = ctx.accounts.author.key(); + subscription.bump = ctx.bumps.subscription; + Ok(()) + } + + pub fn react(ctx: Context, kind: u8) -> Result<()> { + let reaction = &mut ctx.accounts.reaction; + reaction.post = ctx.accounts.post.key(); + reaction.user = ctx.accounts.user.key(); + reaction.kind = kind; + reaction.bump = ctx.bumps.reaction; + Ok(()) + } + + pub fn create_daily_digest( + ctx: Context, + year: u16, + month: u8, + day: u8, + ) -> Result<()> { + let digest = &mut ctx.accounts.daily_digest; + digest.profile = ctx.accounts.profile.key(); + digest.year = year; + digest.month = month; + digest.day = day; + digest.post_count = 0; + digest.bump = ctx.bumps.daily_digest; + Ok(()) + } + + pub fn create_access_grant( + ctx: Context, + permissions: [u8; 4], + ) -> Result<()> { + let grant = &mut ctx.accounts.access_grant; + grant.profile = ctx.accounts.profile.key(); + grant.permissions = permissions; + grant.bump = ctx.bumps.access_grant; + Ok(()) + } + + pub fn create_bookmark_list( + ctx: Context, + bookmarks: Vec, + ) -> Result<()> { + let list = &mut ctx.accounts.bookmark_list; + list.owner = ctx.accounts.owner.key(); + list.bookmarks = bookmarks; + list.bump = ctx.bumps.bookmark_list; + Ok(()) + } +} + +#[derive(Accounts)] +#[instruction(username: String)] +pub struct CreateProfile<'info> { + #[account(mut)] + pub authority: Signer<'info>, + #[account( + init, + payer = authority, + space = 8 + Profile::INIT_SPACE, + seeds = [b"profile", authority.key().as_ref()], + bump + )] + pub profile: Account<'info, Profile>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +#[instruction(title: String, content: String)] +pub struct CreatePost<'info> { + #[account(mut)] + pub authority: Signer<'info>, + #[account( + mut, + seeds = [b"profile", authority.key().as_ref()], + bump = profile.bump, + has_one = authority, + )] + pub profile: Account<'info, Profile>, + #[account( + init, + payer = authority, + space = 8 + Post::INIT_SPACE, + seeds = [b"post", profile.key().as_ref(), &profile.post_count.to_le_bytes()], + bump + )] + pub post: Account<'info, Post>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +#[instruction(post_id: u64)] +pub struct UpdatePost<'info> { + pub authority: Signer<'info>, + #[account( + seeds = [b"profile", authority.key().as_ref()], + bump = profile.bump, + has_one = authority, + )] + pub profile: Account<'info, Profile>, + #[account( + mut, + seeds = [b"post", profile.key().as_ref(), &post_id.to_le_bytes()], + bump = post.bump, + has_one = author, + )] + pub post: Account<'info, Post>, + /// CHECK: validated via has_one on post + pub author: UncheckedAccount<'info>, +} + +#[derive(Accounts)] +#[instruction(name: String)] +pub struct CreateCategory<'info> { + #[account(mut)] + pub creator: Signer<'info>, + #[account( + init, + payer = creator, + space = 8 + Category::INIT_SPACE, + seeds = [b"category", name.as_bytes()], + bump + )] + pub category: Account<'info, Category>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct Subscribe<'info> { + #[account(mut)] + pub follower: Signer<'info>, + /// CHECK: the author profile being followed + pub author: UncheckedAccount<'info>, + #[account( + init, + payer = follower, + space = 8 + Subscription::INIT_SPACE, + seeds = [b"sub", follower.key().as_ref(), author.key().as_ref()], + bump + )] + pub subscription: Account<'info, Subscription>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +#[instruction(kind: u8)] +pub struct React<'info> { + #[account(mut)] + pub user: Signer<'info>, + /// CHECK: the post being reacted to + pub post: UncheckedAccount<'info>, + #[account( + init, + payer = user, + space = 8 + Reaction::INIT_SPACE, + seeds = [b"reaction", post.key().as_ref(), user.key().as_ref(), &kind.to_le_bytes()], + bump + )] + pub reaction: Account<'info, Reaction>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +#[instruction(year: u16, month: u8, day: u8)] +pub struct CreateDailyDigest<'info> { + #[account(mut)] + pub authority: Signer<'info>, + #[account( + seeds = [b"profile", authority.key().as_ref()], + bump = profile.bump, + has_one = authority, + )] + pub profile: Account<'info, Profile>, + #[account( + init, + payer = authority, + space = 8 + DailyDigest::INIT_SPACE, + seeds = [b"digest", profile.key().as_ref(), &year.to_le_bytes(), &month.to_le_bytes(), &day.to_le_bytes()], + bump + )] + pub daily_digest: Account<'info, DailyDigest>, + pub system_program: Program<'info, System>, +} + +#[account] +#[derive(InitSpace)] +pub struct Profile { + pub authority: Pubkey, + #[max_len(32)] + pub username: String, + pub post_count: u64, + pub bump: u8, +} + +#[account] +#[derive(InitSpace)] +pub struct Post { + pub author: Pubkey, + pub id: u64, + #[max_len(64)] + pub title: String, + #[max_len(512)] + pub content: String, + pub bump: u8, +} + +#[account] +#[derive(InitSpace)] +pub struct Category { + pub creator: Pubkey, + #[max_len(32)] + pub name: String, + pub bump: u8, +} + +#[account] +#[derive(InitSpace)] +pub struct Subscription { + pub follower: Pubkey, + pub author: Pubkey, + pub bump: u8, +} + +#[account] +#[derive(InitSpace)] +pub struct Reaction { + pub post: Pubkey, + pub user: Pubkey, + pub kind: u8, + pub bump: u8, +} + +#[derive(Accounts)] +#[instruction(permissions: [u8; 4])] +pub struct CreateAccessGrant<'info> { + #[account(mut)] + pub authority: Signer<'info>, + #[account( + seeds = [b"profile", authority.key().as_ref()], + bump = profile.bump, + has_one = authority, + )] + pub profile: Account<'info, Profile>, + #[account( + init, + payer = authority, + space = 8 + AccessGrant::INIT_SPACE, + seeds = [b"grant", profile.key().as_ref(), permissions.as_ref()], + bump + )] + pub access_grant: Account<'info, AccessGrant>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +#[instruction(bookmarks: Vec)] +pub struct CreateBookmarkList<'info> { + #[account(mut)] + pub owner: Signer<'info>, + #[account( + init, + payer = owner, + space = 8 + BookmarkList::INIT_SPACE, + seeds = [b"bookmarks", owner.key().as_ref()], + bump + )] + pub bookmark_list: Account<'info, BookmarkList>, + pub system_program: Program<'info, System>, +} + +#[account] +#[derive(InitSpace)] +pub struct DailyDigest { + pub profile: Pubkey, + pub year: u16, + pub month: u8, + pub day: u8, + pub post_count: u8, + pub bump: u8, +} + +#[account] +#[derive(InitSpace)] +pub struct AccessGrant { + pub profile: Pubkey, + pub permissions: [u8; 4], + pub bump: u8, +} + +#[account] +#[derive(InitSpace)] +pub struct BookmarkList { + pub owner: Pubkey, + #[max_len(10)] + pub bookmarks: Vec, + pub bump: u8, +} diff --git a/packages/dynamic-client/test/programs/anchor/programs/example/Cargo.toml b/packages/dynamic-client/test/programs/anchor/programs/example/Cargo.toml new file mode 100644 index 000000000..3da2e277e --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/example/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "example" +version = "0.1.0" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "example" + + +[features] +default = [] +cpi = ["no-entrypoint"] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"] + + +[dependencies] +anchor-lang = "=0.32.1" +anchor-spl = "=0.32.1" \ No newline at end of file diff --git a/packages/dynamic-client/test/programs/anchor/programs/example/Xargo.toml b/packages/dynamic-client/test/programs/anchor/programs/example/Xargo.toml new file mode 100644 index 000000000..475fb71ed --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/example/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/packages/dynamic-client/test/programs/anchor/programs/example/src/lib.rs b/packages/dynamic-client/test/programs/anchor/programs/example/src/lib.rs new file mode 100644 index 000000000..77253237a --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/example/src/lib.rs @@ -0,0 +1,282 @@ +#![allow(unexpected_cfgs)] +use anchor_lang::prelude::*; + +use anchor_spl::{token::{Token, Mint, TokenAccount}, associated_token::AssociatedToken}; +mod nested_example; +pub use nested_example::*; + +declare_id!("5xjPsgMHuoj4MrAPJVBrTomk5UAZvCxVtAdcWwgheoZs"); + +#[program] +pub mod example { + use super::*; + + pub fn pubkey_seed_ix(ctx: Context, input: u64) -> Result<()> { + ctx.accounts.new_account.input = input; + ctx.accounts.new_account.bump = ctx.bumps.new_account; + Ok(()) + } + + pub fn update_optional_input( + ctx: Context, + input: u64, + optional_input: Option, + ) -> Result<()> { + ctx.accounts.existing_account.input = input; + ctx.accounts.existing_account.optional_input = optional_input; + Ok(()) + } + + pub fn update_optional_account(ctx: Context, _id: u64) -> Result<()> { + ctx.accounts.created_optional_acc.optional_acc = + ctx.accounts.optional_acc_key.as_ref().map(|acc| acc.key()); + Ok(()) + } + + pub fn no_arguments(_ctx: Context) -> Result<()> { + Ok(()) + } + + pub fn external_programs_with_pda(_ctx: Context) -> Result<()> { + Ok(()) + } + + pub fn four_level_pda(_ctx: Context) -> Result<()> { + Ok(()) + } + + pub fn self_reference_pda(_ctx: Context) -> Result<()> { + Ok(()) + } + + pub fn two_node_cycle_pda(_ctx: Context) -> Result<()> { + Ok(()) + } + + pub fn nested_example(ctx: Context, input: StructAndEnumsInput) -> Result<()> { + nested_example::handler(ctx, input) + } + + pub fn string_seed_pda(ctx: Context, _name: String, id: u64) -> Result<()> { + ctx.accounts.pda_account.input = id; + ctx.accounts.pda_account.bump = ctx.bumps.pda_account; + Ok(()) + } +} + +#[derive(Accounts)] +pub struct PubkeySeedIx<'info> { + #[account(mut)] + pub signer: Signer<'info>, + #[account( + init, + payer = signer, + space = 8 + 8 + 1 + 32 + 1, + seeds = [b"seed", signer.key().as_ref()], + bump + )] + pub new_account: Account<'info, DataAccount1>, + pub system_program: Program<'info, System>, +} + +#[account] +#[derive(InitSpace)] +pub struct DataAccount1 { + input: u64, + optional_input: Option, + bump: u8, +} + +#[derive(Accounts)] +pub struct UpdateOptionalInput<'info> { + pub signer: Signer<'info>, + #[account( + mut, + seeds = [b"seed", signer.key().as_ref()], + bump = existing_account.bump + )] + pub existing_account: Account<'info, DataAccount1>, +} + +#[derive(Accounts)] +#[instruction(id: u64)] +pub struct UpdateOptionalAccount<'info> { + #[account(mut)] + pub signer: Signer<'info>, + #[account( + init, + seeds = [b"optional_acc".as_ref(), &id.to_le_bytes()], + payer = signer, + space = 8 + StoreOptionalAccount::INIT_SPACE, + bump, + )] + pub created_optional_acc: Account<'info, StoreOptionalAccount>, + pub optional_acc_key: Option>, + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct NoArguments<'info> { + #[account(mut)] + pub signer: Signer<'info>, + #[account( + init, + payer = signer, + space = 8 + StoreOptionalAccount::INIT_SPACE, + )] + pub acc: Account<'info, StoreOptionalAccount>, + pub system_program: Program<'info, System>, +} + +#[account] +#[derive(InitSpace)] +pub struct StoreOptionalAccount { + optional_acc: Option, +} + +#[derive(Accounts)] +pub struct ExternalProgramsWithPdaIx<'info> { + #[account(mut)] + pub signer: Signer<'info>, + + // mint and token_account are to check auto-resolution with external program + #[account( + init, + payer = signer, + mint::decimals = 9, + mint::authority = signer, + )] + pub mint: Account<'info, Mint>, + #[account( + init, + payer = signer, + associated_token::mint = mint, + associated_token::authority = signer, + )] + pub token_account: Account<'info, TokenAccount>, + + // dependent_account to check that auto-resolution and seeds derivation from both: + // signer (accountInput) and token_account (another auto-derived account) + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"signer_and_ata", signer.key().as_ref(), token_account.key().as_ref()], + bump + )] + pub dependent_account: Account<'info, DataAccount1>, + + pub system_program: Program<'info, System>, + pub token_program: Program<'info, Token>, + pub associated_token_program: Program<'info, AssociatedToken>, + pub rent: Sysvar<'info, Rent>, +} + +#[derive(Accounts)] +pub struct FourLevelPda<'info> { + #[account(mut)] + pub signer: Signer<'info>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"level1", signer.key().as_ref()], + bump + )] + pub level1: Account<'info, DataAccount1>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"level2", level1.key().as_ref()], + bump + )] + pub level2: Account<'info, DataAccount1>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"level3", level2.key().as_ref()], + bump + )] + pub level3: Account<'info, DataAccount1>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"level4", level3.key().as_ref()], + bump + )] + pub level4: Account<'info, DataAccount1>, + + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct SelfReferencePda<'info> { + #[account(mut)] + pub signer: Signer<'info>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"recursive", recursive.key().as_ref()], + bump + )] + pub recursive: Account<'info, DataAccount1>, + + pub system_program: Program<'info, System>, +} + +#[derive(Accounts)] +pub struct TwoNodeCyclePda<'info> { + #[account(mut)] + pub signer: Signer<'info>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"pda_a", pda_b.key().as_ref()], + bump + )] + pub pda_a: Account<'info, DataAccount1>, + + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [b"pda_b", pda_a.key().as_ref()], + bump + )] + pub pda_b: Account<'info, DataAccount1>, + + pub system_program: Program<'info, System>, +} + +// Reproducer for the PDA seed type mismatch: +// The `name` argument is a Rust `String`, which Borsh serializes with a u32 length prefix +// (sizePrefixTypeNode in Codama). But the PDA seed uses `name.as_bytes()` — raw UTF-8 bytes +// without any prefix (stringTypeNode in Codama). Without the proper seedTypeNode in +// pda-seed-value.ts, the library would encode the seed with the length prefix, deriving +// the wrong PDA address. +#[derive(Accounts)] +#[instruction(name: String, id: u64)] +pub struct StringSeedPda<'info> { + #[account(mut)] + pub signer: Signer<'info>, + #[account( + init, + payer = signer, + space = 8 + DataAccount1::INIT_SPACE, + seeds = [&id.to_le_bytes(), name.as_bytes()], + bump + )] + pub pda_account: Account<'info, DataAccount1>, + pub system_program: Program<'info, System>, +} diff --git a/packages/dynamic-client/test/programs/anchor/programs/example/src/nested_example.rs b/packages/dynamic-client/test/programs/anchor/programs/example/src/nested_example.rs new file mode 100644 index 000000000..716340048 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/programs/example/src/nested_example.rs @@ -0,0 +1,136 @@ + +use anchor_lang::prelude::*; +use anchor_lang::Space; + +// All arguments are stored in the NestedExampleAccount.input field for testing. +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub struct StructAndEnumsInput { + pub header: InnerHeader, + pub inner_struct: InnerStruct, + pub inner_enum: InnerEnum, + pub seed_enum: SeedEnum, + pub pubkey: Pubkey, +} + +#[account] +#[derive(InitSpace)] +pub struct NestedExampleAccount { + pub input: StructAndEnumsInput, +} + +// We need to implement Space for all structures for size calculation. +impl Space for StructAndEnumsInput { + const INIT_SPACE: usize = + InnerHeader::INIT_SPACE + + InnerStruct::INIT_SPACE + + InnerEnum::INIT_SPACE + + SeedEnum::INIT_SPACE + + 32; // Pubkey field +} + +// header: InnerHeader +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub struct InnerHeader { + pub version: u32, + pub command: Command, +} +impl Space for InnerHeader { + const INIT_SPACE: usize = 4 + Command::INIT_SPACE; +} +// command: Command +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub enum Command { + Start(u64), + Stop, + Continue { reason: String }, +} +impl Space for Command { + const INIT_SPACE: usize = 1 + 8 + 4 + 64; // discriminant + u64 + String (max 64 for simplicity) +} + +// inner_struct: InnerStruct +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub struct InnerStruct { + pub value: u64, + pub name: String, + pub seed_enum: SeedEnum, + pub bytes: Vec, + pub optional_pubkey: Option, + pub enums_array: [SeedEnum; 2], +} +impl Space for InnerStruct { + const INIT_SPACE: usize = + 8 // value: u64 + + 4 + 32 // name: String (max 32 for simplicity) + + SeedEnum::INIT_SPACE + + 4 + 32 // bytes: Vec (max 32 for simplicity) + + 1 + 32 // optional_pubkey: Option + + 2 * SeedEnum::INIT_SPACE; // enums_array +} + +// inner_enum: InnerEnum +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub enum InnerEnum { + TokenTransfer { amount: u64, token_type: TokenType }, + Stake { duration: u64 }, + None, +} +impl Space for InnerEnum { + const INIT_SPACE: usize = 1 + 8 + TokenType::INIT_SPACE; +} +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub enum TokenType { + SPL, + NFT { collection: String }, +} +impl Space for TokenType { + const INIT_SPACE: usize = 1 + 4 + 64; +} + +// seed_enum: SeedEnum (used as example of nested enum PDA seed) +#[derive(AnchorSerialize, AnchorDeserialize, Clone)] +pub enum SeedEnum { + Arm = 0, + Bar = 1, + Car = 2, +} +impl SeedEnum { + pub fn as_seed(&self) -> [u8; 1] { + [self.clone() as u8] + } +} +impl Space for SeedEnum { + const INIT_SPACE: usize = 1; +} + +#[derive(Accounts)] +#[instruction(input: StructAndEnumsInput)] +pub struct NestedStructsAndEnums<'info> { + #[account(mut)] + pub signer: Signer<'info>, + // The PDA account is derived using multiple fields from the input arguments, demonstrating complex seed derivation. + // Dependency from argument doesn't produce pdaAccountNode with seeds in Codama IDL. + #[account( + init, + payer = signer, + space = 8 + NestedExampleAccount::INIT_SPACE, + seeds = [ + b"nested_example_account", + input.pubkey.as_ref(), + input.seed_enum.as_seed().as_ref(), + input.inner_struct.seed_enum.as_seed().as_ref(), + ], + bump + )] + pub nested_example_account: Account<'info, NestedExampleAccount>, + pub system_program: Program<'info, System>, +} + +pub fn handler( + ctx: Context, + input: StructAndEnumsInput, +) -> Result<()> { + let nested_example_account = &mut ctx.accounts.nested_example_account; + nested_example_account.input = input; + Ok(()) +} diff --git a/packages/dynamic-client/test/programs/anchor/rust-toolchain.toml b/packages/dynamic-client/test/programs/anchor/rust-toolchain.toml new file mode 100644 index 000000000..075062e5e --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.93.0" diff --git a/packages/dynamic-client/test/programs/anchor/tests/blog.test.ts b/packages/dynamic-client/test/programs/anchor/tests/blog.test.ts new file mode 100644 index 000000000..df4c383a3 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/tests/blog.test.ts @@ -0,0 +1,380 @@ +import path from 'node:path'; + +import { getNodeCodec } from '@codama/dynamic-codecs'; +import { type Address, getProgramDerivedAddress } from '@solana/addresses'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { createProgramClient } from '../../../../src'; +import type { BlogProgramClient } from '../../generated/blog-idl-types'; +import { loadIdl, SvmTestContext } from '../../test-utils'; + +const idl = loadIdl('blog-idl.json'); +const programClient = createProgramClient(idl); +const programSoPath = path.resolve(__dirname, '..', '..', 'dumps', 'blog.so'); + +describe('blog', () => { + let ctx: SvmTestContext; + let payer: Address; + + beforeEach(async () => { + ctx = new SvmTestContext({ defaultPrograms: true }); + ctx.loadProgram(programClient.programAddress, programSoPath); + payer = await ctx.createFundedAccount(); + }); + + describe('category PDA — string seed', () => { + test('should create a category and read it back via pdas helper', async () => { + const ix = await programClient.methods + .createCategory({ name: 'solana' }) + .accounts({ creator: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + const [categoryPda] = await programClient.pdas.category({ name: 'solana' }); + const decoded = decodeAccount('category', categoryPda); + expect(decoded.creator).toBe(payer); + expect(decoded.name).toBe('solana'); + }); + + test('should derive distinct PDAs for different category names', async () => { + for (const name of ['tech', 'art', 'science']) { + const ix = await programClient.methods + .createCategory({ name }) + .accounts({ creator: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + } + + const [techPda] = await programClient.pdas.category({ name: 'tech' }); + const [artPda] = await programClient.pdas.category({ name: 'art' }); + const [sciencePda] = await programClient.pdas.category({ name: 'science' }); + + expect(decodeAccount('category', techPda).name).toBe('tech'); + expect(decodeAccount('category', artPda).name).toBe('art'); + expect(decodeAccount('category', sciencePda).name).toBe('science'); + }); + }); + + describe('subscription PDA — two pubkey seeds', () => { + test('should create a subscription and read it back via pdas helper', async () => { + const author = payer; + const follower = await ctx.createFundedAccount(); + + const ix = await programClient.methods.subscribe().accounts({ author, follower }).instruction(); + + await ctx.sendInstruction(ix, [follower]); + + const [subPda] = await programClient.pdas.subscription({ author, follower }); + const decoded = decodeAccount('subscription', subPda); + expect(decoded.follower).toBe(follower); + expect(decoded.author).toBe(author); + }); + + test('should derive distinct PDAs when follower/author are swapped', async () => { + const alice = await ctx.createFundedAccount(); + const bob = await ctx.createFundedAccount(); + + // Alice follows Bob + const ix1 = await programClient.methods + .subscribe() + .accounts({ author: bob, follower: alice }) + .instruction(); + await ctx.sendInstruction(ix1, [alice]); + + // Bob follows Alice + const ix2 = await programClient.methods + .subscribe() + .accounts({ author: alice, follower: bob }) + .instruction(); + await ctx.sendInstruction(ix2, [bob]); + + const [sub1] = await programClient.pdas.subscription({ author: bob, follower: alice }); + const [sub2] = await programClient.pdas.subscription({ author: alice, follower: bob }); + + expect(decodeAccount('subscription', sub1).follower).toBe(alice); + expect(decodeAccount('subscription', sub2).follower).toBe(bob); + }); + }); + + describe('post PDA — updatePost auto-derives post from postId argument', () => { + test('should create a post then update it with auto-derived PDA', async () => { + // Create profile + const createProfileIx = await programClient.methods + .createProfile({ username: 'writer' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + + // Create post (manual PDA — Codama can't express profile.post_count dependency) + const [postPda] = await programClient.pdas.post({ postId: 0, profile: profilePda }); + const createPostIx = await programClient.methods + .createPost({ content: 'Original content', title: 'Original' }) + .accounts({ authority: payer, post: postPda }) + .instruction(); + await ctx.sendInstruction(createPostIx, [payer]); + + // Update post — post account should auto-derive from postId arg + profile account + const updatePostIx = await programClient.methods + .updatePost({ content: 'Updated content', postId: 0, title: 'Updated' }) + .accounts({ author: profilePda, authority: payer }) + .instruction(); + await ctx.sendInstruction(updatePostIx, [payer]); + + const decoded = decodeAccount('post', postPda); + expect(decoded.title).toBe('Updated'); + expect(decoded.content).toBe('Updated content'); + }); + }); + + describe('reaction PDA — two pubkeys + u8 seed', () => { + test('should create a reaction and read it back via pdas helper', async () => { + // Setup: create profile + post + const createProfileIx = await programClient.methods + .createProfile({ username: 'alice' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + const [postPda] = await programClient.pdas.post({ postId: 0, profile: profilePda }); + + const createPostIx = await programClient.methods + .createPost({ content: 'World', title: 'Hello' }) + .accounts({ authority: payer, post: postPda }) + .instruction(); + await ctx.sendInstruction(createPostIx, [payer]); + + // React with kind=1 (like) + const reactor = await ctx.createFundedAccount(); + const ix = await programClient.methods + .react({ kind: 1 }) + .accounts({ post: postPda, user: reactor }) + .instruction(); + await ctx.sendInstruction(ix, [reactor]); + + const [reactionPda] = await programClient.pdas.reaction({ + kind: 1, + post: postPda, + user: reactor, + }); + const decoded = decodeAccount('reaction', reactionPda); + expect(decoded.post).toBe(postPda); + expect(decoded.user).toBe(reactor); + expect(decoded.kind).toBe(1); + }); + + test('should derive distinct PDAs for different reaction kinds on the same post', async () => { + // Setup: create profile + post + const createProfileIx = await programClient.methods + .createProfile({ username: 'bob' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + const [postPda] = await programClient.pdas.post({ postId: 0, profile: profilePda }); + + const createPostIx = await programClient.methods + .createPost({ content: 'There', title: 'Hi' }) + .accounts({ authority: payer, post: postPda }) + .instruction(); + await ctx.sendInstruction(createPostIx, [payer]); + + // Same user, two reaction kinds + const reactor = await ctx.createFundedAccount(); + for (const kind of [0, 1]) { + const ix = await programClient.methods + .react({ kind }) + .accounts({ post: postPda, user: reactor }) + .instruction(); + await ctx.sendInstruction(ix, [reactor]); + } + + const [likePda] = await programClient.pdas.reaction({ kind: 0, post: postPda, user: reactor }); + const [lovePda] = await programClient.pdas.reaction({ kind: 1, post: postPda, user: reactor }); + + expect(decodeAccount('reaction', likePda).kind).toBe(0); + expect(decodeAccount('reaction', lovePda).kind).toBe(1); + }); + }); + + describe('dailyDigest PDA — pubkey + u16 + u8 + u8 seeds', () => { + test('should create a daily digest and read it back via pdas helper', async () => { + const createProfileIx = await programClient.methods + .createProfile({ username: 'charlie' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + + const ix = await programClient.methods + .createDailyDigest({ day: 25, month: 2, year: 2026 }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const [digestPda] = await programClient.pdas.dailyDigest({ + day: 25, + month: 2, + profile: profilePda, + year: 2026, + }); + const decoded = decodeAccount('dailyDigest', digestPda); + expect(decoded.profile).toBe(profilePda); + expect(decoded.year).toBe(2026); + expect(decoded.month).toBe(2); + expect(decoded.day).toBe(25); + expect(decoded.postCount).toBe(0); + }); + + test('should derive distinct PDAs for different dates', async () => { + const createProfileIx = await programClient.methods + .createProfile({ username: 'dave' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + + const dates = [ + { day: 1, month: 1, year: 2026 }, + { day: 2, month: 1, year: 2026 }, + { day: 1, month: 2, year: 2026 }, + ]; + + for (const date of dates) { + const ix = await programClient.methods + .createDailyDigest(date) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + } + + for (const date of dates) { + const [pda] = await programClient.pdas.dailyDigest({ profile: profilePda, ...date }); + const decoded = decodeAccount('dailyDigest', pda); + expect(decoded.year).toBe(date.year); + expect(decoded.month).toBe(date.month); + expect(decoded.day).toBe(date.day); + } + }); + }); + + describe('accessGrant PDA — pubkey + [u8; 4] array seed', () => { + test('should create an access grant and read it back via pdas helper', async () => { + const createProfileIx = await programClient.methods + .createProfile({ username: 'eve' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + const permissions = new Uint8Array([1, 0, 1, 0]); // read, no-write, execute, no-admin + + const ix = await programClient.methods + .createAccessGrant({ permissions }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const [grantPda] = await programClient.pdas.accessGrant({ + permissions, + profile: profilePda, + }); + const decoded = decodeAccount('accessGrant', grantPda); + expect(decoded.profile).toBe(profilePda); + expect(decodeBytes(decoded.permissions)).toEqual([1, 0, 1, 0]); + }); + + test('should derive distinct PDAs for different permission sets', async () => { + const createProfileIx = await programClient.methods + .createProfile({ username: 'frank' }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(createProfileIx, [payer]); + + const [profilePda] = await programClient.pdas.profile({ authority: payer }); + const readOnly = new Uint8Array([1, 0, 0, 0]); + const fullAccess = new Uint8Array([1, 1, 1, 1]); + + for (const permissions of [readOnly, fullAccess]) { + const ix = await programClient.methods + .createAccessGrant({ permissions }) + .accounts({ authority: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + } + + const [readPda] = await programClient.pdas.accessGrant({ permissions: readOnly, profile: profilePda }); + const [fullPda] = await programClient.pdas.accessGrant({ permissions: fullAccess, profile: profilePda }); + + expect(decodeBytes(decodeAccount('accessGrant', readPda).permissions)).toEqual([1, 0, 0, 0]); + expect(decodeBytes(decodeAccount('accessGrant', fullPda).permissions)).toEqual([1, 1, 1, 1]); + }); + }); + + describe('bookmarkList PDA — pubkey seed with Vec arg', () => { + test('should create a bookmark list with vec arg and read it back via pdas helper', async () => { + const bookmark1 = await ctx.createAccount(); + const bookmark2 = await ctx.createAccount(); + const bookmark3 = await ctx.createAccount(); + + const ix = await programClient.methods + .createBookmarkList({ bookmarks: [bookmark1, bookmark2, bookmark3] }) + .accounts({ owner: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const [listPda] = await programClient.pdas.bookmarkList({ owner: payer }); + const decoded = decodeAccount('bookmarkList', listPda); + expect(decoded.owner).toBe(payer); + expect(decoded.bookmarks).toEqual([bookmark1, bookmark2, bookmark3]); + }); + + test('should create a bookmark list with empty vec', async () => { + const ix = await programClient.methods + .createBookmarkList({ bookmarks: [] }) + .accounts({ owner: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const [listPda] = await programClient.pdas.bookmarkList({ owner: payer }); + const decoded = decodeAccount('bookmarkList', listPda); + expect(decoded.owner).toBe(payer); + expect(decoded.bookmarks).toEqual([]); + }); + }); + + describe('category PDA — matches manual derivation with root program', () => { + test('should derive PDA using root program address when no pdaNode.programId', async () => { + const [categoryPda] = await programClient.pdas.category({ name: 'my-category' }); + + const [expectedPda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['category', 'my-category'], + }); + expect(categoryPda).toBe(expectedPda); + }); + }); + + function decodeAccount(name: string, pda: Address) { + const accountNode = programClient.root.program.accounts.find(a => a.name === name); + if (!accountNode) throw new Error(`Account node "${name}" not found in IDL`); + + const codec = getNodeCodec([programClient.root, programClient.root.program, accountNode]); + const data = ctx.requireEncodedAccount(pda).data; + return codec.decode(Uint8Array.from(data)) as Record; + } + + /** Codama decodes fixedSize(bytes) as ['base64', encoded] — convert back to number[] */ + function decodeBytes(value: unknown): number[] { + if (Array.isArray(value) && value[0] === 'base64' && typeof value[1] === 'string') { + return [...Buffer.from(value[1], 'base64')]; + } + throw new Error(`Expected ['base64', string], got: ${JSON.stringify(value)}`); + } +}); diff --git a/packages/dynamic-client/test/programs/anchor/tests/example.test.ts b/packages/dynamic-client/test/programs/anchor/tests/example.test.ts new file mode 100644 index 000000000..561ad07aa --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/tests/example.test.ts @@ -0,0 +1,327 @@ +import { getNodeCodec } from '@codama/dynamic-codecs'; +import { type Address, getAddressEncoder, getProgramDerivedAddress } from '@solana/addresses'; +import { getU64Encoder, type Option, unwrapOption } from '@solana/codecs'; +import type { RootNode } from 'codama'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { createProgramClient } from '../../../../src'; +import type { ExampleProgramClient } from '../../generated/example-idl-types'; +import { SvmTestContext } from '../../test-utils'; +import { createTestContext, idl, programClient } from './helpers'; + +describe('anchor-example: commonIxs', () => { + let ctx: SvmTestContext; + let payer: Address; + + beforeEach(async () => { + ({ ctx, payer } = await createTestContext()); + }); + + describe('pubkeySeedIx', () => { + test('should execute instruction with pubkey seed', async () => { + const ix = await programClient.methods + .pubkeySeedIx({ input: 42 }) + .accounts({ signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + }); + }); + + describe('updateOptionalInput', () => { + test('should update optional input field with and without value', async () => { + const signer = await ctx.createFundedAccount(); + + const ix0 = await programClient.methods.pubkeySeedIx({ input: 42 }).accounts({ signer }).instruction(); + + await ctx.sendInstruction(ix0, [signer]); + + const [pda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['seed', getAddressEncoder().encode(signer)], + }); + + const optionalAddress = await ctx.createAccount(); + const ix1 = await programClient.methods + .updateOptionalInput({ + input: 44, + optionalInput: optionalAddress, + }) + .accounts({ signer }) + .instruction(); + + await ctx.sendInstruction(ix1, [signer]); + + const account1 = ctx.requireEncodedAccount(pda); + const decoded1 = decodeDataAccount1(programClient.root, account1.data); + expect(decoded1.optionalInput).eq(optionalAddress); + + const ix2 = await programClient.methods + .updateOptionalInput({ input: 45 }) + .accounts({ signer }) + .instruction(); + + await ctx.sendInstruction(ix2, [signer]); + + const account2 = ctx.requireEncodedAccount(pda); + const decoded2 = decodeDataAccount1(programClient.root, account2.data); + expect(decoded2.optionalInput).toBeNull(); + }); + }); + + describe('updateOptionalAccount', () => { + test('should handle optional accounts', async () => { + const optionalAccount = await ctx.createAccount(); + const ix1 = await programClient.methods + .updateOptionalAccount({ id: 1 }) + .accounts({ + optionalAccKey: optionalAccount, + signer: payer, + }) + .instruction(); + + await ctx.sendInstruction(ix1, [payer]); + + const ix2 = await programClient.methods + .updateOptionalAccount({ id: 2 }) + .accounts({ + optionalAccKey: null, + signer: payer, + }) + .instruction(); + + await ctx.sendInstruction(ix2, [payer]); + }); + }); + + describe('noArguments', () => { + test('should execute instruction with no arguments', async () => { + const account = await ctx.createAccount(); + + const ix = await programClient.methods + .noArguments() + .accounts({ + acc: account, + signer: payer, + }) + .instruction(); + + await ctx.sendInstruction(ix, [payer, account]); + }); + }); + + test('ExternalProgramsWithPdaIx: should resolve dependent pda and external program addresses', async () => { + const mint = await ctx.createAccount(); + const addressEncoder = getAddressEncoder(); + const [expectedAta] = await getProgramDerivedAddress({ + programAddress: ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + seeds: [ + addressEncoder.encode(payer), + addressEncoder.encode(ctx.TOKEN_PROGRAM_ADDRESS), + addressEncoder.encode(mint), + ], + }); + + const [expectedDependentPda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['signer_and_ata', addressEncoder.encode(payer), addressEncoder.encode(expectedAta)], + }); + + const ix = await programClient.methods + .externalProgramsWithPda() + .accounts({ + mint, + signer: payer, + }) + .instruction(); + + expect(ix.accounts).toBeDefined(); + if (!ix.accounts) throw new Error('Expected instruction accounts to be defined'); + + expect(ix.accounts.length).eq(8); + + const expectedAccounts = [ + [payer, "signer doesn't match"], + [mint, "mint doesn't match"], + [expectedAta, "token_account doesn't match"], + [expectedDependentPda, "dependent_account doesn't match"], + [ctx.SYSTEM_PROGRAM_ADDRESS, "system_program doesn't match"], + [ctx.TOKEN_PROGRAM_ADDRESS, "token_program doesn't match"], + [ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, "associated_token_program doesn't match"], + [ctx.SYSVAR_RENT_ADDRESS, "rent_sysvar doesn't match"], + ]; + + expectedAccounts.forEach((expected, i) => { + if (!ix?.accounts?.[i]) { + throw new Error(`Expected instruction accounts to be defined at index ${i}`); + } + expect(ix.accounts[i].address, expected[1]).eq(expected[0]); + }); + + // Send transaction to verify it executes on-chain + await ctx.sendInstruction(ix, [payer, mint]); + }); + + test('FourLevelPdaIx: should resolve four-level dependent PDA', async () => { + const ix = await programClient.methods + .fourLevelPda() + .accounts({ + signer: payer, + }) + .instruction(); + + expect(ix.accounts).toBeDefined(); + if (!ix.accounts) throw new Error('Expected instruction accounts to be defined'); + expect(ix.accounts.length).eq(6); + + const addressEncoder = getAddressEncoder(); + + const [expectedLevel1] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['level1', addressEncoder.encode(payer)], + }); + + const [expectedLevel2] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['level2', addressEncoder.encode(expectedLevel1)], + }); + + const [expectedLevel3] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['level3', addressEncoder.encode(expectedLevel2)], + }); + + const [expectedLevel4] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['level4', addressEncoder.encode(expectedLevel3)], + }); + + const expectedAccounts = [ + [payer, "signer doesn't match"], + [expectedLevel1, "level1 doesn't match"], + [expectedLevel2, "level2 doesn't match"], + [expectedLevel3, "level3 doesn't match"], + [expectedLevel4, "level4 doesn't match"], + [ctx.SYSTEM_PROGRAM_ADDRESS, "system_program doesn't match"], + ]; + + expectedAccounts.forEach((expected, i) => { + if (!ix?.accounts?.[i]) { + throw new Error(`Expected instruction accounts to be defined at index ${i}`); + } + expect(ix.accounts[i].address, expected[1]).eq(expected[0]); + }); + + await ctx.sendInstruction(ix, [payer]); + }); + + describe('stringSeedPda', () => { + test('should derive PDA using raw string seed bytes (not size-prefixed)', async () => { + const name = 'hello'; + const id = 7; + + const ix = await programClient.methods + .stringSeedPda({ id, name }) + .accounts({ signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + const [expectedPda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: [getU64Encoder().encode(id), name], + }); + + const account = ctx.requireEncodedAccount(expectedPda); + expect(account.owner).toBe(programClient.programAddress); + + const decoded = decodeDataAccount1(programClient.root, account.data); + expect(decoded.input).toBe(7n); + }); + }); + + describe('Circular Dependency Detection', () => { + test('SelfReferencePdaIx: should throw AccountError for A->A cycle', async () => { + await expect( + programClient.methods.selfReferencePda().accounts({ signer: payer }).instruction(), + ).rejects.toThrow(/Circular dependency detected: \[recursive -> recursive\]/); + }); + + test('TwoNodeCyclePdaIx: should throw AccountError for A->B->A pattern in two-node cycle', async () => { + await expect( + programClient.methods.twoNodeCyclePda().accounts({ signer: payer }).instruction(), + ).rejects.toThrow(/Circular dependency detected: \[pda[AB] -> pda[AB] -> pda[AB]\]/); + }); + }); + + describe('Standalone PDA derivation — pdaNode.programId', () => { + const addressEncoder = getAddressEncoder(); + + test('should derive cross-program PDA using pdaNode.programId, not root program', async () => { + const signer = await SvmTestContext.generateAddress(); + const mint = await SvmTestContext.generateAddress(); + + const [actualPda] = await programClient.pdas.tokenAccount({ mint, signer }); + + const [expectedPda] = await getProgramDerivedAddress({ + programAddress: ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + seeds: [ + addressEncoder.encode(signer), + addressEncoder.encode(ctx.TOKEN_PROGRAM_ADDRESS), + addressEncoder.encode(mint), + ], + }); + expect(actualPda).toBe(expectedPda); + }); + + test('should not be affected by programId option override and still use pdaNode.programId', async () => { + const signer = await SvmTestContext.generateAddress(); + const mint = await SvmTestContext.generateAddress(); + + const overrideProgramId = await SvmTestContext.generateAddress(); + const overrideClient = createProgramClient(idl, { programId: overrideProgramId }); + // double-check that the override took effect + expect(overrideClient.programAddress).toBe(overrideProgramId); + + const [pdaFromOriginal] = await programClient.pdas.tokenAccount({ mint, signer }); + const [pdaFromOverride] = await overrideClient.pdas.tokenAccount({ mint, signer }); + + expect(pdaFromOverride).toBe(pdaFromOriginal); + }); + + test('should fall back to root program when pdaNode has no programId', async () => { + const signer = await SvmTestContext.generateAddress(); + + const [actualPda] = await programClient.pdas.level1({ signer }); + + const [expectedPda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: ['level1', addressEncoder.encode(signer)], + }); + expect(actualPda).toBe(expectedPda); + }); + }); +}); + +function decodeDataAccount1( + root: RootNode, + data: Uint8Array, +): { bump: number; input: bigint; optionalInput: string | null } { + const accountNode = root.program.accounts.find(a => a.name === 'dataAccount1'); + if (!accountNode) { + throw new Error('Could not find account node "dataAccount1" in IDL'); + } + + const codec = getNodeCodec([root, root.program, accountNode]); + const decoded = codec.decode(Uint8Array.from(data)) as { + bump: number; + input: bigint; + optionalInput: Option; + }; + + return { + bump: decoded.bump, + input: decoded.input, + optionalInput: unwrapOption(decoded.optionalInput), + }; +} diff --git a/packages/dynamic-client/test/programs/anchor/tests/helpers.ts b/packages/dynamic-client/test/programs/anchor/tests/helpers.ts new file mode 100644 index 000000000..552644625 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/tests/helpers.ts @@ -0,0 +1,25 @@ +import path from 'node:path'; + +import { createProgramClient } from '../../../../src'; +import type { ExampleProgramClient } from '../../generated/example-idl-types'; +import { loadIdl, SvmTestContext } from '../../test-utils'; + +export const idl = loadIdl('example-idl.json'); +export const programClient = createProgramClient(idl); +export const programSoPath = path.resolve(__dirname, '..', 'target', 'deploy', 'example.so'); + +export async function createTestContext() { + const ctx = new SvmTestContext({ defaultPrograms: true }); + ctx.loadProgram(programClient.programAddress, programSoPath); + const payer = await ctx.createFundedAccount(); + + return { ctx, payer }; +} + +/** + * Encodes and returns a value in base16 codama dynamic-codecs format. + * To match bytes decoded by getNodeCodec. + */ +export function bytesToBase16CodecFormat(bytes: Uint8Array) { + return ['base16', Buffer.from(bytes).toString('hex')] as const; +} diff --git a/packages/dynamic-client/test/programs/anchor/tests/nested-example-ix.test.ts b/packages/dynamic-client/test/programs/anchor/tests/nested-example-ix.test.ts new file mode 100644 index 000000000..0a397cfa7 --- /dev/null +++ b/packages/dynamic-client/test/programs/anchor/tests/nested-example-ix.test.ts @@ -0,0 +1,651 @@ +import { getNodeCodec } from '@codama/dynamic-codecs'; +import { type Address, getAddressEncoder, getProgramDerivedAddress } from '@solana/addresses'; +import { none, some } from '@solana/codecs'; +import type { RootNode } from 'codama'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { NestedExampleArgs } from '../../generated/example-idl-types'; +import { SvmTestContext } from '../../test-utils'; +import { bytesToBase16CodecFormat, createTestContext, programClient } from './helpers'; + +describe('anchor-example: nestedExampleIx', () => { + let ctx: SvmTestContext; + let payer: Address; + + beforeEach(async () => { + ({ ctx, payer } = await createTestContext()); + }); + + test('should encode nested struct with scalar enums, bytes, fixed array, and none inner enum', async () => { + const pubkeyArg = await ctx.createAccount(); + const nestedExampleAccount = await deriveNestedExamplePda( + programClient.programAddress, + pubkeyArg, + 'arm', + 'bar', + ); + + const ix = await programClient.methods + .nestedExample({ + input: { + header: { command: { __kind: 'start', fields: [42n] }, version: 1 }, + innerEnum: { __kind: 'none' }, + innerStruct: { + bytes: new Uint8Array([1, 2, 3]), + enumsArray: ['arm', 'car'], + name: 'hello', + optionalPubkey: null, + seedEnum: 'bar', + value: BigInt(100), + }, + pubkey: pubkeyArg, + seedEnum: 'arm', + }, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + expect(ix.data?.length).toBeGreaterThan(0); + const exampleAccountData = ctx.requireEncodedAccount(nestedExampleAccount).data; + + const exampleAccount = decodeNestedExampleAccount(programClient.root, exampleAccountData); + expect(exampleAccount.input).toEqual({ + header: { command: { __kind: 'Start', fields: [42n] }, version: 1 }, + innerEnum: { __kind: 'None' }, + innerStruct: { + bytes: bytesToBase16CodecFormat(new Uint8Array([1, 2, 3])), + enumsArray: [seedEnumToNumber('arm'), seedEnumToNumber('car')], + name: 'hello', + optionalPubkey: none(), + seedEnum: seedEnumToNumber('bar'), + value: 100n, + }, + pubkey: pubkeyArg, + seedEnum: seedEnumToNumber('arm'), + }); + }); + + test('should encode Command::Continue with reason string [enumStructVariantTypeNode]', async () => { + const pubkeyArg = await ctx.createAccount(); + const nestedExampleAccount = await deriveNestedExamplePda( + programClient.programAddress, + pubkeyArg, + 'bar', + 'arm', + ); + + const ix = await programClient.methods + .nestedExample({ + input: { + header: { command: { __kind: 'continue', reason: 'keep going' }, version: 2 }, + innerEnum: { __kind: 'none' }, + innerStruct: { + bytes: new Uint8Array([]), + enumsArray: ['bar', 'bar'], + name: 'test', + optionalPubkey: null, + seedEnum: 'arm', + value: BigInt(0), + }, + pubkey: pubkeyArg, + seedEnum: 'bar', + }, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + expect(ix.data?.length).toBeGreaterThan(0); + const exampleAccountData = ctx.requireEncodedAccount(nestedExampleAccount).data; + const exampleAccount = decodeNestedExampleAccount(programClient.root, exampleAccountData); + + expect(exampleAccount.input).toEqual({ + header: { + command: { + __kind: 'Continue', + reason: 'keep going', + }, + version: 2, + }, + innerEnum: { __kind: 'None' }, + innerStruct: { + bytes: bytesToBase16CodecFormat(new Uint8Array([])), + enumsArray: [seedEnumToNumber('bar'), seedEnumToNumber('bar')], + name: 'test', + optionalPubkey: none(), + seedEnum: seedEnumToNumber('arm'), + value: 0n, + }, + pubkey: pubkeyArg, + seedEnum: seedEnumToNumber('bar'), + }); + }); + + test('should encode InnerEnum::TokenTransfer [enumStructVariantTypeNode->enumEmptyVariantTypeNode]', async () => { + const pubkeyArg = await ctx.createAccount(); + const nestedExampleAccount = await deriveNestedExamplePda( + programClient.programAddress, + pubkeyArg, + 'car', + 'car', + ); + + const ix = await programClient.methods + .nestedExample({ + input: { + header: { command: { __kind: 'stop' }, version: 1 }, + innerEnum: { __kind: 'tokenTransfer', amount: BigInt(500), tokenType: { __kind: 'sPL' } }, + innerStruct: { + bytes: new Uint8Array([0xde, 0xad, 0xbe, 0xef]), + enumsArray: ['car', 'arm'], + name: 'transfer', + optionalPubkey: null, + seedEnum: 'car', + value: BigInt(999), + }, + pubkey: pubkeyArg, + seedEnum: 'car', + }, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + expect(ix.data?.length).toBeGreaterThan(0); + const exampleAccountData = ctx.requireEncodedAccount(nestedExampleAccount).data; + const exampleAccount = decodeNestedExampleAccount(programClient.root, exampleAccountData); + + expect(exampleAccount.input).toEqual({ + header: { + command: { + __kind: 'Stop', + }, + version: 1, + }, + innerEnum: { + __kind: 'TokenTransfer', + amount: 500n, + tokenType: { __kind: 'SPL' }, + }, + innerStruct: { + bytes: bytesToBase16CodecFormat(new Uint8Array([0xde, 0xad, 0xbe, 0xef])), + enumsArray: [seedEnumToNumber('car'), seedEnumToNumber('arm')], + name: 'transfer', + optionalPubkey: none(), + seedEnum: seedEnumToNumber('car'), + value: 999n, + }, + pubkey: pubkeyArg, + seedEnum: seedEnumToNumber('car'), + }); + }); + + test('should encode InnerEnum::TokenTransfer enum (3 levels deep)', async () => { + const pubkeyArg = await ctx.createAccount(); + const nestedExampleAccount = await deriveNestedExamplePda( + programClient.programAddress, + pubkeyArg, + 'arm', + 'arm', + ); + + const ix = await programClient.methods + .nestedExample({ + input: { + header: { command: { __kind: 'start', fields: [42n] }, version: 1 }, + innerEnum: { + __kind: 'tokenTransfer', + amount: BigInt(1), + tokenType: { __kind: 'nFT', collection: 'DegenApes' }, + }, + innerStruct: { + bytes: new Uint8Array([]), + enumsArray: ['arm', 'arm'], + name: 'nft-test', + optionalPubkey: null, + seedEnum: 'arm', + value: BigInt(1), + }, + pubkey: pubkeyArg, + seedEnum: 'arm', + }, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + expect(ix.data?.length).toBeGreaterThan(0); + const exampleAccountData = ctx.requireEncodedAccount(nestedExampleAccount).data; + const exampleAccount = decodeNestedExampleAccount(programClient.root, exampleAccountData); + + expect(exampleAccount.input).toEqual({ + header: { + command: { + __kind: 'Start', + fields: [42n], + }, + version: 1, + }, + innerEnum: { + __kind: 'TokenTransfer', + amount: 1n, + tokenType: { __kind: 'NFT', collection: 'DegenApes' }, + }, + innerStruct: { + bytes: bytesToBase16CodecFormat(new Uint8Array([])), + enumsArray: [seedEnumToNumber('arm'), seedEnumToNumber('arm')], + name: 'nft-test', + optionalPubkey: none(), + seedEnum: seedEnumToNumber('arm'), + value: 1n, + }, + pubkey: pubkeyArg, + seedEnum: seedEnumToNumber('arm'), + }); + }); + + test('should encode Stake inner enum and optional pubkey (Some)', async () => { + const pubkeyArg = await ctx.createAccount(); + const optionalPubkey = await ctx.createAccount(); + const nestedExampleAccount = await deriveNestedExamplePda( + programClient.programAddress, + pubkeyArg, + 'bar', + 'car', + ); + + const ix = await programClient.methods + .nestedExample({ + input: { + header: { command: { __kind: 'start', fields: [321n] }, version: 3 }, + innerEnum: { __kind: 'stake', duration: BigInt(86400) }, + innerStruct: { + bytes: new Uint8Array([10, 20]), + enumsArray: ['bar', 'car'], + name: 'staker', + optionalPubkey, + seedEnum: 'car', + value: BigInt(42), + }, + pubkey: pubkeyArg, + seedEnum: 'bar', + }, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + expect(ix.data?.length).toBeGreaterThan(0); + const exampleAccountData = ctx.requireEncodedAccount(nestedExampleAccount).data; + const exampleAccount = decodeNestedExampleAccount(programClient.root, exampleAccountData); + + expect(exampleAccount.input).toEqual({ + header: { + command: { + __kind: 'Start', + fields: [321n], + }, + version: 3, + }, + innerEnum: { + __kind: 'Stake', + duration: 86400n, + }, + innerStruct: { + bytes: bytesToBase16CodecFormat(new Uint8Array([10, 20])), + enumsArray: [seedEnumToNumber('bar'), seedEnumToNumber('car')], + name: 'staker', + optionalPubkey: some(optionalPubkey), + seedEnum: seedEnumToNumber('car'), + value: 42n, + }, + pubkey: pubkeyArg, + seedEnum: seedEnumToNumber('bar'), + }); + }); + + describe('should validate nestedExampleIx arguments', () => { + let pubkeyArg: Address; + let nestedExampleAccount: Address; + + beforeEach(async () => { + pubkeyArg = await ctx.createAccount(); + nestedExampleAccount = await deriveNestedExamplePda(programClient.programAddress, pubkeyArg, 'arm', 'bar'); + }); + + const makeValidArgs = (pubkey: Address): NestedExampleArgs['input'] => ({ + header: { command: { __kind: 'start', fields: [123n] }, version: 1 }, + innerEnum: { __kind: 'none' }, + innerStruct: { + bytes: new Uint8Array([1, 2, 3]), + enumsArray: ['arm', 'car'], + name: 'hello', + optionalPubkey: null, + seedEnum: 'bar', + value: BigInt(100), + }, + pubkey, + seedEnum: 'arm', + }); + + test('should throw when input is missing', async () => { + await expect( + programClient.methods + .nestedExample({} as unknown as NestedExampleArgs) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input"/); + }); + + test('should throw when header is missing', async () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { header: _header, ...args } = makeValidArgs(pubkeyArg); + await expect( + programClient.methods + .nestedExample({ + input: args as unknown as NestedExampleArgs['input'], + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.header"/); + }); + + test('should throw when command enum fields tuple payload is missing', async () => { + const input = makeValidArgs(pubkeyArg); + input.header.command = { + __kind: 'start', + fields: null, + } as unknown as NestedExampleArgs['input']['header']['command']; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.header.command"/); + }); + + test('should throw when innerEnum payload data is missing', async () => { + const input = makeValidArgs(pubkeyArg); + input.innerEnum = { + __kind: 'tokenTransfer', + amount: BigInt(1), + tokenType: { __kind: 'nFT', collection: 'Test' }, + }; + input.innerEnum.amount = undefined as unknown as bigint; // Force amount to be missing + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Enum variant "tokenTransfer" has invalid "amount"/); + }); + + test('should throw when tokenTransfer variant is missing all payload fields', async () => { + const input = { + ...makeValidArgs(pubkeyArg), + innerEnum: { __kind: 'tokenTransfer' } as unknown as NestedExampleArgs['input']['innerEnum'], + }; + await expect( + programClient.methods + .nestedExample({ input }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Enum variant "tokenTransfer" has invalid "amount"/); + }); + + test('should throw when tokenTransfer variant is missing tokenType', async () => { + const input = { + ...makeValidArgs(pubkeyArg), + innerEnum: { + __kind: 'tokenTransfer', + amount: BigInt(1), + } as unknown as NestedExampleArgs['input']['innerEnum'], + }; + await expect( + programClient.methods + .nestedExample({ input }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Enum variant "tokenTransfer" has invalid "tokenType"/); + }); + + test('should throw when continue variant is missing reason', async () => { + const input = { + ...makeValidArgs(pubkeyArg), + header: { + command: { __kind: 'continue' } as unknown as NestedExampleArgs['input']['header']['command'], + version: 1, + }, + }; + await expect( + programClient.methods + .nestedExample({ input }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.header.command".*"reason"/); + }); + + test('should throw when innerStruct is missing', async () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { innerStruct: _innerStruct, ...args } = makeValidArgs(pubkeyArg); + await expect( + programClient.methods + .nestedExample({ + input: args as unknown as NestedExampleArgs['input'], + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.innerStruct"/); + }); + + test('should throw when pubkey is missing', async () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { pubkey: _pubkey, ...args } = makeValidArgs(pubkeyArg); + await expect( + programClient.methods + .nestedExample({ + input: args as unknown as NestedExampleArgs['input'], + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.pubkey"/); + }); + + test('should throw when header.version is string', async () => { + const input = { + ...makeValidArgs(pubkeyArg), + header: { command: { __kind: 'start' }, version: 'one' as unknown as number }, + } as unknown as NestedExampleArgs['input']; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.header.version"/); + }); + + test('should throw when innerStruct.value is string', async () => { + const validInput = makeValidArgs(pubkeyArg); + const { innerStruct } = validInput; + const input = { + ...validInput, + innerStruct: { + ...innerStruct, + value: 'hundred-of-thousands' as unknown as bigint, + }, + } as unknown as NestedExampleArgs['input']; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.innerStruct.value"/); + }); + + test('should throw for invalid seedEnum variant', async () => { + const input = { ...makeValidArgs(pubkeyArg), seedEnum: 'invalidVariant' as unknown as 'arm' }; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.seedEnum"/); + }); + + test('should throw for invalid innerEnum __kind', async () => { + const input = { + ...makeValidArgs(pubkeyArg), + innerEnum: { __kind: 'nonExistent' } as unknown as NestedExampleArgs['input']['innerEnum'], + }; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.innerEnum"/); + }); + + test('should throw for invalid header.command __kind', async () => { + const input = { + ...makeValidArgs(pubkeyArg), + header: { + command: { __kind: 'invalidCommand' } as unknown as NestedExampleArgs['input']['header']['command'], + version: 1, + }, + }; + await expect( + programClient.methods + .nestedExample({ input }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.header.command"/); + }); + + test('should throw when enumsArray has wrong size', async () => { + const validInput = makeValidArgs(pubkeyArg); + const { innerStruct } = validInput; + const input = { + ...makeValidArgs(pubkeyArg), + innerStruct: { + ...innerStruct, + enumsArray: ['arm'] as unknown as ('arm' | 'bar' | 'car')[], + }, + }; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.innerStruct.enumsArray/); + }); + + test('should throw when enumsArray has invalid enum value', async () => { + const validInput = makeValidArgs(pubkeyArg); + const { innerStruct } = validInput; + const input = { + ...makeValidArgs(pubkeyArg), + innerStruct: { + ...innerStruct, + enumsArray: ['arm', 'invalid', 123] as unknown as ('arm' | 'bar' | 'car')[], + }, + }; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.innerStruct.enumsArray/); + }); + + test('should throw when bytes is string instead of Uint8Array', async () => { + const validInput = makeValidArgs(pubkeyArg); + const { innerStruct } = validInput; + const input = { + ...makeValidArgs(pubkeyArg), + innerStruct: { ...innerStruct, bytes: 'notbytes' as unknown as Uint8Array }, + }; + await expect( + programClient.methods + .nestedExample({ + input, + }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.innerStruct.bytes"/); + }); + + test('should throw for invalid pubkey string', async () => { + const input = { ...makeValidArgs(pubkeyArg), pubkey: 'not-a-valid-address' as unknown as Address }; + await expect( + programClient.methods + .nestedExample({ input }) + .accounts({ nestedExampleAccount, signer: payer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "input.pubkey"/); + }); + }); +}); + +function decodeNestedExampleAccount(root: RootNode, data: Uint8Array) { + const accountNode = root.program.accounts.find(a => a.name === 'nestedExampleAccount'); + if (!accountNode) { + throw new Error('Could not find account node "nestedExampleAccount" node in IDL'); + } + + const codec = getNodeCodec([root, root.program, accountNode], { + bytesEncoding: 'base16', + }); + const decoded = codec.decode(Uint8Array.from(data)); + return decoded as { discriminator: unknown; input: unknown }; +} + +async function deriveNestedExamplePda( + programAddress: Address, + pubkey: Address, + seedEnum: 'arm' | 'bar' | 'car', + innerSeedEnum: 'arm' | 'bar' | 'car', +): Promise
{ + const index: Record = { arm: 0, bar: 1, car: 2 }; + const [pda] = await getProgramDerivedAddress({ + programAddress, + seeds: [ + 'nested_example_account', + getAddressEncoder().encode(pubkey), + new Uint8Array([index[seedEnum]]), + new Uint8Array([index[innerSeedEnum]]), + ], + }); + return pda; +} + +/** SeedEnum enum is stored as a number. */ +export function seedEnumToNumber(enumValue: string) { + switch (enumValue.toLowerCase()) { + case 'arm': + return 0; + case 'bar': + return 1; + case 'car': + return 2; + default: + throw new Error(`Unknown enum value: ${enumValue}`); + } +} diff --git a/packages/dynamic-client/test/programs/associated-token-account/ata-test-utils.ts b/packages/dynamic-client/test/programs/associated-token-account/ata-test-utils.ts new file mode 100644 index 000000000..c21f298a2 --- /dev/null +++ b/packages/dynamic-client/test/programs/associated-token-account/ata-test-utils.ts @@ -0,0 +1,34 @@ +import type { Address } from '@solana/addresses'; + +import type { SplAssociatedTokenAccountProgramClient } from '../generated/associated-token-account-idl-types'; +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import type { TokenProgramClient } from '../generated/token-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +export const ataClient = createTestProgramClient( + 'associated-token-account-idl.json', +); +export const tokenClient = createTestProgramClient('token-idl.json'); +export const systemClient = createTestProgramClient('system-program-idl.json'); + +const SPL_TOKEN_MINT_SIZE = 82n; + +export async function createMint( + ctx: SvmTestContext, + payer: Address, + mint: Address, + mintAuthority: Address, +): Promise { + const lamports = ctx.getMinimumBalanceForRentExemption(SPL_TOKEN_MINT_SIZE); + const createMintAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: tokenClient.programAddress, space: SPL_TOKEN_MINT_SIZE }) + .accounts({ newAccount: mint, payer }) + .instruction(); + await ctx.sendInstruction(createMintAccountIx, [payer, mint]); + + const initializeMintIx = await tokenClient.methods + .initializeMint({ decimals: 9, freezeAuthority: null, mintAuthority }) + .accounts({ mint }) + .instruction(); + await ctx.sendInstruction(initializeMintIx, [payer]); +} diff --git a/packages/dynamic-client/test/programs/associated-token-account/create-idempotent.test.ts b/packages/dynamic-client/test/programs/associated-token-account/create-idempotent.test.ts new file mode 100644 index 000000000..77c53dd83 --- /dev/null +++ b/packages/dynamic-client/test/programs/associated-token-account/create-idempotent.test.ts @@ -0,0 +1,56 @@ +import { findAssociatedTokenPda, getTokenDecoder } from '@solana-program/token'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { ataClient, createMint, tokenClient } from './ata-test-utils'; + +describe('Associated Token Account: createIdempotent', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true }); + }); + + test('should create an associated token account idempotently', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const wallet = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mint, mintAuthority); + + const [ataAddress] = await findAssociatedTokenPda({ + mint, + owner: wallet, + tokenProgram: tokenClient.programAddress, + }); + + const ix = await ataClient.methods + .createIdempotent() + .accounts({ + associatedAccountAddress: ataAddress, + fundingAddress: payer, + tokenMintAddress: mint, + walletAddress: wallet, + }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + const ataAccount = ctx.requireEncodedAccount(ataAddress); + const tokenData = getTokenDecoder().decode(ataAccount.data); + expect(ataAccount.owner).toBe(tokenClient.programAddress); + expect(tokenData.mint).toBe(mint); + expect(tokenData.owner).toBe(wallet); + + // Call again — should succeed without error + ctx.advanceSlots(); + await ctx.sendInstruction(ix, [payer]); + + const ataAccountAfter = ctx.requireEncodedAccount(ataAddress); + const tokenDataAfter = getTokenDecoder().decode(ataAccountAfter.data); + expect(ataAccountAfter.owner).toBe(tokenClient.programAddress); + expect(tokenDataAfter.mint).toBe(mint); + expect(tokenDataAfter.owner).toBe(wallet); + }); +}); diff --git a/packages/dynamic-client/test/programs/associated-token-account/create.test.ts b/packages/dynamic-client/test/programs/associated-token-account/create.test.ts new file mode 100644 index 000000000..738ad45c3 --- /dev/null +++ b/packages/dynamic-client/test/programs/associated-token-account/create.test.ts @@ -0,0 +1,46 @@ +import { findAssociatedTokenPda, getTokenDecoder } from '@solana-program/token'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { ataClient, createMint, tokenClient } from './ata-test-utils'; + +describe('Associated Token Account: create', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true }); + }); + + test('should create an associated token account', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const wallet = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mint, mintAuthority); + + const [ataAddress] = await findAssociatedTokenPda({ + mint, + owner: wallet, + tokenProgram: tokenClient.programAddress, + }); + + const ix = await ataClient.methods + .create() + .accounts({ + associatedAccountAddress: ataAddress, + fundingAddress: payer, + tokenMintAddress: mint, + walletAddress: wallet, + }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + const ataAccount = ctx.requireEncodedAccount(ataAddress); + const tokenData = getTokenDecoder().decode(ataAccount.data); + expect(ataAccount.owner).toBe(tokenClient.programAddress); + expect(tokenData.mint).toBe(mint); + expect(tokenData.owner).toBe(wallet); + }); +}); diff --git a/packages/dynamic-client/test/programs/associated-token-account/recover-nested.test.ts b/packages/dynamic-client/test/programs/associated-token-account/recover-nested.test.ts new file mode 100644 index 000000000..95073d2af --- /dev/null +++ b/packages/dynamic-client/test/programs/associated-token-account/recover-nested.test.ts @@ -0,0 +1,104 @@ +import { findAssociatedTokenPda, getTokenDecoder } from '@solana-program/token'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { ataClient, createMint, tokenClient } from './ata-test-utils'; + +describe('Associated Token Account: recoverNested', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true }); + }); + + test('should recover tokens from a nested associated token account', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const ownerMint = await ctx.createAccount(); + const nestedMint = await ctx.createAccount(); + const wallet = await ctx.createFundedAccount(); + + await createMint(ctx, payer, ownerMint, mintAuthority); + await createMint(ctx, payer, nestedMint, mintAuthority); + + // Create owner ATA (wallet → ownerMint) + const [ownerAta] = await findAssociatedTokenPda({ + mint: ownerMint, + owner: wallet, + tokenProgram: tokenClient.programAddress, + }); + const createOwnerAtaIx = await ataClient.methods + .create() + .accounts({ + associatedAccountAddress: ownerAta, + fundingAddress: payer, + tokenMintAddress: ownerMint, + walletAddress: wallet, + }) + .instruction(); + await ctx.sendInstruction(createOwnerAtaIx, [payer]); + + // Create nested ATA (ownerAta → nestedMint) — tokens sent here accidentally + const [nestedAta] = await findAssociatedTokenPda({ + mint: nestedMint, + owner: ownerAta, + tokenProgram: tokenClient.programAddress, + }); + const createNestedAtaIx = await ataClient.methods + .create() + .accounts({ + associatedAccountAddress: nestedAta, + fundingAddress: payer, + tokenMintAddress: nestedMint, + walletAddress: ownerAta, + }) + .instruction(); + await ctx.sendInstruction(createNestedAtaIx, [payer]); + + // Mint tokens to nested ATA + const amount = BigInt(1_000_000); + const mintToIx = await tokenClient.methods + .mintTo({ amount }) + .accounts({ mint: nestedMint, mintAuthority, token: nestedAta }) + .signers(['mintAuthority']) + .instruction(); + await ctx.sendInstruction(mintToIx, [payer, mintAuthority]); + + // Create destination ATA (wallet → nestedMint) + const [destinationAta] = await findAssociatedTokenPda({ + mint: nestedMint, + owner: wallet, + tokenProgram: tokenClient.programAddress, + }); + const createDestAtaIx = await ataClient.methods + .create() + .accounts({ + associatedAccountAddress: destinationAta, + fundingAddress: payer, + tokenMintAddress: nestedMint, + walletAddress: wallet, + }) + .instruction(); + await ctx.sendInstruction(createDestAtaIx, [payer]); + + // Recover nested tokens + const recoverIx = await ataClient.methods + .recoverNested() + .accounts({ + destinationAssociatedAccountAddress: destinationAta, + nestedAssociatedAccountAddress: nestedAta, + nestedTokenMintAddress: nestedMint, + ownerAssociatedAccountAddress: ownerAta, + ownerTokenMintAddress: ownerMint, + walletAddress: wallet, + }) + .signers(['walletAddress']) + .instruction(); + await ctx.sendInstruction(recoverIx, [payer, wallet]); + + // Verify tokens moved to destination + const destAccount = ctx.requireEncodedAccount(destinationAta); + const destTokenData = getTokenDecoder().decode(destAccount.data); + expect(destTokenData.amount).toBe(amount); + }); +}); diff --git a/packages/dynamic-client/test/programs/circular-account-refs/circular-account-refs.test.ts b/packages/dynamic-client/test/programs/circular-account-refs/circular-account-refs.test.ts new file mode 100644 index 000000000..10edf11b0 --- /dev/null +++ b/packages/dynamic-client/test/programs/circular-account-refs/circular-account-refs.test.ts @@ -0,0 +1,75 @@ +import { address } from '@solana/addresses'; +import { describe, expect, test } from 'vitest'; + +import type { CircularAccountRefsProgramClient } from '../generated/circular-account-refs-idl-types'; +import { createTestProgramClient } from '../test-utils'; + +describe('Circular Account References (Without PDA Seeds)', () => { + const programClient = createTestProgramClient('circular-account-refs-idl.json'); + + test('should throw AccountError for A->A self-reference', async () => { + await expect(programClient.methods.selfReference().accounts({}).instruction()).rejects.toThrow( + /Circular dependency detected: \[accountA -> accountA\]/, + ); + }); + + test('should throw AccountError for A->B->A two-node cycle', async () => { + await expect(programClient.methods.twoAccountCycle().accounts({}).instruction()).rejects.toThrow( + /Circular dependency detected: \[account(A|B) -> account(A|B) -> account(A|B)\]/, + ); + }); + + test('should throw AccountError for A->B->C->A three-node cycle', async () => { + await expect(programClient.methods.threeAccountCycle().accounts({}).instruction()).rejects.toThrow( + /Circular dependency detected: \[account(A|B|C) -> account(A|B|C) -> account(A|B|C) -> account(A|B|C)\]/, + ); + }); + + test('should succeed when account is provided (A->B->A cycle)', async () => { + const testAddress = address('HNvDDMNXFUkJz8fFDVJ2GLrWNWYcFfqjJWJZR7JSxaMv'); + + const ixWithA = await programClient.methods.twoAccountCycle().accounts({ accountA: testAddress }).instruction(); + const ixWithB = await programClient.methods.twoAccountCycle().accounts({ accountB: testAddress }).instruction(); + + [ixWithA, ixWithB].forEach(ix => { + expect(ix.accounts?.length).toBe(2); + ix.accounts?.forEach(account => { + expect(account.address).toBe(testAddress); + }); + }); + }); + + test('should succeed when account in three-node cycle (A->B->C->A) is provided', async () => { + const testAddress = address('HNvDDMNXFUkJz8fFDVJ2GLrWNWYcFfqjJWJZR7JSxaMv'); + + const ixWithA = await programClient.methods + .threeAccountCycle() + .accounts({ accountA: testAddress }) + .instruction(); + + const ixWithB = await programClient.methods + .threeAccountCycle() + .accounts({ accountB: testAddress }) + .instruction(); + + const ixWithC = await programClient.methods + .threeAccountCycle() + .accounts({ accountC: testAddress }) + .instruction(); + + [ixWithA, ixWithB, ixWithC].forEach(ix => { + expect(ix.accounts?.length).toBe(3); + ix.accounts?.forEach(account => { + expect(account.address).toBe(testAddress); + }); + }); + }); + + test('should provide account self-reference', async () => { + const testAddress = address('HNvDDMNXFUkJz8fFDVJ2GLrWNWYcFfqjJWJZR7JSxaMv'); + const ix = await programClient.methods.selfReference().accounts({ accountA: testAddress }).instruction(); + + expect(ix.accounts?.length).toBe(1); + expect(ix?.accounts?.[0]?.address).toBe(testAddress); + }); +}); diff --git a/packages/dynamic-client/test/programs/collection-types/collection-types.test.ts b/packages/dynamic-client/test/programs/collection-types/collection-types.test.ts new file mode 100644 index 000000000..cc3b4d522 --- /dev/null +++ b/packages/dynamic-client/test/programs/collection-types/collection-types.test.ts @@ -0,0 +1,239 @@ +import { getNodeCodec, type ReadonlyUint8Array } from '@codama/dynamic-codecs'; +import { type Address } from '@solana/addresses'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { CollectionTypesProgramClient } from '../generated/collection-types-idl-types'; +import { createTestProgramClient, loadRoot, SvmTestContext } from '../test-utils'; + +const root = loadRoot('collection-types-idl.json'); + +function decodeInstructionData(instructionName: string, data: ReadonlyUint8Array): unknown { + const ix = root.program.instructions.find(i => i.name === instructionName); + if (!ix) throw new Error(`Instruction ${instructionName} not found`); + + const codec = getNodeCodec([root, root.program, ix]); + return codec.decode(new Uint8Array(data)); +} + +describe('Collection types: encoding and validation (set, map, tuple)', () => { + let ctx: SvmTestContext; + let signer: Address; + const programClient = createTestProgramClient('collection-types-idl.json'); + + beforeEach(async () => { + ctx = new SvmTestContext({ defaultPrograms: true, sysvars: true }); + signer = await ctx.createFundedAccount(); + }); + + describe('tupleTypeNode', () => { + test('should build instruction with basic tuple [u64, string]', async () => { + const ix = await programClient.methods + .storeTuple({ data: [42n, 'hello'] }) + .accounts({ signer }) + .instruction(); + + const decoded = decodeInstructionData('storeTuple', ix.data!); + expect(decoded).toMatchObject({ + data: [42n, 'hello'], + discriminator: 0, + }); + }); + + test('should build instruction with nested tuple [map, array]', async () => { + const ix = await programClient.methods + .storeNestedTuple({ + data: [{ alice: 100n, bob: 200n }, [1n, 2n, 3n]], + }) + .accounts({ signer }) + .instruction(); + + const decoded = decodeInstructionData('storeNestedTuple', ix.data!); + expect(decoded).toMatchObject({ + data: [{ alice: 100n, bob: 200n }, [1n, 2n, 3n]], + discriminator: 6, + }); + }); + + test('should reject tuple with wrong length', async () => { + await expect( + programClient.methods + // @ts-expect-error - testing wrong tuple length + .storeTuple({ data: [42n] }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "data\[1\]", value: undefined/); + }); + + test('should reject tuple with wrong item type', async () => { + await expect( + programClient.methods + // @ts-expect-error - testing wrong item type + .storeTuple({ data: [42n, 123] }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "data\[1\]", value: 123/); + }); + }); + + describe('mapTypeNode', () => { + test('should build instruction with basic map ([string]: u64)', async () => { + const ix = await programClient.methods + .storeMap({ data: { alice: 100n, bob: 200n, charlie: 300n } }) + .accounts({ signer }) + .instruction(); + + const decoded = decodeInstructionData('storeMap', ix.data!); + expect(decoded).toMatchObject({ + data: { alice: 100n, bob: 200n, charlie: 300n }, + discriminator: 1, + }); + }); + + test('should build instruction with empty map', async () => { + const ix = await programClient.methods.storeMap({ data: {} }).accounts({ signer }).instruction(); + + const decoded = decodeInstructionData('storeMap', ix.data!); + expect(decoded).toMatchObject({ + data: {}, + discriminator: 1, + }); + }); + + test('should build instruction with nested map ([string]: array)', async () => { + const ix = await programClient.methods + .storeNestedMap({ + data: { + list1: [1n, 2n, 3n], + list2: [10n, 20n], + list3: [], + }, + }) + .accounts({ signer }) + .instruction(); + + const decoded = decodeInstructionData('storeNestedMap', ix.data!); + expect(decoded).toMatchObject({ + data: { + list1: [1n, 2n, 3n], + list2: [10n, 20n], + list3: [], + }, + discriminator: 7, + }); + }); + + test('should reject non-object input', async () => { + await expect( + programClient.methods + // @ts-expect-error - testing non-object input + .storeMap({ data: [1, 2, 3] }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Expected \[object\] for \[mapTypeNode\]/); + }); + + test('should reject wrong value type', async () => { + await expect( + programClient.methods + // @ts-expect-error - testing wrong value type + .storeMap({ data: { key: 'wrong' } }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "data"/); + }); + }); + + describe('setTypeNode', () => { + test('should build instruction with basic set', async () => { + const ix = await programClient.methods + .storeSet({ data: [1n, 2n, 3n] }) + .accounts({ signer }) + .instruction(); + + const decoded = decodeInstructionData('storeSet', ix.data!); + expect(decoded).toMatchObject({ + data: [1n, 2n, 3n], + discriminator: 2, + }); + }); + + test('should build instruction with empty set', async () => { + const ix = await programClient.methods.storeSet({ data: [] }).accounts({ signer }).instruction(); + + const decoded = decodeInstructionData('storeSet', ix.data!); + expect(decoded).toMatchObject({ + data: [], + discriminator: 2, + }); + }); + + test('should build instruction with nested set>', async () => { + const ix = await programClient.methods + .storeNestedSet({ + data: [ + [1n, 'first'], + [2n, 'second'], + [3n, 'third'], + [3n, 'fifth'], + ], + }) + .accounts({ signer }) + .instruction(); + + const decoded = decodeInstructionData('storeNestedSet', ix.data!); + expect(decoded).toMatchObject({ + data: [ + [1n, 'first'], + [2n, 'second'], + [3n, 'third'], + [3n, 'fifth'], + ], + discriminator: 8, + }); + }); + + test('should reject duplicate primitive values in set', async () => { + await expect( + programClient.methods + .storeSet({ data: [1n, 2n, 1n] }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Expected all items to be unique/); + await expect( + programClient.methods + .storeNestedSet({ + data: [ + [1n, 'first'], + [2n, 'second'], + [1n, 'first'], // duplicate + ], + }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Expected all items to be unique/); + }); + + test('should reject non-array input', async () => { + await expect( + programClient.methods + // @ts-expect-error - testing non-array input + .storeSet({ data: { key: 'value' } }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "data"/); + }); + + test('should reject non-serializable input with a helpful validation error', async () => { + const invalidData: Record = { a: 1n, b: {} }; + invalidData.b = invalidData; + + await expect( + programClient.methods + // @ts-expect-error - testing circular reference input + .storeSet({ data: [invalidData, invalidData] }) + .accounts({ signer }) + .instruction(), + ).rejects.toThrow(/Invalid argument "data", value: non-serializable array \(length 2\)/); + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/custom-resolvers/account-resolver.test.ts b/packages/dynamic-client/test/programs/custom-resolvers/account-resolver.test.ts new file mode 100644 index 000000000..3425604ba --- /dev/null +++ b/packages/dynamic-client/test/programs/custom-resolvers/account-resolver.test.ts @@ -0,0 +1,150 @@ +import type { Address } from '@solana/addresses'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { programClient } from './custom-resolvers-test-utils'; + +describe('Custom resolvers: accounts ResolverValueNode', () => { + let authority: Address; + let ctx: SvmTestContext; + + beforeEach(async () => { + ctx = new SvmTestContext(); + authority = await ctx.createFundedAccount(); + }); + + test('should resolve accounts addresses via resolver', async () => { + const destination = await ctx.createFundedAccount(); + const treasury = await ctx.createFundedAccount(); + + const expectedAccounts = [authority, destination, treasury]; + const ix = await programClient.methods + .transferWithResolver({ amount: 100 }) + .accounts({ authority }) + .resolvers({ + resolveDestination: () => Promise.resolve(destination), + resolveTreasury: () => Promise.resolve(treasury), + }) + .instruction(); + + expect(ix.accounts?.length).toBe(3); + ix.accounts?.forEach((accountMeta, index) => { + expect(accountMeta.address).toBe(expectedAccounts[index]); + }); + }); + + test('should throw AccountError when resolver missing for required account', async () => { + await expect( + programClient.methods.transferWithResolver({ amount: 100 }).accounts({ authority }).instruction(), + ).rejects.toThrow(/Resolver \[resolveDestination\] not provided for account \[destination\]/); + }); + + test('should throw AccountError when resolver returns null/undefined for required account', async () => { + const treasury = await ctx.createAccount(); + await expect( + programClient.methods + .transferWithResolver({ amount: 100 }) + .accounts({ authority, treasury }) + .resolvers({ + resolveDestination: () => Promise.resolve(null), + }) + .instruction(), + ).rejects.toThrow(/Invalid account address \[destination\]: \[null\]/); + + await expect( + programClient.methods + .transferWithResolver({ amount: 100 }) + .accounts({ authority, treasury }) + .resolvers({ + resolveDestination: () => Promise.resolve(undefined), + }) + .instruction(), + ).rejects.toThrow(/Invalid account address \[destination\]: \[undefined\]/); + }); + + test('should propagate error when account resolver rejects', async () => { + await expect( + programClient.methods + .transferWithResolver({ amount: 100 }) + .accounts({ authority }) + .resolvers({ + resolveDestination: () => Promise.reject(new Error('resolver failed')), + resolveTreasury: () => Promise.resolve(ctx.SYSTEM_PROGRAM_ADDRESS), + }) + .instruction(), + ).rejects.toThrow( + /Resolver \[resolveDestination\] threw an error while resolving \[instructionAccountNode\] \[destination\]/, + ); + }); + + test('should throw when resolver missing for optional undefined account with direct resolverValueNode', async () => { + const destination = await ctx.createFundedAccount(); + + await expect( + programClient.methods + .transferWithResolver({ amount: 100 }) + .accounts({ authority }) + .resolvers({ + resolveDestination: () => Promise.resolve(destination), + }) + .instruction(), + ).rejects.toThrow(/Resolver \[resolveTreasury\] not provided for account \[treasury\]/); + + // double-check: when we provide null, treasury will be resolved into programId even without resolveTreasury resolver. + const ix = await programClient.methods + .transferWithResolver({ amount: 100 }) + .accounts({ authority, treasury: null }) + .resolvers({ + resolveDestination: () => Promise.resolve(destination), + }) + .instruction(); + expect(ix.accounts?.[2].address).toBe(programClient.programAddress); + }); + + test('should bypass resolver when account is explicitly provided', async () => { + const destination = await ctx.createAccount(); + const treasury = await ctx.createAccount(); + + const ix = await programClient.methods + .transferWithResolver({ amount: 42 }) + .accounts({ authority, destination, treasury }) + .resolvers({ + resolveDestination: () => { + throw new Error('resolveDestination should not be called'); + }, + resolveTreasury: () => { + throw new Error('resolveTreasury should not be called'); + }, + }) + .instruction(); + + expect(ix.accounts?.[1].address).toBe(destination); + expect(ix.accounts?.[2].address).toBe(treasury); + }); + + test('should resolve to programId when resolver returns null', async () => { + const ix = await programClient.methods + .conditionalTransfer() + .accounts({ authority }) + .resolvers({ + resolveIncludeRequired: () => Promise.resolve(true), + resolveIncludeTarget: () => Promise.resolve(null), + }) + .instruction(); + + expect(ix.accounts?.[1].address).toBe(programClient.programAddress); + }); + + test('should throw AccountError when omitted required account conditional has no ifFalse and condition is falsy', async () => { + await expect( + programClient.methods + .conditionalTransfer() + .accounts({ authority }) + .resolvers({ + resolveIncludeRequired: () => Promise.resolve(false), + resolveIncludeTarget: () => Promise.resolve(true), + }) + .instruction(), + ).rejects.toThrow(/Missing account \[requiredTarget\] in \[conditionalTransfer\] instruction/); + }); +}); diff --git a/packages/dynamic-client/test/programs/custom-resolvers/argument-resolvers.test.ts b/packages/dynamic-client/test/programs/custom-resolvers/argument-resolvers.test.ts new file mode 100644 index 000000000..ece203e55 --- /dev/null +++ b/packages/dynamic-client/test/programs/custom-resolvers/argument-resolvers.test.ts @@ -0,0 +1,164 @@ +import type { Address } from '@solana/addresses'; +import { + addEncoderSizePrefix, + getOptionEncoder, + getU8Encoder, + getU32Encoder, + getUtf8Encoder, + none, + some, +} from '@solana/codecs'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { programClient } from './custom-resolvers-test-utils'; + +const utf8Encoder = getUtf8Encoder(); +const u32Encoder = getU32Encoder(); +const u8Encoder = getU8Encoder(); +const stringEncoder = addEncoderSizePrefix(utf8Encoder, u32Encoder); + +/** + * Concat arguments for createItem ix data bytes: + * [discriminator: u8] + [name: utf8] + [description: optional(utf8)] + [tags: optional(u8)] + */ +function expectedData({ + name, + description, + tags, +}: { + description?: string | null; + name: string; + tags?: number | null; +}): Uint8Array { + const discriminator = new Uint8Array([8]); + const nameBytes = stringEncoder.encode(name); + const descriptionBytes = getOptionEncoder(stringEncoder).encode(description ? some(description) : none()); + const tagsBytes = getOptionEncoder(u8Encoder).encode(tags ? some(tags) : none()); + + return new Uint8Array([...discriminator, ...nameBytes, ...descriptionBytes, ...tagsBytes]); +} + +describe('Custom resolvers: arguments ResolverValueNode', () => { + let authority: Address; + let ctx: SvmTestContext; + + beforeEach(async () => { + ctx = new SvmTestContext(); + authority = await ctx.createFundedAccount(); + }); + + test('should resolve omitted argument via resolver', async () => { + const ix = await programClient.methods + .createItem({ name: 'hello' }) + .accounts({ authority }) + .resolvers({ resolveDescription: () => Promise.resolve('auto-filled') }) + .instruction(); + + expect(ix.data).toEqual(expectedData({ description: 'auto-filled', name: 'hello', tags: null })); + }); + + test('should bypass resolver when argument is explicitly provided', async () => { + const ix = await programClient.methods + .createItem({ description: 'explicit', name: 'hello' }) + .accounts({ authority }) + .resolvers({ + resolveDescription: () => { + throw new Error('should not be called'); + }, + }) + .instruction(); + + expect(ix.data).toEqual(expectedData({ description: 'explicit', name: 'hello', tags: null })); + }); + + test('should call multiple resolvers independently', async () => { + const ix = await programClient.methods + .createItem({ name: 'multi' }) + .accounts({ authority }) + .resolvers({ + resolveDescription: () => Promise.resolve('desc'), + resolveTags: () => Promise.resolve(42), + }) + .instruction(); + + expect(ix.data).toEqual(expectedData({ description: 'desc', name: 'multi', tags: 42 })); + }); + + test('should pass argumentsInput and accountsInput context to resolver', async () => { + const expectedArgs = { name: 'context' }; + const expectedAccounts = { authority }; + const capturedArgs: Record = {}; + const capturedAccounts: Record = {}; + + await programClient.methods + .createItem(expectedArgs) + .accounts(expectedAccounts) + .resolvers({ + resolveDescription: (args, accounts) => { + Object.assign(capturedArgs, args); + Object.assign(capturedAccounts, accounts); + return Promise.resolve(null); + }, + }) + .instruction(); + + expect(capturedArgs).toEqual(expectedArgs); + expect(capturedAccounts).toEqual(expectedAccounts); + }); + + test('should omit optional argument when no resolver provided', async () => { + const ix = await programClient.methods + .createItem({ name: 'no-resolver' }) + .accounts({ authority }) + .instruction(); + + expect(ix.data).toEqual(expectedData({ description: null, name: 'no-resolver', tags: null })); + }); + + test('should propagate error when argument resolver throws', async () => { + await expect( + programClient.methods + .createItem({ name: 'err' }) + .accounts({ authority }) + .resolvers({ + resolveDescription: () => { + throw new Error('Error from resolver'); + }, + }) + .instruction(), + ).rejects.toThrow( + /Resolver \[resolveDescription\] threw an error while resolving \[instructionArgumentNode\] \[description\]/, + ); + + await expect( + programClient.methods + .createItem({ name: 'err' }) + .accounts({ authority }) + .resolvers({ + resolveDescription: () => Promise.reject(new Error('Async error from resolver')), + }) + .instruction(), + ).rejects.toThrow( + /Resolver \[resolveDescription\] threw an error while resolving \[instructionArgumentNode\] \[description\]/, + ); + }); + + test('should encode optional argument as none when resolver returns undefined or null', async () => { + const ix1 = await programClient.methods + .createItem({ name: 'hello world 1' }) + .accounts({ authority }) + .resolvers({ resolveDescription: () => Promise.resolve(undefined) }) + .instruction(); + + expect(ix1.data).toEqual(expectedData({ description: null, name: 'hello world 1', tags: null })); + + const ix2 = await programClient.methods + .createItem({ name: 'hello world 2' }) + .accounts({ authority }) + .resolvers({ resolveDescription: () => Promise.resolve(null) }) + .instruction(); + + expect(ix2.data).toEqual(expectedData({ description: null, name: 'hello world 2', tags: null })); + }); +}); diff --git a/packages/dynamic-client/test/programs/custom-resolvers/custom-resolvers-test-utils.ts b/packages/dynamic-client/test/programs/custom-resolvers/custom-resolvers-test-utils.ts new file mode 100644 index 000000000..177150e87 --- /dev/null +++ b/packages/dynamic-client/test/programs/custom-resolvers/custom-resolvers-test-utils.ts @@ -0,0 +1,6 @@ +import { type CustomResolversTestProgramClient } from '../generated/custom-resolvers-test-idl-types'; +import { createTestProgramClient } from '../test-utils'; + +export const programClient = createTestProgramClient( + 'custom-resolvers-test-idl.json', +); diff --git a/packages/dynamic-client/test/programs/dumps/blog.so b/packages/dynamic-client/test/programs/dumps/blog.so new file mode 100755 index 000000000..4534c9174 Binary files /dev/null and b/packages/dynamic-client/test/programs/dumps/blog.so differ diff --git a/packages/dynamic-client/test/programs/dumps/mpl-token-metadata.so b/packages/dynamic-client/test/programs/dumps/mpl-token-metadata.so new file mode 100644 index 000000000..fdebe231b Binary files /dev/null and b/packages/dynamic-client/test/programs/dumps/mpl-token-metadata.so differ diff --git a/packages/dynamic-client/test/programs/dumps/pmp.so b/packages/dynamic-client/test/programs/dumps/pmp.so new file mode 100644 index 000000000..c9f977b53 Binary files /dev/null and b/packages/dynamic-client/test/programs/dumps/pmp.so differ diff --git a/packages/dynamic-client/test/programs/dumps/sas.so b/packages/dynamic-client/test/programs/dumps/sas.so new file mode 100644 index 000000000..10b769ca9 Binary files /dev/null and b/packages/dynamic-client/test/programs/dumps/sas.so differ diff --git a/packages/dynamic-client/test/programs/idls/associated-token-account-idl.json b/packages/dynamic-client/test/programs/idls/associated-token-account-idl.json new file mode 100644 index 000000000..c4f2e86b5 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/associated-token-account-idl.json @@ -0,0 +1,300 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.3.7", + "program": { + "kind": "programNode", + "name": "splAssociatedTokenAccount", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "version": "1.1.1", + "docs": [], + "accounts": [], + "instructions": [ + { + "kind": "instructionNode", + "name": "create", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "fundingAddress", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "associatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "walletAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "tokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createIdempotent", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "fundingAddress", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "associatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "walletAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "tokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "recoverNested", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nestedAssociatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "nestedTokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "destinationAssociatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "ownerAssociatedAccountAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "ownerTokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "walletAddress", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "definedTypes": [], + "pdas": [], + "errors": [ + { + "kind": "errorNode", + "name": "invalidOwner", + "code": 0, + "message": "Associated token account owner does not match address derivation", + "docs": ["InvalidOwner: Associated token account owner does not match address derivation"] + } + ] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/blog-idl.json b/packages/dynamic-client/test/programs/idls/blog-idl.json new file mode 100644 index 000000000..a08261557 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/blog-idl.json @@ -0,0 +1,2008 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.5.1", + "program": { + "kind": "programNode", + "name": "blog", + "publicKey": "1rAs9KgDjEnMVrU1nJPWVhN4b6W4VEBxzcNJoeJpbVR", + "version": "0.1.0", + "origin": "anchor", + "docs": [], + "accounts": [ + { + "kind": "accountNode", + "name": "accessGrant", + "size": 45, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "a737b8ed4af2006d", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "profile", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "permissions", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 4, + "type": { + "kind": "bytesTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "bookmarkList", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "a166250186ff7035", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "owner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bookmarks", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "publicKeyTypeNode" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "category", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "f223f5e8dde36234", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "creator", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "dailyDigest", + "size": 46, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "9f7a552333dbba01", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "profile", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "year", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "month", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "day", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "postCount", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "post", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "08935abab938c096", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "author", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "id", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "title", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "content", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "profile", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "b865a5bc5f3f7fbc", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "username", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "postCount", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "reaction", + "size": 74, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "e23d64bfdfdd8e8b", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "post", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "user", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "kind", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "subscription", + "size": 73, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "40071a8766846221", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "follower", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "author", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "instructions": [ + { + "kind": "instructionNode", + "name": "createAccessGrant", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "profile", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "profile" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "authority", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "accessGrant", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "accessGrant" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "profile", + "value": { + "kind": "accountValueNode", + "name": "profile" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "permissions", + "value": { + "kind": "argumentValueNode", + "name": "permissions" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "480b9806c737599e", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "permissions", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 4, + "type": { + "kind": "bytesTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createBookmarkList", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "bookmarkList", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "bookmarkList" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "owner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "778dbfdea33e1da9", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "bookmarks", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "publicKeyTypeNode" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createCategory", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "creator", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "category", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "category" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "name", + "value": { + "kind": "argumentValueNode", + "name": "name" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "dcf2ee2fe4dbdfe6", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createDailyDigest", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "profile", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "profile" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "authority", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "dailyDigest", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "dailyDigest" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "profile", + "value": { + "kind": "accountValueNode", + "name": "profile" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "year", + "value": { + "kind": "argumentValueNode", + "name": "year" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "month", + "value": { + "kind": "argumentValueNode", + "name": "month" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "day", + "value": { + "kind": "argumentValueNode", + "name": "day" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "39b9aea36467fe8d", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "year", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "month", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "day", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createPost", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "profile", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "profile" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "authority", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "post", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "7b5cb81de7180fca", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "title", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "content", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createProfile", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "profile", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "profile" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "authority", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "e1cdea8f11ba32dc", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "username", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "react", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "user", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "post", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "reaction", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "reaction" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "post", + "value": { + "kind": "accountValueNode", + "name": "post" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "user", + "value": { + "kind": "accountValueNode", + "name": "user" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "kind", + "value": { + "kind": "argumentValueNode", + "name": "kind" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "1e3377485425cccf", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "kind", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "subscribe", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "follower", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "author", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "subscription", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "subscription" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "follower", + "value": { + "kind": "accountValueNode", + "name": "follower" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "author", + "value": { + "kind": "accountValueNode", + "name": "author" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "fe1cbf8a9cb3b735", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updatePost", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "profile", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "profile" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "authority", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "post", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "post" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "profile", + "value": { + "kind": "accountValueNode", + "name": "profile" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "postId", + "value": { + "kind": "argumentValueNode", + "name": "postId" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "author", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "9780cf6ba9f6f16b", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "postId", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "title", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "content", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "definedTypes": [], + "pdas": [ + { + "kind": "pdaNode", + "name": "profile", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "5G9odWBzmA", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "authority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "accessGrant", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "CfvKowZ", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "profile", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "permissions", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 4, + "type": { + "kind": "bytesTypeNode" + } + } + } + ] + }, + { + "kind": "pdaNode", + "name": "bookmarkList", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "2Ffw66YXmcbBp", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "owner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "category", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "Hd7nx8Jz9DA", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "name", + "docs": [], + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "dailyDigest", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "s186r9EB", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "profile", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "year", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "month", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "day", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "reaction", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "L8nWcjTPk4d", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "post", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "user", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "kind", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "subscription", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "fnKB", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "follower", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "author", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "post", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "3sh3oZ", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "profile", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "postId", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + ], + "events": [], + "errors": [] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/circular-account-refs-idl.json b/packages/dynamic-client/test/programs/idls/circular-account-refs-idl.json new file mode 100644 index 000000000..267dc8197 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/circular-account-refs-idl.json @@ -0,0 +1,121 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.3.7", + "program": { + "kind": "programNode", + "name": "circularAccountRefs", + "publicKey": "BkppVYrCXNAr7rt6FRVBJ6ZxfcMLkkWUomuebFVnNAAt", + "version": "0.1.0", + "origin": "custom", + "docs": ["Test program for circular account reference detection"], + "accounts": [], + "instructions": [ + { + "kind": "instructionNode", + "name": "twoAccountCycle", + "docs": ["Test A->B->A circular reference"], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "accountA", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "accountValueNode", + "name": "accountB" + } + }, + { + "kind": "instructionAccountNode", + "name": "accountB", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "accountValueNode", + "name": "accountA" + } + } + ], + "arguments": [], + "discriminators": [] + }, + { + "kind": "instructionNode", + "name": "selfReference", + "docs": ["Test A->A self-reference cycle"], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "accountA", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "accountValueNode", + "name": "accountA" + } + } + ], + "arguments": [], + "discriminators": [] + }, + { + "kind": "instructionNode", + "name": "threeAccountCycle", + "docs": ["Test A->B->C->A circular reference"], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "accountA", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "accountValueNode", + "name": "accountB" + } + }, + { + "kind": "instructionAccountNode", + "name": "accountB", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "accountValueNode", + "name": "accountC" + } + }, + { + "kind": "instructionAccountNode", + "name": "accountC", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "accountValueNode", + "name": "accountA" + } + } + ], + "arguments": [], + "discriminators": [] + } + ], + "definedTypes": [], + "pdas": [] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/collection-types-idl.json b/packages/dynamic-client/test/programs/idls/collection-types-idl.json new file mode 100644 index 000000000..5580b3c97 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/collection-types-idl.json @@ -0,0 +1,434 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.5.1", + "program": { + "kind": "programNode", + "name": "collectionTypes", + "publicKey": "5YYZqJa7jR51426rhWhydoZJC3GSTtYDQNzJJrZqWxA4", + "version": "0.1.0", + "docs": [], + "accounts": [], + "instructions": [ + { + "kind": "instructionNode", + "name": "storeTuple", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + { + "kind": "sizePrefixTypeNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + } + ] + } + } + ] + }, + { + "kind": "instructionNode", + "name": "storeMap", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "mapTypeNode", + "key": { + "kind": "sizePrefixTypeNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + }, + "value": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + }, + { + "kind": "instructionNode", + "name": "storeSet", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "setTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + }, + { + "kind": "instructionNode", + "name": "storeNestedTuple", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "mapTypeNode", + "key": { + "kind": "sizePrefixTypeNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + }, + "value": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "arrayTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ] + } + } + ] + }, + { + "kind": "instructionNode", + "name": "storeNestedMap", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "mapTypeNode", + "key": { + "kind": "sizePrefixTypeNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + }, + "value": { + "kind": "arrayTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + }, + { + "kind": "instructionNode", + "name": "storeNestedSet", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "setTypeNode", + "item": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + { + "kind": "sizePrefixTypeNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + } + ] + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + } + ], + "definedTypes": [], + "pdas": [], + "errors": [] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/custom-resolvers-test-idl.json b/packages/dynamic-client/test/programs/idls/custom-resolvers-test-idl.json new file mode 100644 index 000000000..1a761ec31 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/custom-resolvers-test-idl.json @@ -0,0 +1,274 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.5.1", + "program": { + "kind": "programNode", + "name": "customResolversTest", + "publicKey": "9oHr11Q3pmPsAkFNzQS3JjK5RJA9hwvwrSgF2MXvs22C", + "version": "0.1.0", + "docs": [ + "Manually generated IDL for testing custom resolvers: argument resolvers, direct account resolvers, and conditional account resolvers." + ], + "pdas": [], + "accounts": [], + "definedTypes": [], + "errors": [], + "instructions": [ + { + "kind": "instructionNode", + "name": "createItem", + "docs": [], + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "description", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveDescription", + "docs": [], + "dependsOn": [] + } + }, + { + "kind": "instructionArgumentNode", + "name": "tags", + "docs": [], + "defaultValueStrategy": "optional", + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveTags", + "docs": [], + "dependsOn": [] + } + } + ] + }, + { + "kind": "instructionNode", + "name": "transferWithResolver", + "docs": ["Tests direct account resolverValueNode (Pattern 3)"], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveDestination", + "docs": [], + "dependsOn": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "treasury", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveTreasury", + "docs": [], + "dependsOn": [] + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + }, + { + "kind": "instructionNode", + "name": "conditionalTransfer", + "docs": ["Tests conditional resolver edge cases"], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "optionalTarget", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIncludeTarget", + "docs": [], + "dependsOn": [] + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "requiredTarget", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIncludeRequired", + "docs": [], + "dependsOn": [] + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + }, + "defaultValueStrategy": "omitted" + } + ] + } + ] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/example-idl.json b/packages/dynamic-client/test/programs/idls/example-idl.json new file mode 100644 index 000000000..c18a34147 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/example-idl.json @@ -0,0 +1,1944 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.5.1", + "program": { + "kind": "programNode", + "name": "example", + "publicKey": "5xjPsgMHuoj4MrAPJVBrTomk5UAZvCxVtAdcWwgheoZs", + "version": "0.1.0", + "origin": "anchor", + "docs": [], + "accounts": [ + { + "kind": "accountNode", + "name": "dataAccount1", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "bd16d2a9c3062624", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "input", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "optionalInput", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "nestedExampleAccount", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "199431fafbc64cb8", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "input", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "structAndEnumsInput" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "storeOptionalAccount", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "cdc23432ff1ff097", + "encoding": "base16" + } + }, + { + "kind": "structFieldTypeNode", + "name": "optionalAcc", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "instructions": [ + { + "kind": "instructionNode", + "name": "externalProgramsWithPda", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaNode", + "name": "tokenAccount", + "docs": [], + "programId": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "signer", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "signer", + "value": { + "kind": "accountValueNode", + "name": "signer" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "dependentAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "dependentAccount" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "signer", + "value": { + "kind": "accountValueNode", + "name": "signer" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenAccount", + "value": { + "kind": "accountValueNode", + "name": "tokenAccount" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "tokenProgram" + } + }, + { + "kind": "instructionAccountNode", + "name": "associatedTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "associatedTokenProgram" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111", + "identifier": "rent" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "2d1ba417d532503f", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "fourLevelPda", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "level1", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "level1" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "signer", + "value": { + "kind": "accountValueNode", + "name": "signer" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "level2", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "level2" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "level1", + "value": { + "kind": "accountValueNode", + "name": "level1" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "level3", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "level3" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "level2", + "value": { + "kind": "accountValueNode", + "name": "level2" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "level4", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "level4" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "level3", + "value": { + "kind": "accountValueNode", + "name": "level3" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "0a91d0f7e05f68d9", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "nestedExample", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "nestedExampleAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "74d1961627e33e2f", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "input", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "structAndEnumsInput" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "noArguments", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "acc", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "d8babc37a02f97b1", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "pubkeySeedIx", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "newAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "newAccount" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "signer", + "value": { + "kind": "accountValueNode", + "name": "signer" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "fbe4907a8392e6e1", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "input", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "selfReferencePda", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "recursive", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "recursive" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "recursive", + "value": { + "kind": "accountValueNode", + "name": "recursive" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "5b16377c88fe854e", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "stringSeedPda", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "pdaAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "pdaAccount" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "id", + "value": { + "kind": "argumentValueNode", + "name": "id" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "name", + "value": { + "kind": "argumentValueNode", + "name": "name" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "be1f479d57a0852b", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "id", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "twoNodeCyclePda", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "pdaA", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "pdaA" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "pdaB", + "value": { + "kind": "accountValueNode", + "name": "pdaB" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "pdaB", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "pdaB" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "pdaA", + "value": { + "kind": "accountValueNode", + "name": "pdaA" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "a0c0bcc91ff667be", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateOptionalAccount", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "createdOptionalAcc", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "createdOptionalAcc" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "id", + "value": { + "kind": "argumentValueNode", + "name": "id" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "optionalAccKey", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "systemProgram" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "f2c55828eba2993c", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "id", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateOptionalInput", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "signer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "existingAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "newAccount" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "signer", + "value": { + "kind": "accountValueNode", + "name": "signer" + } + } + ] + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "1f094566b31b79c7", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "input", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "optionalInput", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "command", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumTupleVariantTypeNode", + "name": "start", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + ] + } + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "stop" + }, + { + "kind": "enumStructVariantTypeNode", + "name": "continue", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "reason", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "innerEnum", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "tokenTransfer", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "tokenType", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenType" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "stake", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "duration", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "innerHeader", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "version", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "command", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "command" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "innerStruct", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "value", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "seedEnum", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "seedEnum" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bytes", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "optionalPubkey", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "enumsArray", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "seedEnum" + }, + "count": { + "kind": "fixedCountNode", + "value": 2 + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "seedEnum", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "arm" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "bar" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "car" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "structAndEnumsInput", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "header", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "innerHeader" + } + }, + { + "kind": "structFieldTypeNode", + "name": "innerStruct", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "innerStruct" + } + }, + { + "kind": "structFieldTypeNode", + "name": "innerEnum", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "innerEnum" + } + }, + { + "kind": "structFieldTypeNode", + "name": "seedEnum", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "seedEnum" + } + }, + { + "kind": "structFieldTypeNode", + "name": "pubkey", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "tokenType", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "sPL" + }, + { + "kind": "enumStructVariantTypeNode", + "name": "nFT", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "collection", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "pdas": [ + { + "kind": "pdaNode", + "name": "dependentAccount", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "jRu685RUxyrTMFKUptY", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "signer", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "tokenAccount", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "level1", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "vyjhaZZA", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "signer", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "level2", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "vyjhaZZB", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "level1", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "level3", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "vyjhaZZC", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "level2", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "level4", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "vyjhaZZD", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "level3", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "newAccount", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "3x5dmD", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "signer", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "recursive", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "2TTMxGdnk9y5E", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "recursive", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "pdaAccount", + "docs": [], + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "id", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "name", + "docs": [], + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "pdaA", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "DgTMS8g", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "pdaB", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "pdaB", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "DgTMS8h", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "pdaA", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "createdOptionalAcc", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "bytesTypeNode" + }, + "value": { + "kind": "bytesValueNode", + "data": "36yLnDMJfhTHJWcBU", + "encoding": "base58" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "id", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + ], + "events": [], + "errors": [] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/mpl-token-metadata-idl.json b/packages/dynamic-client/test/programs/idls/mpl-token-metadata-idl.json new file mode 100644 index 000000000..a743186b8 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/mpl-token-metadata-idl.json @@ -0,0 +1,30697 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.5.0", + "program": { + "kind": "programNode", + "name": "mplTokenMetadata", + "publicKey": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", + "version": "1.14.0", + "origin": "shank", + "docs": [], + "accounts": [ + { + "kind": "accountNode", + "name": "collectionAuthorityRecord", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "collectionAuthorityRecord", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "collectionAuthorityRecord" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "metadataDelegateRecord", + "size": 98, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "delegate", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + } + }, + { + "kind": "accountNode", + "name": "holderDelegateRecord", + "size": 98, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "delegate", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "holderDelegateRecord" + } + }, + { + "kind": "accountNode", + "name": "edition", + "size": 41, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "editionV1", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "parent", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "edition", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "editionMarker", + "size": 32, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "editionMarker", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "ledger", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 31, + "type": { + "kind": "bytesTypeNode" + } + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "editionMarker" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "editionMarkerV2", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + } + }, + { + "kind": "structFieldTypeNode", + "name": "ledger", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "editionMarkerV2" + } + }, + { + "kind": "accountNode", + "name": "tokenOwnedEscrow", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "tokenOwnedEscrow", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "baseToken", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "escrowAuthority" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "masterEdition", + "size": null, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "masterEditionV2", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "supply", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "maxSupply", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "deprecatedMasterEditionV1", + "size": null, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "masterEditionV1", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "supply", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "maxSupply", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "printingMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "oneTimePrintingAuthorizationMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "deprecatedMasterEditionV1" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "metadata", + "size": null, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "metadataV1", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "symbol", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uri", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "sellerFeeBasisPoints", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "creators", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "creator" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "primarySaleHappened", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "isMutable", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "editionNonce", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "collection", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collection" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uses", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "uses" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "collectionDetails", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collectionDetails" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "programmableConfig", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "programmableConfig" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "tokenRecord", + "size": 80, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "tokenRecord", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "state", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenState" + } + }, + { + "kind": "structFieldTypeNode", + "name": "ruleSetRevision", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "delegate", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "delegateRole", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "tokenDelegateRole" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "lockedTransfer", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + }, + { + "kind": "accountNode", + "name": "useAuthorityRecord", + "size": 10, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "key", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "key" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "useAuthorityRecord", + "enum": { + "kind": "definedTypeLinkNode", + "name": "key" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "allowedUses", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "bump", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + }, + "pda": { + "kind": "pdaLinkNode", + "name": "useAuthorityRecord" + }, + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "key", + "offset": 0 + } + ] + } + ], + "instructions": [ + { + "kind": "instructionNode", + "name": "deprecatedMintNewEditionFromMasterEditionViaPrintingToken", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Metadata key (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Edition V1 (pda of ['metadata', program id, mint id, 'edition'])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY"] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority of new mint"] + }, + { + "kind": "instructionAccountNode", + "name": "printingMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Printing Mint of master record edition"] + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account containing Printing mint token to be transferred"] + }, + { + "kind": "instructionAccountNode", + "name": "editionMarker", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master mint id, edition_number])" + ] + }, + { + "kind": "instructionAccountNode", + "name": "burnAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Burn authority for this token"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "masterUpdateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["update authority info for new metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "masterMetadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Master record metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent info"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "reservationList", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": [ + "Reservation List - If present, and you are on this list, you can get an edition number given by your position on the list." + ] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updatePrimarySaleHappenedViaToken", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata key (pda of ['metadata', program id, mint id])"] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Owner on the token account"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Account containing tokens from the metadata's mint"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "signMetadata", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"] + }, + { + "kind": "instructionAccountNode", + "name": "creator", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Creator"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "mintNewEditionFromMasterEditionViaToken", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "newMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Metadata key (pda of ['metadata', program id, mint id])"] + }, + { + "kind": "instructionAccountNode", + "name": "newEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Edition (pda of ['metadata', program id, mint id, 'edition'])"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ] + }, + { + "kind": "instructionAccountNode", + "name": "newMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY"] + }, + { + "kind": "instructionAccountNode", + "name": "editionMarkPda", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ] + }, + { + "kind": "instructionAccountNode", + "name": "newMintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority of new mint"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccountOwner", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["owner of token account containing master token (#8)"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["token account containing token from master metadata mint"] + }, + { + "kind": "instructionAccountNode", + "name": "newMetadataUpdateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Update authority info for new metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Master record metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintNewEditionFromMasterEditionViaTokenArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "mintNewEditionFromMasterEditionViaTokenArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "convertMasterEditionV1ToV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V1 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ] + }, + { + "kind": "instructionAccountNode", + "name": "oneTimeAuth", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["One time authorization mint"] + }, + { + "kind": "instructionAccountNode", + "name": "printingMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Printing mint"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 12 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "mintNewEditionFromMasterEditionViaVaultProxy", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "newMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Metadata key (pda of ['metadata', program id, mint id])"] + }, + { + "kind": "instructionAccountNode", + "name": "newEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Edition (pda of ['metadata', program id, mint id, 'edition'])"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']" + ] + }, + { + "kind": "instructionAccountNode", + "name": "newMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY"] + }, + { + "kind": "instructionAccountNode", + "name": "editionMarkPda", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ] + }, + { + "kind": "instructionAccountNode", + "name": "newMintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority of new mint"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "vaultAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Vault authority"] + }, + { + "kind": "instructionAccountNode", + "name": "safetyDepositStore", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Safety deposit token store account"] + }, + { + "kind": "instructionAccountNode", + "name": "safetyDepositBox", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Safety deposit box"] + }, + { + "kind": "instructionAccountNode", + "name": "vault", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Vault"] + }, + { + "kind": "instructionAccountNode", + "name": "newMetadataUpdateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Update authority info for new metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Master record metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenVaultProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token vault program"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 13 + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintNewEditionFromMasterEditionViaTokenArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "mintNewEditionFromMasterEditionViaTokenArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "puffMetadata", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 14 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateMetadataAccountV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority key"], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 15 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "dataV2" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createMasterEditionV3", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition']" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata mint"] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [ + "Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY" + ] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 17 + } + }, + { + "kind": "instructionArgumentNode", + "name": "maxSupply", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "verifyCollection", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Update authority"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collection", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEditionAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 18 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "utilize", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token Account Of NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "useAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["A Use Authority / Can be the current Owner of the NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "ataProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Associated Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent info"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "useAuthorityRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Use Authority Record PDA If present the program Assumes a delegated use authority"] + }, + { + "kind": "instructionAccountNode", + "name": "burner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Program As Signer (Burner)"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 19 + } + }, + { + "kind": "instructionArgumentNode", + "name": "numberOfUses", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "approveUseAuthority", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "useAuthorityRecord", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Use Authority Record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Owner"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "user", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["A Use Authority"] + }, + { + "kind": "instructionAccountNode", + "name": "ownerTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Owned Token Account Of Mint"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "burner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Program As Signer (Burner)"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 20 + } + }, + { + "kind": "instructionArgumentNode", + "name": "numberOfUses", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeUseAuthority", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "useAuthorityRecord", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Use Authority Record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Owner"] + }, + { + "kind": "instructionAccountNode", + "name": "user", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["A Use Authority"] + }, + { + "kind": "instructionAccountNode", + "name": "ownerTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Owned Token Account Of Mint"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 21 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "unverifyCollection", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Authority"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collection", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEditionAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 22 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "approveCollectionAuthority", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Collection Authority Record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "newCollectionAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["A Collection Authority"] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Update Authority of Collection NFT"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Collection Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Collection Metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 23 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeCollectionAuthority", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Collection Authority Record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "delegateAuthority", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Delegated Collection Authority"] + }, + { + "kind": "instructionAccountNode", + "name": "revokeAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Update Authority, or Delegated Authority, of Collection NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Metadata"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 24 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setAndVerifyCollection", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Update authority"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Update Authority of Collection NFT and NFT"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collection", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEditionAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 25 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "freezeDelegatedAccount", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Delegate"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account to freeze"] + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Edition"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "thawDelegatedAccount", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Delegate"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account to thaw"] + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Edition"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "removeCreatorVerification", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"] + }, + { + "kind": "instructionAccountNode", + "name": "creator", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Creator"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 28 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "burnNft", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["NFT owner"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account to close"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 of the NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata of the Collection"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 29 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "verifySizedCollectionItem", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Update authority"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collection", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEditionAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 30 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "unverifySizedCollectionItem", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Authority"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collection", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEditionAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 31 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setAndVerifySizedCollectionItem", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Update authority"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Update Authority of Collection NFT and NFT"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collection", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEditionAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 32 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createMetadataAccountV3", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata key (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["update authority info"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Rent info"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 33 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "dataV2" + } + }, + { + "kind": "instructionArgumentNode", + "name": "isMutable", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "collectionDetails", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collectionDetails" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setCollectionSize", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Collection Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Update authority"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 34 + } + }, + { + "kind": "instructionArgumentNode", + "name": "setCollectionSizeArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "setCollectionSizeArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setTokenStandard", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Metadata update authority"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 35 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "bubblegumSetCollectionSize", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Collection Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Collection Update authority"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "bubblegumSigner", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Signing PDA of Bubblegum program"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionAuthorityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Collection Authority Record PDA"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 36 + } + }, + { + "kind": "instructionArgumentNode", + "name": "setCollectionSizeArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "setCollectionSizeArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "burnEditionNft", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["NFT owner"] + }, + { + "kind": "instructionAccountNode", + "name": "printEditionMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the print edition NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the original/master NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "printEditionTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account the print edition NFT is in"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionTokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account the Master Edition NFT is in"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["MasterEdition2 of the original NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "printEditionAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Print Edition account of the NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "editionMarkerAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Edition Marker PDA of the NFT"] + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createEscrowAccount", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "escrow", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Escrow account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of the token"] + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Edition account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Wallet paying for the transaction and new account"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": true, + "docs": ["Authority/creator of the escrow account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 38 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "closeEscrowAccount", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "escrow", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Escrow account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Edition account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Wallet paying for the transaction and new account"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 39 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "transferOutOfEscrow", + "docs": [], + "optionalAccountStrategy": "omitted", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "escrow", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Escrow account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Wallet paying for the transaction and new account"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "attributeMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account for the new attribute"] + }, + { + "kind": "instructionAccountNode", + "name": "attributeSrc", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account source for the new attribute"] + }, + { + "kind": "instructionAccountNode", + "name": "attributeDst", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account, owned by TM, destination for the new attribute"] + }, + { + "kind": "instructionAccountNode", + "name": "escrowMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account that the escrow is attached"] + }, + { + "kind": "instructionAccountNode", + "name": "escrowAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account that holds the token the escrow is attached to"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "ataProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Associated Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": true, + "docs": ["Authority/creator of the escrow account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 40 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "burn", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Asset owner or Utility delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Edition of the asset"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account to close"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Master edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "masterEditionMint" + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "masterEditionMint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionMint", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master edition mint of the asset"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionToken", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master edition token account"] + }, + { + "kind": "instructionAccountNode", + "name": "editionMarker", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Edition marker account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 41 + } + }, + { + "kind": "instructionArgumentNode", + "name": "burnArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "burnArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "burnV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Asset owner or Utility delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Edition of the asset"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account to close"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Master edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "masterEditionMint" + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "masterEditionMint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionMint", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master edition mint of the asset"] + }, + { + "kind": "instructionAccountNode", + "name": "masterEditionToken", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master edition token account"] + }, + { + "kind": "instructionAccountNode", + "name": "editionMarker", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Edition marker account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 41 + } + }, + { + "kind": "instructionArgumentNode", + "name": "burnV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "create", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Unallocated metadata account with address as pda of ['metadata', program id, mint id]" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": [ + "Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition']" + ] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["Update authority for the metadata account"], + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungibleOrIsMintSigner", + "docs": [], + "dependsOn": [ + { + "kind": "accountValueNode", + "name": "mint" + }, + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 42 + } + }, + { + "kind": "instructionArgumentNode", + "name": "createArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "createArgs" + } + } + ], + "byteDeltas": [ + { + "kind": "instructionByteDeltaNode", + "withHeader": false, + "value": { + "kind": "numberValueNode", + "number": 1427 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "createV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Unallocated metadata account with address as pda of ['metadata', program id, mint id]" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": [ + "Unallocated edition account with address as pda of ['metadata', program id, mint, 'edition']" + ], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["Update authority for the metadata account"], + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungibleOrIsMintSigner", + "docs": [], + "dependsOn": [ + { + "kind": "accountValueNode", + "name": "mint" + }, + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 42 + } + }, + { + "kind": "instructionArgumentNode", + "name": "createV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "symbol", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "defaultValue": { + "kind": "stringValueNode", + "string": "" + } + }, + { + "kind": "instructionArgumentNode", + "name": "uri", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "sellerFeeBasisPoints", + "docs": [], + "type": { + "kind": "amountTypeNode", + "decimals": 2, + "unit": "%", + "number": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "creators", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "creator" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveCreators", + "docs": [], + "dependsOn": [ + { + "kind": "accountValueNode", + "name": "authority" + } + ] + } + }, + { + "kind": "instructionArgumentNode", + "name": "primarySaleHappened", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "booleanValueNode", + "boolean": false + } + }, + { + "kind": "instructionArgumentNode", + "name": "isMutable", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "booleanValueNode", + "boolean": true + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "nonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "collection", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collection" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "uses", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "uses" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "collectionDetails", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collectionDetails" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveCollectionDetails", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "isCollection" + } + ] + } + }, + { + "kind": "instructionArgumentNode", + "name": "ruleSet", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveDecimals", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + } + }, + { + "kind": "instructionArgumentNode", + "name": "printSupply", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "printSupply" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolvePrintSupply", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "isCollection", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "booleanValueNode", + "boolean": false + } + } + ], + "byteDeltas": [ + { + "kind": "instructionByteDeltaNode", + "withHeader": false, + "value": { + "kind": "resolverValueNode", + "name": "resolveCreateV1Bytes", + "docs": [] + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "mint", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token or Associated Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Owner of the token account"], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveOptionalTokenOwner", + "docs": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["(Mint or Update) authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata delegate record"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 43 + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "mintArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "byteDeltas": [ + { + "kind": "instructionByteDeltaNode", + "withHeader": false, + "value": { + "kind": "numberValueNode", + "number": 468 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "mintV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token or Associated Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Owner of the token account"], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveOptionalTokenOwner", + "docs": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["(Mint or Update) authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata delegate record"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 43 + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "byteDeltas": [ + { + "kind": "instructionByteDeltaNode", + "withHeader": false, + "value": { + "kind": "numberValueNode", + "number": 468 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "delegate", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "delegateArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "delegateCollectionV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "collection", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateCollectionV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateSaleV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateSaleV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateTransferV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateTransferV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateDataV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "data", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateDataV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateUtilityV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateUtilityV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateStakingV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateStakingV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateStandardV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "programIdValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateStandardV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateLockedTransferV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateLockedTransferV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "lockedAddress", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateProgrammableConfigV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "programmableConfig", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateProgrammableConfigV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateAuthorityItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "authorityItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateAuthorityItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 9 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateDataItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "dataItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateDataItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 10 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateCollectionItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "collectionItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateCollectionItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegateProgrammableConfigItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "programmableConfigItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateProgrammableConfigItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 12 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "delegatePrintDelegateV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegatePrintDelegateV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 13 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "revoke", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "revokeArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "revokeCollectionV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "collection", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeCollectionV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeSaleV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeSaleV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeTransferV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeTransferV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeDataV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "data", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeDataV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeUtilityV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeUtilityV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeStakingV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeStakingV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeStandardV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "programIdValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeStandardV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeLockedTransferV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeLockedTransferV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeProgrammableConfigV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "programmableConfig", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeProgrammableConfigV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeMigrationV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "argumentValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeMigrationV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 9 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenOwner", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeAuthorityItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "authorityItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeAuthorityItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 10 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeDataItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "dataItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeDataItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeCollectionItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "collectionItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeCollectionItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 12 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokeProgrammableConfigItemV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "programmableConfigItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "delegate" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokeProgrammableConfigItemV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 13 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "authority" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revokePrintDelegateV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record account"] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the delegated account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of metadata"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account of mint"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or token owner"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "revokePrintDelegateV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 14 + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "lock", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Delegate or freeze authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token owner account"], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveOptionalTokenOwner", + "docs": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifFalse": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 46 + } + }, + { + "kind": "instructionArgumentNode", + "name": "lockArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "lockArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "lockV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Delegate or freeze authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token owner account"], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveOptionalTokenOwner", + "docs": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifFalse": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 46 + } + }, + { + "kind": "instructionArgumentNode", + "name": "lockV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "unlock", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Delegate or freeze authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token owner account"], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveOptionalTokenOwner", + "docs": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifFalse": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 47 + } + }, + { + "kind": "instructionArgumentNode", + "name": "unlockArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "unlockArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "unlockV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Delegate or freeze authority"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token owner account"], + "defaultValue": { + "kind": "resolverValueNode", + "name": "resolveOptionalTokenOwner", + "docs": [] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "resolverValueNode", + "name": "resolveIsNonFungible", + "docs": [], + "dependsOn": [ + { + "kind": "argumentValueNode", + "name": "tokenStandard" + } + ] + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifFalse": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 47 + } + }, + { + "kind": "instructionArgumentNode", + "name": "unlockV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "migrate", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Edition account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account owner"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Collection metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Delegate record account"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token record account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instruction sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 48 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "transfer", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account owner"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "destinationToken", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Destination token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "destinationOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "destinationOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Destination token account owner"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition of token asset"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Owner token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "destinationTokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Destination token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "destinationToken" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Transfer authority (token owner or delegate)"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 49 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "transferArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "transferV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "tokenOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account owner"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "destinationToken", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Destination token account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "destinationOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "destinationOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Destination token account owner"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition of token asset"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Owner token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "token" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "destinationTokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Destination token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "destinationToken" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Transfer authority (token owner or delegate)"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token Program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 49 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "update", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "updateArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "updateV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "collectionDetails", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "uses", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsUpdateAuthorityV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsUpdateAuthorityV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "collectionDetails", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "uses", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsAuthorityItemDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "authorityItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsAuthorityItemDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsCollectionDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "delegateMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "collection", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "delegateUpdateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsCollectionDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + }, + { + "kind": "instructionArgumentNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "delegateMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateUpdateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsDataDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "delegateMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "data", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "delegateUpdateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsDataDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "delegateMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateUpdateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsProgrammableConfigDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "delegateMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "programmableConfig", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "delegateUpdateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsProgrammableConfigDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + }, + { + "kind": "instructionArgumentNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "delegateMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "accountValueNode", + "name": "mint" + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegateUpdateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsDataItemDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "dataItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsDataItemDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsCollectionItemDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "collectionItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsCollectionItemDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + }, + { + "kind": "instructionArgumentNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateAsProgrammableConfigItemDelegateV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Update authority or delegate"], + "defaultValue": { + "kind": "accountValueNode", + "name": "payer" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadataDelegateRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "delegateRole", + "value": { + "kind": "enumValueNode", + "variant": "programmableConfigItem", + "enum": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRole" + } + } + }, + { + "kind": "pdaSeedValueNode", + "name": "updateAuthority", + "value": { + "kind": "argumentValueNode", + "name": "updateAuthority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "delegate", + "value": { + "kind": "accountValueNode", + "name": "authority" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 50 + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAsProgrammableConfigItemDelegateV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + } + }, + { + "kind": "instructionArgumentNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + }, + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "use", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Token owner or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 51 + } + }, + { + "kind": "instructionArgumentNode", + "name": "useArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "useArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "useV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Token owner or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint account"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Edition account"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["SPL Token Program"] + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRulesProgram", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules Program"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "authorizationRules" + }, + "ifTrue": { + "kind": "publicKeyValueNode", + "publicKey": "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "identifier": "mplTokenAuthRules" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authorizationRules", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token Authorization Rules account"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 51 + } + }, + { + "kind": "instructionArgumentNode", + "name": "useV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "verify", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Creator to verify, collection update authority or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 52 + } + }, + { + "kind": "instructionArgumentNode", + "name": "verificationArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "verificationArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "verifyCreatorV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Creator to verify, collection update authority or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition Account of the Collection Token"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 52 + } + }, + { + "kind": "instructionArgumentNode", + "name": "verifyCreatorV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "verifyCollectionV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Creator to verify, collection update authority or delegate"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata Account of the Collection"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "collectionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "collectionMasterEdition", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Master Edition Account of the Collection Token"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "collectionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 52 + } + }, + { + "kind": "instructionArgumentNode", + "name": "verifyCollectionV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "unverify", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [ + "Creator to verify, collection (or metadata if parent burned) update authority or delegate" + ], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 53 + } + }, + { + "kind": "instructionArgumentNode", + "name": "verificationArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "verificationArgs" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "unverifyCreatorV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [ + "Creator to verify, collection (or metadata if parent burned) update authority or delegate" + ], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata Account of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 53 + } + }, + { + "kind": "instructionArgumentNode", + "name": "unverifyCreatorV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "unverifyCollectionV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [ + "Creator to verify, collection (or metadata if parent burned) update authority or delegate" + ], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "delegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Delegate record PDA"] + }, + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata account"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of the Collection"] + }, + { + "kind": "instructionAccountNode", + "name": "collectionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Metadata Account of the Collection"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "collectionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 53 + } + }, + { + "kind": "instructionArgumentNode", + "name": "unverifyCollectionV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "collect", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authority to collect fees"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "recipient", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The account to transfer collected fees to"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 54 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "print", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "editionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Metadata key (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Edition (pda of ['metadata', program id, mint id, 'edition'])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMint", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY"] + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenAccountOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the token account of new token"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of new token"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "editionTokenAccountOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority of new mint"] + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "editionTokenAccount" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMarkerPda", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccountOwner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["owner of token account containing master token"] + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["token account containing token from master metadata mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "masterTokenAccountOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterMetadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Master record metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The update authority of the master edition."], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 55 + } + }, + { + "kind": "instructionArgumentNode", + "name": "printArgs", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "printArgs" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "masterEditionMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "subInstructions": [ + { + "kind": "instructionNode", + "name": "printV1", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "editionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Metadata key (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Edition (pda of ['metadata', program id, mint id, 'edition'])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMint", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY"] + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenAccountOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the token account of new token"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of new token"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "editionTokenAccountOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority of new mint"], + "defaultValue": { + "kind": "accountValueNode", + "name": "masterTokenAccountOwner" + } + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "editionTokenAccount" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMarkerPda", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "editionMarkerV2" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + }, + "ifFalse": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "editionMarkerFromEditionNumber" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "editionNumber", + "value": { + "kind": "argumentValueNode", + "name": "editionNumber" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccountOwner", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["owner of token account containing master token"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["token account containing token from master metadata mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "masterTokenAccountOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterMetadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Master record metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The update authority of the master edition."], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 55 + } + }, + { + "kind": "instructionArgumentNode", + "name": "printV1Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "editionNumber", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "masterEditionMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "printV2", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "editionMetadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Metadata key (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["New Edition (pda of ['metadata', program id, mint id, 'edition'])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMint", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY"] + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenAccountOwner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner of the token account of new token"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token account of new token"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "editionTokenAccountOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Mint authority of new mint"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "holderDelegateRecord" + }, + "ifTrue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "delegate" + }, + "ifTrue": { + "kind": "accountValueNode", + "name": "delegate" + }, + "ifFalse": { + "kind": "accountValueNode", + "name": "payer" + } + }, + "ifFalse": { + "kind": "accountValueNode", + "name": "masterTokenAccountOwner" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "editionTokenRecord", + "isWritable": true, + "isSigner": false, + "isOptional": true, + "docs": ["Token record account"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "tokenRecord" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "editionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "token", + "value": { + "kind": "accountValueNode", + "name": "editionTokenAccount" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "masterEdition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition'])" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "editionMarkerPda", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE)." + ], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "argumentValueNode", + "name": "tokenStandard" + }, + "value": { + "kind": "enumValueNode", + "variant": "programmableNonFungible", + "enum": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "editionMarkerV2" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + }, + "ifFalse": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "editionMarkerFromEditionNumber" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "editionNumber", + "value": { + "kind": "argumentValueNode", + "name": "editionNumber" + } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["payer"], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccountOwner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["owner of token account containing master token"], + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "holderDelegateRecord" + }, + "ifFalse": { + "kind": "identityValueNode" + } + } + }, + { + "kind": "instructionAccountNode", + "name": "masterTokenAccount", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["token account containing token from master metadata mint"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "masterTokenAccountOwner" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "masterMetadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Master record metadata account"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "argumentValueNode", + "name": "masterEditionMint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The update authority of the master edition."], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "splTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "splAtaProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Associated Token Account program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "identifier": "splAssociatedToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "sysvarInstructions", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar account"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "holderDelegateRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["The Delegate Record authorizing escrowless edition printing"] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": true, + "isOptional": true, + "docs": ["The authority printing the edition for a delegated print"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 55 + } + }, + { + "kind": "instructionArgumentNode", + "name": "printV2Discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "editionNumber", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "extraArguments": [ + { + "kind": "instructionArgumentNode", + "name": "masterEditionMint", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ] + }, + { + "kind": "instructionNode", + "name": "resize", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The metadata account of the digital asset"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "The master edition or edition account of the digital asset, an uninitialized account for fungible assets" + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": [ + "The recipient of the excess rent and authority if the authority account is not present" + ], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": true, + "docs": [ + "Owner of the asset for (p)NFTs, or mint authority for fungible assets, if different from the payer" + ] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Token or Associated Token account"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 56 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "closeAccounts", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Metadata (pda of ['metadata', program id, mint id])"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "metadata" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "edition", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Edition of the asset"], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "masterEdition" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of token asset"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authority to close ownerless accounts"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account that will receive the rent."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 57 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "setCollectionSizeArgs", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "size", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "mintNewEditionFromMasterEditionViaTokenArgs", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "edition", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "authorizationData", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "payload", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "payload" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "collection", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "verified", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "key", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "creator", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "address", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "verified", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "share", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "data", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "symbol", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uri", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "sellerFeeBasisPoints", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "creators", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "creator" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "dataV2", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "symbol", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uri", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "sellerFeeBasisPoints", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "creators", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "creator" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "collection", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collection" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uses", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "uses" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "reservation", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "address", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "spotsRemaining", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "totalSpots", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "reservationV1", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "address", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "spotsRemaining", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "totalSpots", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "seedsVec", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "seeds", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "proofInfo", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "proof", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "fixedSizeTypeNode", + "size": 32, + "type": { + "kind": "bytesTypeNode" + } + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "payload", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "map", + "docs": [], + "type": { + "kind": "mapTypeNode", + "key": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "value": { + "kind": "definedTypeLinkNode", + "name": "payloadType" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "uses", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "useMethod", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "useMethod" + } + }, + { + "kind": "structFieldTypeNode", + "name": "remaining", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "total", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "burnArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "delegateArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "collectionV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "saleV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "transferV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "dataV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "utilityV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "stakingV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "standardV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "lockedTransferV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "lockedAddress", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "programmableConfigV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "authorityItemV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "dataItemV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "collectionItemV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "programmableConfigItemV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "printDelegateV1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "revokeArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "collectionV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "saleV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "dataV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "utilityV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "stakingV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "standardV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "lockedTransferV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableConfigV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "migrationV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "authorityItemV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "dataItemV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "collectionItemV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableConfigItemV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "printDelegateV1" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "metadataDelegateRole", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "authorityItem" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "collection" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "use" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "data" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableConfig" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "dataItem" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "collectionItem" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableConfigItem" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "holderDelegateRole", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "printDelegate" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "createArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "symbol", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "defaultValue": { + "kind": "stringValueNode", + "string": "" + } + }, + { + "kind": "structFieldTypeNode", + "name": "uri", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "sellerFeeBasisPoints", + "docs": [], + "type": { + "kind": "amountTypeNode", + "decimals": 2, + "unit": "%", + "number": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "creators", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "creator" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "primarySaleHappened", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "booleanValueNode", + "boolean": false + } + }, + { + "kind": "structFieldTypeNode", + "name": "isMutable", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "booleanValueNode", + "boolean": true + } + }, + { + "kind": "structFieldTypeNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + } + }, + { + "kind": "structFieldTypeNode", + "name": "collection", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collection" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "uses", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "uses" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "collectionDetails", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "collectionDetails" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "ruleSet", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "decimals", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "printSupply", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "printSupply" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "mintArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "transferArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "amount", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "updateArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "collectionDetails", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uses", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asUpdateAuthorityV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "collectionDetails", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionDetailsToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uses", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "usesToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asAuthorityItemDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "newUpdateAuthority", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "primarySaleHappened", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "isMutable", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "tokenStandard" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asCollectionDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asDataDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asProgrammableConfigDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asDataItemDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "data", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "data" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asCollectionItemDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "collection", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "collectionToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "asProgrammableConfigItemDelegateV2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "ruleSet", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + }, + "defaultValue": { + "kind": "enumValueNode", + "variant": "none", + "enum": { + "kind": "definedTypeLinkNode", + "name": "ruleSetToggle" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "collectionToggle", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "clear" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "set", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "collection" + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "usesToggle", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "clear" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "set", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "uses" + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "collectionDetailsToggle", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "clear" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "set", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "collectionDetails" + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "ruleSetToggle", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "clear" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "set", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "publicKeyTypeNode" + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "printArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "edition", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "v2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "edition", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "lockArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "unlockArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "useArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authorizationData", + "defaultValueStrategy": "optional", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "definedTypeLinkNode", + "name": "authorizationData" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "verificationArgs", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "creatorV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "collectionV1" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "tokenStandard", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "nonFungible" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "fungibleAsset" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "fungible" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "nonFungibleEdition" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableNonFungible" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableNonFungibleEdition" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "key", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "uninitialized" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "editionV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "masterEditionV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "reservationListV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadataV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "reservationListV2" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "masterEditionV2" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "editionMarker" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "useAuthorityRecord" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "collectionAuthorityRecord" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenOwnedEscrow" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenRecord" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadataDelegate" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "editionMarkerV2" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "holderDelegate" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "collectionDetails", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "size", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "v2", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "padding", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 8, + "type": { + "kind": "bytesTypeNode" + } + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "escrowAuthority", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenOwner" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "creator", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "publicKeyTypeNode" + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "printSupply", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "zero" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "limited", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + ] + } + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "unlimited" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "programmableConfig", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumStructVariantTypeNode", + "name": "v1", + "struct": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "ruleSet", + "docs": [], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "migrationType", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "collectionV1" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "programmableV1" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "tokenState", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "unlocked" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "locked" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "listed" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "tokenDelegateRole", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "sale" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transfer" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "utility" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "staking" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "standard" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "lockedTransfer" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "migration" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "authorityType", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadata" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "holder" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadataDelegate" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenDelegate" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "payloadKey", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "amount" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "authority" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "authoritySeeds" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "delegate" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "delegateSeeds" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "destination" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "destinationSeeds" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "holder" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "source" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "sourceSeeds" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "payloadType", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumTupleVariantTypeNode", + "name": "pubkey", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "publicKeyTypeNode" + } + ] + } + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "seeds", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "seedsVec" + } + ] + } + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "merkleProof", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "proofInfo" + } + ] + } + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "number", + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "useMethod", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "burn" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "multiple" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "single" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "pdas": [ + { + "kind": "pdaNode", + "name": "metadata", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "deprecatedMasterEditionV1", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "edition" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "masterEdition", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "edition" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "editionMarker", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "edition" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "editionMarker", + "docs": ["The floor of the edition number divided by 248 as a string. I.e. ⌊edition/248⌋."], + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "editionMarkerV2", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "edition" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "marker" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "tokenRecord", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "token_record" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "token", + "docs": ["The address of the token account (ata or not)"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "metadataDelegateRecord", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "delegateRole", + "docs": ["The role of the metadata delegate"], + "type": { + "kind": "definedTypeLinkNode", + "name": "metadataDelegateRoleSeed" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "updateAuthority", + "docs": ["The address of the metadata's update authority"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "delegate", + "docs": ["The address of the delegate authority"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "collectionAuthorityRecord", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "collection_authority" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "collectionAuthority", + "docs": ["The address of the collection authority"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "holderDelegateRecord", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "delegateRole", + "docs": ["The role of the holder delegate"], + "type": { + "kind": "definedTypeLinkNode", + "name": "holderDelegateRoleSeed" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "owner", + "docs": ["The address of the owner of the token"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "delegate", + "docs": ["The address of the delegate authority"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + { + "kind": "pdaNode", + "name": "useAuthorityRecord", + "docs": [], + "seeds": [ + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "metadata" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "publicKeyTypeNode" + }, + "value": { + "kind": "programIdValueNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The address of the mint account"], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "constantPdaSeedNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "value": { + "kind": "stringValueNode", + "string": "user" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "useAuthority", + "docs": ["The address of the use authority"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + } + ], + "errors": [ + { + "kind": "errorNode", + "name": "instructionUnpackError", + "code": 0, + "message": "", + "docs": ["InstructionUnpackError"] + }, + { + "kind": "errorNode", + "name": "instructionPackError", + "code": 1, + "message": "", + "docs": ["InstructionPackError"] + }, + { + "kind": "errorNode", + "name": "notRentExempt", + "code": 2, + "message": "Lamport balance below rent-exempt threshold", + "docs": ["NotRentExempt: Lamport balance below rent-exempt threshold"] + }, + { + "kind": "errorNode", + "name": "alreadyInitialized", + "code": 3, + "message": "Already initialized", + "docs": ["AlreadyInitialized: Already initialized"] + }, + { + "kind": "errorNode", + "name": "uninitialized", + "code": 4, + "message": "Uninitialized", + "docs": ["Uninitialized: Uninitialized"] + }, + { + "kind": "errorNode", + "name": "invalidMetadataKey", + "code": 5, + "message": " Metadata's key must match seed of ['metadata', program id, mint] provided", + "docs": [ + "InvalidMetadataKey: Metadata's key must match seed of ['metadata', program id, mint] provided" + ] + }, + { + "kind": "errorNode", + "name": "invalidEditionKey", + "code": 6, + "message": "Edition's key must match seed of ['metadata', program id, name, 'edition'] provided", + "docs": [ + "InvalidEditionKey: Edition's key must match seed of ['metadata', program id, name, 'edition'] provided" + ] + }, + { + "kind": "errorNode", + "name": "updateAuthorityIncorrect", + "code": 7, + "message": "Update Authority given does not match", + "docs": ["UpdateAuthorityIncorrect: Update Authority given does not match"] + }, + { + "kind": "errorNode", + "name": "updateAuthorityIsNotSigner", + "code": 8, + "message": "Update Authority needs to be signer to update metadata", + "docs": ["UpdateAuthorityIsNotSigner: Update Authority needs to be signer to update metadata"] + }, + { + "kind": "errorNode", + "name": "notMintAuthority", + "code": 9, + "message": "You must be the mint authority and signer on this transaction", + "docs": ["NotMintAuthority: You must be the mint authority and signer on this transaction"] + }, + { + "kind": "errorNode", + "name": "invalidMintAuthority", + "code": 10, + "message": "Mint authority provided does not match the authority on the mint", + "docs": ["InvalidMintAuthority: Mint authority provided does not match the authority on the mint"] + }, + { + "kind": "errorNode", + "name": "nameTooLong", + "code": 11, + "message": "Name too long", + "docs": ["NameTooLong: Name too long"] + }, + { + "kind": "errorNode", + "name": "symbolTooLong", + "code": 12, + "message": "Symbol too long", + "docs": ["SymbolTooLong: Symbol too long"] + }, + { + "kind": "errorNode", + "name": "uriTooLong", + "code": 13, + "message": "URI too long", + "docs": ["UriTooLong: URI too long"] + }, + { + "kind": "errorNode", + "name": "updateAuthorityMustBeEqualToMetadataAuthorityAndSigner", + "code": 14, + "message": "", + "docs": ["UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner"] + }, + { + "kind": "errorNode", + "name": "mintMismatch", + "code": 15, + "message": "Mint given does not match mint on Metadata", + "docs": ["MintMismatch: Mint given does not match mint on Metadata"] + }, + { + "kind": "errorNode", + "name": "editionsMustHaveExactlyOneToken", + "code": 16, + "message": "Editions must have exactly one token", + "docs": ["EditionsMustHaveExactlyOneToken: Editions must have exactly one token"] + }, + { + "kind": "errorNode", + "name": "maxEditionsMintedAlready", + "code": 17, + "message": "", + "docs": ["MaxEditionsMintedAlready"] + }, + { + "kind": "errorNode", + "name": "tokenMintToFailed", + "code": 18, + "message": "", + "docs": ["TokenMintToFailed"] + }, + { + "kind": "errorNode", + "name": "masterRecordMismatch", + "code": 19, + "message": "", + "docs": ["MasterRecordMismatch"] + }, + { + "kind": "errorNode", + "name": "destinationMintMismatch", + "code": 20, + "message": "", + "docs": ["DestinationMintMismatch"] + }, + { + "kind": "errorNode", + "name": "editionAlreadyMinted", + "code": 21, + "message": "", + "docs": ["EditionAlreadyMinted"] + }, + { + "kind": "errorNode", + "name": "printingMintDecimalsShouldBeZero", + "code": 22, + "message": "", + "docs": ["PrintingMintDecimalsShouldBeZero"] + }, + { + "kind": "errorNode", + "name": "oneTimePrintingAuthorizationMintDecimalsShouldBeZero", + "code": 23, + "message": "", + "docs": ["OneTimePrintingAuthorizationMintDecimalsShouldBeZero"] + }, + { + "kind": "errorNode", + "name": "editionMintDecimalsShouldBeZero", + "code": 24, + "message": "EditionMintDecimalsShouldBeZero", + "docs": ["EditionMintDecimalsShouldBeZero: EditionMintDecimalsShouldBeZero"] + }, + { + "kind": "errorNode", + "name": "tokenBurnFailed", + "code": 25, + "message": "", + "docs": ["TokenBurnFailed"] + }, + { + "kind": "errorNode", + "name": "tokenAccountOneTimeAuthMintMismatch", + "code": 26, + "message": "", + "docs": ["TokenAccountOneTimeAuthMintMismatch"] + }, + { + "kind": "errorNode", + "name": "derivedKeyInvalid", + "code": 27, + "message": "Derived key invalid", + "docs": ["DerivedKeyInvalid: Derived key invalid"] + }, + { + "kind": "errorNode", + "name": "printingMintMismatch", + "code": 28, + "message": "The Printing mint does not match that on the master edition!", + "docs": ["PrintingMintMismatch: The Printing mint does not match that on the master edition!"] + }, + { + "kind": "errorNode", + "name": "oneTimePrintingAuthMintMismatch", + "code": 29, + "message": "The One Time Printing Auth mint does not match that on the master edition!", + "docs": [ + "OneTimePrintingAuthMintMismatch: The One Time Printing Auth mint does not match that on the master edition!" + ] + }, + { + "kind": "errorNode", + "name": "tokenAccountMintMismatch", + "code": 30, + "message": "The mint of the token account does not match the Printing mint!", + "docs": ["TokenAccountMintMismatch: The mint of the token account does not match the Printing mint!"] + }, + { + "kind": "errorNode", + "name": "tokenAccountMintMismatchV2", + "code": 31, + "message": "The mint of the token account does not match the master metadata mint!", + "docs": [ + "TokenAccountMintMismatchV2: The mint of the token account does not match the master metadata mint!" + ] + }, + { + "kind": "errorNode", + "name": "notEnoughTokens", + "code": 32, + "message": "Not enough tokens to mint a limited edition", + "docs": ["NotEnoughTokens: Not enough tokens to mint a limited edition"] + }, + { + "kind": "errorNode", + "name": "printingMintAuthorizationAccountMismatch", + "code": 33, + "message": "", + "docs": ["PrintingMintAuthorizationAccountMismatch"] + }, + { + "kind": "errorNode", + "name": "authorizationTokenAccountOwnerMismatch", + "code": 34, + "message": "", + "docs": ["AuthorizationTokenAccountOwnerMismatch"] + }, + { + "kind": "errorNode", + "name": "disabled", + "code": 35, + "message": "", + "docs": ["Disabled"] + }, + { + "kind": "errorNode", + "name": "creatorsTooLong", + "code": 36, + "message": "Creators list too long", + "docs": ["CreatorsTooLong: Creators list too long"] + }, + { + "kind": "errorNode", + "name": "creatorsMustBeAtleastOne", + "code": 37, + "message": "Creators must be at least one if set", + "docs": ["CreatorsMustBeAtleastOne: Creators must be at least one if set"] + }, + { + "kind": "errorNode", + "name": "mustBeOneOfCreators", + "code": 38, + "message": "", + "docs": ["MustBeOneOfCreators"] + }, + { + "kind": "errorNode", + "name": "noCreatorsPresentOnMetadata", + "code": 39, + "message": "This metadata does not have creators", + "docs": ["NoCreatorsPresentOnMetadata: This metadata does not have creators"] + }, + { + "kind": "errorNode", + "name": "creatorNotFound", + "code": 40, + "message": "This creator address was not found", + "docs": ["CreatorNotFound: This creator address was not found"] + }, + { + "kind": "errorNode", + "name": "invalidBasisPoints", + "code": 41, + "message": "Basis points cannot be more than 10000", + "docs": ["InvalidBasisPoints: Basis points cannot be more than 10000"] + }, + { + "kind": "errorNode", + "name": "primarySaleCanOnlyBeFlippedToTrue", + "code": 42, + "message": "Primary sale can only be flipped to true and is immutable", + "docs": ["PrimarySaleCanOnlyBeFlippedToTrue: Primary sale can only be flipped to true and is immutable"] + }, + { + "kind": "errorNode", + "name": "ownerMismatch", + "code": 43, + "message": "Owner does not match that on the account given", + "docs": ["OwnerMismatch: Owner does not match that on the account given"] + }, + { + "kind": "errorNode", + "name": "noBalanceInAccountForAuthorization", + "code": 44, + "message": "This account has no tokens to be used for authorization", + "docs": ["NoBalanceInAccountForAuthorization: This account has no tokens to be used for authorization"] + }, + { + "kind": "errorNode", + "name": "shareTotalMustBe100", + "code": 45, + "message": "Share total must equal 100 for creator array", + "docs": ["ShareTotalMustBe100: Share total must equal 100 for creator array"] + }, + { + "kind": "errorNode", + "name": "reservationExists", + "code": 46, + "message": "", + "docs": ["ReservationExists"] + }, + { + "kind": "errorNode", + "name": "reservationDoesNotExist", + "code": 47, + "message": "", + "docs": ["ReservationDoesNotExist"] + }, + { + "kind": "errorNode", + "name": "reservationNotSet", + "code": 48, + "message": "", + "docs": ["ReservationNotSet"] + }, + { + "kind": "errorNode", + "name": "reservationAlreadyMade", + "code": 49, + "message": "", + "docs": ["ReservationAlreadyMade"] + }, + { + "kind": "errorNode", + "name": "beyondMaxAddressSize", + "code": 50, + "message": "", + "docs": ["BeyondMaxAddressSize"] + }, + { + "kind": "errorNode", + "name": "numericalOverflowError", + "code": 51, + "message": "NumericalOverflowError", + "docs": ["NumericalOverflowError: NumericalOverflowError"] + }, + { + "kind": "errorNode", + "name": "reservationBreachesMaximumSupply", + "code": 52, + "message": "", + "docs": ["ReservationBreachesMaximumSupply"] + }, + { + "kind": "errorNode", + "name": "addressNotInReservation", + "code": 53, + "message": "", + "docs": ["AddressNotInReservation"] + }, + { + "kind": "errorNode", + "name": "cannotVerifyAnotherCreator", + "code": 54, + "message": "You cannot unilaterally verify another creator, they must sign", + "docs": ["CannotVerifyAnotherCreator: You cannot unilaterally verify another creator, they must sign"] + }, + { + "kind": "errorNode", + "name": "cannotUnverifyAnotherCreator", + "code": 55, + "message": "You cannot unilaterally unverify another creator", + "docs": ["CannotUnverifyAnotherCreator: You cannot unilaterally unverify another creator"] + }, + { + "kind": "errorNode", + "name": "spotMismatch", + "code": 56, + "message": "", + "docs": ["SpotMismatch"] + }, + { + "kind": "errorNode", + "name": "incorrectOwner", + "code": 57, + "message": "Incorrect account owner", + "docs": ["IncorrectOwner: Incorrect account owner"] + }, + { + "kind": "errorNode", + "name": "printingWouldBreachMaximumSupply", + "code": 58, + "message": "", + "docs": ["PrintingWouldBreachMaximumSupply"] + }, + { + "kind": "errorNode", + "name": "dataIsImmutable", + "code": 59, + "message": "Data is immutable", + "docs": ["DataIsImmutable: Data is immutable"] + }, + { + "kind": "errorNode", + "name": "duplicateCreatorAddress", + "code": 60, + "message": "No duplicate creator addresses", + "docs": ["DuplicateCreatorAddress: No duplicate creator addresses"] + }, + { + "kind": "errorNode", + "name": "reservationSpotsRemainingShouldMatchTotalSpotsAtStart", + "code": 61, + "message": "", + "docs": ["ReservationSpotsRemainingShouldMatchTotalSpotsAtStart"] + }, + { + "kind": "errorNode", + "name": "invalidTokenProgram", + "code": 62, + "message": "Invalid token program", + "docs": ["InvalidTokenProgram: Invalid token program"] + }, + { + "kind": "errorNode", + "name": "dataTypeMismatch", + "code": 63, + "message": "Data type mismatch", + "docs": ["DataTypeMismatch: Data type mismatch"] + }, + { + "kind": "errorNode", + "name": "beyondAlottedAddressSize", + "code": 64, + "message": "", + "docs": ["BeyondAlottedAddressSize"] + }, + { + "kind": "errorNode", + "name": "reservationNotComplete", + "code": 65, + "message": "", + "docs": ["ReservationNotComplete"] + }, + { + "kind": "errorNode", + "name": "triedToReplaceAnExistingReservation", + "code": 66, + "message": "", + "docs": ["TriedToReplaceAnExistingReservation"] + }, + { + "kind": "errorNode", + "name": "invalidOperation", + "code": 67, + "message": "Invalid operation", + "docs": ["InvalidOperation: Invalid operation"] + }, + { + "kind": "errorNode", + "name": "invalidOwner", + "code": 68, + "message": "Invalid Owner", + "docs": ["InvalidOwner: Invalid Owner"] + }, + { + "kind": "errorNode", + "name": "printingMintSupplyMustBeZeroForConversion", + "code": 69, + "message": "Printing mint supply must be zero for conversion", + "docs": ["PrintingMintSupplyMustBeZeroForConversion: Printing mint supply must be zero for conversion"] + }, + { + "kind": "errorNode", + "name": "oneTimeAuthMintSupplyMustBeZeroForConversion", + "code": 70, + "message": "One Time Auth mint supply must be zero for conversion", + "docs": [ + "OneTimeAuthMintSupplyMustBeZeroForConversion: One Time Auth mint supply must be zero for conversion" + ] + }, + { + "kind": "errorNode", + "name": "invalidEditionIndex", + "code": 71, + "message": "You tried to insert one edition too many into an edition mark pda", + "docs": ["InvalidEditionIndex: You tried to insert one edition too many into an edition mark pda"] + }, + { + "kind": "errorNode", + "name": "reservationArrayShouldBeSizeOne", + "code": 72, + "message": "", + "docs": ["ReservationArrayShouldBeSizeOne"] + }, + { + "kind": "errorNode", + "name": "isMutableCanOnlyBeFlippedToFalse", + "code": 73, + "message": "Is Mutable can only be flipped to false", + "docs": ["IsMutableCanOnlyBeFlippedToFalse: Is Mutable can only be flipped to false"] + }, + { + "kind": "errorNode", + "name": "collectionCannotBeVerifiedInThisInstruction", + "code": 74, + "message": "Collection cannot be verified in this instruction", + "docs": [ + "CollectionCannotBeVerifiedInThisInstruction: Collection cannot be verified in this instruction" + ] + }, + { + "kind": "errorNode", + "name": "removed", + "code": 75, + "message": "This instruction was deprecated in a previous release and is now removed", + "docs": ["Removed: This instruction was deprecated in a previous release and is now removed"] + }, + { + "kind": "errorNode", + "name": "mustBeBurned", + "code": 76, + "message": "", + "docs": ["MustBeBurned"] + }, + { + "kind": "errorNode", + "name": "invalidUseMethod", + "code": 77, + "message": "This use method is invalid", + "docs": ["InvalidUseMethod: This use method is invalid"] + }, + { + "kind": "errorNode", + "name": "cannotChangeUseMethodAfterFirstUse", + "code": 78, + "message": "Cannot Change Use Method after the first use", + "docs": ["CannotChangeUseMethodAfterFirstUse: Cannot Change Use Method after the first use"] + }, + { + "kind": "errorNode", + "name": "cannotChangeUsesAfterFirstUse", + "code": 79, + "message": "Cannot Change Remaining or Available uses after the first use", + "docs": ["CannotChangeUsesAfterFirstUse: Cannot Change Remaining or Available uses after the first use"] + }, + { + "kind": "errorNode", + "name": "collectionNotFound", + "code": 80, + "message": "Collection Not Found on Metadata", + "docs": ["CollectionNotFound: Collection Not Found on Metadata"] + }, + { + "kind": "errorNode", + "name": "invalidCollectionUpdateAuthority", + "code": 81, + "message": "Collection Update Authority is invalid", + "docs": ["InvalidCollectionUpdateAuthority: Collection Update Authority is invalid"] + }, + { + "kind": "errorNode", + "name": "collectionMustBeAUniqueMasterEdition", + "code": 82, + "message": "Collection Must Be a Unique Master Edition v2", + "docs": ["CollectionMustBeAUniqueMasterEdition: Collection Must Be a Unique Master Edition v2"] + }, + { + "kind": "errorNode", + "name": "useAuthorityRecordAlreadyExists", + "code": 83, + "message": "The Use Authority Record Already Exists, to modify it Revoke, then Approve", + "docs": [ + "UseAuthorityRecordAlreadyExists: The Use Authority Record Already Exists, to modify it Revoke, then Approve" + ] + }, + { + "kind": "errorNode", + "name": "useAuthorityRecordAlreadyRevoked", + "code": 84, + "message": "The Use Authority Record is empty or already revoked", + "docs": ["UseAuthorityRecordAlreadyRevoked: The Use Authority Record is empty or already revoked"] + }, + { + "kind": "errorNode", + "name": "unusable", + "code": 85, + "message": "This token has no uses", + "docs": ["Unusable: This token has no uses"] + }, + { + "kind": "errorNode", + "name": "notEnoughUses", + "code": 86, + "message": "There are not enough Uses left on this token.", + "docs": ["NotEnoughUses: There are not enough Uses left on this token."] + }, + { + "kind": "errorNode", + "name": "collectionAuthorityRecordAlreadyExists", + "code": 87, + "message": "This Collection Authority Record Already Exists.", + "docs": ["CollectionAuthorityRecordAlreadyExists: This Collection Authority Record Already Exists."] + }, + { + "kind": "errorNode", + "name": "collectionAuthorityDoesNotExist", + "code": 88, + "message": "This Collection Authority Record Does Not Exist.", + "docs": ["CollectionAuthorityDoesNotExist: This Collection Authority Record Does Not Exist."] + }, + { + "kind": "errorNode", + "name": "invalidUseAuthorityRecord", + "code": 89, + "message": "This Use Authority Record is invalid.", + "docs": ["InvalidUseAuthorityRecord: This Use Authority Record is invalid."] + }, + { + "kind": "errorNode", + "name": "invalidCollectionAuthorityRecord", + "code": 90, + "message": "", + "docs": ["InvalidCollectionAuthorityRecord"] + }, + { + "kind": "errorNode", + "name": "invalidFreezeAuthority", + "code": 91, + "message": "Metadata does not match the freeze authority on the mint", + "docs": ["InvalidFreezeAuthority: Metadata does not match the freeze authority on the mint"] + }, + { + "kind": "errorNode", + "name": "invalidDelegate", + "code": 92, + "message": "All tokens in this account have not been delegated to this user.", + "docs": ["InvalidDelegate: All tokens in this account have not been delegated to this user."] + }, + { + "kind": "errorNode", + "name": "cannotAdjustVerifiedCreator", + "code": 93, + "message": "", + "docs": ["CannotAdjustVerifiedCreator"] + }, + { + "kind": "errorNode", + "name": "cannotRemoveVerifiedCreator", + "code": 94, + "message": "Verified creators cannot be removed.", + "docs": ["CannotRemoveVerifiedCreator: Verified creators cannot be removed."] + }, + { + "kind": "errorNode", + "name": "cannotWipeVerifiedCreators", + "code": 95, + "message": "", + "docs": ["CannotWipeVerifiedCreators"] + }, + { + "kind": "errorNode", + "name": "notAllowedToChangeSellerFeeBasisPoints", + "code": 96, + "message": "", + "docs": ["NotAllowedToChangeSellerFeeBasisPoints"] + }, + { + "kind": "errorNode", + "name": "editionOverrideCannotBeZero", + "code": 97, + "message": "Edition override cannot be zero", + "docs": ["EditionOverrideCannotBeZero: Edition override cannot be zero"] + }, + { + "kind": "errorNode", + "name": "invalidUser", + "code": 98, + "message": "Invalid User", + "docs": ["InvalidUser: Invalid User"] + }, + { + "kind": "errorNode", + "name": "revokeCollectionAuthoritySignerIncorrect", + "code": 99, + "message": "Revoke Collection Authority signer is incorrect", + "docs": ["RevokeCollectionAuthoritySignerIncorrect: Revoke Collection Authority signer is incorrect"] + }, + { + "kind": "errorNode", + "name": "tokenCloseFailed", + "code": 100, + "message": "", + "docs": ["TokenCloseFailed"] + }, + { + "kind": "errorNode", + "name": "unsizedCollection", + "code": 101, + "message": "Can't use this function on unsized collection", + "docs": ["UnsizedCollection: Can't use this function on unsized collection"] + }, + { + "kind": "errorNode", + "name": "sizedCollection", + "code": 102, + "message": "Can't use this function on a sized collection", + "docs": ["SizedCollection: Can't use this function on a sized collection"] + }, + { + "kind": "errorNode", + "name": "missingCollectionMetadata", + "code": 103, + "message": "Missing collection metadata account", + "docs": ["MissingCollectionMetadata: Missing collection metadata account"] + }, + { + "kind": "errorNode", + "name": "notAMemberOfCollection", + "code": 104, + "message": "This NFT is not a member of the specified collection.", + "docs": ["NotAMemberOfCollection: This NFT is not a member of the specified collection."] + }, + { + "kind": "errorNode", + "name": "notVerifiedMemberOfCollection", + "code": 105, + "message": "This NFT is not a verified member of the specified collection.", + "docs": [ + "NotVerifiedMemberOfCollection: This NFT is not a verified member of the specified collection." + ] + }, + { + "kind": "errorNode", + "name": "notACollectionParent", + "code": 106, + "message": "This NFT is not a collection parent NFT.", + "docs": ["NotACollectionParent: This NFT is not a collection parent NFT."] + }, + { + "kind": "errorNode", + "name": "couldNotDetermineTokenStandard", + "code": 107, + "message": "Could not determine a TokenStandard type.", + "docs": ["CouldNotDetermineTokenStandard: Could not determine a TokenStandard type."] + }, + { + "kind": "errorNode", + "name": "missingEditionAccount", + "code": 108, + "message": "This mint account has an edition but none was provided.", + "docs": ["MissingEditionAccount: This mint account has an edition but none was provided."] + }, + { + "kind": "errorNode", + "name": "notAMasterEdition", + "code": 109, + "message": "This edition is not a Master Edition", + "docs": ["NotAMasterEdition: This edition is not a Master Edition"] + }, + { + "kind": "errorNode", + "name": "masterEditionHasPrints", + "code": 110, + "message": "This Master Edition has existing prints", + "docs": ["MasterEditionHasPrints: This Master Edition has existing prints"] + }, + { + "kind": "errorNode", + "name": "borshDeserializationError", + "code": 111, + "message": "", + "docs": ["BorshDeserializationError"] + }, + { + "kind": "errorNode", + "name": "cannotUpdateVerifiedCollection", + "code": 112, + "message": "Cannot update a verified collection in this command", + "docs": ["CannotUpdateVerifiedCollection: Cannot update a verified collection in this command"] + }, + { + "kind": "errorNode", + "name": "collectionMasterEditionAccountInvalid", + "code": 113, + "message": "Edition account doesnt match collection ", + "docs": ["CollectionMasterEditionAccountInvalid: Edition account doesnt match collection "] + }, + { + "kind": "errorNode", + "name": "alreadyVerified", + "code": 114, + "message": "Item is already verified.", + "docs": ["AlreadyVerified: Item is already verified."] + }, + { + "kind": "errorNode", + "name": "alreadyUnverified", + "code": 115, + "message": "", + "docs": ["AlreadyUnverified"] + }, + { + "kind": "errorNode", + "name": "notAPrintEdition", + "code": 116, + "message": "This edition is not a Print Edition", + "docs": ["NotAPrintEdition: This edition is not a Print Edition"] + }, + { + "kind": "errorNode", + "name": "invalidMasterEdition", + "code": 117, + "message": "Invalid Master Edition", + "docs": ["InvalidMasterEdition: Invalid Master Edition"] + }, + { + "kind": "errorNode", + "name": "invalidPrintEdition", + "code": 118, + "message": "Invalid Print Edition", + "docs": ["InvalidPrintEdition: Invalid Print Edition"] + }, + { + "kind": "errorNode", + "name": "invalidEditionMarker", + "code": 119, + "message": "Invalid Edition Marker", + "docs": ["InvalidEditionMarker: Invalid Edition Marker"] + }, + { + "kind": "errorNode", + "name": "reservationListDeprecated", + "code": 120, + "message": "Reservation List is Deprecated", + "docs": ["ReservationListDeprecated: Reservation List is Deprecated"] + }, + { + "kind": "errorNode", + "name": "printEditionDoesNotMatchMasterEdition", + "code": 121, + "message": "Print Edition does not match Master Edition", + "docs": ["PrintEditionDoesNotMatchMasterEdition: Print Edition does not match Master Edition"] + }, + { + "kind": "errorNode", + "name": "editionNumberGreaterThanMaxSupply", + "code": 122, + "message": "Edition Number greater than max supply", + "docs": ["EditionNumberGreaterThanMaxSupply: Edition Number greater than max supply"] + }, + { + "kind": "errorNode", + "name": "mustUnverify", + "code": 123, + "message": "Must unverify before migrating collections.", + "docs": ["MustUnverify: Must unverify before migrating collections."] + }, + { + "kind": "errorNode", + "name": "invalidEscrowBumpSeed", + "code": 124, + "message": "Invalid Escrow Account Bump Seed", + "docs": ["InvalidEscrowBumpSeed: Invalid Escrow Account Bump Seed"] + }, + { + "kind": "errorNode", + "name": "mustBeEscrowAuthority", + "code": 125, + "message": "Must Escrow Authority", + "docs": ["MustBeEscrowAuthority: Must Escrow Authority"] + }, + { + "kind": "errorNode", + "name": "invalidSystemProgram", + "code": 126, + "message": "Invalid System Program", + "docs": ["InvalidSystemProgram: Invalid System Program"] + }, + { + "kind": "errorNode", + "name": "mustBeNonFungible", + "code": 127, + "message": "Must be a Non Fungible Token", + "docs": ["MustBeNonFungible: Must be a Non Fungible Token"] + }, + { + "kind": "errorNode", + "name": "insufficientTokens", + "code": 128, + "message": "Insufficient tokens for transfer", + "docs": ["InsufficientTokens: Insufficient tokens for transfer"] + }, + { + "kind": "errorNode", + "name": "borshSerializationError", + "code": 129, + "message": "Borsh Serialization Error", + "docs": ["BorshSerializationError: Borsh Serialization Error"] + }, + { + "kind": "errorNode", + "name": "noFreezeAuthoritySet", + "code": 130, + "message": "Cannot create NFT with no Freeze Authority.", + "docs": ["NoFreezeAuthoritySet: Cannot create NFT with no Freeze Authority."] + }, + { + "kind": "errorNode", + "name": "invalidCollectionSizeChange", + "code": 131, + "message": "Invalid collection size change", + "docs": ["InvalidCollectionSizeChange: Invalid collection size change"] + }, + { + "kind": "errorNode", + "name": "invalidBubblegumSigner", + "code": 132, + "message": "Invalid bubblegum signer", + "docs": ["InvalidBubblegumSigner: Invalid bubblegum signer"] + }, + { + "kind": "errorNode", + "name": "escrowParentHasDelegate", + "code": 133, + "message": "Escrow parent cannot have a delegate", + "docs": ["EscrowParentHasDelegate: Escrow parent cannot have a delegate"] + }, + { + "kind": "errorNode", + "name": "mintIsNotSigner", + "code": 134, + "message": "Mint needs to be signer to initialize the account", + "docs": ["MintIsNotSigner: Mint needs to be signer to initialize the account"] + }, + { + "kind": "errorNode", + "name": "invalidTokenStandard", + "code": 135, + "message": "Invalid token standard", + "docs": ["InvalidTokenStandard: Invalid token standard"] + }, + { + "kind": "errorNode", + "name": "invalidMintForTokenStandard", + "code": 136, + "message": "Invalid mint account for specified token standard", + "docs": ["InvalidMintForTokenStandard: Invalid mint account for specified token standard"] + }, + { + "kind": "errorNode", + "name": "invalidAuthorizationRules", + "code": 137, + "message": "Invalid authorization rules account", + "docs": ["InvalidAuthorizationRules: Invalid authorization rules account"] + }, + { + "kind": "errorNode", + "name": "missingAuthorizationRules", + "code": 138, + "message": "Missing authorization rules account", + "docs": ["MissingAuthorizationRules: Missing authorization rules account"] + }, + { + "kind": "errorNode", + "name": "missingProgrammableConfig", + "code": 139, + "message": "Missing programmable configuration", + "docs": ["MissingProgrammableConfig: Missing programmable configuration"] + }, + { + "kind": "errorNode", + "name": "invalidProgrammableConfig", + "code": 140, + "message": "Invalid programmable configuration", + "docs": ["InvalidProgrammableConfig: Invalid programmable configuration"] + }, + { + "kind": "errorNode", + "name": "delegateAlreadyExists", + "code": 141, + "message": "Delegate already exists", + "docs": ["DelegateAlreadyExists: Delegate already exists"] + }, + { + "kind": "errorNode", + "name": "delegateNotFound", + "code": 142, + "message": "Delegate not found", + "docs": ["DelegateNotFound: Delegate not found"] + }, + { + "kind": "errorNode", + "name": "missingAccountInBuilder", + "code": 143, + "message": "Required account not set in instruction builder", + "docs": ["MissingAccountInBuilder: Required account not set in instruction builder"] + }, + { + "kind": "errorNode", + "name": "missingArgumentInBuilder", + "code": 144, + "message": "Required argument not set in instruction builder", + "docs": ["MissingArgumentInBuilder: Required argument not set in instruction builder"] + }, + { + "kind": "errorNode", + "name": "featureNotSupported", + "code": 145, + "message": "Feature not supported currently", + "docs": ["FeatureNotSupported: Feature not supported currently"] + }, + { + "kind": "errorNode", + "name": "invalidSystemWallet", + "code": 146, + "message": "Invalid system wallet", + "docs": ["InvalidSystemWallet: Invalid system wallet"] + }, + { + "kind": "errorNode", + "name": "onlySaleDelegateCanTransfer", + "code": 147, + "message": "Only the sale delegate can transfer while its set", + "docs": ["OnlySaleDelegateCanTransfer: Only the sale delegate can transfer while its set"] + }, + { + "kind": "errorNode", + "name": "missingTokenAccount", + "code": 148, + "message": "Missing token account", + "docs": ["MissingTokenAccount: Missing token account"] + }, + { + "kind": "errorNode", + "name": "missingSplTokenProgram", + "code": 149, + "message": "Missing SPL token program", + "docs": ["MissingSplTokenProgram: Missing SPL token program"] + }, + { + "kind": "errorNode", + "name": "missingAuthorizationRulesProgram", + "code": 150, + "message": "Missing authorization rules program", + "docs": ["MissingAuthorizationRulesProgram: Missing authorization rules program"] + }, + { + "kind": "errorNode", + "name": "invalidDelegateRoleForTransfer", + "code": 151, + "message": "Invalid delegate role for transfer", + "docs": ["InvalidDelegateRoleForTransfer: Invalid delegate role for transfer"] + }, + { + "kind": "errorNode", + "name": "invalidTransferAuthority", + "code": 152, + "message": "Invalid transfer authority", + "docs": ["InvalidTransferAuthority: Invalid transfer authority"] + }, + { + "kind": "errorNode", + "name": "instructionNotSupported", + "code": 153, + "message": "Instruction not supported for ProgrammableNonFungible assets", + "docs": ["InstructionNotSupported: Instruction not supported for ProgrammableNonFungible assets"] + }, + { + "kind": "errorNode", + "name": "keyMismatch", + "code": 154, + "message": "Public key does not match expected value", + "docs": ["KeyMismatch: Public key does not match expected value"] + }, + { + "kind": "errorNode", + "name": "lockedToken", + "code": 155, + "message": "Token is locked", + "docs": ["LockedToken: Token is locked"] + }, + { + "kind": "errorNode", + "name": "unlockedToken", + "code": 156, + "message": "Token is unlocked", + "docs": ["UnlockedToken: Token is unlocked"] + }, + { + "kind": "errorNode", + "name": "missingDelegateRole", + "code": 157, + "message": "Missing delegate role", + "docs": ["MissingDelegateRole: Missing delegate role"] + }, + { + "kind": "errorNode", + "name": "invalidAuthorityType", + "code": 158, + "message": "Invalid authority type", + "docs": ["InvalidAuthorityType: Invalid authority type"] + }, + { + "kind": "errorNode", + "name": "missingTokenRecord", + "code": 159, + "message": "Missing token record account", + "docs": ["MissingTokenRecord: Missing token record account"] + }, + { + "kind": "errorNode", + "name": "mintSupplyMustBeZero", + "code": 160, + "message": "Mint supply must be zero for programmable assets", + "docs": ["MintSupplyMustBeZero: Mint supply must be zero for programmable assets"] + }, + { + "kind": "errorNode", + "name": "dataIsEmptyOrZeroed", + "code": 161, + "message": "Data is empty or zeroed", + "docs": ["DataIsEmptyOrZeroed: Data is empty or zeroed"] + }, + { + "kind": "errorNode", + "name": "missingTokenOwnerAccount", + "code": 162, + "message": "Missing token owner", + "docs": ["MissingTokenOwnerAccount: Missing token owner"] + }, + { + "kind": "errorNode", + "name": "invalidMasterEditionAccountLength", + "code": 163, + "message": "Master edition account has an invalid length", + "docs": ["InvalidMasterEditionAccountLength: Master edition account has an invalid length"] + }, + { + "kind": "errorNode", + "name": "incorrectTokenState", + "code": 164, + "message": "Incorrect token state", + "docs": ["IncorrectTokenState: Incorrect token state"] + }, + { + "kind": "errorNode", + "name": "invalidDelegateRole", + "code": 165, + "message": "Invalid delegate role", + "docs": ["InvalidDelegateRole: Invalid delegate role"] + }, + { + "kind": "errorNode", + "name": "missingPrintSupply", + "code": 166, + "message": "Print supply is required for non-fungibles", + "docs": ["MissingPrintSupply: Print supply is required for non-fungibles"] + }, + { + "kind": "errorNode", + "name": "missingMasterEditionAccount", + "code": 167, + "message": "Missing master edition account", + "docs": ["MissingMasterEditionAccount: Missing master edition account"] + }, + { + "kind": "errorNode", + "name": "amountMustBeGreaterThanZero", + "code": 168, + "message": "Amount must be greater than zero", + "docs": ["AmountMustBeGreaterThanZero: Amount must be greater than zero"] + }, + { + "kind": "errorNode", + "name": "invalidDelegateArgs", + "code": 169, + "message": "Invalid delegate args", + "docs": ["InvalidDelegateArgs: Invalid delegate args"] + }, + { + "kind": "errorNode", + "name": "missingLockedTransferAddress", + "code": 170, + "message": "Missing address for locked transfer", + "docs": ["MissingLockedTransferAddress: Missing address for locked transfer"] + }, + { + "kind": "errorNode", + "name": "invalidLockedTransferAddress", + "code": 171, + "message": "Invalid destination address for locked transfer", + "docs": ["InvalidLockedTransferAddress: Invalid destination address for locked transfer"] + }, + { + "kind": "errorNode", + "name": "dataIncrementLimitExceeded", + "code": 172, + "message": "Exceeded account realloc increase limit", + "docs": ["DataIncrementLimitExceeded: Exceeded account realloc increase limit"] + }, + { + "kind": "errorNode", + "name": "cannotUpdateAssetWithDelegate", + "code": 173, + "message": "Cannot update the rule set of a programmable asset that has a delegate", + "docs": [ + "CannotUpdateAssetWithDelegate: Cannot update the rule set of a programmable asset that has a delegate" + ] + }, + { + "kind": "errorNode", + "name": "invalidAmount", + "code": 174, + "message": "Invalid token amount for this operation or token standard", + "docs": ["InvalidAmount: Invalid token amount for this operation or token standard"] + }, + { + "kind": "errorNode", + "name": "missingMasterEditionMintAccount", + "code": 175, + "message": "Missing master edition mint account", + "docs": ["MissingMasterEditionMintAccount: Missing master edition mint account"] + }, + { + "kind": "errorNode", + "name": "missingMasterEditionTokenAccount", + "code": 176, + "message": "Missing master edition token account", + "docs": ["MissingMasterEditionTokenAccount: Missing master edition token account"] + }, + { + "kind": "errorNode", + "name": "missingEditionMarkerAccount", + "code": 177, + "message": "Missing edition marker account", + "docs": ["MissingEditionMarkerAccount: Missing edition marker account"] + }, + { + "kind": "errorNode", + "name": "cannotBurnWithDelegate", + "code": 178, + "message": "Cannot burn while persistent delegate is set", + "docs": ["CannotBurnWithDelegate: Cannot burn while persistent delegate is set"] + }, + { + "kind": "errorNode", + "name": "missingEdition", + "code": 179, + "message": "Missing edition account", + "docs": ["MissingEdition: Missing edition account"] + }, + { + "kind": "errorNode", + "name": "invalidAssociatedTokenAccountProgram", + "code": 180, + "message": "Invalid Associated Token Account Program", + "docs": ["InvalidAssociatedTokenAccountProgram: Invalid Associated Token Account Program"] + }, + { + "kind": "errorNode", + "name": "invalidInstructionsSysvar", + "code": 181, + "message": "Invalid InstructionsSysvar", + "docs": ["InvalidInstructionsSysvar: Invalid InstructionsSysvar"] + }, + { + "kind": "errorNode", + "name": "invalidParentAccounts", + "code": 182, + "message": "Invalid or Unneeded parent accounts", + "docs": ["InvalidParentAccounts: Invalid or Unneeded parent accounts"] + }, + { + "kind": "errorNode", + "name": "invalidUpdateArgs", + "code": 183, + "message": "Authority cannot apply all update args", + "docs": ["InvalidUpdateArgs: Authority cannot apply all update args"] + }, + { + "kind": "errorNode", + "name": "insufficientTokenBalance", + "code": 184, + "message": "Token account does not have enough tokens", + "docs": ["InsufficientTokenBalance: Token account does not have enough tokens"] + }, + { + "kind": "errorNode", + "name": "missingCollectionMint", + "code": 185, + "message": "Missing collection account", + "docs": ["MissingCollectionMint: Missing collection account"] + }, + { + "kind": "errorNode", + "name": "missingCollectionMasterEdition", + "code": 186, + "message": "Missing collection master edition account", + "docs": ["MissingCollectionMasterEdition: Missing collection master edition account"] + }, + { + "kind": "errorNode", + "name": "invalidTokenRecord", + "code": 187, + "message": "Invalid token record account", + "docs": ["InvalidTokenRecord: Invalid token record account"] + }, + { + "kind": "errorNode", + "name": "invalidCloseAuthority", + "code": 188, + "message": "The close authority needs to be revoked by the Utility Delegate", + "docs": ["InvalidCloseAuthority: The close authority needs to be revoked by the Utility Delegate"] + }, + { + "kind": "errorNode", + "name": "invalidInstruction", + "code": 189, + "message": "Invalid or removed instruction", + "docs": ["InvalidInstruction: Invalid or removed instruction"] + }, + { + "kind": "errorNode", + "name": "missingDelegateRecord", + "code": 190, + "message": "Missing delegate record", + "docs": ["MissingDelegateRecord: Missing delegate record"] + }, + { + "kind": "errorNode", + "name": "invalidFeeAccount", + "code": 191, + "message": "", + "docs": ["InvalidFeeAccount"] + }, + { + "kind": "errorNode", + "name": "invalidMetadataFlags", + "code": 192, + "message": "", + "docs": ["InvalidMetadataFlags"] + }, + { + "kind": "errorNode", + "name": "cannotChangeUpdateAuthorityWithDelegate", + "code": 193, + "message": "Cannot change the update authority with a delegate", + "docs": ["CannotChangeUpdateAuthorityWithDelegate: Cannot change the update authority with a delegate"] + }, + { + "kind": "errorNode", + "name": "invalidMintExtensionType", + "code": 194, + "message": "Invalid mint extension type", + "docs": ["InvalidMintExtensionType: Invalid mint extension type"] + }, + { + "kind": "errorNode", + "name": "invalidMintCloseAuthority", + "code": 195, + "message": "Invalid mint close authority", + "docs": ["InvalidMintCloseAuthority: Invalid mint close authority"] + }, + { + "kind": "errorNode", + "name": "invalidMetadataPointer", + "code": 196, + "message": "Invalid metadata pointer", + "docs": ["InvalidMetadataPointer: Invalid metadata pointer"] + }, + { + "kind": "errorNode", + "name": "invalidTokenExtensionType", + "code": 197, + "message": "Invalid token extension type", + "docs": ["InvalidTokenExtensionType: Invalid token extension type"] + }, + { + "kind": "errorNode", + "name": "missingImmutableOwnerExtension", + "code": 198, + "message": "Missing immutable owner extension", + "docs": ["MissingImmutableOwnerExtension: Missing immutable owner extension"] + }, + { + "kind": "errorNode", + "name": "expectedUninitializedAccount", + "code": 199, + "message": "Expected account to be uninitialized", + "docs": ["ExpectedUninitializedAccount: Expected account to be uninitialized"] + }, + { + "kind": "errorNode", + "name": "invalidEditionAccountLength", + "code": 200, + "message": "Edition account has an invalid length", + "docs": ["InvalidEditionAccountLength: Edition account has an invalid length"] + }, + { + "kind": "errorNode", + "name": "accountAlreadyResized", + "code": 201, + "message": "Account has already been resized", + "docs": ["AccountAlreadyResized: Account has already been resized"] + }, + { + "kind": "errorNode", + "name": "conditionsForClosingNotMet", + "code": 202, + "message": "Conditions for closing not met", + "docs": ["ConditionsForClosingNotMet: Conditions for closing not met"] + } + ] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/pmp-idl.json b/packages/dynamic-client/test/programs/idls/pmp-idl.json new file mode 100644 index 000000000..ac2962445 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/pmp-idl.json @@ -0,0 +1,1245 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.0.0", + "program": { + "kind": "programNode", + "name": "programMetadata", + "publicKey": "ProgM6JCCvbYkfKqJYHePx4xxSUSqJp7rh8Lyv7nk7S", + "version": "0.0.0", + "pdas": [ + { + "kind": "pdaNode", + "name": "canonical", + "docs": ["The canonical derivation for metadata accounts managed by the program authority itself."], + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "program", + "docs": ["The program to which the metadata belongs."], + "type": { "kind": "publicKeyTypeNode" } + }, + { + "kind": "variablePdaSeedNode", + "name": "seed", + "docs": ["The seed deriving the metadata account."], + "type": { "kind": "definedTypeLinkNode", "name": "seed" } + } + ] + }, + { + "kind": "pdaNode", + "name": "nonCanonical", + "docs": ["The derivation for metadata accounts managed by third-party authorities."], + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "program", + "docs": ["The program to which the metadata belongs."], + "type": { "kind": "publicKeyTypeNode" } + }, + { + "kind": "variablePdaSeedNode", + "name": "authority", + "docs": ["The third-party authority managing this metadata account."], + "type": { "kind": "publicKeyTypeNode" } + }, + { + "kind": "variablePdaSeedNode", + "name": "seed", + "docs": ["The seed deriving the metadata account."], + "type": { "kind": "definedTypeLinkNode", "name": "seed" } + } + ] + }, + { + "kind": "pdaNode", + "name": "metadata", + "docs": [ + "The derivation for metadata accounts, canonical or not, depending if an authority is provided." + ], + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "program", + "docs": ["The program to which the metadata belongs."], + "type": { "kind": "publicKeyTypeNode" } + }, + { + "kind": "variablePdaSeedNode", + "name": "authority", + "docs": ["The third-party authority managing this metadata account, if non-canonical."], + "type": { + "kind": "remainderOptionTypeNode", + "item": { "kind": "publicKeyTypeNode" } + } + }, + { + "kind": "variablePdaSeedNode", + "name": "seed", + "docs": ["The seed deriving the metadata account."], + "type": { "kind": "definedTypeLinkNode", "name": "seed" } + } + ] + } + ], + "accounts": [ + { + "kind": "accountNode", + "name": "buffer", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "accountDiscriminator" + }, + "defaultValue": { + "kind": "enumValueNode", + "enum": { + "kind": "definedTypeLinkNode", + "name": "accountDiscriminator" + }, + "variant": "buffer" + }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "structFieldTypeNode", + "name": "program", + "docs": [], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { "kind": "publicKeyTypeNode" } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { "kind": "publicKeyTypeNode" } + } + }, + { + "kind": "structFieldTypeNode", + "name": "canonical", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "seed", + "docs": [], + "type": { + "kind": "postOffsetTypeNode", + "offset": 14, + "strategy": "padded", + "type": { "kind": "definedTypeLinkNode", "name": "seed" } + } + }, + { + "kind": "structFieldTypeNode", + "name": "data", + "docs": [], + "type": { "kind": "bytesTypeNode" } + } + ] + }, + "pda": { "kind": "pdaLinkNode", "name": "metadata" } + }, + { + "kind": "accountNode", + "name": "metadata", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "accountDiscriminator" + }, + "defaultValue": { + "kind": "enumValueNode", + "enum": { + "kind": "definedTypeLinkNode", + "name": "accountDiscriminator" + }, + "variant": "metadata" + }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "structFieldTypeNode", + "name": "program", + "docs": [], + "type": { "kind": "publicKeyTypeNode" } + }, + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { "kind": "publicKeyTypeNode" } + } + }, + { + "kind": "structFieldTypeNode", + "name": "mutable", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "canonical", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "seed", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "seed" } + }, + { + "kind": "structFieldTypeNode", + "name": "encoding", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "encoding" } + }, + { + "kind": "structFieldTypeNode", + "name": "compression", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "compression" } + }, + { + "kind": "structFieldTypeNode", + "name": "format", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "format" } + }, + { + "kind": "structFieldTypeNode", + "name": "dataSource", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "dataSource" } + }, + { + "kind": "structFieldTypeNode", + "name": "dataLength", + "docs": [], + "type": { + "kind": "postOffsetTypeNode", + "offset": 5, + "strategy": "padded", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "data", + "docs": [], + "type": { "kind": "bytesTypeNode" } + } + ] + }, + "pda": { "kind": "pdaLinkNode", "name": "metadata" } + } + ], + "instructions": [ + { + "kind": "instructionNode", + "name": "write", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "buffer", + "docs": ["The buffer to write to."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["The authority of the buffer."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "sourceBuffer", + "docs": [ + "Buffer to copy the data from.", + "You may use the `data` argument instead of this account to pass data directly." + ], + "isSigner": false, + "isWritable": false, + "isOptional": true + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 0 } + }, + { + "kind": "instructionArgumentNode", + "name": "offset", + "docs": ["The offset to write to."], + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [ + "The data to write at the provided offset.", + "You may use the `source_buffer` account instead of this argument to copy from an existing buffer." + ], + "defaultValue": { "kind": "noneValueNode" }, + "type": { + "kind": "remainderOptionTypeNode", + "item": { "kind": "bytesTypeNode" } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initialize", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "docs": ["Metadata account the initialize."], + "isSigner": false, + "isWritable": true, + "defaultValue": { + "kind": "conditionalValueNode", + "condition": { + "kind": "accountValueNode", + "name": "programData" + }, + "ifTrue": { + "kind": "pdaValueNode", + "pda": { "kind": "pdaLinkNode", "name": "canonical" }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "program", + "value": { "kind": "accountValueNode", "name": "program" } + }, + { + "kind": "pdaSeedValueNode", + "name": "seed", + "value": { "kind": "argumentValueNode", "name": "seed" } + } + ] + }, + "ifFalse": { + "kind": "pdaValueNode", + "pda": { "kind": "pdaLinkNode", "name": "nonCanonical" }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "program", + "value": { "kind": "accountValueNode", "name": "program" } + }, + { + "kind": "pdaSeedValueNode", + "name": "authority", + "value": { "kind": "accountValueNode", "name": "authority" } + }, + { + "kind": "pdaSeedValueNode", + "name": "seed", + "value": { "kind": "argumentValueNode", "name": "seed" } + } + ] + } + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority (for canonical, must match program upgrade authority)."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "system", + "docs": ["System program."], + "isSigner": false, + "isWritable": false, + "isOptional": true, + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 1 } + }, + { + "kind": "instructionArgumentNode", + "name": "seed", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "seed" } + }, + { + "kind": "instructionArgumentNode", + "name": "encoding", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "encoding" } + }, + { + "kind": "instructionArgumentNode", + "name": "compression", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "compression" } + }, + { + "kind": "instructionArgumentNode", + "name": "format", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "format" } + }, + { + "kind": "instructionArgumentNode", + "name": "dataSource", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "dataSource" } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "defaultValue": { "kind": "noneValueNode" }, + "type": { + "kind": "remainderOptionTypeNode", + "item": { "kind": "bytesTypeNode" } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setAuthority", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "docs": ["Metadata or buffer account."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Current authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 2 } + }, + { + "kind": "instructionArgumentNode", + "name": "newAuthority", + "docs": [], + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setData", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "docs": ["Metadata account."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "buffer", + "docs": ["Buffer account to copy data from."], + "isSigner": false, + "isWritable": true, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 3 } + }, + { + "kind": "instructionArgumentNode", + "name": "encoding", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "encoding" } + }, + { + "kind": "instructionArgumentNode", + "name": "compression", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "compression" } + }, + { + "kind": "instructionArgumentNode", + "name": "format", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "format" } + }, + { + "kind": "instructionArgumentNode", + "name": "dataSource", + "docs": [], + "type": { "kind": "definedTypeLinkNode", "name": "dataSource" } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "defaultValue": { "kind": "noneValueNode" }, + "docs": [], + "type": { + "kind": "remainderOptionTypeNode", + "item": { "kind": "bytesTypeNode" } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setImmutable", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "docs": ["Metadata account."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 4 } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "trim", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "docs": ["Buffer or metadata account."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "docs": ["Destination account."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "docs": ["Rent sysvar account."], + "isSigner": false, + "isWritable": false, + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 5 } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "close", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "docs": ["Account to close."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "docs": ["Destination account."], + "isSigner": false, + "isWritable": true + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 6 } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "allocate", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "buffer", + "docs": ["Buffer account to allocate."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "system", + "docs": ["System program."], + "isSigner": false, + "isWritable": false, + "isOptional": true, + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 7 } + }, + { + "kind": "instructionArgumentNode", + "name": "seed", + "docs": ["The seed of the metadata for PDA buffers."], + "defaultValue": { "kind": "noneValueNode" }, + "type": { + "kind": "remainderOptionTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "seed" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "extend", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "docs": ["Buffer or metadata account."], + "isSigner": false, + "isWritable": true + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "docs": ["Authority account."], + "isSigner": true, + "isWritable": false + }, + { + "kind": "instructionAccountNode", + "name": "program", + "docs": ["Program account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + }, + { + "kind": "instructionAccountNode", + "name": "programData", + "docs": ["Program data account."], + "isSigner": false, + "isWritable": false, + "isOptional": true + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValueStrategy": "omitted", + "defaultValue": { "kind": "numberValueNode", "number": 8 } + }, + { + "kind": "instructionArgumentNode", + "name": "length", + "docs": ["Length (in bytes) to add to the account size."], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "seed", + "docs": [], + "type": { + "kind": "fixedSizeTypeNode", + "size": 16, + "type": { "kind": "stringTypeNode", "encoding": "utf8" } + } + }, + { + "kind": "definedTypeNode", + "name": "accountDiscriminator", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "empty" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "buffer" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadata" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "encoding", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "utf8" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "base58" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "base64" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "compression", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "gzip" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "zlib" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "format", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "none" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "json" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "yaml" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "toml" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "dataSource", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "direct" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "url" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "external" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "externalData", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "address", + "docs": [], + "type": { "kind": "publicKeyTypeNode" } + }, + { + "kind": "structFieldTypeNode", + "name": "offset", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "length", + "docs": [], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ] + } + } + ], + "errors": [] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/sas-idl.json b/packages/dynamic-client/test/programs/idls/sas-idl.json new file mode 100644 index 000000000..2ce28098f --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/sas-idl.json @@ -0,0 +1,1742 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.3.7", + "program": { + "kind": "programNode", + "name": "solanaAttestationService", + "publicKey": "22zoJMtdu4tQc2PzL74ZUT7FrwgB1Udec8DdW4yw4BdG", + "version": "0.1.0", + "origin": "shank", + "docs": [], + "accounts": [ + { + "kind": "accountNode", + "name": "attestation", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "nonce", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "credential", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "schema", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "data", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "signer", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "expiry", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "i64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "tokenAccount", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + } + }, + { + "kind": "accountNode", + "name": "credential", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorizedSigners", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "publicKeyTypeNode" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + } + }, + { + "kind": "accountNode", + "name": "schema", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "credential", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "description", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "layout", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "fieldNames", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "isPaused", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "version", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ] + } + } + ], + "instructions": [ + { + "kind": "instructionNode", + "name": "createCredential", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "signers", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "publicKeyTypeNode" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createSchema", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "schema", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "description", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "layout", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "fieldNames", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "changeSchemaStatus", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "schema", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "isPaused", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "changeAuthorizedSigners", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + }, + { + "kind": "instructionArgumentNode", + "name": "signers", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "publicKeyTypeNode" + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "changeSchemaDescription", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "schema", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + }, + { + "kind": "instructionArgumentNode", + "name": "description", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "changeSchemaVersion", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "existingSchema", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "newSchema", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + }, + { + "kind": "instructionArgumentNode", + "name": "layout", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "fieldNames", + "docs": [], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createAttestation", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authorized signer of the Schema's Credential"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "schema", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Schema the Attestation is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "attestation", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + }, + { + "kind": "instructionArgumentNode", + "name": "nonce", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "expiry", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "i64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "closeAttestation", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authorized signer of the Schema's Credential"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "attestation", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "eventAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "attestationProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "tokenizeSchema", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "schema", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Schema Token"] + }, + { + "kind": "instructionAccountNode", + "name": "sasPda", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Program derived address used as program signer authority"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 9 + } + }, + { + "kind": "instructionArgumentNode", + "name": "maxSize", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "createTokenizedAttestation", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authorized signer of the Schema's Credential"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Credential the Schema is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "schema", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Schema the Attestation is associated with"] + }, + { + "kind": "instructionAccountNode", + "name": "attestation", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "schemaMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Schema Token"] + }, + { + "kind": "instructionAccountNode", + "name": "attestationMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Attestation Token"] + }, + { + "kind": "instructionAccountNode", + "name": "sasPda", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Program derived address used as program signer authority"] + }, + { + "kind": "instructionAccountNode", + "name": "recipientTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Associated token account of Recipient for Attestation Token"] + }, + { + "kind": "instructionAccountNode", + "name": "recipient", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet to receive Attestation Token"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + }, + { + "kind": "instructionAccountNode", + "name": "associatedTokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 10 + } + }, + { + "kind": "instructionArgumentNode", + "name": "nonce", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "data", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "expiry", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "i64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "uri", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "symbol", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintAccountSpace", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "closeTokenizedAttestation", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "payerValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authorized signer of the Schema's Credential"], + "defaultValue": { + "kind": "identityValueNode" + } + }, + { + "kind": "instructionAccountNode", + "name": "credential", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "attestation", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "eventAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111", + "identifier": "splSystem" + } + }, + { + "kind": "instructionAccountNode", + "name": "attestationProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "attestationMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Mint of Attestation Token"] + }, + { + "kind": "instructionAccountNode", + "name": "sasPda", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Program derived address used as program signer authority"] + }, + { + "kind": "instructionAccountNode", + "name": "attestationTokenAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Associated token account of the related Attestation Token"] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "identifier": "splToken" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "emitEvent", + "docs": [], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "eventAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 228 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "closeAttestationEvent", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "discriminator", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "schema", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "attestationData", + "docs": [], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "bytesTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ] + } + } + ], + "pdas": [], + "errors": [] + }, + "additionalPrograms": [] +} diff --git a/packages/dynamic-client/test/programs/idls/system-program-idl.json b/packages/dynamic-client/test/programs/idls/system-program-idl.json new file mode 100644 index 000000000..44b5c4871 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/system-program-idl.json @@ -0,0 +1,1042 @@ +{ + "kind": "rootNode", + "program": { + "kind": "programNode", + "pdas": [], + "accounts": [ + { + "kind": "accountNode", + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "version", + "type": { "kind": "definedTypeLinkNode", "name": "nonceVersion" }, + "docs": [] + }, + { + "kind": "structFieldTypeNode", + "name": "state", + "type": { "kind": "definedTypeLinkNode", "name": "nonceState" }, + "docs": [] + }, + { + "kind": "structFieldTypeNode", + "name": "authority", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + }, + { + "kind": "structFieldTypeNode", + "name": "blockhash", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + }, + { + "kind": "structFieldTypeNode", + "name": "lamportsPerSignature", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + } + ] + }, + "name": "nonce", + "idlName": "Nonce", + "docs": [], + "size": 80 + } + ], + "instructions": [ + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { "kind": "payerValueNode" } + }, + { + "kind": "instructionAccountNode", + "name": "newAccount", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 0 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "lamports", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "space", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "programAddress", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "byteDeltas": [ + { + "kind": "instructionByteDeltaNode", + "value": { "kind": "argumentValueNode", "name": "space" }, + "withHeader": true + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "createAccount", + "idlName": "CreateAccount", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 1 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "programAddress", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "assign", + "idlName": "Assign", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 2 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "transferSol", + "idlName": "TransferSol", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [], + "defaultValue": { "kind": "payerValueNode" } + }, + { + "kind": "instructionAccountNode", + "name": "newAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "baseAccount", + "isWritable": false, + "isSigner": true, + "isOptional": true, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 3 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "base", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "seed", + "type": { + "kind": "sizePrefixTypeNode", + "type": { "kind": "stringTypeNode", "encoding": "utf8" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "space", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "programAddress", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "createAccountWithSeed", + "idlName": "CreateAccountWithSeed", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nonceAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "recentBlockhashesSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRecentB1ockHashes11111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "nonceAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 4 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "advanceNonceAccount", + "idlName": "AdvanceNonceAccount", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nonceAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "recipientAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "recentBlockhashesSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRecentB1ockHashes11111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "rentSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "nonceAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 5 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "withdrawAmount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "withdrawNonceAccount", + "idlName": "WithdrawNonceAccount", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nonceAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "recentBlockhashesSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRecentB1ockHashes11111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "rentSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 6 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "nonceAuthority", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeNonceAccount", + "idlName": "InitializeNonceAccount", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nonceAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "nonceAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 7 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "newNonceAuthority", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "authorizeNonceAccount", + "idlName": "AuthorizeNonceAccount", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "newAccount", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 8 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "space", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "allocate", + "idlName": "Allocate", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "newAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "baseAccount", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 9 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "base", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "seed", + "type": { + "kind": "sizePrefixTypeNode", + "type": { "kind": "stringTypeNode", "encoding": "utf8" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "space", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "programAddress", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "allocateWithSeed", + "idlName": "AllocateWithSeed", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "baseAccount", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 10 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "base", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "seed", + "type": { + "kind": "sizePrefixTypeNode", + "type": { "kind": "stringTypeNode", "encoding": "utf8" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "programAddress", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "assignWithSeed", + "idlName": "AssignWithSeed", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "baseAccount", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 11 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "fromSeed", + "type": { + "kind": "sizePrefixTypeNode", + "type": { "kind": "stringTypeNode", "encoding": "utf8" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + "docs": [] + }, + { + "kind": "instructionArgumentNode", + "name": "fromOwner", + "type": { "kind": "publicKeyTypeNode" }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "transferSolWithSeed", + "idlName": "TransferSolWithSeed", + "docs": [], + "optionalAccountStrategy": "omitted" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nonceAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 12 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "upgradeNonceAccount", + "idlName": "UpgradeNonceAccount", + "docs": [], + "optionalAccountStrategy": "omitted" + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "nonceVersion", + "type": { + "kind": "enumTypeNode", + "variants": [ + { "kind": "enumEmptyVariantTypeNode", "name": "legacy" }, + { "kind": "enumEmptyVariantTypeNode", "name": "current" } + ], + "size": { "kind": "numberTypeNode", "format": "u32", "endian": "le" } + }, + "idlName": "NonceVersion", + "docs": [] + }, + { + "kind": "definedTypeNode", + "name": "nonceState", + "type": { + "kind": "enumTypeNode", + "variants": [ + { "kind": "enumEmptyVariantTypeNode", "name": "uninitialized" }, + { "kind": "enumEmptyVariantTypeNode", "name": "initialized" } + ], + "size": { "kind": "numberTypeNode", "format": "u32", "endian": "le" } + }, + "idlName": "NonceState", + "docs": [] + } + ], + "errors": [ + { + "kind": "errorNode", + "name": "accountAlreadyInUse", + "idlName": "AccountAlreadyInUse", + "code": 0, + "message": "an account with the same address already exists", + "docs": ["AccountAlreadyInUse: an account with the same address already exists"] + }, + { + "kind": "errorNode", + "name": "resultWithNegativeLamports", + "idlName": "ResultWithNegativeLamports", + "code": 1, + "message": "account does not have enough SOL to perform the operation", + "docs": ["ResultWithNegativeLamports: account does not have enough SOL to perform the operation"] + }, + { + "kind": "errorNode", + "name": "invalidProgramId", + "idlName": "InvalidProgramId", + "code": 2, + "message": "cannot assign account to this program id", + "docs": ["InvalidProgramId: cannot assign account to this program id"] + }, + { + "kind": "errorNode", + "name": "invalidAccountDataLength", + "idlName": "InvalidAccountDataLength", + "code": 3, + "message": "cannot allocate account data of this length", + "docs": ["InvalidAccountDataLength: cannot allocate account data of this length"] + }, + { + "kind": "errorNode", + "name": "maxSeedLengthExceeded", + "idlName": "MaxSeedLengthExceeded", + "code": 4, + "message": "length of requested seed is too long", + "docs": ["MaxSeedLengthExceeded: length of requested seed is too long"] + }, + { + "kind": "errorNode", + "name": "addressWithSeedMismatch", + "idlName": "AddressWithSeedMismatch", + "code": 5, + "message": "provided address does not match addressed derived from seed", + "docs": ["AddressWithSeedMismatch: provided address does not match addressed derived from seed"] + }, + { + "kind": "errorNode", + "name": "nonceNoRecentBlockhashes", + "idlName": "NonceNoRecentBlockhashes", + "code": 6, + "message": "advancing stored nonce requires a populated RecentBlockhashes sysvar", + "docs": [ + "NonceNoRecentBlockhashes: advancing stored nonce requires a populated RecentBlockhashes sysvar" + ] + }, + { + "kind": "errorNode", + "name": "nonceBlockhashNotExpired", + "idlName": "NonceBlockhashNotExpired", + "code": 7, + "message": "stored nonce is still in recent_blockhashes", + "docs": ["NonceBlockhashNotExpired: stored nonce is still in recent_blockhashes"] + }, + { + "kind": "errorNode", + "name": "nonceUnexpectedBlockhashValue", + "idlName": "NonceUnexpectedBlockhashValue", + "code": 8, + "message": "specified nonce does not match stored nonce", + "docs": ["NonceUnexpectedBlockhashValue: specified nonce does not match stored nonce"] + } + ], + "name": "system", + "prefix": "", + "publicKey": "11111111111111111111111111111111", + "version": "0.0.1", + "origin": "shank" + }, + "additionalPrograms": [], + "standard": "codama", + "version": "1.0.0" +} diff --git a/packages/dynamic-client/test/programs/idls/token-2022-idl.json b/packages/dynamic-client/test/programs/idls/token-2022-idl.json new file mode 100644 index 000000000..cf4a2a5c9 --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/token-2022-idl.json @@ -0,0 +1,10994 @@ +{ + "kind": "rootNode", + "standard": "codama", + "version": "1.0.0", + "program": { + "kind": "programNode", + "name": "token-2022", + "publicKey": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", + "version": "3.0.2", + "origin": "shank", + "docs": [], + "accounts": [ + { + "kind": "accountNode", + "name": "mint", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "mintAuthority", + "docs": [ + "Optional authority used to mint new tokens. The mint authority may only", + "be provided during mint creation. If no mint authority is present", + "then the mint has a fixed supply and no further tokens may be minted." + ], + "type": { + "kind": "optionTypeNode", + "fixed": true, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "supply", + "docs": ["Total supply of tokens."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "decimals", + "docs": ["Number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "isInitialized", + "docs": ["Is `true` if this structure has been initialized."], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "freezeAuthority", + "docs": ["Optional authority to freeze token accounts."], + "type": { + "kind": "optionTypeNode", + "fixed": true, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "extensions", + "docs": ["The extensions activated on the mint account."], + "type": { + "kind": "remainderOptionTypeNode", + "item": { + "kind": "hiddenPrefixTypeNode", + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "extension" + }, + "count": { + "kind": "remainderCountNode" + } + }, + "prefix": [ + { + "kind": "constantValueNode", + "type": { + "kind": "preOffsetTypeNode", + "offset": 83, + "strategy": "padded", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "value": { + "kind": "numberValueNode", + "number": 1 + } + } + ] + } + } + } + ] + }, + "discriminators": [ + { + "kind": "sizeDiscriminatorNode", + "size": 82 + } + ] + }, + { + "kind": "accountNode", + "name": "token", + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": ["The mint associated with this account."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "owner", + "docs": ["The owner of this account."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "amount", + "docs": ["The amount of tokens this account holds."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "delegate", + "docs": [ + "If `delegate` is `Some` then `delegated_amount` represents", + "the amount authorized by the delegate." + ], + "type": { + "kind": "optionTypeNode", + "fixed": true, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "state", + "docs": ["The account's state."], + "type": { + "kind": "definedTypeLinkNode", + "name": "accountState" + } + }, + { + "kind": "structFieldTypeNode", + "name": "isNative", + "docs": [ + "If is_native.is_some, this is a native token, and the value logs the", + "rent-exempt reserve. An Account is required to be rent-exempt, so", + "the value is used by the Processor to ensure that wrapped SOL", + "accounts do not drop below this threshold." + ], + "type": { + "kind": "optionTypeNode", + "fixed": true, + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "delegatedAmount", + "docs": ["The amount delegated."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "closeAuthority", + "docs": ["Optional authority to close the account."], + "type": { + "kind": "optionTypeNode", + "fixed": true, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "extensions", + "docs": ["The extensions activated on the token account."], + "type": { + "kind": "remainderOptionTypeNode", + "item": { + "kind": "hiddenPrefixTypeNode", + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "extension" + }, + "count": { + "kind": "remainderCountNode" + } + }, + "prefix": [ + { + "kind": "constantValueNode", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "value": { + "kind": "numberValueNode", + "number": 2 + } + } + ] + } + } + } + ] + }, + "discriminators": [ + { + "kind": "sizeDiscriminatorNode", + "size": 165 + } + ] + }, + { + "kind": "accountNode", + "name": "multisig", + "size": 355, + "docs": [], + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "m", + "docs": ["Number of signers required."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "n", + "docs": ["Number of valid signers."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "isInitialized", + "docs": ["Is `true` if this structure has been initialized."], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "signers", + "docs": ["Signer public keys."], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "publicKeyTypeNode" + }, + "count": { + "kind": "fixedCountNode", + "value": 11 + } + } + } + ] + }, + "discriminators": [ + { + "kind": "sizeDiscriminatorNode", + "size": 355 + } + ] + } + ], + "instructions": [ + { + "kind": "instructionNode", + "name": "initializeMint", + "docs": [ + "Initializes a new mint and optionally deposits all the newly minted", + "tokens in an account.", + "", + "The `InitializeMint` instruction requires no signers and MUST be", + "included within the same Transaction as the system program's", + "`CreateAccount` instruction that creates the account being initialized.", + "Otherwise another party can acquire ownership of the uninitialized account." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint account."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Number of decimals in token account amounts."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintAuthority", + "docs": ["Minting authority."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "freezeAuthority", + "docs": ["Optional authority that can freeze token accounts."], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeAccount", + "docs": [ + "Initializes a new account to hold tokens. If this account is associated", + "with the native mint then the token balance of the initialized account", + "will be equal to the amount of SOL in the account. If this account is", + "associated with another mint, that mint must be initialized before this", + "command can succeed.", + "", + "The `InitializeAccount` instruction requires no signers and MUST be", + "included within the same Transaction as the system program's", + "`CreateAccount` instruction that creates the account being initialized.", + "Otherwise another party can acquire ownership of the uninitialized account." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint this account will be associated with."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The new account's owner/multisignature."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeMultisig", + "docs": [ + "Initializes a multisignature account with N provided signers.", + "", + "Multisignature accounts can used in place of any single owner/delegate", + "accounts in any token instruction that require an owner/delegate to be", + "present. The variant field represents the number of signers (M)", + "required to validate this multisignature account.", + "", + "The `InitializeMultisig` instruction requires no signers and MUST be", + "included within the same Transaction as the system program's", + "`CreateAccount` instruction that creates the account being initialized.", + "Otherwise another party can acquire ownership of the uninitialized account." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "multisig", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The multisignature account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "m", + "docs": ["The number of signers (M) required to validate this multisignature account."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "signers" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "transfer", + "docs": [ + "Transfers tokens from one account to another either directly or via a delegate.", + "If this account is associated with the native mint then equal amounts", + "of SOL and Tokens will be transferred to the destination account." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to transfer."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "approve", + "docs": [ + "Approves a delegate. A delegate is given the authority over tokens on", + "behalf of the source account's owner." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The delegate."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens the delegate is approved for."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "revoke", + "docs": ["Revokes the delegate's authority."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account owner or its multisignature."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "setAuthority", + "docs": ["Sets a new authority of a mint or account."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "owned", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint or account to change the authority of."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": [ + "The current authority or the multisignature account of the mint or account to update." + ] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authorityType", + "docs": ["The type of authority to update."], + "type": { + "kind": "definedTypeLinkNode", + "name": "authorityType" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newAuthority", + "docs": ["The new authority"], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "mintTo", + "docs": ["Mints new tokens to an account. The native mint does not support minting."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint account."] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to mint tokens to."] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's minting authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of new tokens to mint."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "burn", + "docs": [ + "Burns tokens by removing them from an account. `Burn` does not support", + "accounts associated with the native mint, use `CloseAccount` instead." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to burn from."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": ["The amount of tokens to burn."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "closeAccount", + "docs": [ + "Close an account by transferring all its SOL to the destination account.", + "Non-native accounts may only be closed if its token amount is zero." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to close."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 9 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "freezeAccount", + "docs": ["Freeze an Initialized account using the Mint's freeze_authority (if set)."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to freeze."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint freeze authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 10 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "thawAccount", + "docs": ["Thaw a Frozen account using the Mint's freeze_authority (if set)."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to thaw."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint freeze authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "transferChecked", + "docs": [ + "Transfers tokens from one account to another either directly or via a", + "delegate. If this account is associated with the native mint then equal", + "amounts of SOL and Tokens will be transferred to the destination account.", + "", + "This instruction differs from Transfer in that the token mint and", + "decimals value is checked by the caller. This may be useful when", + "creating transactions offline or within a hardware wallet." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 12 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to transfer."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "approveChecked", + "docs": [ + "Approves a delegate. A delegate is given the authority over tokens on", + "behalf of the source account's owner.", + "", + "This instruction differs from Approve in that the token mint and", + "decimals value is checked by the caller. This may be useful when", + "creating transactions offline or within a hardware wallet." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The delegate."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 13 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens the delegate is approved for."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "mintToChecked", + "docs": [ + "Mints new tokens to an account. The native mint does not support minting.", + "", + "This instruction differs from MintTo in that the decimals value is", + "checked by the caller. This may be useful when creating transactions", + "offline or within a hardware wallet." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to mint tokens to."] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's minting authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 14 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of new tokens to mint."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "burnChecked", + "docs": [ + "Burns tokens by removing them from an account. `BurnChecked` does not", + "support accounts associated with the native mint, use `CloseAccount` instead.", + "", + "This instruction differs from Burn in that the decimals value is checked", + "by the caller. This may be useful when creating transactions offline or", + "within a hardware wallet." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to burn from."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 15 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to burn."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeAccount2", + "docs": [ + "Like InitializeAccount, but the owner pubkey is passed via instruction", + "data rather than the accounts list. This variant may be preferable", + "when using Cross Program Invocation from an instruction that does", + "not need the owner's `AccountInfo` otherwise." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint this account will be associated with."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 16 + } + }, + { + "kind": "instructionArgumentNode", + "name": "owner", + "docs": ["The new account's owner/multisignature."], + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "syncNative", + "docs": [ + "Given a wrapped / native token account (a token account containing SOL)", + "updates its amount field based on the account's underlying `lamports`.", + "This is useful if a non-wrapped SOL account uses", + "`system_instruction::transfer` to move lamports to a wrapped token", + "account, and needs to have its token `amount` field updated." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The native token account to sync with its underlying lamports."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 17 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeAccount3", + "docs": ["Like InitializeAccount2, but does not require the Rent sysvar to be provided."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint this account will be associated with."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 18 + } + }, + { + "kind": "instructionArgumentNode", + "name": "owner", + "docs": ["The new account's owner/multisignature."], + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeMultisig2", + "docs": ["Like InitializeMultisig, but does not require the Rent sysvar to be provided."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "multisig", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The multisignature account to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 19 + } + }, + { + "kind": "instructionArgumentNode", + "name": "m", + "docs": ["The number of signers (M) required to validate this multisignature account."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "signers" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeMint2", + "docs": ["Like [`InitializeMint`], but does not require the Rent sysvar to be provided."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 20 + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "mintAuthority", + "docs": ["The authority/multisignature to mint tokens."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "freezeAuthority", + "docs": ["The optional freeze authority/multisignature of the mint."], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "getAccountDataSize", + "docs": [ + "Gets the required size of an account for the given mint as a", + "little-endian `u64`.", + "", + "Return data can be fetched using `sol_get_return_data` and deserializing", + "the return data as a little-endian `u64`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to calculate for."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 21 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeImmutableOwner", + "docs": [ + "Initialize the Immutable Owner extension for the given token account", + "", + "Fails if the account has already been initialized, so must be called", + "before `InitializeAccount`.", + "", + "No-ops in this version of the program, but is included for compatibility", + "with the Associated Token Account program." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 22 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "amountToUiAmount", + "docs": [ + "Convert an Amount of tokens to a UiAmount `string`, using the given", + "mint. In this version of the program, the mint can only specify the", + "number of decimals.", + "", + "Fails on an invalid mint.", + "", + "Return data can be fetched using `sol_get_return_data` and deserialized", + "with `String::from_utf8`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to calculate for."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 23 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to reformat."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "uiAmountToAmount", + "docs": [ + "Convert a UiAmount of tokens to a little-endian `u64` raw Amount, using", + "the given mint. In this version of the program, the mint can only", + "specify the number of decimals.", + "", + "Return data can be fetched using `sol_get_return_data` and deserializing", + "the return data as a little-endian `u64`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to calculate for."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 24 + } + }, + { + "kind": "instructionArgumentNode", + "name": "uiAmount", + "docs": ["The ui_amount of tokens to reformat."], + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeMintCloseAuthority", + "docs": [ + "Initialize the close account authority on a new mint.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 25 + } + }, + { + "kind": "instructionArgumentNode", + "name": "closeAuthority", + "docs": ["Authority that must sign the `CloseAccount` instruction on a mint."], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeTransferFeeConfig", + "docs": [ + "Initialize the transfer fee on a new mint.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeConfigAuthority", + "docs": ["Pubkey that may update the fees."], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "withdrawWithheldAuthority", + "docs": ["Withdraw instructions must be signed by this key."], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "publicKeyTypeNode" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeBasisPoints", + "docs": [ + "Amount of transfer collected as fees, expressed as basis points of the transfer amount." + ], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "maximumFee", + "docs": ["Maximum fee assessed on transfers."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "transferCheckedWithFee", + "docs": [ + "Transfer, providing expected mint information and fees.", + "", + "This instruction succeeds if the mint has no configured transfer fee", + "and the provided fee is 0. This allows applications to use", + "`TransferCheckedWithFee` with any mint." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account. May include the `TransferFeeAmount` extension."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint. May include the `TransferFeeConfig` extension."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account. May include the `TransferFeeAmount` extension."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to transfer."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "fee", + "docs": [ + "Expected fee assessed on this transfer, calculated off-chain based", + "on the transfer_fee_basis_points and maximum_fee of the mint. May", + "be 0 for a mint without a configured transfer fee." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "withdrawWithheldTokensFromMint", + "docs": [ + "Transfer all withheld tokens in the mint to an account. Signed by the", + "mint's withdraw withheld tokens authority." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint. Must include the `TransferFeeConfig` extension."] + }, + { + "kind": "instructionAccountNode", + "name": "feeReceiver", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "The fee receiver account. Must include the `TransferFeeAmount`", + "extension associated with the provided mint." + ] + }, + { + "kind": "instructionAccountNode", + "name": "withdrawWithheldAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's `withdraw_withheld_authority` or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "withdrawWithheldTokensFromAccounts", + "docs": [ + "Transfer all withheld tokens to an account. Signed by the mint's", + "withdraw withheld tokens authority." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint. Must include the `TransferFeeConfig` extension."] + }, + { + "kind": "instructionAccountNode", + "name": "feeReceiver", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "The fee receiver account. Must include the `TransferFeeAmount`", + "extension associated with the provided mint." + ] + }, + { + "kind": "instructionAccountNode", + "name": "withdrawWithheldAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's `withdraw_withheld_authority` or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + }, + { + "kind": "instructionArgumentNode", + "name": "numTokenAccounts", + "docs": ["Number of token accounts harvested."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + }, + { + "kind": "instructionRemainingAccountsNode", + "isOptional": false, + "isWritable": true, + "isSigner": false, + "docs": ["The source accounts to withdraw from."], + "value": { + "kind": "argumentValueNode", + "name": "sources" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "harvestWithheldTokensToMint", + "docs": [ + "Permissionless instruction to transfer all withheld tokens to the mint.", + "", + "Succeeds for frozen accounts.", + "", + "Accounts provided should include the `TransferFeeAmount` extension.", + "If not, the account is skipped." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": false, + "isWritable": true, + "isSigner": false, + "docs": ["The source accounts to harvest from."], + "value": { + "kind": "argumentValueNode", + "name": "sources" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "setTransferFee", + "docs": [ + "Set transfer fee. Only supported for mints that include the", + "`TransferFeeConfig` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "transferFeeConfigAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's fee account owner or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 26 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferFeeBasisPoints", + "docs": [ + "Amount of transfer collected as fees, expressed as basis points of the transfer amount." + ], + "type": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "maximumFee", + "docs": ["Maximum fee assessed on transfers."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeConfidentialTransferMint", + "docs": [ + "Initializes confidential transfers for a mint.", + "", + "The `ConfidentialTransferInstruction::InitializeMint` instruction", + "requires no signers and MUST be included within the same Transaction", + "as `TokenInstruction::InitializeMint`. Otherwise another party can", + "initialize the configuration.", + "", + "The instruction fails if the `TokenInstruction::InitializeMint`", + "instruction has already executed for the mint." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": [ + "Authority to modify the `ConfidentialTransferMint` configuration and to", + "approve new accounts." + ], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "autoApproveNewAccounts", + "docs": [ + "Determines if newly configured accounts must be approved by the", + "`authority` before they may be used by the user." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "auditorElgamalPubkey", + "docs": ["New authority to decode any transfer amount in a confidential transfer."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateConfidentialTransferMint", + "docs": [ + "Updates the confidential transfer mint configuration for a mint.", + "", + "Use `TokenInstruction::SetAuthority` to update the confidential transfer", + "mint authority." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Confidential transfer mint authority."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "autoApproveNewAccounts", + "docs": [ + "Determines if newly configured accounts must be approved by the", + "`authority` before they may be used by the user." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "auditorElgamalPubkey", + "docs": ["New authority to decode any transfer amount in a confidential transfer."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "configureConfidentialTransferAccount", + "docs": [ + "Configures confidential transfers for a token account.", + "", + "The instruction fails if the confidential transfers are already", + "configured, or if the mint was not initialized with confidential", + "transfer support.", + "", + "The instruction fails if the `TokenInstruction::InitializeAccount`", + "instruction has not yet successfully executed for the token account.", + "", + "Upon success, confidential and non-confidential deposits and transfers", + "are enabled. Use the `DisableConfidentialCredits` and", + "`DisableNonConfidentialCredits` instructions to disable.", + "", + "In order for this instruction to be successfully processed, it must be", + "accompanied by the `VerifyPubkeyValidity` instruction of the", + "`zk_elgamal_proof` program in the same transaction or the address of a", + "context state account for the proof must be provided." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The corresponding SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvarOrContextState", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [ + "Instructions sysvar if `VerifyPubkeyValidity` is included in", + "the same transaction or context state account if", + "`VerifyPubkeyValidity` is pre-verified into a context state", + "account." + ], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "record", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "(Optional) Record account if the accompanying proof is to be read from a record account." + ] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "decryptableZeroBalance", + "docs": ["The decryptable balance (always 0) once the configure account succeeds."], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + }, + { + "kind": "instructionArgumentNode", + "name": "maximumPendingBalanceCreditCounter", + "docs": [ + "The maximum number of despots and transfers that an account can receiver", + "before the `ApplyPendingBalance` is executed" + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "proofInstructionOffset", + "docs": [ + "Relative location of the `ProofInstruction::ZeroCiphertextProof`", + "instruction to the `ConfigureAccount` instruction in the", + "transaction. If the offset is `0`, then use a context state account", + "for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "approveConfidentialTransferAccount", + "docs": [ + "Approves a token account for confidential transfers.", + "", + "Approval is only required when the", + "`ConfidentialTransferMint::approve_new_accounts` field is set in the", + "SPL Token mint. This instruction must be executed after the account", + "owner configures their account for confidential transfers with", + "`ConfidentialTransferInstruction::ConfigureAccount`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account to approve."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The corresponding SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Confidential transfer mint authority."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "emptyConfidentialTransferAccount", + "docs": [ + "Empty the available balance in a confidential token account.", + "", + "A token account that is extended for confidential transfers can only be", + "closed if the pending and available balance ciphertexts are emptied.", + "The pending balance can be emptied", + "via the `ConfidentialTransferInstruction::ApplyPendingBalance`", + "instruction. Use the `ConfidentialTransferInstruction::EmptyAccount`", + "instruction to empty the available balance ciphertext.", + "", + "Note that a newly configured account is always empty, so this", + "instruction is not required prior to account closing if no", + "instructions beyond", + "`ConfidentialTransferInstruction::ConfigureAccount` have affected the", + "token account.", + "", + "In order for this instruction to be successfully processed, it must be", + "accompanied by the `VerifyZeroCiphertext` instruction of the", + "`zk_elgamal_proof` program in the same transaction or the address of a", + "context state account for the proof must be provided." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvarOrContextState", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [ + "Instructions sysvar if `VerifyZeroCiphertext` is included in", + "the same transaction or context state account if", + "`VerifyZeroCiphertext` is pre-verified into a context state", + "account." + ], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "Sysvar1nstructions1111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "record", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "(Optional) Record account if the accompanying proof is to be read from a record account." + ] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + }, + { + "kind": "instructionArgumentNode", + "name": "proofInstructionOffset", + "docs": [ + "Relative location of the `ProofInstruction::VerifyCloseAccount`", + "instruction to the `EmptyAccount` instruction in the transaction. If", + "the offset is `0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "confidentialDeposit", + "docs": [ + "Deposit SPL Tokens into the pending balance of a confidential token", + "account.", + "", + "The account owner can then invoke the `ApplyPendingBalance` instruction", + "to roll the deposit into their available balance at a time of their", + "choosing.", + "", + "Fails if the source or destination accounts are frozen.", + "Fails if the associated mint is extended as `NonTransferable`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The corresponding SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to deposit."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "confidentialWithdraw", + "docs": [ + "Withdraw SPL Tokens from the available balance of a confidential token", + "account.", + "", + "In order for this instruction to be successfully processed, it must be", + "accompanied by the following list of `zk_elgamal_proof` program", + "instructions:", + "- `VerifyCiphertextCommitmentEquality`", + "- `VerifyBatchedRangeProofU64`", + "These instructions can be accompanied in the same transaction or can be", + "pre-verified into a context state account, in which case, only their", + "context state account address need to be provided.", + "", + "Fails if the source or destination accounts are frozen.", + "Fails if the associated mint is extended as `NonTransferable`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The corresponding SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "Instructions sysvar if at least one of the", + "`zk_elgamal_proof` instructions are included in the same", + "transaction." + ] + }, + { + "kind": "instructionAccountNode", + "name": "equalityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Equality proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "rangeRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Range proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to withdraw."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newDecryptableAvailableBalance", + "docs": ["The new decryptable balance if the withdrawal succeeds."], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + }, + { + "kind": "instructionArgumentNode", + "name": "equalityProofInstructionOffset", + "docs": [ + "Relative location of the", + "`ProofInstruction::VerifyCiphertextCommitmentEquality` instruction", + "to the `Withdraw` instruction in the transaction. If the offset is", + "`0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "rangeProofInstructionOffset", + "docs": [ + "Relative location of the `ProofInstruction::BatchedRangeProofU64`", + "instruction to the `Withdraw` instruction in the transaction. If the", + "offset is `0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "confidentialTransfer", + "docs": [ + "Transfer tokens confidentially.", + "", + "In order for this instruction to be successfully processed, it must be", + "accompanied by the following list of `zk_elgamal_proof` program", + "instructions:", + "- `VerifyCiphertextCommitmentEquality`", + "- `VerifyBatchedGroupedCiphertext3HandlesValidity`", + "- `VerifyBatchedRangeProofU128`", + "These instructions can be accompanied in the same transaction or can be", + "pre-verified into a context state account, in which case, only their", + "context state account addresses need to be provided.", + "", + "Fails if the associated mint is extended as `NonTransferable`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "sourceToken", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The corresponding SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "destinationToken", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "(Optional) Instructions sysvar if at least one of the", + "`zk_elgamal_proof` instructions are included in the same", + "transaction." + ] + }, + { + "kind": "instructionAccountNode", + "name": "equalityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Equality proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "ciphertextValidityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Ciphertext validity proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "rangeRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Range proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + } + }, + { + "kind": "instructionArgumentNode", + "name": "newSourceDecryptableAvailableBalance", + "docs": ["The new source decryptable balance if the transfer succeeds."], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + }, + { + "kind": "instructionArgumentNode", + "name": "equalityProofInstructionOffset", + "docs": [ + "Relative location of the", + "`ProofInstruction::VerifyCiphertextCommitmentEquality` instruction", + "to the `Transfer` instruction in the transaction. If the offset is", + "`0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "ciphertextValidityProofInstructionOffset", + "docs": [ + "Relative location of the", + "`ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity`", + "instruction to the `Transfer` instruction in the transaction. If the", + "offset is `0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "rangeProofInstructionOffset", + "docs": [ + "Relative location of the `ProofInstruction::BatchedRangeProofU128Data`", + "instruction to the `Transfer` instruction in the transaction. If the", + "offset is `0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "applyConfidentialPendingBalance", + "docs": [ + "Applies the pending balance to the available balance, based on the", + "history of `Deposit` and/or `Transfer` instructions.", + "", + "After submitting `ApplyPendingBalance`, the client should compare", + "`ConfidentialTransferAccount::expected_pending_balance_credit_counter`", + "with", + "`ConfidentialTransferAccount::actual_applied_pending_balance_instructions`. If they are", + "equal then the", + "`ConfidentialTransferAccount::decryptable_available_balance` is", + "consistent with `ConfidentialTransferAccount::available_balance`. If", + "they differ then there is more pending balance to be applied." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + } + }, + { + "kind": "instructionArgumentNode", + "name": "expectedPendingBalanceCreditCounter", + "docs": [ + "The expected number of pending balance credits since the last successful", + "`ApplyPendingBalance` instruction" + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newDecryptableAvailableBalance", + "docs": ["The new decryptable balance if the pending balance is applied", "successfully"], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "enableConfidentialCredits", + "docs": ["Configure a confidential extension account to accept incoming", "confidential transfers."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 9 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "disableConfidentialCredits", + "docs": [ + "Configure a confidential extension account to reject any incoming", + "confidential transfers.", + "", + "If the `allow_non_confidential_credits` field is `true`, then the base", + "account can still receive non-confidential transfers.", + "", + "This instruction can be used to disable confidential payments after a", + "token account has already been extended for confidential transfers." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 10 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "enableNonConfidentialCredits", + "docs": [ + "Configure an account with the confidential extension to accept incoming", + "non-confidential transfers." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "disableNonConfidentialCredits", + "docs": [ + "Configure an account with the confidential extension to reject any", + "incoming non-confidential transfers.", + "", + "This instruction can be used to configure a confidential extension", + "account to exclusively receive confidential payments." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 12 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "confidentialTransferWithFee", + "docs": [ + "Transfer tokens confidentially with fee.", + "", + "In order for this instruction to be successfully processed, it must be", + "accompanied by the following list of `zk_elgamal_proof` program", + "instructions:", + "- `VerifyCiphertextCommitmentEquality`", + "- `VerifyBatchedGroupedCiphertext3HandlesValidity` (transfer amount", + " ciphertext)", + "- `VerifyPercentageWithFee`", + "- `VerifyBatchedGroupedCiphertext2HandlesValidity` (fee ciphertext)", + "- `VerifyBatchedRangeProofU256`", + "These instructions can be accompanied in the same transaction or can be", + "pre-verified into a context state account, in which case, only their", + "context state account addresses need to be provided.", + "", + "The same restrictions for the `Transfer` applies to", + "`TransferWithFee`. Namely, the instruction fails if the", + "associated mint is extended as `NonTransferable`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "sourceToken", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The corresponding SPL Token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "destinationToken", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination SPL Token account."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvar", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "(Optional) Instructions sysvar if at least one of the", + "`zk_elgamal_proof` instructions are included in the same", + "transaction." + ] + }, + { + "kind": "instructionAccountNode", + "name": "equalityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Equality proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "transferAmountCiphertextValidityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": [ + "(Optional) Transfer amount ciphertext validity proof record", + "account or context state account." + ] + }, + { + "kind": "instructionAccountNode", + "name": "feeSigmaRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Fee sigma proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "feeCiphertextValidityRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Fee ciphertext validity proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "rangeRecord", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["(Optional) Range proof record account or context state account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 27 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 13 + } + }, + { + "kind": "instructionArgumentNode", + "name": "newSourceDecryptableAvailableBalance", + "docs": ["The new source decryptable balance if the transfer succeeds."], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + }, + { + "kind": "instructionArgumentNode", + "name": "equalityProofInstructionOffset", + "docs": [ + "Relative location of the", + "`ProofInstruction::VerifyCiphertextCommitmentEquality` instruction", + "to the `TransferWithFee` instruction in the transaction. If the offset", + "is `0`, then use a context state account for the proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferAmountCiphertextValidityProofInstructionOffset", + "docs": [ + "Relative location of the", + "`ProofInstruction::VerifyBatchedGroupedCiphertext3HandlesValidity`", + "instruction to the `TransferWithFee` instruction in the transaction.", + "If the offset is `0`, then use a context state account for the", + "proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "feeSigmaProofInstructionOffset", + "docs": [ + "Relative location of the `ProofInstruction::VerifyPercentageWithFee`", + "instruction to the `TransferWithFee` instruction in the transaction.", + "If the offset is `0`, then use a context state account for the", + "proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "feeCiphertextValidityProofInstructionOffset", + "docs": [ + "Relative location of the", + "`ProofInstruction::VerifyBatchedGroupedCiphertext2HandlesValidity`", + "instruction to the `TransferWithFee` instruction in the transaction.", + "If the offset is `0`, then use a context state account for the", + "proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "rangeProofInstructionOffset", + "docs": [ + "Relative location of the `ProofInstruction::BatchedRangeProofU256Data`", + "instruction to the `TransferWithFee` instruction in the transaction.", + "If the offset is `0`, then use a context state account for the", + "proof." + ], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeDefaultAccountState", + "docs": [ + "Initialize a new mint with the default state for new Accounts.", + "", + "Fails if the mint has already been initialized, so must be called before", + "`InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 28 + } + }, + { + "kind": "instructionArgumentNode", + "name": "defaultAccountStateDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "state", + "docs": ["The state each new token account should start with."], + "type": { + "kind": "definedTypeLinkNode", + "name": "accountState" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "defaultAccountStateDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateDefaultAccountState", + "docs": [ + "Update the default state for new Accounts. Only supported for mints that", + "include the `DefaultAccountState` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "freezeAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint freeze authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 28 + } + }, + { + "kind": "instructionArgumentNode", + "name": "defaultAccountStateDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "state", + "docs": ["The state each new token account should start with."], + "type": { + "kind": "definedTypeLinkNode", + "name": "accountState" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "defaultAccountStateDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "reallocate", + "docs": [ + "Check to see if a token account is large enough for a list of", + "ExtensionTypes, and if not, use reallocation to increase the data", + "size." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token account to reallocate."] + }, + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["The payer account to fund reallocation."] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program for reallocation funding."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 29 + } + }, + { + "kind": "instructionArgumentNode", + "name": "newExtensionTypes", + "docs": ["New extension types to include in the reallocated account."], + "type": { + "kind": "arrayTypeNode", + "item": { + "kind": "definedTypeLinkNode", + "name": "extensionType" + }, + "count": { + "kind": "remainderCountNode" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "enableMemoTransfers", + "docs": [ + "Require memos for transfers into this Account. Adds the MemoTransfer", + "extension to the Account, if it doesn't already exist." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token account to update."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 30 + } + }, + { + "kind": "instructionArgumentNode", + "name": "memoTransfersDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "memoTransfersDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "disableMemoTransfers", + "docs": [ + "Stop requiring memos for transfers into this Account.", + "", + "Implicitly initializes the extension in the case where it is not", + "present." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token account to update."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 30 + } + }, + { + "kind": "instructionArgumentNode", + "name": "memoTransfersDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "memoTransfersDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "createNativeMint", + "docs": [ + "Creates the native mint.", + "", + "This instruction only needs to be invoked once after deployment and is", + "permissionless. Wrapped SOL (`native_mint::id()`) will not be", + "available until this instruction is successfully executed." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Funding account (must be a system account)"] + }, + { + "kind": "instructionAccountNode", + "name": "nativeMint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The native mint address"] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program for mint account funding"], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 31 + } + } + ], + "remainingAccounts": [], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeNonTransferableMint", + "docs": [ + "Initialize the non transferable extension for the given mint account", + "", + "Fails if the account has already been initialized, so must be called before `InitializeMint`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint account to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 32 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeInterestBearingMint", + "docs": [ + "Initialize a new mint with the `InterestBearing` extension.", + "", + "Fails if the mint has already been initialized, so must be called before", + "`InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 33 + } + }, + { + "kind": "instructionArgumentNode", + "name": "interestBearingMintDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "rateAuthority", + "docs": ["The public key for the account that can update the rate"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "rate", + "docs": ["The initial interest rate"], + "type": { + "kind": "numberTypeNode", + "format": "i16", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "interestBearingMintDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateRateInterestBearingMint", + "docs": [ + "Update the interest rate. Only supported for mints that include the", + "`InterestBearingConfig` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "rateAuthority", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint rate authority."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 33 + } + }, + { + "kind": "instructionArgumentNode", + "name": "interestBearingMintDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "rate", + "docs": ["The interest rate to update."], + "type": { + "kind": "numberTypeNode", + "format": "i16", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "interestBearingMintDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "enableCpiGuard", + "docs": [ + "Lock certain token operations from taking place within CPI for this Account, namely:", + "* Transfer and Burn must go through a delegate.", + "* CloseAccount can only return lamports to owner.", + "* SetAuthority can only be used to remove an existing close authority.", + "* Approve is disallowed entirely.", + "", + "In addition, CPI Guard cannot be enabled or disabled via CPI." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token account to update."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 34 + } + }, + { + "kind": "instructionArgumentNode", + "name": "cpiGuardDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "cpiGuardDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "disableCpiGuard", + "docs": [ + "Allow all token operations to happen via CPI as normal.", + "", + "Implicitly initializes the extension in the case where it is not present." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token account to update."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 34 + } + }, + { + "kind": "instructionArgumentNode", + "name": "cpiGuardDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "cpiGuardDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializePermanentDelegate", + "docs": [ + "Initialize the permanent delegate on a new mint.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82 bytes),", + "plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 35 + } + }, + { + "kind": "instructionArgumentNode", + "name": "delegate", + "docs": ["Authority that may sign for `Transfer`s and `Burn`s on any account"], + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeTransferHook", + "docs": [ + "Initialize a new mint with a transfer hook program.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82 bytes),", + "plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 36 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferHookDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The public key for the account that can update the program id"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "programId", + "docs": ["The program id that performs logic during transfers"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferHookDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateTransferHook", + "docs": [ + "Update the transfer hook program id. Only supported for mints that", + "include the `TransferHook` extension.", + "", + "Accounts expected by this instruction:", + "", + " 0. `[writable]` The mint.", + " 1. `[signer]` The transfer hook authority." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The transfer hook authority."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 36 + } + }, + { + "kind": "instructionArgumentNode", + "name": "transferHookDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "programId", + "docs": ["The program id that performs logic during transfers"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "transferHookDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeConfidentialTransferFee", + "docs": [ + "Initializes confidential transfer fees for a mint.", + "", + "The instruction must be included within the same Transaction as TokenInstruction::InitializeMint.", + "Otherwise another party can initialize the configuration.", + "", + "The instruction fails if TokenInstruction::InitializeMint has already executed for the mint." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The SPL Token mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["Optional authority to set the withdraw withheld authority ElGamal key"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "withdrawWithheldAuthorityElGamalPubkey", + "docs": ["Withheld fees from accounts must be encrypted with this ElGamal key"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "withdrawWithheldTokensFromMintForConfidentialTransferFee", + "docs": [ + "Transfer all withheld confidential tokens in the mint to an account.", + "Signed by the mint's withdraw withheld tokens authority.", + "", + "The withheld confidential tokens are aggregated directly into the destination available balance.", + "", + "Must be accompanied by the VerifyCiphertextCiphertextEquality instruction", + "of the zk_elgamal_proof program in the same transaction or the address of", + "a context state account for the proof must be provided." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The fee receiver account."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvarOrContextState", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar or context state account"] + }, + { + "kind": "instructionAccountNode", + "name": "record", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Optional record account if proof is read from record"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's withdraw_withheld_authority"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "proofInstructionOffset", + "docs": ["Proof instruction offset"], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newDecryptableAvailableBalance", + "docs": ["The new decryptable balance in the destination token account"], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "withdrawWithheldTokensFromAccountsForConfidentialTransferFee", + "docs": [ + "Transfer all withheld tokens to an account. Signed by the mint's withdraw withheld", + "tokens authority. This instruction is susceptible to front-running.", + "Use `HarvestWithheldTokensToMint` and `WithdrawWithheldTokensFromMint` as alternative.", + "", + "Must be accompanied by the VerifyWithdrawWithheldTokens instruction." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The fee receiver account."] + }, + { + "kind": "instructionAccountNode", + "name": "instructionsSysvarOrContextState", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Instructions sysvar or context state account"] + }, + { + "kind": "instructionAccountNode", + "name": "record", + "isWritable": false, + "isSigner": false, + "isOptional": true, + "docs": ["Optional record account"] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's withdraw_withheld_authority"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "numTokenAccounts", + "docs": ["Number of token accounts harvested"], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "proofInstructionOffset", + "docs": ["Proof instruction offset"], + "type": { + "kind": "numberTypeNode", + "format": "i8", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newDecryptableAvailableBalance", + "docs": ["The new decryptable balance in the destination token account"], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "harvestWithheldTokensToMintForConfidentialTransferFee", + "docs": [ + "Permissionless instruction to transfer all withheld confidential tokens to the mint.", + "", + "Succeeds for frozen accounts.", + "", + "Accounts provided should include both the `TransferFeeAmount` and", + "`ConfidentialTransferAccount` extension. If not, the account is skipped." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": false, + "isWritable": true, + "docs": ["The source accounts to harvest from"], + "value": { + "kind": "argumentValueNode", + "name": "sources" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "enableHarvestToMint", + "docs": ["Configure a confidential transfer fee mint to accept harvested confidential fees."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The confidential transfer fee authority"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "disableHarvestToMint", + "docs": ["Configure a confidential transfer fee mint to reject any harvested confidential fees."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The confidential transfer fee authority"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 37 + } + }, + { + "kind": "instructionArgumentNode", + "name": "confidentialTransferFeeDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "confidentialTransferFeeDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "withdrawExcessLamports", + "docs": [ + "This instruction is to be used to rescue SOLs sent to any TokenProgram", + "owned account by sending them to any other account, leaving behind only", + "lamports for rent exemption." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "sourceAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Account holding excess lamports."] + }, + { + "kind": "instructionAccountNode", + "name": "destinationAccount", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Destination account for withdrawn lamports."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 38 + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeMetadataPointer", + "docs": [ + "Initialize a new mint with a metadata pointer", + "", + "Fails if the mint has already been initialized, so must be called before", + "`InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 39 + } + }, + { + "kind": "instructionArgumentNode", + "name": "metadataPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The public key for the account that can update the metadata address."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "metadataAddress", + "docs": ["The account address that holds the metadata."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "metadataPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateMetadataPointer", + "docs": [ + "Update the metadata pointer address. Only supported for mints that", + "include the `MetadataPointer` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "metadataPointerAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The metadata pointer authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 39 + } + }, + { + "kind": "instructionArgumentNode", + "name": "metadataPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "metadataAddress", + "docs": ["The new account address that holds the metadata."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "metadataPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeGroupPointer", + "docs": [ + "Initialize a new mint with a group pointer", + "", + "Fails if the mint has already been initialized, so must be called before", + "`InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 40 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The public key for the account that can update the group address."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupAddress", + "docs": ["The account address that holds the group."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "groupPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateGroupPointer", + "docs": [ + "Update the group pointer address. Only supported for mints that", + "include the `GroupPointer` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "groupPointerAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The group pointer authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 40 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupAddress", + "docs": ["The new account address that holds the group configurations."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "groupPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeGroupMemberPointer", + "docs": [ + "Initialize a new mint with a group member pointer", + "", + "Fails if the mint has already been initialized, so must be called before", + "`InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82", + "bytes), plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 41 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupMemberPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The public key for the account that can update the group member address."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "memberAddress", + "docs": ["The account address that holds the member."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "groupMemberPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateGroupMemberPointer", + "docs": [ + "Update the group member pointer address. Only supported for mints that", + "include the `GroupMemberPointer` extension." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "groupMemberPointerAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The group member pointer authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 41 + } + }, + { + "kind": "instructionArgumentNode", + "name": "groupMemberPointerDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "memberAddress", + "docs": ["The new account address that holds the member."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "groupMemberPointerDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeScaledUiAmountMint", + "docs": [ + "Initialize a new mint with the `ScaledUiAmount` extension.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`.", + "", + "The mint must have exactly enough space allocated for the base mint (82 bytes),", + "plus 83 bytes of padding, 1 byte reserved for the account type,", + "then space required for this extension, plus any others." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 43 + } + }, + { + "kind": "instructionArgumentNode", + "name": "scaledUiAmountMintDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The authority that can update the multiplier"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "multiplier", + "docs": ["The initial multiplier for the scaled UI extension"], + "type": { + "kind": "numberTypeNode", + "format": "f64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "scaledUiAmountMintDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateMultiplierScaledUiMint", + "docs": [ + "Update the multiplier. Only supported for mints that include the", + "`ScaledUiAmountConfig` extension.", + "You can set a specific timestamp for the multiplier to take effect." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": true, + "isSigner": "either", + "isOptional": false, + "docs": ["The multiplier authority."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 43 + } + }, + { + "kind": "instructionArgumentNode", + "name": "scaledUiAmountMintDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "multiplier", + "docs": ["The new multiplier for the scaled UI extension"], + "type": { + "kind": "numberTypeNode", + "format": "f64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "effectiveTimestamp", + "docs": ["The timestamp at which the new multiplier will take effect"], + "type": { + "kind": "numberTypeNode", + "format": "i64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "scaledUiAmountMintDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializePausableConfig", + "docs": [ + "Initialize a new mint with the `Pausable` extension.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "pausableDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The authority that can pause and resume the mint."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "pausableDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "pause", + "docs": ["Pause the mint.", "", "Fails if the mint is not pausable."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The pausable authority that can pause the mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "pausableDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "pausableDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "resume", + "docs": ["Resume the mint.", "", "Fails if the mint is not pausable."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The pausable authority that can resume the mint."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 44 + } + }, + { + "kind": "instructionArgumentNode", + "name": "pausableDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "pausableDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeTokenMetadata", + "docs": [ + "Initializes a TLV entry with the basic token-metadata fields.", + "", + "Assumes that the provided mint is an SPL token mint, that the metadata", + "account is allocated and assigned to the program, and that the metadata", + "account has enough lamports to cover the rent-exempt reserve." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "d2e11ea258b84d8d", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "name", + "docs": ["Longer name of the token."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "symbol", + "docs": ["Shortened symbol of the token."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "uri", + "docs": ["URI pointing to more metadata (image, video, etc.)."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateTokenMetadataField", + "docs": [ + "Updates a field in a token-metadata account.", + "", + "The field can be one of the required fields (name, symbol, URI), or a", + "totally new field denoted by a \"key\" string.", + "", + "By the end of the instruction, the metadata account must be properly", + "resized based on the new size of the TLV entry.", + " * If the new size is larger, the program must first reallocate to", + " avoid", + " overwriting other TLV entries.", + " * If the new size is smaller, the program must reallocate at the end", + " so that it's possible to iterate over TLV entries" + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "dde9312db5cadcc8", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "field", + "docs": ["Field to update in the metadata."], + "type": { + "kind": "definedTypeLinkNode", + "name": "tokenMetadataField" + } + }, + { + "kind": "instructionArgumentNode", + "name": "value", + "docs": ["Value to write for the field."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "removeTokenMetadataKey", + "docs": [ + "Removes a key-value pair in a token-metadata account.", + "", + "This only applies to additional fields, and not the base name / symbol /", + "URI fields.", + "", + "By the end of the instruction, the metadata account must be properly", + "resized at the end based on the new size of the TLV entry." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "ea122038598d25b5", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "idempotent", + "docs": [ + "If the idempotent flag is set to true, then the instruction will not", + "error if the key does not exist" + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "booleanValueNode", + "boolean": false + } + }, + { + "kind": "instructionArgumentNode", + "name": "key", + "docs": ["Key to remove in the additional metadata portion."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateTokenMetadataUpdateAuthority", + "docs": ["Updates the token-metadata authority."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "d7e4a6e45464567b", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newUpdateAuthority", + "docs": ["New authority for the token metadata, or unset if `None`"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "emitTokenMetadata", + "docs": [ + "Emits the token-metadata as return data", + "", + "The format of the data emitted follows exactly the `TokenMetadata`", + "struct, but it's possible that the account data is stored in another", + "format by the program.", + "", + "With this instruction, a program that implements the token-metadata", + "interface can return `TokenMetadata` without adhering to the specific", + "byte layout of the `TokenMetadata` struct in any accounts." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "metadata", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "faa6b4fa0d0cb846", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "start", + "docs": ["Start of range of data to emit"], + "type": { + "kind": "optionTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "end", + "docs": ["End of range of data to emit"], + "type": { + "kind": "optionTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "defaultValue": { + "kind": "noneValueNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeTokenGroup", + "docs": ["Initialize a new `Group`", "", "Assumes one has already initialized a mint for the group."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "group", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "79716c2736330004", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "updateAuthority", + "docs": ["Update authority for the group"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "instructionArgumentNode", + "name": "maxSize", + "docs": ["The maximum number of group members"], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateTokenGroupMaxSize", + "docs": ["Update the max size of a `Group`."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "group", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "6c25ab8ff81e126e", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "maxSize", + "docs": ["New max size for the group"], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "updateTokenGroupUpdateAuthority", + "docs": ["Update the authority of a `Group`."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "group", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "updateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Current update authority"] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "a1695801edddd8cb", + "encoding": "base16" + } + }, + { + "kind": "instructionArgumentNode", + "name": "newUpdateAuthority", + "docs": ["New authority for the group, or unset if `None`"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializeTokenGroupMember", + "docs": [ + "Initialize a new `Member` of a `Group`", + "", + "Assumes the `Group` has already been initialized,", + "as well as the mint for the member." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "member", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "memberMint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "memberMintAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "group", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [] + }, + { + "kind": "instructionAccountNode", + "name": "groupUpdateAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": [] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "bytesTypeNode" + }, + "defaultValue": { + "kind": "bytesValueNode", + "data": "9820deb0dfed7486", + "encoding": "base16" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "unwrapLamports", + "docs": ["Transfer lamports from a native SOL account to a destination account."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 45 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of lamports to transfer."], + "type": { + "kind": "optionTypeNode", + "fixed": false, + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ] + }, + { + "kind": "instructionNode", + "name": "initializePermissionedBurn", + "docs": [ + "Require permissioned burn for the given mint account.", + "", + "Fails if the mint has already been initialized, so must be called before `InitializeMint`." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint account to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 46 + } + }, + { + "kind": "instructionArgumentNode", + "name": "permissionedBurnDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + } + }, + { + "kind": "instructionArgumentNode", + "name": "authority", + "docs": ["The public key for the account that is required for token burning."], + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "permissionedBurnDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "permissionedBurn", + "docs": ["Burn tokens when the mint has the permissioned burn extension enabled."], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account to burn from."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "permissionedBurnAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authority configured on the mint that must sign any permissioned burn instruction."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 46 + } + }, + { + "kind": "instructionArgumentNode", + "name": "permissionedBurnDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to burn."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "permissionedBurnDiscriminator", + "offset": 1 + } + ] + }, + { + "kind": "instructionNode", + "name": "permissionedBurnChecked", + "docs": [ + "Burn tokens with expected decimals when the mint has the permissioned burn extension enabled." + ], + "optionalAccountStrategy": "programId", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account to burn from."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "permissionedBurnAuthority", + "isWritable": false, + "isSigner": true, + "isOptional": false, + "docs": ["Authority configured on the mint that must sign any permissioned burn instruction."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."], + "defaultValue": { + "kind": "identityValueNode" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 46 + } + }, + { + "kind": "instructionArgumentNode", + "name": "permissionedBurnDiscriminator", + "defaultValueStrategy": "omitted", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + } + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "docs": ["The amount of tokens to burn."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "docs": ["Expected number of base 10 digits to the right of the decimal place."], + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "isOptional": true, + "isSigner": true, + "docs": [], + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + }, + { + "kind": "fieldDiscriminatorNode", + "name": "permissionedBurnDiscriminator", + "offset": 1 + } + ] + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "accountState", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "uninitialized" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "initialized" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "frozen" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "authorityType", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "mintTokens" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "freezeAccount" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "accountOwner" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "closeAccount" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferFeeConfig" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "withheldWithdraw" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "closeMint" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "interestRate" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "permanentDelegate" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "confidentialTransferMint" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferHookProgramId" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "confidentialTransferFeeConfig" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadataPointer" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "groupPointer" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "groupMemberPointer" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "scaledUiAmount" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "pause" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "permissionedBurn" + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "transferFee", + "docs": [], + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "epoch", + "docs": ["First epoch where the transfer fee takes effect."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "maximumFee", + "docs": ["Maximum fee assessed on transfers, expressed as an amount of tokens."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "transferFeeBasisPoints", + "docs": [ + "Amount of transfer collected as fees, expressed as basis points of the", + "transfer amount, ie. increments of 0.01%." + ], + "type": { + "kind": "amountTypeNode", + "decimals": 2, + "unit": "%", + "number": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + } + ] + } + }, + { + "kind": "definedTypeNode", + "name": "encryptedBalance", + "docs": ["ElGamal ciphertext containing an account balance."], + "type": { + "kind": "fixedSizeTypeNode", + "size": 64, + "type": { + "kind": "bytesTypeNode" + } + } + }, + { + "kind": "definedTypeNode", + "name": "decryptableBalance", + "docs": ["Authenticated encryption containing an account balance."], + "type": { + "kind": "fixedSizeTypeNode", + "size": 36, + "type": { + "kind": "bytesTypeNode" + } + } + }, + { + "kind": "definedTypeNode", + "name": "extension", + "docs": [], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "uninitialized" + }, + { + "kind": "enumStructVariantTypeNode", + "name": "transferFeeConfig", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "transferFeeConfigAuthority", + "docs": ["Optional authority to set the fee."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "withdrawWithheldAuthority", + "docs": ["Withdraw from mint instructions must be signed by this key."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "withheldAmount", + "docs": [ + "Withheld transfer fee tokens that have been moved to the mint for withdrawal." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "olderTransferFee", + "docs": [ + "Older transfer fee, used if the current epoch < newerTransferFee.epoch." + ], + "type": { + "kind": "definedTypeLinkNode", + "name": "transferFee" + } + }, + { + "kind": "structFieldTypeNode", + "name": "newerTransferFee", + "docs": [ + "Newer transfer fee, used if the current epoch >= newerTransferFee.epoch." + ], + "type": { + "kind": "definedTypeLinkNode", + "name": "transferFee" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "transferFeeAmount", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "withheldAmount", + "docs": [ + "Withheld transfer fee tokens that can be claimed by the fee authority." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "mintCloseAuthority", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "closeAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "confidentialTransferMint", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [ + "Authority to modify the `ConfidentialTransferMint` configuration and to", + "approve new accounts (if `auto_approve_new_accounts` is true).", + "", + "The legacy Token Multisig account is not supported as the authority." + ], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "autoApproveNewAccounts", + "docs": [ + "Indicate if newly configured accounts must be approved by the", + "`authority` before they may be used by the user.", + "", + "* If `true`, no approval is required and new accounts may be used immediately.", + "* If `false`, the authority must approve newly configured accounts (see", + " `ConfidentialTransferInstruction::ConfigureAccount`)." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "auditorElgamalPubkey", + "docs": [ + "Authority to decode any transfer amount in a confidential transfer." + ], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "confidentialTransferAccount", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "approved", + "docs": [ + "`true` if this account has been approved for use. All confidential", + "transfer operations for the account will fail until approval is granted." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "elgamalPubkey", + "docs": ["The public key associated with ElGamal encryption."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "pendingBalanceLow", + "docs": [ + "The low 16 bits of the pending balance (encrypted by `elgamal_pubkey`)." + ], + "type": { + "kind": "definedTypeLinkNode", + "name": "encryptedBalance" + } + }, + { + "kind": "structFieldTypeNode", + "name": "pendingBalanceHigh", + "docs": [ + "The high 32 bits of the pending balance (encrypted by `elgamal_pubkey`)." + ], + "type": { + "kind": "definedTypeLinkNode", + "name": "encryptedBalance" + } + }, + { + "kind": "structFieldTypeNode", + "name": "availableBalance", + "docs": ["The available balance (encrypted by `encrypiton_pubkey`)."], + "type": { + "kind": "definedTypeLinkNode", + "name": "encryptedBalance" + } + }, + { + "kind": "structFieldTypeNode", + "name": "decryptableAvailableBalance", + "docs": ["The decryptable available balance."], + "type": { + "kind": "definedTypeLinkNode", + "name": "decryptableBalance" + } + }, + { + "kind": "structFieldTypeNode", + "name": "allowConfidentialCredits", + "docs": [ + "If `false`, the extended account rejects any incoming confidential transfers." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "allowNonConfidentialCredits", + "docs": ["If `false`, the base account rejects any incoming transfers."], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "pendingBalanceCreditCounter", + "docs": [ + "The total number of `Deposit` and `Transfer` instructions that have credited `pending_balance`." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "maximumPendingBalanceCreditCounter", + "docs": [ + "The maximum number of `Deposit` and `Transfer` instructions that can", + "credit `pending_balance` before the `ApplyPendingBalance`", + "instruction is executed." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "expectedPendingBalanceCreditCounter", + "docs": [ + "The `expected_pending_balance_credit_counter` value that was included in", + "the last `ApplyPendingBalance` instruction." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "actualPendingBalanceCreditCounter", + "docs": [ + "The actual `pending_balance_credit_counter` when the last", + "`ApplyPendingBalance` instruction was executed." + ], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "defaultAccountState", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "state", + "docs": [], + "type": { + "kind": "definedTypeLinkNode", + "name": "accountState" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "immutableOwner", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "memoTransfer", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "requireIncomingTransferMemos", + "docs": [ + "Require transfers into this account to be accompanied by a memo." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "nonTransferable", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "interestBearingConfig", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "rateAuthority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "initializationTimestamp", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "preUpdateAverageRate", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "i16", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "lastUpdateTimestamp", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "currentRate", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "i16", + "endian": "le" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "cpiGuard", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "lockCpi", + "docs": [ + "Lock certain token operations from taking place within CPI for this account." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "permanentDelegate", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "delegate", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "nonTransferableAccount", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "transferHook", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": ["The transfer hook update authority."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "programId", + "docs": ["The transfer hook program account."], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "transferHookAccount", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "transferring", + "docs": [ + "Whether or not this account is currently transferring tokens", + "True during the transfer hook cpi, otherwise false." + ], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "confidentialTransferFee", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [ + "Optional authority to set the withdraw withheld authority ElGamal key." + ], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "elgamalPubkey", + "docs": [ + "Withheld fees from accounts must be encrypted with this ElGamal key.", + "", + "Note that whoever holds the ElGamal private key for this ElGamal public", + "key has the ability to decode any withheld fee amount that are", + "associated with accounts. When combined with the fee parameters, the", + "withheld fee amounts can reveal information about transfer amounts." + ], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "harvestToMintEnabled", + "docs": ["If `false`, the harvest of withheld tokens to mint is rejected."], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "withheldAmount", + "docs": [ + "Withheld confidential transfer fee tokens that have been moved to the", + "mint for withdrawal." + ], + "type": { + "kind": "definedTypeLinkNode", + "name": "encryptedBalance" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "confidentialTransferFeeAmount", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "withheldAmount", + "docs": [ + "Amount withheld during confidential transfers, to be harvest to the mint." + ], + "type": { + "kind": "definedTypeLinkNode", + "name": "encryptedBalance" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "metadataPointer", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": ["Optional authority that can set the metadata address."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "metadataAddress", + "docs": ["Optional Account Address that holds the metadata."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "tokenMetadata", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "updateAuthority", + "docs": ["The authority that can sign to update the metadata."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": [ + "The associated mint, used to counter spoofing to be sure that metadata belongs to a particular mint." + ], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "name", + "docs": ["The longer name of the token."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "symbol", + "docs": ["The shortened symbol for the token."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "uri", + "docs": ["The URI pointing to richer metadata."], + "type": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "additionalMetadata", + "docs": ["Any additional metadata about the token as key-value pairs."], + "type": { + "kind": "mapTypeNode", + "key": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "value": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + }, + "count": { + "kind": "prefixedCountNode", + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "groupPointer", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": ["Optional authority that can set the group address."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "groupAddress", + "docs": ["Optional account address that holds the group."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "tokenGroup", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "updateAuthority", + "docs": ["The authority that can sign to update the group."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": [ + "The associated mint, used to counter spoofing to be sure that group belongs to a particular mint." + ], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "size", + "docs": ["The current number of group members."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "maxSize", + "docs": ["The maximum number of group members."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "groupMemberPointer", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": ["Optional authority that can set the member address."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "memberAddress", + "docs": ["Optional account address that holds the member."], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "tokenGroupMember", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "mint", + "docs": [ + "The associated mint, used to counter spoofing to be sure that member belongs to a particular mint." + ], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "group", + "docs": ["The pubkey of the `TokenGroup`."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "memberNumber", + "docs": ["The member number."], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "confidentialMintBurn", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "scaledUiAmountConfig", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "multiplier", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "f64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "newMultiplierEffectiveTimestamp", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + } + }, + { + "kind": "structFieldTypeNode", + "name": "newMultiplier", + "docs": [], + "type": { + "kind": "numberTypeNode", + "format": "f64", + "endian": "le" + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "pausableConfig", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": [], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "paused", + "docs": [], + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "pausableAccount", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "enumStructVariantTypeNode", + "name": "permissionedBurn", + "struct": { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "authority", + "docs": ["Authority that is required for burning"], + "type": { + "kind": "zeroableOptionTypeNode", + "item": { + "kind": "publicKeyTypeNode" + } + } + } + ] + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "extensionType", + "docs": [ + "Extensions that can be applied to mints or accounts. Mint extensions must", + "only be applied to mint accounts, and account extensions must only be", + "applied to token holding accounts." + ], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "uninitialized", + "docs": ["Used as padding if the account size would otherwise be 355, same as a multisig"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferFeeConfig", + "docs": [ + "Includes transfer fee rate info and accompanying authorities to withdraw", + "and set the fee" + ] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferFeeAmount", + "docs": ["Includes withheld transfer fees"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "mintCloseAuthority", + "docs": ["Includes an optional mint close authority"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "confidentialTransferMint", + "docs": ["Auditor configuration for confidential transfers"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "confidentialTransferAccount", + "docs": ["State for confidential transfers"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "defaultAccountState", + "docs": ["Specifies the default Account::state for new Accounts"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "immutableOwner", + "docs": ["Indicates that the Account owner authority cannot be changed"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "memoTransfer", + "docs": ["Require inbound transfers to have memo"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "nonTransferable", + "docs": ["Indicates that the tokens from this mint can't be transferred"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "interestBearingConfig", + "docs": ["Tokens accrue interest over time,"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "cpiGuard", + "docs": ["Locks privileged token operations from happening via CPI"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "permanentDelegate", + "docs": ["Includes an optional permanent delegate"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "nonTransferableAccount", + "docs": ["Indicates that the tokens in this account belong to a non-transferable", "mint"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferHook", + "docs": ["Mint requires a CPI to a program implementing the \"transfer hook\"", "interface"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "transferHookAccount", + "docs": [ + "Indicates that the tokens in this account belong to a mint with a", + "transfer hook" + ] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "confidentialTransferFee", + "docs": [ + "Includes encrypted withheld fees and the encryption public that they are", + "encrypted under" + ] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "confidentialTransferFeeAmount", + "docs": ["Includes confidential withheld transfer fees"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "scaledUiAmountConfig", + "docs": ["Tokens have a scaled UI amount"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "pausableConfig", + "docs": ["Mint contains pausable configuration"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "pausableAccount", + "docs": ["Account contains pausable configuration"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "metadataPointer", + "docs": [ + "Mint contains a pointer to another account (or the same account) that", + "holds metadata" + ] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenMetadata", + "docs": ["Mint contains token-metadata"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "groupPointer", + "docs": [ + "Mint contains a pointer to another account (or the same account) that", + "holds group configurations" + ] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenGroup", + "docs": ["Mint contains token group configurations"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "groupMemberPointer", + "docs": [ + "Mint contains a pointer to another account (or the same account) that", + "holds group member configurations" + ] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "tokenGroupMember", + "docs": ["Mint contains token group member configurations"] + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u16", + "endian": "le" + } + } + }, + { + "kind": "definedTypeNode", + "name": "tokenMetadataField", + "docs": ["Fields in the metadata account, used for updating."], + "type": { + "kind": "enumTypeNode", + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "name", + "docs": ["The name field, corresponding to `TokenMetadata.name`"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "symbol", + "docs": ["The symbol field, corresponding to `TokenMetadata.symbol`"] + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "uri", + "docs": ["The uri field, corresponding to `TokenMetadata.uri`"] + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "key", + "docs": ["A user field, whose key is given by the associated string"], + "tuple": { + "kind": "tupleTypeNode", + "items": [ + { + "kind": "sizePrefixTypeNode", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + } + } + ] + } + } + ], + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + } + } + ], + "pdas": [], + "errors": [ + { + "kind": "errorNode", + "name": "notRentExempt", + "code": 0, + "message": "Lamport balance below rent-exempt threshold", + "docs": ["NotRentExempt: Lamport balance below rent-exempt threshold"] + }, + { + "kind": "errorNode", + "name": "insufficientFunds", + "code": 1, + "message": "Insufficient funds", + "docs": ["InsufficientFunds: Insufficient funds"] + }, + { + "kind": "errorNode", + "name": "invalidMint", + "code": 2, + "message": "Invalid Mint", + "docs": ["InvalidMint: Invalid Mint"] + }, + { + "kind": "errorNode", + "name": "mintMismatch", + "code": 3, + "message": "Account not associated with this Mint", + "docs": ["MintMismatch: Account not associated with this Mint"] + }, + { + "kind": "errorNode", + "name": "ownerMismatch", + "code": 4, + "message": "Owner does not match", + "docs": ["OwnerMismatch: Owner does not match"] + }, + { + "kind": "errorNode", + "name": "fixedSupply", + "code": 5, + "message": "Fixed supply", + "docs": ["FixedSupply: Fixed supply"] + }, + { + "kind": "errorNode", + "name": "alreadyInUse", + "code": 6, + "message": "Already in use", + "docs": ["AlreadyInUse: Already in use"] + }, + { + "kind": "errorNode", + "name": "invalidNumberOfProvidedSigners", + "code": 7, + "message": "Invalid number of provided signers", + "docs": ["InvalidNumberOfProvidedSigners: Invalid number of provided signers"] + }, + { + "kind": "errorNode", + "name": "invalidNumberOfRequiredSigners", + "code": 8, + "message": "Invalid number of required signers", + "docs": ["InvalidNumberOfRequiredSigners: Invalid number of required signers"] + }, + { + "kind": "errorNode", + "name": "uninitializedState", + "code": 9, + "message": "State is unititialized", + "docs": ["UninitializedState: State is unititialized"] + }, + { + "kind": "errorNode", + "name": "nativeNotSupported", + "code": 10, + "message": "Instruction does not support native tokens", + "docs": ["NativeNotSupported: Instruction does not support native tokens"] + }, + { + "kind": "errorNode", + "name": "nonNativeHasBalance", + "code": 11, + "message": "Non-native account can only be closed if its balance is zero", + "docs": ["NonNativeHasBalance: Non-native account can only be closed if its balance is zero"] + }, + { + "kind": "errorNode", + "name": "invalidInstruction", + "code": 12, + "message": "Invalid instruction", + "docs": ["InvalidInstruction: Invalid instruction"] + }, + { + "kind": "errorNode", + "name": "invalidState", + "code": 13, + "message": "State is invalid for requested operation", + "docs": ["InvalidState: State is invalid for requested operation"] + }, + { + "kind": "errorNode", + "name": "overflow", + "code": 14, + "message": "Operation overflowed", + "docs": ["Overflow: Operation overflowed"] + }, + { + "kind": "errorNode", + "name": "authorityTypeNotSupported", + "code": 15, + "message": "Account does not support specified authority type", + "docs": ["AuthorityTypeNotSupported: Account does not support specified authority type"] + }, + { + "kind": "errorNode", + "name": "mintCannotFreeze", + "code": 16, + "message": "This token mint cannot freeze accounts", + "docs": ["MintCannotFreeze: This token mint cannot freeze accounts"] + }, + { + "kind": "errorNode", + "name": "accountFrozen", + "code": 17, + "message": "Account is frozen", + "docs": ["AccountFrozen: Account is frozen"] + }, + { + "kind": "errorNode", + "name": "mintDecimalsMismatch", + "code": 18, + "message": "The provided decimals value different from the Mint decimals", + "docs": ["MintDecimalsMismatch: The provided decimals value different from the Mint decimals"] + }, + { + "kind": "errorNode", + "name": "nonNativeNotSupported", + "code": 19, + "message": "Instruction does not support non-native tokens", + "docs": ["NonNativeNotSupported: Instruction does not support non-native tokens"] + } + ] + }, + "additionalPrograms": [ + { + "kind": "programNode", + "name": "associatedToken", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "version": "1.1.1", + "origin": "shank", + "docs": [], + "accounts": [], + "instructions": [ + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Funding account (must be a system account)."], + "defaultValue": { "kind": "payerValueNode" } + }, + { + "kind": "instructionAccountNode", + "name": "ata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Associated token account address to be created."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "owner" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet address for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 0 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "createAssociatedToken", + "docs": [ + "Creates an associated token account for the given wallet address and", + "token mint Returns an error if the account exists." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Funding account (must be a system account)."], + "defaultValue": { "kind": "payerValueNode" } + }, + { + "kind": "instructionAccountNode", + "name": "ata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Associated token account address to be created."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "owner" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet address for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 1 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "createAssociatedTokenIdempotent", + "docs": [ + "Creates an associated token account for the given wallet address and", + "token mint, if it doesn't already exist. Returns an error if the", + "account exists, but with a different owner." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nestedAssociatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Nested associated token account, must be owned by `ownerAssociatedAccountAddress`." + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "ownerAssociatedAccountAddress" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "nestedTokenMintAddress" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "nestedTokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint for the nested associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "destinationAssociatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet's associated token account."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "walletAddress" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "nestedTokenMintAddress" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "ownerAssociatedAccountAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner associated token account address, must be owned by `walletAddress`."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "walletAddress" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "ownerTokenMintAddress" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "ownerTokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint for the owner associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "walletAddress", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Wallet address for the owner associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 2 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "recoverNestedAssociatedToken", + "docs": [ + "Transfers from and closes a nested associated token account: an", + "associated token account owned by an associated token account.", + "", + "The tokens are moved from the nested associated token account to the", + "wallet's associated token account, and the nested account lamports are", + "moved to the wallet.", + "", + "Note: Nested token accounts are an anti-pattern, and almost always", + "created unintentionally, so this instruction should only be used to", + "recover from errors." + ], + "optionalAccountStrategy": "programId" + } + ], + "definedTypes": [], + "pdas": [ + { + "kind": "pdaNode", + "name": "associatedToken", + "docs": [], + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "owner", + "docs": ["The wallet address of the associated token account."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "tokenProgram", + "docs": ["The address of the token program to use."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The mint address of the associated token account."], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + } + ], + "errors": [ + { + "kind": "errorNode", + "name": "invalidOwner", + "code": 0, + "message": "Associated token account owner does not match address derivation", + "docs": ["InvalidOwner: Associated token account owner does not match address derivation"] + } + ] + } + ] +} diff --git a/packages/dynamic-client/test/programs/idls/token-idl.json b/packages/dynamic-client/test/programs/idls/token-idl.json new file mode 100644 index 000000000..bd1b80c1d --- /dev/null +++ b/packages/dynamic-client/test/programs/idls/token-idl.json @@ -0,0 +1,2701 @@ +{ + "kind": "rootNode", + "program": { + "kind": "programNode", + "pdas": [], + "accounts": [ + { + "kind": "accountNode", + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "mintAuthority", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "fixed": true + }, + "docs": [ + "Optional authority used to mint new tokens. The mint authority may only", + "be provided during mint creation. If no mint authority is present", + "then the mint has a fixed supply and no further tokens may be minted." + ] + }, + { + "kind": "structFieldTypeNode", + "name": "supply", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["Total supply of tokens."] + }, + { + "kind": "structFieldTypeNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Number of base 10 digits to the right of the decimal place."] + }, + { + "kind": "structFieldTypeNode", + "name": "isInitialized", + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "docs": ["Is `true` if this structure has been initialized."] + }, + { + "kind": "structFieldTypeNode", + "name": "freezeAuthority", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "fixed": true + }, + "docs": ["Optional authority to freeze token accounts."] + } + ] + }, + "discriminators": [ + { + "kind": "sizeDiscriminatorNode", + "size": 82 + } + ], + "name": "mint", + "docs": [], + "size": 82 + }, + { + "kind": "accountNode", + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "mint", + "type": { "kind": "publicKeyTypeNode" }, + "docs": ["The mint associated with this account."] + }, + { + "kind": "structFieldTypeNode", + "name": "owner", + "type": { "kind": "publicKeyTypeNode" }, + "docs": ["The owner of this account."] + }, + { + "kind": "structFieldTypeNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens this account holds."] + }, + { + "kind": "structFieldTypeNode", + "name": "delegate", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "fixed": true + }, + "docs": [ + "If `delegate` is `Some` then `delegated_amount` represents", + "the amount authorized by the delegate." + ] + }, + { + "kind": "structFieldTypeNode", + "name": "state", + "type": { "kind": "definedTypeLinkNode", "name": "accountState" }, + "docs": ["The account's state."] + }, + { + "kind": "structFieldTypeNode", + "name": "isNative", + "type": { + "kind": "optionTypeNode", + "item": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "fixed": true + }, + "docs": [ + "If is_native.is_some, this is a native token, and the value logs the", + "rent-exempt reserve. An Account is required to be rent-exempt, so", + "the value is used by the Processor to ensure that wrapped SOL", + "accounts do not drop below this threshold." + ] + }, + { + "kind": "structFieldTypeNode", + "name": "delegatedAmount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount delegated."] + }, + { + "kind": "structFieldTypeNode", + "name": "closeAuthority", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u32", + "endian": "le" + }, + "fixed": true + }, + "docs": ["Optional authority to close the account."] + } + ] + }, + "discriminators": [ + { + "kind": "sizeDiscriminatorNode", + "size": 165 + } + ], + "name": "token", + "docs": [], + "size": 165 + }, + { + "kind": "accountNode", + "data": { + "kind": "structTypeNode", + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "m", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Number of signers required."] + }, + { + "kind": "structFieldTypeNode", + "name": "n", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Number of valid signers."] + }, + { + "kind": "structFieldTypeNode", + "name": "isInitialized", + "type": { + "kind": "booleanTypeNode", + "size": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + } + }, + "docs": ["Is `true` if this structure has been initialized."] + }, + { + "kind": "structFieldTypeNode", + "name": "signers", + "type": { + "kind": "arrayTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "count": { "kind": "fixedCountNode", "value": 11 } + }, + "docs": ["Signer public keys."] + } + ] + }, + "discriminators": [ + { + "kind": "sizeDiscriminatorNode", + "size": 355 + } + ], + "name": "multisig", + "docs": [], + "size": 355 + } + ], + "instructions": [ + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint account."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 0 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Number of decimals in token account amounts."] + }, + { + "kind": "instructionArgumentNode", + "name": "mintAuthority", + "type": { "kind": "publicKeyTypeNode" }, + "docs": ["Minting authority."] + }, + { + "kind": "instructionArgumentNode", + "name": "freezeAuthority", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "fixed": false + }, + "defaultValue": { + "kind": "noneValueNode" + }, + "docs": ["Optional authority that can freeze token accounts."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeMint", + "docs": [ + "Initializes a new mint and optionally deposits all the newly minted", + "tokens in an account.", + "", + "The `InitializeMint` instruction requires no signers and MUST be", + "included within the same Transaction as the system program's", + "`CreateAccount` instruction that creates the account being initialized.", + "Otherwise another party can acquire ownership of the uninitialized account." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint this account will be associated with."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The new account's owner/multisignature."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 1 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeAccount", + "docs": [ + "Initializes a new account to hold tokens. If this account is associated", + "with the native mint then the token balance of the initialized account", + "will be equal to the amount of SOL in the account. If this account is", + "associated with another mint, that mint must be initialized before this", + "command can succeed.", + "", + "The `InitializeAccount` instruction requires no signers and MUST be", + "included within the same Transaction as the system program's", + "`CreateAccount` instruction that creates the account being initialized.", + "Otherwise another party can acquire ownership of the uninitialized account." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "multisig", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The multisignature account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 2 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "m", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["The number of signers (M) required to validate this multisignature account."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "signers" + } + } + ], + "name": "initializeMultisig", + "docs": [ + "Initializes a multisignature account with N provided signers.", + "", + "Multisignature accounts can used in place of any single owner/delegate", + "accounts in any token instruction that require an owner/delegate to be", + "present. The variant field represents the number of signers (M)", + "required to validate this multisignature account.", + "", + "The `InitializeMultisig` instruction requires no signers and MUST be", + "included within the same Transaction as the system program's", + "`CreateAccount` instruction that creates the account being initialized.", + "Otherwise another party can acquire ownership of the uninitialized account." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."], + "defaultValue": { "kind": "identityValueNode" } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 3 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens to transfer."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "transfer", + "docs": [ + "Transfers tokens from one account to another either directly or via a delegate.", + "If this account is associated with the native mint then equal amounts", + "of SOL and Tokens will be transferred to the destination account." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The delegate."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 4 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens the delegate is approved for."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "approve", + "docs": [ + "Approves a delegate. A delegate is given the authority over tokens on", + "behalf of the source account's owner." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account owner or its multisignature."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 5 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "revoke", + "docs": ["Revokes the delegate's authority."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "owned", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint or account to change the authority of."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": [ + "The current authority or the multisignature account of the mint or account to update." + ] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 6 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "authorityType", + "type": { "kind": "definedTypeLinkNode", "name": "authorityType" }, + "docs": ["The type of authority to update."] + }, + { + "kind": "instructionArgumentNode", + "name": "newAuthority", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "fixed": false + }, + "docs": ["The new authority"] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "setAuthority", + "docs": ["Sets a new authority of a mint or account."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint account."] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to mint tokens to."] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's minting authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 7 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of new tokens to mint."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "mintTo", + "docs": ["Mints new tokens to an account. The native mint does not support minting."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to burn from."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."], + "defaultValue": { "kind": "identityValueNode" } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["The amount of tokens to burn."], + "defaultValue": { "kind": "numberValueNode", "number": 8 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": [] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "burn", + "docs": [ + "Burns tokens by removing them from an account. `Burn` does not support", + "accounts associated with the native mint, use `CloseAccount` instead." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to close."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 9 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "closeAccount", + "docs": [ + "Close an account by transferring all its SOL to the destination account.", + "Non-native accounts may only be closed if its token amount is zero." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to freeze."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint freeze authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 10 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "freezeAccount", + "docs": ["Freeze an Initialized account using the Mint's freeze_authority (if set)."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to thaw."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint freeze authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 11 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "thawAccount", + "docs": ["Thaw a Frozen account using the Mint's freeze_authority (if set)."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "destination", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The destination account."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account's owner/delegate or its multisignature account."], + "defaultValue": { "kind": "identityValueNode" } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 12 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens to transfer."] + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Expected number of base 10 digits to the right of the decimal place."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "transferChecked", + "docs": [ + "Transfers tokens from one account to another either directly or via a", + "delegate. If this account is associated with the native mint then equal", + "amounts of SOL and Tokens will be transferred to the destination account.", + "", + "This instruction differs from Transfer in that the token mint and", + "decimals value is checked by the caller. This may be useful when", + "creating transactions offline or within a hardware wallet." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "source", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The source account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "delegate", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The delegate."] + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The source account owner or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 13 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens the delegate is approved for."] + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Expected number of base 10 digits to the right of the decimal place."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "approveChecked", + "docs": [ + "Approves a delegate. A delegate is given the authority over tokens on", + "behalf of the source account's owner.", + "", + "This instruction differs from Approve in that the token mint and", + "decimals value is checked by the caller. This may be useful when", + "creating transactions offline or within a hardware wallet." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint."] + }, + { + "kind": "instructionAccountNode", + "name": "token", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to mint tokens to."] + }, + { + "kind": "instructionAccountNode", + "name": "mintAuthority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The mint's minting authority or its multisignature account."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 14 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of new tokens to mint."] + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Expected number of base 10 digits to the right of the decimal place."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "mintToChecked", + "docs": [ + "Mints new tokens to an account. The native mint does not support minting.", + "", + "This instruction differs from MintTo in that the decimals value is", + "checked by the caller. This may be useful when creating transactions", + "offline or within a hardware wallet." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to burn from."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint."] + }, + { + "kind": "instructionAccountNode", + "name": "authority", + "isWritable": false, + "isSigner": "either", + "isOptional": false, + "docs": ["The account's owner/delegate or its multisignature account."], + "defaultValue": { "kind": "identityValueNode" } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 15 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens to burn."] + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Expected number of base 10 digits to the right of the decimal place."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "multiSigners" + }, + "isOptional": true, + "isSigner": true + } + ], + "name": "burnChecked", + "docs": [ + "Burns tokens by removing them from an account. `BurnChecked` does not", + "support accounts associated with the native mint, use `CloseAccount` instead.", + "", + "This instruction differs from Burn in that the decimals value is checked", + "by the caller. This may be useful when creating transactions offline or", + "within a hardware wallet." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint this account will be associated with."] + }, + { + "kind": "instructionAccountNode", + "name": "rent", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Rent sysvar."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 16 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "owner", + "type": { "kind": "publicKeyTypeNode" }, + "docs": ["The new account's owner/multisignature."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeAccount2", + "docs": [ + "Like InitializeAccount, but the owner pubkey is passed via instruction", + "data rather than the accounts list. This variant may be preferable", + "when using Cross Program Invocation from an instruction that does", + "not need the owner's `AccountInfo` otherwise." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The native token account to sync with its underlying lamports."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 17 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "syncNative", + "docs": [ + "Given a wrapped / native token account (a token account containing SOL)", + "updates its amount field based on the account's underlying `lamports`.", + "This is useful if a non-wrapped SOL account uses", + "`system_instruction::transfer` to move lamports to a wrapped token", + "account, and needs to have its token `amount` field updated." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint this account will be associated with."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 18 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "owner", + "type": { "kind": "publicKeyTypeNode" }, + "docs": ["The new account's owner/multisignature."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeAccount3", + "docs": ["Like InitializeAccount2, but does not require the Rent sysvar to be provided."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "multisig", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The multisignature account to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 19 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "m", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["The number of signers (M) required to validate this multisignature account."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "remainingAccounts": [ + { + "kind": "instructionRemainingAccountsNode", + "value": { + "kind": "argumentValueNode", + "name": "signers" + } + } + ], + "name": "initializeMultisig2", + "docs": ["Like InitializeMultisig, but does not require the Rent sysvar to be provided."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 20 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "decimals", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": ["Number of base 10 digits to the right of the decimal place."] + }, + { + "kind": "instructionArgumentNode", + "name": "mintAuthority", + "type": { "kind": "publicKeyTypeNode" }, + "docs": ["The authority/multisignature to mint tokens."] + }, + { + "kind": "instructionArgumentNode", + "name": "freezeAuthority", + "type": { + "kind": "optionTypeNode", + "item": { "kind": "publicKeyTypeNode" }, + "prefix": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "fixed": false + }, + "defaultValue": { + "kind": "noneValueNode" + }, + "docs": ["The optional freeze authority/multisignature of the mint."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeMint2", + "docs": ["Like [`InitializeMint`], but does not require the Rent sysvar to be provided."], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to calculate for."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 21 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "getAccountDataSize", + "docs": [ + "Gets the required size of an account for the given mint as a", + "little-endian `u64`.", + "", + "Return data can be fetched using `sol_get_return_data` and deserializing", + "the return data as a little-endian `u64`." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "account", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["The account to initialize."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 22 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "initializeImmutableOwner", + "docs": [ + "Initialize the Immutable Owner extension for the given token account", + "", + "Fails if the account has already been initialized, so must be called", + "before `InitializeAccount`.", + "", + "No-ops in this version of the program, but is included for compatibility", + "with the Associated Token Account program." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to calculate for."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 23 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "amount", + "type": { + "kind": "numberTypeNode", + "format": "u64", + "endian": "le" + }, + "docs": ["The amount of tokens to reformat."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "amountToUiAmount", + "docs": [ + "Convert an Amount of tokens to a UiAmount `string`, using the given", + "mint. In this version of the program, the mint can only specify the", + "number of decimals.", + "", + "Fails on an invalid mint.", + "", + "Return data can be fetched using `sol_get_return_data` and deserialized", + "with `String::from_utf8`." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The mint to calculate for."] + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 24 }, + "defaultValueStrategy": "omitted" + }, + { + "kind": "instructionArgumentNode", + "name": "uiAmount", + "type": { + "kind": "stringTypeNode", + "encoding": "utf8" + }, + "docs": ["The ui_amount of tokens to reformat."] + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "uiAmountToAmount", + "docs": [ + "Convert a UiAmount of tokens to a little-endian `u64` raw Amount, using", + "the given mint. In this version of the program, the mint can only", + "specify the number of decimals.", + "", + "Return data can be fetched using `sol_get_return_data` and deserializing", + "the return data as a little-endian `u64`." + ], + "optionalAccountStrategy": "programId" + } + ], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "accountState", + "type": { + "kind": "enumTypeNode", + "variants": [ + { "kind": "enumEmptyVariantTypeNode", "name": "uninitialized" }, + { "kind": "enumEmptyVariantTypeNode", "name": "initialized" }, + { "kind": "enumEmptyVariantTypeNode", "name": "frozen" } + ], + "size": { "kind": "numberTypeNode", "format": "u8", "endian": "le" } + }, + "docs": [] + }, + { + "kind": "definedTypeNode", + "name": "authorityType", + "type": { + "kind": "enumTypeNode", + "variants": [ + { "kind": "enumEmptyVariantTypeNode", "name": "mintTokens" }, + { "kind": "enumEmptyVariantTypeNode", "name": "freezeAccount" }, + { "kind": "enumEmptyVariantTypeNode", "name": "accountOwner" }, + { "kind": "enumEmptyVariantTypeNode", "name": "closeAccount" } + ], + "size": { "kind": "numberTypeNode", "format": "u8", "endian": "le" } + }, + "docs": [] + } + ], + "errors": [ + { + "kind": "errorNode", + "name": "notRentExempt", + "code": 0, + "message": "Lamport balance below rent-exempt threshold", + "docs": ["NotRentExempt: Lamport balance below rent-exempt threshold"] + }, + { + "kind": "errorNode", + "name": "insufficientFunds", + "code": 1, + "message": "Insufficient funds", + "docs": ["InsufficientFunds: Insufficient funds"] + }, + { + "kind": "errorNode", + "name": "invalidMint", + "code": 2, + "message": "Invalid Mint", + "docs": ["InvalidMint: Invalid Mint"] + }, + { + "kind": "errorNode", + "name": "mintMismatch", + "code": 3, + "message": "Account not associated with this Mint", + "docs": ["MintMismatch: Account not associated with this Mint"] + }, + { + "kind": "errorNode", + "name": "ownerMismatch", + "code": 4, + "message": "Owner does not match", + "docs": ["OwnerMismatch: Owner does not match"] + }, + { + "kind": "errorNode", + "name": "fixedSupply", + "code": 5, + "message": "Fixed supply", + "docs": ["FixedSupply: Fixed supply"] + }, + { + "kind": "errorNode", + "name": "alreadyInUse", + "code": 6, + "message": "Already in use", + "docs": ["AlreadyInUse: Already in use"] + }, + { + "kind": "errorNode", + "name": "invalidNumberOfProvidedSigners", + "code": 7, + "message": "Invalid number of provided signers", + "docs": ["InvalidNumberOfProvidedSigners: Invalid number of provided signers"] + }, + { + "kind": "errorNode", + "name": "invalidNumberOfRequiredSigners", + "code": 8, + "message": "Invalid number of required signers", + "docs": ["InvalidNumberOfRequiredSigners: Invalid number of required signers"] + }, + { + "kind": "errorNode", + "name": "uninitializedState", + "code": 9, + "message": "State is unititialized", + "docs": ["UninitializedState: State is unititialized"] + }, + { + "kind": "errorNode", + "name": "nativeNotSupported", + "code": 10, + "message": "Instruction does not support native tokens", + "docs": ["NativeNotSupported: Instruction does not support native tokens"] + }, + { + "kind": "errorNode", + "name": "nonNativeHasBalance", + "code": 11, + "message": "Non-native account can only be closed if its balance is zero", + "docs": ["NonNativeHasBalance: Non-native account can only be closed if its balance is zero"] + }, + { + "kind": "errorNode", + "name": "invalidInstruction", + "code": 12, + "message": "Invalid instruction", + "docs": ["InvalidInstruction: Invalid instruction"] + }, + { + "kind": "errorNode", + "name": "invalidState", + "code": 13, + "message": "State is invalid for requested operation", + "docs": ["InvalidState: State is invalid for requested operation"] + }, + { + "kind": "errorNode", + "name": "overflow", + "code": 14, + "message": "Operation overflowed", + "docs": ["Overflow: Operation overflowed"] + }, + { + "kind": "errorNode", + "name": "authorityTypeNotSupported", + "code": 15, + "message": "Account does not support specified authority type", + "docs": ["AuthorityTypeNotSupported: Account does not support specified authority type"] + }, + { + "kind": "errorNode", + "name": "mintCannotFreeze", + "code": 16, + "message": "This token mint cannot freeze accounts", + "docs": ["MintCannotFreeze: This token mint cannot freeze accounts"] + }, + { + "kind": "errorNode", + "name": "accountFrozen", + "code": 17, + "message": "Account is frozen", + "docs": ["AccountFrozen: Account is frozen"] + }, + { + "kind": "errorNode", + "name": "mintDecimalsMismatch", + "code": 18, + "message": "The provided decimals value different from the Mint decimals", + "docs": ["MintDecimalsMismatch: The provided decimals value different from the Mint decimals"] + }, + { + "kind": "errorNode", + "name": "nonNativeNotSupported", + "code": 19, + "message": "Instruction does not support non-native tokens", + "docs": ["NonNativeNotSupported: Instruction does not support non-native tokens"] + } + ], + "name": "token", + "prefix": "", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "version": "3.3.0", + "origin": "shank" + }, + "additionalPrograms": [ + { + "kind": "programNode", + "pdas": [ + { + "kind": "pdaNode", + "name": "associatedToken", + "seeds": [ + { + "kind": "variablePdaSeedNode", + "name": "owner", + "docs": ["The wallet address of the associated token account."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "tokenProgram", + "docs": ["The address of the token program to use."], + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "variablePdaSeedNode", + "name": "mint", + "docs": ["The mint address of the associated token account."], + "type": { + "kind": "publicKeyTypeNode" + } + } + ] + } + ], + "accounts": [], + "instructions": [ + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Funding account (must be a system account)."], + "defaultValue": { "kind": "payerValueNode" } + }, + { + "kind": "instructionAccountNode", + "name": "ata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Associated token account address to be created."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "owner" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet address for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 0 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "createAssociatedToken", + "docs": [ + "Creates an associated token account for the given wallet address and", + "token mint Returns an error if the account exists." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "payer", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Funding account (must be a system account)."], + "defaultValue": { "kind": "payerValueNode" } + }, + { + "kind": "instructionAccountNode", + "name": "ata", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Associated token account address to be created."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "owner" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "mint" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "owner", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet address for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "mint", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["The token mint for the new associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "systemProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["System program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "11111111111111111111111111111111" + } + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 1 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "createAssociatedTokenIdempotent", + "docs": [ + "Creates an associated token account for the given wallet address and", + "token mint, if it doesn't already exist. Returns an error if the", + "account exists, but with a different owner." + ], + "optionalAccountStrategy": "programId" + }, + { + "kind": "instructionNode", + "accounts": [ + { + "kind": "instructionAccountNode", + "name": "nestedAssociatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": [ + "Nested associated token account, must be owned by `ownerAssociatedAccountAddress`." + ], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "ownerAssociatedAccountAddress" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "nestedTokenMintAddress" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "nestedTokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint for the nested associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "destinationAssociatedAccountAddress", + "isWritable": true, + "isSigner": false, + "isOptional": false, + "docs": ["Wallet's associated token account."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "walletAddress" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "nestedTokenMintAddress" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "ownerAssociatedAccountAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Owner associated token account address, must be owned by `walletAddress`."], + "defaultValue": { + "kind": "pdaValueNode", + "pda": { + "kind": "pdaLinkNode", + "name": "associatedToken" + }, + "seeds": [ + { + "kind": "pdaSeedValueNode", + "name": "owner", + "value": { + "kind": "accountValueNode", + "name": "walletAddress" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "tokenProgram", + "value": { + "kind": "accountValueNode", + "name": "tokenProgram" + } + }, + { + "kind": "pdaSeedValueNode", + "name": "mint", + "value": { + "kind": "accountValueNode", + "name": "ownerTokenMintAddress" + } + } + ] + } + }, + { + "kind": "instructionAccountNode", + "name": "ownerTokenMintAddress", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["Token mint for the owner associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "walletAddress", + "isWritable": true, + "isSigner": true, + "isOptional": false, + "docs": ["Wallet address for the owner associated token account."] + }, + { + "kind": "instructionAccountNode", + "name": "tokenProgram", + "isWritable": false, + "isSigner": false, + "isOptional": false, + "docs": ["SPL Token program."], + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + } + } + ], + "arguments": [ + { + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "kind": "numberTypeNode", + "format": "u8", + "endian": "le" + }, + "docs": [], + "defaultValue": { "kind": "numberValueNode", "number": 2 }, + "defaultValueStrategy": "omitted" + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "name": "recoverNestedAssociatedToken", + "docs": [ + "Transfers from and closes a nested associated token account: an", + "associated token account owned by an associated token account.", + "", + "The tokens are moved from the nested associated token account to the", + "wallet's associated token account, and the nested account lamports are", + "moved to the wallet.", + "", + "Note: Nested token accounts are an anti-pattern, and almost always", + "created unintentionally, so this instruction should only be used to", + "recover from errors." + ], + "optionalAccountStrategy": "programId" + } + ], + "definedTypes": [], + "errors": [ + { + "kind": "errorNode", + "name": "invalidOwner", + "code": 0, + "message": "Associated token account owner does not match address derivation", + "docs": ["InvalidOwner: Associated token account owner does not match address derivation"] + } + ], + "name": "associatedToken", + "prefix": "", + "publicKey": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", + "version": "1.1.1", + "origin": "shank" + } + ], + "standard": "codama", + "version": "1.0.0" +} diff --git a/packages/dynamic-client/test/programs/mpl-token-metadata/create-with-resolvers.test.ts b/packages/dynamic-client/test/programs/mpl-token-metadata/create-with-resolvers.test.ts new file mode 100644 index 000000000..ac825c9ae --- /dev/null +++ b/packages/dynamic-client/test/programs/mpl-token-metadata/create-with-resolvers.test.ts @@ -0,0 +1,230 @@ +import { + findMasterEditionPda, + findMetadataPda, + getMetadataDecoder, + TokenStandard, +} from '@metaplex-foundation/mpl-token-metadata-kit'; +import { address } from '@solana/addresses'; +import { some } from '@solana/codecs'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { CreateArgs } from '../generated/mpl-token-metadata-idl-types'; +import { SvmTestContext } from '../test-utils'; +import { createMint } from '../token/token-test-utils'; +import { loadMplProgram, programClient } from './helpers'; + +function buildFungibleArgs(): CreateArgs { + return { + createArgs: { + __kind: 'v1', + collection: null, + collectionDetails: null, + creators: null, + decimals: null, + isMutable: true, + name: 'Test NFT', + primarySaleHappened: false, + printSupply: null, + ruleSet: null, + sellerFeeBasisPoints: 500, + symbol: 'TST', + tokenStandard: 'fungible', + uri: 'https://example.com/metadata.json', + uses: null, + }, + }; +} + +describe('MPL Token Metadata: create with resolvers', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true, sysvars: true }); + loadMplProgram(ctx, programClient.programAddress); + }); + + test('should auto-resolve splTokenProgram when resolveIsNonFungibleOrIsMintSigner returns true', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [metadataPda] = await findMetadataPda({ mint }); + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const expectedAccounts = [ + metadataPda, + masterEditionPda, + mint, + mintAuthority, + payer, + mintAuthority, + ctx.SYSTEM_PROGRAM_ADDRESS, + ctx.SYSVAR_INSTRUCTIONS_ADDRESS, + address('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'), // from ifTrue branch + ]; + + const ix = await programClient.methods + .create(buildFungibleArgs()) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + // splTokenProgram omitted — should be auto-resolved via defaultValue resolver + }) + .signers(['mint']) + .resolvers({ + // conditionalValueNode -> resolveIsNonFungibleOrIsMintSigner -> ifTrue branch -> publicKeyValueNode + resolveIsNonFungibleOrIsMintSigner: async () => await Promise.resolve(true), + }) + .instruction(); + + expect(ix.accounts?.length).toBe(9); + expectedAccounts.forEach((expected, i) => { + expect(expected, `Account mismatch at index ${i}`).toBe(ix.accounts?.[i].address); + }); + + await ctx.sendInstruction(ix, [payer, mintAuthority, mint]); + + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + }); + + test('should resolve splTokenProgram to programId when resolver returns false (optionalAccountStrategy=programId)', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const ix = await programClient.methods + .create(buildFungibleArgs()) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + }) + .signers(['mint']) + .resolvers({ + resolveIsNonFungibleOrIsMintSigner: async () => await Promise.resolve(false), + }) + .instruction(); + + // resolver returns false -> ifFalse is undefined -> conditional returns null + // optional optionalAccountStrategy=programId resolves to program ID + expect(ix.accounts?.length).toBe(9); + expect(ix.accounts?.[ix.accounts.length - 1].address).toBe(programClient.programAddress); + + await ctx.sendInstruction(ix, [payer, mintAuthority, mint]); + const [metadataPda] = await findMetadataPda({ mint }); + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + }); + + test('should use user-provided account and bypass resolver', async () => { + const payer = await ctx.createFundedAccount(); + const splTokenProgramMock = await ctx.createAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const ix = await programClient.methods + .create(buildFungibleArgs()) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + splTokenProgram: splTokenProgramMock, + }) + .signers(['mint']) + .resolvers({ + // This resolver should not be called since splTokenProgram is explicitly provided + resolveIsNonFungibleOrIsMintSigner: async () => { + return await Promise.reject( + new Error('Resolver should not be called for explicitly provided account'), + ); + }, + }) + .instruction(); + + expect(ix.accounts?.[ix.accounts.length - 1].address).toBe(splTokenProgramMock); + + await ctx.sendInstruction(ix, [payer, mintAuthority, mint]); + const [metadataPda] = await findMetadataPda({ mint }); + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + }); + + test('should work without calling .resolvers()', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const ix = await programClient.methods + .create(buildFungibleArgs()) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + splTokenProgram: null, // auto resolution via optionalAccountStrategy into programId + }) + .signers(['mint']) + .instruction(); + + expect(ix.programAddress).toBe(programClient.programAddress); + expect(ix.accounts?.length).toBe(9); + expect(ix.accounts?.[ix.accounts.length - 1].address).toBe(programClient.programAddress); + + await ctx.sendInstruction(ix, [payer, mintAuthority, mint]); + const [metadataPda] = await findMetadataPda({ mint }); + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + }); + + test('should fallback to optionalAccountStrategy when no resolver and no account provided', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + // undefined splTokenProgram triggers defaultValue auto-resolution. + // defaultValue is conditionalValueNode with undefined ifFalse branch + // Without resolvers provided, condition should choose ifFalse branch + // Optional account should be resolved into programId via optionalAccountStrategy + const ix = await programClient.methods + .create(buildFungibleArgs()) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + }) + .signers(['mint']) + .instruction(); + + expect(ix.accounts?.length).toBe(9); + expect(ix.accounts?.[ix.accounts.length - 1].address).toBe(programClient.programAddress); + + await ctx.sendInstruction(ix, [payer, mintAuthority, mint]); + const [metadataPda] = await findMetadataPda({ mint }); + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + }); +}); diff --git a/packages/dynamic-client/test/programs/mpl-token-metadata/create.test.ts b/packages/dynamic-client/test/programs/mpl-token-metadata/create.test.ts new file mode 100644 index 000000000..44b0158de --- /dev/null +++ b/packages/dynamic-client/test/programs/mpl-token-metadata/create.test.ts @@ -0,0 +1,215 @@ +import { + findMasterEditionPda, + findMetadataPda, + getMetadataDecoder, + TokenStandard, +} from '@metaplex-foundation/mpl-token-metadata-kit'; +import { none, some } from '@solana/codecs'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { CreateArgs } from '../generated/mpl-token-metadata-idl-types'; +import { SvmTestContext } from '../test-utils'; +import { createMint } from '../token/token-test-utils'; +import { loadMplProgram, programClient } from './helpers'; + +describe('MPL Token Metadata: create', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true, sysvars: true }); + loadMplProgram(ctx, programClient.programAddress); + }); + + test('should construct a valid create instruction', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [metadataPda] = await findMetadataPda({ mint }); + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const expectedAccounts = [ + metadataPda, + masterEditionPda, + mint, + mintAuthority, + payer, + mintAuthority, + ctx.SYSTEM_PROGRAM_ADDRESS, + ctx.SYSVAR_INSTRUCTIONS_ADDRESS, + programClient.programAddress, + ]; + + const args: CreateArgs = { + createArgs: { + __kind: 'v1', + collection: null, + collectionDetails: null, + creators: null, + decimals: null, + isMutable: true, + name: 'Test NFT', + primarySaleHappened: false, + printSupply: null, + ruleSet: null, + sellerFeeBasisPoints: 500, + symbol: 'TST', + tokenStandard: 'fungible', + uri: 'https://example.com/metadata.json', + uses: null, + }, + }; + const ix = await programClient.methods + .create(args) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + splTokenProgram: null, // auto-derived via optionalAccountStrategy into programClient.programAddress + // metadata: metadataPda, // auto-derived pda, can be omitted + // updateAuthority: mintAuthority, // auto-derived into "authority" , can be omitted + }) + .instruction(); + + expect(ix.accounts?.length).toBe(9); + expectedAccounts.forEach((expected, i) => { + expect(expected, `Account mismatch at index ${i}`).toBe(ix.accounts?.[i].address); + }); + + await ctx.sendInstruction(ix, [payer, mintAuthority]); + + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + + expect(metadata.name).toBe(args.createArgs.name); + expect(metadata.symbol).toBe(args.createArgs.symbol); + expect(metadata.uri).toBe(args.createArgs.uri); + expect(metadata.sellerFeeBasisPoints).toBe(args.createArgs.sellerFeeBasisPoints); + expect(metadata.primarySaleHappened).toBe(args.createArgs.primarySaleHappened); + expect(metadata.isMutable).toBe(args.createArgs.isMutable); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + expect(metadata.collection).toEqual(none()); + expect(metadata.collectionDetails).toEqual(none()); + expect(metadata.creators).toEqual(none()); + expect(metadata.uses).toEqual(none()); + }); + + test('should throw ValidationError for invalid sellerFeeBasisPoints [amountValueNode]', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const args: CreateArgs = { + createArgs: { + __kind: 'v1', + collection: null, + collectionDetails: null, + creators: null, + decimals: null, + isMutable: true, + name: 'Test NFT', + primarySaleHappened: false, + printSupply: null, + ruleSet: null, + sellerFeeBasisPoints: 'not a number' as unknown as number, // invalid value for amountValueNode + symbol: 'TST', + tokenStandard: 'fungible', + uri: 'https://example.com/metadata.json', + uses: null, + }, + }; + + await expect( + programClient.methods + .create(args) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + splTokenProgram: null, + }) + .instruction(), + ).rejects.toThrowError(/Invalid argument "createArgs"/); + }); + + test('should construct a create instruction with mint as signer and provided TokenProgram', async () => { + const payer = await ctx.createFundedAccount(); + const mintAuthority = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + await createMint(ctx, payer, mint, mintAuthority); + + const [metadataPda] = await findMetadataPda({ mint }); + const [masterEditionPda] = await findMasterEditionPda({ mint }); + + const expectedAccounts = [ + metadataPda, + masterEditionPda, + mint, + mintAuthority, + payer, + mintAuthority, + ctx.SYSTEM_PROGRAM_ADDRESS, + ctx.SYSVAR_INSTRUCTIONS_ADDRESS, + ctx.TOKEN_PROGRAM_ADDRESS, + ]; + + const args: CreateArgs = { + createArgs: { + __kind: 'v1', + collection: null, + collectionDetails: null, + creators: null, + decimals: null, + isMutable: true, + name: 'Test NFT', + primarySaleHappened: false, + printSupply: null, + ruleSet: null, + sellerFeeBasisPoints: 500n, + symbol: 'TST', + tokenStandard: 'fungible', + uri: 'https://example.com/metadata.json', + uses: null, + }, + }; + + const ix = await programClient.methods + .create(args) + .accounts({ + authority: mintAuthority, + masterEdition: masterEditionPda, + mint, + payer, + splTokenProgram: ctx.TOKEN_PROGRAM_ADDRESS, // explicitly provide to skip auto-derivation with ResolverValueNode which is not supported yet + }) + .signers(['mint']) + .instruction(); + + expect(ix.accounts?.length).toBe(9); + expectedAccounts.forEach((expected, i) => { + expect(expected, `Account mismatch at index ${i}`).toBe(ix.accounts?.[i].address); + }); + + await ctx.sendInstruction(ix, [payer, mintAuthority, mint]); + + const metadataAccountInfo = ctx.requireEncodedAccount(metadataPda); + const metadata = getMetadataDecoder().decode(metadataAccountInfo.data); + + expect(metadata.name).toBe(args.createArgs.name); + expect(metadata.symbol).toBe(args.createArgs.symbol); + expect(metadata.uri).toBe(args.createArgs.uri); + expect(metadata.sellerFeeBasisPoints).toBe(Number(args.createArgs.sellerFeeBasisPoints)); + expect(metadata.primarySaleHappened).toBe(args.createArgs.primarySaleHappened); + expect(metadata.isMutable).toBe(args.createArgs.isMutable); + expect(metadata.tokenStandard).toEqual(some(TokenStandard.Fungible)); + expect(metadata.collection).toEqual(none()); + expect(metadata.collectionDetails).toEqual(none()); + expect(metadata.creators).toEqual(none()); + expect(metadata.uses).toEqual(none()); + }); +}); diff --git a/packages/dynamic-client/test/programs/mpl-token-metadata/helpers.ts b/packages/dynamic-client/test/programs/mpl-token-metadata/helpers.ts new file mode 100644 index 000000000..2e9651c6f --- /dev/null +++ b/packages/dynamic-client/test/programs/mpl-token-metadata/helpers.ts @@ -0,0 +1,16 @@ +import path from 'node:path'; + +import { type Address } from '@solana/addresses'; + +import type { MplTokenMetadataProgramClient } from '../generated/mpl-token-metadata-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +export const programClient = createTestProgramClient('mpl-token-metadata-idl.json'); + +/** + * Loads compiled MPL program binary located at '../dumps/mpl-token-metadata.so' into the test context at the specified program address. + */ +export function loadMplProgram(ctx: SvmTestContext, programAddress: Address): void { + const programPath = path.resolve(__dirname, '..', 'dumps', 'mpl-token-metadata.so'); + ctx.loadProgram(programAddress, programPath); +} diff --git a/packages/dynamic-client/test/programs/pmp/allocate.test.ts b/packages/dynamic-client/test/programs/pmp/allocate.test.ts new file mode 100644 index 000000000..514afc083 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/allocate.test.ts @@ -0,0 +1,96 @@ +import { type Address } from '@solana/addresses'; +import type { Some } from '@solana/codecs'; +import { AccountDiscriminator } from '@solana-program/program-metadata'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { decodeBufferAccount, loadPmpProgram, programClient, setupCanonicalPda, setupNonCanonicalPda } from './helpers'; + +describe('Program Metadata: allocate', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should allocate with seed null', async () => { + const bufferAndAuthority = await ctx.createFundedAccount(); + + const ix = await programClient.methods + .allocate({ seed: null }) + .accounts({ + authority: bufferAndAuthority, + buffer: bufferAndAuthority, + program: null, + programData: null, + }) + .instruction(); + + await ctx.sendInstruction(ix, [bufferAndAuthority]); + + const account = ctx.requireEncodedAccount(bufferAndAuthority); + + const buffer = decodeBufferAccount(account.data); + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + expect(buffer.canonical).toBe(false); + expect(buffer.program).toEqual({ __option: 'None' }); + expect((buffer.authority as Some
).value).toBe(bufferAndAuthority); + }); + + test('should allocate canonical PDA buffer', async () => { + const seed = 'idl'; + const { authority, programAddress, programDataAddress, pda: bufferPda } = await setupCanonicalPda(ctx, seed); + + const ix = await programClient.methods + .allocate({ seed }) + .accounts({ + authority, + buffer: bufferPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(bufferPda); + expect(account.owner).toBe(programClient.programAddress); + expect(account.data.length).gt(0); + + const buffer = decodeBufferAccount(account.data); + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + expect(buffer.canonical).toBe(true); + expect(buffer.program).toEqual({ __option: 'Some', value: programAddress }); + expect(buffer.authority).toEqual({ __option: 'Some', value: authority }); + expect(buffer.seed).toBe(seed); + }); + + test('should allocate non-canonical PDA buffer', async () => { + const seed = 'idl'; + const { authority, programAddress, programDataAddress, pda: bufferPda } = await setupNonCanonicalPda(ctx, seed); + + const ix = await programClient.methods + .allocate({ seed }) + .accounts({ + authority, + buffer: bufferPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(bufferPda); + expect(account.owner).toBe(programClient.programAddress); + expect(account.data.length).gt(0); + + const buffer = decodeBufferAccount(account.data); + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + expect(buffer.canonical).toBe(false); + expect(buffer.program).toEqual({ __option: 'Some', value: programAddress }); + expect(buffer.authority).toEqual({ __option: 'Some', value: authority }); + expect(buffer.seed).toBe(seed); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/close.test.ts b/packages/dynamic-client/test/programs/pmp/close.test.ts new file mode 100644 index 000000000..f900188a2 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/close.test.ts @@ -0,0 +1,141 @@ +import { type Address } from '@solana/addresses'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + allocateBufferAccount, + decodeBufferAccount, + initializeCanonicalMetadata, + loadPmpProgram, + programClient, + setupCanonicalPda, +} from './helpers'; + +describe('Program Metadata: close', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should close canonical PDA buffer', async () => { + const destination = await ctx.createFundedAccount(); + const { authority, programAddress, programDataAddress, pda: bufferPda } = await setupCanonicalPda(ctx); + + const allocateIx = await programClient.methods + .allocate({ seed: 'idl' }) + .accounts({ + authority, + buffer: bufferPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(allocateIx, [authority]); + + const bufferAccount = ctx.requireEncodedAccount(bufferPda); + expect(bufferAccount).not.toBeNull(); + + const destinationBalanceBefore = ctx.getBalanceOrZero(destination); + + const closeIx = await programClient.methods + .close() + .accounts({ + account: bufferPda, + authority, + destination, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(closeIx, [authority]); + + const closedAccount = ctx.fetchEncodedAccount(bufferPda); + expect(closedAccount).toBeNull(); + + const destinationBalanceAfter = ctx.getBalanceOrZero(destination); + expect(destinationBalanceAfter).toBeGreaterThan(destinationBalanceBefore); + }); + + test('should close mutable metadata', async () => { + const destination = await ctx.createFundedAccount(); + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx); + + const destinationBalanceBefore = ctx.getBalanceOrZero(destination); + + const closeIx = await programClient.methods + .close() + .accounts({ + account: metadataPda, + authority, + destination, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(closeIx, [authority]); + + const closedAccount = ctx.fetchEncodedAccount(metadataPda); + expect(closedAccount).toBeNull(); + + const destinationBalanceAfter = ctx.getBalanceOrZero(destination); + expect(destinationBalanceAfter).toBeGreaterThan(destinationBalanceBefore); + }); + + test('should close buffer account', async () => { + const feePayer = await ctx.createFundedAccount(); + const destination = await ctx.createFundedAccount(); + const { bufferAccount } = await allocateBufferAccount(ctx); + + const buffer = ctx.requireEncodedAccount(bufferAccount); + const decoded = decodeBufferAccount(buffer.data); + expect(decoded.canonical).toBe(false); + + const destinationBalanceBefore = ctx.getBalanceOrZero(destination); + + const closeIx = await programClient.methods + .close() + .accounts({ + account: bufferAccount, + authority: bufferAccount, + destination, + program: null, + programData: null, + }) + .instruction(); + + await ctx.sendInstruction(closeIx, [feePayer, bufferAccount]); + + const destinationBalanceAfter = ctx.getBalanceOrZero(destination); + expect(destinationBalanceAfter).toBeGreaterThan(destinationBalanceBefore); + + const closedAccount = ctx.fetchEncodedAccount(bufferAccount); + expect(closedAccount).toBeNull(); + }); + + test('should throw AccountError when destination is missing', async () => { + const authority = await ctx.createFundedAccount(); + + await expect( + programClient.methods + .close() + .accounts({ + account: authority, + authority, + destination: undefined as unknown as Address, + program: null, + programData: null, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[destination\]/); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/extend.test.ts b/packages/dynamic-client/test/programs/pmp/extend.test.ts new file mode 100644 index 000000000..cff9930bc --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/extend.test.ts @@ -0,0 +1,105 @@ +import { type Address } from '@solana/addresses'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + allocateBufferAccount, + decodeMetadataAccount, + initializeCanonicalMetadata, + loadPmpProgram, + programClient, +} from './helpers'; + +describe('Program Metadata: extend', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should extend buffer capacity', async () => { + const feePayer = await ctx.createFundedAccount(); + const { bufferAccount } = await allocateBufferAccount(ctx); + + const accountBefore = ctx.requireEncodedAccount(bufferAccount); + const sizeBefore = accountBefore.data.length; + + const extendLength = 500; + const extendIx = await programClient.methods + .extend({ length: extendLength }) + .accounts({ + account: bufferAccount, + authority: bufferAccount, + program: null, + programData: null, + }) + .instruction(); + + await ctx.sendInstruction(extendIx, [feePayer, bufferAccount]); + + const accountAfter = ctx.requireEncodedAccount(bufferAccount); + expect(accountAfter.data.length).toBe(sizeBefore + extendLength); + }); + + test('should extend canonical metadata capacity', async () => { + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx); + + const accountBefore = ctx.requireEncodedAccount(metadataPda); + const sizeBefore = accountBefore.data.length; + + const extendLength = 500; + const extendIx = await programClient.methods + .extend({ length: extendLength }) + .accounts({ + account: metadataPda, + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(extendIx, [authority]); + + const accountAfter = ctx.requireEncodedAccount(metadataPda); + expect(accountAfter.data.length).toBe(sizeBefore + extendLength); + + const metadata = decodeMetadataAccount(accountAfter.data); + expect(metadata.canonical).toBe(true); + }); + + test('should throw ArgumentError when length argument is missing', async () => { + const authority = await ctx.createFundedAccount(); + + await expect( + programClient.methods + .extend({ length: undefined as unknown as number }) + .accounts({ + account: authority, + authority, + program: null, + programData: null, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "length"/); + }); + + test('should throw AccountError when required account is missing', async () => { + await expect( + programClient.methods + .extend({ length: 100 }) + .accounts({ + account: undefined as unknown as Address, + authority: undefined as unknown as Address, + program: null, + programData: null, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[account\]/); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/helpers.ts b/packages/dynamic-client/test/programs/pmp/helpers.ts new file mode 100644 index 000000000..f575d2b58 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/helpers.ts @@ -0,0 +1,279 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +import { type Address, getAddressEncoder, getProgramDerivedAddress } from '@solana/addresses'; +import { getOptionEncoder, getStructEncoder, getU32Encoder, getU64Encoder, none, some } from '@solana/codecs'; +import { + type Buffer as PmpBuffer, + getBufferDecoder, + getMetadataDecoder, + type Metadata as PmpMetadata, +} from '@solana-program/program-metadata'; + +import type { SvmTestContext } from '../../svm-test-context'; +import type { ProgramMetadataProgramClient } from '../generated/pmp-idl-types'; +import { createTestProgramClient } from '../test-utils'; + +export const programClient = createTestProgramClient('pmp-idl.json'); +export const PMP_PROGRAM_ID = programClient.programAddress; +export const exampleProgramPath = path.join(__dirname, '../dumps/pmp.so'); + +/** + * Creates a 16-byte seed buffer from a string for PDA derivation. + * + * PMP seeds are fixed-size 16-byte UTF-8 strings. If the input string is shorter + * than 16 bytes, then we want to pad it with zeros. If longer, it's truncated. + * + * @param seed - The seed string (max 16 bytes UTF-8) + * @returns A 16-byte Uint8Array + */ +export function encodeSeedForPda(seed: string): Uint8Array { + const seedBytes = new TextEncoder().encode(seed); + const buffer = new Uint8Array(16); + buffer.set(seedBytes.slice(0, 16)); // Copy up to 16 bytes + return buffer; +} + +export function decodeBufferAccount(data: Uint8Array): PmpBuffer { + const decoder = getBufferDecoder(); + return decoder.decode(data); +} + +export function decodeMetadataAccount(data: Uint8Array): PmpMetadata { + const decoder = getMetadataDecoder(); + return decoder.decode(data); +} + +/** + * Loads compiled PMP program binary located at '../dumps/pmp.so' into the test context at the specified program address. + */ +export function loadPmpProgram(ctx: SvmTestContext, programAddress: Address): void { + const programPath = path.resolve(__dirname, '..', 'dumps', 'pmp.so'); + ctx.loadProgram(programAddress, programPath); +} + +/** Helper for creating canonical Metadata. */ +export async function initializeCanonicalMetadata(ctx: SvmTestContext, options?: { data?: Uint8Array; seed?: string }) { + const seed = options?.seed ?? 'idl'; + const data = options?.data ?? new TextEncoder().encode('{"name":"test"}'); + const result = await setupCanonicalPda(ctx, seed); + + const initIx = await programClient.methods + .initialize({ + compression: 'none', + data, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority: result.authority, + program: result.programAddress, + programData: result.programDataAddress, + }) + .instruction(); + await ctx.sendInstruction(initIx, [result.authority]); + + return result; +} + +/** Helper for creating non-canonical Metadata. */ +export async function initializeNonCanonicalMetadata( + ctx: SvmTestContext, + options?: { data?: Uint8Array; seed?: string }, +) { + const seed = options?.seed ?? 'idl'; + const data = options?.data ?? new TextEncoder().encode('non-canonical data'); + const result = await setupNonCanonicalPda(ctx, seed); + + const initIx = await programClient.methods + .initialize({ + compression: 'none', + data, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority: result.authority, + program: result.programAddress, + programData: null, + }) + .instruction(); + await ctx.sendInstruction(initIx, [result.authority]); + + return result; +} + +/** + * Helper to create common required accounts for canonical PMP use cases. + * - Creates Upgradable Program Accounts for LiteSVM. + * - Creates a canonical PDA (program upgradeAuthority), i.e [programAddress, seed]. + */ +export async function setupCanonicalPda(ctx: SvmTestContext, seed = 'idl') { + const authority = await ctx.createFundedAccount(); + const testProgramAddress = await ctx.createAccount(); + + const { programAddress, programDataAddress } = await setUpgradeableProgramAccounts( + ctx, + exampleProgramPath, + testProgramAddress, + authority, + ); + + const pda = await deriveCanonicalPda(programAddress, seed); + ctx.airdropToAddress(pda, BigInt(10_000_000_000)); + + return { authority, pda, programAddress, programDataAddress }; +} + +/** + * Helper to create common required accounts for non-canonical PMP use cases. + * - Creates Upgradable Program Accounts for LiteSVM. + * - Creates a non-canonical PDA (arbitrary authority), i.e [programAddress, authority, seed]. + */ +export async function setupNonCanonicalPda(ctx: SvmTestContext, seed = 'idl') { + const authority = await ctx.createFundedAccount(); + const programDataAuthority = await ctx.createFundedAccount(); + const testProgramAddress = await ctx.createAccount(); + + const { programAddress, programDataAddress } = await setUpgradeableProgramAccounts( + ctx, + exampleProgramPath, + testProgramAddress, + programDataAuthority, + ); + + const pda = await deriveNonCanonicalPda(programAddress, authority, seed); + ctx.airdropToAddress(pda, BigInt(10_000_000_000)); + + return { authority, pda, programAddress, programDataAddress, programDataAuthority }; +} + +/** + * Manually creates BPF Loader Upgradeable accounts for a program in LiteSVM. + * since LiteSVM's loadProgram() doesn't create ProgramData accounts + * + * This allows testing canonical vs non-canonical scenarios: + * - Canonical: authority matches ProgramData.upgrade_authority + * - Non-canonical: authority does NOT match ProgramData.upgrade_authority + * + * How it works: + * - Derives the ProgramData address (PDA with seeds: [program_address]) + * - Reads the program bytecode from file + * - Creates ProgramData account with custom authority + bytecode + * - Creates Program account pointing to ProgramData + * - Both accounts are owned by BPF Loader Upgradeable + * + * @param ctx - Test context + * @param programBinaryPath - Path to program .so file + * @param programAddress - Address of the program + * @param upgradeAuthority - Authority to set in ProgramData account + * @returns { programAddress, programDataAddress } + */ +export async function setUpgradeableProgramAccounts( + ctx: SvmTestContext, + programBinaryPath: string, + programAddress: Address, + upgradeAuthority: Address, +): Promise<{ programAddress: Address; programDataAddress: Address }> { + const addressEncoder = getAddressEncoder(); + const [programDataAddress] = await getProgramDerivedAddress({ + programAddress: ctx.BPF_LOADER_UPGRADEABLE, + seeds: [addressEncoder.encode(programAddress)], + }); + + const programDataAccountBytes = encodeProgramDataAccount(upgradeAuthority); + const programBytes = fs.readFileSync(programBinaryPath); + const programDataAccountData = new Uint8Array([...programDataAccountBytes, ...programBytes]); + + const rentExemptBalance = ctx.getMinimumBalanceForRentExemption(BigInt(programDataAccountData.length)); + ctx.setAccount(programDataAddress, { + data: programDataAccountData, + executable: false, + lamports: rentExemptBalance, + owner: ctx.BPF_LOADER_UPGRADEABLE, + }); + + const programAccountBytes = encodeProgramAccount(programDataAddress); + ctx.setAccount(programAddress, { + data: Uint8Array.from(programAccountBytes), + executable: true, + lamports: rentExemptBalance, + owner: ctx.BPF_LOADER_UPGRADEABLE, + }); + + return { programAddress, programDataAddress }; +} + +/** Creates ProgramData Account for BPF Loader Upgradeable. */ +function encodeProgramDataAccount(authority: Address | null) { + const encoder = getStructEncoder([ + ['discriminator', getU32Encoder()], + ['slot', getU64Encoder()], + ['authority', getOptionEncoder(getAddressEncoder())], + ]); + + return encoder.encode({ + authority: authority ? some(authority) : none(), + discriminator: 3, + slot: 0n, + }); +} + +/** Creates a Program Account for BPF Loader Upgradeable. */ +function encodeProgramAccount(programDataAddress: Address) { + const encoder = getStructEncoder([ + ['discriminator', getU32Encoder()], + ['programData', getAddressEncoder()], + ]); + + return encoder.encode({ + discriminator: 2, + programData: programDataAddress, + }); +} + +/** Helper for allocating Buffer. Used for extending, closing or adding data */ +export async function allocateBufferAccount(ctx: SvmTestContext) { + const bufferAccount = await ctx.createFundedAccount(); + + const allocateIx = await programClient.methods + .allocate({ seed: null }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + program: null, + programData: null, + }) + .instruction(); + await ctx.sendInstruction(allocateIx, [bufferAccount]); + + return { bufferAccount }; +} + +/** Derives a canonical PDA (upgradeAuthority), i.e [programAddress, seed]. */ +export async function deriveCanonicalPda(programAddress: Address, seed: string) { + const seed16Bytes = encodeSeedForPda(seed); + const addressEncoder = getAddressEncoder(); + const [pda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: [addressEncoder.encode(programAddress), seed16Bytes], + }); + + return pda; +} + +/** Derives a non-canonical PDA (arbitrary authority), i.e [programAddress, authority, seed]. */ +export async function deriveNonCanonicalPda(programAddress: Address, authority: Address, seed: string) { + const seed16Bytes = encodeSeedForPda(seed); + const addressEncoder = getAddressEncoder(); + const [pda] = await getProgramDerivedAddress({ + programAddress: programClient.programAddress, + seeds: [addressEncoder.encode(programAddress), addressEncoder.encode(authority), seed16Bytes], + }); + + return pda; +} diff --git a/packages/dynamic-client/test/programs/pmp/initialize.test.ts b/packages/dynamic-client/test/programs/pmp/initialize.test.ts new file mode 100644 index 000000000..fb6f53361 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/initialize.test.ts @@ -0,0 +1,335 @@ +import { type Address } from '@solana/addresses'; +import type { Some } from '@solana/codecs'; +import { AccountDiscriminator, Compression, DataSource, Encoding, Format } from '@solana-program/program-metadata'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + decodeBufferAccount, + decodeMetadataAccount, + loadPmpProgram, + PMP_PROGRAM_ID, + programClient, + setupCanonicalPda, + setupNonCanonicalPda, +} from './helpers'; + +describe('Program Metadata: initialize', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should initialize canonical metadata with direct data (ifTrue condition branch)', async () => { + const seed = 'idl'; + const { authority, programAddress, programDataAddress, pda: metadataPda } = await setupCanonicalPda(ctx, seed); + + const testData = new TextEncoder().encode('{"name":"test"}'); + + const expectedAccounts = [ + metadataPda, + authority, + programAddress, + programDataAddress, + ctx.SYSTEM_PROGRAM_ADDRESS, + ]; + + const ix = await programClient.methods + .initialize({ + compression: 'none', + data: testData, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(5); + ix.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(metadataPda); + expect(account.owner).toBe(PMP_PROGRAM_ID); + + const metadata = decodeMetadataAccount(account.data); + expect(metadata.canonical).toBe(true); + expect(metadata.program).toBe(programAddress); + // Canonical metadata stores authority as zero (None) + expect(metadata.authority).toEqual({ __option: 'None' }); + expect(metadata.seed).toBe(seed); + + const writtenData = metadata.data.slice(0, testData.length); + expect(writtenData).toEqual(testData); + }); + + test('should initialize non-canonical metadata (ifFalse condition branch)', async () => { + const seed = 'idl'; + const { authority, programAddress, pda: metadataPda } = await setupNonCanonicalPda(ctx, seed); + + const testData = new TextEncoder().encode('non-canonical data'); + + const expectedAccounts = [ + metadataPda, + authority, + programAddress, + programClient.programAddress, // with "programId" optionalAccountStrategy address is resolved to root.programId + ctx.SYSTEM_PROGRAM_ADDRESS, + ]; + + const ix = await programClient.methods + .initialize({ + compression: 'none', + data: testData, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: null, // this should use ifFalse branch in conditionalValueNode + }) + .instruction(); + + expect(ix.accounts?.length).toBe(5); + ix.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(metadataPda); + expect(account.owner).toBe(PMP_PROGRAM_ID); + + const metadata = decodeMetadataAccount(account.data); + expect(metadata.discriminator).toBe(AccountDiscriminator.Metadata); + expect(metadata.canonical).toBe(false); + expect(metadata.program).toBe(programAddress); + expect((metadata.authority as Some
).value).toBe(authority); + expect(metadata.seed).toBe(seed); + + const writtenData = metadata.data.slice(0, testData.length); + expect(writtenData).toEqual(testData); + }); + + test('should resolve optional null system_program account according on optionalAccountStrategy', async () => { + const seed = 'idl'; + const { authority, programAddress, programDataAddress, pda: metadataPda } = await setupCanonicalPda(ctx, seed); + + const testData = new TextEncoder().encode('{"name":"test"}'); + + const expectedAccounts = [ + metadataPda, + authority, + programAddress, + programDataAddress, + programClient.programAddress, // expect root.programAddress based on optionalAccountStrategy + ]; + + const ix = await programClient.methods + .initialize({ + compression: 'none', + data: testData, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: programDataAddress, + system: null, // explicit null should resolve to root.programAddress + }) + .instruction(); + + expect(ix.accounts?.length).toBe(5); + ix.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + }); + + test('should initialize metadata from pre-allocated buffer', async () => { + const seed = 'idl'; + const { authority, programAddress, programDataAddress, pda: metadataPda } = await setupCanonicalPda(ctx, seed); + + // Allocate the metadata PDA as a canonical buffer + const allocateIx = await programClient.methods + .allocate({ seed }) + .accounts({ + authority, + buffer: metadataPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + // Write data to the buffer at the metadata PDA address + const testData = new TextEncoder().encode('{"from":"buffer"}'); + const writeIx = await programClient.methods + .write({ data: testData, offset: 0 }) + .accounts({ + authority, + buffer: metadataPda, + sourceBuffer: null, + }) + .instruction(); + + await ctx.sendInstructions([allocateIx, writeIx], [authority]); + + // Verify the buffer was written at the metadata PDA + const bufferAccount = ctx.requireEncodedAccount(metadataPda); + const buffer = decodeBufferAccount(bufferAccount.data); + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + + // Now initialize — the program sees the Buffer discriminator and uses existing data + const initializeIx = await programClient.methods + .initialize({ + compression: 'none', + data: null, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(initializeIx, [authority]); + + const account = ctx.requireEncodedAccount(metadataPda); + expect(account.owner).toBe(PMP_PROGRAM_ID); + + const metadata = decodeMetadataAccount(account.data); + expect(metadata.discriminator).toBe(AccountDiscriminator.Metadata); + expect(metadata.canonical).toBe(true); + expect(metadata.program).toBe(programAddress); + expect(metadata.authority).toEqual({ __option: 'None' }); + const writtenData = metadata.data.slice(0, testData.length); + expect(writtenData).toEqual(testData); + }); + + test('should initialize with different encoding and format', async () => { + const seed = 'config'; + const { authority, programAddress, programDataAddress, pda: metadataPda } = await setupCanonicalPda(ctx, seed); + + const testData = new TextEncoder().encode('dG9tbCBkYXRh'); + + const ix = await programClient.methods + .initialize({ + compression: 'zlib', + data: testData, + dataSource: 'url', + encoding: 'base64', + format: 'toml', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(metadataPda); + expect(account.owner).toBe(PMP_PROGRAM_ID); + + const metadata = decodeMetadataAccount(account.data); + expect(metadata.discriminator).toBe(AccountDiscriminator.Metadata); + expect(metadata.canonical).toBe(true); + expect(metadata.encoding).toBe(Encoding.Base64); + expect(metadata.compression).toBe(Compression.Zlib); + expect(metadata.format).toBe(Format.Toml); + expect(metadata.dataSource).toBe(DataSource.Url); + + const writtenData = metadata.data.slice(0, testData.length); + expect(writtenData).toEqual(testData); + }); + + test('should throw AccountError when authority is missing for non-canonical metadata', async () => { + const testProgramAddress = await ctx.createAccount(); + await expect( + programClient.methods + .initialize({ + compression: 'none', + data: null, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed: 'idl', + }) + .accounts({ + // Simulate invalid required authority account + authority: undefined as unknown as Address, + program: testProgramAddress, + programData: null, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[authority\]/); + }); + + test('should throw AccountError when required program account is missing', async () => { + const authority = await ctx.createFundedAccount(); + + await expect( + programClient.methods + .initialize({ + compression: 'none', + data: null, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed: 'idl', + }) + .accounts({ + authority, + // Simulate invalid required program account + program: undefined as unknown as Address, + programData: null, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[program\]/); + }); + + test('should throw ArgumentError when missing required seed argument', async () => { + const authority = await ctx.createFundedAccount(); + const testProgramAddress = await ctx.createAccount(); + + await expect( + programClient.methods + .initialize({ + compression: 'none', + data: null, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + // Simulate invalid seed + seed: undefined as unknown as string, + }) + .accounts({ + authority, + program: testProgramAddress, + programData: null, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "seed", value: undefined/); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/pdas.test.ts b/packages/dynamic-client/test/programs/pmp/pdas.test.ts new file mode 100644 index 000000000..416bd854b --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/pdas.test.ts @@ -0,0 +1,163 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + deriveCanonicalPda, + deriveNonCanonicalPda, + loadPmpProgram, + programClient, + setupCanonicalPda, + setupNonCanonicalPda, +} from './helpers'; + +describe('Program Metadata: pdas', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + describe('canonical', () => { + test('should derive canonical PDA matching manual derivation', async () => { + const programAddress = await ctx.createAccount(); + const seed = 'idl'; + + const [pdaFromHelper] = await programClient.pdas.canonical({ program: programAddress, seed }); + const manualPda = await deriveCanonicalPda(programAddress, seed); + + expect(pdaFromHelper).toBe(manualPda); + }); + + test('should derive different PDAs for different seeds', async () => { + const programAddress = await ctx.createAccount(); + + const [pda1] = await programClient.pdas.canonical({ program: programAddress, seed: 'idl' }); + const [pda2] = await programClient.pdas.canonical({ program: programAddress, seed: 'config' }); + + expect(pda1).not.toBe(pda2); + }); + + test('should derive different PDAs for different programs', async () => { + const program1 = await ctx.createAccount(); + const program2 = await ctx.createAccount(); + + const [pda1] = await programClient.pdas.canonical({ program: program1, seed: 'idl' }); + const [pda2] = await programClient.pdas.canonical({ program: program2, seed: 'idl' }); + + expect(pda1).not.toBe(pda2); + }); + + test('should match instruction-resolved metadata PDA', async () => { + const seed = 'idl'; + const { authority, programAddress, programDataAddress } = await setupCanonicalPda(ctx, seed); + + const ix = await programClient.methods + .initialize({ + compression: 'none', + data: new TextEncoder().encode('test'), + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + const [pdaFromHelper] = await programClient.pdas.canonical({ program: programAddress, seed }); + // The instruction's 1st account (index 0) is the metadata PDA + const pdaFromIx = ix.accounts?.[0]?.address; + + expect(pdaFromHelper).toBe(pdaFromIx); + }); + }); + + describe('nonCanonical', () => { + test('should derive non-canonical PDA matching manual derivation', async () => { + const programAddress = await ctx.createAccount(); + const authority = await ctx.createAccount(); + const seed = 'idl'; + + const [pdaFromHelper] = await programClient.pdas.nonCanonical({ authority, program: programAddress, seed }); + const manualPda = await deriveNonCanonicalPda(programAddress, authority, seed); + + expect(pdaFromHelper).toBe(manualPda); + }); + + test('should derive different PDAs for different authorities', async () => { + const programAddress = await ctx.createAccount(); + const authority1 = await ctx.createAccount(); + const authority2 = await ctx.createAccount(); + + const [pda1] = await programClient.pdas.nonCanonical({ + authority: authority1, + program: programAddress, + seed: 'idl', + }); + const [pda2] = await programClient.pdas.nonCanonical({ + authority: authority2, + program: programAddress, + seed: 'idl', + }); + + expect(pda1).not.toBe(pda2); + }); + + test('should match instruction-resolved metadata PDA', async () => { + const seed = 'idl'; + const { authority, programAddress } = await setupNonCanonicalPda(ctx, seed); + + const ix = await programClient.methods + .initialize({ + compression: 'none', + data: new TextEncoder().encode('test'), + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + seed, + }) + .accounts({ + authority, + program: programAddress, + programData: null, + }) + .instruction(); + + const [pdaFromHelper] = await programClient.pdas.nonCanonical({ authority, program: programAddress, seed }); + const pdaFromIx = ix.accounts?.[0]?.address; + + expect(pdaFromHelper).toBe(pdaFromIx); + }); + }); + + describe('metadata', () => { + test('should derive canonical PDA when authority is null', async () => { + const programAddress = await ctx.createAccount(); + const seed = 'idl'; + + const [metadataPda] = await programClient.pdas.metadata({ authority: null, program: programAddress, seed }); + const [canonicalPda] = await programClient.pdas.canonical({ program: programAddress, seed }); + + expect(metadataPda).toBe(canonicalPda); + }); + + test('should derive non-canonical PDA when authority is provided', async () => { + const programAddress = await ctx.createAccount(); + const authority = await ctx.createAccount(); + const seed = 'idl'; + + const [metadataPda] = await programClient.pdas.metadata({ authority, program: programAddress, seed }); + const [nonCanonicalPda] = await programClient.pdas.nonCanonical({ + authority, + program: programAddress, + seed, + }); + + expect(metadataPda).toBe(nonCanonicalPda); + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/set-authority.test.ts b/packages/dynamic-client/test/programs/pmp/set-authority.test.ts new file mode 100644 index 000000000..64e399309 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/set-authority.test.ts @@ -0,0 +1,100 @@ +import type { Address } from '@solana/addresses'; +import type { Some } from '@solana/codecs'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { decodeMetadataAccount, initializeCanonicalMetadata, loadPmpProgram, programClient } from './helpers'; + +describe('Program Metadata: setAuthority', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should set new authority on canonical metadata', async () => { + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx); + + const accountBefore = ctx.requireEncodedAccount(metadataPda); + const metadataBefore = decodeMetadataAccount(accountBefore.data); + expect(metadataBefore.authority).toEqual({ __option: 'None' }); + expect(metadataBefore.canonical).toBe(true); + + // Set new authority + const newAuthority = await ctx.createAccount(); + const expectedAccounts = [metadataPda, authority, programAddress, programDataAddress]; + const setAuthorityIx = await programClient.methods + .setAuthority({ newAuthority }) + .accounts({ + account: metadataPda, + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + expect(setAuthorityIx.accounts?.length).toBe(4); + setAuthorityIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(setAuthorityIx, [authority]); + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + expect((metadataAfter.authority as Some
).value).toBe(newAuthority); + }); + + test('should remove authority from canonical metadata', async () => { + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx); + + // Set authority + const someAuthority = await ctx.createAccount(); + const setAuthorityIx = await programClient.methods + .setAuthority({ newAuthority: someAuthority }) + .accounts({ + account: metadataPda, + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + await ctx.sendInstruction(setAuthorityIx, [authority]); + const accountWithAuthority = ctx.requireEncodedAccount(metadataPda); + const metadataWithAuthority = decodeMetadataAccount(accountWithAuthority.data); + expect((metadataWithAuthority.authority as Some
).value).toBe(someAuthority); + + // Remove the authority + const expectedAccounts = [metadataPda, authority, programAddress, programDataAddress]; + const removeAuthorityIx = await programClient.methods + .setAuthority({ newAuthority: null }) + .accounts({ + account: metadataPda, + authority, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + expect(removeAuthorityIx.accounts?.length).toBe(4); + removeAuthorityIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(removeAuthorityIx, [authority]); + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + expect(metadataAfter.authority).toEqual({ __option: 'None' }); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/set-data.test.ts b/packages/dynamic-client/test/programs/pmp/set-data.test.ts new file mode 100644 index 000000000..8869fe682 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/set-data.test.ts @@ -0,0 +1,198 @@ +import type { Address } from '@solana/addresses'; +import type { Some } from '@solana/codecs'; +import { Compression, DataSource, Encoding, Format } from '@solana-program/program-metadata'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + allocateBufferAccount, + decodeMetadataAccount, + initializeCanonicalMetadata, + initializeNonCanonicalMetadata, + loadPmpProgram, + PMP_PROGRAM_ID, + programClient, +} from './helpers'; + +describe('Program Metadata: setData', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should update canonical metadata with inline data', async () => { + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx, { data: new TextEncoder().encode('{"name":"initial"}') }); + + // Verify initial state + const accountBefore = ctx.requireEncodedAccount(metadataPda); + const metadataBefore = decodeMetadataAccount(accountBefore.data); + expect(metadataBefore.encoding).toBe(Encoding.Utf8); + expect(metadataBefore.format).toBe(Format.Json); + + // Update metadata with new data and properties + const newData = new TextEncoder().encode('{"name":"updated"}'); + const expectedAccounts = [metadataPda, authority, PMP_PROGRAM_ID, programAddress, programDataAddress]; + + const setDataIx = await programClient.methods + .setData({ + compression: 'zlib', + data: newData, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + }) + .accounts({ + authority, + buffer: null, + metadata: metadataPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + expect(setDataIx.accounts?.length).toBe(5); + setDataIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(setDataIx, [authority]); + + // Verify metadata updated + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + + const writtenData = metadataAfter.data.slice(0, newData.length); + expect(writtenData).toEqual(newData); + expect(metadataAfter.encoding).toBe(Encoding.Utf8); + expect(metadataAfter.compression).toBe(Compression.Zlib); + expect(metadataAfter.format).toBe(Format.Json); + expect(metadataAfter.dataSource).toBe(DataSource.Direct); + + // Unchanged fields + expect(metadataAfter.canonical).toBe(true); + expect(metadataAfter.program).toBe(programAddress); + expect(metadataAfter.authority).toEqual({ __option: 'None' }); + expect(metadataAfter.seed).toBe('idl'); + expect(metadataAfter.mutable).toBe(true); + }); + + test('should update canonical metadata from buffer', async () => { + const feePayer = await ctx.createFundedAccount(); + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx, { data: new TextEncoder().encode('{"name":"initial"}') }); + + const { bufferAccount } = await allocateBufferAccount(ctx); + + const bufferData = new TextEncoder().encode('{"from":"buffer"}'); + const writeBufferIx = await programClient.methods + .write({ data: bufferData, offset: 0 }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + sourceBuffer: null, + }) + .instruction(); + + await ctx.sendInstruction(writeBufferIx, [feePayer, bufferAccount]); + + // Update metadata from buffer + const expectedAccounts = [metadataPda, authority, bufferAccount, programAddress, programDataAddress]; + + const setDataIx = await programClient.methods + .setData({ + compression: 'none', + data: null, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + }) + .accounts({ + authority, + buffer: bufferAccount, + metadata: metadataPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + expect(setDataIx.accounts?.length).toBe(5); + setDataIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(setDataIx, [authority]); + + // Verify metadata data matches buffer + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + + const writtenData = metadataAfter.data.slice(0, bufferData.length); + expect(writtenData).toEqual(bufferData); + }); + + test('should update non-canonical metadata with inline data', async () => { + const { + authority, + programAddress, + pda: metadataPda, + } = await initializeNonCanonicalMetadata(ctx, { + data: new TextEncoder().encode('non-canonical initial'), + }); + + // Verify non-canonical + const accountBefore = ctx.requireEncodedAccount(metadataPda); + const metadataBefore = decodeMetadataAccount(accountBefore.data); + expect(metadataBefore.canonical).toBe(false); + expect((metadataBefore.authority as Some
).value).toBe(authority); + + // Update non-canonical metadata + const newData = new TextEncoder().encode('non-canonical updated'); + const expectedAccounts = [metadataPda, authority, PMP_PROGRAM_ID, programAddress, PMP_PROGRAM_ID]; + + const setDataIx = await programClient.methods + .setData({ + compression: 'gzip', + data: newData, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + }) + .accounts({ + authority, + buffer: null, + metadata: metadataPda, + program: programAddress, + programData: null, + }) + .instruction(); + + expect(setDataIx.accounts?.length).toBe(5); + setDataIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(setDataIx, [authority]); + + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + + const writtenData = metadataAfter.data.slice(0, newData.length); + expect(writtenData).toEqual(newData); + expect(metadataAfter.encoding).toBe(Encoding.Utf8); + expect(metadataAfter.compression).toBe(Compression.Gzip); + expect(metadataAfter.format).toBe(Format.Json); + expect(metadataAfter.dataSource).toBe(DataSource.Direct); + expect((metadataAfter.authority as Some
).value).toBe(authority); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/set-immutable.test.ts b/packages/dynamic-client/test/programs/pmp/set-immutable.test.ts new file mode 100644 index 000000000..cf980a15d --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/set-immutable.test.ts @@ -0,0 +1,97 @@ +import type { Address } from '@solana/addresses'; +import type { Some } from '@solana/codecs'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + decodeMetadataAccount, + initializeCanonicalMetadata, + initializeNonCanonicalMetadata, + loadPmpProgram, + PMP_PROGRAM_ID, + programClient, +} from './helpers'; + +describe('Program Metadata: setImmutable', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should make canonical metadata immutable', async () => { + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx); + + const accountBefore = ctx.requireEncodedAccount(metadataPda); + const metadataBefore = decodeMetadataAccount(accountBefore.data); + expect(metadataBefore.mutable).toBe(true); + expect(metadataBefore.canonical).toBe(true); + + // Make immutable + const expectedAccounts = [metadataPda, authority, programAddress, programDataAddress]; + + const setImmutableIx = await programClient.methods + .setImmutable() + .accounts({ + authority, + metadata: metadataPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + + expect(setImmutableIx.accounts?.length).toBe(4); + setImmutableIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(setImmutableIx, [authority]); + + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + expect(metadataAfter.mutable).toBe(false); + }); + + test('should make non-canonical metadata immutable', async () => { + const { authority, pda: metadataPda } = await initializeNonCanonicalMetadata(ctx); + + // Verify non-canonical and mutable + const accountBefore = ctx.requireEncodedAccount(metadataPda); + const metadataBefore = decodeMetadataAccount(accountBefore.data); + expect(metadataBefore.canonical).toBe(false); + expect(metadataBefore.mutable).toBe(true); + expect((metadataBefore.authority as Some
).value).toBe(authority); + + // Make immutable + const expectedAccounts = [metadataPda, authority, PMP_PROGRAM_ID, PMP_PROGRAM_ID]; + + const setImmutableIx = await programClient.methods + .setImmutable() + .accounts({ + authority, + metadata: metadataPda, + program: null, + programData: null, + }) + .instruction(); + + expect(setImmutableIx.accounts?.length).toBe(4); + setImmutableIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + + await ctx.sendInstruction(setImmutableIx, [authority]); + + const accountAfter = ctx.requireEncodedAccount(metadataPda); + const metadataAfter = decodeMetadataAccount(accountAfter.data); + expect(metadataAfter.mutable).toBe(false); + expect(metadataAfter.canonical).toBe(false); + expect((metadataAfter.authority as Some
).value).toBe(authority); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/trim.test.ts b/packages/dynamic-client/test/programs/pmp/trim.test.ts new file mode 100644 index 000000000..2e3b77f64 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/trim.test.ts @@ -0,0 +1,77 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { decodeMetadataAccount, initializeCanonicalMetadata, loadPmpProgram, programClient } from './helpers'; + +describe('Program Metadata: trim', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true, sysvars: true }); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should trim metadata to reduced size', async () => { + const destination = await ctx.createAccount(); + const { + authority, + programAddress, + programDataAddress, + pda: metadataPda, + } = await initializeCanonicalMetadata(ctx, { data: new TextEncoder().encode('x'.repeat(200)) }); + + const reducedData = new TextEncoder().encode('x'.repeat(100)); + const setDataIx = await programClient.methods + .setData({ + compression: 'none', + data: reducedData, + dataSource: 'direct', + encoding: 'utf8', + format: 'json', + }) + .accounts({ + authority, + buffer: null, + metadata: metadataPda, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + await ctx.sendInstruction(setDataIx, [authority]); + + const balanceBefore = ctx.getBalanceOrZero(destination); + expect(balanceBefore).toBe(0n); + + const expectedAccounts = [ + metadataPda, + authority, + programAddress, + programDataAddress, + destination, + ctx.SYSVAR_RENT_ADDRESS, + ]; + + const trimIx = await programClient.methods + .trim() + .accounts({ + account: metadataPda, + authority, + destination, + program: programAddress, + programData: programDataAddress, + }) + .instruction(); + expect(trimIx.accounts?.length).toBe(6); + trimIx.accounts?.forEach((ixAccount, i) => { + expect(expectedAccounts[i], `Invalid account: [${i}]`).toBe(ixAccount.address); + }); + await ctx.sendInstruction(trimIx, [authority]); + + const account = ctx.requireEncodedAccount(metadataPda); + const metadata = decodeMetadataAccount(account.data); + expect(metadata.data).toEqual(reducedData); + + const balanceAfter = ctx.getBalanceOrZero(destination); + expect(balanceAfter).toBeGreaterThan(0n); + }); +}); diff --git a/packages/dynamic-client/test/programs/pmp/write.test.ts b/packages/dynamic-client/test/programs/pmp/write.test.ts new file mode 100644 index 000000000..c124f1fc3 --- /dev/null +++ b/packages/dynamic-client/test/programs/pmp/write.test.ts @@ -0,0 +1,122 @@ +import { AccountDiscriminator } from '@solana-program/program-metadata'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { allocateBufferAccount, decodeBufferAccount, loadPmpProgram, programClient } from './helpers'; + +describe('Program Metadata: write', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadPmpProgram(ctx, programClient.programAddress); + }); + + test('should write inline data to buffer', async () => { + const feePayer = await ctx.createFundedAccount(); + const { bufferAccount } = await allocateBufferAccount(ctx); + + const testData = new TextEncoder().encode('Hello, PMP!'); + const writeIx = await programClient.methods + .write({ data: testData, offset: 0 }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + sourceBuffer: null, + }) + .instruction(); + + await ctx.sendInstruction(writeIx, [feePayer, bufferAccount]); + + const account = ctx.requireEncodedAccount(bufferAccount); + const buffer = decodeBufferAccount(account.data); + + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + expect(buffer.canonical).toBe(false); + + const writtenData = buffer.data.slice(0, testData.length); + expect(writtenData).toEqual(testData); + }); + + test('should write data at offset', async () => { + const feePayer = await ctx.createFundedAccount(); + const { bufferAccount } = await allocateBufferAccount(ctx); + + const dataA = new TextEncoder().encode('AAAA'); + const writeIxA = await programClient.methods + .write({ data: dataA, offset: 0 }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + sourceBuffer: null, + }) + .instruction(); + + const dataB = new TextEncoder().encode('BBBB'); + const dataBoffset = 10; + const writeIxB = await programClient.methods + .write({ data: dataB, offset: dataBoffset }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + sourceBuffer: null, + }) + .instruction(); + + await ctx.sendInstructions([writeIxA, writeIxB], [feePayer, bufferAccount]); + + const account = ctx.requireEncodedAccount(bufferAccount); + const buffer = decodeBufferAccount(account.data); + + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + + const writtenDataA = buffer.data.slice(0, dataA.length); + expect(writtenDataA).toEqual(dataA); + + const writtenDataB = buffer.data.slice(dataBoffset, dataBoffset + dataB.length); + expect(writtenDataB).toEqual(dataB); + + const untouchedBytes = buffer.data.slice(dataA.length, dataBoffset); + expect(untouchedBytes).toEqual(new Uint8Array([0, 0, 0, 0, 0, 0])); + }); + + test('should write data in chunks', async () => { + const feePayer = await ctx.createFundedAccount(); + const { bufferAccount } = await allocateBufferAccount(ctx); + + const chunk1 = new TextEncoder().encode('Hello'); + const writeIx1 = await programClient.methods + .write({ data: chunk1, offset: 0 }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + sourceBuffer: null, + }) + .instruction(); + + const chunk2 = new TextEncoder().encode('World'); + const chunk2Offset = chunk1.length; + const writeIx2 = await programClient.methods + .write({ data: chunk2, offset: chunk2Offset }) + .accounts({ + authority: bufferAccount, + buffer: bufferAccount, + sourceBuffer: null, + }) + .instruction(); + + await ctx.sendInstructions([writeIx1, writeIx2], [feePayer, bufferAccount]); + + const account = ctx.requireEncodedAccount(bufferAccount); + const buffer = decodeBufferAccount(account.data); + + expect(buffer.discriminator).toBe(AccountDiscriminator.Buffer); + + const combinedData = buffer.data.slice(0, chunk1.length + chunk2.length); + const expectedData = new TextEncoder().encode('HelloWorld'); + expect(combinedData).toEqual(expectedData); + + const resultString = new TextDecoder().decode(combinedData); + expect(resultString).toBe('HelloWorld'); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/change-authorized-signers.test.ts b/packages/dynamic-client/test/programs/sas/change-authorized-signers.test.ts new file mode 100644 index 000000000..4947fbfde --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/change-authorized-signers.test.ts @@ -0,0 +1,59 @@ +import { type Address } from '@solana/addresses'; +import { getCredentialDecoder } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createCredential, loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: changeAuthorizedSigners', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should replace authorized signers with a new set', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const newSigner1 = await ctx.createAccount(); + const newSigner2 = await ctx.createAccount(); + + const expectedAccounts = [authority, authority, credentialPda, ctx.SYSTEM_PROGRAM_ADDRESS]; + const ix = await programClient.methods + .changeAuthorizedSigners({ signers: [newSigner1, newSigner2] }) + .accounts({ authority, credential: credentialPda, payer: authority }) + .instruction(); + + expect(ix.accounts?.length).toBe(4); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(credentialPda); + const credential = getCredentialDecoder().decode(account.data); + expect(credential.authorizedSigners).toEqual([newSigner1, newSigner2]); + }); + + test('should throw AccountError when credential is missing', async () => { + const { authority } = await createCredential(ctx); + + await expect( + programClient.methods + .changeAuthorizedSigners({ signers: [authority] }) + .accounts({ authority, credential: undefined as unknown as Address, payer: authority }) + .instruction(), + ).rejects.toThrow(/Missing account \[credential\]/); + }); + + test('should throw ValidationError when signers arg is invalid', async () => { + const { authority, credentialPda } = await createCredential(ctx); + + await expect( + programClient.methods + .changeAuthorizedSigners({ signers: { a: 42 } as unknown as Address[] }) + .accounts({ authority, credential: credentialPda, payer: authority }) + .instruction(), + ).rejects.toThrow(/Invalid argument "signers"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/change-schema-description.test.ts b/packages/dynamic-client/test/programs/sas/change-schema-description.test.ts new file mode 100644 index 000000000..c6fd1eae4 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/change-schema-description.test.ts @@ -0,0 +1,69 @@ +import { type Address } from '@solana/addresses'; +import { getSchemaDecoder } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createCredential, createSchema, loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: changeSchemaDescription', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should update schema description', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const expectedAccounts = [authority, authority, credentialPda, schemaPda, ctx.SYSTEM_PROGRAM_ADDRESS]; + const ix = await programClient.methods + .changeSchemaDescription({ description: 'Updated description' }) + .accounts({ authority, credential: credentialPda, payer: authority, schema: schemaPda }) + .instruction(); + + expect(ix.accounts?.length).toBe(5); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(schemaPda); + const schema = getSchemaDecoder().decode(account.data); + expect(schema.description).toEqual(new TextEncoder().encode('Updated description')); + }); + + test('should throw AccountError when schema is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + + await expect( + programClient.methods + .changeSchemaDescription({ description: 'New description' }) + .accounts({ + authority, + credential: credentialPda, + payer: authority, + schema: undefined as unknown as Address, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[schema\]/); + }); + + test('should throw ValidationError when description is invalid', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + await expect( + programClient.methods + .changeSchemaDescription({ description: BigInt(42) as unknown as string }) + .accounts({ + authority, + credential: credentialPda, + payer: authority, + schema: schemaPda, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "description"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/change-schema-status.test.ts b/packages/dynamic-client/test/programs/sas/change-schema-status.test.ts new file mode 100644 index 000000000..2b539147a --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/change-schema-status.test.ts @@ -0,0 +1,95 @@ +import { type Address } from '@solana/addresses'; +import { getSchemaDecoder } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createCredential, createSchema, loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: changeSchemaStatus', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should pause a schema', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const expectedAccounts = [authority, credentialPda, schemaPda]; + const ix = await programClient.methods + .changeSchemaStatus({ isPaused: true }) + .accounts({ authority, credential: credentialPda, schema: schemaPda }) + .instruction(); + + expect(ix.accounts?.length).toBe(3); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(schemaPda); + const schema = getSchemaDecoder().decode(account.data); + expect(schema.isPaused).toBe(true); + }); + + test('should unpause a schema', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const pauseIx = await programClient.methods + .changeSchemaStatus({ isPaused: true }) + .accounts({ authority, credential: credentialPda, schema: schemaPda }) + .instruction(); + + await ctx.sendInstruction(pauseIx, [authority]); + + const unpauseIx = await programClient.methods + .changeSchemaStatus({ isPaused: false }) + .accounts({ authority, credential: credentialPda, schema: schemaPda }) + .instruction(); + + await ctx.sendInstruction(unpauseIx, [authority]); + + const account = ctx.requireEncodedAccount(schemaPda); + const schema = getSchemaDecoder().decode(account.data); + expect(schema.isPaused).toBe(false); + }); + + test('should build correct instruction with 3 accounts', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const ix = await programClient.methods + .changeSchemaStatus({ isPaused: true }) + .accounts({ authority, credential: credentialPda, schema: schemaPda }) + .instruction(); + + expect(ix.accounts?.length).toBe(3); + }); + + test('should throw AccountError when credential is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + await expect( + programClient.methods + .changeSchemaStatus({ isPaused: true }) + .accounts({ authority, credential: undefined as unknown as Address, schema: schemaPda }) + .instruction(), + ).rejects.toThrow(/Missing account \[credential\]/); + }); + + test('should throw ArgumentError when isPaused is invalid', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + await expect( + programClient.methods + .changeSchemaStatus({ isPaused: 'yes' as unknown as boolean }) + .accounts({ authority, credential: credentialPda, schema: schemaPda }) + .instruction(), + ).rejects.toThrow(/Invalid argument "isPaused"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/change-schema-version.test.ts b/packages/dynamic-client/test/programs/sas/change-schema-version.test.ts new file mode 100644 index 000000000..89d9d3e43 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/change-schema-version.test.ts @@ -0,0 +1,133 @@ +import { type Address } from '@solana/addresses'; +import { deriveSchemaPda, getSchemaDecoder } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createCredential, + createSchema, + loadSasProgram, + programClient, + SCHEMA_DATA_STRING_TYPE, + SCHEMA_DATA_U8_TYPE, +} from './sas-test-utils'; + +describe('SAS: changeSchemaVersion', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should create a new version of a schema', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { name, schemaPda: existingSchemaPda } = await createSchema(ctx, authority, credentialPda); + + const [newSchemaPda] = await deriveSchemaPda({ credential: credentialPda, name, version: 2 }); + + const expectedAccounts = [ + authority, + authority, + credentialPda, + existingSchemaPda, + newSchemaPda, + ctx.SYSTEM_PROGRAM_ADDRESS, + ]; + const ix = await programClient.methods + .changeSchemaVersion({ + fieldNames: ['fullName', 'age'], + layout: new Uint8Array([SCHEMA_DATA_STRING_TYPE, SCHEMA_DATA_U8_TYPE]), + }) + .accounts({ + authority, + credential: credentialPda, + existingSchema: existingSchemaPda, + newSchema: newSchemaPda, + payer: authority, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(6); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(newSchemaPda); + const schema = getSchemaDecoder().decode(account.data); + expect(schema.layout).toEqual(new Uint8Array([SCHEMA_DATA_STRING_TYPE, SCHEMA_DATA_U8_TYPE])); + expect(schema.version).toBe(2); + }); + + test('should throw AccountError when existingSchema is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { name, schemaPda: existingSchemaPda } = await createSchema(ctx, authority, credentialPda); + const [newSchemaPda] = await deriveSchemaPda({ credential: credentialPda, name, version: 2 }); + + await expect( + programClient.methods + .changeSchemaVersion({ fieldNames: ['field123'], layout: new Uint8Array([12]) }) + .accounts({ + authority, + credential: credentialPda, + existingSchema: undefined as unknown as Address, + newSchema: newSchemaPda, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[existingSchema\]/); + + await expect( + programClient.methods + .changeSchemaVersion({ fieldNames: ['field123'], layout: new Uint8Array([12]) }) + .accounts({ + authority, + credential: credentialPda, + existingSchema: existingSchemaPda, + newSchema: undefined as unknown as Address, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[newSchema\]/); + }); + + test('should throw ValidationError when argument is invalid', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { name, schemaPda: existingSchemaPda } = await createSchema(ctx, authority, credentialPda); + + const [newSchemaPda] = await deriveSchemaPda({ credential: credentialPda, name, version: 2 }); + + await expect( + programClient.methods + .changeSchemaVersion({ + fieldNames: undefined as unknown as string[], + layout: new Uint8Array([SCHEMA_DATA_STRING_TYPE, SCHEMA_DATA_U8_TYPE]), + }) + .accounts({ + authority, + credential: credentialPda, + existingSchema: existingSchemaPda, + newSchema: newSchemaPda, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "fieldNames"/); + + await expect( + programClient.methods + .changeSchemaVersion({ + fieldNames: ['test1', 'test2'], + layout: 123 as unknown as Uint8Array, + }) + .accounts({ + authority, + credential: credentialPda, + existingSchema: existingSchemaPda, + newSchema: newSchemaPda, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "layout"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/close-attestation.test.ts b/packages/dynamic-client/test/programs/sas/close-attestation.test.ts new file mode 100644 index 000000000..a1c4c4984 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/close-attestation.test.ts @@ -0,0 +1,101 @@ +import { type Address } from '@solana/addresses'; +import { deriveEventAuthorityAddress } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createAttestation, createCredential, createSchema, loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: closeAttestation', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should close an attestation', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const { attestationPda } = await createAttestation(ctx, authority, credentialPda, schemaPda); + const eventAuthority = await deriveEventAuthorityAddress(); + + const expectedAccounts = [ + authority, + authority, + credentialPda, + attestationPda, + eventAuthority, + ctx.SYSTEM_PROGRAM_ADDRESS, + programClient.programAddress, + ]; + const ix = await programClient.methods + .closeAttestation() + .accounts({ + attestation: attestationPda, + attestationProgram: programClient.programAddress, + authority, + credential: credentialPda, + eventAuthority, + payer: authority, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(7); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.fetchEncodedAccount(attestationPda); + expect(account).toBeNull(); + }); + + test('should throw AccountError when required account is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const { attestationPda } = await createAttestation(ctx, authority, credentialPda, schemaPda); + const eventAuthority = await deriveEventAuthorityAddress(); + + await expect( + programClient.methods + .closeAttestation() + .accounts({ + attestation: attestationPda, + attestationProgram: programClient.programAddress, + authority, + credential: credentialPda, + eventAuthority: undefined as unknown as Address, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[eventAuthority\]/); + + await expect( + programClient.methods + .closeAttestation() + .accounts({ + attestation: attestationPda, + attestationProgram: programClient.programAddress, + authority, + credential: undefined as unknown as Address, + eventAuthority: eventAuthority, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[credential\]/); + + await expect( + programClient.methods + .closeAttestation() + .accounts({ + attestation: attestationPda, + attestationProgram: undefined as unknown as Address, + authority, + credential: credentialPda, + eventAuthority: eventAuthority, + payer: authority, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[attestationProgram\]/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/close-tokenized-attestation.test.ts b/packages/dynamic-client/test/programs/sas/close-tokenized-attestation.test.ts new file mode 100644 index 000000000..66eed628d --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/close-tokenized-attestation.test.ts @@ -0,0 +1,179 @@ +import { type Address } from '@solana/addresses'; +import { findAssociatedTokenPda } from '@solana-program/token'; +import { + deriveAttestationMintPda, + deriveAttestationPda, + deriveEventAuthorityAddress, + serializeAttestationData, +} from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createCredential, + createSchema, + getAttestationMintSize, + loadSasProgram, + programClient, + tokenizeSchema, +} from './sas-test-utils'; + +const NFT_NAME = 'Test NFT'; +const NFT_SYMBOL = 'TEST'; +const NFT_URI = 'https://example.com/metadata.json'; + +async function createTokenizedAttestationSetup(ctx: SvmTestContext) { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda, schema } = await createSchema(ctx, authority, credentialPda); + const attestationData = serializeAttestationData(schema, { field1: 'test' }); + const { sasPda, schemaMintPda } = await tokenizeSchema(ctx, authority, credentialPda, schemaPda); + + const nonce = await ctx.createAccount(); + const recipient = await ctx.createFundedAccount(); + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + const [attestationMintPda] = await deriveAttestationMintPda({ attestation: attestationPda }); + + const [recipientTokenAccount] = await findAssociatedTokenPda({ + mint: attestationMintPda, + owner: recipient, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }); + + const mintAccountSpace = getAttestationMintSize({ + attestationMint: attestationMintPda, + attestationPda, + name: NFT_NAME, + sasPda, + schemaMint: schemaMintPda, + schemaPda, + symbol: NFT_SYMBOL, + uri: NFT_URI, + }); + + const createIx = await programClient.methods + .createTokenizedAttestation({ + data: attestationData, + expiry: 0n, + mintAccountSpace, + name: NFT_NAME, + nonce, + symbol: NFT_SYMBOL, + uri: NFT_URI, + }) + .accounts({ + associatedTokenProgram: ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + attestation: attestationPda, + attestationMint: attestationMintPda, + authority, + credential: credentialPda, + payer: authority, + recipient, + recipientTokenAccount, + sasPda, + schema: schemaPda, + schemaMint: schemaMintPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(); + + await ctx.sendInstruction(createIx, [authority]); + + return { attestationMintPda, attestationPda, authority, credentialPda, recipientTokenAccount, sasPda }; +} + +describe('SAS: closeTokenizedAttestation', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true }); + loadSasProgram(ctx); + }); + + test('should close a tokenized attestation', async () => { + const { attestationMintPda, attestationPda, authority, credentialPda, recipientTokenAccount, sasPda } = + await createTokenizedAttestationSetup(ctx); + const eventAuthority = await deriveEventAuthorityAddress(); + + const expectedAccounts = [ + authority, + authority, + credentialPda, + attestationPda, + eventAuthority, + ctx.SYSTEM_PROGRAM_ADDRESS, + programClient.programAddress, + attestationMintPda, + sasPda, + recipientTokenAccount, + ctx.TOKEN_2022_PROGRAM_ADDRESS, + ]; + + const ix = await programClient.methods + .closeTokenizedAttestation() + .accounts({ + attestation: attestationPda, + attestationMint: attestationMintPda, + attestationProgram: programClient.programAddress, + attestationTokenAccount: recipientTokenAccount, + authority, + credential: credentialPda, + eventAuthority, + payer: authority, + sasPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(11); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.fetchEncodedAccount(attestationPda); + expect(account).toBeNull(); + }); + + test('should throw AccountError when required account is missing', async () => { + const { attestationMintPda, attestationPda, authority, credentialPda, recipientTokenAccount, sasPda } = + await createTokenizedAttestationSetup(ctx); + + const eventAuthority = await deriveEventAuthorityAddress(); + + await expect( + programClient.methods + .closeTokenizedAttestation() + .accounts({ + attestation: attestationPda, + attestationMint: undefined as unknown as Address, + attestationProgram: programClient.programAddress, + attestationTokenAccount: recipientTokenAccount, + authority, + credential: credentialPda, + eventAuthority, + payer: authority, + sasPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[attestationMint\]/); + + await expect( + programClient.methods + .closeTokenizedAttestation() + .accounts({ + attestation: attestationPda, + attestationMint: attestationMintPda, + attestationProgram: programClient.programAddress, + attestationTokenAccount: undefined as unknown as Address, + authority, + credential: credentialPda, + eventAuthority, + payer: authority, + sasPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[attestationTokenAccount\]/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/create-attestation.test.ts b/packages/dynamic-client/test/programs/sas/create-attestation.test.ts new file mode 100644 index 000000000..21092a738 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/create-attestation.test.ts @@ -0,0 +1,111 @@ +import { type Address } from '@solana/addresses'; +import { deriveAttestationPda, getAttestationDecoder, serializeAttestationData } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createAttestation, createCredential, createSchema, loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: createAttestation', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should create an attestation with no expiry', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const nonce = await ctx.createAccount(); + + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + + const expectedAccounts = [ + authority, + authority, + credentialPda, + schemaPda, + attestationPda, + ctx.SYSTEM_PROGRAM_ADDRESS, + ]; + const ix = await programClient.methods + .createAttestation({ data: new Uint8Array([0, 0, 0, 0]), expiry: 0, nonce }) + .accounts({ + attestation: attestationPda, + authority, + credential: credentialPda, + payer: authority, + schema: schemaPda, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(6); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(attestationPda); + const attestation = getAttestationDecoder().decode(account.data); + expect(attestation.data).toEqual(new Uint8Array([0, 0, 0, 0])); + expect(attestation.expiry).toBe(0n); + }); + + test('should create an attestation with binary data', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda, schema } = await createSchema(ctx, authority, credentialPda); + const attestationData = serializeAttestationData(schema, { field1: 'test' }); + + const { attestationPda } = await createAttestation(ctx, authority, credentialPda, schemaPda, { + data: attestationData, + }); + + const account = ctx.requireEncodedAccount(attestationPda); + const attestation = getAttestationDecoder().decode(account.data); + expect(attestation.data).toEqual(new Uint8Array(attestationData)); + expect(attestation.expiry).toBe(0n); + }); + + test('should throw AccountError when attestation is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const nonce = await ctx.createAccount(); + + await expect( + programClient.methods + .createAttestation({ data: new Uint8Array([]), expiry: 0n, nonce }) + .accounts({ + attestation: undefined as unknown as Address, + authority, + credential: credentialPda, + payer: authority, + schema: schemaPda, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[attestation\]/); + }); + + test('should throw ArgumentError when nonce is invalid', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const nonce = await ctx.createAccount(); + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + + await expect( + programClient.methods + .createAttestation({ + data: new Uint8Array([]), + expiry: 0n, + nonce: 'not-a-valid-address' as unknown as Address, + }) + .accounts({ + attestation: attestationPda, + authority, + credential: credentialPda, + payer: authority, + schema: schemaPda, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "nonce"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/create-credential.test.ts b/packages/dynamic-client/test/programs/sas/create-credential.test.ts new file mode 100644 index 000000000..8b7f58a60 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/create-credential.test.ts @@ -0,0 +1,68 @@ +import { type Address } from '@solana/addresses'; +import { deriveCredentialPda, getCredentialDecoder } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: createCredential', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should create a credential with multiple signers', async () => { + const authority = await ctx.createFundedAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + const name = 'MultiSignerCredential'; + + const [credentialPda] = await deriveCredentialPda({ authority, name }); + + const expectedAccounts = [authority, credentialPda, authority, ctx.SYSTEM_PROGRAM_ADDRESS]; + const ix = await programClient.methods + .createCredential({ name, signers: [authority, signer2, signer3] }) + .accounts({ authority, credential: credentialPda, payer: authority }) + .instruction(); + + expect(ix.accounts?.length).toBe(4); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(credentialPda); + const credential = getCredentialDecoder().decode(account.data); + + expect(credential).toMatchObject({ + authority, + authorizedSigners: [authority, signer2, signer3], + name: new Uint8Array(Buffer.from(name)), + }); + }); + + test('should throw AccountError when credential is missing', async () => { + const authority = await ctx.createFundedAccount(); + + await expect( + programClient.methods + .createCredential({ name: 'Test', signers: [authority] }) + .accounts({ authority, credential: undefined as unknown as Address, payer: authority }) + .instruction(), + ).rejects.toThrow(/Missing account \[credential\]/); + }); + + test('should throw ArgumentError when name is missing', async () => { + const authority = await ctx.createFundedAccount(); + const [credentialPda] = await deriveCredentialPda({ authority, name: 'dummy' }); + + await expect( + programClient.methods + .createCredential({ name: undefined as unknown as string, signers: [authority] }) + .accounts({ authority, credential: credentialPda, payer: authority }) + .instruction(), + ).rejects.toThrow(/Invalid argument "name"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/create-schema.test.ts b/packages/dynamic-client/test/programs/sas/create-schema.test.ts new file mode 100644 index 000000000..e2fa2fe13 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/create-schema.test.ts @@ -0,0 +1,127 @@ +import { type Address } from '@solana/addresses'; +import { getU32Encoder } from '@solana/codecs'; +import { deriveSchemaPda, getSchemaDecoder } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createCredential, + loadSasProgram, + programClient, + SCHEMA_DATA_STRING_TYPE, + SCHEMA_DATA_U8_TYPE, +} from './sas-test-utils'; + +describe('SAS: createSchema', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + loadSasProgram(ctx); + }); + + test('should create a schema', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const name = 'FullNameSchema'; + const [schemaPda] = await deriveSchemaPda({ credential: credentialPda, name, version: 1 }); + + const expectedAccounts = [authority, authority, credentialPda, schemaPda, ctx.SYSTEM_PROGRAM_ADDRESS]; + const ix = await programClient.methods + .createSchema({ + description: 'This is description', + fieldNames: ['firstName', 'age', 'lastName'], + layout: new Uint8Array([SCHEMA_DATA_STRING_TYPE, SCHEMA_DATA_U8_TYPE, SCHEMA_DATA_STRING_TYPE]), + name, + }) + .accounts({ authority, credential: credentialPda, payer: authority, schema: schemaPda }) + .instruction(); + + expect(ix.accounts?.length).toBe(5); + expectedAccounts.forEach((acc, idx) => { + expect(ix.accounts?.[idx].address).toBe(acc); + }); + await ctx.sendInstruction(ix, [authority]); + + const textEncoder = new TextEncoder(); + const account = ctx.requireEncodedAccount(schemaPda); + const schema = getSchemaDecoder().decode(account.data); + expect(schema.description).toEqual(textEncoder.encode('This is description')); + + const sizePrefixEncoder = getU32Encoder(); + expect(schema.fieldNames).toEqual( + new Uint8Array([ + ...sizePrefixEncoder.encode('firstName'.length), + ...textEncoder.encode('firstName'), + ...sizePrefixEncoder.encode('age'.length), + ...textEncoder.encode('age'), + ...sizePrefixEncoder.encode('lastName'.length), + ...textEncoder.encode('lastName'), + ]), + ); + expect(schema.layout).toEqual( + new Uint8Array([SCHEMA_DATA_STRING_TYPE, SCHEMA_DATA_U8_TYPE, SCHEMA_DATA_STRING_TYPE]), + ); + }); + + test('should throw AccountError when credential is missing', async () => { + const authority = await ctx.createFundedAccount(); + const [schemaPda] = await deriveSchemaPda({ credential: authority, name: 'dummy', version: 1 }); + + await expect( + programClient.methods + .createSchema({ description: '', fieldNames: ['field1'], layout: new Uint8Array([12]), name: 'Test' }) + .accounts({ + authority, + credential: undefined as unknown as Address, + payer: authority, + schema: schemaPda, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[credential\]/); + }); + + test('should throw AccountError when schema is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + + await expect( + programClient.methods + .createSchema({ description: '', fieldNames: ['field1'], layout: new Uint8Array([12]), name: 'Test' }) + .accounts({ + authority, + credential: credentialPda, + payer: authority, + schema: undefined as unknown as Address, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[schema\]/); + }); + + test('should throw ArgumentError when argument is invalid', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const [schemaPda] = await deriveSchemaPda({ credential: credentialPda, name: 'dummy', version: 1 }); + + await expect( + programClient.methods + .createSchema({ + description: '', + fieldNames: ['field1'], + layout: new Uint8Array([12]), + name: undefined as unknown as string, + }) + .accounts({ authority, credential: credentialPda, payer: authority, schema: schemaPda }) + .instruction(), + ).rejects.toThrow(/Invalid argument "name"/); + + await expect( + programClient.methods + .createSchema({ + description: '', + fieldNames: { a: 42 } as unknown as string[], + layout: new Uint8Array([12]), + name: '234', + }) + .accounts({ authority, credential: credentialPda, payer: authority, schema: schemaPda }) + .instruction(), + ).rejects.toThrow(/Invalid argument "fieldNames"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/create-tokenized-attestation.test.ts b/packages/dynamic-client/test/programs/sas/create-tokenized-attestation.test.ts new file mode 100644 index 000000000..f067e06b0 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/create-tokenized-attestation.test.ts @@ -0,0 +1,209 @@ +import { type Address } from '@solana/addresses'; +import { findAssociatedTokenPda } from '@solana-program/token'; +import { + deriveAttestationMintPda, + deriveAttestationPda, + getAttestationDecoder, + serializeAttestationData, +} from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createCredential, + createSchema, + getAttestationMintSize, + loadSasProgram, + programClient, + tokenizeSchema, +} from './sas-test-utils'; + +const NFT_NAME = 'Test NFT'; +const NFT_SYMBOL = 'TEST'; +const NFT_URI = 'https://example.com/metadata.json'; + +describe('SAS: createTokenizedAttestation', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true }); + loadSasProgram(ctx); + }); + + test('should create a tokenized attestation', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda, schema } = await createSchema(ctx, authority, credentialPda); + const attestationData = serializeAttestationData(schema, { field1: 'test' }); + const { sasPda, schemaMintPda } = await tokenizeSchema(ctx, authority, credentialPda, schemaPda); + + const nonce = await ctx.createAccount(); + const recipient = await ctx.createFundedAccount(); + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + const [attestationMintPda] = await deriveAttestationMintPda({ attestation: attestationPda }); + + const [recipientTokenAccount] = await findAssociatedTokenPda({ + mint: attestationMintPda, + owner: recipient, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }); + + const mintAccountSpace = getAttestationMintSize({ + attestationMint: attestationMintPda, + attestationPda, + name: NFT_NAME, + sasPda, + schemaMint: schemaMintPda, + schemaPda, + symbol: NFT_SYMBOL, + uri: NFT_URI, + }); + + const expectedAccounts = [ + authority, + authority, + credentialPda, + schemaPda, + attestationPda, + ctx.SYSTEM_PROGRAM_ADDRESS, + schemaMintPda, + attestationMintPda, + sasPda, + recipientTokenAccount, + recipient, + ctx.TOKEN_2022_PROGRAM_ADDRESS, + ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + ]; + const ix = await programClient.methods + .createTokenizedAttestation({ + data: attestationData, + expiry: 0, + mintAccountSpace, + name: NFT_NAME, + nonce, + symbol: NFT_SYMBOL, + uri: NFT_URI, + }) + .accounts({ + associatedTokenProgram: ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + attestation: attestationPda, + attestationMint: attestationMintPda, + authority, + credential: credentialPda, + payer: authority, + recipient, + recipientTokenAccount, + sasPda, + schema: schemaPda, + schemaMint: schemaMintPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(13); + expectedAccounts.forEach((expected, i) => { + expect(ix.accounts?.[i].address).eq(expected); + }); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(attestationPda); + const attestation = getAttestationDecoder().decode(account.data); + expect(attestation).toMatchObject({ + credential: credentialPda, + data: new Uint8Array(attestationData), + discriminator: 2, + expiry: 0n, + schema: schemaPda, + }); + }); + + test('should throw AccountError when schemaMint is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const { sasPda } = await tokenizeSchema(ctx, authority, credentialPda, schemaPda); + + const nonce = await ctx.createAccount(); + const recipient = await ctx.createFundedAccount(); + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + const [attestationMintPda] = await deriveAttestationMintPda({ attestation: attestationPda }); + + const [recipientTokenAccount] = await findAssociatedTokenPda({ + mint: attestationMintPda, + owner: recipient, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }); + + await expect( + programClient.methods + .createTokenizedAttestation({ + data: new Uint8Array([]), + expiry: 0n, + mintAccountSpace: 234, + name: NFT_NAME, + nonce, + symbol: NFT_SYMBOL, + uri: NFT_URI, + }) + .accounts({ + associatedTokenProgram: ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + attestation: attestationPda, + attestationMint: attestationMintPda, + authority, + credential: credentialPda, + payer: authority, + recipient, + recipientTokenAccount, + sasPda, + schema: schemaPda, + schemaMint: undefined as unknown as Address, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[schemaMint\]/); + }); + + test('should throw error with invalid argument', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + const { sasPda } = await tokenizeSchema(ctx, authority, credentialPda, schemaPda); + + const nonce = await ctx.createAccount(); + const recipient = await ctx.createFundedAccount(); + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + const [attestationMintPda] = await deriveAttestationMintPda({ attestation: attestationPda }); + + const [recipientTokenAccount] = await findAssociatedTokenPda({ + mint: attestationMintPda, + owner: recipient, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }); + + await expect( + programClient.methods + .createTokenizedAttestation({ + data: { a: 42 } as unknown as Uint8Array, + expiry: 0n, + mintAccountSpace: 234, + name: NFT_NAME, + nonce, + symbol: NFT_SYMBOL, + uri: NFT_URI, + }) + .accounts({ + associatedTokenProgram: ctx.ASSOCIATED_TOKEN_PROGRAM_ADDRESS, + attestation: attestationPda, + attestationMint: attestationMintPda, + authority, + credential: credentialPda, + payer: authority, + recipient, + recipientTokenAccount, + sasPda, + schema: schemaPda, + schemaMint: undefined as unknown as Address, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "data"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/sas/sas-test-utils.ts b/packages/dynamic-client/test/programs/sas/sas-test-utils.ts new file mode 100644 index 000000000..64aa8505a --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/sas-test-utils.ts @@ -0,0 +1,183 @@ +import path from 'node:path'; + +import { type Address } from '@solana/addresses'; +import { getMintSize } from '@solana-program/token-2022'; +import { + deriveAttestationPda, + deriveCredentialPda, + deriveSasAuthorityAddress, + deriveSchemaMintPda, + deriveSchemaPda, + getSchemaDecoder, +} from 'sas-lib'; + +import type { SvmTestContext } from '../../svm-test-context'; +import type { SolanaAttestationServiceProgramClient } from '../generated/sas-idl-types'; +import { createTestProgramClient } from '../test-utils'; + +export const programClient = createTestProgramClient('sas-idl.json'); + +export function loadSasProgram(ctx: SvmTestContext) { + const programPath = path.resolve(__dirname, '..', 'dumps', 'sas.so'); + ctx.loadProgram(programClient.programAddress, programPath); +} + +/** + * Compute the mint account space needed for TokenizedSchema. + */ +export function getSchemaMintSize(sasPda: Address, schemaMint: Address) { + return getMintSize([{ __kind: 'GroupPointer', authority: sasPda, groupAddress: schemaMint }]); +} + +/** + * Compute the mint account space needed for TokenizedAttestation. + */ +export function getAttestationMintSize({ + sasPda, + attestationMint, + schemaMint, + name, + symbol, + uri, + attestationPda, + schemaPda, +}: { + attestationMint: Address; + attestationPda: Address; + name: string; + sasPda: Address; + schemaMint: Address; + schemaPda: Address; + symbol: string; + uri: string; +}) { + return getMintSize([ + { __kind: 'GroupMemberPointer', authority: sasPda, memberAddress: attestationMint }, + { __kind: 'NonTransferable' }, + { __kind: 'MetadataPointer', authority: sasPda, metadataAddress: attestationMint }, + { __kind: 'PermanentDelegate', delegate: sasPda }, + { __kind: 'MintCloseAuthority', closeAuthority: sasPda }, + { + __kind: 'TokenMetadata', + additionalMetadata: new Map([ + ['attestation', attestationPda], + ['schema', schemaPda], + ]), + mint: attestationMint, + name, + symbol, + updateAuthority: sasPda, + uri, + }, + { __kind: 'TokenGroupMember', group: schemaMint, memberNumber: 1, mint: attestationMint }, + ]); +} + +export async function createCredential(ctx: SvmTestContext, opts?: { name?: string; signers?: Address[] }) { + const authority = await ctx.createFundedAccount(); + const name = opts?.name ?? 'TestCredential'; + const signers = opts?.signers ?? [authority]; + + const [credentialPda] = await deriveCredentialPda({ authority, name }); + + const ix = await programClient.methods + .createCredential({ name, signers }) + .accounts({ authority, credential: credentialPda, payer: authority }) + .instruction(); + + await ctx.sendInstruction(ix, [authority]); + + return { authority, credentialPda, name }; +} + +// https://github.com/solana-foundation/solana-attestation-service/blob/master/program/src/state/schema.rs#L26 +export const SCHEMA_DATA_STRING_TYPE = 12; +export const SCHEMA_DATA_U8_TYPE = 0; + +/** + * Helper function to create a schema. + * - Derives the schema PDA + * - Sends the createSchema instruction + * - Fetches and decodes the created schema account + */ +export async function createSchema( + ctx: SvmTestContext, + authority: Address, + credentialPda: Address, + opts?: { description?: string; fieldNames?: string[]; layout?: Uint8Array; name?: string; version?: number }, +) { + const description = opts?.description ?? ''; + const fieldNames = opts?.fieldNames ?? ['field1']; + const layout = opts?.layout ?? new Uint8Array([SCHEMA_DATA_STRING_TYPE]); + const name = opts?.name ?? 'TestSchema'; + const version = opts?.version ?? 1; + + const [schemaPda] = await deriveSchemaPda({ credential: credentialPda, name, version }); + const ix = await programClient.methods + .createSchema({ description, fieldNames, layout, name }) + .accounts({ authority, credential: credentialPda, payer: authority, schema: schemaPda }) + .instruction(); + await ctx.sendInstruction(ix, [authority]); + + const schemaData = ctx.requireEncodedAccount(schemaPda).data; + const schema = getSchemaDecoder().decode(schemaData); + + return { name, schema, schemaData, schemaPda, version }; +} + +export async function createAttestation( + ctx: SvmTestContext, + authority: Address, + credentialPda: Address, + schemaPda: Address, + opts?: { data?: Uint8Array; expiry?: bigint }, +) { + const data = opts?.data ?? new Uint8Array([0, 0, 0, 0]); + const expiry = opts?.expiry ?? 0n; + const nonce = await ctx.createAccount(); + + const [attestationPda] = await deriveAttestationPda({ credential: credentialPda, nonce, schema: schemaPda }); + + const ix = await programClient.methods + .createAttestation({ data, expiry, nonce }) + .accounts({ + attestation: attestationPda, + authority, + credential: credentialPda, + payer: authority, + schema: schemaPda, + }) + .instruction(); + + await ctx.sendInstruction(ix, [authority]); + + return { attestationPda, nonce }; +} + +export async function tokenizeSchema( + ctx: SvmTestContext, + authority: Address, + credentialPda: Address, + schemaPda: Address, +) { + const sasPda = await deriveSasAuthorityAddress(); + const [schemaMintPda] = await deriveSchemaMintPda({ schema: schemaPda }); + const maxSize = BigInt(getSchemaMintSize(sasPda, schemaMintPda)); + + const ix = await programClient.methods + .tokenizeSchema({ maxSize }) + .accounts({ + authority, + credential: credentialPda, + mint: schemaMintPda, + payer: authority, + sasPda, + schema: schemaPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(); + + await ctx.sendInstruction(ix, [authority]); + + return { sasPda, schemaMintPda }; +} diff --git a/packages/dynamic-client/test/programs/sas/tokenize-schema.test.ts b/packages/dynamic-client/test/programs/sas/tokenize-schema.test.ts new file mode 100644 index 000000000..c5c05c790 --- /dev/null +++ b/packages/dynamic-client/test/programs/sas/tokenize-schema.test.ts @@ -0,0 +1,108 @@ +import { type Address } from '@solana/addresses'; +import { deriveSasAuthorityAddress, deriveSchemaMintPda } from 'sas-lib'; +import { beforeEach, describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createCredential, createSchema, getSchemaMintSize, loadSasProgram, programClient } from './sas-test-utils'; + +describe('SAS: tokenizeSchema', () => { + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext({ defaultPrograms: true }); + loadSasProgram(ctx); + }); + + test('should tokenize a schema and create a mint', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const sasPda = await deriveSasAuthorityAddress(); + const [schemaMintPda] = await deriveSchemaMintPda({ schema: schemaPda }); + const maxSize = BigInt(getSchemaMintSize(sasPda, schemaMintPda)); + + const expectedAccounts = [ + authority, + authority, + credentialPda, + schemaPda, + schemaMintPda, + sasPda, + ctx.SYSTEM_PROGRAM_ADDRESS, + ctx.TOKEN_2022_PROGRAM_ADDRESS, + ]; + const ix = await programClient.methods + .tokenizeSchema({ maxSize }) + .accounts({ + authority, + credential: credentialPda, + mint: schemaMintPda, + payer: authority, + sasPda, + schema: schemaPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(); + + expect(ix.accounts?.length).toBe(8); + expectedAccounts.forEach((expected, i) => { + if (!ix?.accounts?.[i]) { + throw new Error(`Expected instruction accounts to be defined at index ${i}`); + } + expect(ix.accounts[i].address).eq(expected); + }); + + await ctx.sendInstruction(ix, [authority]); + + const account = ctx.requireEncodedAccount(schemaMintPda); + expect(account).not.toBeNull(); + expect(account.data.length).greaterThan(0); + }); + + test('should throw AccountError when mint is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const sasPda = await deriveSasAuthorityAddress(); + const [schemaMintPda] = await deriveSchemaMintPda({ schema: schemaPda }); + const maxSize = getSchemaMintSize(sasPda, schemaMintPda); // should work as number + + await expect( + programClient.methods + .tokenizeSchema({ maxSize }) + .accounts({ + authority, + credential: credentialPda, + mint: undefined as unknown as Address, + payer: authority, + sasPda, + schema: schemaPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(), + ).rejects.toThrow(/Missing account \[mint\]/); + }); + + test('should throw AccountError when maxSize arg is missing', async () => { + const { authority, credentialPda } = await createCredential(ctx); + const { schemaPda } = await createSchema(ctx, authority, credentialPda); + + const sasPda = await deriveSasAuthorityAddress(); + const [schemaMintPda] = await deriveSchemaMintPda({ schema: schemaPda }); + + await expect( + programClient.methods + .tokenizeSchema({ maxSize: 'jondoe' as unknown as bigint }) + .accounts({ + authority, + credential: credentialPda, + mint: schemaMintPda, + payer: authority, + sasPda, + schema: schemaPda, + tokenProgram: ctx.TOKEN_2022_PROGRAM_ADDRESS, + }) + .instruction(), + ).rejects.toThrow(/Invalid argument "maxSize"/); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/advance-nonce-account.test.ts b/packages/dynamic-client/test/programs/system-program/advance-nonce-account.test.ts new file mode 100644 index 000000000..1bcb940bb --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/advance-nonce-account.test.ts @@ -0,0 +1,109 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: advanceNonceAccount', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should advance nonce multiple times and work after authority change', async () => { + const payer = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + const originalAuthority = await ctx.createFundedAccount(); + const newAuthority = await ctx.createFundedAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 10_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payer, nonceAccount]); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority: originalAuthority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payer]); + + const initialData = ctx.requireEncodedAccount(nonceAccount).data; + + ctx.advanceSlots(); + const advanceNonceInstruction1 = await programClient.methods + .advanceNonceAccount() + .accounts({ + nonceAccount, + nonceAuthority: originalAuthority, + }) + .instruction(); + + await ctx.sendInstruction(advanceNonceInstruction1, [originalAuthority]); + + const dataAfterFirstAdvance = ctx.requireEncodedAccount(nonceAccount).data; + expect(dataAfterFirstAdvance).not.toEqual(initialData); + + ctx.advanceSlots(); + const advanceNonceInstruction2 = await programClient.methods + .advanceNonceAccount() + .accounts({ + nonceAccount, + nonceAuthority: originalAuthority, + }) + .instruction(); + + await ctx.sendInstruction(advanceNonceInstruction2, [originalAuthority]); + + const dataAfterSecondAdvance = ctx.requireEncodedAccount(nonceAccount).data; + expect(dataAfterSecondAdvance).not.toEqual(dataAfterFirstAdvance); + + const authorizeNonceInstruction = await programClient.methods + .authorizeNonceAccount({ + newNonceAuthority: newAuthority, + }) + .accounts({ + nonceAccount, + nonceAuthority: originalAuthority, + }) + .instruction(); + + await ctx.sendInstruction(authorizeNonceInstruction, [originalAuthority]); + + ctx.advanceSlots(); + const advanceWithNewAuthority = await programClient.methods + .advanceNonceAccount() + .accounts({ + nonceAccount, + nonceAuthority: newAuthority, + }) + .instruction(); + + await ctx.sendInstruction(advanceWithNewAuthority, [newAuthority]); + + const finalAccount = ctx.requireEncodedAccount(nonceAccount); + expect(finalAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + expect(finalAccount.data.length).toBe(nonceAccountSpace); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/allocate-with-seed.test.ts b/packages/dynamic-client/test/programs/system-program/allocate-with-seed.test.ts new file mode 100644 index 000000000..ff3c47efe --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/allocate-with-seed.test.ts @@ -0,0 +1,62 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: allocateWithSeed', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should allocate space for a seed-derived account', async () => { + const payerAccount = await ctx.createFundedAccount(); + const baseAccount = await ctx.createFundedAccount(); + + const seed = 'storage'; + const newAccount = await ctx.createAccountWithSeed(baseAccount, seed, programClient.programAddress); + + const fundingLamports = 5_000_000; + const createIx = await programClient.methods + .createAccountWithSeed({ + amount: fundingLamports, + base: baseAccount, + programAddress: programClient.programAddress, + seed, + space: 0, + }) + .accounts({ + baseAccount, + newAccount, + payer: payerAccount, + }) + .instruction(); + + await ctx.sendInstruction(createIx, [payerAccount, baseAccount]); + + const space = 96; + const allocateIx = await programClient.methods + .allocateWithSeed({ + base: baseAccount, + programAddress: programClient.programAddress, + seed, + space, + }) + .accounts({ + baseAccount, + newAccount, + }) + .instruction(); + + await ctx.sendInstruction(allocateIx, [baseAccount]); + + const accountAfter = ctx.requireEncodedAccount(newAccount); + + expect(accountAfter).toMatchObject({ + data: new Uint8Array(space), + owner: programClient.programAddress, + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/allocate.test.ts b/packages/dynamic-client/test/programs/system-program/allocate.test.ts new file mode 100644 index 000000000..f030967f7 --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/allocate.test.ts @@ -0,0 +1,37 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: allocate', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should allocate space for an account', async () => { + const account = await ctx.createFundedAccount(); + const space = 100; + + const accountBefore = ctx.requireEncodedAccount(account); + expect(accountBefore.data.length).toBe(0); + + const instruction = await programClient.methods + .allocate({ space }) + .accounts({ newAccount: account }) + .instruction(); + + await ctx.sendInstruction(instruction, [account]); + + const accountAfter = ctx.requireEncodedAccount(account); + + expect(accountAfter).toMatchObject({ + owner: programClient.programAddress, + }); + expect(accountAfter.data.length).toBe(space); + expect(accountAfter.lamports).toBeLessThan(accountBefore.lamports); + expect(accountAfter.data.every(byte => byte === 0)).toBe(true); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/assign-with-seed.test.ts b/packages/dynamic-client/test/programs/system-program/assign-with-seed.test.ts new file mode 100644 index 000000000..03a8156aa --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/assign-with-seed.test.ts @@ -0,0 +1,56 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: assignWithSeed', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should assign seed-derived account to system program', async () => { + const payerAccount = await ctx.createFundedAccount(); + const baseAccount = await ctx.createFundedAccount(); + + const seed = 'wallet'; + const account = await ctx.createAccountWithSeed(baseAccount, seed, programClient.programAddress); + + const createIx = await programClient.methods + .createAccountWithSeed({ + amount: 5_000_000, + base: baseAccount, + programAddress: programClient.programAddress, + seed, + space: 32, + }) + .accounts({ + baseAccount, + newAccount: account, + payer: payerAccount, + }) + .instruction(); + + await ctx.sendInstruction(createIx, [payerAccount, baseAccount]); + + const assignIx = await programClient.methods + .assignWithSeed({ + base: baseAccount, + programAddress: programClient.programAddress, + seed, + }) + .accounts({ + account, + baseAccount, + }) + .instruction(); + + await ctx.sendInstruction(assignIx, [baseAccount]); + + expect(ctx.requireEncodedAccount(account)).toMatchObject({ + owner: programClient.programAddress, + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/assign.test.ts b/packages/dynamic-client/test/programs/system-program/assign.test.ts new file mode 100644 index 000000000..6285a26bd --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/assign.test.ts @@ -0,0 +1,56 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: assign', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should assign a new owner to an account', async () => { + const payer = await ctx.createFundedAccount(); + const accountToAssign = await ctx.createAccount(); + const newOwner = await ctx.createAccount(); + const amount = 1_000_000; + + const transferInstruction = await programClient.methods + .transferSol({ amount }) + .accounts({ + destination: accountToAssign, + source: payer, + }) + .instruction(); + + const assignInstruction = await programClient.methods + .assign({ programAddress: newOwner }) + .accounts({ account: accountToAssign }) + .instruction(); + + await ctx.sendInstructions([transferInstruction, assignInstruction], [payer, accountToAssign]); + + expect(ctx.requireEncodedAccount(accountToAssign)).toMatchObject({ + lamports: BigInt(amount), + owner: newOwner, + }); + }); + + test('should assign account to system program', async () => { + const account = await ctx.createFundedAccount(); + + const instruction = await programClient.methods + .assign({ programAddress: programClient.programAddress }) + .accounts({ account: account }) + .instruction(); + + await ctx.sendInstruction(instruction, [account]); + + const encodedAccount = ctx.requireEncodedAccount(account); + expect(encodedAccount).toMatchObject({ + owner: programClient.programAddress, + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/authorize-nonce-account.test.ts b/packages/dynamic-client/test/programs/system-program/authorize-nonce-account.test.ts new file mode 100644 index 000000000..f1621201d --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/authorize-nonce-account.test.ts @@ -0,0 +1,196 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: authorizeNonceAccount', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should change nonce account authority to a new authority', async () => { + const payer = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + const originalAuthority = await ctx.createFundedAccount(); + const newAuthority = await ctx.createAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 10_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payer, nonceAccount]); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority: originalAuthority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payer]); + + const initializedAccount = ctx.requireEncodedAccount(nonceAccount); + expect(initializedAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + + const authorizeNonceInstruction = await programClient.methods + .authorizeNonceAccount({ + newNonceAuthority: newAuthority, + }) + .accounts({ + nonceAccount, + nonceAuthority: originalAuthority, + }) + .instruction(); + + await ctx.sendInstruction(authorizeNonceInstruction, [originalAuthority]); + + const authorizedAccount = ctx.requireEncodedAccount(nonceAccount); + expect(authorizedAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + expect(authorizedAccount.data.length).toBe(nonceAccountSpace); + }); + + test('should allow changing authority multiple times', async () => { + const payer = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + const firstAuthority = await ctx.createFundedAccount(); + const secondAuthority = await ctx.createFundedAccount(); + const thirdAuthority = await ctx.createAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 10_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payer, nonceAccount]); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority: firstAuthority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payer]); + + const authorizeToSecondInstruction = await programClient.methods + .authorizeNonceAccount({ + newNonceAuthority: secondAuthority, + }) + .accounts({ + nonceAccount, + nonceAuthority: firstAuthority, + }) + .instruction(); + + await ctx.sendInstruction(authorizeToSecondInstruction, [firstAuthority]); + + const authorizeToThirdInstruction = await programClient.methods + .authorizeNonceAccount({ + newNonceAuthority: thirdAuthority, + }) + .accounts({ + nonceAccount, + nonceAuthority: secondAuthority, + }) + .instruction(); + + await ctx.sendInstruction(authorizeToThirdInstruction, [secondAuthority]); + + const finalAccount = ctx.requireEncodedAccount(nonceAccount); + expect(finalAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + expect(finalAccount.data.length).toBe(nonceAccountSpace); + }); + + test('should work when authority transfers to itself (no-op transfer)', async () => { + const payer = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + const authority = await ctx.createFundedAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 10_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payer, nonceAccount]); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority: authority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payer]); + + const authorizeInstruction = await programClient.methods + .authorizeNonceAccount({ + newNonceAuthority: authority, + }) + .accounts({ + nonceAccount, + nonceAuthority: authority, + }) + .instruction(); + + await ctx.sendInstruction(authorizeInstruction, [authority]); + + const finalAccount = ctx.requireEncodedAccount(nonceAccount); + expect(finalAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/create-account-with-seed.test.ts b/packages/dynamic-client/test/programs/system-program/create-account-with-seed.test.ts new file mode 100644 index 000000000..044165fa6 --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/create-account-with-seed.test.ts @@ -0,0 +1,50 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: createAccountWithSeed', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should create a new account at a seed-derived address', async () => { + const payerAccount = await ctx.createFundedAccount(); + const baseAccount = await ctx.createFundedAccount(); + + const seed = 'vault'; + const newAccount = await ctx.createAccountWithSeed(baseAccount, seed, programClient.programAddress); + + const accountSpace = 64; + const fundingLamports = 5_000_000; + + const createAccountWithSeedInstruction = await programClient.methods + .createAccountWithSeed({ + amount: fundingLamports, + base: baseAccount, + programAddress: programClient.programAddress, + seed, + space: accountSpace, + }) + .accounts({ + baseAccount, + newAccount, + payer: payerAccount, + }) + .instruction(); + + await ctx.sendInstruction(createAccountWithSeedInstruction, [payerAccount, baseAccount]); + + const createdAccount = ctx.requireEncodedAccount(newAccount); + + expect(createdAccount).toMatchObject({ + data: new Uint8Array(accountSpace), + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/create-account.test.ts b/packages/dynamic-client/test/programs/system-program/create-account.test.ts new file mode 100644 index 000000000..9379121a3 --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/create-account.test.ts @@ -0,0 +1,44 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: createAccount', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should create a new account with specified space and lamports', async () => { + const payerAccount = await ctx.createFundedAccount(); + const newAccountAddress = await ctx.createAccount(); + + const accountSpace = 165; + const fundingLamports = 10_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: accountSpace, + }) + .accounts({ + newAccount: newAccountAddress, + payer: payerAccount, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payerAccount, newAccountAddress]); + + const createdAccount = ctx.requireEncodedAccount(newAccountAddress); + + expect(createdAccount).toMatchObject({ + data: new Uint8Array(accountSpace), + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/initialize-nonce-account.test.ts b/packages/dynamic-client/test/programs/system-program/initialize-nonce-account.test.ts new file mode 100644 index 000000000..9e50276a4 --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/initialize-nonce-account.test.ts @@ -0,0 +1,102 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: initializeNonceAccount', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should initialize a nonce account with specified authority', async () => { + const payer = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + const nonceAuthority = await ctx.createAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 10_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payer, nonceAccount]); + + const createdAccount = ctx.requireEncodedAccount(nonceAccount); + expect(createdAccount.data.length).toBe(nonceAccountSpace); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payer]); + + const initializedAccount = ctx.requireEncodedAccount(nonceAccount); + + expect(initializedAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + expect(initializedAccount.data.length).toBe(nonceAccountSpace); + expect(initializedAccount.data.some(byte => byte !== 0)).toBe(true); + }); + + test('should initialize a nonce account where authority is also the payer', async () => { + const payerAndAuthority = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 5_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer: payerAndAuthority, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payerAndAuthority, nonceAccount]); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority: payerAndAuthority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payerAndAuthority]); + + const initializedAccount = ctx.requireEncodedAccount(nonceAccount); + + expect(initializedAccount).toMatchObject({ + executable: false, + lamports: BigInt(fundingLamports), + owner: programClient.programAddress, + }); + expect(initializedAccount.data.length).toBe(nonceAccountSpace); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/transfer-sol-with-seed.test.ts b/packages/dynamic-client/test/programs/system-program/transfer-sol-with-seed.test.ts new file mode 100644 index 000000000..c59780b8a --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/transfer-sol-with-seed.test.ts @@ -0,0 +1,66 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: transferSolWithSeed', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should transfer SOL from a seed-derived account to a destination', async () => { + const payerAccount = await ctx.createFundedAccount(); + const baseAccount = await ctx.createFundedAccount(); + + const seed = 'vault'; + const source = await ctx.createAccountWithSeed(baseAccount, seed, programClient.programAddress); + + const fundingLamports = 10_000_000; + const createIx = await programClient.methods + .createAccountWithSeed({ + amount: fundingLamports, + base: baseAccount, + programAddress: programClient.programAddress, + seed, + space: 0, + }) + .accounts({ + baseAccount, + newAccount: source, + payer: payerAccount, + }) + .instruction(); + + await ctx.sendInstruction(createIx, [payerAccount, baseAccount]); + + const destination = await ctx.createAccount(); + const transferAmount = 3_000_000; + + expect(ctx.requireEncodedAccount(source).lamports).toBe(BigInt(fundingLamports)); + expect(ctx.fetchEncodedAccount(destination)).toBeNull(); + + const transferIx = await programClient.methods + .transferSolWithSeed({ + amount: transferAmount, + fromOwner: programClient.programAddress, + fromSeed: seed, + }) + .accounts({ + baseAccount, + destination, + source, + }) + .instruction(); + + await ctx.sendInstruction(transferIx, [baseAccount]); + + const sourceAfter = ctx.requireEncodedAccount(source); + const destinationAfter = ctx.requireEncodedAccount(destination); + + expect(sourceAfter.lamports).toBe(BigInt(fundingLamports) - BigInt(transferAmount)); + expect(destinationAfter.lamports).toBe(BigInt(transferAmount)); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/transfer-sol.test.ts b/packages/dynamic-client/test/programs/system-program/transfer-sol.test.ts new file mode 100644 index 000000000..e09066685 --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/transfer-sol.test.ts @@ -0,0 +1,37 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: transferSol', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should transfer SOL from one account to another', async () => { + const initialSourceBalance = 3_000_000_000; + const source = await ctx.createFundedAccount(BigInt(initialSourceBalance)); + const destination = await ctx.createAccount(); + const transferAmount = 1_000_000_000; + + expect(ctx.fetchEncodedAccount(source)).toMatchObject({ + lamports: BigInt(initialSourceBalance), + }); + expect(ctx.fetchEncodedAccount(destination)).toBeNull(); + + const instruction = await programClient.methods + .transferSol({ amount: transferAmount }) + .accounts({ destination, source }) + .instruction(); + + await ctx.sendInstruction(instruction, [source]); + + const sourceAccount = ctx.requireEncodedAccount(source); + expect(sourceAccount.lamports).toBeLessThan(BigInt(initialSourceBalance) - BigInt(transferAmount)); + const destinationAccount = ctx.requireEncodedAccount(destination); + expect(destinationAccount.lamports).toBe(BigInt(transferAmount)); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/upgrade-nonce-account.test.ts b/packages/dynamic-client/test/programs/system-program/upgrade-nonce-account.test.ts new file mode 100644 index 000000000..54d67120d --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/upgrade-nonce-account.test.ts @@ -0,0 +1,45 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +/** + * + * NOTE: This instruction only works on LEGACY nonce accounts (created before + * the version field was added). When we create new nonce accounts with + * initializeNonceAccount, they are already in the CURRENT format, so calling + * upgradeNonceAccount on them will fail with "InvalidArgument". + * + * These tests verify that the instruction can be built correctly, but cannot + * test the actual upgrade behavior since we cannot easily create legacy nonce + * accounts in the test environment. + */ +describe('System Program: upgradeNonceAccount', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('smoke: should build upgrade nonce account instruction correctly', async () => { + const nonceAccount = await ctx.createAccount(); + + const upgradeNonceInstruction = await programClient.methods + .upgradeNonceAccount() + .accounts({ + nonceAccount, + }) + .instruction(); + + expect(upgradeNonceInstruction).toBeDefined(); + expect(upgradeNonceInstruction.programAddress).toBe(programClient.programAddress); + expect(upgradeNonceInstruction.accounts).toBeDefined(); + expect(upgradeNonceInstruction.data).toBeDefined(); + + expect(upgradeNonceInstruction.accounts?.length).toBe(1); + + const nonceAccountMeta = upgradeNonceInstruction.accounts?.[0]; + expect(nonceAccountMeta?.address).toBe(nonceAccount); + }); +}); diff --git a/packages/dynamic-client/test/programs/system-program/withdraw-nonce-account.test.ts b/packages/dynamic-client/test/programs/system-program/withdraw-nonce-account.test.ts new file mode 100644 index 000000000..e1d61204c --- /dev/null +++ b/packages/dynamic-client/test/programs/system-program/withdraw-nonce-account.test.ts @@ -0,0 +1,71 @@ +import { beforeEach, describe, expect, test } from 'vitest'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +describe('System Program: withdrawNonceAccount', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + let ctx: SvmTestContext; + + beforeEach(() => { + ctx = new SvmTestContext(); + }); + + test('should withdraw lamports from nonce account to recipient', async () => { + const payer = await ctx.createFundedAccount(); + const nonceAccount = await ctx.createAccount(); + const nonceAuthority = await ctx.createFundedAccount(); + const recipient = await ctx.createAccount(); + + const nonceAccountSpace = 80; + const fundingLamports = 10_000_000; + const withdrawAmount = 2_000_000; + + const createAccountInstruction = await programClient.methods + .createAccount({ + lamports: fundingLamports, + programAddress: programClient.programAddress, + space: nonceAccountSpace, + }) + .accounts({ + newAccount: nonceAccount, + payer, + }) + .instruction(); + + await ctx.sendInstruction(createAccountInstruction, [payer, nonceAccount]); + + const initializeNonceInstruction = await programClient.methods + .initializeNonceAccount({ + nonceAuthority, + }) + .accounts({ + nonceAccount, + }) + .instruction(); + + await ctx.sendInstruction(initializeNonceInstruction, [payer]); + + const beforeWithdraw = ctx.requireEncodedAccount(nonceAccount); + expect(beforeWithdraw.lamports).toBe(BigInt(fundingLamports)); + + const withdrawInstruction = await programClient.methods + .withdrawNonceAccount({ + withdrawAmount, + }) + .accounts({ + nonceAccount, + nonceAuthority, + recipientAccount: recipient, + }) + .instruction(); + + await ctx.sendInstruction(withdrawInstruction, [nonceAuthority]); + + const afterWithdrawNonce = ctx.requireEncodedAccount(nonceAccount); + expect(afterWithdrawNonce.lamports).toBe(BigInt(fundingLamports - withdrawAmount)); + + const recipientAccount = ctx.requireEncodedAccount(recipient); + expect(recipientAccount.lamports).toBe(BigInt(withdrawAmount)); + }); +}); diff --git a/packages/dynamic-client/test/programs/test-utils.ts b/packages/dynamic-client/test/programs/test-utils.ts new file mode 100644 index 000000000..7ace62ff4 --- /dev/null +++ b/packages/dynamic-client/test/programs/test-utils.ts @@ -0,0 +1,38 @@ +import { readFileSync } from 'node:fs'; +import path from 'node:path'; + +import { createFromJson, type RootNode } from 'codama'; + +import type { IdlInput, ProgramClient } from '../../src'; +import { createProgramClient } from '../../src'; + +export function loadIdl(idlFileName: string, baseDir?: string): IdlInput { + const basePath = baseDir ?? path.resolve(__dirname, 'idls'); + const idlPath = path.resolve(basePath, idlFileName); + const idlJson: unknown = JSON.parse(readFileSync(idlPath, 'utf8')); + if (typeof idlJson !== 'object' || idlJson === null) { + throw new Error(`Invalid IDL json: ${idlFileName}`); + } + return idlJson as IdlInput; +} + +/** + * Creates a program client for tests. Pass a generated client type for full type safety: + * ```ts + * import type { SystemProgramClient } from '../generated/system-program-idl-types'; + * const client = createTestProgramClient('system-program-idl.json'); + * // client.methods.advanceNonceAccount etc. are now typed, no non-null assertions needed + * ``` + */ +export function createTestProgramClient(idlFileName: string): T { + const idl = loadIdl(idlFileName); + return createProgramClient(idl); +} + +export function loadRoot(idlFileName: string): RootNode { + const idl = loadIdl(idlFileName); + const json = JSON.stringify(idl); + return createFromJson(json).getRoot(); +} + +export { SvmTestContext, type EncodedAccount } from '../svm-test-context'; diff --git a/packages/dynamic-client/test/programs/token-2022/amount-to-ui-amount.test.ts b/packages/dynamic-client/test/programs/token-2022/amount-to-ui-amount.test.ts new file mode 100644 index 000000000..9766b4ce6 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/amount-to-ui-amount.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: amountToUiAmount', () => { + test('should convert a token amount to its UI representation', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + const amount = 1_000_000_000; + const expectedUiAmount = amount / 10 ** 9; + + const ix = await token2022Client.methods + .amountToUiAmount({ amount }) + .accounts({ mint: mintAccount }) + .instruction(); + + const meta = await ctx.sendInstruction(ix, [payer]); + const returnData = meta.returnData(); + const uiAmount = new TextDecoder().decode(returnData.data()); + expect(uiAmount).toBe(expectedUiAmount.toString()); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/approve-checked.test.ts b/packages/dynamic-client/test/programs/token-2022/approve-checked.test.ts new file mode 100644 index 000000000..70741d24f --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/approve-checked.test.ts @@ -0,0 +1,30 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, mintTokens, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: approveChecked', () => { + test('should approve_checked a delegate', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, sourceAccount, payer, 1_000_000); + + const ix = await token2022Client.methods + .approveChecked({ amount: 500_000, decimals: 9 }) + .accounts({ delegate, mint: mintAccount, owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceData.delegatedAmount).toBe(500_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/approve.test.ts b/packages/dynamic-client/test/programs/token-2022/approve.test.ts new file mode 100644 index 000000000..073223013 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/approve.test.ts @@ -0,0 +1,82 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createMint, + createTokenAccount, + mintTokens, + systemClient, + TOKEN_2022_MULTISIG_SIZE, + token2022Client, +} from './token-2022-test-utils'; + +describe('Token 2022 Program: approve', () => { + test('should approve a delegate for a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, sourceAccount, payer, 1_000_000); + + const ix = await token2022Client.methods + .approve({ amount: 500_000 }) + .accounts({ delegate, owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceData.delegatedAmount).toBe(500_000n); + }); + + test('should approve with multisig', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + const multisigOwner = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, multisigOwner); + await mintTokens(ctx, payer, mintAccount, sourceAccount, payer, 1_000_000); + + const signer1 = await ctx.createAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(TOKEN_2022_MULTISIG_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, + space: TOKEN_2022_MULTISIG_SIZE, + }) + .accounts({ newAccount: multisigOwner, payer }) + .instruction(); + + const initMultisigIx = await token2022Client.methods + .initializeMultisig({ m: 2, signers: [signer1, signer2, signer3] }) + .accounts({ multisig: multisigOwner }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMultisigIx], [payer, multisigOwner]); + + const ix = await token2022Client.methods + .approve({ amount: 500_000, multiSigners: [signer1, signer2] }) + .accounts({ delegate, owner: multisigOwner, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer, signer1, signer2]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceData.delegatedAmount).toBe(500_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/burn-checked.test.ts b/packages/dynamic-client/test/programs/token-2022/burn-checked.test.ts new file mode 100644 index 000000000..e1ae3e15e --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/burn-checked.test.ts @@ -0,0 +1,28 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, mintTokens, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: burnChecked', () => { + test('should burn_checked tokens', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, tokenAccount, payer, 1_000_000); + + const ix = await token2022Client.methods + .burnChecked({ amount: 400_000, decimals: 9 }) + .accounts({ account: tokenAccount, authority: payer, mint: mintAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const tokenData = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.amount).toBe(600_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/burn.test.ts b/packages/dynamic-client/test/programs/token-2022/burn.test.ts new file mode 100644 index 000000000..1fd90df18 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/burn.test.ts @@ -0,0 +1,30 @@ +import { getMintDecoder, getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, mintTokens, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: burn', () => { + test('should burn tokens from a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, tokenAccount, payer, 1_000_000); + + const burnIx = await token2022Client.methods + .burn({ amount: 400_000 }) + .accounts({ account: tokenAccount, authority: payer, mint: mintAccount }) + .instruction(); + await ctx.sendInstruction(burnIx, [payer]); + + const tokenData = getTokenDecoder().decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.amount).toBe(600_000n); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.supply).toBe(600_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/close-account.test.ts b/packages/dynamic-client/test/programs/token-2022/close-account.test.ts new file mode 100644 index 000000000..26114540f --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/close-account.test.ts @@ -0,0 +1,25 @@ +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: closeAccount', () => { + test('should close a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, owner); + + const ix = await token2022Client.methods + .closeAccount() + .accounts({ account: tokenAccount, destination: owner, owner }) + .instruction(); + await ctx.sendInstruction(ix, [owner]); + + expect(ctx.fetchEncodedAccount(tokenAccount)).toBeNull(); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/confidential-transfer-fee.test.ts b/packages/dynamic-client/test/programs/token-2022/confidential-transfer-fee.test.ts new file mode 100644 index 000000000..22d7ed864 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/confidential-transfer-fee.test.ts @@ -0,0 +1,131 @@ +import type { Address } from '@solana/addresses'; +import { some } from '@solana/codecs'; +import { type ExtensionArgs, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +const getConfidentialTransferFeeExts = ( + feeAuthority: Address, + withdrawAuthority: Address, + confidentialFeeAuthority: Address, + confidentialTransferAuthority: Address, + elgamalPubkey: Address, +): ExtensionArgs[] => [ + { + __kind: 'TransferFeeConfig', + newerTransferFee: { epoch: 0n, maximumFee: 1_000_000n, transferFeeBasisPoints: 100 }, + olderTransferFee: { epoch: 0n, maximumFee: 0n, transferFeeBasisPoints: 0 }, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + withheldAmount: 0n, + }, + { + __kind: 'ConfidentialTransferMint', + auditorElgamalPubkey: null, + authority: confidentialTransferAuthority, + autoApproveNewAccounts: true, + }, + { + __kind: 'ConfidentialTransferFee', + authority: confidentialFeeAuthority, + elgamalPubkey: elgamalPubkey, + harvestToMintEnabled: true, + withheldAmount: new Uint8Array(64), + }, +]; + +describe('Token 2022 Program: confidentialTransferFee', () => { + test('should initialize confidential transfer fee extension [initializeConfidentialTransferFee]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + const confidentialFeeAuthority = await ctx.createFundedAccount(); + const confidentialTransferAuthority = await ctx.createFundedAccount(); + const elgamalPubkey = await ctx.createFundedAccount(); + + const size = getMintSize( + getConfidentialTransferFeeExts( + feeAuthority, + withdrawAuthority, + confidentialFeeAuthority, + confidentialTransferAuthority, + elgamalPubkey, + ), + ); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initFeeConfigIx = await token2022Client.methods + .initializeTransferFeeConfig({ + maximumFee: 1_000_000, + transferFeeBasisPoints: 100, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + }) + .accounts({ mint }) + .instruction(); + + const initConfidentialTransferIx = await token2022Client.methods + .initializeConfidentialTransferMint({ + auditorElgamalPubkey: null, + authority: confidentialTransferAuthority, + autoApproveNewAccounts: true, + }) + .accounts({ mint }) + .instruction(); + + const initConfidentialFeeIx = await token2022Client.methods + .initializeConfidentialTransferFee({ + authority: confidentialFeeAuthority, + withdrawWithheldAuthorityElGamalPubkey: elgamalPubkey, + }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions( + [createAccountIx, initFeeConfigIx, initConfidentialTransferIx, initConfidentialFeeIx, initMintIx], + [payer, mint], + ); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'TransferFeeConfig', + newerTransferFee: { epoch: 0n, maximumFee: 1_000_000n, transferFeeBasisPoints: 100 }, + olderTransferFee: { epoch: 0n, maximumFee: 1_000_000n, transferFeeBasisPoints: 100 }, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + withheldAmount: 0n, + }, + { + __kind: 'ConfidentialTransferMint', + auditorElgamalPubkey: { __option: 'None' }, + authority: { __option: 'Some', value: confidentialTransferAuthority }, + autoApproveNewAccounts: true, + }, + { + __kind: 'ConfidentialTransferFee', + authority: { __option: 'Some', value: confidentialFeeAuthority }, + elgamalPubkey, + harvestToMintEnabled: true, + withheldAmount: Uint8Array.from({ length: 64 }, () => 0), + }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/confidential-transfer.test.ts b/packages/dynamic-client/test/programs/token-2022/confidential-transfer.test.ts new file mode 100644 index 000000000..e2b314bc3 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/confidential-transfer.test.ts @@ -0,0 +1,112 @@ +import type { Address } from '@solana/addresses'; +import { none, some } from '@solana/codecs'; +import { type Extension, type ExtensionArgs, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +const getConfidentialTransferMintExt = (authority: Address): ExtensionArgs[] => [ + { + __kind: 'ConfidentialTransferMint', + auditorElgamalPubkey: null, + authority, + autoApproveNewAccounts: true, + }, +]; + +describe('Token 2022 Program: confidentialTransfer', () => { + test('should initialize confidential transfer mint extension [initializeConfidentialTransferMint]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const confidentialTransferAuthority = await ctx.createFundedAccount(); + + const size = getMintSize(getConfidentialTransferMintExt(confidentialTransferAuthority)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initConfidentialTransferIx = await token2022Client.methods + .initializeConfidentialTransferMint({ + auditorElgamalPubkey: null, + authority: confidentialTransferAuthority, + autoApproveNewAccounts: true, + }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initConfidentialTransferIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'ConfidentialTransferMint', + auditorElgamalPubkey: none(), + authority: some(confidentialTransferAuthority), + autoApproveNewAccounts: true, + }, + ]), + ); + }); + + test('should update confidential transfer mint config [updateConfidentialTransferMint]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const confidentialTransferAuthority = await ctx.createFundedAccount(); + const auditorElgamalPubkey = await ctx.createFundedAccount(); + + const size = getMintSize(getConfidentialTransferMintExt(confidentialTransferAuthority)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initConfidentialTransferIx = await token2022Client.methods + .initializeConfidentialTransferMint({ + auditorElgamalPubkey, + authority: confidentialTransferAuthority, + autoApproveNewAccounts: true, + }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initConfidentialTransferIx, initMintIx], [payer, mint]); + + const updateIx = await token2022Client.methods + .updateConfidentialTransferMint({ auditorElgamalPubkey: null, autoApproveNewAccounts: false }) + .accounts({ authority: confidentialTransferAuthority, mint }) + .instruction(); + await ctx.sendInstruction(updateIx, [payer, confidentialTransferAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'ConfidentialTransferMint', + auditorElgamalPubkey: none(), + authority: some(confidentialTransferAuthority), + autoApproveNewAccounts: false, + }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/create-native-mint.test.ts b/packages/dynamic-client/test/programs/token-2022/create-native-mint.test.ts new file mode 100644 index 000000000..64959dac7 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/create-native-mint.test.ts @@ -0,0 +1,20 @@ +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: createNativeMint', () => { + test('should create the Token 2022 native mint', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + + const ix = await token2022Client.methods + .createNativeMint() + .accounts({ nativeMint: ctx.TOKEN_2022_NATIVE_MINT, payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const account = ctx.fetchEncodedAccount(ctx.TOKEN_2022_NATIVE_MINT); + expect(account).not.toBeNull(); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/disable-cpi-guard.test.ts b/packages/dynamic-client/test/programs/token-2022/disable-cpi-guard.test.ts new file mode 100644 index 000000000..7ee38994a --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/disable-cpi-guard.test.ts @@ -0,0 +1,43 @@ +import { some } from '@solana/codecs'; +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: disableCpiGuard', () => { + test('should enable/disable CPI guard on a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mint, payer); + await createTokenAccount(ctx, payer, tokenAccount, mint, payer); + + const reallocateIx = await token2022Client.methods + .reallocate({ newExtensionTypes: ['cpiGuard'] }) + .accounts({ owner: payer, payer, token: tokenAccount }) + .instruction(); + + const enableIx = await token2022Client.methods + .enableCpiGuard() + .accounts({ owner: payer, token: tokenAccount }) + .instruction(); + + const disableIx = await token2022Client.methods + .disableCpiGuard() + .accounts({ owner: payer, token: tokenAccount }) + .instruction(); + + await ctx.sendInstructions([reallocateIx, enableIx], [payer]); + + const decoder = getTokenDecoder(); + const tokenDataCpiEnabled = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenDataCpiEnabled.extensions).toMatchObject(some([{ __kind: 'CpiGuard', lockCpi: true }])); + + await ctx.sendInstructions([reallocateIx, disableIx], [payer]); + const tokenDataCpiDisabled = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenDataCpiDisabled.extensions).toMatchObject(some([{ __kind: 'CpiGuard', lockCpi: false }])); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/disable-memo-transfers.test.ts b/packages/dynamic-client/test/programs/token-2022/disable-memo-transfers.test.ts new file mode 100644 index 000000000..6bd0a0bc1 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/disable-memo-transfers.test.ts @@ -0,0 +1,46 @@ +import { some } from '@solana/codecs'; +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: disableMemoTransfers', () => { + test('should enable/disable memo transfers on a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mint, payer); + await createTokenAccount(ctx, payer, tokenAccount, mint, payer); + + const reallocateIx = await token2022Client.methods + .reallocate({ newExtensionTypes: ['memoTransfer'] }) + .accounts({ owner: payer, payer, token: tokenAccount }) + .instruction(); + + const enableIx = await token2022Client.methods + .enableMemoTransfers() + .accounts({ owner: payer, token: tokenAccount }) + .instruction(); + + const disableIx = await token2022Client.methods + .disableMemoTransfers() + .accounts({ owner: payer, token: tokenAccount }) + .instruction(); + + await ctx.sendInstructions([reallocateIx, enableIx], [payer]); + + const tokenDataEnabledMemo = getTokenDecoder().decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenDataEnabledMemo.extensions).toMatchObject( + some([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]), + ); + + await ctx.sendInstructions([reallocateIx, disableIx], [payer]); + const tokenDataDisabledMemo = getTokenDecoder().decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenDataDisabledMemo.extensions).toMatchObject( + some([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: false }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/freeze-account.test.ts b/packages/dynamic-client/test/programs/token-2022/freeze-account.test.ts new file mode 100644 index 000000000..f7d3249b7 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/freeze-account.test.ts @@ -0,0 +1,29 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: freezeAccount', () => { + test('should freeze a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, freezeAuthority); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const freezeIx = await token2022Client.methods + .freezeAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: freezeAuthority }) + .instruction(); + + await ctx.sendInstruction(freezeIx, [freezeAuthority]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.state).toBe(AccountState.Frozen); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/get-account-data-size.test.ts b/packages/dynamic-client/test/programs/token-2022/get-account-data-size.test.ts new file mode 100644 index 000000000..af22b763f --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/get-account-data-size.test.ts @@ -0,0 +1,21 @@ +import { getU64Decoder } from '@solana/codecs'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, TOKEN_2022_ACCOUNT_SIZE, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: getAccountDataSize', () => { + test('should return the required account size for a given mint', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const ix = await token2022Client.methods.getAccountDataSize().accounts({ mint: mintAccount }).instruction(); + + const meta = await ctx.sendInstruction(ix, [payer]); + const size = getU64Decoder().decode(meta.returnData().data()); + expect(size).toBe(BigInt(TOKEN_2022_ACCOUNT_SIZE)); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/group-member-pointer.test.ts b/packages/dynamic-client/test/programs/token-2022/group-member-pointer.test.ts new file mode 100644 index 000000000..16e8cf39d --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/group-member-pointer.test.ts @@ -0,0 +1,101 @@ +import type { Address } from '@solana/addresses'; +import { type OptionOrNullable, some } from '@solana/codecs'; +import { type Extension, type ExtensionArgs, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +const GROUP_MEMBER_POINTER_EXT = ( + authority: OptionOrNullable
, + memberAddress: OptionOrNullable
, +): ExtensionArgs[] => [{ __kind: 'GroupMemberPointer', authority, memberAddress }]; + +describe('Token 2022 Program: groupMemberPointer', () => { + test('should initialize group member pointer extension [initializeGroupMemberPointer]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const memberPointerAuthority = await ctx.createFundedAccount(); + + // GroupMemberPointer points to the mint itself + const size = getMintSize(GROUP_MEMBER_POINTER_EXT(memberPointerAuthority, mint)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initGroupMemberPointerIx = await token2022Client.methods + .initializeGroupMemberPointer({ authority: memberPointerAuthority, memberAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initGroupMemberPointerIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'GroupMemberPointer', + authority: some(memberPointerAuthority), + memberAddress: some(mint), + }, + ]), + ); + }); + + test('should update group member pointer address [updateGroupMemberPointer]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const memberPointerAuthority = await ctx.createFundedAccount(); + const newMemberAddress = await ctx.createAccount(); + + const size = getMintSize(GROUP_MEMBER_POINTER_EXT(memberPointerAuthority, mint)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initGroupMemberPointerIx = await token2022Client.methods + .initializeGroupMemberPointer({ authority: memberPointerAuthority, memberAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initGroupMemberPointerIx, initMintIx], [payer, mint]); + + // Update group member pointer to a new address + const updateIx = await token2022Client.methods + .updateGroupMemberPointer({ memberAddress: newMemberAddress }) + .accounts({ groupMemberPointerAuthority: memberPointerAuthority, mint }) + .signers(['groupMemberPointerAuthority']) + .instruction(); + await ctx.sendInstruction(updateIx, [payer, memberPointerAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'GroupMemberPointer', + authority: some(memberPointerAuthority), + memberAddress: some(newMemberAddress), + }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/group-pointer.test.ts b/packages/dynamic-client/test/programs/token-2022/group-pointer.test.ts new file mode 100644 index 000000000..7427a0496 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/group-pointer.test.ts @@ -0,0 +1,97 @@ +import type { Address } from '@solana/addresses'; +import { type OptionOrNullable, some } from '@solana/codecs'; +import { type Extension, type ExtensionArgs, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +const GROUP_POINTER_EXT = ( + authority: OptionOrNullable
, + groupAddress: OptionOrNullable
, +): ExtensionArgs[] => [{ __kind: 'GroupPointer' as const, authority, groupAddress }]; + +describe('Token 2022 Program: groupPointer', () => { + test('should initialize group pointer extension [initializeGroupPointer]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const groupPointerAuthority = await ctx.createFundedAccount(); + + // GroupPointer points to the mint itself (common pattern) + const size = getMintSize(GROUP_POINTER_EXT(groupPointerAuthority, mint)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initGroupPointerIx = await token2022Client.methods + .initializeGroupPointer({ authority: groupPointerAuthority, groupAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initGroupPointerIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'GroupPointer', + authority: some(groupPointerAuthority), + groupAddress: some(mint), + }, + ]), + ); + }); + + test('should update group pointer address [updateGroupPointer]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const groupPointerAuthority = await ctx.createFundedAccount(); + const newGroupAddress = await ctx.createAccount(); + + const size = getMintSize(GROUP_POINTER_EXT(groupPointerAuthority, mint)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initGroupPointerIx = await token2022Client.methods + .initializeGroupPointer({ authority: groupPointerAuthority, groupAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initGroupPointerIx, initMintIx], [payer, mint]); + + // Update group pointer to a new address + const updateIx = await token2022Client.methods + .updateGroupPointer({ groupAddress: newGroupAddress }) + .accounts({ groupPointerAuthority, mint }) + .signers(['groupPointerAuthority']) + .instruction(); + await ctx.sendInstruction(updateIx, [payer, groupPointerAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { __kind: 'GroupPointer', authority: some(groupPointerAuthority), groupAddress: some(newGroupAddress) }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/harvest-withheld-tokens-to-mint.test.ts b/packages/dynamic-client/test/programs/token-2022/harvest-withheld-tokens-to-mint.test.ts new file mode 100644 index 000000000..9536a3bc6 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/harvest-withheld-tokens-to-mint.test.ts @@ -0,0 +1,45 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createTokenAccountWithExtensions, + createTransferFeeMint, + mintTokens, + token2022Client, +} from './token-2022-test-utils'; + +const TRANSFER_FEE_AMOUNT_EXT = [{ __kind: 'TransferFeeAmount' as const, withheldAmount: 0n }]; + +describe('Token 2022 Program: harvestWithheldTokensToMint', () => { + test('should harvest withheld tokens to mint', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + + const mint = await createTransferFeeMint(ctx, payer, feeAuthority, withdrawAuthority); + const source = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + const destination = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + + // Mint and transfer to generate fees + await mintTokens(ctx, payer, mint, source, payer, 1_000_000); + + const transferIx = await token2022Client.methods + .transferCheckedWithFee({ amount: 1_000_000, decimals: 9, fee: 10_000 }) + .accounts({ authority: payer, destination, mint, source }) + .instruction(); + await ctx.sendInstruction(transferIx, [payer]); + + // Harvest fees from destination to mint + const harvestIx = await token2022Client.methods + .harvestWithheldTokensToMint({ sources: [destination] }) + .accounts({ mint }) + .instruction(); + await ctx.sendInstruction(harvestIx, [payer]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject(some([{ __kind: 'TransferFeeConfig', withheldAmount: 10_000n }])); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-account.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-account.test.ts new file mode 100644 index 000000000..1da024370 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-account.test.ts @@ -0,0 +1,57 @@ +import { some } from '@solana/codecs'; +import { AccountState, getTokenDecoder, getTokenSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeAccount', () => { + test('should initialize a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, undefined); + const space = getTokenSize([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(space)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initAccountIx = await token2022Client.methods + .initializeAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner }) + .instruction(); + + const reallocateIx = await token2022Client.methods + .reallocate({ newExtensionTypes: ['memoTransfer'] }) + .accounts({ owner, payer, token: tokenAccount }) + .signers(['owner']) + .instruction(); + + const enableMemoTransfersIx = await token2022Client.methods + .enableMemoTransfers() + .accounts({ owner, token: tokenAccount }) + .signers(['owner']) + .instruction(); + + await ctx.sendInstructions( + [createAccountIx, initAccountIx, reallocateIx, enableMemoTransfersIx], + [payer, tokenAccount, owner], + ); + + const accountData = ctx.requireEncodedAccount(tokenAccount).data; + const tokenData = getTokenDecoder().decode(accountData); + + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(owner); + expect(tokenData.amount).toBe(0n); + expect(tokenData.state).toBe(AccountState.Initialized); + expect(tokenData.extensions).toMatchObject( + some([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-account2.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-account2.test.ts new file mode 100644 index 000000000..0caeb8826 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-account2.test.ts @@ -0,0 +1,57 @@ +import { some } from '@solana/codecs'; +import { AccountState, getTokenDecoder, getTokenSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeAccount2', () => { + test('should initialize2 a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, undefined); + const space = getTokenSize([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(space)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initAccountIx = await token2022Client.methods + .initializeAccount2({ owner }) + .accounts({ account: tokenAccount, mint: mintAccount }) + .instruction(); + + const reallocateIx = await token2022Client.methods + .reallocate({ newExtensionTypes: ['memoTransfer'] }) + .accounts({ owner, payer, token: tokenAccount }) + .signers(['owner']) + .instruction(); + + const enableMemoTransfersIx = await token2022Client.methods + .enableMemoTransfers() + .accounts({ owner, token: tokenAccount }) + .signers(['owner']) + .instruction(); + + await ctx.sendInstructions( + [createAccountIx, initAccountIx, reallocateIx, enableMemoTransfersIx], + [payer, tokenAccount, owner], + ); + + const accountData = ctx.requireEncodedAccount(tokenAccount).data; + const tokenData = getTokenDecoder().decode(accountData); + + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(owner); + expect(tokenData.amount).toBe(0n); + expect(tokenData.state).toBe(AccountState.Initialized); + expect(tokenData.extensions).toMatchObject( + some([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-account3.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-account3.test.ts new file mode 100644 index 000000000..55e3a3126 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-account3.test.ts @@ -0,0 +1,57 @@ +import { some } from '@solana/codecs'; +import { AccountState, getTokenDecoder, getTokenSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeAccount3', () => { + test('should initialize3 a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, undefined); + const space = getTokenSize([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(space)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initAccountIx = await token2022Client.methods + .initializeAccount3({ owner }) + .accounts({ account: tokenAccount, mint: mintAccount }) + .instruction(); + + const reallocateIx = await token2022Client.methods + .reallocate({ newExtensionTypes: ['memoTransfer'] }) + .accounts({ owner, payer, token: tokenAccount }) + .signers(['owner']) + .instruction(); + + const enableMemoTransfersIx = await token2022Client.methods + .enableMemoTransfers() + .accounts({ owner, token: tokenAccount }) + .signers(['owner']) + .instruction(); + + await ctx.sendInstructions( + [createAccountIx, initAccountIx, reallocateIx, enableMemoTransfersIx], + [payer, tokenAccount, owner], + ); + + const accountData = ctx.requireEncodedAccount(tokenAccount).data; + const tokenData = getTokenDecoder().decode(accountData); + + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(owner); + expect(tokenData.amount).toBe(0n); + expect(tokenData.state).toBe(AccountState.Initialized); + expect(tokenData.extensions).toMatchObject( + some([{ __kind: 'MemoTransfer', requireIncomingTransferMemos: true }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-default-account-state.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-default-account-state.test.ts new file mode 100644 index 000000000..80451c5a4 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-default-account-state.test.ts @@ -0,0 +1,41 @@ +import { some } from '@solana/codecs'; +import { AccountState, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeDefaultAccountState', () => { + test('should initialize default account state extension', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([{ __kind: 'DefaultAccountState', state: AccountState.Frozen }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initDefaultStateIx = await token2022Client.methods + .initializeDefaultAccountState({ state: 'frozen' }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initDefaultStateIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.freezeAuthority).toEqual({ __option: 'Some', value: freezeAuthority }); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'DefaultAccountState', state: AccountState.Frozen }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-immutable-owner.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-immutable-owner.test.ts new file mode 100644 index 000000000..e50bfba3d --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-immutable-owner.test.ts @@ -0,0 +1,42 @@ +import { some } from '@solana/codecs'; +import { getTokenDecoder, getTokenSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeImmutableOwner', () => { + test('should initialize immutable owner extension on a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mint, payer); + + const space = getTokenSize([{ __kind: 'ImmutableOwner' }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(space)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initImmutableOwnerIx = await token2022Client.methods + .initializeImmutableOwner() + .accounts({ account: tokenAccount }) + .instruction(); + + const initAccountIx = await token2022Client.methods + .initializeAccount3({ owner }) + .accounts({ account: tokenAccount, mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initImmutableOwnerIx, initAccountIx], [payer, tokenAccount]); + + const tokenData = getTokenDecoder().decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.mint).toBe(mint); + expect(tokenData.owner).toBe(owner); + expect(tokenData.extensions).toMatchObject(some([{ __kind: 'ImmutableOwner' }])); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-interest-bearing-mint.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-interest-bearing-mint.test.ts new file mode 100644 index 000000000..248a17d45 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-interest-bearing-mint.test.ts @@ -0,0 +1,51 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeInterestBearingMint', () => { + test('should initialize interest bearing mint extension', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const rateAuthority = await ctx.createFundedAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([ + { + __kind: 'InterestBearingConfig', + currentRate: 500, + initializationTimestamp: 0n, + lastUpdateTimestamp: 0n, + preUpdateAverageRate: 0, + rateAuthority, + }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initInterestBearingIx = await token2022Client.methods + .initializeInterestBearingMint({ rate: 500, rateAuthority }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority: freezeAuthority, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initInterestBearingIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.freezeAuthority).toEqual({ __option: 'Some', value: freezeAuthority }); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'InterestBearingConfig', currentRate: 500, rateAuthority }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-mint-close-authority.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-mint-close-authority.test.ts new file mode 100644 index 000000000..307c9fb97 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-mint-close-authority.test.ts @@ -0,0 +1,38 @@ +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeMintCloseAuthority', () => { + test('should initialize mint close authority extension', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const closeAuthority = await ctx.createAccount(); + + const size = getMintSize([{ __kind: 'MintCloseAuthority', closeAuthority }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initCloseAuthIx = await token2022Client.methods + .initializeMintCloseAuthority({ closeAuthority }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority: null, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initCloseAuthIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.decimals).toBe(9); + expect(mintData.supply).toBe(0n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-mint.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-mint.test.ts new file mode 100644 index 000000000..923a03185 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-mint.test.ts @@ -0,0 +1,40 @@ +import { getMintDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, TOKEN_2022_MINT_SIZE, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeMint', () => { + test('should initialize a mint with default freeze authority (None)', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + const mintRent = ctx.getMinimumBalanceForRentExemption(BigInt(TOKEN_2022_MINT_SIZE)); + + const createAccountIx = await systemClient.methods + .createAccount({ + lamports: mintRent, + programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, + space: TOKEN_2022_MINT_SIZE, + }) + .accounts({ + newAccount: mintAccount, + payer, + }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint({ decimals: 9, mintAuthority: payer }) + .accounts({ mint: mintAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMintIx], [payer, mintAccount]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.decimals).toBe(9); + expect(mintData.supply).toBe(0n); + expect(mintData.freezeAuthority).toEqual({ __option: 'None' }); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-mint2.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-mint2.test.ts new file mode 100644 index 000000000..dc42e90c4 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-mint2.test.ts @@ -0,0 +1,41 @@ +import { getMintDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, TOKEN_2022_MINT_SIZE, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeMint2', () => { + test('should initialize_mint2', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const freezeAuthority = await ctx.createAccount(); + + const mintRent = ctx.getMinimumBalanceForRentExemption(BigInt(TOKEN_2022_MINT_SIZE)); + + const createAccountIx = await systemClient.methods + .createAccount({ + lamports: mintRent, + programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, + space: TOKEN_2022_MINT_SIZE, + }) + .accounts({ + newAccount: mintAccount, + payer, + }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 6, freezeAuthority, mintAuthority: payer }) + .accounts({ mint: mintAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMintIx], [payer, mintAccount]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.decimals).toBe(6); + expect(mintData.supply).toBe(0n); + expect(mintData.freezeAuthority).toEqual({ __option: 'Some', value: freezeAuthority }); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-multisig.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-multisig.test.ts new file mode 100644 index 000000000..7802fb882 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-multisig.test.ts @@ -0,0 +1,41 @@ +import { getMultisigDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, TOKEN_2022_MULTISIG_SIZE, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeMultisig', () => { + test('should initialize a multisig account with signers', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const multisigAccount = await ctx.createAccount(); + + const signer1 = await ctx.createAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(TOKEN_2022_MULTISIG_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, + space: TOKEN_2022_MULTISIG_SIZE, + }) + .accounts({ newAccount: multisigAccount, payer }) + .instruction(); + + const initMultisigIx = await token2022Client.methods + .initializeMultisig({ m: 2, signers: [signer1, signer2, signer3] }) + .accounts({ multisig: multisigAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMultisigIx], [payer, multisigAccount]); + + const decoder = getMultisigDecoder(); + const multisigData = decoder.decode(ctx.requireEncodedAccount(multisigAccount).data); + expect(multisigData.m).toBe(2); + expect(multisigData.n).toBe(3); + expect(multisigData.isInitialized).toBe(true); + expect(multisigData.signers.slice(0, 3)).toStrictEqual([signer1, signer2, signer3]); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-multisig2.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-multisig2.test.ts new file mode 100644 index 000000000..7b77949b3 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-multisig2.test.ts @@ -0,0 +1,41 @@ +import { getMultisigDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, TOKEN_2022_MULTISIG_SIZE, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeMultisig2', () => { + test('should initialize_multisig2 account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const multisigAccount = await ctx.createAccount(); + + const signer1 = await ctx.createAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(TOKEN_2022_MULTISIG_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, + space: TOKEN_2022_MULTISIG_SIZE, + }) + .accounts({ newAccount: multisigAccount, payer }) + .instruction(); + + const initMultisigIx = await token2022Client.methods + .initializeMultisig2({ m: 2, signers: [signer1, signer2, signer3] }) + .accounts({ multisig: multisigAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMultisigIx], [payer, multisigAccount]); + + const decoder = getMultisigDecoder(); + const multisigData = decoder.decode(ctx.requireEncodedAccount(multisigAccount).data); + expect(multisigData.m).toBe(2); + expect(multisigData.n).toBe(3); + expect(multisigData.isInitialized).toBe(true); + expect(multisigData.signers.slice(0, 3)).toStrictEqual([signer1, signer2, signer3]); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-non-transferable-mint.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-non-transferable-mint.test.ts new file mode 100644 index 000000000..638bafb9e --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-non-transferable-mint.test.ts @@ -0,0 +1,39 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializeNonTransferableMint', () => { + test('should initialize non-transferable mint extension', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + + const size = getMintSize([{ __kind: 'NonTransferable' }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initNonTransferableIx = await token2022Client.methods + .initializeNonTransferableMint() + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initNonTransferableIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.freezeAuthority).toEqual({ __option: 'None' }); + expect(mintData.supply).toBe(0n); + expect(mintData.extensions).toMatchObject(some([{ __kind: 'NonTransferable' }])); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/initialize-permanent-delegate.test.ts b/packages/dynamic-client/test/programs/token-2022/initialize-permanent-delegate.test.ts new file mode 100644 index 000000000..3e4d17dd8 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/initialize-permanent-delegate.test.ts @@ -0,0 +1,38 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: initializePermanentDelegate', () => { + test('should initialize permanent delegate extension', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + + const size = getMintSize([{ __kind: 'PermanentDelegate', delegate }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initPermanentDelegateIx = await token2022Client.methods + .initializePermanentDelegate({ delegate }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initPermanentDelegateIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toMatchObject(some([{ __kind: 'PermanentDelegate', delegate }])); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/metadata-pointer.test.ts b/packages/dynamic-client/test/programs/token-2022/metadata-pointer.test.ts new file mode 100644 index 000000000..a37ad9f08 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/metadata-pointer.test.ts @@ -0,0 +1,94 @@ +import type { Address } from '@solana/addresses'; +import { some } from '@solana/codecs'; +import { type ExtensionArgs, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +const METADATA_POINTER_EXT = (authority: Address, metadataAddress: Address): ExtensionArgs[] => [ + { __kind: 'MetadataPointer', authority, metadataAddress }, +]; + +describe('Token 2022 Program: metadataPointer', () => { + test('should initialize metadata pointer extension [initializeMetadataPointer]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const metadataPointerAuthority = await ctx.createFundedAccount(); + + // MetadataPointer points to the mint itself + const size = getMintSize(METADATA_POINTER_EXT(metadataPointerAuthority, mint)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initMetadataPointerIx = await token2022Client.methods + .initializeMetadataPointer({ authority: metadataPointerAuthority, metadataAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMetadataPointerIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toMatchObject( + some([ + { + __kind: 'MetadataPointer', + authority: some(metadataPointerAuthority), + metadataAddress: some(mint), + }, + ]), + ); + }); + + test('should update metadata pointer address [updateMetadataPointer]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const metadataPointerAuthority = await ctx.createFundedAccount(); + const newMetadataAddress = await ctx.createAccount(); + + const size = getMintSize(METADATA_POINTER_EXT(metadataPointerAuthority, mint)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initMetadataPointerIx = await token2022Client.methods + .initializeMetadataPointer({ authority: metadataPointerAuthority, metadataAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMetadataPointerIx, initMintIx], [payer, mint]); + + // Update metadata pointer to a new address + const updateIx = await token2022Client.methods + .updateMetadataPointer({ metadataAddress: newMetadataAddress }) + .accounts({ metadataPointerAuthority, mint }) + .signers(['metadataPointerAuthority']) + .instruction(); + await ctx.sendInstruction(updateIx, [payer, metadataPointerAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'MetadataPointer', metadataAddress: some(newMetadataAddress) }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/mint-to-checked.test.ts b/packages/dynamic-client/test/programs/token-2022/mint-to-checked.test.ts new file mode 100644 index 000000000..f5a3ef9da --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/mint-to-checked.test.ts @@ -0,0 +1,27 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: mintToChecked', () => { + test('should mint_to_checked tokens', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const ix = await token2022Client.methods + .mintToChecked({ amount: 1_000_000, decimals: 9 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: tokenAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const tokenData = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.amount).toBe(1_000_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/mint-to.test.ts b/packages/dynamic-client/test/programs/token-2022/mint-to.test.ts new file mode 100644 index 000000000..41498608f --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/mint-to.test.ts @@ -0,0 +1,28 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: mintTo', () => { + test('should mint tokens to a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const ix = await token2022Client.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: tokenAccount }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.amount).toBe(1_000_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/pausable.test.ts b/packages/dynamic-client/test/programs/token-2022/pausable.test.ts new file mode 100644 index 000000000..318c81f17 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/pausable.test.ts @@ -0,0 +1,101 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: pausable', () => { + test('should pause the mint [initializePausableConfig + pause]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const pauseAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([{ __kind: 'PausableConfig', authority: pauseAuthority, paused: false }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initPausableIx = await token2022Client.methods + .initializePausableConfig({ authority: pauseAuthority }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initPausableIx, initMintIx], [payer, mint]); + + const mintUnpaused = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintUnpaused.extensions).toMatchObject( + some([{ __kind: 'PausableConfig', authority: some(pauseAuthority), paused: false }]), + ); + + const pauseIx = await token2022Client.methods + .pause() + .accounts({ authority: pauseAuthority, mint }) + .signers(['authority']) + .instruction(); + await ctx.sendInstruction(pauseIx, [payer, pauseAuthority]); + + const mintPaused = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintPaused.extensions).toMatchObject( + some([{ __kind: 'PausableConfig', authority: some(pauseAuthority), paused: true }]), + ); + }); + + test('should resume the mint [initializePausableConfig + pause + resume]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const pauseAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([{ __kind: 'PausableConfig', authority: pauseAuthority, paused: false }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initPausableIx = await token2022Client.methods + .initializePausableConfig({ authority: pauseAuthority }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initPausableIx, initMintIx], [payer, mint]); + + const pauseIx = await token2022Client.methods + .pause() + .accounts({ authority: pauseAuthority, mint }) + .signers(['authority']) + .instruction(); + await ctx.sendInstruction(pauseIx, [payer, pauseAuthority]); + + const mintDataPaused = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintDataPaused.extensions).toMatchObject( + some([{ __kind: 'PausableConfig', authority: some(pauseAuthority), paused: true }]), + ); + + const resumeIx = await token2022Client.methods + .resume() + .accounts({ authority: pauseAuthority, mint }) + .signers(['authority']) + .instruction(); + await ctx.sendInstruction(resumeIx, [payer, pauseAuthority]); + + const mintDataResumed = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintDataResumed.extensions).toMatchObject( + some([{ __kind: 'PausableConfig', authority: some(pauseAuthority), paused: false }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/reallocate.test.ts b/packages/dynamic-client/test/programs/token-2022/reallocate.test.ts new file mode 100644 index 000000000..044fff8e8 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/reallocate.test.ts @@ -0,0 +1,27 @@ +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: reallocate', () => { + test('should reallocate a token account to accommodate new extensions', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mint, payer); + await createTokenAccount(ctx, payer, tokenAccount, mint, payer); + + const balanceBefore = ctx.getBalanceOrZero(tokenAccount); + + const ix = await token2022Client.methods + .reallocate({ newExtensionTypes: ['memoTransfer'] }) + .accounts({ owner: payer, payer, token: tokenAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const balanceAfter = ctx.getBalanceOrZero(tokenAccount); + expect(balanceAfter).toBeGreaterThan(balanceBefore); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/revoke.test.ts b/packages/dynamic-client/test/programs/token-2022/revoke.test.ts new file mode 100644 index 000000000..5c9e2eb08 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/revoke.test.ts @@ -0,0 +1,40 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, mintTokens, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: revoke', () => { + test('should revoke a delegate from a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + const decoder = getTokenDecoder(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, sourceAccount, payer, 1_000_000); + + const approveIx = await token2022Client.methods + .approve({ amount: 500_000 }) + .accounts({ delegate, owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(approveIx, [payer]); + + const sourceDataBefore = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceDataBefore.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceDataBefore.delegatedAmount).toBe(500_000n); + + const ix = await token2022Client.methods + .revoke() + .accounts({ owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const sourceDataAfter = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceDataAfter.delegate).toStrictEqual({ __option: 'None' }); + expect(sourceDataAfter.delegatedAmount).toBe(0n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/scaled-ui-amount.test.ts b/packages/dynamic-client/test/programs/token-2022/scaled-ui-amount.test.ts new file mode 100644 index 000000000..f72c6d0c8 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/scaled-ui-amount.test.ts @@ -0,0 +1,50 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: scaledUiAmount', () => { + test('should update multiplier for scaled UI amount [initializeScaledUiAmountMint + updateMultiplierScaledUiMint]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + + const size = getMintSize([ + { + __kind: 'ScaledUiAmountConfig', + authority: payer, + multiplier: 1.0, + newMultiplier: 0, + newMultiplierEffectiveTimestamp: 0n, + }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initScaledIx = await token2022Client.methods + .initializeScaledUiAmountMint({ authority: payer, multiplier: 1.0 }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initScaledIx, initMintIx], [payer, mint]); + + const updateIx = await token2022Client.methods + .updateMultiplierScaledUiMint({ effectiveTimestamp: 0, multiplier: 2.5 }) + .accounts({ authority: payer, mint }) + .instruction(); + await ctx.sendInstruction(updateIx, [payer]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject(some([{ __kind: 'ScaledUiAmountConfig', newMultiplier: 2.5 }])); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/set-authority.test.ts b/packages/dynamic-client/test/programs/token-2022/set-authority.test.ts new file mode 100644 index 000000000..50610a3ff --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/set-authority.test.ts @@ -0,0 +1,26 @@ +import { getMintDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: setAuthority', () => { + test('should change the mint authority to a new address', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const newAuthority = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const ix = await token2022Client.methods + .setAuthority({ authorityType: 'mintTokens', newAuthority }) + .accounts({ owned: mintAccount, owner: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getMintDecoder(); + const mintData = decoder.decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.mintAuthority).toStrictEqual({ __option: 'Some', value: newAuthority }); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/sync-native.test.ts b/packages/dynamic-client/test/programs/token-2022/sync-native.test.ts new file mode 100644 index 000000000..9aca2c0dd --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/sync-native.test.ts @@ -0,0 +1,60 @@ +import { address } from '@solana/addresses'; +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, TOKEN_2022_ACCOUNT_SIZE, token2022Client } from './token-2022-test-utils'; + +const TOKEN_2022_NATIVE_MINT = address('9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP'); + +describe('Token 2022 Program: syncNative', () => { + test('should sync a wrapped SOL account amount with its lamport balance', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const wrappedSolAccount = await ctx.createAccount(); + + // Ensure the Token 2022 native mint exists. + const createNativeMintIx = await token2022Client.methods + .createNativeMint() + .accounts({ nativeMint: TOKEN_2022_NATIVE_MINT, payer, systemProgram: ctx.SYSTEM_PROGRAM_ADDRESS }) + .instruction(); + await ctx.sendInstruction(createNativeMintIx, [payer]); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(TOKEN_2022_ACCOUNT_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, + space: TOKEN_2022_ACCOUNT_SIZE, + }) + .accounts({ newAccount: wrappedSolAccount, payer }) + .instruction(); + + const initAccountIx = await token2022Client.methods + .initializeAccount() + .accounts({ account: wrappedSolAccount, mint: TOKEN_2022_NATIVE_MINT, owner: payer }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, wrappedSolAccount]); + + const transferAmount = 1_000_000_000n; + const transferIx = await systemClient.methods + .transferSol({ amount: transferAmount }) + .accounts({ destination: wrappedSolAccount, source: payer }) + .instruction(); + await ctx.sendInstruction(transferIx, [payer]); + + const decoder = getTokenDecoder(); + const beforeSync = decoder.decode(ctx.requireEncodedAccount(wrappedSolAccount).data); + expect(beforeSync.amount).toBe(0n); + + const syncIx = await token2022Client.methods + .syncNative() + .accounts({ account: wrappedSolAccount }) + .instruction(); + await ctx.sendInstruction(syncIx, [payer]); + + const afterSync = decoder.decode(ctx.requireEncodedAccount(wrappedSolAccount).data); + expect(afterSync.amount).toBe(transferAmount); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/thaw-account.test.ts b/packages/dynamic-client/test/programs/token-2022/thaw-account.test.ts new file mode 100644 index 000000000..14a4792a3 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/thaw-account.test.ts @@ -0,0 +1,36 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: thawAccount', () => { + test('should thaw a frozen account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, freezeAuthority); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const freezeIx = await token2022Client.methods + .freezeAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: freezeAuthority }) + .instruction(); + + await ctx.sendInstruction(freezeIx, [freezeAuthority]); + + const thawIx = await token2022Client.methods + .thawAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: freezeAuthority }) + .instruction(); + + await ctx.sendInstruction(thawIx, [freezeAuthority]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.state).toBe(AccountState.Initialized); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/token-2022-test-utils.ts b/packages/dynamic-client/test/programs/token-2022/token-2022-test-utils.ts new file mode 100644 index 000000000..d5e026e7a --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/token-2022-test-utils.ts @@ -0,0 +1,149 @@ +import type { Address } from '@solana/addresses'; +import { getMintSize, getTokenSize } from '@solana-program/token-2022'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import type { Token2022ProgramClient } from '../generated/token-2022-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +export const token2022Client = createTestProgramClient('token-2022-idl.json'); +export const systemClient = createTestProgramClient('system-program-idl.json'); + +export const TOKEN_2022_MINT_SIZE = getMintSize(); +export const TOKEN_2022_ACCOUNT_SIZE = getTokenSize(); +export const TOKEN_2022_MULTISIG_SIZE = 355; + +// Creates basic mint without extensions. +export async function createMint( + ctx: SvmTestContext, + payer: Address, + mint: Address, + mintAuthority: Address, + freezeAuthority?: Address, + space = TOKEN_2022_MINT_SIZE, +): Promise { + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(space)); + const createMintAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space }) + .accounts({ newAccount: mint, payer }) + .instruction(); + await ctx.sendInstruction(createMintAccountIx, [payer, mint]); + + const initializeMintIx = await token2022Client.methods + .initializeMint({ decimals: 9, freezeAuthority: freezeAuthority ?? null, mintAuthority }) + .accounts({ mint }) + .instruction(); + await ctx.sendInstruction(initializeMintIx, [payer]); +} + +// Creates basic token account without extensions. +export async function createTokenAccount( + ctx: SvmTestContext, + payer: Address, + account: Address, + mint: Address, + owner: Address, + space = TOKEN_2022_ACCOUNT_SIZE, +): Promise { + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(space)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space }) + .accounts({ newAccount: account, payer }) + .instruction(); + + const initAccountIx = await token2022Client.methods + .initializeAccount() + .accounts({ account, mint, owner }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, account]); +} + +// Creates a mint with TransferFeeConfig extension. +export async function createTransferFeeMint( + ctx: SvmTestContext, + payer: Address, + feeAuthority: Address, + withdrawAuthority: Address, + options: { maximumFee: bigint; transferFeeBasisPoints: number } = { + maximumFee: 1_000_000n, + transferFeeBasisPoints: 100, + }, +): Promise
{ + const { maximumFee, transferFeeBasisPoints } = options; + const mint = await ctx.createAccount(); + const size = getMintSize([ + { + __kind: 'TransferFeeConfig', + newerTransferFee: { epoch: 0n, maximumFee, transferFeeBasisPoints }, + olderTransferFee: { epoch: 0n, maximumFee: 0n, transferFeeBasisPoints: 0 }, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + withheldAmount: 0n, + }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initFeeConfigIx = await token2022Client.methods + .initializeTransferFeeConfig({ + maximumFee: maximumFee, + transferFeeBasisPoints: transferFeeBasisPoints, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initFeeConfigIx, initMintIx], [payer, mint]); + return mint; +} + +// Creates a token account with given extensions. +export async function createTokenAccountWithExtensions( + ctx: SvmTestContext, + payer: Address, + mint: Address, + owner: Address, + extensions: NonNullable[0]>, +): Promise
{ + const account = await ctx.createAccount(); + const size = getTokenSize(extensions); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: account, payer }) + .instruction(); + const initAccountIx = await token2022Client.methods + .initializeAccount3({ owner }) + .accounts({ account, mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, account]); + + return account; +} + +export async function mintTokens( + ctx: SvmTestContext, + payer: Address, + mint: Address, + destination: Address, + mintAuthority: Address, + amount: number, +): Promise { + const mintIx = await token2022Client.methods + .mintTo({ amount }) + .accounts({ mint, mintAuthority, token: destination }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer, mintAuthority]); +} diff --git a/packages/dynamic-client/test/programs/token-2022/token-group.test.ts b/packages/dynamic-client/test/programs/token-2022/token-group.test.ts new file mode 100644 index 000000000..eac57d341 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/token-group.test.ts @@ -0,0 +1,190 @@ +import type { Address } from '@solana/addresses'; +import { some } from '@solana/codecs'; +import { type Extension, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +// Create a mint with GroupPointer + TokenGroup extensions +async function createGroupMint(ctx: SvmTestContext, payer: Address, groupUpdateAuthority: Address, maxSize: number) { + const mint = await ctx.createAccount(); + + // Allocate only GroupPointer space (initializeMint2 rejects extra uninitialized TLV bytes) + // initializeTokenGroup will realloc the account internally. + const pointerSize = getMintSize([{ __kind: 'GroupPointer', authority: groupUpdateAuthority, groupAddress: mint }]); + const fullSize = getMintSize([ + { __kind: 'GroupPointer', authority: groupUpdateAuthority, groupAddress: mint }, + { __kind: 'TokenGroup', maxSize, mint, size: 0, updateAuthority: some(groupUpdateAuthority) }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(fullSize)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: pointerSize }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initGroupPointerIx = await token2022Client.methods + .initializeGroupPointer({ authority: groupUpdateAuthority, groupAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 0, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + const initTokenGroupIx = await token2022Client.methods + .initializeTokenGroup({ maxSize, updateAuthority: groupUpdateAuthority }) + .accounts({ group: mint, mint, mintAuthority: payer }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initGroupPointerIx, initMintIx, initTokenGroupIx], [payer, mint]); + + return mint; +} + +describe('Token 2022 Program: tokenGroup', () => { + test('should initialize token group [initializeTokenGroup]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const groupUpdateAuthority = await ctx.createFundedAccount(); + const maxSize = 10; + const mint = await createGroupMint(ctx, payer, groupUpdateAuthority, maxSize); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([ + { __kind: 'GroupPointer', authority: some(groupUpdateAuthority), groupAddress: some(mint) }, + { + __kind: 'TokenGroup', + maxSize: BigInt(maxSize), + size: 0n, + updateAuthority: { __option: 'Some', value: groupUpdateAuthority }, + }, + ]), + ); + }); + + test('should update token group max size [updateTokenGroupMaxSize]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const groupUpdateAuthority = await ctx.createFundedAccount(); + const maxSize = 10; + const newMaxSize = 20; + const mint = await createGroupMint(ctx, payer, groupUpdateAuthority, maxSize); + + const updateMaxSizeIx = await token2022Client.methods + .updateTokenGroupMaxSize({ maxSize: newMaxSize }) + .accounts({ group: mint, updateAuthority: groupUpdateAuthority }) + .instruction(); + await ctx.sendInstruction(updateMaxSizeIx, [payer, groupUpdateAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'GroupPointer' }, { __kind: 'TokenGroup', maxSize: BigInt(newMaxSize) }]), + ); + }); + + test('should update token group update authority [updateTokenGroupUpdateAuthority]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const groupUpdateAuthority = await ctx.createFundedAccount(); + const newUpdateAuthority = await ctx.createFundedAccount(); + const maxSize = 10; + const mint = await createGroupMint(ctx, payer, groupUpdateAuthority, maxSize); + + const updateAuthorityIx = await token2022Client.methods + .updateTokenGroupUpdateAuthority({ newUpdateAuthority }) + .accounts({ group: mint, updateAuthority: groupUpdateAuthority }) + .instruction(); + await ctx.sendInstruction(updateAuthorityIx, [payer, groupUpdateAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([ + { __kind: 'GroupPointer' }, + { + __kind: 'TokenGroup', + updateAuthority: { __option: 'Some', value: newUpdateAuthority }, + }, + ]), + ); + }); + + test('should initialize token group member [initializeTokenGroupMember]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const groupUpdateAuthority = await ctx.createFundedAccount(); + + const groupMint = await createGroupMint(ctx, payer, groupUpdateAuthority, 10); + // const memberMint = await createMemberMint(ctx, payer, groupMint, groupUpdateAuthority); + + // Create a member mint with GroupMemberPointer + TokenGroupMember + const memberMint = await ctx.createAccount(); + // Allocate only GroupMemberPointer space; initializeTokenGroupMember will realloc. + const pointerSize = getMintSize([ + { __kind: 'GroupMemberPointer', authority: payer, memberAddress: memberMint }, + ]); + const fullSize = getMintSize([ + { __kind: 'GroupMemberPointer', authority: payer, memberAddress: memberMint }, + { __kind: 'TokenGroupMember', group: groupMint, memberNumber: 1, mint: memberMint }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(fullSize)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: pointerSize }) + .accounts({ newAccount: memberMint, payer }) + .instruction(); + + const initMemberPointerIx = await token2022Client.methods + .initializeGroupMemberPointer({ authority: payer, memberAddress: memberMint }) + .accounts({ mint: memberMint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 0, mintAuthority: payer }) + .accounts({ mint: memberMint }) + .instruction(); + + const initTokenGroupMemberIx = await token2022Client.methods + .initializeTokenGroupMember() + .accounts({ + group: groupMint, + groupUpdateAuthority, + member: memberMint, + memberMint, + memberMintAuthority: payer, + }) + .instruction(); + + await ctx.sendInstructions( + [createAccountIx, initMemberPointerIx, initMintIx, initTokenGroupMemberIx], + [payer, memberMint, groupUpdateAuthority], + ); + + // Verify TokenGroupMember extension + const memberData = getMintDecoder().decode(ctx.requireEncodedAccount(memberMint).data); + expect(memberData.extensions).toEqual( + some([ + { __kind: 'GroupMemberPointer', authority: some(payer), memberAddress: some(memberMint) }, + { __kind: 'TokenGroupMember', group: groupMint, memberNumber: 1n, mint: memberMint }, + ]), + ); + + // Verify incremented TokenGroup size + const groupData = getMintDecoder().decode(ctx.requireEncodedAccount(groupMint).data); + expect(groupData.extensions).toEqual( + some([ + { __kind: 'GroupPointer', authority: some(groupUpdateAuthority), groupAddress: some(groupMint) }, + { + __kind: 'TokenGroup', + maxSize: 10n, + mint: groupMint, + size: 1n, + updateAuthority: some(groupUpdateAuthority), + }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/token-metadata.test.ts b/packages/dynamic-client/test/programs/token-2022/token-metadata.test.ts new file mode 100644 index 000000000..8381b505d --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/token-metadata.test.ts @@ -0,0 +1,247 @@ +import type { Address } from '@solana/addresses'; +import { some } from '@solana/codecs'; +import { type Extension, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +// Create a mint with MetadataPointer + TokenMetadata extensions +async function createMintWithMetadata( + ctx: SvmTestContext, + payer: Address, + updateAuthority: Address, + metadata: { name: string; symbol: string; uri: string }, +) { + const mint = await ctx.createAccount(); + + // Allocate only MetadataPointer space + // initializeTokenMetadata will realloc the account internally to fit the metadata. + // Fund with enough lamports for the full size (pointer + metadata) so realloc succeeds. + const pointerSize = getMintSize([{ __kind: 'MetadataPointer', authority: updateAuthority, metadataAddress: mint }]); + const fullSize = getMintSize([ + { __kind: 'MetadataPointer', authority: updateAuthority, metadataAddress: mint }, + { + __kind: 'TokenMetadata', + additionalMetadata: new Map(), + mint, + name: metadata.name, + symbol: metadata.symbol, + updateAuthority, + uri: metadata.uri, + }, + ]); + // Add extra space for potential field updates (updateTokenMetadataField reallocs the account) + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(fullSize * 2)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: pointerSize }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initMetadataPointerIx = await token2022Client.methods + .initializeMetadataPointer({ authority: updateAuthority, metadataAddress: mint }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + const initTokenMetadataIx = await token2022Client.methods + .initializeTokenMetadata({ name: metadata.name, symbol: metadata.symbol, uri: metadata.uri }) + .accounts({ metadata: mint, mint, mintAuthority: payer, updateAuthority }) + .instruction(); + + await ctx.sendInstructions( + [createAccountIx, initMetadataPointerIx, initMintIx, initTokenMetadataIx], + [payer, mint], + ); + + return mint; +} + +describe('Token 2022 Program: tokenMetadata', () => { + test('should initialize token metadata [initializeTokenMetadata]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const updateAuthority = await ctx.createFundedAccount(); + + const mint = await createMintWithMetadata(ctx, payer, updateAuthority, { + name: 'Test Token', + symbol: 'TST', + uri: 'https://example.com/metadata.json', + }); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([ + { __kind: 'MetadataPointer', authority: some(updateAuthority), metadataAddress: some(mint) }, + { + __kind: 'TokenMetadata', + name: 'Test Token', + symbol: 'TST', + updateAuthority: { __option: 'Some', value: updateAuthority }, + uri: 'https://example.com/metadata.json', + }, + ]), + ); + }); + + test('should update token metadata field [updateTokenMetadataField]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const updateAuthority = await ctx.createFundedAccount(); + + const mint = await createMintWithMetadata(ctx, payer, updateAuthority, { + name: 'Test Token', + symbol: 'TST', + uri: 'https://example.com/metadata.json', + }); + + const updateNameIx = await token2022Client.methods + .updateTokenMetadataField({ field: { __kind: 'name' }, value: 'Updated Token' }) + .accounts({ metadata: mint, updateAuthority }) + .instruction(); + const updateSymbolIx = await token2022Client.methods + .updateTokenMetadataField({ field: { __kind: 'symbol' }, value: 'LOL' }) + .accounts({ metadata: mint, updateAuthority }) + .instruction(); + const addKeyIx = await token2022Client.methods + .updateTokenMetadataField({ field: { __kind: 'key', fields: ['color'] }, value: 'blue' }) + .accounts({ metadata: mint, updateAuthority }) + .instruction(); + + await ctx.sendInstructions([updateNameIx, updateSymbolIx, addKeyIx], [payer, updateAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { __kind: 'MetadataPointer', authority: some(updateAuthority), metadataAddress: some(mint) }, + { + __kind: 'TokenMetadata', + additionalMetadata: new Map([['color', 'blue']]), + mint, + name: 'Updated Token', + symbol: 'LOL', + updateAuthority: some(updateAuthority), + uri: 'https://example.com/metadata.json', + }, + ]), + ); + }); + + test('should add and remove custom metadata key [updateTokenMetadataField + removeTokenMetadataKey]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const updateAuthority = await ctx.createFundedAccount(); + + // Use shorter metadata so there's room for additionalMetadata in the allocated space + const mint = await createMintWithMetadata(ctx, payer, updateAuthority, { + name: 'T', + symbol: 'T', + uri: '', + }); + + // Add a custom key-value pair + const addKeyIx = await token2022Client.methods + .updateTokenMetadataField({ field: { __kind: 'key', fields: ['color'] }, value: 'blue' }) + .accounts({ metadata: mint, updateAuthority }) + .instruction(); + await ctx.sendInstruction(addKeyIx, [payer, updateAuthority]); + + let mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { __kind: 'MetadataPointer', authority: some(updateAuthority), metadataAddress: some(mint) }, + { + __kind: 'TokenMetadata', + additionalMetadata: new Map([['color', 'blue']]), + mint, + name: 'T', + symbol: 'T', + updateAuthority: some(updateAuthority), + uri: '', + }, + ]), + ); + + // Remove the custom key + const removeKeyIx = await token2022Client.methods + .removeTokenMetadataKey({ idempotent: false, key: 'color' }) + .accounts({ metadata: mint, updateAuthority }) + .instruction(); + await ctx.sendInstruction(removeKeyIx, [payer, updateAuthority]); + + mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { __kind: 'MetadataPointer', authority: some(updateAuthority), metadataAddress: some(mint) }, + { + __kind: 'TokenMetadata', + additionalMetadata: new Map(), + mint, + name: 'T', + symbol: 'T', + updateAuthority: some(updateAuthority), + uri: '', + }, + ]), + ); + }); + + test('should update token metadata update authority [updateTokenMetadataUpdateAuthority]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const updateAuthority = await ctx.createFundedAccount(); + const newUpdateAuthority = await ctx.createFundedAccount(); + + const mint = await createMintWithMetadata(ctx, payer, updateAuthority, { + name: 'Test Token', + symbol: 'TST', + uri: 'https://example.com/metadata.json', + }); + + const updateAuthorityIx = await token2022Client.methods + .updateTokenMetadataUpdateAuthority({ newUpdateAuthority }) + .accounts({ metadata: mint, updateAuthority }) + .instruction(); + await ctx.sendInstruction(updateAuthorityIx, [payer, updateAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([ + { __kind: 'MetadataPointer' }, + { + __kind: 'TokenMetadata', + updateAuthority: { __option: 'Some', value: newUpdateAuthority }, + }, + ]), + ); + }); + + test('should emit token metadata [emitTokenMetadata]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const updateAuthority = await ctx.createFundedAccount(); + + const mint = await createMintWithMetadata(ctx, payer, updateAuthority, { + name: 'Test Token', + symbol: 'TST', + uri: 'https://example.com/metadata.json', + }); + + // emitTokenMetadata emits serialized TokenMetadata as return data + // We just ensure that tx was not failed + const emitIx = await token2022Client.methods.emitTokenMetadata().accounts({ metadata: mint }).instruction(); + const result = await ctx.sendInstruction(emitIx, [payer]); + expect(result.returnData().data()).toBeDefined(); + + // And verify metadata is unchanged after emit + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'MetadataPointer' }, { __kind: 'TokenMetadata', name: 'Test Token', symbol: 'TST' }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/transfer-checked.test.ts b/packages/dynamic-client/test/programs/token-2022/transfer-checked.test.ts new file mode 100644 index 000000000..56aa4cfac --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/transfer-checked.test.ts @@ -0,0 +1,32 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, mintTokens, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: transferChecked', () => { + test('should transfer_checked tokens', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const destinationAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await createTokenAccount(ctx, payer, destinationAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, sourceAccount, payer, 1_000_000); + + const ix = await token2022Client.methods + .transferChecked({ amount: 400_000, decimals: 9 }) + .accounts({ authority: payer, destination: destinationAccount, mint: mintAccount, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + const destData = decoder.decode(ctx.requireEncodedAccount(destinationAccount).data); + expect(sourceData.amount).toBe(600_000n); + expect(destData.amount).toBe(400_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/transfer-fee.test.ts b/packages/dynamic-client/test/programs/token-2022/transfer-fee.test.ts new file mode 100644 index 000000000..7cf2559b1 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/transfer-fee.test.ts @@ -0,0 +1,125 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize, getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createTokenAccountWithExtensions, + createTransferFeeMint, + mintTokens, + systemClient, + token2022Client, +} from './token-2022-test-utils'; + +const TRANSFER_FEE_AMOUNT_EXT = [{ __kind: 'TransferFeeAmount' as const, withheldAmount: 0n }]; + +describe('Token 2022 Program: transferFee', () => { + test('should initialize transfer fee config extension [initializeTransferFeeConfig]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([ + { + __kind: 'TransferFeeConfig', + newerTransferFee: { epoch: 0n, maximumFee: 1_000_000n, transferFeeBasisPoints: 100 }, + olderTransferFee: { epoch: 0n, maximumFee: 0n, transferFeeBasisPoints: 0 }, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + withheldAmount: 0n, + }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initFeeConfigIx = await token2022Client.methods + .initializeTransferFeeConfig({ + maximumFee: 1_000_000, + transferFeeBasisPoints: 100, + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority: null, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initFeeConfigIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toMatchObject( + some([ + { + __kind: 'TransferFeeConfig', + transferFeeConfigAuthority: feeAuthority, + withdrawWithheldAuthority: withdrawAuthority, + }, + ]), + ); + }); + + test('should transfer tokens with fee [transferCheckedWithFee]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + + // Prepare mint and accounts with Transfer fee + const mint = await createTransferFeeMint(ctx, payer, feeAuthority, withdrawAuthority); + const source = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + const destination = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + + await mintTokens(ctx, payer, mint, source, payer, 1_000_000); + + // Transfer with fee: 1_000_000 * 100 / 10000 = 10_000 fee + const amount = 1_000_000; + const fee = 10_000; + const transferIx = await token2022Client.methods + .transferCheckedWithFee({ amount, decimals: 9, fee }) + .accounts({ authority: payer, destination, mint, source }) + .instruction(); + await ctx.sendInstruction(transferIx, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(source).data); + const destData = decoder.decode(ctx.requireEncodedAccount(destination).data); + expect(sourceData.amount).toBe(0n); + expect(destData.amount).toBe(BigInt(amount - fee)); + }); + + test('should set new transfer fee [setTransferFee]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + + // Prepare mint with Transfer fee + const mint = await createTransferFeeMint(ctx, payer, feeAuthority, withdrawAuthority); + + const setFeeIx = await token2022Client.methods + .setTransferFee({ maximumFee: 2_000_000, transferFeeBasisPoints: 200 }) + .accounts({ mint, transferFeeConfigAuthority: feeAuthority }) + .signers(['transferFeeConfigAuthority']) + .instruction(); + await ctx.sendInstruction(setFeeIx, [payer, feeAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([ + { + __kind: 'TransferFeeConfig', + newerTransferFee: { maximumFee: 2_000_000n, transferFeeBasisPoints: 200 }, + }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/transfer-hook.test.ts b/packages/dynamic-client/test/programs/token-2022/transfer-hook.test.ts new file mode 100644 index 000000000..79c363402 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/transfer-hook.test.ts @@ -0,0 +1,97 @@ +import type { Address } from '@solana/addresses'; +import { some } from '@solana/codecs'; +import { type Extension, type ExtensionArgs, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +const getTransferHookExt = (authority: Address, programId: Address): ExtensionArgs[] => [ + { __kind: 'TransferHook', authority, programId }, +]; + +describe('Token 2022 Program: transferHook', () => { + test('should initialize transfer hook extension [initializeTransferHook]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const transferHookAuthority = await ctx.createFundedAccount(); + const hookProgramId = await ctx.createAccount(); + + const size = getMintSize(getTransferHookExt(transferHookAuthority, hookProgramId)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initTransferHookIx = await token2022Client.methods + .initializeTransferHook({ authority: transferHookAuthority, programId: hookProgramId }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initTransferHookIx, initMintIx], [payer, mint]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.extensions).toEqual( + some([ + { + __kind: 'TransferHook', + authority: transferHookAuthority, + programId: hookProgramId, + }, + ]), + ); + }); + + test('should update transfer hook program id [updateTransferHook]', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const transferHookAuthority = await ctx.createFundedAccount(); + const hookProgramId = await ctx.createAccount(); + const newHookProgramId = await ctx.createAccount(); + + const size = getMintSize(getTransferHookExt(transferHookAuthority, hookProgramId)); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initTransferHookIx = await token2022Client.methods + .initializeTransferHook({ authority: transferHookAuthority, programId: hookProgramId }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initTransferHookIx, initMintIx], [payer, mint]); + + // Update transfer hook to a new program id + const updateIx = await token2022Client.methods + .updateTransferHook({ programId: newHookProgramId }) + .accounts({ authority: transferHookAuthority, mint }) + .signers(['authority']) + .instruction(); + await ctx.sendInstruction(updateIx, [payer, transferHookAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toEqual( + some([ + { __kind: 'TransferHook', authority: transferHookAuthority, programId: newHookProgramId }, + ]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/transfer.test.ts b/packages/dynamic-client/test/programs/token-2022/transfer.test.ts new file mode 100644 index 000000000..f8d6a70fd --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/transfer.test.ts @@ -0,0 +1,32 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, mintTokens, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: transfer', () => { + test('should transfer tokens between accounts', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const destinationAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await createTokenAccount(ctx, payer, destinationAccount, mintAccount, payer); + await mintTokens(ctx, payer, mintAccount, sourceAccount, payer, 1_000_000); + + const ix = await token2022Client.methods + .transfer({ amount: 400_000 }) + .accounts({ authority: payer, destination: destinationAccount, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + const destData = decoder.decode(ctx.requireEncodedAccount(destinationAccount).data); + expect(sourceData.amount).toBe(600_000n); + expect(destData.amount).toBe(400_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/ui-amount-to-amount.test.ts b/packages/dynamic-client/test/programs/token-2022/ui-amount-to-amount.test.ts new file mode 100644 index 000000000..9aba74122 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/ui-amount-to-amount.test.ts @@ -0,0 +1,26 @@ +import { getU64Decoder } from '@solana/codecs'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: uiAmountToAmount', () => { + test('should convert a UI amount string to a raw token amount', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + const amount = 1_000_000_000; + const uiAmount = amount / 10 ** 9; + + const ix = await token2022Client.methods + .uiAmountToAmount({ uiAmount: uiAmount.toString() }) + .accounts({ mint: mintAccount }) + .instruction(); + + const meta = await ctx.sendInstruction(ix, [payer]); + const rawAmount = getU64Decoder().decode(meta.returnData().data()); + expect(rawAmount).toBe(BigInt(amount)); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/update-default-account-state.test.ts b/packages/dynamic-client/test/programs/token-2022/update-default-account-state.test.ts new file mode 100644 index 000000000..02e797e57 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/update-default-account-state.test.ts @@ -0,0 +1,51 @@ +import { some } from '@solana/codecs'; +import { AccountState, getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: updateDefaultAccountState', () => { + test('should update default account state extension', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([{ __kind: 'DefaultAccountState', state: AccountState.Frozen }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initDefaultStateIx = await token2022Client.methods + .initializeDefaultAccountState({ state: 'frozen' }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initDefaultStateIx, initMintIx], [payer, mint]); + + const mintDataBefore = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintDataBefore.extensions).toMatchObject( + some([{ __kind: 'DefaultAccountState', state: AccountState.Frozen }]), + ); + + const updateIx = await token2022Client.methods + .updateDefaultAccountState({ state: 'initialized' }) + .accounts({ freezeAuthority, mint }) + .signers(['freezeAuthority']) + .instruction(); + await ctx.sendInstruction(updateIx, [payer, freezeAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'DefaultAccountState', state: AccountState.Initialized }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/update-rate-interest-bearing-mint.test.ts b/packages/dynamic-client/test/programs/token-2022/update-rate-interest-bearing-mint.test.ts new file mode 100644 index 000000000..199ce1cb0 --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/update-rate-interest-bearing-mint.test.ts @@ -0,0 +1,56 @@ +import { some } from '@solana/codecs'; +import { getMintDecoder, getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: updateRateInterestBearingMint', () => { + test('should update interest bearing mint rate', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const rateAuthority = await ctx.createFundedAccount(); + + const size = getMintSize([ + { + __kind: 'InterestBearingConfig', + currentRate: 500, + initializationTimestamp: 0n, + lastUpdateTimestamp: 0n, + preUpdateAverageRate: 0, + rateAuthority, + }, + ]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initInterestBearingIx = await token2022Client.methods + .initializeInterestBearingMint({ rate: 500, rateAuthority }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority: null, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initInterestBearingIx, initMintIx], [payer, mint]); + + const updateIx = await token2022Client.methods + .updateRateInterestBearingMint({ rate: 1000 }) + .accounts({ mint, rateAuthority }) + .signers(['rateAuthority']) + .instruction(); + + await ctx.sendInstruction(updateIx, [payer, rateAuthority]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mint).data); + expect(mintData.extensions).toMatchObject( + some([{ __kind: 'InterestBearingConfig', currentRate: 1000, rateAuthority }]), + ); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/withdraw-excess-lamports.test.ts b/packages/dynamic-client/test/programs/token-2022/withdraw-excess-lamports.test.ts new file mode 100644 index 000000000..e3909fbce --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/withdraw-excess-lamports.test.ts @@ -0,0 +1,46 @@ +import { getMintSize } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { systemClient, token2022Client } from './token-2022-test-utils'; + +describe('Token 2022 Program: withdrawExcessLamports', () => { + test('should withdraw excess lamports from a mint account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mint = await ctx.createAccount(); + const destination = await ctx.createFundedAccount(); + + // Create mint WITH MintCloseAuthority (required for withdrawExcessLamports). + const size = getMintSize([{ __kind: 'MintCloseAuthority', closeAuthority: payer }]); + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(size)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: ctx.TOKEN_2022_PROGRAM_ADDRESS, space: size }) + .accounts({ newAccount: mint, payer }) + .instruction(); + + const initCloseAuthIx = await token2022Client.methods + .initializeMintCloseAuthority({ closeAuthority: payer }) + .accounts({ mint }) + .instruction(); + + const initMintIx = await token2022Client.methods + .initializeMint2({ decimals: 9, freezeAuthority: null, mintAuthority: payer }) + .accounts({ mint }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initCloseAuthIx, initMintIx], [payer, mint]); + + // Airdrop excess lamports to the mint account. + ctx.airdropToAddress(mint, 1_000_000n); + + const destBefore = ctx.getBalanceOrZero(destination); + const ix = await token2022Client.methods + .withdrawExcessLamports() + .accounts({ authority: payer, destinationAccount: destination, sourceAccount: mint }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + expect(ctx.getBalanceOrZero(destination)).toBeGreaterThan(destBefore); + }); +}); diff --git a/packages/dynamic-client/test/programs/token-2022/withdraw-withheld-tokens.test.ts b/packages/dynamic-client/test/programs/token-2022/withdraw-withheld-tokens.test.ts new file mode 100644 index 000000000..3bdb41d4d --- /dev/null +++ b/packages/dynamic-client/test/programs/token-2022/withdraw-withheld-tokens.test.ts @@ -0,0 +1,87 @@ +import { getTokenDecoder } from '@solana-program/token-2022'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { + createTokenAccountWithExtensions, + createTransferFeeMint, + mintTokens, + token2022Client, +} from './token-2022-test-utils'; + +const TRANSFER_FEE_AMOUNT_EXT = [{ __kind: 'TransferFeeAmount' as const, withheldAmount: 0n }]; + +describe('Token 2022 Program: withdrawWithheldTokens', () => { + test('should withdraw withheld tokens from mint', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + + // Prepare mint with Transfer fee + const mint = await createTransferFeeMint(ctx, payer, feeAuthority, withdrawAuthority); + const source = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + const destination = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + const feeReceiver = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + + // Mint and transfer to generate fees + await mintTokens(ctx, payer, mint, source, payer, 1_000_000); + + const transferIx = await token2022Client.methods + .transferCheckedWithFee({ amount: 1_000_000, decimals: 9, fee: 10_000 }) + .accounts({ authority: payer, destination, mint, source }) + .instruction(); + await ctx.sendInstruction(transferIx, [payer]); + + // Harvest fees from destination to mint + const harvestIx = await token2022Client.methods + .harvestWithheldTokensToMint({ sources: [destination] }) + .accounts({ mint }) + .instruction(); + await ctx.sendInstruction(harvestIx, [payer]); + + // Withdraw from mint to feeReceiver + const withdrawIx = await token2022Client.methods + .withdrawWithheldTokensFromMint() + .accounts({ feeReceiver, mint, withdrawWithheldAuthority: withdrawAuthority }) + .signers(['withdrawWithheldAuthority']) + .instruction(); + await ctx.sendInstruction(withdrawIx, [payer, withdrawAuthority]); + + const feeReceiverData = getTokenDecoder().decode(ctx.requireEncodedAccount(feeReceiver).data); + expect(feeReceiverData.amount).toBe(10_000n); + }); + + test('should withdraw withheld tokens from accounts', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const feeAuthority = await ctx.createFundedAccount(); + const withdrawAuthority = await ctx.createFundedAccount(); + + // Prepare mint and accounts with Transfer fee + const mint = await createTransferFeeMint(ctx, payer, feeAuthority, withdrawAuthority); + const source = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + const destination = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + const feeReceiver = await createTokenAccountWithExtensions(ctx, payer, mint, payer, TRANSFER_FEE_AMOUNT_EXT); + + // Mint and transfer to generate fees + await mintTokens(ctx, payer, mint, source, payer, 1_000_000); + + const transferIx = await token2022Client.methods + .transferCheckedWithFee({ amount: 1_000_000, decimals: 9, fee: 10_000 }) + .accounts({ authority: payer, destination, mint, source }) + .instruction(); + await ctx.sendInstruction(transferIx, [payer]); + + // Withdraw directly from accounts + const withdrawIx = await token2022Client.methods + .withdrawWithheldTokensFromAccounts({ numTokenAccounts: 1, sources: [destination] }) + .accounts({ feeReceiver, mint, withdrawWithheldAuthority: withdrawAuthority }) + .signers(['withdrawWithheldAuthority']) + .instruction(); + await ctx.sendInstruction(withdrawIx, [payer, withdrawAuthority]); + + const feeReceiverData = getTokenDecoder().decode(ctx.requireEncodedAccount(feeReceiver).data); + expect(feeReceiverData.amount).toBe(10_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/amount-to-ui-amount.test.ts b/packages/dynamic-client/test/programs/token/amount-to-ui-amount.test.ts new file mode 100644 index 000000000..08694fd87 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/amount-to-ui-amount.test.ts @@ -0,0 +1,24 @@ +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, tokenClient } from './token-test-utils'; + +describe('Token Program: amountToUiAmount', () => { + test('should convert a token amount to its UI representation', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const ix = await tokenClient.methods + .amountToUiAmount({ amount: 1_000_000_000 }) + .accounts({ mint: mintAccount }) + .instruction(); + + const meta = await ctx.sendInstruction(ix, [payer]); + const returnData = meta.returnData(); + const uiAmount = new TextDecoder().decode(returnData.data()); + expect(uiAmount).toBe('1'); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/approve-checked.test.ts b/packages/dynamic-client/test/programs/token/approve-checked.test.ts new file mode 100644 index 000000000..71dcf9f55 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/approve-checked.test.ts @@ -0,0 +1,35 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: approveChecked', () => { + test('should approve a delegate with mint and decimals verification', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: sourceAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + const ix = await tokenClient.methods + .approveChecked({ amount: 500_000, decimals: 9 }) + .accounts({ delegate, mint: mintAccount, owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceData.delegatedAmount).toBe(500_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/approve.test.ts b/packages/dynamic-client/test/programs/token/approve.test.ts new file mode 100644 index 000000000..67bfe8522 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/approve.test.ts @@ -0,0 +1,89 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, SPL_TOKEN_MULTISIG_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: approve', () => { + test('should approve a delegate for a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: sourceAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + const ix = await tokenClient.methods + .approve({ amount: 500_000 }) + .accounts({ delegate, owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceData.delegatedAmount).toBe(500_000n); + }); + + test('should approve with multisig', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + const multisigOwner = await ctx.createAccount(); + + // Create mints + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, multisigOwner); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: sourceAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + // Create multisignature owner + const signer1 = await ctx.createAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_MULTISIG_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_MULTISIG_SIZE, + }) + .accounts({ newAccount: multisigOwner, payer }) + .instruction(); + + const initMultisigIx = await tokenClient.methods + .initializeMultisig({ m: 2, signers: [signer1, signer2, signer3] }) + .accounts({ multisig: multisigOwner }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMultisigIx], [payer, multisigOwner]); + + // Approve delegate with multisig owner, + // providing signer1 and signer2 without signing by multisigOwner + const ix = await tokenClient.methods + .approve({ amount: 500_000, multiSigners: [signer1, signer2] }) + .accounts({ delegate, owner: multisigOwner, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer, signer1, signer2]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'Some', value: delegate }); + expect(sourceData.delegatedAmount).toBe(500_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/burn-checked.test.ts b/packages/dynamic-client/test/programs/token/burn-checked.test.ts new file mode 100644 index 000000000..68e8d7c6f --- /dev/null +++ b/packages/dynamic-client/test/programs/token/burn-checked.test.ts @@ -0,0 +1,33 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: burnChecked', () => { + test('should burn tokens with decimals verification', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: tokenAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + const ix = await tokenClient.methods + .burnChecked({ amount: 400_000, decimals: 9 }) + .accounts({ account: tokenAccount, authority: payer, mint: mintAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const tokenData = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.amount).toBe(600_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/burn.test.ts b/packages/dynamic-client/test/programs/token/burn.test.ts new file mode 100644 index 000000000..a9fc1a02d --- /dev/null +++ b/packages/dynamic-client/test/programs/token/burn.test.ts @@ -0,0 +1,39 @@ +import { getMintDecoder, getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: burn', () => { + test('should burn tokens from a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + // Mint tokens first. + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: tokenAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + // Burn tokens. + const burnIx = await tokenClient.methods + .burn({ amount: 400_000 }) + .accounts({ account: tokenAccount, authority: payer, mint: mintAccount }) + .instruction(); + await ctx.sendInstruction(burnIx, [payer]); + + // Verify token account balance decreased. + const tokenData = getTokenDecoder().decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.amount).toBe(600_000n); + + // Verify mint supply decreased. + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.supply).toBe(600_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/close-account.test.ts b/packages/dynamic-client/test/programs/token/close-account.test.ts new file mode 100644 index 000000000..55f7773f1 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/close-account.test.ts @@ -0,0 +1,28 @@ +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: closeAccount', () => { + test('should close a token account and transfer lamports to destination', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, owner); + + const destBalanceBefore = ctx.getBalanceOrZero(owner); + + const ix = await tokenClient.methods + .closeAccount() + .accounts({ account: tokenAccount, destination: owner, owner }) + .instruction(); + await ctx.sendInstruction(ix, [owner]); + + expect(ctx.fetchEncodedAccount(tokenAccount)).toBeNull(); + expect(ctx.getBalanceOrZero(owner)).toBeGreaterThan(destBalanceBefore); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/freeze-account.test.ts b/packages/dynamic-client/test/programs/token/freeze-account.test.ts new file mode 100644 index 000000000..02bc13a0c --- /dev/null +++ b/packages/dynamic-client/test/programs/token/freeze-account.test.ts @@ -0,0 +1,29 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: freezeAccount', () => { + test('should freeze a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, freezeAuthority); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const freezeIx = await tokenClient.methods + .freezeAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: freezeAuthority }) + .instruction(); + + await ctx.sendInstruction(freezeIx, [freezeAuthority]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.state).toBe(AccountState.Frozen); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/get-account-data-size.test.ts b/packages/dynamic-client/test/programs/token/get-account-data-size.test.ts new file mode 100644 index 000000000..dc52c0409 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/get-account-data-size.test.ts @@ -0,0 +1,21 @@ +import { getU64Decoder } from '@solana/codecs'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, SPL_TOKEN_ACCOUNT_SIZE, tokenClient } from './token-test-utils'; + +describe('Token Program: getAccountDataSize', () => { + test('should return the required account size for a given mint', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const ix = await tokenClient.methods.getAccountDataSize().accounts({ mint: mintAccount }).instruction(); + + const meta = await ctx.sendInstruction(ix, [payer]); + const size = getU64Decoder().decode(meta.returnData().data()); + expect(size).toBe(BigInt(SPL_TOKEN_ACCOUNT_SIZE)); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-account.test.ts b/packages/dynamic-client/test/programs/token/initialize-account.test.ts new file mode 100644 index 000000000..a9d244610 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-account.test.ts @@ -0,0 +1,24 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount } from './token-test-utils'; + +describe('Token Program: initializeAccount', () => { + test('should initialize a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, owner); + + const tokenData = getTokenDecoder().decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(owner); + expect(tokenData.amount).toBe(0n); + expect(tokenData.state).toBe(AccountState.Initialized); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-account2.test.ts b/packages/dynamic-client/test/programs/token/initialize-account2.test.ts new file mode 100644 index 000000000..0a7dddc70 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-account2.test.ts @@ -0,0 +1,40 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, SPL_TOKEN_ACCOUNT_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeAccount2', () => { + test('should initialize a token account with owner passed as instruction data', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_ACCOUNT_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_ACCOUNT_SIZE, + }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initAccountIx = await tokenClient.methods + .initializeAccount2({ owner }) + .accounts({ account: tokenAccount, mint: mintAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, tokenAccount]); + + const decoder = getTokenDecoder(); + const tokenData = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(owner); + expect(tokenData.state).toBe(AccountState.Initialized); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-account3.test.ts b/packages/dynamic-client/test/programs/token/initialize-account3.test.ts new file mode 100644 index 000000000..4bbe77609 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-account3.test.ts @@ -0,0 +1,40 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, SPL_TOKEN_ACCOUNT_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeAccount3', () => { + test('should initialize a token account without requiring the Rent sysvar', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const owner = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_ACCOUNT_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_ACCOUNT_SIZE, + }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initAccountIx = await tokenClient.methods + .initializeAccount3({ owner }) + .accounts({ account: tokenAccount, mint: mintAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, tokenAccount]); + + const decoder = getTokenDecoder(); + const tokenData = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(owner); + expect(tokenData.state).toBe(AccountState.Initialized); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-immutable-owner.test.ts b/packages/dynamic-client/test/programs/token/initialize-immutable-owner.test.ts new file mode 100644 index 000000000..4e762c1ba --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-immutable-owner.test.ts @@ -0,0 +1,44 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, SPL_TOKEN_ACCOUNT_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeImmutableOwner', () => { + test('should initialize immutable owner on a token account before initializeAccount', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const rent = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_ACCOUNT_SIZE)); + + const createAccountIx = await systemClient.methods + .createAccount({ + lamports: rent, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_ACCOUNT_SIZE, + }) + .accounts({ newAccount: tokenAccount, payer }) + .instruction(); + + const initImmutableOwnerIx = await tokenClient.methods + .initializeImmutableOwner() + .accounts({ account: tokenAccount }) + .instruction(); + + const initAccountIx = await tokenClient.methods + .initializeAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: payer }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initImmutableOwnerIx, initAccountIx], [payer, tokenAccount]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.mint).toBe(mintAccount); + expect(tokenData.owner).toBe(payer); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-mint.test.ts b/packages/dynamic-client/test/programs/token/initialize-mint.test.ts new file mode 100644 index 000000000..80eaff078 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-mint.test.ts @@ -0,0 +1,40 @@ +import { getMintDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { SPL_TOKEN_MINT_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeMint', () => { + test('should initialize a mint with default freeze authority (None)', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + const mintRent = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_MINT_SIZE)); + + const createAccountIx = await systemClient.methods + .createAccount({ + lamports: mintRent, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_MINT_SIZE, + }) + .accounts({ + newAccount: mintAccount, + payer, + }) + .instruction(); + + const initMintIx = await tokenClient.methods + .initializeMint({ decimals: 9, mintAuthority: payer }) + .accounts({ mint: mintAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMintIx], [payer, mintAccount]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.decimals).toBe(9); + expect(mintData.supply).toBe(0n); + expect(mintData.freezeAuthority).toEqual({ __option: 'None' }); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-mint2.test.ts b/packages/dynamic-client/test/programs/token/initialize-mint2.test.ts new file mode 100644 index 000000000..2e02b9a53 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-mint2.test.ts @@ -0,0 +1,41 @@ +import { getMintDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { SPL_TOKEN_MINT_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeMint2', () => { + test('should initialize a mint without requiring the Rent sysvar', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const freezeAuthority = await ctx.createAccount(); + + const mintRent = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_MINT_SIZE)); + + const createAccountIx = await systemClient.methods + .createAccount({ + lamports: mintRent, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_MINT_SIZE, + }) + .accounts({ + newAccount: mintAccount, + payer, + }) + .instruction(); + + const initMintIx = await tokenClient.methods + .initializeMint2({ decimals: 6, freezeAuthority, mintAuthority: payer }) + .accounts({ mint: mintAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMintIx], [payer, mintAccount]); + + const mintData = getMintDecoder().decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.mintAuthority).toEqual({ __option: 'Some', value: payer }); + expect(mintData.decimals).toBe(6); + expect(mintData.supply).toBe(0n); + expect(mintData.freezeAuthority).toEqual({ __option: 'Some', value: freezeAuthority }); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-multisig.test.ts b/packages/dynamic-client/test/programs/token/initialize-multisig.test.ts new file mode 100644 index 000000000..f216f14a7 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-multisig.test.ts @@ -0,0 +1,41 @@ +import { getMultisigDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { SPL_TOKEN_MULTISIG_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeMultisig', () => { + test('should initialize a multisig account with 2-of-3 signers', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const multisigAccount = await ctx.createAccount(); + + const signer1 = await ctx.createAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_MULTISIG_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_MULTISIG_SIZE, + }) + .accounts({ newAccount: multisigAccount, payer }) + .instruction(); + + const initMultisigIx = await tokenClient.methods + .initializeMultisig({ m: 2, signers: [signer1, signer2, signer3] }) + .accounts({ multisig: multisigAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMultisigIx], [payer, multisigAccount]); + + const decoder = getMultisigDecoder(); + const multisigData = decoder.decode(ctx.requireEncodedAccount(multisigAccount).data); + expect(multisigData.m).toBe(2); + expect(multisigData.n).toBe(3); + expect(multisigData.isInitialized).toBe(true); + expect(multisigData.signers.slice(0, 3)).toStrictEqual([signer1, signer2, signer3]); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/initialize-multisig2.test.ts b/packages/dynamic-client/test/programs/token/initialize-multisig2.test.ts new file mode 100644 index 000000000..0a0b276b2 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/initialize-multisig2.test.ts @@ -0,0 +1,41 @@ +import { getMultisigDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { SPL_TOKEN_MULTISIG_SIZE, systemClient, tokenClient } from './token-test-utils'; + +describe('Token Program: initializeMultisig2', () => { + test('should initialize a multisig account without requiring the Rent sysvar', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const multisigAccount = await ctx.createAccount(); + + const signer1 = await ctx.createAccount(); + const signer2 = await ctx.createAccount(); + const signer3 = await ctx.createAccount(); + + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_MULTISIG_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_MULTISIG_SIZE, + }) + .accounts({ newAccount: multisigAccount, payer }) + .instruction(); + + const initMultisigIx = await tokenClient.methods + .initializeMultisig2({ m: 2, signers: [signer1, signer2, signer3] }) + .accounts({ multisig: multisigAccount }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initMultisigIx], [payer, multisigAccount]); + + const decoder = getMultisigDecoder(); + const multisigData = decoder.decode(ctx.requireEncodedAccount(multisigAccount).data); + expect(multisigData.m).toBe(2); + expect(multisigData.n).toBe(3); + expect(multisigData.isInitialized).toBe(true); + expect(multisigData.signers.slice(0, 3)).toStrictEqual([signer1, signer2, signer3]); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/mint-to-checked.test.ts b/packages/dynamic-client/test/programs/token/mint-to-checked.test.ts new file mode 100644 index 000000000..c59a7ed79 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/mint-to-checked.test.ts @@ -0,0 +1,27 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: mintToChecked', () => { + test('should mint tokens with decimals verification', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const ix = await tokenClient.methods + .mintToChecked({ amount: 1_000_000, decimals: 9 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: tokenAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const tokenData = decoder.decode(ctx.requireEncodedAccount(tokenAccount).data); + expect(tokenData.amount).toBe(1_000_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/mint-to.test.ts b/packages/dynamic-client/test/programs/token/mint-to.test.ts new file mode 100644 index 000000000..b48c56a25 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/mint-to.test.ts @@ -0,0 +1,28 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: mintTo', () => { + test('should mint tokens to a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const ix = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: tokenAccount }) + .instruction(); + + await ctx.sendInstruction(ix, [payer]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.amount).toBe(1_000_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/revoke.test.ts b/packages/dynamic-client/test/programs/token/revoke.test.ts new file mode 100644 index 000000000..8b9ae216d --- /dev/null +++ b/packages/dynamic-client/test/programs/token/revoke.test.ts @@ -0,0 +1,38 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: revoke', () => { + test('should revoke a delegate from a token account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const delegate = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: sourceAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + const approveIx = await tokenClient.methods + .approve({ amount: 500_000 }) + .accounts({ delegate, owner: payer, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(approveIx, [payer]); + + const ix = await tokenClient.methods.revoke().accounts({ owner: payer, source: sourceAccount }).instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + expect(sourceData.delegate).toStrictEqual({ __option: 'None' }); + expect(sourceData.delegatedAmount).toBe(0n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/set-authority.test.ts b/packages/dynamic-client/test/programs/token/set-authority.test.ts new file mode 100644 index 000000000..e8ad8749d --- /dev/null +++ b/packages/dynamic-client/test/programs/token/set-authority.test.ts @@ -0,0 +1,26 @@ +import { getMintDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, tokenClient } from './token-test-utils'; + +describe('Token Program: setAuthority', () => { + test('should change the mint authority to a new address', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const newAuthority = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const ix = await tokenClient.methods + .setAuthority({ authorityType: 'mintTokens', newAuthority }) + .accounts({ owned: mintAccount, owner: payer }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getMintDecoder(); + const mintData = decoder.decode(ctx.requireEncodedAccount(mintAccount).data); + expect(mintData.mintAuthority).toStrictEqual({ __option: 'Some', value: newAuthority }); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/sync-native.test.ts b/packages/dynamic-client/test/programs/token/sync-native.test.ts new file mode 100644 index 000000000..5f7989c14 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/sync-native.test.ts @@ -0,0 +1,54 @@ +import { address } from '@solana/addresses'; +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { SPL_TOKEN_ACCOUNT_SIZE, systemClient, tokenClient } from './token-test-utils'; + +const NATIVE_MINT = address('So11111111111111111111111111111111111111112'); + +describe('Token Program: syncNative', () => { + test('should sync a wrapped SOL account amount with its lamport balance', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const wrappedSolAccount = await ctx.createAccount(); + + // Create and initialize a wrapped SOL token account. + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_ACCOUNT_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ + lamports, + programAddress: tokenClient.programAddress, + space: SPL_TOKEN_ACCOUNT_SIZE, + }) + .accounts({ newAccount: wrappedSolAccount, payer }) + .instruction(); + + const initAccountIx = await tokenClient.methods + .initializeAccount() + .accounts({ account: wrappedSolAccount, mint: NATIVE_MINT, owner: payer }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, wrappedSolAccount]); + + // Transfer additional SOL to the wrapped account via system program. + const transferAmount = 1_000_000_000n; + const transferIx = await systemClient.methods + .transferSol({ amount: transferAmount }) + .accounts({ destination: wrappedSolAccount, source: payer }) + .instruction(); + await ctx.sendInstruction(transferIx, [payer]); + + // Token amount is still 0 before sync. + const decoder = getTokenDecoder(); + const beforeSync = decoder.decode(ctx.requireEncodedAccount(wrappedSolAccount).data); + expect(beforeSync.amount).toBe(0n); + + // Sync native to update the token amount. + const syncIx = await tokenClient.methods.syncNative().accounts({ account: wrappedSolAccount }).instruction(); + await ctx.sendInstruction(syncIx, [payer]); + + const afterSync = decoder.decode(ctx.requireEncodedAccount(wrappedSolAccount).data); + expect(afterSync.amount).toBe(transferAmount); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/thaw-account.test.ts b/packages/dynamic-client/test/programs/token/thaw-account.test.ts new file mode 100644 index 000000000..6a76023cf --- /dev/null +++ b/packages/dynamic-client/test/programs/token/thaw-account.test.ts @@ -0,0 +1,36 @@ +import { AccountState, getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: thawAccount', () => { + test('should thaw a frozen account', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const tokenAccount = await ctx.createAccount(); + const freezeAuthority = await ctx.createFundedAccount(); + + await createMint(ctx, payer, mintAccount, payer, freezeAuthority); + await createTokenAccount(ctx, payer, tokenAccount, mintAccount, payer); + + const freezeIx = await tokenClient.methods + .freezeAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: freezeAuthority }) + .instruction(); + + await ctx.sendInstruction(freezeIx, [freezeAuthority]); + + const thawIx = await tokenClient.methods + .thawAccount() + .accounts({ account: tokenAccount, mint: mintAccount, owner: freezeAuthority }) + .instruction(); + + await ctx.sendInstruction(thawIx, [freezeAuthority]); + + const account = ctx.requireEncodedAccount(tokenAccount); + const tokenData = getTokenDecoder().decode(account.data); + expect(tokenData.state).toBe(AccountState.Initialized); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/token-test-utils.ts b/packages/dynamic-client/test/programs/token/token-test-utils.ts new file mode 100644 index 000000000..971eb8e55 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/token-test-utils.ts @@ -0,0 +1,54 @@ +import type { Address } from '@solana/addresses'; + +import type { SystemProgramClient } from '../generated/system-program-idl-types'; +import type { TokenProgramClient } from '../generated/token-idl-types'; +import { createTestProgramClient, SvmTestContext } from '../test-utils'; + +export const tokenClient = createTestProgramClient('token-idl.json'); +export const systemClient = createTestProgramClient('system-program-idl.json'); + +export const SPL_TOKEN_MINT_SIZE = 82; +export const SPL_TOKEN_ACCOUNT_SIZE = 165; +export const SPL_TOKEN_MULTISIG_SIZE = 355; + +export async function createMint( + ctx: SvmTestContext, + payer: Address, + mint: Address, + mintAuthority: Address, + freezeAuthority?: Address, +): Promise { + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_MINT_SIZE)); + const createMintAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: tokenClient.programAddress, space: SPL_TOKEN_MINT_SIZE }) + .accounts({ newAccount: mint, payer }) + .instruction(); + await ctx.sendInstruction(createMintAccountIx, [payer, mint]); + + const initializeMintIx = await tokenClient.methods + .initializeMint({ decimals: 9, freezeAuthority: freezeAuthority ?? null, mintAuthority }) + .accounts({ mint }) + .instruction(); + await ctx.sendInstruction(initializeMintIx, [payer]); +} + +export async function createTokenAccount( + ctx: SvmTestContext, + payer: Address, + account: Address, + mint: Address, + owner: Address, +): Promise { + const lamports = ctx.getMinimumBalanceForRentExemption(BigInt(SPL_TOKEN_ACCOUNT_SIZE)); + const createAccountIx = await systemClient.methods + .createAccount({ lamports, programAddress: tokenClient.programAddress, space: SPL_TOKEN_ACCOUNT_SIZE }) + .accounts({ newAccount: account, payer }) + .instruction(); + + const initAccountIx = await tokenClient.methods + .initializeAccount() + .accounts({ account, mint, owner }) + .instruction(); + + await ctx.sendInstructions([createAccountIx, initAccountIx], [payer, account]); +} diff --git a/packages/dynamic-client/test/programs/token/transfer-checked.test.ts b/packages/dynamic-client/test/programs/token/transfer-checked.test.ts new file mode 100644 index 000000000..12353c234 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/transfer-checked.test.ts @@ -0,0 +1,37 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: transferChecked', () => { + test('should transfer tokens with mint and decimal verification', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const destinationAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await createTokenAccount(ctx, payer, destinationAccount, mintAccount, payer); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: sourceAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + const ix = await tokenClient.methods + .transferChecked({ amount: 400_000, decimals: 9 }) + .accounts({ authority: payer, destination: destinationAccount, mint: mintAccount, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + const destData = decoder.decode(ctx.requireEncodedAccount(destinationAccount).data); + expect(sourceData.amount).toBe(600_000n); + expect(destData.amount).toBe(400_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/transfer.test.ts b/packages/dynamic-client/test/programs/token/transfer.test.ts new file mode 100644 index 000000000..664546814 --- /dev/null +++ b/packages/dynamic-client/test/programs/token/transfer.test.ts @@ -0,0 +1,37 @@ +import { getTokenDecoder } from '@solana-program/token'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, createTokenAccount, tokenClient } from './token-test-utils'; + +describe('Token Program: transfer', () => { + test('should transfer tokens between accounts', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + const sourceAccount = await ctx.createAccount(); + const destinationAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + await createTokenAccount(ctx, payer, sourceAccount, mintAccount, payer); + await createTokenAccount(ctx, payer, destinationAccount, mintAccount, payer); + + const mintIx = await tokenClient.methods + .mintTo({ amount: 1_000_000 }) + .accounts({ mint: mintAccount, mintAuthority: payer, token: sourceAccount }) + .instruction(); + await ctx.sendInstruction(mintIx, [payer]); + + const ix = await tokenClient.methods + .transfer({ amount: 400_000 }) + .accounts({ authority: payer, destination: destinationAccount, source: sourceAccount }) + .instruction(); + await ctx.sendInstruction(ix, [payer]); + + const decoder = getTokenDecoder(); + const sourceData = decoder.decode(ctx.requireEncodedAccount(sourceAccount).data); + const destData = decoder.decode(ctx.requireEncodedAccount(destinationAccount).data); + expect(sourceData.amount).toBe(600_000n); + expect(destData.amount).toBe(400_000n); + }); +}); diff --git a/packages/dynamic-client/test/programs/token/ui-amount-to-amount.test.ts b/packages/dynamic-client/test/programs/token/ui-amount-to-amount.test.ts new file mode 100644 index 000000000..252e6fbbb --- /dev/null +++ b/packages/dynamic-client/test/programs/token/ui-amount-to-amount.test.ts @@ -0,0 +1,24 @@ +import { getU64Decoder } from '@solana/codecs'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../test-utils'; +import { createMint, tokenClient } from './token-test-utils'; + +describe('Token Program: uiAmountToAmount', () => { + test('should convert a UI amount string to a raw token amount', async () => { + const ctx = new SvmTestContext({ defaultPrograms: true }); + const payer = await ctx.createFundedAccount(); + const mintAccount = await ctx.createAccount(); + + await createMint(ctx, payer, mintAccount, payer); + + const ix = await tokenClient.methods + .uiAmountToAmount({ uiAmount: '1' }) + .accounts({ mint: mintAccount }) + .instruction(); + + const meta = await ctx.sendInstruction(ix, [payer]); + const rawAmount = getU64Decoder().decode(meta.returnData().data()); + expect(rawAmount).toBe(1_000_000_000n); + }); +}); diff --git a/packages/dynamic-client/test/svm-test-context.ts b/packages/dynamic-client/test/svm-test-context.ts new file mode 100644 index 000000000..659542c98 --- /dev/null +++ b/packages/dynamic-client/test/svm-test-context.ts @@ -0,0 +1,262 @@ +import { + type Address, + address, + appendTransactionMessageInstructions, + compileTransaction, + createAddressWithSeed, + createTransactionMessage, + generateKeyPairSigner, + type Instruction, + type KeyPairSigner, + lamports, + pipe, + setTransactionMessageFeePayerSigner, + signTransactionWithSigners, +} from '@solana/kit'; +import { TOKEN_PROGRAM_ADDRESS as TOKEN_PROGRAM_ADDR } from '@solana-program/token'; +import { + ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ASSOCIATED_TOKEN_PROGRAM_ADDR, + TOKEN_2022_PROGRAM_ADDRESS as T2022_PROGRAM_ADDR, +} from '@solana-program/token-2022'; +import { FailedTransactionMetadata, LiteSVM, type TransactionMetadata } from 'litesvm'; + +/** + * Encoded account data returned from SVM. + */ +export type EncodedAccount = { + readonly data: Uint8Array; + readonly executable: boolean; + readonly lamports: bigint; + readonly owner: Address; + readonly rentEpoch?: bigint; +}; + +/** + * Configuration options for the SVM test context. + */ +export type SvmTestContextConfig = { + /** Include standard builtins */ + readonly builtins?: boolean; + /** Include standard SPL programs (Token, Token-2022, ATA, etc.). Default: false. */ + readonly defaultPrograms?: boolean; + /** Include standard precompiles (ed25519, secp256k1). Default: false. */ + readonly precompiles?: boolean; + /** Include standard sysvars (clock, rent, etc.). Default: false. */ + readonly sysvars?: boolean; +}; + +/** + * Test context that encapsulates LiteSVM and provides a clean Solana Kit API. + * + * Purpose: + * - Hides LiteSVM implementation details and exposes Solana Kit types (Address, Instruction) + * - Manages account lifecycle and signing internally + * - Provides declarative test helpers (fundAccount, sendInstruction) + * + * Tests work exclusively with Address types while the context handles + * keypair management and transaction building behind the scenes. + * Use the config parameter to include additional programs. + */ +export class SvmTestContext { + private readonly svm: LiteSVM; + private readonly accounts: Map; + private currentSlot: bigint; + + readonly TOKEN_2022_PROGRAM_ADDRESS: Address = T2022_PROGRAM_ADDR; + readonly TOKEN_PROGRAM_ADDRESS: Address = TOKEN_PROGRAM_ADDR; + readonly ASSOCIATED_TOKEN_PROGRAM_ADDRESS: Address = ASSOCIATED_TOKEN_PROGRAM_ADDR; + readonly SYSTEM_PROGRAM_ADDRESS = address('11111111111111111111111111111111'); + readonly SYSVAR_RENT_ADDRESS = address('SysvarRent111111111111111111111111111111111'); + readonly SYSVAR_INSTRUCTIONS_ADDRESS = address('Sysvar1nstructions1111111111111111111111111'); + readonly BPF_LOADER_UPGRADEABLE = address('BPFLoaderUpgradeab1e11111111111111111111111'); + readonly TOKEN_2022_NATIVE_MINT = address('9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP'); + + constructor(config: SvmTestContextConfig = {}) { + let svm = new LiteSVM(); + if (config.defaultPrograms) { + svm = svm.withDefaultPrograms(); + } + if (config.precompiles) { + svm = svm.withPrecompiles(); + } + if (config.sysvars) { + svm = svm.withSysvars(); + } + if (config.builtins) { + svm = svm.withBuiltins(); + } + this.svm = svm; + this.accounts = new Map(); + this.currentSlot = BigInt(0); + } + + /** Creates a new keypair signer */ + static generateKeypair(): Promise { + return generateKeyPairSigner(); + } + + /** Generates a new Address */ + static async generateAddress(): Promise
{ + const signer = await SvmTestContext.generateKeypair(); + return signer.address; + } + + /** Creates a new keypair, stores it in the context, and returns its address. */ + async createAccount(): Promise
{ + const signer = await generateKeyPairSigner(); + this.accounts.set(signer.address, signer); + return signer.address; + } + + /** Creates an account and airdrops the given lamports to it. */ + async createFundedAccount(amount: bigint = BigInt(10e9)): Promise
{ + const addr = await this.createAccount(); + this.svm.airdrop(addr, lamports(amount)); + return addr; + } + + /** Derives an address from base + seed + programId (createWithSeed). Does not store a keypair. */ + async createAccountWithSeed(base: Address, seed: string, programId: Address): Promise
{ + return await createAddressWithSeed({ baseAddress: base, programAddress: programId, seed }); + } + + /** Airdrops lamports to an account. Account must have been created via this context. */ + airdrop(account: Address, amount: bigint = BigInt(1e9)): void { + this.svm.airdrop(account, lamports(amount)); + } + + /** Airdrops lamports to any address on-chain (e.g. PDAs without stored keypairs). */ + airdropToAddress(account: Address, amount: bigint = BigInt(1e9)): void { + this.svm.airdrop(account, lamports(amount)); + } + + /** + * Sets account data directly on any address. + * @param account - The account address to set + * @param accountData - The account data including lamports, data, owner, executable + */ + setAccount( + account: Address, + accountData: { + readonly data: Uint8Array; + readonly executable?: boolean; + readonly lamports: bigint; + readonly owner: Address; + }, + ): void { + this.svm.setAccount({ + address: account, + data: accountData.data, + executable: accountData.executable ?? false, + lamports: lamports(accountData.lamports), + programAddress: accountData.owner, + space: BigInt(accountData.data.length), + }); + } + + /** Returns the account's lamport balance, or null if the account is unknown to the SVM. */ + getBalance(account: Address): bigint | null { + const balance = this.svm.getBalance(account); + return balance !== null ? BigInt(balance) : null; + } + + /** Same as getBalance but returns 0n when the account is missing. */ + getBalanceOrZero(account: Address): bigint { + return this.getBalance(account) ?? BigInt(0); + } + + /** Fetches full account data (lamports, owner, data, executable). Returns null if not found. */ + fetchEncodedAccount(account: Address): EncodedAccount | null { + const accountInfo = this.svm.getAccount(account); + + if (!accountInfo.exists) { + return null; + } + + return { + data: new Uint8Array(accountInfo.data), + executable: accountInfo.executable, + lamports: BigInt(accountInfo.lamports), + owner: accountInfo.programAddress, + }; + } + + /** Like fetchEncodedAccount but throws if the account does not exist. */ + requireEncodedAccount(account: Address): EncodedAccount { + const encodedAccount = this.fetchEncodedAccount(account); + if (!encodedAccount) { + throw new Error(`Account ${account} does not exist`); + } + return encodedAccount; + } + + /** Builds, signs, and sends a transaction with a single instruction. Signers must be context-owned. */ + async sendInstruction(instruction: Instruction, signers: Address[]): Promise { + return await this.buildAndSend([instruction], signers); + } + + /** Builds, signs, and sends a transaction with multiple instructions. Signers must be context-owned. */ + async sendInstructions(instructions: Instruction[], signers: Address[]): Promise { + return await this.buildAndSend(instructions, signers); + } + + /** Warps the SVM to the specified slot. */ + warpToSlot(slot: bigint): void { + this.currentSlot = slot; + this.svm.warpToSlot(slot); + } + + /** Advances the SVM by the specified number of slots (default: 1). */ + advanceSlots(count: bigint = BigInt(1)): void { + this.currentSlot += count; + this.svm.warpToSlot(this.currentSlot); + this.svm.expireBlockhash(); + } + + /** Loads a Solana program from a .so file. */ + loadProgram(programAddress: Address, programPath: string): void { + this.svm.addProgramFromFile(programAddress, programPath); + } + + /** Calculates the minimum balance required to make an account with the given data length rent-exempt. */ + getMinimumBalanceForRentExemption(dataLen: bigint): bigint { + return this.svm.minimumBalanceForRentExemption(dataLen); + } + + /** Returns the underlying LiteSVM instance for direct use when needed. Consider using the public methods instead. */ + getSvm(): LiteSVM { + return this.svm; + } + + private async buildAndSend(instructions: Instruction[], signers: Address[]): Promise { + if (signers.length === 0) { + throw new Error('At least one signer is required'); + } + + const keypairSigners = signers.map(addr => { + const signer = this.accounts.get(addr); + if (!signer) { + throw new Error(`Signer ${addr} not found in context`); + } + return signer; + }); + + const tx = pipe( + createTransactionMessage({ version: 0 }), + message => setTransactionMessageFeePayerSigner(keypairSigners[0], message), + message => this.svm.setTransactionMessageLifetimeUsingLatestBlockhash(message), + message => appendTransactionMessageInstructions(instructions, message), + message => compileTransaction(message), + ); + const signedTx = await signTransactionWithSigners(keypairSigners, tx); + + const result = this.svm.sendTransaction(signedTx); + + if (result instanceof FailedTransactionMetadata) { + console.error('Transaction failed, logs:\n', result.meta().prettyLogs()); + throw new Error(`Transaction failed: ${result.toString()}`); + } + + return result; + } +} diff --git a/packages/dynamic-client/test/unit/cli/generate-program-client-types.test.ts b/packages/dynamic-client/test/unit/cli/generate-program-client-types.test.ts new file mode 100644 index 000000000..8a28a127f --- /dev/null +++ b/packages/dynamic-client/test/unit/cli/generate-program-client-types.test.ts @@ -0,0 +1,102 @@ +import { execFileSync } from 'node:child_process'; +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import path from 'node:path'; + +import type { RootNode } from 'codama'; +import { afterAll, describe, expect, test } from 'vitest'; + +import { generateClientTypes } from '../../../src/cli/commands/generate-client-types/generate-client-types'; + +const CLI_PATH = path.resolve('bin/cli.cjs'); + +function execCli(args: string[]) { + try { + const stdout = execFileSync('node', [CLI_PATH, ...args], { + cwd: path.resolve('.'), + encoding: 'utf-8', + stdio: 'pipe', + }); + return { exitCode: 0, stderr: '', stdout }; + } catch (error: unknown) { + const e = error as { status: number; stderr: string; stdout: string }; + return { exitCode: e.status ?? 1, stderr: e.stderr ?? '', stdout: e.stdout ?? '' }; + } +} + +describe('CLI', () => { + const tmpDirs: string[] = []; + + afterAll(() => { + for (const dir of tmpDirs) { + rmSync(dir, { force: true, recursive: true }); + } + }); + + test('should print help when no arguments are provided', () => { + const { stdout, exitCode } = execCli([]); + expect(stdout).toContain('Usage: dynamic-client'); + expect(stdout).toContain('generate-client-types '); + expect(exitCode).toBe(0); + }); + + test('should print help when --help flag is provided', () => { + const { stdout, exitCode } = execCli(['--help']); + expect(stdout).toContain('Usage: dynamic-client'); + expect(stdout).toContain('generate-client-types '); + expect(exitCode).toBe(0); + }); + + test('should exit with code 1 for unknown commands', () => { + const { stderr, exitCode } = execCli(['unknown-cmd']); + expect(stderr).toContain("unknown command 'unknown-cmd'"); + expect(exitCode).toBe(1); + }); + + test('should print subcommand help for generate-client-types --help', () => { + const { stdout, exitCode } = execCli(['generate-client-types', '--help']); + expect(stdout).toContain('generate-client-types'); + expect(stdout).toContain('codama-idl'); + expect(stdout).toContain('output-dir'); + expect(exitCode).toBe(0); + }); + + test('should exit with code 1 when output dir argument is missing', () => { + const { exitCode, stderr } = execCli(['generate-client-types', 'some-file.json']); + expect(exitCode).toBe(1); + expect(stderr).toContain("missing required argument 'output-dir'"); + }); + + test('should exit with code 1 when IDL file does not exist', () => { + const tmpDir = mkdtempSync(path.join(tmpdir(), 'cli-test-')); + tmpDirs.push(tmpDir); + const { exitCode, stderr } = execCli(['generate-client-types', '/nonexistent/path.json', tmpDir]); + expect(exitCode).toBe(1); + expect(stderr).toContain('IDL file not found'); + }); + + test('should exit with code 1 when IDL file contains invalid JSON', () => { + const tmpDir = mkdtempSync(path.join(tmpdir(), 'cli-test-')); + tmpDirs.push(tmpDir); + const badFile = path.join(tmpDir, 'bad.json'); + writeFileSync(badFile, '{ not valid json'); + const { exitCode, stderr } = execCli(['generate-client-types', badFile, tmpDir]); + expect(exitCode).toBe(1); + expect(stderr).toContain('not valid Codama JSON'); + }); + + test('should read IDL and write output file for generate-client-types', () => { + const idlPath = path.resolve('test/programs/idls/circular-account-refs-idl.json'); + const tmpDir = mkdtempSync(path.join(tmpdir(), 'cli-test-')); + tmpDirs.push(tmpDir); + + const { exitCode } = execCli(['generate-client-types', idlPath, tmpDir]); + expect(exitCode).toBe(0); + + const outputPath = path.join(tmpDir, 'circular-account-refs-idl-types.ts'); + const output = readFileSync(outputPath, 'utf-8'); + const idl = JSON.parse(readFileSync(idlPath, 'utf-8')) as RootNode; + const expected = generateClientTypes(idl); + expect(output).toBe(expected); + }); +}); diff --git a/packages/dynamic-client/test/unit/cli/program-client-types.test.ts b/packages/dynamic-client/test/unit/cli/program-client-types.test.ts new file mode 100644 index 000000000..08dc7eba1 --- /dev/null +++ b/packages/dynamic-client/test/unit/cli/program-client-types.test.ts @@ -0,0 +1,163 @@ +import type { Address, ProgramDerivedAddress } from '@solana/addresses'; +import type { Instruction } from '@solana/instructions'; +import type { InstructionNode, RootNode } from 'codama'; +import { describe, expectTypeOf, test } from 'vitest'; + +import type { + CreateItemAccounts, + CreateItemArgs, + CreateItemResolvers, + ResolverFn, +} from '../../programs/generated/custom-resolvers-test-idl-types'; +import type { + AllocateArgs, + CanonicalPdaSeeds, + NonCanonicalPdaSeeds, + ProgramMetadataPdas, + ProgramMetadataProgramClient, + WriteArgs, +} from '../../programs/generated/pmp-idl-types'; +import type { + CreateAccountAccounts, + CreateAccountArgs, + CreateAccountMethod, + SystemMethods, + SystemProgramClient, +} from '../../programs/generated/system-program-idl-types'; +import type { InitializeConfidentialTransferMintArgs } from '../../programs/generated/token-2022-idl-types'; + +describe('generated program client types', () => { + describe('program client without PDAs (SystemProgramClient)', () => { + test('should align with ProgramClient structure', () => { + expectTypeOf().toHaveProperty('instructions'); + expectTypeOf().toEqualTypeOf>(); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().not.toHaveProperty('pdas'); + + expectTypeOf().toHaveProperty('programAddress'); + expectTypeOf().toEqualTypeOf
(); + + expectTypeOf().toHaveProperty('root'); + expectTypeOf().toEqualTypeOf(); + }); + + test('should have expected method keys on SystemMethods', () => { + type ExpectedKeys = + | 'advanceNonceAccount' + | 'allocate' + | 'allocateWithSeed' + | 'assign' + | 'assignWithSeed' + | 'authorizeNonceAccount' + | 'createAccount' + | 'createAccountWithSeed' + | 'initializeNonceAccount' + | 'transferSol' + | 'transferSolWithSeed' + | 'upgradeNonceAccount' + | 'withdrawNonceAccount'; + expectTypeOf().toEqualTypeOf(); + }); + + test('should return MethodBuilder from method call', () => { + type MethodsBuilder = ReturnType; + expectTypeOf().toHaveProperty('accounts'); + expectTypeOf().returns.toEqualTypeOf(); + + expectTypeOf().toHaveProperty('instruction'); + expectTypeOf().returns.toEqualTypeOf>(); + + expectTypeOf().toHaveProperty('resolvers'); + expectTypeOf().returns.toEqualTypeOf(); + + expectTypeOf().toHaveProperty('signers'); + expectTypeOf().returns.toEqualTypeOf(); + }); + + test('should have correct properties on CreateAccountArgs', () => { + expectTypeOf().toHaveProperty('lamports'); + expectTypeOf().toEqualTypeOf(); + + expectTypeOf().toHaveProperty('space'); + expectTypeOf().toEqualTypeOf(); + + expectTypeOf().toHaveProperty('programAddress'); + expectTypeOf().toEqualTypeOf
(); + }); + + test('should have correct properties on CreateAccountAccounts', () => { + expectTypeOf().toEqualTypeOf
(); + expectTypeOf().toEqualTypeOf
(); + }); + }); + + describe('program client with PDAs (ProgramMetadataProgramClient)', () => { + test('should align with ProgramClient structure', () => { + expectTypeOf().toHaveProperty('instructions'); + expectTypeOf().toHaveProperty('pdas'); + expectTypeOf().toEqualTypeOf(); + expectTypeOf().toHaveProperty('programAddress'); + expectTypeOf().toHaveProperty('root'); + }); + + test('should have a key for every PDA defined in the IDL', () => { + type ExpectedPdaKeys = 'canonical' | 'metadata' | 'nonCanonical'; + expectTypeOf().toEqualTypeOf(); + type PdaFn = ProgramMetadataPdas[keyof ProgramMetadataPdas]; + expectTypeOf().returns.toEqualTypeOf>(); + }); + + test('should have correct seed properties on CanonicalPdaSeeds', () => { + expectTypeOf().toHaveProperty('program'); + expectTypeOf().toEqualTypeOf
(); + + expectTypeOf().toHaveProperty('seed'); + expectTypeOf().toEqualTypeOf(); + }); + + test('should have correct seed properties on NonCanonicalPdaSeeds', () => { + expectTypeOf().toHaveProperty('program'); + expectTypeOf().toEqualTypeOf
(); + + expectTypeOf().toHaveProperty('authority'); + expectTypeOf().toEqualTypeOf
(); + + expectTypeOf().toHaveProperty('seed'); + expectTypeOf().toEqualTypeOf(); + }); + }); + + describe('remainderOptionTypeNode optional args (pmp-idl)', () => { + test('should have optional data in write args', () => { + expectTypeOf().toMatchObjectType<{ data?: Uint8Array | null; offset: number }>(); + }); + + test('should have optional seed in allocate args', () => { + expectTypeOf().toMatchObjectType<{ seed?: string | null }>(); + }); + }); + + describe('zeroableOptionTypeNode optional args (token-2022)', () => { + test('should have optional auditorElgamalPubkey in InitializeConfidentialTransferMintArgs', () => { + expectTypeOf().toMatchObjectType<{ + auditorElgamalPubkey?: Address | null; + authority?: Address | null; + autoApproveNewAccounts: boolean; + }>(); + }); + }); + + describe('resolver types', () => { + test('should have expected resolver keys on CreateItemResolvers', () => { + expectTypeOf().toHaveProperty('resolveDescription'); + expectTypeOf().toExtend< + ResolverFn + >(); + + expectTypeOf().toHaveProperty('resolveTags'); + expectTypeOf().toExtend< + ResolverFn + >(); + }); + }); +}); diff --git a/packages/dynamic-client/test/unit/instruction-encoding/arguments.test.ts b/packages/dynamic-client/test/unit/instruction-encoding/arguments.test.ts new file mode 100644 index 000000000..6199db8dc --- /dev/null +++ b/packages/dynamic-client/test/unit/instruction-encoding/arguments.test.ts @@ -0,0 +1,193 @@ +import { CodamaError } from '@codama/errors'; +import { address } from '@solana/addresses'; +import { getU32Encoder, getU64Encoder, mergeBytes } from '@solana/codecs'; +import { getInitializeInstructionDataDecoder } from '@solana-program/program-metadata'; +import type { InstructionNode, RootNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createArgumentsInputValidator, encodeInstructionArguments } from '../../../src/instruction-encoding/arguments'; +import { getCodecFromBytesEncoding } from '../../../src/shared/bytes-encoding'; +import { loadRoot } from '../../programs/test-utils'; + +function getInstruction(root: RootNode, name: string): InstructionNode { + const ix = root.program.instructions.find(i => i.name === name); + if (!ix) throw new Error(`Instruction ${name} not found`); + return ix; +} + +describe('Instruction encoding: encodeInstructionArguments', () => { + test('should encode omitted discriminator using default numberValueNode', () => { + // pmp-idl.json 'write' instruction has discriminator with defaultValue: numberValueNode(0) + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'write'); + + const encoded = encodeInstructionArguments(root, ix, { + data: null, + offset: 2, + }); + + // discriminator: u8 + offset: u32 + expect(encoded).toEqual(new Uint8Array([0, 2, 0, 0, 0])); + }); + + test('should encode omitted discriminator using default bytesValueNode', () => { + const root = loadRoot('example-idl.json'); + const ix = getInstruction(root, 'updateOptionalInput'); + + const encoded = encodeInstructionArguments(root, ix, { + input: 42n, + optionalInput: null, + }); + + // discriminator defaulValue from updateOptionalInput: + const expectedDiscriminator = getCodecFromBytesEncoding('base16').encode('1f094566b31b79c7'); + const expectedInput = getU64Encoder().encode(42n); + const expectedOptionalInput = new Uint8Array([0]); + expect(encoded).toEqual( + mergeBytes([ + expectedDiscriminator as Uint8Array, + expectedInput as Uint8Array, + expectedOptionalInput as Uint8Array, + ]), + ); + }); + + test('should transform Uint8Array in remainderOptionTypeNode argument', () => { + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'write'); + + const testData = new Uint8Array([0xde, 0xad, 0xbe, 0xef]); + const encoded = encodeInstructionArguments(root, ix, { + data: testData, + offset: 10, + }); + + const expected = mergeBytes([new Uint8Array([0]), getU32Encoder().encode(10) as Uint8Array, testData]); + expect(encoded).toEqual(expected); + }); + + test('should resolve definedTypeLinkNode to enumTypeNode', () => { + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'initialize'); + + // seed is a fixedSizeTypeNode(16, stringTypeNode) - needs 16-byte padded string + // Enums use lowercase variant names: none=0, utf8=1, gzip=1, json=1, direct=0, etc. + const encoded = encodeInstructionArguments(root, ix, { + compression: 'gzip', // gzip=1 + data: null, + dataSource: 'url', // url=1 + encoding: 'base64', // base64=3 + format: 'json', // json=1 + seed: 'test', // fixed 16-byte string, null-padded + }); + + const expected = getInitializeInstructionDataDecoder().decode(encoded); + expect(encoded.length).toBe(21); + expect(expected.discriminator).toBe(1); + expect(expected.seed).toBe('test'); + expect(expected.encoding).toBe(3); + expect(expected.compression).toBe(1); + expect(expected.format).toBe(1); + expect(expected.dataSource).toBe(1); + }); + + test('should throw ARGUMENT_MISSING for missing required argument', () => { + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'write'); + + expect(() => encodeInstructionArguments(root, ix, {})).toThrow('Missing argument [offset] in [write].'); + }); + + test('should throw DEFAULT_VALUE_MISSING when omitted argument has no defaultValue', () => { + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'write'); + + // Create a modified instruction where the omitted discriminator has no defaultValue. + const modifiedIx: InstructionNode = { + ...ix, + arguments: ix.arguments.map(arg => + arg.name === 'discriminator' ? { ...arg, defaultValue: undefined } : arg, + ), + }; + + expect(() => encodeInstructionArguments(root, modifiedIx, { data: null, offset: 0 })).toThrow( + 'Default value is missing for argument [discriminator] in [write].', + ); + }); + + test('should throw ValidationError when omitted argument is provided', () => { + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'write'); + + // discriminator should be omitted due to strategy + const validate = createArgumentsInputValidator(root, ix); + expect(() => + validate({ + data: null, + discriminator: 99, + offset: 0, + }), + ).toThrow(CodamaError); + }); + + test('should encode instruction with only omitted discriminator (no user args)', () => { + const root = loadRoot('pmp-idl.json'); + const ix = getInstruction(root, 'close'); + + const encoded = encodeInstructionArguments(root, ix, {}); + const discriminator = 6; + expect(encoded).toEqual(new Uint8Array([discriminator])); + }); +}); + +describe('Instruction validation: remaining account arguments', () => { + const ADDR_1 = address('11111111111111111111111111111111'); + const ADDR_2 = address('22222222222222222222222222222222222222222222'); + + test('should not reject remaining account args as extra keys', () => { + // initializeMultisig has remainingAccounts referencing "signers" argumentValueNode + // superstruct's object() rejects unknown keys, so "signers" must be stripped before validation + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + const validate = createArgumentsInputValidator(root, ix); + expect(() => validate({ m: 2, signers: [ADDR_1, ADDR_2] })).not.toThrow(); + }); + + test('should still validate regular arguments when remaining account args are present', () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + // m is a required number argument — passing a string should fail validation + const validate = createArgumentsInputValidator(root, ix); + expect(() => validate({ m: 'invalid', signers: [ADDR_1] })).toThrow('Invalid argument "m"'); + }); + + test('should not reject optional remaining account args when omitted', () => { + // transfer has optional multiSigners remaining accounts + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'transfer'); + + const validate = createArgumentsInputValidator(root, ix); + expect(() => validate({ amount: 100 })).not.toThrow(); + }); + + test('should not reject optional remaining account args when provided', () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'transfer'); + + const validate = createArgumentsInputValidator(root, ix); + expect(() => validate({ amount: 100, multiSigners: [ADDR_1] })).not.toThrow(); + }); + + test('should not encode remaining account args as instruction data', () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + const withSigners = encodeInstructionArguments(root, ix, { m: 2, signers: [ADDR_1, ADDR_2] }); + const withoutSigners = encodeInstructionArguments(root, ix, { m: 2 }); + + // Remaining account args should not affect encoded data + expect(withSigners).toEqual(withoutSigners); + }); +}); diff --git a/packages/dynamic-client/test/unit/instruction-encoding/create-account-meta.test.ts b/packages/dynamic-client/test/unit/instruction-encoding/create-account-meta.test.ts new file mode 100644 index 000000000..05b289b1f --- /dev/null +++ b/packages/dynamic-client/test/unit/instruction-encoding/create-account-meta.test.ts @@ -0,0 +1,177 @@ +import { address } from '@solana/addresses'; +import { AccountRole } from '@solana/instructions'; +import type { InstructionNode, RootNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createAccountMeta } from '../../../src/instruction-encoding/accounts/create-account-meta'; +import { loadRoot } from '../../programs/test-utils'; + +const ADDR_1 = address('11111111111111111111111111111111'); +const ADDR_2 = address('22222222222222222222222222222222222222222222'); +const ADDR_3 = address('33333333333333333333333333333333333333333333'); +const MULTISIG_ADDR = address('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'); + +describe('createAccountMeta: remaining accounts', () => { + test('should append remaining accounts from argumentsInput', async () => { + // initializeMultisig has remainingAccounts: [{ value: argumentValueNode("signers") }] + // It has 2 regular accounts: multisig (user-provided) + rent (default: SysvarRent) + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + const result = await createAccountMeta( + root, + ix, + { m: 2, signers: [ADDR_1, ADDR_2, ADDR_3] }, + { multisig: MULTISIG_ADDR }, + ); + + // 2 regular accounts (multisig + rent) + 3 remaining accounts + expect(result).toHaveLength(5); + const remainingAccounts = result.slice(2); + expect(remainingAccounts[0]).toEqual({ address: ADDR_1, role: AccountRole.READONLY }); + expect(remainingAccounts[1]).toEqual({ address: ADDR_2, role: AccountRole.READONLY }); + expect(remainingAccounts[2]).toEqual({ address: ADDR_3, role: AccountRole.READONLY }); + }); + + test('should use READONLY_SIGNER role when isSigner is true', async () => { + // transfer has remainingAccounts: [{ value: argumentValueNode("multiSigners"), isOptional: true, isSigner: true }] + // It has 3 regular accounts: source, destination, authority (default: identity) + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'transfer'); + + const result = await createAccountMeta( + root, + ix, + { amount: 100, multiSigners: [ADDR_1, ADDR_2] }, + { authority: ADDR_3, destination: MULTISIG_ADDR, source: ADDR_3 }, + ); + + // 3 regular accounts + 2 remaining accounts + const remainingAccounts = result.slice(3); + expect(remainingAccounts).toHaveLength(2); + expect(remainingAccounts[0]).toEqual({ address: ADDR_1, role: AccountRole.READONLY_SIGNER }); + expect(remainingAccounts[1]).toEqual({ address: ADDR_2, role: AccountRole.READONLY_SIGNER }); + }); + + test('should skip optional remaining accounts when not provided', async () => { + // transfer's multiSigners is optional — omitting it should produce no extra accounts + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'transfer'); + + const result = await createAccountMeta( + root, + ix, + { amount: 100 }, + { authority: ADDR_1, destination: MULTISIG_ADDR, source: ADDR_3 }, + ); + + // Only 3 regular accounts, no remaining + expect(result).toHaveLength(3); + }); + + test('should append empty array as no remaining accounts', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + const result = await createAccountMeta(root, ix, { m: 1, signers: [] }, { multisig: MULTISIG_ADDR }); + + // 2 regular accounts (multisig + rent), no remaining + expect(result).toHaveLength(2); + }); + + test('should return no remaining accounts when instruction has none defined', async () => { + // initializeMint has no remainingAccounts + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMint'); + + const result = await createAccountMeta( + root, + ix, + { decimals: 9, freezeAuthority: null, mintAuthority: ADDR_1 }, + { mint: MULTISIG_ADDR }, + ); + + // Should only have regular accounts (mint + rent sysvar) + expect(result).toHaveLength(2); + }); + + test('should throw when remaining account argument is not an array', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + await expect( + createAccountMeta(root, ix, { m: 2, signers: ADDR_1 }, { multisig: MULTISIG_ADDR }), + ).rejects.toThrow( + 'Invalid argument input [signers]: ["11111111111111111111111111111111"]. Expected [Address[]].', + ); + }); + + test('should throw when remaining account value kind is not argumentValueNode', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + // Replace the argumentValueNode with an unsupported value kind + const remainingAccount = ix.remainingAccounts?.[0]; + const modifiedRemainingAccount = Object.assign({}, remainingAccount, { + value: { kind: 'resolverValueNode', name: 'someResolver' }, + }) as typeof remainingAccount; + const modifiedIx: InstructionNode = Object.assign({}, ix, { + remainingAccounts: [modifiedRemainingAccount], + }); + + await expect(createAccountMeta(root, modifiedIx, { m: 2 }, { multisig: MULTISIG_ADDR })).rejects.toThrow( + /Expected node of kind \[argumentValueNode\], got \[resolverValueNode\]/, + ); + }); + + test('should throw when remaining account array contains invalid element types', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + await expect( + createAccountMeta(root, ix, { m: 2, signers: [ADDR_1, 123] }, { multisig: MULTISIG_ADDR }), + ).rejects.toThrow(/Expected \[Address \| PublicKey\] for account \[signers\[1\]\]/); + }); + + test('should throw when required remaining account argument is not provided', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMultisig'); + + // signers is required: + await expect( + createAccountMeta(root, ix, { m: 2, signers: undefined }, { multisig: MULTISIG_ADDR }), + ).rejects.toThrow(/Missing argument \[signers\]/); + }); +}); + +describe('createAccountMeta: UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY', () => { + test('should throw when optionalAccountStrategy is unsupported', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'initializeMint'); + + // Create an optional account with no default value. + const optionalAccount = { + ...ix.accounts[0], + defaultValue: undefined, + isOptional: true, + }; + + // Set an invalid optionalAccountStrategy. + const modifiedIx: InstructionNode = { + ...ix, + accounts: [optionalAccount], + // @ts-expect-error - we're intentionally passing an invalid strategy to test error handling + optionalAccountStrategy: 'invalid', + }; + + await expect(createAccountMeta(root, modifiedIx, {}, { [optionalAccount.name]: null })).rejects.toThrow( + 'Unsupported optional account strategy ["invalid"] for account [mint] in [initializeMint].', + ); + }); +}); + +function getInstruction(root: RootNode, name: string): InstructionNode { + const ix = root.program.instructions.find(i => i.name === name); + if (!ix) throw new Error(`Instruction ${name} not found`); + return ix; +} diff --git a/packages/dynamic-client/test/unit/instruction-encoding/validators.test.ts b/packages/dynamic-client/test/unit/instruction-encoding/validators.test.ts new file mode 100644 index 000000000..b0a03bf2e --- /dev/null +++ b/packages/dynamic-client/test/unit/instruction-encoding/validators.test.ts @@ -0,0 +1,19 @@ +import type { InstructionArgumentNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createIxArgumentsValidator } from '../../../src/instruction-encoding/validators'; + +describe('Validators', () => { + test('should throw for unsupported TypeNode kind', () => { + const fakeIxArguments = [ + { + name: 'testArg', + type: { kind: 'fooBarTypeNode' }, + }, + ] as unknown as InstructionArgumentNode[]; + + expect(() => createIxArgumentsValidator('testInstruction', fakeIxArguments, [])).toThrow( + 'Validator for TypeNode "testInstruction_testArg_0" kind: fooBarTypeNode is not implemented!', + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/program-client/create-program-client.test.ts b/packages/dynamic-client/test/unit/program-client/create-program-client.test.ts new file mode 100644 index 000000000..0f8bf247f --- /dev/null +++ b/packages/dynamic-client/test/unit/program-client/create-program-client.test.ts @@ -0,0 +1,173 @@ +import { CodamaError } from '@codama/errors'; +import { address } from '@solana/addresses'; +import { describe, expect, test } from 'vitest'; + +import { createProgramClient } from '../../../src'; +import type { MplTokenMetadataProgramClient } from '../../programs/generated/mpl-token-metadata-idl-types'; +import type { SystemProgramClient } from '../../programs/generated/system-program-idl-types'; +import { createTestProgramClient, loadIdl, SvmTestContext } from '../../programs/test-utils'; + +describe('createProgramClient', () => { + describe('methods', () => { + const programClient = createTestProgramClient('system-program-idl.json'); + + test('should throw when accessing a non-existent instruction', () => { + expect(() => programClient.methods.nonExistentMethod).toThrow(CodamaError); + expect(() => programClient.methods.nonExistentMethod).toThrow( + /Instruction \[nonExistentMethod\] not found in IDL/, + ); + }); + + test('should list available instructions in error message', () => { + try { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + programClient.methods.nonExistentMethod; + expect.unreachable('should have thrown'); + } catch (error) { + const message = (error as Error).message; + expect(message).toContain('Available:'); + + const allInstructions = [ + 'createAccount', + 'assign', + 'transferSol', + 'createAccountWithSeed', + 'advanceNonceAccount', + 'withdrawNonceAccount', + 'initializeNonceAccount', + 'authorizeNonceAccount', + 'allocate', + 'allocateWithSeed', + 'assignWithSeed', + 'transferSolWithSeed', + 'upgradeNonceAccount', + ]; + + for (const ix of allInstructions) { + expect(message).toContain(ix); + } + } + }); + + test('should return a builder for a valid instruction', () => { + const typedClient = createTestProgramClient('system-program-idl.json'); + const builder = typedClient.methods.transferSol({ amount: 1000 }); + expect(builder).toBeDefined(); + expect(typeof builder.accounts).toBe('function'); + expect(typeof builder.instruction).toBe('function'); + }); + + test('should support "in" operator for existing instructions', () => { + expect('transferSol' in programClient.methods).toBe(true); + expect('nonExistentMethod' in programClient.methods).toBe(false); + }); + + test('should preserve standard object semantics for prototype properties with "in" operator', () => { + expect('toString' in programClient.methods).toBe(true); + expect('valueOf' in programClient.methods).toBe(true); + expect('constructor' in programClient.methods).toBe(true); + expect('hasOwnProperty' in programClient.methods).toBe(true); + }); + + test('should not throw when accessing standard prototype properties', () => { + expect(() => programClient.methods.constructor).not.toThrow(); + // eslint-disable-next-line @typescript-eslint/unbound-method + expect(() => programClient.methods.hasOwnProperty).not.toThrow(); + expect(programClient.methods.constructor).toBeUndefined(); + // eslint-disable-next-line @typescript-eslint/unbound-method + expect(programClient.methods.hasOwnProperty).toBeUndefined(); + }); + + test('should not throw when awaited directly', async () => { + // eslint-disable-next-line @typescript-eslint/await-thenable + const result = await programClient.methods; + expect(result).toBeDefined(); + }); + + test('should not throw when serialized with JSON.stringify', () => { + expect(() => JSON.stringify(programClient.methods)).not.toThrow(); + }); + }); + + describe('pdas', () => { + const pdaClient = createTestProgramClient('mpl-token-metadata-idl.json'); + + test('should throw when accessing a non-existent PDA', () => { + // @ts-expect-error - testing error message for non-existent PDA + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + expect(() => pdaClient.pdas.nonExistentPda).toThrow(CodamaError); + // @ts-expect-error - testing error message for non-existent PDA + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + expect(() => pdaClient.pdas.nonExistentPda).toThrow(/PDA \[nonExistentPda\] not found in IDL/); + }); + + test('should list available PDAs in error message', () => { + // @ts-expect-error - testing error message for non-existent PDA + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + expect(() => pdaClient.pdas.nonExistentPda).toThrow(/Available:/); + }); + + test('should support "in" operator for existing PDAs', () => { + expect('metadata' in pdaClient.pdas).toBe(true); + expect('nonExistentPda' in pdaClient.pdas).toBe(false); + }); + + test('should preserve standard object semantics for prototype properties with "in" operator', () => { + expect('toString' in pdaClient.pdas).toBe(true); + expect('valueOf' in pdaClient.pdas).toBe(true); + expect('constructor' in pdaClient.pdas).toBe(true); + expect('hasOwnProperty' in pdaClient.pdas).toBe(true); + }); + + test('should return undefined pdas for IDL without PDAs', () => { + const noPdaClient = createTestProgramClient('system-program-idl.json'); + expect(noPdaClient.pdas).toBeUndefined(); + }); + + test('should return defined pdas for IDL with PDAs', () => { + expect(pdaClient.pdas).toBeDefined(); + }); + + test('should not throw when accessing standard prototype properties', () => { + expect(() => pdaClient.pdas.constructor).not.toThrow(); + // eslint-disable-next-line @typescript-eslint/unbound-method + expect(() => pdaClient.pdas.hasOwnProperty).not.toThrow(); + expect(pdaClient.pdas.constructor).toBeUndefined(); + // eslint-disable-next-line @typescript-eslint/unbound-method + expect(pdaClient.pdas.hasOwnProperty).toBeUndefined(); + }); + + test('should not throw when awaited directly', async () => { + // eslint-disable-next-line @typescript-eslint/await-thenable + const result = await pdaClient.pdas; + expect(result).toBeDefined(); + }); + + test('should not throw when serialized with JSON.stringify', () => { + expect(() => JSON.stringify(pdaClient.pdas)).not.toThrow(); + }); + }); + + describe('programId override', () => { + const OVERRIDE_ADDRESS = address('7EqQdEULxWcraVx3mXKFjc84LhCkMGZCkRuDrdXkTfBR'); + + test('should reflect the override in programAddress', () => { + const idl = loadIdl('system-program-idl.json'); + const client = createProgramClient(idl, { programId: OVERRIDE_ADDRESS }); + expect(client.programAddress).toBe(OVERRIDE_ADDRESS); + }); + + test('should use the overridden program address in built instruction', async () => { + const idl = loadIdl('system-program-idl.json'); + const client = createProgramClient(idl, { programId: OVERRIDE_ADDRESS }); + + const sourceAndDest = await SvmTestContext.generateAddress(); + const ix = await client.methods + .transferSol({ amount: 1000 }) + .accounts({ destination: sourceAndDest, source: sourceAndDest }) + .instruction(); + + expect(ix.programAddress).toBe(OVERRIDE_ADDRESS); + }); + }); +}); diff --git a/packages/dynamic-client/test/unit/resolvers/resolve-account-value-node-address/resolve-account-value-node-address.test.ts b/packages/dynamic-client/test/unit/resolvers/resolve-account-value-node-address/resolve-account-value-node-address.test.ts new file mode 100644 index 000000000..f21060d42 --- /dev/null +++ b/packages/dynamic-client/test/unit/resolvers/resolve-account-value-node-address/resolve-account-value-node-address.test.ts @@ -0,0 +1,30 @@ +import { CodamaError } from '@codama/errors'; +import { describe, expect, test } from 'vitest'; + +import { detectCircularDependency } from '../../../../src/instruction-encoding/resolvers/resolve-account-value-node-address'; + +describe('detectCircularDependency', () => { + test('should not throw when no circular dependency exists', () => { + expect(() => detectCircularDependency('c', ['a', 'b'])).not.toThrow(); + }); + + test('should throw AccountError when circular dependency detected', () => { + expect(() => detectCircularDependency('a', ['a', 'b'])).toThrow(CodamaError); + }); + + test('should include full resolution path in error message', () => { + expect(() => detectCircularDependency('a', ['a', 'b', 'c'])).toThrow( + /Circular dependency detected: \[a -> b -> c -> a\]/, + ); + }); + + test('should detect dependency later in the path', () => { + expect(() => detectCircularDependency('b', ['a', 'b', 'c'])).toThrow( + /Circular dependency detected: \[a -> b -> c -> b\]/, + ); + }); + + test('should not throw for empty path', () => { + expect(() => detectCircularDependency('a', [])).not.toThrow(); + }); +}); diff --git a/packages/dynamic-client/test/unit/resolvers/resolve-account-value-node-address/types.test.ts b/packages/dynamic-client/test/unit/resolvers/resolve-account-value-node-address/types.test.ts new file mode 100644 index 000000000..208327544 --- /dev/null +++ b/packages/dynamic-client/test/unit/resolvers/resolve-account-value-node-address/types.test.ts @@ -0,0 +1,9 @@ +import { describe, expectTypeOf, test } from 'vitest'; + +import type { ResolutionPath } from '../../../../src/instruction-encoding/resolvers'; + +describe('ResolutionPath', () => { + test('should be a readonly array of strings', () => { + expectTypeOf().toEqualTypeOf(); + }); +}); diff --git a/packages/dynamic-client/test/unit/resolvers/resolve-conditional.test.ts b/packages/dynamic-client/test/unit/resolvers/resolve-conditional.test.ts new file mode 100644 index 000000000..caaf67fa2 --- /dev/null +++ b/packages/dynamic-client/test/unit/resolvers/resolve-conditional.test.ts @@ -0,0 +1,46 @@ +import { + camelCase, + type ConditionalValueNode, + type InstructionAccountNode, + type InstructionNode, + type RootNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { resolveConditionalValueNodeCondition } from '../../../src/instruction-encoding/resolvers/resolve-conditional'; +import { loadRoot } from '../../programs/test-utils'; + +function getInstruction(root: RootNode, name: string): InstructionNode { + const ix = root.program.instructions.find(i => i.name === name); + if (!ix) throw new Error(`Instruction ${name} not found`); + return ix; +} + +describe('resolveConditionalValueNodeCondition: INVARIANT_VIOLATION', () => { + test('should throw when conditionalValueNode has no value and no branches', async () => { + const root = loadRoot('token-idl.json'); + const ix = getInstruction(root, 'transfer'); + + const ixAccountNode: InstructionAccountNode = ix.accounts[0]; + + const invalidConditional: ConditionalValueNode = { + condition: { kind: 'accountValueNode', name: camelCase('source') }, + kind: 'conditionalValueNode', + }; + + await expect( + resolveConditionalValueNodeCondition({ + accountsInput: {}, + argumentsInput: {}, + conditionalValueNode: invalidConditional, + ixAccountNode, + ixNode: ix, + resolutionPath: [], + resolversInput: {}, + root, + }), + ).rejects.toThrow( + 'Internal invariant violation: [Invalid conditionalValueNode: missing value and branches for account source in transfer].', + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/shared/address.test.ts b/packages/dynamic-client/test/unit/shared/address.test.ts new file mode 100644 index 000000000..2658d02b2 --- /dev/null +++ b/packages/dynamic-client/test/unit/shared/address.test.ts @@ -0,0 +1,129 @@ +import { type Address, address } from '@solana/addresses'; +import { describe, expect, expectTypeOf, test } from 'vitest'; + +import { + type AddressInput, + isConvertibleAddress, + isPublicKeyLike, + type PublicKeyLike, + toAddress, +} from '../../../src/shared/address'; +import { SvmTestContext } from '../../svm-test-context'; + +describe('isPublicKeyLike', () => { + test('should return true for objects with toBase58 method', () => { + const publicKey = { toBase58: () => '11111111111111111111111111111111' }; + expect(isPublicKeyLike(publicKey)).toBe(true); + }); + + test('should narrow type to PublicKeyLike', () => { + const value: unknown = { toBase58: () => '11111111111111111111111111111111' }; + if (isPublicKeyLike(value)) { + expectTypeOf(value).toExtend(); + } + }); + + test('should return false for plain strings', () => { + expect(isPublicKeyLike('11111111111111111111111111111111')).toBe(false); + }); + + test('should return false for null', () => { + expect(isPublicKeyLike(null)).toBe(false); + }); + + test('should return false for undefined', () => { + expect(isPublicKeyLike(undefined)).toBe(false); + }); + + test('should return false for numbers', () => { + expect(isPublicKeyLike(42)).toBe(false); + }); + + test('should return false for objects without toBase58', () => { + expect(isPublicKeyLike({ toString: () => 'hello' })).toBe(false); + }); + + test('should return false for objects where toBase58 is not a function', () => { + expect(isPublicKeyLike({ toBase58: 'not-a-function' })).toBe(false); + }); +}); + +describe('toAddress', () => { + const VALID_ADDRESS = '11111111111111111111111111111111'; + + test('should convert a string to Address', () => { + const result = toAddress(VALID_ADDRESS); + expect(result).toBe(VALID_ADDRESS); + expectTypeOf(result).toExtend
(); + }); + + test('should convert a PublicKeyLike to Address', () => { + const publicKey = { toBase58: () => VALID_ADDRESS }; + const result = toAddress(publicKey); + expect(result).toBe(VALID_ADDRESS); + }); + + test('should pass through an existing Address', () => { + const addr = address(VALID_ADDRESS); + const result = toAddress(addr); + expect(result).toBe(VALID_ADDRESS); + }); + + test('should throw for invalid non-string or pubkey Addresses', () => { + const invalidAddresses = [42n, 42, { a: 42 }, null, undefined]; + for (const input of invalidAddresses) { + // @ts-expect-error testing invalid inputs + expect(() => toAddress(input)).toThrow(/Cannot convert value to Address/); + } + }); +}); + +describe('isConvertibleAddress', () => { + test('should return true for Address', async () => { + const address = await SvmTestContext.generateAddress(); + expect(isConvertibleAddress(address)).toBe(true); + }); + + test('should return true for PublicKeyLike', () => { + const publicKey = { toBase58: () => '11111111111111111111111111111111' }; + const result = toAddress(publicKey); + expect(isConvertibleAddress(result)).toBe(true); + }); + + test('should return true for valid base58 string', () => { + const addr = '11111111111111111111111111111111'; + const result = toAddress(addr); + expect(isConvertibleAddress(result)).toBe(true); + }); + + test('should return false for invalid string', () => { + const addr = 'invalid_address'; + expect(isConvertibleAddress(addr)).toBe(false); + }); + + test('should return false for null and undefined', () => { + [null, undefined].forEach(invalidAddr => { + expect(isConvertibleAddress(invalidAddr)).toBe(false); + }); + }); + + test('should return false for invalid objects', () => { + [{}, { a: 42 }].forEach(invalidAddr => { + expect(isConvertibleAddress(invalidAddr)).toBe(false); + }); + }); +}); + +describe('AddressInput type', () => { + test('should accept Address', () => { + expectTypeOf(address('11111111111111111111111111111111')).toExtend(); + }); + + test('should accept string', () => { + expectTypeOf().toExtend(); + }); + + test('should accept PublicKeyLike', () => { + expectTypeOf().toExtend(); + }); +}); diff --git a/packages/dynamic-client/test/unit/shared/bytes-encoding.test.ts b/packages/dynamic-client/test/unit/shared/bytes-encoding.test.ts new file mode 100644 index 000000000..2add953e6 --- /dev/null +++ b/packages/dynamic-client/test/unit/shared/bytes-encoding.test.ts @@ -0,0 +1,81 @@ +import { describe, expect, test } from 'vitest'; + +import { getCodecFromBytesEncoding, isUint8Array, uint8ArrayToEncodedString } from '../../../src/shared/bytes-encoding'; + +describe('uint8ArrayToEncodedString', () => { + const helloBytes = new Uint8Array([72, 101, 108, 108, 111]); + + test('should encode to base16', () => { + expect(uint8ArrayToEncodedString(helloBytes, 'base16')).toBe('48656c6c6f'); + }); + + test('should encode to base58', () => { + expect(uint8ArrayToEncodedString(helloBytes, 'base58')).toBe('9Ajdvzr'); + }); + + test('should encode to base64', () => { + expect(uint8ArrayToEncodedString(helloBytes, 'base64')).toBe('SGVsbG8='); + }); + + test('should encode to utf8', () => { + expect(uint8ArrayToEncodedString(helloBytes, 'utf8')).toBe('Hello'); + }); + + test('should handle empty bytes', () => { + expect(uint8ArrayToEncodedString(new Uint8Array(), 'base16')).toBe(''); + }); +}); + +describe('getCodecFromBytesEncoding', () => { + test('should return codec for base16', () => { + const codec = getCodecFromBytesEncoding('base16'); + expect(codec).toBeDefined(); + expect(codec.encode('ff')).toEqual(new Uint8Array([255])); + }); + + test('should return codec for base58', () => { + const codec = getCodecFromBytesEncoding('base58'); + expect(codec).toBeDefined(); + }); + + test('should return codec for base64', () => { + const codec = getCodecFromBytesEncoding('base64'); + expect(codec).toBeDefined(); + }); + + test('should return codec for utf8', () => { + const codec = getCodecFromBytesEncoding('utf8'); + expect(codec).toBeDefined(); + expect(codec.encode('Hi')).toEqual(new Uint8Array([72, 105])); + }); + + test('should throw for unsupported encoding', () => { + // @ts-expect-error testing invalid input + expect(() => getCodecFromBytesEncoding('rot13')).toThrow(/Unrecognized bytes encoding \[.*rot13.*\]/); + }); +}); + +describe('isUint8Array', () => { + test('should return true for Uint8Array', () => { + expect(isUint8Array(new Uint8Array([1, 2, 3]))).toBe(true); + expect(isUint8Array(new Uint8Array())).toBe(true); + }); + + test('should return false for regular arrays', () => { + expect(isUint8Array([1, 2, 3])).toBe(false); + }); + + test('should return false for strings', () => { + expect(isUint8Array('hello')).toBe(false); + }); + + test('should return false for null and undefined', () => { + expect(isUint8Array(null)).toBe(false); + expect(isUint8Array(undefined)).toBe(false); + }); + + test('should return false for other typed arrays', () => { + expect(isUint8Array(new Uint16Array([1, 2]))).toBe(false); + expect(isUint8Array(new Int8Array([1, 2]))).toBe(false); + }); +}); diff --git a/packages/dynamic-client/test/unit/shared/codecs.test.ts b/packages/dynamic-client/test/unit/shared/codecs.test.ts new file mode 100644 index 000000000..1030492bd --- /dev/null +++ b/packages/dynamic-client/test/unit/shared/codecs.test.ts @@ -0,0 +1,51 @@ +import { describe, expect, test } from 'vitest'; + +import { + getMemoizedAddressEncoder, + getMemoizedBase16Codec, + getMemoizedBase58Codec, + getMemoizedBase64Codec, + getMemoizedBooleanEncoder, + getMemoizedUtf8Codec, + getMemoizedUtf8Encoder, +} from '../../../src/shared/codecs'; +import { SvmTestContext } from '../../svm-test-context'; + +describe('shared codecs (memoized):', () => { + test('should encode a base58 address to 32 bytes (getMemoizedAddressEncoder)', async () => { + const kp = await SvmTestContext.generateKeypair(); + const encoder = getMemoizedAddressEncoder(); + const result = encoder.encode(kp.address); + expect(result.length).toBe(32); + }); + + test('should encode a string to utf8 bytes (getMemoizedUtf8Encoder)', () => { + const encoder = getMemoizedUtf8Encoder(); + expect(encoder.encode('Hello')).toEqual(new Uint8Array([72, 101, 108, 108, 111])); + }); + + test('should encode true to a single byte (getMemoizedBooleanEncoder)', () => { + const encoder = getMemoizedBooleanEncoder(); + expect(encoder.encode(true)).toEqual(new Uint8Array([1])); + }); + + test('should encode a string to utf8 bytes (getMemoizedUtf8Codec)', () => { + const codec = getMemoizedUtf8Codec(); + expect(codec.encode('Hi')).toEqual(new Uint8Array([72, 105])); + }); + + test('should encode a hex string to bytes (getMemoizedBase16Codec)', () => { + const codec = getMemoizedBase16Codec(); + expect(codec.encode('ff')).toEqual(new Uint8Array([255])); + }); + + test('should encode a base58 string to bytes (getMemoizedBase58Codec)', () => { + const codec = getMemoizedBase58Codec(); + expect(codec.encode('1')).toEqual(new Uint8Array([0])); + }); + + test('should encode a base64 string to bytes (getMemoizedBase64Codec)', () => { + const codec = getMemoizedBase64Codec(); + expect(codec.encode('AQ==')).toEqual(new Uint8Array([1])); + }); +}); diff --git a/packages/dynamic-client/test/unit/shared/types.test.ts b/packages/dynamic-client/test/unit/shared/types.test.ts new file mode 100644 index 000000000..135ef48cf --- /dev/null +++ b/packages/dynamic-client/test/unit/shared/types.test.ts @@ -0,0 +1,76 @@ +import type { Address } from '@solana/addresses'; +import type { Instruction } from '@solana/instructions'; +import { describe, expectTypeOf, test } from 'vitest'; + +import type { AddressInput } from '../../../src/shared/address'; +import type { + AccountsInput, + ArgumentsInput, + BuildIxFn, + EitherSigners, + ResolverFn, + ResolversInput, +} from '../../../src/shared/types'; + +describe('AccountsInput', () => { + test('should accept partial record of string to AddressInput | null', () => { + expectTypeOf().toExtend>>(); + }); + + test('should allow null values for optional accounts', () => { + expectTypeOf<{ mint: null }>().toExtend(); + }); + + test('should allow AddressInput values', () => { + expectTypeOf<{ mint: Address }>().toExtend(); + }); + + test('should allow partial (missing keys)', () => { + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + expectTypeOf<{}>().toExtend(); + }); +}); + +describe('ArgumentsInput', () => { + test('should accept partial record of string to unknown', () => { + expectTypeOf().toExtend>>(); + }); + + test('should allow any value types', () => { + expectTypeOf<{ amount: bigint; name: string }>().toExtend(); + }); +}); + +describe('EitherSigners', () => { + test('should be an array of strings', () => { + expectTypeOf().toEqualTypeOf(); + }); +}); + +describe('ResolverFn', () => { + test('should accept arguments and accounts input and return Promise', () => { + expectTypeOf().toBeFunction(); + expectTypeOf().parameters.toEqualTypeOf<[ArgumentsInput, AccountsInput]>(); + expectTypeOf().returns.toEqualTypeOf>(); + }); +}); + +describe('ResolversInput', () => { + test('should be a record of string to ResolverFn', () => { + expectTypeOf().toEqualTypeOf>(); + }); +}); + +describe('BuildIxFn', () => { + test('should return a Promise of Instruction', () => { + expectTypeOf().returns.toEqualTypeOf>(); + }); + + test('should allow calling with no arguments', () => { + expectTypeOf().toBeCallableWith(); + }); + + test('should accept all four parameters', () => { + expectTypeOf().toBeCallableWith({}, {}, [], {}); + }); +}); diff --git a/packages/dynamic-client/test/unit/shared/util.test.ts b/packages/dynamic-client/test/unit/shared/util.test.ts new file mode 100644 index 000000000..ca929c29a --- /dev/null +++ b/packages/dynamic-client/test/unit/shared/util.test.ts @@ -0,0 +1,105 @@ +import { describe, expect, expectTypeOf, test } from 'vitest'; + +import { formatValueType, isObjectRecord, safeStringify } from '../../../src/shared/util'; + +describe('isObjectRecord', () => { + test('should return true for plain objects', () => { + expect(isObjectRecord({})).toBe(true); + expect(isObjectRecord({ key: 'value' })).toBe(true); + }); + + test('should narrow type to Record', () => { + const value: unknown = { key: 'value' }; + if (isObjectRecord(value)) { + expectTypeOf(value).toExtend>(); + } + }); + + test('should return false for null', () => { + expect(isObjectRecord(null)).toBe(false); + }); + + test('should return false for arrays', () => { + expect(isObjectRecord([1, 2, 3])).toBe(false); + }); + + test('should return false for primitives', () => { + expect(isObjectRecord('string')).toBe(false); + expect(isObjectRecord(42)).toBe(false); + expect(isObjectRecord(true)).toBe(false); + expect(isObjectRecord(undefined)).toBe(false); + }); + + test('should return false for class instances', () => { + expect(isObjectRecord(new Date())).toBe(false); + expect(isObjectRecord(new Map())).toBe(false); + }); + + test('should return false for Uint8Array', () => { + expect(isObjectRecord(new Uint8Array([1, 2]))).toBe(false); + }); +}); + +describe('formatValueType', () => { + test('should return "null" for null', () => { + expect(formatValueType(null)).toBe('null'); + }); + + test('should return array description with length', () => { + expect(formatValueType([1, 2, 3])).toBe('array (length 3)'); + expect(formatValueType([])).toBe('array (length 0)'); + }); + + test('should return Uint8Array description with length', () => { + expect(formatValueType(new Uint8Array([1, 2]))).toBe('Uint8Array (length 2)'); + expect(formatValueType(new Uint8Array())).toBe('Uint8Array (length 0)'); + }); + + test('should return "object" for plain objects', () => { + expect(formatValueType({ key: 'value' })).toBe('object'); + }); + + test('should return "object" for class instances', () => { + expect(formatValueType(new Date())).toBe('object'); + }); + + test('should return typeof for primitives', () => { + expect(formatValueType('hello')).toBe('string'); + expect(formatValueType(42)).toBe('number'); + expect(formatValueType(true)).toBe('boolean'); + expect(formatValueType(undefined)).toBe('undefined'); + expect(formatValueType(42n)).toBe('bigint'); + }); +}); + +describe('safeStringify', () => { + test('should stringify plain objects', () => { + expect(safeStringify({ a: 1 })).toBe('{"a":1}'); + }); + + test('should stringify arrays', () => { + expect(safeStringify([1, 2, 3])).toBe('[1,2,3]'); + }); + + test('should stringify primitives', () => { + expect(safeStringify('hello')).toBe('"hello"'); + expect(safeStringify(42)).toBe('42'); + expect(safeStringify(null)).toBe('null'); + expect(safeStringify(true)).toBe('true'); + }); + + test('should convert BigInt to string', () => { + expect(safeStringify(42n)).toBe('"42"'); + expect(safeStringify({ amount: 1000n })).toBe('{"amount":"1000"}'); + }); + + test('should return non-serializable object for circular references', () => { + const circular: Record = {}; + circular.self = circular; + expect(safeStringify(circular)).toBe('non-serializable object'); + }); + + test('should always return a string', () => { + expectTypeOf(safeStringify).returns.toBeString(); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/account-default-value-test-utils.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/account-default-value-test-utils.ts new file mode 100644 index 000000000..71ed0fb0e --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/account-default-value-test-utils.ts @@ -0,0 +1,31 @@ +import { address } from '@solana/addresses'; +import type { InstructionAccountNode } from 'codama'; +import { instructionAccountNode, instructionNode, programNode, rootNode } from 'codama'; + +import { createAccountDefaultValueVisitor } from '../../../../src/instruction-encoding/visitors/account-default-value'; + +export const programAddress = address('11111111111111111111111111111111'); +export const rootNodeMock = rootNode(programNode({ name: 'test', publicKey: programAddress })); + +export const ixNodeStub = instructionNode({ name: 'testInstruction' }); + +export const ixAccountNodeStub: InstructionAccountNode = instructionAccountNode({ + isOptional: false, + isSigner: false, + isWritable: false, + name: 'testAccount', +}); + +export function makeVisitor(overrides?: Partial[0]>) { + return createAccountDefaultValueVisitor({ + accountAddressInput: undefined, + accountsInput: undefined, + argumentsInput: undefined, + ixAccountNode: ixAccountNodeStub, + ixNode: ixNodeStub, + resolutionPath: [], + resolversInput: undefined, + root: rootNodeMock, + ...overrides, + }); +} diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/accountBumpValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/accountBumpValueNode.test.ts new file mode 100644 index 000000000..869fd0ebd --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/accountBumpValueNode.test.ts @@ -0,0 +1,13 @@ +import { accountBumpValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitAccountBumpValue', () => { + test('should throw "not yet supported"', async () => { + const visitor = makeVisitor(); + await expect(visitor.visitAccountBumpValue(accountBumpValueNode('seed'))).rejects.toThrow( + /Unsupported node kind \[accountBumpValueNode\]/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/accountValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/accountValueNode.test.ts new file mode 100644 index 000000000..82d81c0dc --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/accountValueNode.test.ts @@ -0,0 +1,86 @@ +import { accountValueNode, instructionAccountNode, instructionNode, publicKeyValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitAccountValue', async () => { + const refAddress = await SvmTestContext.generateAddress(); + const ixNodeWithAccount = instructionNode({ + accounts: [ + instructionAccountNode({ + isOptional: false, + isSigner: false, + isWritable: false, + name: 'refAccount', + }), + ], + name: 'testInstruction', + }); + + test('should return address when user provides address in accountsInput', async () => { + const visitor = makeVisitor({ + accountsInput: { refAccount: refAddress }, + ixNode: ixNodeWithAccount, + }); + const result = await visitor.visitAccountValue(accountValueNode('refAccount')); + expect(result).toBe(refAddress); + }); + + test('should return null for optional account with null input and omitted strategy', async () => { + const ixNodeWithOptional = instructionNode({ + accounts: [ + instructionAccountNode({ + isOptional: true, + isSigner: false, + isWritable: false, + name: 'refAccount', + }), + ], + name: 'testInstruction', + optionalAccountStrategy: 'omitted', + }); + const visitor = makeVisitor({ + accountsInput: { refAccount: null }, + ixNode: ixNodeWithOptional, + }); + const result = await visitor.visitAccountValue(accountValueNode('refAccount')); + expect(result).toBeNull(); + }); + + test('should resolve referenced account defaultValue', async () => { + const expectedDefaultAddress = await SvmTestContext.generateAddress(); + const ixNodeWithDefault = instructionNode({ + accounts: [ + instructionAccountNode({ + defaultValue: publicKeyValueNode(expectedDefaultAddress), + isOptional: false, + isSigner: false, + isWritable: false, + name: 'refAccount', + }), + ], + name: 'testInstruction', + }); + const visitor = makeVisitor({ ixNode: ixNodeWithDefault }); + const result = await visitor.visitAccountValue(accountValueNode('refAccount')); + expect(result).toBe(expectedDefaultAddress); + }); + + test('should throw for unknown account reference', async () => { + const visitor = makeVisitor(); + await expect(visitor.visitAccountValue(accountValueNode('unknown'))).rejects.toThrow( + /Referenced node \[unknown\] not found in \[testInstruction\]/, + ); + }); + + test('should throw on circular dependency', async () => { + const visitor = makeVisitor({ + ixNode: ixNodeWithAccount, + resolutionPath: ['refAccount'], + }); + await expect(visitor.visitAccountValue(accountValueNode('refAccount'))).rejects.toThrow( + /Circular dependency detected: \[/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/argumentValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/argumentValueNode.test.ts new file mode 100644 index 000000000..8462e019c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/argumentValueNode.test.ts @@ -0,0 +1,40 @@ +import { argumentValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitArgumentValue', () => { + test('should return address from argument value', async () => { + const addr = await SvmTestContext.generateAddress(); + const visitor = makeVisitor({ argumentsInput: { myArg: addr } }); + const result = await visitor.visitArgumentValue(argumentValueNode('myArg')); + expect(result).toBe(addr); + }); + + test('should throw when argument is missing', async () => { + const visitor = makeVisitor({ argumentsInput: {} }); + await expect(visitor.visitArgumentValue(argumentValueNode('myArg'))).rejects.toThrow( + /Missing argument \[myArg\] in \[testInstruction\]/, + ); + }); + + test('should throw when argument is null', async () => { + const visitor = makeVisitor({ argumentsInput: { myArg: null } }); + await expect(visitor.visitArgumentValue(argumentValueNode('myArg'))).rejects.toThrow( + /Missing argument \[myArg\] in \[testInstruction\]/, + ); + }); + + test('should throw when argument cannot be converted to Address', async () => { + const visitors: ReturnType[] = [ + makeVisitor({ argumentsInput: { myArg: 'not-a-valid-base58' } }), + makeVisitor({ argumentsInput: { myArg: { a: 42 } } }), + ]; + for (const visitor of visitors) { + await expect(visitor.visitArgumentValue(argumentValueNode('myArg'))).rejects.toThrow( + /Expected \[Address \| PublicKey\] for account \[testAccount\]/, + ); + } + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/conditionalValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/conditionalValueNode.test.ts new file mode 100644 index 000000000..e12f6f084 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/conditionalValueNode.test.ts @@ -0,0 +1,111 @@ +import { + argumentValueNode, + conditionalValueNode, + instructionAccountNode, + numberValueNode, + publicKeyValueNode, + resolverValueNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { ixAccountNodeStub, makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitConditionalValue', async () => { + const ifTrueAddress = await SvmTestContext.generateAddress(); + const ifFalseAddress = await SvmTestContext.generateAddress(); + + test('should resolve ifTrue branch when argument condition is truthy', async () => { + const node = conditionalValueNode({ + condition: argumentValueNode('flag'), + ifTrue: publicKeyValueNode(ifTrueAddress), + }); + const visitor = makeVisitor({ argumentsInput: { flag: true } }); + const result = await visitor.visitConditionalValue(node); + expect(result).toBe(ifTrueAddress); + }); + + test('should resolve ifFalse branch when argument condition is falsy', async () => { + const node = conditionalValueNode({ + condition: argumentValueNode('flag'), + ifFalse: publicKeyValueNode(ifFalseAddress), + ifTrue: publicKeyValueNode(ifTrueAddress), + }); + const visitor = makeVisitor({ argumentsInput: { flag: false } }); + const result = await visitor.visitConditionalValue(node); + expect(result).toBe(ifFalseAddress); + }); + + test('should return null for optional account when no ifFalse and condition is falsy', async () => { + const optionalAccountNode = instructionAccountNode({ + isOptional: true, + isSigner: false, + isWritable: false, + name: 'optionalAccount', + }); + const node = conditionalValueNode({ + condition: argumentValueNode('flag'), + ifTrue: publicKeyValueNode(ifTrueAddress), + }); + const visitor = makeVisitor({ + argumentsInput: { flag: false }, + ixAccountNode: optionalAccountNode, + }); + const result = await visitor.visitConditionalValue(node); + expect(result).toBeNull(); + }); + + test('should throw for required account when no ifFalse and condition is falsy', async () => { + const node = conditionalValueNode({ + condition: argumentValueNode('flag'), + ifTrue: publicKeyValueNode(ifTrueAddress), + }); + const visitor = makeVisitor({ + argumentsInput: { flag: false }, + ixAccountNode: { + ...ixAccountNodeStub, + isOptional: false, + }, + }); + await expect(visitor.visitConditionalValue(node)).rejects.toThrow(/Missing account \[/); + }); + + test('should resolve ifTrue when primitive value matches', async () => { + const node = conditionalValueNode({ + condition: argumentValueNode('tokenStandard'), + ifFalse: publicKeyValueNode(ifFalseAddress), + ifTrue: publicKeyValueNode(ifTrueAddress), + value: numberValueNode(0), + }); + const visitor = makeVisitor({ argumentsInput: { tokenStandard: 0 } }); + const result = await visitor.visitConditionalValue(node); + expect(result).toBe(ifTrueAddress); + }); + + test('should resolve ifFalse when value does not match', async () => { + const node = conditionalValueNode({ + condition: argumentValueNode('tokenStandard'), + ifFalse: publicKeyValueNode(ifFalseAddress), + ifTrue: publicKeyValueNode(ifTrueAddress), + value: numberValueNode(0), + }); + const visitor = makeVisitor({ argumentsInput: { tokenStandard: 1 } }); + const result = await visitor.visitConditionalValue(node); + expect(result).toBe(ifFalseAddress); + }); + + test('should resolve with resolver condition', async () => { + const nodeWithTrue = conditionalValueNode({ + condition: resolverValueNode('myResolver'), + ifFalse: publicKeyValueNode(ifFalseAddress), + ifTrue: publicKeyValueNode(ifTrueAddress), + }); + const visitorWithTrue = makeVisitor({ resolversInput: { myResolver: () => Promise.resolve(true) } }); + const result = await visitorWithTrue.visitConditionalValue(nodeWithTrue); + expect(result).toBe(ifTrueAddress); + + const visitorWithFalse = makeVisitor({ resolversInput: { myResolver: () => Promise.resolve(false) } }); + const resultFalse = await visitorWithFalse.visitConditionalValue(nodeWithTrue); + expect(resultFalse).toBe(ifFalseAddress); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/identityValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/identityValueNode.test.ts new file mode 100644 index 000000000..1cae2d701 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/identityValueNode.test.ts @@ -0,0 +1,28 @@ +import { identityValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitIdentityValue', () => { + test('should return provided address', async () => { + const addr = await SvmTestContext.generateAddress(); + const visitor = makeVisitor({ accountAddressInput: addr }); + const result = await visitor.visitIdentityValue(identityValueNode()); + expect(result).toBe(addr); + }); + + test('should throw when address not provided (undefined)', async () => { + const visitor = makeVisitor({ accountAddressInput: undefined }); + await expect(visitor.visitIdentityValue(identityValueNode())).rejects.toThrow( + /Missing account \[testAccount\]/, + ); + }); + + test('should throw when address not provided (null)', async () => { + const visitor = makeVisitor({ accountAddressInput: null }); + await expect(visitor.visitIdentityValue(identityValueNode())).rejects.toThrow( + /Missing account \[testAccount\]/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/payerValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/payerValueNode.test.ts new file mode 100644 index 000000000..f853a9e5b --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/payerValueNode.test.ts @@ -0,0 +1,24 @@ +import { payerValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitPayerValue', () => { + test('should return provided address', async () => { + const addr = await SvmTestContext.generateAddress(); + const visitor = makeVisitor({ accountAddressInput: addr }); + const result = await visitor.visitPayerValue(payerValueNode()); + expect(result).toBe(addr); + }); + + test('should throw when address not provided (undefined)', async () => { + const visitor = makeVisitor({ accountAddressInput: undefined }); + await expect(visitor.visitPayerValue(payerValueNode())).rejects.toThrow(/Missing account \[testAccount\]/); + }); + + test('should throw when address not provided (null)', async () => { + const visitor = makeVisitor({ accountAddressInput: null }); + await expect(visitor.visitPayerValue(payerValueNode())).rejects.toThrow(/Missing account \[testAccount\]/); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/pdaValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/pdaValueNode.test.ts new file mode 100644 index 000000000..8b130a8bf --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/pdaValueNode.test.ts @@ -0,0 +1,85 @@ +import { getAddressEncoder, getProgramDerivedAddress } from '@solana/addresses'; +import { getUtf8Codec } from '@solana/codecs'; +import { + argumentValueNode, + bytesTypeNode, + constantPdaSeedNode, + instructionArgumentNode, + pdaLinkNode, + pdaNode, + pdaSeedValueNode, + pdaValueNode, + programNode, + publicKeyTypeNode, + rootNode, + stringTypeNode, + stringValueNode, + variablePdaSeedNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { ixNodeStub, makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitPdaValue', async () => { + const testProgramAddress = await SvmTestContext.generateAddress(); + + test('should derive PDA with constant seed', async () => { + const pda = pdaNode({ + name: 'testPda', + seeds: [constantPdaSeedNode(stringTypeNode('utf8'), stringValueNode('prefix'))], + }); + const root = rootNode(programNode({ name: 'test', pdas: [pda], publicKey: testProgramAddress })); + const node = pdaValueNode(pdaLinkNode('testPda')); + + const expectedPda = await getProgramDerivedAddress({ + programAddress: testProgramAddress, + seeds: [getUtf8Codec().encode('prefix')], + }); + + const visitor = makeVisitor({ root }); + const result = await visitor.visitPdaValue(node); + expect(result).toBe(expectedPda[0]); + }); + + test('should derive PDA with variable seed from argument', async () => { + const ownerAddress = await SvmTestContext.generateAddress(); + const pda = pdaNode({ + name: 'testPda', + seeds: [variablePdaSeedNode('owner', publicKeyTypeNode())], + }); + const root = rootNode(programNode({ name: 'test', pdas: [pda], publicKey: testProgramAddress })); + const node = pdaValueNode(pdaLinkNode('testPda'), [pdaSeedValueNode('owner', argumentValueNode('ownerArg'))]); + const ixNode = { + ...ixNodeStub, + arguments: [instructionArgumentNode({ name: 'ownerArg', type: publicKeyTypeNode() })], + }; + + const expectedPda = await getProgramDerivedAddress({ + programAddress: testProgramAddress, + seeds: [getAddressEncoder().encode(ownerAddress)], + }); + + const visitor = makeVisitor({ + argumentsInput: { ownerArg: ownerAddress }, + ixNode, + root, + }); + const result = await visitor.visitPdaValue(node); + expect(result).toBe(expectedPda[0]); + }); + + test('should throw when variable seed value node is missing', async () => { + const pda = pdaNode({ + name: 'testPda', + seeds: [variablePdaSeedNode('owner', bytesTypeNode())], + }); + const root = rootNode(programNode({ name: 'test', pdas: [pda], publicKey: testProgramAddress })); + const node = pdaValueNode(pdaLinkNode('testPda')); + + const visitor = makeVisitor({ root }); + await expect(visitor.visitPdaValue(node)).rejects.toThrow( + /Referenced node \[owner\] not found in \[testInstruction\]/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/programIdValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/programIdValueNode.test.ts new file mode 100644 index 000000000..399511b22 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/programIdValueNode.test.ts @@ -0,0 +1,12 @@ +import { programIdValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor, programAddress } from './account-default-value-test-utils'; + +describe('account-default-value: visitProgramIdValue', () => { + test('should return program public key from root', async () => { + const visitor = makeVisitor(); + const result = await visitor.visitProgramIdValue(programIdValueNode()); + expect(result).toBe(programAddress); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/publicKeyValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/publicKeyValueNode.test.ts new file mode 100644 index 000000000..d843d23bb --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/publicKeyValueNode.test.ts @@ -0,0 +1,14 @@ +import { publicKeyValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitPublicKeyValue', () => { + test('should return public key address', async () => { + const addr = await SvmTestContext.generateAddress(); + const visitor = makeVisitor(); + const result = await visitor.visitPublicKeyValue(publicKeyValueNode(addr)); + expect(result).toBe(addr); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/account-default-value/resolverValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/account-default-value/resolverValueNode.test.ts new file mode 100644 index 000000000..b7298da31 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/account-default-value/resolverValueNode.test.ts @@ -0,0 +1,57 @@ +import { resolverValueNode } from 'codama'; +import { describe, expect, test, vi } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './account-default-value-test-utils'; + +describe('account-default-value: visitResolverValue', () => { + test('should call resolver and return address', async () => { + const addr = await SvmTestContext.generateAddress(); + const visitor = makeVisitor({ + resolversInput: { myResolver: () => Promise.resolve(addr) }, + }); + const result = await visitor.visitResolverValue(resolverValueNode('myResolver')); + expect(result).toBe(addr); + }); + + test('should throw when resolver is not provided', async () => { + const visitor = makeVisitor(); + await expect(visitor.visitResolverValue(resolverValueNode('myResolver'))).rejects.toThrow( + /Resolver \[myResolver\] not provided for account \[testAccount\]/, + ); + }); + + test('should throw when resolver returns null', async () => { + const visitor = makeVisitor({ + resolversInput: { myResolver: () => Promise.resolve(null) }, + }); + await expect(visitor.visitResolverValue(resolverValueNode('myResolver'))).rejects.toThrow( + /Invalid account address \[testAccount\]: \[null\]/, + ); + }); + + test('should throw when resolver returns undefined', async () => { + const visitor = makeVisitor({ + resolversInput: { myResolver: () => Promise.resolve(undefined) }, + }); + await expect(visitor.visitResolverValue(resolverValueNode('myResolver'))).rejects.toThrow( + /Invalid account address \[testAccount\]: \[undefined\]/, + ); + }); + + test('should pass arguments and accounts to resolver', async () => { + const addr = await SvmTestContext.generateAddress(); + const resolverSpy = vi.fn().mockResolvedValue(addr); + const argumentsInput = { amount: 100 }; + const accountsInput = { treasury: addr }; + + const visitor = makeVisitor({ + accountsInput, + argumentsInput, + resolversInput: { myResolver: resolverSpy }, + }); + await visitor.visitResolverValue(resolverValueNode('myResolver')); + + expect(resolverSpy).toHaveBeenCalledWith(argumentsInput, accountsInput); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/condition-node-value/accountValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/condition-node-value/accountValueNode.test.ts new file mode 100644 index 000000000..b9ba535a1 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/condition-node-value/accountValueNode.test.ts @@ -0,0 +1,55 @@ +import { accountValueNode, instructionAccountNode, instructionNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './condition-node-value-test-utils'; + +describe('condition-node-value: visitAccountValue', () => { + const ixNodeWithAccount = instructionNode({ + accounts: [ + instructionAccountNode({ + isOptional: true, + isSigner: false, + isWritable: false, + name: 'myAccount', + }), + ], + name: 'testInstruction', + }); + + test('should return null when user provides null', async () => { + const visitor = makeVisitor({ + accountsInput: { myAccount: null }, + ixNode: ixNodeWithAccount, + }); + const result = await visitor.visitAccountValue(accountValueNode('myAccount')); + expect(result).toBeNull(); + }); + + test('should return address when user provides address', async () => { + const accAddress = await SvmTestContext.generateAddress(); + const visitor = makeVisitor({ + accountsInput: { myAccount: accAddress }, + ixNode: ixNodeWithAccount, + }); + const result = await visitor.visitAccountValue(accountValueNode('myAccount')); + expect(result).toBe(accAddress); + }); + + test('should throw for unknown account reference', async () => { + const visitor = makeVisitor(); + await expect(visitor.visitAccountValue(accountValueNode('unknown'))).rejects.toThrow( + /Referenced node \[unknown\] not found in \[testInstruction\]/, + ); + }); + + test('should throw on circular dependency', async () => { + const visitor = makeVisitor({ + ixNode: ixNodeWithAccount, + resolutionPath: ['myAccount'], + }); + await expect(visitor.visitAccountValue(accountValueNode('myAccount'))).rejects.toThrow( + /Circular dependency detected: \[/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/condition-node-value/argumentValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/condition-node-value/argumentValueNode.test.ts new file mode 100644 index 000000000..ddb8bfaa3 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/condition-node-value/argumentValueNode.test.ts @@ -0,0 +1,18 @@ +import { argumentValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './condition-node-value-test-utils'; + +describe('condition-node-value: visitArgumentValue', () => { + test('should return argument value', async () => { + const visitor = makeVisitor({ argumentsInput: { amount: 42 } }); + const result = await visitor.visitArgumentValue(argumentValueNode('amount')); + expect(result).toBe(42); + }); + + test('should return undefined for missing argument', async () => { + const visitor = makeVisitor({ argumentsInput: {} }); + const result = await visitor.visitArgumentValue(argumentValueNode('amount')); + expect(result).toBeUndefined(); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/condition-node-value/condition-node-value-test-utils.ts b/packages/dynamic-client/test/unit/visitors/condition-node-value/condition-node-value-test-utils.ts new file mode 100644 index 000000000..32f146b1c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/condition-node-value/condition-node-value-test-utils.ts @@ -0,0 +1,18 @@ +import { instructionNode, programNode, rootNode } from 'codama'; + +import { createConditionNodeValueVisitor } from '../../../../src/instruction-encoding/visitors/condition-node-value'; + +const rootNodeMock = rootNode(programNode({ name: 'test', publicKey: '11111111111111111111111111111111' })); +const ixNodeStub = instructionNode({ name: 'testInstruction' }); + +export function makeVisitor(overrides?: Partial[0]>) { + return createConditionNodeValueVisitor({ + accountsInput: undefined, + argumentsInput: undefined, + ixNode: ixNodeStub, + resolutionPath: [], + resolversInput: undefined, + root: rootNodeMock, + ...overrides, + }); +} diff --git a/packages/dynamic-client/test/unit/visitors/condition-node-value/resolverValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/condition-node-value/resolverValueNode.test.ts new file mode 100644 index 000000000..456224e50 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/condition-node-value/resolverValueNode.test.ts @@ -0,0 +1,55 @@ +import { resolverValueNode } from 'codama'; +import { describe, expect, test, vi } from 'vitest'; + +import { makeVisitor } from './condition-node-value-test-utils'; + +describe('condition-node-value: visitResolverValue', () => { + test('should return undefined when resolversInput is undefined', async () => { + const visitor = makeVisitor(); + const result = await visitor.visitResolverValue(resolverValueNode('myResolver')); + expect(result).toBeUndefined(); + }); + + test('should return undefined when resolver not in the resolversInput', async () => { + const visitor = makeVisitor({ resolversInput: {} }); + const result = await visitor.visitResolverValue(resolverValueNode('myResolver')); + expect(result).toBeUndefined(); + }); + + test('should call resolver and return result', async () => { + const visitor = makeVisitor({ + resolversInput: { myResolver: async () => await Promise.resolve(999) }, + }); + const result = await visitor.visitResolverValue(resolverValueNode('myResolver')); + expect(result).toBe(999); + }); + + test('should throw ResolverError when resolver throws', async () => { + const visitor = makeVisitor({ + resolversInput: { + myResolver: () => { + throw new Error('some error'); + }, + }, + }); + await expect(visitor.visitResolverValue(resolverValueNode('myResolver'))).rejects.toThrow( + /Resolver \[myResolver\] threw an error while resolving \[conditionalValueNode\] \[myResolver\]/, + ); + }); + + test('should pass arguments and accounts to resolver', async () => { + const resolverSpy = vi.fn().mockReturnValue('resolved'); + const argumentsInput = { amount: 100 }; + const accountsInput = { treasury: null }; + + const visitor = makeVisitor({ + accountsInput, + argumentsInput, + resolversInput: { myResolver: resolverSpy }, + }); + const result = await visitor.visitResolverValue(resolverValueNode('myResolver')); + + expect(result).toBe('resolved'); + expect(resolverSpy).toHaveBeenCalledWith(argumentsInput, accountsInput); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/booleanValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/booleanValueNode.test.ts new file mode 100644 index 000000000..0b118edf4 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/booleanValueNode.test.ts @@ -0,0 +1,19 @@ +import { getBooleanCodec } from '@solana/codecs'; +import { booleanTypeNode, booleanValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitBooleanValue', () => { + test('should encode true', () => { + const visitor = makeVisitor(booleanTypeNode()); + const result = visitor.visitBooleanValue(booleanValueNode(true)); + expect(result).toEqual(getBooleanCodec().encode(true)); + }); + + test('should encode false', () => { + const visitor = makeVisitor(booleanTypeNode()); + const result = visitor.visitBooleanValue(booleanValueNode(false)); + expect(result).toEqual(getBooleanCodec().encode(false)); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/bytesValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/bytesValueNode.test.ts new file mode 100644 index 000000000..0ef54b9a1 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/bytesValueNode.test.ts @@ -0,0 +1,33 @@ +import { getBase16Codec, getBase58Codec, getUtf8Codec } from '@solana/codecs'; +import { bytesTypeNode, bytesValueNode, fixedSizeTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitBytesValue', () => { + test('should encode base16 bytes', () => { + const visitor = makeVisitor(fixedSizeTypeNode(bytesTypeNode(), 4)); + const result = visitor.visitBytesValue(bytesValueNode('base16', 'deadbeef')); + expect(result).toEqual(getBase16Codec().encode('deadbeef')); + }); + + test('should encode base58 bytes', async () => { + const bs58 = await SvmTestContext.generateAddress(); + const visitor = makeVisitor(fixedSizeTypeNode(bytesTypeNode(), 32)); + const result = visitor.visitBytesValue(bytesValueNode('base58', bs58)); + expect(result).toEqual(getBase58Codec().encode(bs58)); + }); + + test('should encode utf8 bytes', () => { + const visitor = makeVisitor(fixedSizeTypeNode(bytesTypeNode(), 5)); + const result = visitor.visitBytesValue(bytesValueNode('utf8', 'hello')); + expect(result).toEqual(getUtf8Codec().encode('hello')); + }); + + test('should encode empty bytes', () => { + const visitor = makeVisitor(fixedSizeTypeNode(bytesTypeNode(), 0)); + const result = visitor.visitBytesValue(bytesValueNode('base16', '')); + expect(result).toEqual(new Uint8Array(0)); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/default-value-encoder-test-utils.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/default-value-encoder-test-utils.ts new file mode 100644 index 000000000..25fa54cdf --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/default-value-encoder-test-utils.ts @@ -0,0 +1,20 @@ +import { getNodeCodec } from '@codama/dynamic-codecs'; +import type { InstructionArgumentNode, TypeNode } from 'codama'; +import { instructionArgumentNode, instructionNode, programNode, rootNode } from 'codama'; + +import { createDefaultValueEncoderVisitor } from '../../../../src/instruction-encoding/visitors/default-value-encoder'; + +const root = rootNode(programNode({ name: 'test_program', publicKey: '11111111111111111111111111111111' })); + +export function makeVisitor(argType: TypeNode) { + const ixArgNode: InstructionArgumentNode = instructionArgumentNode({ + name: 'testArg', + type: argType, + }); + const ixNode = instructionNode({ + arguments: [ixArgNode], + name: 'testInstruction', + }); + const codec = getNodeCodec([root, root.program, ixNode, ixArgNode]); + return createDefaultValueEncoderVisitor(codec); +} diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/enumValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/enumValueNode.test.ts new file mode 100644 index 000000000..d48683e44 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/enumValueNode.test.ts @@ -0,0 +1,17 @@ +import { enumEmptyVariantTypeNode, enumTypeNode, enumValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitEnumValue', () => { + test('should encode variants', () => { + const visitor = makeVisitor( + enumTypeNode([enumEmptyVariantTypeNode('variantA'), enumEmptyVariantTypeNode('variantB')]), + ); + const variantA = visitor.visitEnumValue(enumValueNode('testEnum', 'variantA')); + expect(variantA).toEqual(new Uint8Array([0])); + + const variantB = visitor.visitEnumValue(enumValueNode('testEnum', 'variantB')); + expect(variantB).toEqual(new Uint8Array([1])); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/noneValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/noneValueNode.test.ts new file mode 100644 index 000000000..e27533673 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/noneValueNode.test.ts @@ -0,0 +1,12 @@ +import { noneValueNode, numberTypeNode, optionTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitNoneValue', () => { + test('should encode none as option prefix byte 0', () => { + const visitor = makeVisitor(optionTypeNode(numberTypeNode('u8'))); + const result = visitor.visitNoneValue(noneValueNode()); + expect(result).toEqual(new Uint8Array([0])); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/numberValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/numberValueNode.test.ts new file mode 100644 index 000000000..e025e4371 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/numberValueNode.test.ts @@ -0,0 +1,36 @@ +import { getU8Codec, getU32Codec } from '@solana/codecs'; +import { numberTypeNode, numberValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitNumberValue', () => { + test('should encode u8 value', () => { + const visitor = makeVisitor(numberTypeNode('u8')); + const result = visitor.visitNumberValue(numberValueNode(42)); + expect(result).toEqual(getU8Codec().encode(42)); + }); + + test('should encode zero', () => { + const visitor = makeVisitor(numberTypeNode('u8')); + const result = visitor.visitNumberValue(numberValueNode(0)); + expect(result).toEqual(getU8Codec().encode(0)); + }); + + test('should encode u32 value', () => { + const visitor = makeVisitor(numberTypeNode('u32')); + const result = visitor.visitNumberValue(numberValueNode(100_000)); + expect(result).toEqual(getU32Codec().encode(100_000)); + }); + + test('should encode max u8 value', () => { + const visitor = makeVisitor(numberTypeNode('u8')); + const result = visitor.visitNumberValue(numberValueNode(255)); + expect(result).toEqual(getU8Codec().encode(255)); + }); + + test('should throw on overflow for u8 value', () => { + const visitor = makeVisitor(numberTypeNode('u8')); + expect(() => visitor.visitNumberValue(numberValueNode(1000))).toThrow(); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/publicKeyValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/publicKeyValueNode.test.ts new file mode 100644 index 000000000..43862552c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/publicKeyValueNode.test.ts @@ -0,0 +1,22 @@ +import { getAddressCodec } from '@solana/addresses'; +import { publicKeyTypeNode, publicKeyValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitPublicKeyValue', () => { + test('should encode public key as 32 bytes', async () => { + const pubkey = await SvmTestContext.generateAddress(); + const visitor = makeVisitor(publicKeyTypeNode()); + const result = visitor.visitPublicKeyValue(publicKeyValueNode(pubkey)); + expect(result).toEqual(getAddressCodec().encode(pubkey)); + expect(result.length).toBe(32); + }); + + test('should throw for invalid public key', () => { + const invalidPubkey = 'not-a-valid-pubkey'; + const visitor = makeVisitor(publicKeyTypeNode()); + expect(() => visitor.visitPublicKeyValue(publicKeyValueNode(invalidPubkey))).toThrow(); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/default-value-encoder/stringValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/default-value-encoder/stringValueNode.test.ts new file mode 100644 index 000000000..ef53e0f42 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/default-value-encoder/stringValueNode.test.ts @@ -0,0 +1,31 @@ +import { getBase16Codec, getBase58Codec, getUtf8Codec } from '@solana/codecs'; +import { fixedSizeTypeNode, stringTypeNode, stringValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './default-value-encoder-test-utils'; + +describe('default-value-encoder: visitStringValue', () => { + test('should encode utf8 string', () => { + const visitor = makeVisitor(fixedSizeTypeNode(stringTypeNode('utf8'), 5)); + const result = visitor.visitStringValue(stringValueNode('hello')); + expect(result).toEqual(getUtf8Codec().encode('hello')); + }); + + test('should encode base16 string', () => { + const visitor = makeVisitor(fixedSizeTypeNode(stringTypeNode('base16'), 4)); + const result = visitor.visitStringValue(stringValueNode('deadbeef')); + expect(result).toEqual(getBase16Codec().encode('deadbeef')); + }); + + test('should encode base58 string', () => { + const visitor = makeVisitor(fixedSizeTypeNode(stringTypeNode('base58'), 3)); + const result = visitor.visitStringValue(stringValueNode('abc')); + expect(result).toEqual(getBase58Codec().encode('abc')); + }); + + test('should encode empty string', () => { + const visitor = makeVisitor(fixedSizeTypeNode(stringTypeNode('utf8'), 0)); + const result = visitor.visitStringValue(stringValueNode('')); + expect(result).toEqual(getUtf8Codec().encode('')); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/amountTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/amountTypeNode.test.ts new file mode 100644 index 000000000..5208c25e0 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/amountTypeNode.test.ts @@ -0,0 +1,13 @@ +import { amountTypeNode, numberTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('amountTypeNode', () => { + test('should delegate to inner number type (pass-through)', () => { + const transformer = createInputValueTransformer(amountTypeNode(numberTypeNode('u64'), 2, 'USD'), rootNodeMock); + expect(transformer(100)).toBe(100); + expect(transformer(0)).toBe(0); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/arrayTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/arrayTypeNode.test.ts new file mode 100644 index 000000000..45fb6ad4f --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/arrayTypeNode.test.ts @@ -0,0 +1,37 @@ +import { arrayTypeNode, bytesTypeNode, numberTypeNode, prefixedCountNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('arrayTypeNode', () => { + test('should transform array items with bytes inner type', () => { + const transformer = createInputValueTransformer( + arrayTypeNode(bytesTypeNode(), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = [new Uint8Array([0x01]), new Uint8Array([0x02])]; + expect(transformer(input)).toEqual([ + ['base16', '01'], + ['base16', '02'], + ]); + }); + + test('should pass through array of primitives', () => { + const transformer = createInputValueTransformer( + arrayTypeNode(numberTypeNode('u8'), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + ); + expect(transformer([1, 2, 3])).toEqual([1, 2, 3]); + }); + + test('should throw for non-array input', () => { + const transformer = createInputValueTransformer( + arrayTypeNode(numberTypeNode('u8'), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + ); + expect(() => transformer('not an array')).toThrow(/Expected \[array\] for \[arrayTypeNode\]/); + expect(() => transformer(42)).toThrow(/Expected \[array\] for \[arrayTypeNode\]/); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/booleanTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/booleanTypeNode.test.ts new file mode 100644 index 000000000..1ae0ad784 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/booleanTypeNode.test.ts @@ -0,0 +1,13 @@ +import { booleanTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('booleanTypeNode', () => { + test('should pass through boolean values', () => { + const transformer = createInputValueTransformer(booleanTypeNode(), rootNodeMock); + expect(transformer(true)).toBe(true); + expect(transformer(false)).toBe(false); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/bytesTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/bytesTypeNode.test.ts new file mode 100644 index 000000000..e36502b61 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/bytesTypeNode.test.ts @@ -0,0 +1,31 @@ +import { bytesTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('bytesTypeNode', () => { + test('should transform Uint8Array or number[] to tuple for bytesTypeNode', () => { + const transformer = createInputValueTransformer(bytesTypeNode(), rootNodeMock, { bytesEncoding: 'base16' }); + + // 'Hello' as bytes: [72, 101, 108, 108, 111] -> base16: '48656c6c6f' + const inputNumbers = [72, 101, 108, 108, 111]; + const inputUint8 = new Uint8Array(inputNumbers); + const resultWithUint8 = transformer(inputUint8); + const resultWithNumbers = transformer(inputNumbers); + const expectedResult = ['base16', '48656c6c6f']; + + expect(resultWithUint8).toEqual(expectedResult); + expect(resultWithNumbers).toEqual(expectedResult); + }); + + test('should throw error for non-Uint8Array input', () => { + const transformer = createInputValueTransformer(bytesTypeNode(), rootNodeMock, { bytesEncoding: 'base16' }); + const expectedMessage = /Expected \[Uint8Array \| number\[\]\] for \[bytesTypeNode\]/; + expect(() => transformer(null)).toThrow(expectedMessage); + expect(() => transformer(undefined)).toThrow(expectedMessage); + expect(() => transformer('not a Uint8Array')).toThrow(expectedMessage); + expect(() => transformer(123)).toThrow(expectedMessage); + expect(() => transformer({ data: [1, 2, 3] })).toThrow(expectedMessage); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/dateTimeTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/dateTimeTypeNode.test.ts new file mode 100644 index 000000000..ce7a6c520 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/dateTimeTypeNode.test.ts @@ -0,0 +1,13 @@ +import { dateTimeTypeNode, numberTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('dateTimeTypeNode', () => { + test('should delegate to inner number type (pass-through)', () => { + const transformer = createInputValueTransformer(dateTimeTypeNode(numberTypeNode('i64')), rootNodeMock); + expect(transformer(1700000000)).toBe(1700000000); + expect(transformer(0)).toBe(0); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/definedTypeLinkNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/definedTypeLinkNode.test.ts new file mode 100644 index 000000000..743f28a9b --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/definedTypeLinkNode.test.ts @@ -0,0 +1,30 @@ +import { definedTypeLinkNode, definedTypeNode, numberTypeNode, programNode, rootNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; + +describe('definedTypeLinkNode', () => { + test('should resolve defined type and delegate', () => { + const root = rootNode( + programNode({ + definedTypes: [definedTypeNode({ name: 'myNumber', type: numberTypeNode('u64') })], + name: 'test', + publicKey: '11111111111111111111111111111111', + }), + ); + const transformer = createInputValueTransformer(definedTypeLinkNode('myNumber'), root); + expect(transformer(42)).toBe(42); + }); + + test('should throw for unknown type name', () => { + const root = rootNode( + programNode({ + name: 'test', + publicKey: '11111111111111111111111111111111', + }), + ); + expect(() => createInputValueTransformer(definedTypeLinkNode('nonExistent'), root)).toThrow( + /Could not find linked node \[nonExistent\] from \[definedTypeLinkNode\]/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/enumTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/enumTypeNode.test.ts new file mode 100644 index 000000000..2beda6377 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/enumTypeNode.test.ts @@ -0,0 +1,265 @@ +import { + arrayTypeNode, + bytesTypeNode, + definedTypeLinkNode, + definedTypeNode, + enumEmptyVariantTypeNode, + enumStructVariantTypeNode, + enumTupleVariantTypeNode, + enumTypeNode, + numberTypeNode, + optionTypeNode, + prefixedCountNode, + programNode, + rootNode, + structFieldTypeNode, + structTypeNode, + tupleTypeNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('enumTypeNode', () => { + // Based on pmp-idl.json, mpl-token-metadata-idl.json, token-2022-idl.json + + test('should pass through scalar enum (number)', () => { + // Based on pmp-idl.json: accountDiscriminator enum + const scalarEnum = enumTypeNode([ + enumEmptyVariantTypeNode('empty'), + enumEmptyVariantTypeNode('buffer'), + enumEmptyVariantTypeNode('metadata'), + ]); + const transformer = createInputValueTransformer(scalarEnum, rootNodeMock); + + expect(transformer(0)).toBe(0); + expect(transformer(1)).toBe(1); + expect(transformer(2)).toBe(2); + }); + + test('should pass through scalar enum (string)', () => { + const scalarEnum = enumTypeNode([enumEmptyVariantTypeNode('initialized'), enumEmptyVariantTypeNode('frozen')]); + const transformer = createInputValueTransformer(scalarEnum, rootNodeMock); + + expect(transformer('initialized')).toBe('initialized'); + expect(transformer('frozen')).toBe('frozen'); + }); + + test('should pass through empty variant enum', () => { + const dataEnum = enumTypeNode([ + enumEmptyVariantTypeNode('none'), + enumEmptyVariantTypeNode('utf8'), + enumEmptyVariantTypeNode('base58'), + ]); + const transformer = createInputValueTransformer(dataEnum, rootNodeMock); + + const input = { __kind: 'none' }; + expect(transformer(input)).toEqual({ __kind: 'None' }); + }); + + test('should transform bytes in struct variant', () => { + // Based on mpl-token-metadata-idl.json: complex enum with struct variants + const enumWithStructVariant = enumTypeNode([ + enumEmptyVariantTypeNode('empty'), + enumStructVariantTypeNode( + 'withData', + structTypeNode([ + structFieldTypeNode({ name: 'id', type: numberTypeNode('u32') }), + structFieldTypeNode({ name: 'data', type: bytesTypeNode() }), + ]), + ), + ]); + + const transformer = createInputValueTransformer(enumWithStructVariant, rootNodeMock, { + bytesEncoding: 'base16', + }); + + const input = { + __kind: 'withData', + data: new Uint8Array([1, 2, 3]), + id: 42, + }; + + expect(transformer(input)).toEqual({ + __kind: 'WithData', + data: ['base16', '010203'], + id: 42, + }); + }); + + test('should transform bytes in tuple variant', () => { + const enumWithTupleVariant = enumTypeNode([ + enumEmptyVariantTypeNode('empty'), + enumTupleVariantTypeNode('withBytes', tupleTypeNode([bytesTypeNode(), numberTypeNode('u8')])), + ]); + + const transformer = createInputValueTransformer(enumWithTupleVariant, rootNodeMock, { + bytesEncoding: 'base16', + }); + + const input = { + __kind: 'withBytes', + fields: [new Uint8Array([0xde, 0xad]), 255], + }; + + expect(transformer(input)).toEqual({ + __kind: 'WithBytes', + fields: [['base16', 'dead'], 255], + }); + }); + + test('should throw on unknown variant', () => { + const enumWithVariants = enumTypeNode([enumEmptyVariantTypeNode('known1'), enumEmptyVariantTypeNode('known2')]); + + const transformer = createInputValueTransformer(enumWithVariants, rootNodeMock); + + const input = { __kind: 'unknownVariant', someData: 123 }; + expect(() => transformer(input)).toThrow(/Expected \[one of \[known1, known2\]\] for \[enumTypeNode\]/); + }); + + test('should pass through non-object input for enumTypeNode', () => { + const enumNode = enumTypeNode([enumEmptyVariantTypeNode('variant1'), enumEmptyVariantTypeNode('variant2')]); + + const transformer = createInputValueTransformer(enumNode, rootNodeMock); + + expect(transformer(null)).toBe(null); + expect(transformer(undefined)).toBe(undefined); + expect(transformer('string')).toBe('string'); + }); + + test('should handle enum without __kind discriminator', () => { + const enumNode = enumTypeNode([enumEmptyVariantTypeNode('variant1')]); + const transformer = createInputValueTransformer(enumNode, rootNodeMock); + + // Object without __kind should pass through + const input = { someField: 'value' }; + expect(transformer(input)).toEqual(input); + }); + + test('should handle nested enum with multiple bytes fields in struct variant', () => { + // Complex real-world scenario + const complexEnum = enumTypeNode([ + enumEmptyVariantTypeNode('none'), + enumStructVariantTypeNode( + 'complex', + structTypeNode([ + structFieldTypeNode({ name: 'id', type: numberTypeNode('u32') }), + structFieldTypeNode({ name: 'key', type: bytesTypeNode() }), + structFieldTypeNode({ name: 'value', type: bytesTypeNode() }), + structFieldTypeNode({ + name: 'nested', + type: optionTypeNode(bytesTypeNode()), + }), + ]), + ), + ]); + + const transformer = createInputValueTransformer(complexEnum, rootNodeMock, { bytesEncoding: 'base16' }); + + const input = { + __kind: 'complex', + id: 100, + key: new Uint8Array([1, 2]), + nested: new Uint8Array([5, 6]), + value: new Uint8Array([3, 4]), + }; + + expect(transformer(input)).toEqual({ + __kind: 'Complex', + id: 100, + key: ['base16', '0102'], + nested: ['base16', '0506'], + value: ['base16', '0304'], + }); + }); + + test('should handle enum with array of bytes in struct variant', () => { + const enumWithArray = enumTypeNode([ + enumStructVariantTypeNode( + 'withArray', + structTypeNode([ + structFieldTypeNode({ + name: 'items', + type: arrayTypeNode(bytesTypeNode(), prefixedCountNode(numberTypeNode('u32'))), + }), + ]), + ), + ]); + + const transformer = createInputValueTransformer(enumWithArray, rootNodeMock, { bytesEncoding: 'base16' }); + + const input = { + __kind: 'withArray', + items: [new Uint8Array([1, 2]), new Uint8Array([3, 4])], + }; + + expect(transformer(input)).toEqual({ + __kind: 'WithArray', + items: [ + ['base16', '0102'], + ['base16', '0304'], + ], + }); + }); + + test('should throw on tuple variant without fields', () => { + const enumWithTuple = enumTypeNode([ + enumTupleVariantTypeNode('tuple', tupleTypeNode([numberTypeNode('u32'), bytesTypeNode()])), + ]); + + const transformer = createInputValueTransformer(enumWithTuple, rootNodeMock, { bytesEncoding: 'base16' }); + + const input = { __kind: 'tuple', someOtherProp: 123 }; + expect(() => transformer(input)).toThrow(/Expected \[array \(fields\)\] for \[enumTupleVariantTypeNode\]/); + }); + + test('should handle deeply nested enum variants', () => { + // Enum containing another enum in struct variant + const innerEnum = enumTypeNode([ + enumEmptyVariantTypeNode('inner1'), + enumStructVariantTypeNode( + 'inner2', + structTypeNode([structFieldTypeNode({ name: 'data', type: bytesTypeNode() })]), + ), + ]); + + const root = rootNode( + programNode({ + definedTypes: [ + definedTypeNode({ + name: 'InnerEnum', + type: innerEnum, + }), + ], + name: 'test', + publicKey: '11111111111111111111111111111111', + }), + ); + + const outerEnum = enumTypeNode([ + enumStructVariantTypeNode( + 'outer', + structTypeNode([structFieldTypeNode({ name: 'inner', type: definedTypeLinkNode('InnerEnum') })]), + ), + ]); + + const transformer = createInputValueTransformer(outerEnum, root, { bytesEncoding: 'base16' }); + + const input = { + __kind: 'outer', + inner: { + __kind: 'inner2', + data: new Uint8Array([0xff, 0xee]), + }, + }; + + expect(transformer(input)).toEqual({ + __kind: 'Outer', + inner: { + __kind: 'Inner2', + data: ['base16', 'ffee'], + }, + }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/fixedSizeTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/fixedSizeTypeNode.test.ts new file mode 100644 index 000000000..a5667f64c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/fixedSizeTypeNode.test.ts @@ -0,0 +1,15 @@ +import { bytesTypeNode, fixedSizeTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('fixedSizeTypeNode', () => { + test('should delegate to inner type (bytes transform visible)', () => { + const transformer = createInputValueTransformer(fixedSizeTypeNode(bytesTypeNode(), 4), rootNodeMock, { + bytesEncoding: 'base16', + }); + const input = new Uint8Array([0xde, 0xad, 0xbe, 0xef]); + expect(transformer(input)).toEqual(['base16', 'deadbeef']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/hiddenPrefixTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/hiddenPrefixTypeNode.test.ts new file mode 100644 index 000000000..6af90de0f --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/hiddenPrefixTypeNode.test.ts @@ -0,0 +1,47 @@ +import { + bytesTypeNode, + bytesValueNode, + constantValueNode, + fixedSizeTypeNode, + hiddenPrefixTypeNode, + numberTypeNode, + stringTypeNode, + stringValueNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('hiddenPrefixTypeNode', () => { + test('should delegate to inner type [bytesTypeNode]', () => { + const transformer = createInputValueTransformer( + hiddenPrefixTypeNode(bytesTypeNode(), [constantValueNode(bytesTypeNode(), bytesValueNode('base16', 'ff'))]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = new Uint8Array([0x01, 0x02]); + expect(transformer(input)).toEqual(['base16', '0102']); + }); + + test('should delegate to inner type [numberTypeNode]', () => { + const transformer = createInputValueTransformer( + hiddenPrefixTypeNode(numberTypeNode('u32'), [ + constantValueNode(bytesTypeNode(), bytesValueNode('base16', 'ffff')), + ]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + expect(transformer(42)).toEqual(42); + }); + + test('should delegate to inner type [stringTypeNode]', () => { + const transformer = createInputValueTransformer( + hiddenPrefixTypeNode(fixedSizeTypeNode(stringTypeNode('utf8'), 10), [ + constantValueNode(stringTypeNode('utf8'), stringValueNode('Hello')), + ]), + rootNodeMock, + ); + expect(transformer('World')).toEqual('World'); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/hiddenSuffixTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/hiddenSuffixTypeNode.test.ts new file mode 100644 index 000000000..650f45f1b --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/hiddenSuffixTypeNode.test.ts @@ -0,0 +1,28 @@ +import { bytesTypeNode, bytesValueNode, constantValueNode, hiddenSuffixTypeNode, numberTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('hiddenSuffixTypeNode', () => { + test('should delegate to inner type', () => { + const transformer = createInputValueTransformer( + hiddenSuffixTypeNode(bytesTypeNode(), [constantValueNode(bytesTypeNode(), bytesValueNode('base16', 'ff'))]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = new Uint8Array([0x01, 0x02]); + expect(transformer(input)).toEqual(['base16', '0102']); + }); + + test('should delegate to inner type [numberTypeNode]', () => { + const transformer = createInputValueTransformer( + hiddenSuffixTypeNode(numberTypeNode('u32'), [ + constantValueNode(bytesTypeNode(), bytesValueNode('base16', 'ffff')), + ]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + expect(transformer(42)).toEqual(42); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/input-value-transformer-test-utils.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/input-value-transformer-test-utils.ts new file mode 100644 index 000000000..554288693 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/input-value-transformer-test-utils.ts @@ -0,0 +1,9 @@ +import { programNode, rootNode } from 'codama'; + +// Shared root node mock for tests +export const rootNodeMock = rootNode( + programNode({ + name: 'test', + publicKey: '11111111111111111111111111111111', + }), +); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/mapTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/mapTypeNode.test.ts new file mode 100644 index 000000000..1d37f6199 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/mapTypeNode.test.ts @@ -0,0 +1,34 @@ +import { bytesTypeNode, mapTypeNode, numberTypeNode, prefixedCountNode, stringTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('mapTypeNode', () => { + test('should transform map values with bytes inner type', () => { + const transformer = createInputValueTransformer( + mapTypeNode(stringTypeNode('utf8'), bytesTypeNode(), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = { key1: new Uint8Array([0x01]), key2: new Uint8Array([0x02]) }; + expect(transformer(input)).toEqual({ key1: ['base16', '01'], key2: ['base16', '02'] }); + }); + + test('should pass through map with primitive values', () => { + const transformer = createInputValueTransformer( + mapTypeNode(stringTypeNode('utf8'), numberTypeNode('u64'), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + ); + expect(transformer({ a: 1, b: 2 })).toEqual({ a: 1, b: 2 }); + }); + + test('should throw for non-object input', () => { + const transformer = createInputValueTransformer( + mapTypeNode(stringTypeNode('utf8'), numberTypeNode('u8'), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + ); + expect(() => transformer('not an object')).toThrow(/Expected \[object\] for \[mapTypeNode\]/); + expect(() => transformer([1, 2])).toThrow(/Expected \[object\] for \[mapTypeNode\]/); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/numberTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/numberTypeNode.test.ts new file mode 100644 index 000000000..5e0ed19c5 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/numberTypeNode.test.ts @@ -0,0 +1,15 @@ +import { numberTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('numberTypeNode', () => { + test('should pass through number values', () => { + const transformer = createInputValueTransformer(numberTypeNode('u64'), rootNodeMock); + expect(transformer(0)).toBe(0); + expect(transformer(42)).toBe(42); + expect(transformer(999)).toBe(999); + expect(transformer(Number.MAX_SAFE_INTEGER)).toBe(Number.MAX_SAFE_INTEGER); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/optionTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/optionTypeNode.test.ts new file mode 100644 index 000000000..79b8fe4b3 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/optionTypeNode.test.ts @@ -0,0 +1,25 @@ +import { bytesTypeNode, numberTypeNode, optionTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('optionTypeNode', () => { + test('should pass through null and undefined', () => { + const transformer = createInputValueTransformer( + optionTypeNode(numberTypeNode('u8'), { prefix: numberTypeNode('u8') }), + rootNodeMock, + ); + expect(transformer(null)).toBe(null); + expect(transformer(undefined)).toBe(undefined); + }); + + test('should transform non-null inner value', () => { + const transformer = createInputValueTransformer( + optionTypeNode(bytesTypeNode(), { prefix: numberTypeNode('u8') }), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + expect(transformer(new Uint8Array([0xff]))).toEqual(['base16', 'ff']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/postOffsetTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/postOffsetTypeNode.test.ts new file mode 100644 index 000000000..4382ebdf2 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/postOffsetTypeNode.test.ts @@ -0,0 +1,20 @@ +import { bytesTypeNode, numberTypeNode, postOffsetTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('postOffsetTypeNode', () => { + test('should delegate to inner type [bytesTypeNode]', () => { + const transformer = createInputValueTransformer(postOffsetTypeNode(bytesTypeNode(), 0), rootNodeMock, { + bytesEncoding: 'base16', + }); + const input = new Uint8Array([0xab, 0xcd]); + expect(transformer(input)).toEqual(['base16', 'abcd']); + }); + + test('should delegate to inner type [numberTypeNode]', () => { + const transformer = createInputValueTransformer(postOffsetTypeNode(numberTypeNode('u32'), 0), rootNodeMock); + expect(transformer(42)).toEqual(42); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/preOffsetTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/preOffsetTypeNode.test.ts new file mode 100644 index 000000000..85ac4de64 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/preOffsetTypeNode.test.ts @@ -0,0 +1,15 @@ +import { bytesTypeNode, preOffsetTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('preOffsetTypeNode', () => { + test('should delegate to inner type', () => { + const transformer = createInputValueTransformer(preOffsetTypeNode(bytesTypeNode(), 0), rootNodeMock, { + bytesEncoding: 'base16', + }); + const input = new Uint8Array([0xab, 0xcd]); + expect(transformer(input)).toEqual(['base16', 'abcd']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/publicKeyTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/publicKeyTypeNode.test.ts new file mode 100644 index 000000000..717f53bd1 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/publicKeyTypeNode.test.ts @@ -0,0 +1,20 @@ +import { publicKeyTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { SvmTestContext } from '../../../svm-test-context'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('publicKeyTypeNode', () => { + test('should pass through public key string', async () => { + const transformer = createInputValueTransformer(publicKeyTypeNode(), rootNodeMock); + const pubkey = await SvmTestContext.generateAddress(); + expect(transformer(pubkey)).toBe(pubkey); + }); + + test('should pass through any value unchanged', () => { + const transformer = createInputValueTransformer(publicKeyTypeNode(), rootNodeMock); + expect(transformer(null)).toBe(null); + expect(transformer(123)).toBe(123); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/remainderOptionTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/remainderOptionTypeNode.test.ts new file mode 100644 index 000000000..0b209ecfd --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/remainderOptionTypeNode.test.ts @@ -0,0 +1,20 @@ +import { bytesTypeNode, remainderOptionTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('remainderOptionTypeNode', () => { + test('should pass through null and undefined', () => { + const transformer = createInputValueTransformer(remainderOptionTypeNode(bytesTypeNode()), rootNodeMock); + expect(transformer(null)).toBe(null); + expect(transformer(undefined)).toBe(undefined); + }); + + test('should transform non-null inner value', () => { + const transformer = createInputValueTransformer(remainderOptionTypeNode(bytesTypeNode()), rootNodeMock, { + bytesEncoding: 'base16', + }); + expect(transformer(new Uint8Array([0xab]))).toEqual(['base16', 'ab']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/sentinelTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/sentinelTypeNode.test.ts new file mode 100644 index 000000000..266c8d436 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/sentinelTypeNode.test.ts @@ -0,0 +1,17 @@ +import { bytesTypeNode, bytesValueNode, constantValueNode, sentinelTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('sentinelTypeNode', () => { + test('should delegate to inner type', () => { + const transformer = createInputValueTransformer( + sentinelTypeNode(bytesTypeNode(), constantValueNode(bytesTypeNode(), bytesValueNode('base16', 'ff'))), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = new Uint8Array([0xab, 0xcd]); + expect(transformer(input)).toEqual(['base16', 'abcd']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/setTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/setTypeNode.test.ts new file mode 100644 index 000000000..493728bf1 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/setTypeNode.test.ts @@ -0,0 +1,29 @@ +import { bytesTypeNode, numberTypeNode, prefixedCountNode, setTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('setTypeNode', () => { + test('should transform set items with bytes inner type', () => { + const transformer = createInputValueTransformer( + setTypeNode(bytesTypeNode(), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = [new Uint8Array([0xaa]), new Uint8Array([0xbb])]; + expect(transformer(input)).toEqual([ + ['base16', 'aa'], + ['base16', 'bb'], + ]); + }); + + test('should throw for non-array input', () => { + const transformer = createInputValueTransformer( + setTypeNode(numberTypeNode('u8'), prefixedCountNode(numberTypeNode('u32'))), + rootNodeMock, + ); + expect(() => transformer('not an array')).toThrow(/Expected \[array\] for \[setTypeNode\]/); + expect(() => transformer({ a: 1 })).toThrow(/Expected \[array\] for \[setTypeNode\]/); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/sizePrefixTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/sizePrefixTypeNode.test.ts new file mode 100644 index 000000000..ba4bfb04a --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/sizePrefixTypeNode.test.ts @@ -0,0 +1,17 @@ +import { bytesTypeNode, numberTypeNode, sizePrefixTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('sizePrefixTypeNode', () => { + test('should delegate to inner type', () => { + const transformer = createInputValueTransformer( + sizePrefixTypeNode(bytesTypeNode(), numberTypeNode('u32')), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = new Uint8Array([0x01, 0x02]); + expect(transformer(input)).toEqual(['base16', '0102']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/solAmountTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/solAmountTypeNode.test.ts new file mode 100644 index 000000000..85b96a62c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/solAmountTypeNode.test.ts @@ -0,0 +1,13 @@ +import { numberTypeNode, solAmountTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('solAmountTypeNode', () => { + test('should delegate to inner number type (pass-through)', () => { + const transformer = createInputValueTransformer(solAmountTypeNode(numberTypeNode('u64')), rootNodeMock); + expect(transformer(1000000000)).toBe(1000000000); + expect(transformer(0)).toBe(0); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/stringTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/stringTypeNode.test.ts new file mode 100644 index 000000000..2a4fd7c09 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/stringTypeNode.test.ts @@ -0,0 +1,20 @@ +import { stringTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('stringTypeNode', () => { + test('should pass through string values', () => { + const transformer = createInputValueTransformer(stringTypeNode('utf8'), rootNodeMock); + expect(transformer('hello')).toBe('hello'); + expect(transformer('')).toBe(''); + expect(transformer('🎉 unicode')).toBe('🎉 unicode'); + }); + + test('should pass through non-string values unchanged', () => { + const transformer = createInputValueTransformer(stringTypeNode('utf8'), rootNodeMock); + expect(transformer(42)).toBe(42); + expect(transformer(null)).toBe(null); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/structTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/structTypeNode.test.ts new file mode 100644 index 000000000..7090f876a --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/structTypeNode.test.ts @@ -0,0 +1,134 @@ +import { + arrayTypeNode, + bytesTypeNode, + fixedCountNode, + numberTypeNode, + optionTypeNode, + stringTypeNode, + structFieldTypeNode, + structTypeNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('structTypeNode', () => { + test('should transform struct with bytes field', () => { + const transformer = createInputValueTransformer( + structTypeNode([ + structFieldTypeNode({ name: 'name', type: stringTypeNode('utf8') }), + structFieldTypeNode({ name: 'data', type: bytesTypeNode() }), + ]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + + const input = { + data: new Uint8Array([1, 2, 3]), + name: 'test', + }; + + expect(transformer(input)).toEqual({ + data: ['base16', '010203'], + name: 'test', + }); + }); + + test('should transform complex nested structure with bytes in array', () => { + const transformer = createInputValueTransformer( + structTypeNode([ + structFieldTypeNode({ name: 'id', type: numberTypeNode('u32') }), + structFieldTypeNode({ + name: 'items', + type: arrayTypeNode( + structTypeNode([ + structFieldTypeNode({ name: 'name', type: stringTypeNode('utf8') }), + structFieldTypeNode({ name: 'data', type: bytesTypeNode() }), + ]), + fixedCountNode(2), + ), + }), + ]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + + const input = { + id: 123, + items: [ + { data: new Uint8Array([1, 2, 3]), name: 'item1' }, + { data: new Uint8Array([4, 5]), name: 'item2' }, + ], + }; + + expect(transformer(input)).toEqual({ + id: 123, + items: [ + { data: ['base16', '010203'], name: 'item1' }, + { data: ['base16', '0405'], name: 'item2' }, + ], + }); + }); + + test('should throw error for non-object input', () => { + const transformer = createInputValueTransformer( + structTypeNode([structFieldTypeNode({ name: 'data', type: bytesTypeNode() })]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + + expect(() => transformer(null)).toThrow(/Expected \[object\] for \[structTypeNode\]/); + expect(() => transformer(undefined)).toThrow(/Expected \[object\] for \[structTypeNode\]/); + expect(() => transformer('not an object')).toThrow(/Expected \[object\] for \[structTypeNode\]/); + expect(() => transformer(123)).toThrow(/Expected \[object\] for \[structTypeNode\]/); + expect(() => transformer([1, 2, 3])).toThrow(/Expected \[object\] for \[structTypeNode\]/); + }); + + test('should throw error for Date, Map, and Set inputs', () => { + const transformer = createInputValueTransformer( + structTypeNode([structFieldTypeNode({ name: 'data', type: bytesTypeNode() })]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + + expect(() => transformer(new Date())).toThrow(/Expected \[object\] for \[structTypeNode\]/); + expect(() => transformer(new Map())).toThrow(/Expected \[object\] for \[structTypeNode\]/); + expect(() => transformer(new Set())).toThrow(/Expected \[object\] for \[structTypeNode\]/); + }); + + test('should transform multiple bytes fields in struct', () => { + const transformer = createInputValueTransformer( + structTypeNode([ + structFieldTypeNode({ name: 'key', type: bytesTypeNode() }), + structFieldTypeNode({ name: 'value', type: bytesTypeNode() }), + structFieldTypeNode({ name: 'id', type: numberTypeNode('u32') }), + ]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + + const input = { + id: 999, + key: new Uint8Array([1, 2]), + value: new Uint8Array([3, 4, 5]), + }; + + expect(transformer(input)).toEqual({ + id: 999, + key: ['base16', '0102'], + value: ['base16', '030405'], + }); + }); + + test('should handle struct with missing optional fields', () => { + const structNode = structTypeNode([ + structFieldTypeNode({ name: 'required', type: numberTypeNode('u32') }), + structFieldTypeNode({ name: 'optional', type: optionTypeNode(bytesTypeNode()) }), + ]); + const transformer = createInputValueTransformer(structNode, rootNodeMock, { bytesEncoding: 'base16' }); + + const input = { required: 100 }; + expect(transformer(input)).toEqual({ required: 100 }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/tupleTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/tupleTypeNode.test.ts new file mode 100644 index 000000000..02dcc62a2 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/tupleTypeNode.test.ts @@ -0,0 +1,31 @@ +import { bytesTypeNode, numberTypeNode, tupleTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('tupleTypeNode', () => { + test('should transform each item by position', () => { + const transformer = createInputValueTransformer( + tupleTypeNode([numberTypeNode('u8'), bytesTypeNode()]), + rootNodeMock, + { bytesEncoding: 'base16' }, + ); + const input = [42, new Uint8Array([0xff])]; + expect(transformer(input)).toEqual([42, ['base16', 'ff']]); + }); + + test('should throw for non-array input', () => { + const transformer = createInputValueTransformer(tupleTypeNode([numberTypeNode('u8')]), rootNodeMock); + expect(() => transformer('not an array')).toThrow(/Expected \[array\] for \[tupleTypeNode\]/); + }); + + test('should throw for wrong length', () => { + const transformer = createInputValueTransformer( + tupleTypeNode([numberTypeNode('u8'), numberTypeNode('u16')]), + rootNodeMock, + ); + expect(() => transformer([1])).toThrow(/Expected \[array\(length:2\)\] for \[tupleTypeNode\]/); + expect(() => transformer([1, 2, 3])).toThrow(/Expected \[array\(length:2\)\] for \[tupleTypeNode\]/); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/input-value-transformer/zeroableOptionTypeNode.test.ts b/packages/dynamic-client/test/unit/visitors/input-value-transformer/zeroableOptionTypeNode.test.ts new file mode 100644 index 000000000..c1fe0b0a8 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/input-value-transformer/zeroableOptionTypeNode.test.ts @@ -0,0 +1,20 @@ +import { bytesTypeNode, zeroableOptionTypeNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { createInputValueTransformer } from '../../../../src/instruction-encoding/visitors/input-value-transformer'; +import { rootNodeMock } from './input-value-transformer-test-utils'; + +describe('zeroableOptionTypeNode', () => { + test('should pass through null and undefined', () => { + const transformer = createInputValueTransformer(zeroableOptionTypeNode(bytesTypeNode()), rootNodeMock); + expect(transformer(null)).toBe(null); + expect(transformer(undefined)).toBe(undefined); + }); + + test('should transform non-null inner value', () => { + const transformer = createInputValueTransformer(zeroableOptionTypeNode(bytesTypeNode()), rootNodeMock, { + bytesEncoding: 'base16', + }); + expect(transformer(new Uint8Array([0xcd]))).toEqual(['base16', 'cd']); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/accountValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/accountValueNode.test.ts new file mode 100644 index 000000000..8d28fba22 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/accountValueNode.test.ts @@ -0,0 +1,80 @@ +import { address, getAddressEncoder } from '@solana/addresses'; +import { accountValueNode, instructionAccountNode, instructionNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitAccountValue', () => { + const ixNodeWithAccount = instructionNode({ + accounts: [ + instructionAccountNode({ + isSigner: false, + isWritable: false, + name: 'authority', + }), + ], + name: 'testInstruction', + }); + + test('should encode provided account address', async () => { + const randomAddress = await new SvmTestContext().createAccount(); + const visitor = makeVisitor({ + accountsInput: { authority: randomAddress }, + ixNode: ixNodeWithAccount, + }); + const result = await visitor.visitAccountValue(accountValueNode('authority')); + expect(result).toEqual(getAddressEncoder().encode(address(randomAddress))); + }); + + test('should fall through to resolution when provided address is null', async () => { + const visitor = makeVisitor({ + accountsInput: { authority: null }, + ixNode: ixNodeWithAccount, + }); + // null is not treated as a provided address — it falls through to resolveAccountAddress, + // which throws because the account has no default value + await expect(visitor.visitAccountValue(accountValueNode('authority'))).rejects.toThrow( + /Missing account \[authority\]/, + ); + }); + + test('should throw when resolved address is null', async () => { + const ixNodeWithOptionalAccount = instructionNode({ + accounts: [ + instructionAccountNode({ + isOptional: true, + isSigner: false, + isWritable: false, + name: 'authority', + }), + ], + name: 'testInstruction', + optionalAccountStrategy: 'omitted', + }); + const visitor = makeVisitor({ + accountsInput: { authority: null }, + ixNode: ixNodeWithOptionalAccount, + }); + await expect(visitor.visitAccountValue(accountValueNode('authority'))).rejects.toThrow( + /Failed to derive PDA for account \[authority\]/, + ); + }); + + test('should throw for unknown account reference', async () => { + const visitor = makeVisitor({ ixNode: ixNodeWithAccount }); + await expect(visitor.visitAccountValue(accountValueNode('nonexistent'))).rejects.toThrow( + /Referenced node \[nonexistent\] not found in \[testInstruction\]/, + ); + }); + + test('should throw on circular dependency', async () => { + const visitor = makeVisitor({ + ixNode: ixNodeWithAccount, + resolutionPath: ['authority'], + }); + await expect(visitor.visitAccountValue(accountValueNode('authority'))).rejects.toThrow( + /Circular dependency detected: \[/, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/argumentValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/argumentValueNode.test.ts new file mode 100644 index 000000000..d65ff3420 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/argumentValueNode.test.ts @@ -0,0 +1,138 @@ +import { getUtf8Codec } from '@solana/codecs'; +import { + argumentValueNode, + instructionArgumentNode, + instructionNode, + numberTypeNode, + publicKeyTypeNode, + remainderOptionTypeNode, + sizePrefixTypeNode, + stringTypeNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitArgumentValue', () => { + const ixNodeWithArg = instructionNode({ + arguments: [instructionArgumentNode({ name: 'title', type: stringTypeNode('utf8') })], + name: 'testInstruction', + }); + + test('should encode argument value using its codec', async () => { + const visitor = makeVisitor({ + argumentsInput: { title: 'hello' }, + ixNode: ixNodeWithArg, + }); + const result = await visitor.visitArgumentValue(argumentValueNode('title')); + expect(result).toEqual(getUtf8Codec().encode('hello')); + }); + + test('should use seedTypeNode override instead of argument type', async () => { + // Argument type is sizePrefixTypeNode (u32 length prefix + utf8 string), + // but seedTypeNode overrides it to plain stringTypeNode (raw utf8 bytes only). + // This mirrors how on-chain PDA derivation uses raw string bytes as seeds, + // even when the instruction argument is serialized with a length prefix. + const sizePrefixedArgType = sizePrefixTypeNode(stringTypeNode('utf8'), numberTypeNode('u32')); + const ixNodeWithSizePrefixedArg = instructionNode({ + arguments: [instructionArgumentNode({ name: 'name', type: sizePrefixedArgType })], + name: 'testInstruction', + }); + + const visitor = makeVisitor({ + argumentsInput: { name: 'hello' }, + ixNode: ixNodeWithSizePrefixedArg, + seedTypeNode: stringTypeNode('utf8'), + }); + const result = await visitor.visitArgumentValue(argumentValueNode('name')); + + // Should produce raw utf8 bytes (5 bytes), NOT size-prefixed bytes (4 + 5 = 9 bytes) + const rawUtf8Bytes = getUtf8Codec().encode('hello'); + expect(result).toEqual(rawUtf8Bytes); + expect(result.length).toBe(5); + }); + + test('should throw for unknown argument name', async () => { + const visitor = makeVisitor({ ixNode: ixNodeWithArg }); + await expect(visitor.visitArgumentValue(argumentValueNode('unknown'))).rejects.toThrow( + /Referenced node \[unknown\] not found in \[testInstruction\]/, + ); + }); + + test('should throw when required argument value is undefined', async () => { + const visitor = makeVisitor({ + argumentsInput: {}, + ixNode: ixNodeWithArg, + }); + await expect(visitor.visitArgumentValue(argumentValueNode('title'))).rejects.toThrow( + /Missing argument \[title\]/, + ); + }); + + test('should throw when required argument value is null', async () => { + const visitor = makeVisitor({ + argumentsInput: { title: null }, + ixNode: ixNodeWithArg, + }); + await expect(visitor.visitArgumentValue(argumentValueNode('title'))).rejects.toThrow( + /Missing argument \[title\]/, + ); + }); + + describe('remainderOptionTypeNode seeds', () => { + // Mirrors the pmp IDL's metadata PDA: + // the "authority" seed is remainderOptionTypeNode(publicKeyTypeNode) — null is canonical. + const ixNodeWithOptionalSeed = instructionNode({ + arguments: [ + instructionArgumentNode({ + name: 'authority', + type: remainderOptionTypeNode(publicKeyTypeNode()), + }), + ], + name: 'testInstruction', + }); + + test('should return empty bytes when argument is undefined', async () => { + const visitor = makeVisitor({ + argumentsInput: {}, + ixNode: ixNodeWithOptionalSeed, + }); + const result = await visitor.visitArgumentValue(argumentValueNode('authority')); + expect(result).toEqual(new Uint8Array(0)); + }); + + test('should return empty bytes when argument is null', async () => { + const visitor = makeVisitor({ + argumentsInput: { authority: null }, + ixNode: ixNodeWithOptionalSeed, + }); + const result = await visitor.visitArgumentValue(argumentValueNode('authority')); + expect(result).toEqual(new Uint8Array(0)); + }); + + test('should encode value when argument is provided', async () => { + const authority = await SvmTestContext.generateAddress(); + const visitor = makeVisitor({ + argumentsInput: { authority }, + ixNode: ixNodeWithOptionalSeed, + }); + const result = await visitor.visitArgumentValue(argumentValueNode('authority')); + expect(result.length).toBe(32); + }); + + test('should return empty bytes when seedTypeNode override is remainderOptionTypeNode and argument is null', async () => { + const ixNodeWithRequiredArg = instructionNode({ + arguments: [instructionArgumentNode({ name: 'authority', type: publicKeyTypeNode() })], + name: 'testInstruction', + }); + const visitor = makeVisitor({ + argumentsInput: { authority: null }, + ixNode: ixNodeWithRequiredArg, + seedTypeNode: remainderOptionTypeNode(publicKeyTypeNode()), + }); + const result = await visitor.visitArgumentValue(argumentValueNode('authority')); + expect(result).toEqual(new Uint8Array(0)); + }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/booleanValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/booleanValueNode.test.ts new file mode 100644 index 000000000..779e865de --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/booleanValueNode.test.ts @@ -0,0 +1,17 @@ +import { getBooleanCodec } from '@solana/codecs'; +import { booleanValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitBooleanValue', () => { + test('should encode true', async () => { + const result = await makeVisitor().visitBooleanValue(booleanValueNode(true)); + expect(result).toEqual(getBooleanCodec().encode(true)); + }); + + test('should encode false', async () => { + const result = await makeVisitor().visitBooleanValue(booleanValueNode(false)); + expect(result).toEqual(getBooleanCodec().encode(false)); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/bytesValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/bytesValueNode.test.ts new file mode 100644 index 000000000..f2a8072bc --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/bytesValueNode.test.ts @@ -0,0 +1,27 @@ +import { getBase16Codec, getBase58Codec, getUtf8Codec } from '@solana/codecs'; +import { bytesValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitBytesValue', () => { + test('should encode base16 data', async () => { + // const hex = Buffer.from('Hello', 'utf8').toString('hex'); + const hex = '48656c6c6f'; + const result = await makeVisitor().visitBytesValue(bytesValueNode('base16', hex)); + expect(result).toEqual(getBase16Codec().encode(hex)); + }); + + test('should encode base58 data', async () => { + const b58 = await new SvmTestContext().createAccount(); + const result = await makeVisitor().visitBytesValue(bytesValueNode('base58', b58)); + expect(result).toEqual(getBase58Codec().encode(b58)); + }); + + test('should encode utf8 data', async () => { + const text = 'Hello'; + const result = await makeVisitor().visitBytesValue(bytesValueNode('utf8', text)); + expect(result).toEqual(getUtf8Codec().encode(text)); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/constantValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/constantValueNode.test.ts new file mode 100644 index 000000000..4eafc8c44 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/constantValueNode.test.ts @@ -0,0 +1,30 @@ +import { getUtf8Codec } from '@solana/codecs'; +import { constantValueNode, mapValueNode, numberTypeNode, stringTypeNode, stringValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { PDA_SEED_VALUE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/pda-seed-value'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitConstantValue', () => { + test('should delegate to inner stringValueNode', async () => { + const node = constantValueNode(stringTypeNode('utf8'), stringValueNode('Hello world')); + const result = await makeVisitor().visitConstantValue(node); + expect(result).toEqual(getUtf8Codec().encode('Hello world')); + }); + + test('should delegate to nested inner constantValueNode', async () => { + const node = constantValueNode( + stringTypeNode('utf8'), + constantValueNode(stringTypeNode('utf8'), stringValueNode('Nested hello world')), + ); + const result = await makeVisitor().visitConstantValue(node); + expect(result).toEqual(getUtf8Codec().encode('Nested hello world')); + }); + + test('should throw for unsupported inner node kind', async () => { + const node = constantValueNode(numberTypeNode('u8'), mapValueNode([])); + await expect(makeVisitor().visitConstantValue(node)).rejects.toThrow( + `Expected node of kind [${PDA_SEED_VALUE_SUPPORTED_NODE_KINDS.join(',')}], got [mapValueNode]`, + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/noneValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/noneValueNode.test.ts new file mode 100644 index 000000000..7f7180eec --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/noneValueNode.test.ts @@ -0,0 +1,11 @@ +import { noneValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitNoneValue', () => { + test('should return empty Uint8Array', async () => { + const result = await makeVisitor().visitNoneValue(noneValueNode()); + expect(result).toEqual(new Uint8Array(0)); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/numberValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/numberValueNode.test.ts new file mode 100644 index 000000000..d5909f931 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/numberValueNode.test.ts @@ -0,0 +1,33 @@ +import { CodamaError } from '@codama/errors'; +import { numberValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitNumberValue', () => { + test('should encode 0 as single byte', async () => { + const result = await makeVisitor().visitNumberValue(numberValueNode(0)); + expect(result).toEqual(new Uint8Array([0])); + }); + + test('should encode 255 as single byte', async () => { + const result = await makeVisitor().visitNumberValue(numberValueNode(255)); + expect(result).toEqual(new Uint8Array([255])); + }); + + test('should throw for value > 255', async () => { + await expect(makeVisitor().visitNumberValue(numberValueNode(256))).rejects.toThrow(/out of range/); + }); + + test('should throw for negative value', async () => { + await expect(makeVisitor().visitNumberValue(numberValueNode(-1))).rejects.toThrow(CodamaError); + }); + + test('should throw for non-integer value', async () => { + await expect(makeVisitor().visitNumberValue(numberValueNode(1.5))).rejects.toThrow(/out of range/); + }); + + test('should throw for large value', async () => { + await expect(makeVisitor().visitNumberValue(numberValueNode(70000))).rejects.toThrow(/out of range/); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/pda-seed-value-test-utils.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/pda-seed-value-test-utils.ts new file mode 100644 index 000000000..2c917bc25 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/pda-seed-value-test-utils.ts @@ -0,0 +1,23 @@ +import { address } from '@solana/addresses'; +import { instructionNode, programNode, rootNode } from 'codama'; + +import { createPdaSeedValueVisitor } from '../../../../src/instruction-encoding/visitors/pda-seed-value'; + +const PROGRAM_PUBLIC_KEY = '11111111111111111111111111111111'; + +export const rootNodeMock = rootNode(programNode({ name: 'test', publicKey: PROGRAM_PUBLIC_KEY })); + +export const ixNodeStub = instructionNode({ name: 'testInstruction' }); + +export function makeVisitor(overrides?: Partial[0]>) { + return createPdaSeedValueVisitor({ + accountsInput: undefined, + argumentsInput: undefined, + ixNode: ixNodeStub, + programId: address(PROGRAM_PUBLIC_KEY), + resolutionPath: [], + resolversInput: undefined, + root: rootNodeMock, + ...overrides, + }); +} diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/programIdValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/programIdValueNode.test.ts new file mode 100644 index 000000000..77ead93ad --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/programIdValueNode.test.ts @@ -0,0 +1,39 @@ +import { getAddressEncoder } from '@solana/addresses'; +import { programIdValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitProgramIdValue', () => { + test('should encode the context programId as 32-byte address', async () => { + const svm = new SvmTestContext(); + const randomAddress = await svm.createAccount(); + const result = await makeVisitor({ + programId: randomAddress, + }).visitProgramIdValue(programIdValueNode()); + expect(result).toEqual(getAddressEncoder().encode(randomAddress)); + }); + + test('should throw an error for non-string programId', async () => { + const invalidValues = [42, [1, 2, 3], null]; + for (const value of invalidValues) { + // @ts-expect-error testing invalid programId value + const visitor = makeVisitor({ programId: value }); + await expect(visitor.visitProgramIdValue(programIdValueNode())).rejects.toThrow( + `Cannot convert value to Address: [${JSON.stringify(value)}].`, + ); + } + }); + + test('should throw an error for invalid string programId', async () => { + const invalidValues = ['not-a-key', '123', '', ' ']; + for (const value of invalidValues) { + // @ts-expect-error testing invalid programId value + const visitor = makeVisitor({ programId: value }); + await expect(visitor.visitProgramIdValue(programIdValueNode())).rejects.toThrow( + `Cannot convert value to Address: [${JSON.stringify(value)}].`, + ); + } + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/publicKeyValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/publicKeyValueNode.test.ts new file mode 100644 index 000000000..c79808ed4 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/publicKeyValueNode.test.ts @@ -0,0 +1,27 @@ +import { address, getAddressEncoder } from '@solana/addresses'; +import { publicKeyValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitPublicKeyValue', () => { + test('should encode the provided public key as 32-byte address', async () => { + const svm = new SvmTestContext(); + const randomAddress = await svm.createAccount(); + const result = await makeVisitor().visitPublicKeyValue(publicKeyValueNode(randomAddress)); + expect(result).toEqual(getAddressEncoder().encode(address(randomAddress))); + }); + + test('should throw for invalid public key', async () => { + const invalidPublicKeys = [123, 'not-a-key', [1, 2, 3], null]; + const visitor = makeVisitor(); + + for (const invalidPublicKey of invalidPublicKeys) { + // @ts-expect-error testing invalid inputs + await expect(visitor.visitPublicKeyValue(publicKeyValueNode(invalidPublicKey))).rejects.toThrow( + `Cannot convert value to Address: [${JSON.stringify(invalidPublicKey)}].`, + ); + } + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/someValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/someValueNode.test.ts new file mode 100644 index 000000000..b06ee2f2e --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/someValueNode.test.ts @@ -0,0 +1,34 @@ +import { + constantValueNode, + mapValueNode, + numberValueNode, + publicKeyTypeNode, + publicKeyValueNode, + someValueNode, +} from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { PDA_SEED_VALUE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/pda-seed-value'; +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitSomeValue', () => { + test('should delegate to inner numberValueNode', async () => { + const node = someValueNode(numberValueNode(42)); + const result = await makeVisitor().visitSomeValue(node); + expect(result).toEqual(new Uint8Array([42])); + }); + + test('should throw for unsupported inner node kind', async () => { + const node = someValueNode(mapValueNode([])); + await expect(makeVisitor().visitSomeValue(node)).rejects.toThrow( + `Expected node of kind [${PDA_SEED_VALUE_SUPPORTED_NODE_KINDS.join(',')}], got [mapValueNode]`, + ); + }); + + test('should throw for unsupported nested inner node kind', async () => { + const node = someValueNode(constantValueNode(publicKeyTypeNode(), publicKeyValueNode('invalid-key'))); + await expect(makeVisitor().visitSomeValue(node)).rejects.toThrow( + 'Cannot convert value to Address: ["invalid-key"].', + ); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/pda-seed-value/stringValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/pda-seed-value/stringValueNode.test.ts new file mode 100644 index 000000000..98447239c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/pda-seed-value/stringValueNode.test.ts @@ -0,0 +1,17 @@ +import { getUtf8Codec } from '@solana/codecs'; +import { stringValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './pda-seed-value-test-utils'; + +describe('pda-seed-value: visitStringValue', () => { + test('should encode non-empty string as UTF-8 bytes', async () => { + const result = await makeVisitor().visitStringValue(stringValueNode('hello')); + expect(result).toEqual(getUtf8Codec().encode('hello')); + }); + + test('should encode empty string as empty bytes', async () => { + const result = await makeVisitor().visitStringValue(stringValueNode('')); + expect(result).toEqual(getUtf8Codec().encode('')); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/arrayValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/arrayValueNode.test.ts new file mode 100644 index 000000000..337bceecd --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/arrayValueNode.test.ts @@ -0,0 +1,32 @@ +import { accountValueNode, arrayValueNode, numberValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitArrayValue', () => { + test('should resolve empty array', () => { + const result = makeVisitor().visitArrayValue(arrayValueNode([])); + expect(result).toEqual({ kind: 'arrayValueNode', value: [] }); + }); + + test('should resolve array items recursively', () => { + const result = makeVisitor().visitArrayValue(arrayValueNode([numberValueNode(1), numberValueNode(2)])); + expect(result).toEqual({ + kind: 'arrayValueNode', + value: [ + { kind: 'numberValueNode', value: 1 }, + { kind: 'numberValueNode', value: 2 }, + ], + }); + }); + + test('should throw for unsupported inner node', () => { + expect(() => + makeVisitor().visitArrayValue( + // @ts-expect-error - accountValueNode is invalid + arrayValueNode([accountValueNode('test')]), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/booleanValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/booleanValueNode.test.ts new file mode 100644 index 000000000..5d4f05411 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/booleanValueNode.test.ts @@ -0,0 +1,16 @@ +import { booleanValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitBooleanValue', () => { + test('should resolve true', () => { + const result = makeVisitor().visitBooleanValue(booleanValueNode(true)); + expect(result).toEqual({ kind: 'booleanValueNode', value: true }); + }); + + test('should resolve false', () => { + const result = makeVisitor().visitBooleanValue(booleanValueNode(false)); + expect(result).toEqual({ kind: 'booleanValueNode', value: false }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/bytesValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/bytesValueNode.test.ts new file mode 100644 index 000000000..92dea386c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/bytesValueNode.test.ts @@ -0,0 +1,16 @@ +import { bytesValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitBytesValue', () => { + test('should resolve with base16 encoding', () => { + const result = makeVisitor().visitBytesValue(bytesValueNode('base16', 'deadbeef')); + expect(result).toEqual({ encoding: 'base16', kind: 'bytesValueNode', value: 'deadbeef' }); + }); + + test('should resolve with base64 encoding', () => { + const result = makeVisitor().visitBytesValue(bytesValueNode('base64', 'AQID')); + expect(result).toEqual({ encoding: 'base64', kind: 'bytesValueNode', value: 'AQID' }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/constantValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/constantValueNode.test.ts new file mode 100644 index 000000000..a018060ae --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/constantValueNode.test.ts @@ -0,0 +1,21 @@ +import { accountValueNode, constantValueNode, numberTypeNode, numberValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitConstantValue', () => { + test('should delegate to inner value node', () => { + const result = makeVisitor().visitConstantValue(constantValueNode(numberTypeNode('u8'), numberValueNode(255))); + expect(result).toEqual({ kind: 'numberValueNode', value: 255 }); + }); + + test('should throw for unsupported inner node', () => { + expect(() => + makeVisitor().visitConstantValue( + // @ts-expect-error - accountValueNode is invalid inside constantValueNode + constantValueNode(numberTypeNode('u8'), accountValueNode('test')), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/enumValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/enumValueNode.test.ts new file mode 100644 index 000000000..beae1b49c --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/enumValueNode.test.ts @@ -0,0 +1,11 @@ +import { enumValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitEnumValue', () => { + test('should resolve enum variant', () => { + const result = makeVisitor().visitEnumValue(enumValueNode('TokenStandard', 'nonFungible')); + expect(result).toEqual({ kind: 'enumValueNode', value: 'nonFungible' }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/mapValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/mapValueNode.test.ts new file mode 100644 index 000000000..3d1763e6e --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/mapValueNode.test.ts @@ -0,0 +1,55 @@ +import { accountValueNode, mapEntryValueNode, mapValueNode, numberValueNode, stringValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitMapValue', () => { + test('should resolve empty map', () => { + const result = makeVisitor().visitMapValue(mapValueNode([])); + expect(result).toEqual({ kind: 'mapValueNode', value: [] }); + }); + + test('should resolve key/value pairs recursively', () => { + const result = makeVisitor().visitMapValue( + mapValueNode([mapEntryValueNode(stringValueNode('key1'), numberValueNode(100))]), + ); + expect(result).toEqual({ + kind: 'mapValueNode', + value: [ + { + key: { kind: 'stringValueNode', value: 'key1' }, + value: { kind: 'numberValueNode', value: 100 }, + }, + ], + }); + }); + + test('should throw for unsupported map key', () => { + expect(() => + makeVisitor().visitMapValue( + mapValueNode([ + mapEntryValueNode( + // @ts-expect-error - accountValueNode is invalid StandaloneValueNode + accountValueNode('test'), + numberValueNode(1), + ), + ]), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); + + test('should throw for unsupported map value', () => { + expect(() => + makeVisitor().visitMapValue( + mapValueNode([ + mapEntryValueNode( + stringValueNode('ok'), + // @ts-expect-error - accountValueNode is invalid StandaloneValueNode + accountValueNode('test'), + ), + ]), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/noneValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/noneValueNode.test.ts new file mode 100644 index 000000000..ce25a298b --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/noneValueNode.test.ts @@ -0,0 +1,11 @@ +import { noneValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitNoneValue', () => { + test('should resolve none to null', () => { + const result = makeVisitor().visitNoneValue(noneValueNode()); + expect(result).toEqual({ kind: 'noneValueNode', value: null }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/numberValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/numberValueNode.test.ts new file mode 100644 index 000000000..8d1622440 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/numberValueNode.test.ts @@ -0,0 +1,21 @@ +import { numberValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitNumberValue', () => { + test('should resolve positive number', () => { + const result = makeVisitor().visitNumberValue(numberValueNode(42)); + expect(result).toEqual({ kind: 'numberValueNode', value: 42 }); + }); + + test('should resolve zero', () => { + const result = makeVisitor().visitNumberValue(numberValueNode(0)); + expect(result).toEqual({ kind: 'numberValueNode', value: 0 }); + }); + + test('should resolve negative number', () => { + const result = makeVisitor().visitNumberValue(numberValueNode(-7)); + expect(result).toEqual({ kind: 'numberValueNode', value: -7 }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/publicKeyValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/publicKeyValueNode.test.ts new file mode 100644 index 000000000..4112c786e --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/publicKeyValueNode.test.ts @@ -0,0 +1,14 @@ +import { address } from '@solana/addresses'; +import { publicKeyValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { SvmTestContext } from '../../../svm-test-context'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitPublicKeyValue', () => { + test('should resolve to Address', async () => { + const key = await SvmTestContext.generateAddress(); + const result = makeVisitor().visitPublicKeyValue(publicKeyValueNode(key)); + expect(result).toEqual({ kind: 'publicKeyValueNode', value: address(key) }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/setValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/setValueNode.test.ts new file mode 100644 index 000000000..478299152 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/setValueNode.test.ts @@ -0,0 +1,32 @@ +import { accountValueNode, numberValueNode, setValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitSetValue', () => { + test('should resolve empty set', () => { + const result = makeVisitor().visitSetValue(setValueNode([])); + expect(result).toEqual({ kind: 'setValueNode', value: [] }); + }); + + test('should resolve set items', () => { + const result = makeVisitor().visitSetValue(setValueNode([numberValueNode(10), numberValueNode(20)])); + expect(result).toEqual({ + kind: 'setValueNode', + value: [ + { kind: 'numberValueNode', value: 10 }, + { kind: 'numberValueNode', value: 20 }, + ], + }); + }); + + test('should throw for unsupported inner node', () => { + expect(() => + makeVisitor().visitSetValue( + // @ts-expect-error - accountValueNode is invalid as StandaloneValueNode + setValueNode([accountValueNode('test')]), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/someValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/someValueNode.test.ts new file mode 100644 index 000000000..6d47e136d --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/someValueNode.test.ts @@ -0,0 +1,21 @@ +import { accountValueNode, numberValueNode, someValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitSomeValue', () => { + test('should delegate to inner value node', () => { + const result = makeVisitor().visitSomeValue(someValueNode(numberValueNode(42))); + expect(result).toEqual({ kind: 'numberValueNode', value: 42 }); + }); + + test('should throw for unsupported inner node', () => { + expect(() => + makeVisitor().visitSomeValue( + // @ts-expect-error - accountValueNode is invalid + someValueNode(accountValueNode('test')), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/stringValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/stringValueNode.test.ts new file mode 100644 index 000000000..43d3c87fb --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/stringValueNode.test.ts @@ -0,0 +1,16 @@ +import { stringValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitStringValue', () => { + test('should resolve string', () => { + const result = makeVisitor().visitStringValue(stringValueNode('hello')); + expect(result).toEqual({ kind: 'stringValueNode', value: 'hello' }); + }); + + test('should resolve empty string', () => { + const result = makeVisitor().visitStringValue(stringValueNode('')); + expect(result).toEqual({ kind: 'stringValueNode', value: '' }); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/structValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/structValueNode.test.ts new file mode 100644 index 000000000..54392f80e --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/structValueNode.test.ts @@ -0,0 +1,32 @@ +import { accountValueNode, numberValueNode, stringValueNode, structFieldValueNode, structValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitStructValue', () => { + test('should resolve struct fields to object entries', () => { + const result = makeVisitor().visitStructValue( + structValueNode([ + structFieldValueNode('name', stringValueNode('Alice')), + structFieldValueNode('age', numberValueNode(30)), + ]), + ); + expect(result).toEqual({ + kind: 'structValueNode', + value: { + age: { kind: 'numberValueNode', value: 30 }, + name: { kind: 'stringValueNode', value: 'Alice' }, + }, + }); + }); + + test('should throw for unsupported field value', () => { + expect(() => + makeVisitor().visitStructValue( + // @ts-expect-error - accountValueNode is invalid as a StandaloneValueNode + structValueNode([structFieldValueNode('invalid_field', accountValueNode('test'))]), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/tupleValueNode.test.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/tupleValueNode.test.ts new file mode 100644 index 000000000..bba2767a6 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/tupleValueNode.test.ts @@ -0,0 +1,30 @@ +import { accountValueNode, booleanValueNode, numberValueNode, stringValueNode, tupleValueNode } from 'codama'; +import { describe, expect, test } from 'vitest'; + +import { VALUE_NODE_SUPPORTED_NODE_KINDS } from '../../../../src/instruction-encoding/visitors/value-node-value'; +import { makeVisitor } from './value-node-value-test-utils'; + +describe('value-node-value: visitTupleValue', () => { + test('should resolve mixed-type tuple items', () => { + const result = makeVisitor().visitTupleValue( + tupleValueNode([numberValueNode(1), stringValueNode('a'), booleanValueNode(true)]), + ); + expect(result).toEqual({ + kind: 'tupleValueNode', + value: [ + { kind: 'numberValueNode', value: 1 }, + { kind: 'stringValueNode', value: 'a' }, + { kind: 'booleanValueNode', value: true }, + ], + }); + }); + + test('should throw for unsupported inner node', () => { + expect(() => + makeVisitor().visitTupleValue( + // @ts-expect-error - accountValueNode is invalid as a StandaloneValueNode + tupleValueNode([accountValueNode('test')]), + ), + ).toThrow(`Expected node of kind [${VALUE_NODE_SUPPORTED_NODE_KINDS.join(',')}], got [accountValueNode]`); + }); +}); diff --git a/packages/dynamic-client/test/unit/visitors/value-node-value/value-node-value-test-utils.ts b/packages/dynamic-client/test/unit/visitors/value-node-value/value-node-value-test-utils.ts new file mode 100644 index 000000000..d15f3f406 --- /dev/null +++ b/packages/dynamic-client/test/unit/visitors/value-node-value/value-node-value-test-utils.ts @@ -0,0 +1,5 @@ +import { createValueNodeVisitor } from '../../../../src/instruction-encoding/visitors/value-node-value'; + +export function makeVisitor() { + return createValueNodeVisitor(); +} diff --git a/packages/dynamic-client/tsconfig.declarations.json b/packages/dynamic-client/tsconfig.declarations.json new file mode 100644 index 000000000..dc2d27bb0 --- /dev/null +++ b/packages/dynamic-client/tsconfig.declarations.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "./dist/types" + }, + "extends": "./tsconfig.json", + "include": ["src/index.ts", "src/types"] +} diff --git a/packages/dynamic-client/tsconfig.json b/packages/dynamic-client/tsconfig.json new file mode 100644 index 000000000..7dad947d6 --- /dev/null +++ b/packages/dynamic-client/tsconfig.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "lib": ["ES2022.Object", "ES2022.Error"] + }, + "display": "@codama/dynamic-client", + "extends": "../../tsconfig.json", + "include": ["src", "test"] +} diff --git a/packages/dynamic-client/tsup.cli.config.ts b/packages/dynamic-client/tsup.cli.config.ts new file mode 100644 index 000000000..94d90304d --- /dev/null +++ b/packages/dynamic-client/tsup.cli.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'tsup'; + +import { getCliBuildConfig } from '../../tsup.config.base'; + +export default defineConfig([getCliBuildConfig()]); diff --git a/packages/dynamic-client/tsup.config.ts b/packages/dynamic-client/tsup.config.ts new file mode 100644 index 000000000..e12a7b9d2 --- /dev/null +++ b/packages/dynamic-client/tsup.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'tsup'; + +import { getCliBuildConfig, getPackageBuildConfigs } from '../../tsup.config.base'; + +export default defineConfig([...getPackageBuildConfigs(), getCliBuildConfig()]); diff --git a/packages/dynamic-client/vitest.config.mts b/packages/dynamic-client/vitest.config.mts new file mode 100644 index 000000000..8fd0137cc --- /dev/null +++ b/packages/dynamic-client/vitest.config.mts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; +import { getVitestConfig } from '../../vitest.config.base.mjs'; + +export default defineConfig({ + test: { + projects: [getVitestConfig('browser'), getVitestConfig('node'), getVitestConfig('react-native')], + }, +}); diff --git a/packages/errors/src/codes.ts b/packages/errors/src/codes.ts index d26acdab7..bec6fe3fb 100644 --- a/packages/errors/src/codes.ts +++ b/packages/errors/src/codes.ts @@ -64,6 +64,29 @@ export const CODAMA_ERROR__ANCHOR__PROGRAM_ID_KIND_UNIMPLEMENTED = 2100005; export const CODAMA_ERROR__ANCHOR__GENERIC_TYPE_MISSING = 2100006; export const CODAMA_ERROR__ANCHOR__EVENT_TYPE_MISSING = 2100007; +// Dynamic-client-related errors. +// Reserve error codes in the range [2500000-2500999]. +export const CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND = 2500000; +export const CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND = 2500001; +export const CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND = 2500002; +export const CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING = 2500003; +export const CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS = 2500004; +export const CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE = 2500005; +export const CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS = 2500006; +export const CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING = 2500007; +export const CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY = 2500008; +export const CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY = 2500009; +export const CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA = 2500010; +export const CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING = 2500011; +export const CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING = 2500012; +export const CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT = 2500013; +export const CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE = 2500014; +export const CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT = 2500015; +export const CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER = 2500016; +export const CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT = 2500017; +export const CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE = 2500018; +export const CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION = 2500019; + // Renderers-related errors. // Reserve error codes in the range [2800000-2800999]. export const CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE = 2800000; @@ -95,6 +118,26 @@ export type CodamaErrorCode = | typeof CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE | typeof CODAMA_ERROR__DISCRIMINATOR_FIELD_HAS_NO_DEFAULT_VALUE | typeof CODAMA_ERROR__DISCRIMINATOR_FIELD_NOT_FOUND + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE + | typeof CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY | typeof CODAMA_ERROR__ENUM_VARIANT_NOT_FOUND | typeof CODAMA_ERROR__LINKED_NODE_NOT_FOUND | typeof CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE diff --git a/packages/errors/src/context.ts b/packages/errors/src/context.ts index 255335f90..252e27dda 100644 --- a/packages/errors/src/context.ts +++ b/packages/errors/src/context.ts @@ -30,6 +30,26 @@ import { CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, CODAMA_ERROR__DISCRIMINATOR_FIELD_HAS_NO_DEFAULT_VALUE, CODAMA_ERROR__DISCRIMINATOR_FIELD_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY, + CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY, CODAMA_ERROR__ENUM_VARIANT_NOT_FOUND, CODAMA_ERROR__LINKED_NODE_NOT_FOUND, CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE, @@ -97,6 +117,86 @@ export type CodamaErrorContext = DefaultUnspecifiedErrorContextToUndefined<{ [CODAMA_ERROR__DISCRIMINATOR_FIELD_NOT_FOUND]: { field: CamelCaseString; }; + [CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING]: { + accountName: CamelCaseString; + instructionName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING]: { + accountName: CamelCaseString; + resolverName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING]: { + argumentName: CamelCaseString; + instructionName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS]: { + value: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY]: { + chain: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING]: { + argumentName: CamelCaseString; + instructionName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA]: { + accountName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT]: { + argumentName: CamelCaseString; + instructionName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER]: { + resolverName: CamelCaseString; + targetKind: NodeKind; + targetName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT]: { + message: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND]: { + availableIxs: string[]; + instructionName: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS]: { + accountName: CamelCaseString; + value: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT]: { + argumentName: CamelCaseString; + expectedType: string; + value: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION]: { + message: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND]: { + instructionName: CamelCaseString; + referencedName: CamelCaseString; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND]: { + available: string; + pdaName: string; + }; + + [CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE]: { + accountName: string; + actualType: string; + expectedType: string; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE]: { + actualType: string; + expectedType: string; + nodeKind: NodeKind; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE]: { + nodeKind: NodeKind; + }; + [CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY]: { + accountName: CamelCaseString; + instructionName: CamelCaseString; + strategy: string; + }; [CODAMA_ERROR__ENUM_VARIANT_NOT_FOUND]: { enum: EnumTypeNode; enumName: CamelCaseString; diff --git a/packages/errors/src/messages.ts b/packages/errors/src/messages.ts index d0eba5940..1bbe3cf45 100644 --- a/packages/errors/src/messages.ts +++ b/packages/errors/src/messages.ts @@ -14,6 +14,26 @@ import { CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE, CODAMA_ERROR__DISCRIMINATOR_FIELD_HAS_NO_DEFAULT_VALUE, CODAMA_ERROR__DISCRIMINATOR_FIELD_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY, + CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER, + CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS, + CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT, + CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION, + CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE, + CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY, CODAMA_ERROR__ENUM_VARIANT_NOT_FOUND, CODAMA_ERROR__LINKED_NODE_NOT_FOUND, CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE, @@ -60,6 +80,38 @@ export const CodamaErrorMessages: Readonly<{ [CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE]: 'Unrecognized Anchor IDL type [$idlType].', [CODAMA_ERROR__DISCRIMINATOR_FIELD_HAS_NO_DEFAULT_VALUE]: 'Discriminator field [$field] has no default value.', [CODAMA_ERROR__DISCRIMINATOR_FIELD_NOT_FOUND]: 'Could not find discriminator field [$field]', + [CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_MISSING]: + 'Missing account [$accountName] in [$instructionName] instruction.', + [CODAMA_ERROR__DYNAMIC_CLIENT__ACCOUNT_RESOLVER_MISSING]: + 'Resolver [$resolverName] not provided for account [$accountName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__ARGUMENT_MISSING]: 'Missing argument [$argumentName] in [$instructionName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__CANNOT_CONVERT_TO_ADDRESS]: 'Cannot convert value to Address: [$value].', + [CODAMA_ERROR__DYNAMIC_CLIENT__CIRCULAR_ACCOUNT_DEPENDENCY]: 'Circular dependency detected: [$chain].', + [CODAMA_ERROR__DYNAMIC_CLIENT__DEFAULT_VALUE_MISSING]: + 'Default value is missing for argument [$argumentName] in [$instructionName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_DERIVE_PDA]: 'Failed to derive PDA for account [$accountName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_ENCODE_ARGUMENT]: + 'Failed to encode argument [$argumentName] in [$instructionName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_EXECUTE_RESOLVER]: + 'Resolver [$resolverName] threw an error while resolving [$targetKind] [$targetName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__FAILED_TO_VALIDATE_INPUT]: 'Failed to validate input: [$message].', + [CODAMA_ERROR__DYNAMIC_CLIENT__INSTRUCTION_NOT_FOUND]: + 'Instruction [$instructionName] not found in IDL. Available: [$availableIxs].', + [CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ACCOUNT_ADDRESS]: 'Invalid account address [$accountName]: [$value].', + [CODAMA_ERROR__DYNAMIC_CLIENT__INVALID_ARGUMENT_INPUT]: + 'Invalid argument input [$argumentName]: [$value]. Expected [$expectedType].', + [CODAMA_ERROR__DYNAMIC_CLIENT__INVARIANT_VIOLATION]: 'Internal invariant violation: [$message].', + [CODAMA_ERROR__DYNAMIC_CLIENT__NODE_REFERENCE_NOT_FOUND]: + 'Referenced node [$referencedName] not found in [$instructionName].', + [CODAMA_ERROR__DYNAMIC_CLIENT__PDA_NOT_FOUND]: 'PDA [$pdaName] not found in IDL. Available: [$available].', + + [CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ADDRESS_TYPE]: + 'Expected [$expectedType] for account [$accountName], but received [$actualType].', + [CODAMA_ERROR__DYNAMIC_CLIENT__UNEXPECTED_ARGUMENT_TYPE]: + 'Expected [$expectedType] for [$nodeKind], but received [$actualType].', + [CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_NODE]: 'Unsupported node kind [$nodeKind].', + [CODAMA_ERROR__DYNAMIC_CLIENT__UNSUPPORTED_OPTIONAL_ACCOUNT_STRATEGY]: + 'Unsupported optional account strategy [$strategy] for account [$accountName] in [$instructionName].', [CODAMA_ERROR__ENUM_VARIANT_NOT_FOUND]: 'Enum variant [$variant] not found in enum type [$enumName].', [CODAMA_ERROR__LINKED_NODE_NOT_FOUND]: 'Could not find linked node [$name] from [$kind].', [CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE]: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8c5127a08..9b27a2fda 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ importers: version: 9.39.2 happy-dom: specifier: ^20.1.0 - version: 20.5.0 + version: 20.5.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) prettier: specifier: ^3.7.4 version: 3.7.4 @@ -43,7 +43,7 @@ importers: version: 6.1.2 tsup: specifier: ^8.5.1 - version: 8.5.1(postcss@8.5.6)(typescript@5.9.3) + version: 8.5.1(postcss@8.5.6)(typescript@5.9.3)(yaml@2.8.2) turbo: specifier: ^2.7.4 version: 2.8.3 @@ -52,7 +52,7 @@ importers: version: 5.9.3 vitest: specifier: ^4.0.16 - version: 4.0.16(@types/node@25.0.3)(happy-dom@20.5.0) + version: 4.0.16(@types/node@25.0.3)(happy-dom@20.5.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(yaml@2.8.2) packages/cli: dependencies: @@ -79,6 +79,61 @@ importers: specifier: ^2.4.9 version: 2.4.9 + packages/dynamic-client: + dependencies: + '@codama/dynamic-codecs': + specifier: workspace:* + version: link:../dynamic-codecs + '@codama/errors': + specifier: workspace:* + version: link:../errors + '@solana/addresses': + specifier: ^5.3.0 + version: 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': + specifier: ^5.3.0 + version: 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/instructions': + specifier: ^5.3.0 + version: 5.5.1(typescript@5.9.3) + codama: + specifier: workspace:* + version: link:../library + commander: + specifier: ^14.0.2 + version: 14.0.3 + superstruct: + specifier: ^2.0.2 + version: 2.0.2 + devDependencies: + '@codama/nodes-from-anchor': + specifier: workspace:* + version: link:../nodes-from-anchor + '@codama/renderers-core': + specifier: workspace:* + version: link:../renderers-core + '@metaplex-foundation/mpl-token-metadata-kit': + specifier: ^0.0.2 + version: 0.0.2(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + '@solana-program/program-metadata': + specifier: ^0.5.1 + version: 0.5.1(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana-program/token': + specifier: 0.10.0 + version: 0.10.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana-program/token-2022': + specifier: ^0.9.0 + version: 0.9.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))(@solana/sysvars@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)) + '@solana/kit': + specifier: 6.5.0 + version: 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + litesvm: + specifier: 1.0.0 + version: 1.0.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + sas-lib: + specifier: ^1.0.10 + version: 1.0.10(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + packages/dynamic-codecs: dependencies: '@codama/errors': @@ -229,42 +284,42 @@ importers: packages: - '@babel/code-frame@7.27.1': - resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + '@babel/code-frame@7.29.0': + resolution: {integrity: sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.28.5': - resolution: {integrity: sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==} + '@babel/compat-data@7.29.0': + resolution: {integrity: sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==} engines: {node: '>=6.9.0'} - '@babel/core@7.28.5': - resolution: {integrity: sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==} + '@babel/core@7.29.0': + resolution: {integrity: sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==} engines: {node: '>=6.9.0'} - '@babel/generator@7.28.5': - resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==} + '@babel/generator@7.29.1': + resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.27.2': - resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} + '@babel/helper-compilation-targets@7.28.6': + resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==} engines: {node: '>=6.9.0'} '@babel/helper-globals@7.28.0': resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.27.1': - resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==} + '@babel/helper-module-imports@7.28.6': + resolution: {integrity: sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.28.3': - resolution: {integrity: sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==} + '@babel/helper-module-transforms@7.28.6': + resolution: {integrity: sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-plugin-utils@7.27.1': - resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==} + '@babel/helper-plugin-utils@7.28.6': + resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} engines: {node: '>=6.9.0'} '@babel/helper-string-parser@7.27.1': @@ -279,12 +334,12 @@ packages: resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.28.4': - resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==} + '@babel/helpers@7.29.2': + resolution: {integrity: sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==} engines: {node: '>=6.9.0'} - '@babel/parser@7.28.5': - resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} + '@babel/parser@7.29.2': + resolution: {integrity: sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==} engines: {node: '>=6.0.0'} hasBin: true @@ -309,8 +364,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-import-attributes@7.27.1': - resolution: {integrity: sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww==} + '@babel/plugin-syntax-import-attributes@7.28.6': + resolution: {integrity: sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -325,8 +380,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.27.1': - resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==} + '@babel/plugin-syntax-jsx@7.28.6': + resolution: {integrity: sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -373,8 +428,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.27.1': - resolution: {integrity: sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==} + '@babel/plugin-syntax-typescript@7.28.6': + resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -383,16 +438,16 @@ packages: resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} engines: {node: '>=6.9.0'} - '@babel/template@7.27.2': - resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} + '@babel/template@7.28.6': + resolution: {integrity: sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.28.5': - resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==} + '@babel/traverse@7.29.0': + resolution: {integrity: sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==} engines: {node: '>=6.9.0'} - '@babel/types@7.28.5': - resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} + '@babel/types@7.29.0': + resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@0.2.3': @@ -777,6 +832,12 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + '@eslint-community/eslint-utils@4.9.1': + resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + '@eslint-community/regexpp@4.12.2': resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} @@ -825,6 +886,9 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} + '@iarna/toml@2.2.5': + resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} + '@inquirer/external-editor@1.0.3': resolution: {integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==} engines: {node: '>=18'} @@ -950,6 +1014,9 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + '@metaplex-foundation/mpl-token-metadata-kit@0.0.2': + resolution: {integrity: sha512-CvDvbzioBenMk0E9crCq/GDga9auamFK2p2UQzXEgGvEzTar6vea4OU2WYaBdxIgSwi1ZxD4BwFh+WaME3+Zyg==} + '@noble/hashes@2.0.1': resolution: {integrity: sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==} engines: {node: '>= 20.19.0'} @@ -1212,6 +1279,120 @@ packages: '@sinonjs/fake-timers@11.3.1': resolution: {integrity: sha512-EVJO7nW5M/F5Tur0Rf2z/QoMo+1Ia963RiMtapiQrEWvY0iBUvADo8Beegwjpnle5BHkyHuoxSTW3jF43H1XRA==} + '@solana-program/compute-budget@0.13.0': + resolution: {integrity: sha512-jdiiWaxFG3kEf6bYPNo2mwz2jNxaj7sF+gZIb8wHw9zK3ZILmpkg4sUeChb1BnH2UGf+HgYb9L/lMdqOTqUoWA==} + peerDependencies: + '@solana/kit': ^6.0.0 + + '@solana-program/program-metadata@0.5.1': + resolution: {integrity: sha512-KORPOJI4+/kdL5BsSub4cU/F84dhM9tEl74J4t+OvobCHcE4SqpPBHFG4VoR/5eRUWr59MfdeTzlFVdYJiCNhw==} + hasBin: true + peerDependencies: + '@solana/kit': ^6.0.0 + + '@solana-program/system@0.11.0': + resolution: {integrity: sha512-SJeQVTkqGZzIXd7XHlCxnfpKpvPZghB1IFwddPPG04ydVXtDLRWp9wLoTR5Prkl9FIWRe/c5VgT4nxyzW1cAuQ==} + peerDependencies: + '@solana/kit': ^6.0.0 + + '@solana-program/system@0.12.0': + resolution: {integrity: sha512-ZnAAWeGVMWNtJhw3GdifI2HnhZ0A0H0qs8tBkcFvxp/8wIavvO+GOM4Jd0N22u2+Lni2zcwvcrxrsxj6Mjphng==} + peerDependencies: + '@solana/kit': ^6.1.0 + + '@solana-program/token-2022@0.9.0': + resolution: {integrity: sha512-j8fPBc/oUApYF7aW0ub6cIV7dbbtXC+Y6oDcI9SUs6BXXSq+lj7p7XRU+GEH8qWfyQ5ziRiOLI9s2AZjJY1Icg==} + peerDependencies: + '@solana/kit': ^6.0.0 + '@solana/sysvars': ^5.0 + + '@solana-program/token@0.10.0': + resolution: {integrity: sha512-6JhgF4tywgbzIBnbEFiSLpXe9ZimPzNheRQU7ksgD98Y4YCakcRI5VIAt2CUh/lTiLUOxGerW/oaK1QGF00FMw==} + peerDependencies: + '@solana/kit': ^6.0.0 + + '@solana-program/token@0.12.0': + resolution: {integrity: sha512-hnidRNuFhmqUdW5aWkKTJ+cdzuotVMNwLsTyAk0Nd8VjLDld+vQC0fugHWqm5GPrvYe0hCNAhtpJcZVnNp7rOA==} + peerDependencies: + '@solana/kit': ^6.1.0 + + '@solana-program/token@0.9.0': + resolution: {integrity: sha512-vnZxndd4ED4Fc56sw93cWZ2djEeeOFxtaPS8SPf5+a+JZjKA/EnKqzbE1y04FuMhIVrLERQ8uR8H2h72eZzlsA==} + peerDependencies: + '@solana/kit': ^5.0 + + '@solana/accounts@5.5.1': + resolution: {integrity: sha512-TfOY9xixg5rizABuLVuZ9XI2x2tmWUC/OoN556xwfDlhBHBjKfszicYYOyD6nbFmwTGYarCmyGIdteXxTXIdhQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/accounts@6.5.0': + resolution: {integrity: sha512-h3zQFjwZjmy+YxgTGOEna6g74Tsn4hTBaBCslwPT4QjqWhywe2JrM2Ab0ANfJcj7g/xrHF5QJ/FnUIcyUTeVfQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/addresses@2.3.0': + resolution: {integrity: sha512-ypTNkY2ZaRFpHLnHAgaW8a83N0/WoqdFvCqf4CQmnMdFsZSdC7qOwcbd7YzdaQn9dy+P2hybewzB+KP7LutxGA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + + '@solana/addresses@5.5.1': + resolution: {integrity: sha512-5xoah3Q9G30HQghu/9BiHLb5pzlPKRC3zydQDmE3O9H//WfayxTFppsUDCL6FjYUHqj/wzK6CWHySglc2RkpdA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/addresses@6.5.0': + resolution: {integrity: sha512-iD4/u3CWchQcPofbwzteaE9RnFJSoi654Rnhru5fOu6U2XOte3+7t50d6OxdxQ109ho2LqZyVtyCo2Wb7u1aJQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/assertions@2.3.0': + resolution: {integrity: sha512-Ekoet3khNg3XFLN7MIz8W31wPQISpKUGDGTylLptI+JjCDWx3PIa88xjEMqFo02WJ8sBj2NLV64Xg1sBcsHjZQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + + '@solana/assertions@5.5.1': + resolution: {integrity: sha512-YTCSWAlGwSlVPnWtWLm3ukz81wH4j2YaCveK+TjpvUU88hTy6fmUqxi0+hvAMAe4zKXpJyj3Az7BrLJRxbIm4Q==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/assertions@6.5.0': + resolution: {integrity: sha512-rEAf40TtC9r6EtJFLe39WID4xnTNT6hdOVRfD1xDzmIQdVOyGgIbJGt2FAuB/uQDKLWneWMnvGDBim+K61Bljw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/codecs-core@2.3.0': + resolution: {integrity: sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + '@solana/codecs-core@5.5.1': resolution: {integrity: sha512-TgBt//bbKBct0t6/MpA8ElaOA3sa8eYVvR7LGslCZ84WiAwwjCY0lW/lOYsFHJQzwREMdUyuEyy5YWBKtdh8Rw==} engines: {node: '>=20.18.0'} @@ -1221,6 +1402,21 @@ packages: typescript: optional: true + '@solana/codecs-core@6.5.0': + resolution: {integrity: sha512-Wb+YUj7vUKz5CxqZkrkugtQjxOP2fkMKnffySRlAmVAkpRnQvBY/2eP3VJAKTgDD4ru9xHSIQSpDu09hC/cQZg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/codecs-data-structures@2.3.0': + resolution: {integrity: sha512-qvU5LE5DqEdYMYgELRHv+HMOx73sSoV1ZZkwIrclwUmwTbTaH8QAJURBj0RhQ/zCne7VuLLOZFFGv6jGigWhSw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + '@solana/codecs-data-structures@5.5.1': resolution: {integrity: sha512-97bJWGyUY9WvBz3mX1UV3YPWGDTez6btCfD0ip3UVEXJbItVuUiOkzcO5iFDUtQT5riKT6xC+Mzl+0nO76gd0w==} engines: {node: '>=20.18.0'} @@ -1230,6 +1426,21 @@ packages: typescript: optional: true + '@solana/codecs-data-structures@6.5.0': + resolution: {integrity: sha512-Rxi5zVJ1YA+E6FoSQ7RHP+3DF4U7ski0mJ3H5CsYQP24QLRlBqWB3X6m2n9GHT5O3s49UR0sqeF4oyq0lF8bKw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/codecs-numbers@2.3.0': + resolution: {integrity: sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + '@solana/codecs-numbers@5.5.1': resolution: {integrity: sha512-rllMIZAHqmtvC0HO/dc/21wDuWaD0B8Ryv8o+YtsICQBuiL/0U4AGwH7Pi5GNFySYk0/crSuwfIqQFtmxNSPFw==} engines: {node: '>=20.18.0'} @@ -1239,6 +1450,22 @@ packages: typescript: optional: true + '@solana/codecs-numbers@6.5.0': + resolution: {integrity: sha512-gU/7eYqD+zl2Kwzo7ctt7YHaxF+c3RX164F+iU4X02dwq8DGVcypp+kmEF1QaO6OiShtdryTxhL+JJmEBjhdfA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/codecs-strings@2.3.0': + resolution: {integrity: sha512-y5pSBYwzVziXu521hh+VxqUtp0hYGTl1eWGoc1W+8mdvBdC1kTqm/X7aYQw33J42hw03JjryvYOvmGgk3Qz/Ug==} + engines: {node: '>=20.18.0'} + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + typescript: '>=5.3.3' + '@solana/codecs-strings@5.5.1': resolution: {integrity: sha512-7klX4AhfHYA+uKKC/nxRGP2MntbYQCR3N6+v7bk1W/rSxYuhNmt+FN8aoThSZtWIKwN6BEyR1167ka8Co1+E7A==} engines: {node: '>=20.18.0'} @@ -1251,6 +1478,18 @@ packages: typescript: optional: true + '@solana/codecs-strings@6.5.0': + resolution: {integrity: sha512-9TuQQxumA9gWJeJzbv1GUg0+o0nZp204EijX3efR+lgBOKbkU7W0UWp33ygAZ+RvWE+kTs48ePoYoJ7UHpyxkQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + typescript: ^5.0.0 + peerDependenciesMeta: + fastestsmallesttextencoderdecoder: + optional: true + typescript: + optional: true + '@solana/codecs@5.5.1': resolution: {integrity: sha512-Vea29nJub/bXjfzEV7ZZQ/PWr1pYLZo3z0qW0LQL37uKKVzVFRQlwetd7INk3YtTD3xm9WUYr7bCvYUk3uKy2g==} engines: {node: '>=20.18.0'} @@ -1260,6 +1499,22 @@ packages: typescript: optional: true + '@solana/codecs@6.5.0': + resolution: {integrity: sha512-WfqMqUXk4jcCJQ9nfKqjDcCJN2Pt8/AKe/E78z8OcblFGVJnTzcu2yZpE2gsqM+DJyCVKdQmOY+NS8Uckk5e5w==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + + '@solana/errors@2.3.0': + resolution: {integrity: sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==} + engines: {node: '>=20.18.0'} + hasBin: true + peerDependencies: + typescript: '>=5.3.3' + '@solana/errors@5.5.1': resolution: {integrity: sha512-vFO3p+S7HoyyrcAectnXbdsMfwUzY2zYFUc2DEe5BwpiE9J1IAxPBGjOWO6hL1bbYdBrlmjNx8DXCslqS+Kcmg==} engines: {node: '>=20.18.0'} @@ -1270,6 +1525,16 @@ packages: typescript: optional: true + '@solana/errors@6.5.0': + resolution: {integrity: sha512-XPc0I8Ck6vgx8Uu+LVLewx/1RWDkXkY3lU+1aN1kmbrPAQWbX4Txk7GPmuIIFpyys8o5aKocYfNxJOPKvfaQhg==} + engines: {node: '>=20.18.0'} + hasBin: true + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + '@solana/eslint-config-solana@5.0.0': resolution: {integrity: sha512-DPsoloOpVf/4JD7m3j394BvJX8mCKTSQ1xJrP0tyyeLEZN7x09OL9uj2bo2Ma4UTYZsyV97p2eiuiHmJVA0Kfw==} peerDependencies: @@ -1286,8 +1551,14 @@ packages: typescript: ^5.6 typescript-eslint: ^8.11.0 - '@solana/instructions@5.5.1': - resolution: {integrity: sha512-h0G1CG6S+gUUSt0eo6rOtsaXRBwCq1+Js2a+Ps9Bzk9q7YHNFA75/X0NWugWLgC92waRp66hrjMTiYYnLBoWOQ==} + '@solana/fast-stable-stringify@2.3.0': + resolution: {integrity: sha512-KfJPrMEieUg6D3hfQACoPy0ukrAV8Kio883llt/8chPEG3FVTX9z/Zuf4O01a15xZmBbmQ7toil2Dp0sxMJSxw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + + '@solana/fast-stable-stringify@5.5.1': + resolution: {integrity: sha512-Ni7s2FN33zTzhTFgRjEbOVFO+UAmK8qi3Iu0/GRFYK4jN696OjKHnboSQH/EacQ+yGqS54bfxf409wU5dsLLCw==} engines: {node: '>=20.18.0'} peerDependencies: typescript: ^5.0.0 @@ -1295,8 +1566,8 @@ packages: typescript: optional: true - '@solana/options@5.5.1': - resolution: {integrity: sha512-eo971c9iLNLmk+yOFyo7yKIJzJ/zou6uKpy6mBuyb/thKtS/haiKIc3VLhyTXty3OH2PW8yOlORJnv4DexJB8A==} + '@solana/fast-stable-stringify@6.5.0': + resolution: {integrity: sha512-5ATQDwBVZMoenX5KS23uFswtaAGoaZB9TthzUXle3tkU3tOfgQTuEWEoqEBYc7ct0sK6LtyE1XXT/NP5YvAkkQ==} engines: {node: '>=20.18.0'} peerDependencies: typescript: ^5.0.0 @@ -1304,3089 +1575,5044 @@ packages: typescript: optional: true - '@solana/prettier-config-solana@0.0.6': - resolution: {integrity: sha512-/s55hDoAyh5QyltQh/jjNK3AgACEq885+DnC6lYhrmYZiV6I0iHITWYnKd8d23KRKs/RBjlaQH54MiafeoI9hw==} + '@solana/functional@2.3.0': + resolution: {integrity: sha512-AgsPh3W3tE+nK3eEw/W9qiSfTGwLYEvl0rWaxHht/lRcuDVwfKRzeSa5G79eioWFFqr+pTtoCr3D3OLkwKz02Q==} + engines: {node: '>=20.18.0'} peerDependencies: - prettier: ^3.7.4 - - '@standard-schema/spec@1.1.0': - resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - - '@types/babel__core@7.20.5': - resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + typescript: '>=5.3.3' - '@types/babel__generator@7.27.0': - resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} + '@solana/functional@5.5.1': + resolution: {integrity: sha512-tTHoJcEQq3gQx5qsdsDJ0LEJeFzwNpXD80xApW9o/PPoCNimI3SALkZl+zNW8VnxRrV3l3yYvfHWBKe/X3WG3w==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/babel__template@7.4.4': - resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} + '@solana/functional@6.5.0': + resolution: {integrity: sha512-/KYgY7ZpBJfkN8+qlIvxuBpxv32U9jHXIOOJh3U5xk8Ncsa9Ex5VwbU9NkOf43MJjoIamsP0vARCHjcqJwe5JQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/babel__traverse@7.28.0': - resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@solana/instruction-plans@5.5.1': + resolution: {integrity: sha512-7z3CB7YMcFKuVvgcnNY8bY6IsZ8LG61Iytbz7HpNVGX2u1RthOs1tRW8luTzSG1MPL0Ox7afyAVMYeFqSPHnaQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/chai@5.2.3': - resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + '@solana/instruction-plans@6.5.0': + resolution: {integrity: sha512-zp2asevpyMwvhajHYM1aruYpO+xf3LSwHEI2FK6E2hddYZaEhuBy+bz+NZ1ixCyfx3iXcq7MamlFQc2ySHDyUQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/deep-eql@4.0.2': - resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@solana/instructions@2.3.0': + resolution: {integrity: sha512-PLMsmaIKu7hEAzyElrk2T7JJx4D+9eRwebhFZpy2PXziNSmFF929eRHKUsKqBFM3cYR1Yy3m6roBZfA+bGE/oQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - '@types/eslint@9.6.1': - resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} + '@solana/instructions@5.5.1': + resolution: {integrity: sha512-h0G1CG6S+gUUSt0eo6rOtsaXRBwCq1+Js2a+Ps9Bzk9q7YHNFA75/X0NWugWLgC92waRp66hrjMTiYYnLBoWOQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/eslint__js@8.42.3': - resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + '@solana/instructions@6.5.0': + resolution: {integrity: sha512-2mQP/1qqr5PCfaVMzs9KofBjpyS7J1sBV6PidGoX9Dg5/4UgwJJ+7yfCVQPn37l1nKCShm4I+pQAy5vbmrxJmA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/estree@1.0.8': - resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} + '@solana/keys@2.3.0': + resolution: {integrity: sha512-ZVVdga79pNH+2pVcm6fr2sWz9HTwfopDVhYb0Lh3dh+WBmJjwkabXEIHey2rUES7NjFa/G7sV8lrUn/v8LDCCQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - '@types/istanbul-lib-coverage@2.0.6': - resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + '@solana/keys@5.5.1': + resolution: {integrity: sha512-KRD61cL7CRL+b4r/eB9dEoVxIf/2EJ1Pm1DmRYhtSUAJD2dJ5Xw8QFuehobOGm9URqQ7gaQl+Fkc1qvDlsWqKg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/istanbul-lib-report@3.0.3': - resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + '@solana/keys@6.5.0': + resolution: {integrity: sha512-CN5jmodX9j5CZKrWLM5XGaRlrLl/Ebl4vgqDXrnwC2NiSfUslLsthuORMuVUTDqkzBX/jd/tgVXFRH2NYNzREQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/istanbul-reports@3.0.4': - resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + '@solana/kit@5.5.1': + resolution: {integrity: sha512-irKUGiV2yRoyf+4eGQ/ZeCRxa43yjFEL1DUI5B0DkcfZw3cr0VJtVJnrG8OtVF01vT0OUfYOcUn6zJW5TROHvQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@solana/kit@6.5.0': + resolution: {integrity: sha512-4ysrtqMRd7CTYRv179gQq4kbw9zMsJCLhWjiyOmLZ4co4ld3L654D8ykW7yqWE5PJwF0hzEfheE7oBscO37nvw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/json-stable-stringify@1.2.0': - resolution: {integrity: sha512-PEHY3ohqolHqAzDyB1+31tFaAMnoLN7x/JgdcGmNZ2uvtEJ6rlFCUYNQc0Xe754xxCYLNGZbLUGydSE6tS4S9A==} - deprecated: This is a stub types definition. json-stable-stringify provides its own type definitions, so you do not need this installed. + '@solana/nominal-types@2.3.0': + resolution: {integrity: sha512-uKlMnlP4PWW5UTXlhKM8lcgIaNj8dvd8xO4Y9l+FVvh9RvW2TO0GwUO6JCo7JBzCB0PSqRJdWWaQ8pu1Ti/OkA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - '@types/node@12.20.55': - resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + '@solana/nominal-types@5.5.1': + resolution: {integrity: sha512-I1ImR+kfrLFxN5z22UDiTWLdRZeKtU0J/pkWkO8qm/8WxveiwdIv4hooi8pb6JnlR4mSrWhq0pCIOxDYrL9GIQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/node@22.12.0': - resolution: {integrity: sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==} + '@solana/nominal-types@6.5.0': + resolution: {integrity: sha512-HngIM2nlaDPXk0EDX0PklFqpjGDKuOFnlEKS0bfr2F9CorFwiNhNjhb9lPH+FdgsogD1wJ8wgLMMk1LZWn5kgQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/node@25.0.3': - resolution: {integrity: sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==} + '@solana/offchain-messages@5.5.1': + resolution: {integrity: sha512-g+xHH95prTU+KujtbOzj8wn+C7ZNoiLhf3hj6nYq3MTyxOXtBEysguc97jJveUZG0K97aIKG6xVUlMutg5yxhw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/prompts@2.4.9': - resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==} + '@solana/offchain-messages@6.5.0': + resolution: {integrity: sha512-IYuidJCwfXg5xlh3rkflkA1fbTKWTsip8MdI+znvXm87grfqOYCTd6t/SKiV4BhLl/65Tn0wB/zvZ1cmzJqa1w==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/semver@7.7.1': - resolution: {integrity: sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==} + '@solana/options@5.5.1': + resolution: {integrity: sha512-eo971c9iLNLmk+yOFyo7yKIJzJ/zou6uKpy6mBuyb/thKtS/haiKIc3VLhyTXty3OH2PW8yOlORJnv4DexJB8A==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/stack-utils@2.0.3': - resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@solana/options@6.5.0': + resolution: {integrity: sha512-jdZjSKGCQpsMFK+3CiUEI7W9iGsndi46R4Abk66ULNLDoMsjvfqNy8kqktm0TN0++EX8dKEecpFwxFaA4VlY5g==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/whatwg-mimetype@3.0.2': - resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==} + '@solana/plugin-core@5.5.1': + resolution: {integrity: sha512-VUZl30lDQFJeiSyNfzU1EjYt2QZvoBFKEwjn1lilUJw7KgqD5z7mbV7diJhT+dLFs36i0OsjXvq5kSygn8YJ3A==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/ws@8.18.1': - resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@solana/plugin-core@6.5.0': + resolution: {integrity: sha512-L6N69oNQOAqljH4GnLTaxpwJB0nibW9DrybHZxpGWshyv6b/EvwvkDVRKj5bNqtCG+HRZUHnEhLi1UgZVNkjpQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/yargs-parser@21.0.3': - resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + '@solana/plugin-interfaces@6.5.0': + resolution: {integrity: sha512-/ZlybbMaR7P4ySersOe1huioMADWze0AzsHbzgkpt5dJUv2tz5cpaKdu7TEVQkUZAFhLdqXQULNGqAU5neOgzg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@types/yargs@17.0.35': - resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} + '@solana/prettier-config-solana@0.0.6': + resolution: {integrity: sha512-/s55hDoAyh5QyltQh/jjNK3AgACEq885+DnC6lYhrmYZiV6I0iHITWYnKd8d23KRKs/RBjlaQH54MiafeoI9hw==} + peerDependencies: + prettier: ^3.7.4 - '@typescript-eslint/eslint-plugin@8.43.0': - resolution: {integrity: sha512-8tg+gt7ENL7KewsKMKDHXR1vm8tt9eMxjJBYINf6swonlWgkYn5NwyIgXpbbDxTNU5DgpDFfj95prcTq2clIQQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/program-client-core@6.5.0': + resolution: {integrity: sha512-eUz1xSeDKySGIjToAryPmlESdj8KX0Np7R+Pjt+kSFGw5Jgmn/Inh4o8luoeEnf5XwbvSPVb4aHpIsDyoUVbIg==} + engines: {node: '>=20.18.0'} peerDependencies: - '@typescript-eslint/parser': ^8.43.0 - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/experimental-utils@5.62.0': - resolution: {integrity: sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@solana/programs@5.5.1': + resolution: {integrity: sha512-7U9kn0Jsx1NuBLn5HRTFYh78MV4XN145Yc3WP/q5BlqAVNlMoU9coG5IUTJIG847TUqC1lRto3Dnpwm6T4YRpA==} + engines: {node: '>=20.18.0'} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/parser@8.43.0': - resolution: {integrity: sha512-B7RIQiTsCBBmY+yW4+ILd6mF5h1FUwJsVvpqkrgpszYifetQ2Ke+Z4u6aZh0CblkUGIdR59iYVyXqqZGkZ3aBw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/programs@6.5.0': + resolution: {integrity: sha512-srn3nEROBxCnBpVz/bvLkVln1BZtk3bS3nuReu3yaeOLkKl8b0h1Zp0YmXVyXHzdMcYahsTvKKLR1ZtLZEyEPA==} + engines: {node: '>=20.18.0'} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/project-service@8.43.0': - resolution: {integrity: sha512-htB/+D/BIGoNTQYffZw4uM4NzzuolCoaA/BusuSIcC8YjmBYQioew5VUZAYdAETPjeed0hqCaW7EHg+Robq8uw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/promises@2.3.0': + resolution: {integrity: sha512-GjVgutZKXVuojd9rWy1PuLnfcRfqsaCm7InCiZc8bqmJpoghlyluweNc7ml9Y5yQn1P2IOyzh9+p/77vIyNybQ==} + engines: {node: '>=20.18.0'} peerDependencies: - typescript: '>=4.8.4 <6.0.0' + typescript: '>=5.3.3' - '@typescript-eslint/scope-manager@5.62.0': - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@solana/promises@5.5.1': + resolution: {integrity: sha512-T9lfuUYkGykJmppEcssNiCf6yiYQxJkhiLPP+pyAc2z84/7r3UVIb2tNJk4A9sucS66pzJnVHZKcZVGUUp6wzA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/scope-manager@8.43.0': - resolution: {integrity: sha512-daSWlQ87ZhsjrbMLvpuuMAt3y4ba57AuvadcR7f3nl8eS3BjRc8L9VLxFLk92RL5xdXOg6IQ+qKjjqNEimGuAg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/promises@6.5.0': + resolution: {integrity: sha512-n5rsA3YwOO2nUst6ghuVw6RSnuZQYqevqBKqVYbw11Z4XezsoQ6hb78opW3J9YNYapw9wLWy6tEfUsJjY+xtGw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/tsconfig-utils@8.43.0': - resolution: {integrity: sha512-ALC2prjZcj2YqqL5X/bwWQmHA2em6/94GcbB/KKu5SX3EBDOsqztmmX1kMkvAJHzxk7TazKzJfFiEIagNV3qEA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/rpc-api@2.3.0': + resolution: {integrity: sha512-UUdiRfWoyYhJL9PPvFeJr4aJ554ob2jXcpn4vKmRVn9ire0sCbpQKYx6K8eEKHZWXKrDW8IDspgTl0gT/aJWVg==} + engines: {node: '>=20.18.0'} peerDependencies: - typescript: '>=4.8.4 <6.0.0' + typescript: '>=5.3.3' - '@typescript-eslint/type-utils@8.43.0': - resolution: {integrity: sha512-qaH1uLBpBuBBuRf8c1mLJ6swOfzCXryhKND04Igr4pckzSEW9JX5Aw9AgW00kwfjWJF0kk0ps9ExKTfvXfw4Qg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/rpc-api@5.5.1': + resolution: {integrity: sha512-XWOQQPhKl06Vj0xi3RYHAc6oEQd8B82okYJ04K7N0Vvy3J4PN2cxeK7klwkjgavdcN9EVkYCChm2ADAtnztKnA==} + engines: {node: '>=20.18.0'} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/types@5.62.0': - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@solana/rpc-api@6.5.0': + resolution: {integrity: sha512-b+kftroO8vZFzLHj7Nk/uATS3HOlBUsUqdGg3eTQrW1pFgkyq5yIoEYHeFF7ApUN/SJLTK86U8ofCaXabd2SXA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/types@8.43.0': - resolution: {integrity: sha512-vQ2FZaxJpydjSZJKiSW/LJsabFFvV7KgLC5DiLhkBcykhQj8iK9BOaDmQt74nnKdLvceM5xmhaTF+pLekrxEkw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/rpc-parsed-types@2.3.0': + resolution: {integrity: sha512-B5pHzyEIbBJf9KHej+zdr5ZNAdSvu7WLU2lOUPh81KHdHQs6dEb310LGxcpCc7HVE8IEdO20AbckewDiAN6OCg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - '@typescript-eslint/typescript-estree@5.62.0': - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@solana/rpc-parsed-types@5.5.1': + resolution: {integrity: sha512-HEi3G2nZqGEsa3vX6U0FrXLaqnUCg4SKIUrOe8CezD+cSFbRTOn3rCLrUmJrhVyXlHoQVaRO9mmeovk31jWxJg==} + engines: {node: '>=20.18.0'} peerDependencies: - typescript: '*' + typescript: ^5.0.0 peerDependenciesMeta: typescript: optional: true - '@typescript-eslint/typescript-estree@8.43.0': - resolution: {integrity: sha512-7Vv6zlAhPb+cvEpP06WXXy/ZByph9iL6BQRBDj4kmBsW98AqEeQHlj/13X+sZOrKSo9/rNKH4Ul4f6EICREFdw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/rpc-parsed-types@6.5.0': + resolution: {integrity: sha512-129c8meL6CxRg56/HfhkFOpwYteQH9Rt0wyXOXZQx3a3FNpcJLd4JdPvxDsLBE3EupEkXLGVku/1bGKz+F2J+g==} + engines: {node: '>=20.18.0'} peerDependencies: - typescript: '>=4.8.4 <6.0.0' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/utils@5.62.0': - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@solana/rpc-spec-types@2.3.0': + resolution: {integrity: sha512-xQsb65lahjr8Wc9dMtP7xa0ZmDS8dOE2ncYjlvfyw/h4mpdXTUdrSMi6RtFwX33/rGuztQ7Hwaid5xLNSLvsFQ==} + engines: {node: '>=20.18.0'} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '>=5.3.3' - '@typescript-eslint/utils@8.43.0': - resolution: {integrity: sha512-S1/tEmkUeeswxd0GGcnwuVQPFWo8NzZTOMxCvw8BX7OMxnNae+i8Tm7REQen/SwUIPoPqfKn7EaZ+YLpiB3k9g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/rpc-spec-types@5.5.1': + resolution: {integrity: sha512-6OFKtRpIEJQs8Jb2C4OO8KyP2h2Hy1MFhatMAoXA+0Ik8S3H+CicIuMZvGZ91mIu/tXicuOOsNNLu3HAkrakrw==} + engines: {node: '>=20.18.0'} peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/visitor-keys@5.62.0': - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@solana/rpc-spec-types@6.5.0': + resolution: {integrity: sha512-XasJp+sOW6PLfNoalzoLnm+j3LEZF8XOQmSrOqv9AGrGxQckkuOf6iXZucWTqeNKdstsOpU28BN2B6qOavfRzQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@typescript-eslint/visitor-keys@8.43.0': - resolution: {integrity: sha512-T+S1KqRD4sg/bHfLwrpF/K3gQLBM1n7Rp7OjjikjTEssI2YJzQpi5WXoynOaQ93ERIuq3O8RBTOUYDKszUCEHw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@solana/rpc-spec@2.3.0': + resolution: {integrity: sha512-fA2LMX4BMixCrNB2n6T83AvjZ3oUQTu7qyPLyt8gHQaoEAXs8k6GZmu6iYcr+FboQCjUmRPgMaABbcr9j2J9Sw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - '@ungap/structured-clone@1.3.0': - resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + '@solana/rpc-spec@5.5.1': + resolution: {integrity: sha512-m3LX2bChm3E3by4mQrH4YwCAFY57QBzuUSWqlUw7ChuZ+oLLOq7b2czi4i6L4Vna67j3eCmB3e+4tqy1j5wy7Q==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@vitest/expect@4.0.16': - resolution: {integrity: sha512-eshqULT2It7McaJkQGLkPjPjNph+uevROGuIMJdG3V+0BSR2w9u6J9Lwu+E8cK5TETlfou8GRijhafIMhXsimA==} + '@solana/rpc-spec@6.5.0': + resolution: {integrity: sha512-k4O7Kg0QfVyjUqQovL+WZJ1iuPzq0jiUDcWYgvzFjYVxQDVOIZmAol7yTvLEL4maVmf0tNFDsrDaB6t75MKRZA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@vitest/mocker@4.0.16': - resolution: {integrity: sha512-yb6k4AZxJTB+q9ycAvsoxGn+j/po0UaPgajllBgt1PzoMAAmJGYFdDk0uCcRcxb3BrME34I6u8gHZTQlkqSZpg==} + '@solana/rpc-subscriptions-api@2.3.0': + resolution: {integrity: sha512-9mCjVbum2Hg9KGX3LKsrI5Xs0KX390lS+Z8qB80bxhar6MJPugqIPH8uRgLhCW9GN3JprAfjRNl7our8CPvsPQ==} + engines: {node: '>=20.18.0'} peerDependencies: - msw: ^2.4.9 - vite: ^6.0.0 || ^7.0.0-0 + typescript: '>=5.3.3' + + '@solana/rpc-subscriptions-api@5.5.1': + resolution: {integrity: sha512-5Oi7k+GdeS8xR2ly1iuSFkAv6CZqwG0Z6b1QZKbEgxadE1XGSDrhM2cn59l+bqCozUWCqh4c/A2znU/qQjROlw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 peerDependenciesMeta: - msw: + typescript: optional: true - vite: + + '@solana/rpc-subscriptions-api@6.5.0': + resolution: {integrity: sha512-smqNjT2C5Vf9nWGIwiYOLOP744gRWKi2i2g0i3ZVdsfoouvB0d/WTQ2bbWq47MrdV8FSuGnjAOM3dRIwYmYOWw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: optional: true - '@vitest/pretty-format@4.0.16': - resolution: {integrity: sha512-eNCYNsSty9xJKi/UdVD8Ou16alu7AYiS2fCPRs0b1OdhJiV89buAXQLpTbe+X8V9L6qrs9CqyvU7OaAopJYPsA==} + '@solana/rpc-subscriptions-channel-websocket@2.3.0': + resolution: {integrity: sha512-2oL6ceFwejIgeWzbNiUHI2tZZnaOxNTSerszcin7wYQwijxtpVgUHiuItM/Y70DQmH9sKhmikQp+dqeGalaJxw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' + ws: ^8.18.0 - '@vitest/runner@4.0.16': - resolution: {integrity: sha512-VWEDm5Wv9xEo80ctjORcTQRJ539EGPB3Pb9ApvVRAY1U/WkHXmmYISqU5E79uCwcW7xYUV38gwZD+RV755fu3Q==} - - '@vitest/snapshot@4.0.16': - resolution: {integrity: sha512-sf6NcrYhYBsSYefxnry+DR8n3UV4xWZwWxYbCJUt2YdvtqzSPR7VfGrY0zsv090DAbjFZsi7ZaMi1KnSRyK1XA==} + '@solana/rpc-subscriptions-channel-websocket@5.5.1': + resolution: {integrity: sha512-7tGfBBrYY8TrngOyxSHoCU5shy86iA9SRMRrPSyBhEaZRAk6dnbdpmUTez7gtdVo0BCvh9nzQtUycKWSS7PnFQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@vitest/spy@4.0.16': - resolution: {integrity: sha512-4jIOWjKP0ZUaEmJm00E0cOBLU+5WE0BpeNr3XN6TEF05ltro6NJqHWxXD0kA8/Zc8Nh23AT8WQxwNG+WeROupw==} + '@solana/rpc-subscriptions-channel-websocket@6.5.0': + resolution: {integrity: sha512-xRKH3ZwIoV9Zua9Gp0RR0eL8lXNgx+iNIkE3F0ROlOzI48lt4lRJ7jLrHQCN3raVtkatFVuEyZ7e9eLHK9zhAw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - '@vitest/utils@4.0.16': - resolution: {integrity: sha512-h8z9yYhV3e1LEfaQ3zdypIrnAg/9hguReGZoS7Gl0aBG5xgA410zBqECqmaF/+RkTggRsfnzc1XaAHA6bmUufA==} + '@solana/rpc-subscriptions-spec@2.3.0': + resolution: {integrity: sha512-rdmVcl4PvNKQeA2l8DorIeALCgJEMSu7U8AXJS1PICeb2lQuMeaR+6cs/iowjvIB0lMVjYN2sFf6Q3dJPu6wWg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - acorn-jsx@5.3.2: - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + '@solana/rpc-subscriptions-spec@5.5.1': + resolution: {integrity: sha512-iq+rGq5fMKP3/mKHPNB6MC8IbVW41KGZg83Us/+LE3AWOTWV1WT20KT2iH1F1ik9roi42COv/TpoZZvhKj45XQ==} + engines: {node: '>=20.18.0'} peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - acorn@7.4.1: - resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} - engines: {node: '>=0.4.0'} - hasBin: true + '@solana/rpc-subscriptions-spec@6.5.0': + resolution: {integrity: sha512-Mi8g9rNS2lG7lyNkDhOVfQVfDC7hXKgH+BlI5qKGk+8cfyU7VDq6tVjDysu6kBWGOPHZxyCvcL6+xW/EkdVoAg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} - engines: {node: '>=0.4.0'} - hasBin: true + '@solana/rpc-subscriptions@2.3.0': + resolution: {integrity: sha512-Uyr10nZKGVzvCOqwCZgwYrzuoDyUdwtgQRefh13pXIrdo4wYjVmoLykH49Omt6abwStB0a4UL5gX9V4mFdDJZg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} - hasBin: true + '@solana/rpc-subscriptions@5.5.1': + resolution: {integrity: sha512-CTMy5bt/6mDh4tc6vUJms9EcuZj3xvK0/xq8IQ90rhkpYvate91RjBP+egvjgSayUg9yucU9vNuUpEjz4spM7w==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - agadoo@3.0.0: - resolution: {integrity: sha512-gq+fjT3Ilrhb88Jf+vYMjdO/+3znYfa7vJ4IMLPFsBPUxglnr40Ed3yCLrW6IABdJAedB94b2BkqR6I04lh3dg==} - hasBin: true + '@solana/rpc-subscriptions@6.5.0': + resolution: {integrity: sha512-EenogPQw9Iy8VUj8anu7xoBnPk7gu1J6sAi4MTVlNVz02sNjdUBJoSS0PRJZuhSM1ktPTtHrNwqlXP8TxPR7jg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + '@solana/rpc-transformers@2.3.0': + resolution: {integrity: sha512-UuHYK3XEpo9nMXdjyGKkPCOr7WsZsxs7zLYDO1A5ELH3P3JoehvrDegYRAGzBS2VKsfApZ86ZpJToP0K3PhmMA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} + '@solana/rpc-transformers@5.5.1': + resolution: {integrity: sha512-OsWqLCQdcrRJKvHiMmwFhp9noNZ4FARuMkHT5us3ustDLXaxOjF0gfqZLnMkulSLcKt7TGXqMhBV+HCo7z5M8Q==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} + '@solana/rpc-transformers@6.5.0': + resolution: {integrity: sha512-kS0d+LuuSLfsod2cm2xp0mNj65PL1aomwu6VKtubmsdESwPXHIaI9XrpkPCBuhNSz1SwVp4OkfK5O/VOOHYHSw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} + '@solana/rpc-transport-http@2.3.0': + resolution: {integrity: sha512-HFKydmxGw8nAF5N+S0NLnPBDCe5oMDtI2RAmW8DMqP4U3Zxt2XWhvV1SNkAldT5tF0U1vP+is6fHxyhk4xqEvg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - ansi-regex@6.2.2: - resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} - engines: {node: '>=12'} + '@solana/rpc-transport-http@5.5.1': + resolution: {integrity: sha512-yv8GoVSHqEV0kUJEIhkdOVkR2SvJ6yoWC51cJn2rSV7plr6huLGe0JgujCmB7uZhhaLbcbP3zxXxu9sOjsi7Fg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} + '@solana/rpc-transport-http@6.5.0': + resolution: {integrity: sha512-A3qgDGiUIHdtAfc2OyazlQa7IvRh+xyl0dmzaZlz4rY7Oc7Xk8jmXtaKGkgXihLyAK3oVSqSz5gn9yEfx55eXA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} + '@solana/rpc-types@2.3.0': + resolution: {integrity: sha512-O09YX2hED2QUyGxrMOxQ9GzH1LlEwwZWu69QbL4oYmIf6P5dzEEHcqRY6L1LsDVqc/dzAdEs/E1FaPrcIaIIPw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - ansi-styles@6.2.3: - resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} - engines: {node: '>=12'} + '@solana/rpc-types@5.5.1': + resolution: {integrity: sha512-bibTFQ7PbHJJjGJPmfYC2I+/5CRFS4O2p9WwbFraX1Keeel+nRrt/NBXIy8veP5AEn2sVJIyJPpWBRpCx1oATA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + '@solana/rpc-types@6.5.0': + resolution: {integrity: sha512-hxts27+Z2VNv4IjXGcXkqbj/MgrN9Xtw/4iE1qZk68T2OAb5vA4b8LHchsOHmHvrzZfo8XDvB9mModCdM3JPsQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} + '@solana/rpc@2.3.0': + resolution: {integrity: sha512-ZWN76iNQAOCpYC7yKfb3UNLIMZf603JckLKOOLTHuy9MZnTN8XV6uwvDFhf42XvhglgUjGCEnbUqWtxQ9pa/pQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + '@solana/rpc@5.5.1': + resolution: {integrity: sha512-ku8zTUMrkCWci66PRIBC+1mXepEnZH/q1f3ck0kJZ95a06bOTl5KU7HeXWtskkyefzARJ5zvCs54AD5nxjQJ+A==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + '@solana/rpc@6.5.0': + resolution: {integrity: sha512-lGj7ZMVOR3Rf16aByXD6ghrMqw3G8rAMuWCHU4uMKES5M5VLqNv6o71bSyoTxVMGrmYdbALOvCbFMFINAxtoBg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} + '@solana/signers@5.5.1': + resolution: {integrity: sha512-FY0IVaBT2kCAze55vEieR6hag4coqcuJ31Aw3hqRH7mv6sV8oqwuJmUrx+uFwOp1gwd5OEAzlv6N4hOOple4sQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - assertion-error@2.0.1: - resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} - engines: {node: '>=12'} + '@solana/signers@6.5.0': + resolution: {integrity: sha512-AL75/DyDUhc+QQ+VGZT7aRwJNzIUTWvmLNXQRlCVhLRuyroXzZEL2WJBs8xOwbZXjY8weacfYT7UNM8qK6ucDg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - babel-jest@30.0.0-alpha.6: - resolution: {integrity: sha512-WOQkqpBz2q8d/AT6D6rZXW5xnKHDmk3kIukaXlzUyoBBIvLh1SEvi2RGS4fboEtS0kNkyL+zf1rSfkt5OCIgmw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + '@solana/subscribable@2.3.0': + resolution: {integrity: sha512-DkgohEDbMkdTWiKAoatY02Njr56WXx9e/dKKfmne8/Ad6/2llUIrax78nCdlvZW9quXMaXPTxZvdQqo9N669Og==} + engines: {node: '>=20.18.0'} peerDependencies: - '@babel/core': ^7.11.0 + typescript: '>=5.3.3' - babel-plugin-istanbul@7.0.1: - resolution: {integrity: sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==} - engines: {node: '>=12'} + '@solana/subscribable@5.5.1': + resolution: {integrity: sha512-9K0PsynFq0CsmK1CDi5Y2vUIJpCqkgSS5yfDN0eKPgHqEptLEaia09Kaxc90cSZDZU5mKY/zv1NBmB6Aro9zQQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - babel-plugin-jest-hoist@30.0.0-alpha.6: - resolution: {integrity: sha512-e/aPv0pmnvJqXM5SfCBpyMwZFEZrKW1Mb4unwTkxewk6/0TjwBk6l3B3F9H9OKZ3ErhkH4b+Epd3IIM5E53I2g==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + '@solana/subscribable@6.5.0': + resolution: {integrity: sha512-Jmy2NYmQN68FsQzKJ5CY3qrxXBJdb5qtJKp8B4byPPO5liKNIsC59HpT0Tq8MCNSfBMmOkWF2rrVot2/g1iB1A==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - babel-preset-current-node-syntax@1.2.0: - resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} + '@solana/sysvars@5.5.1': + resolution: {integrity: sha512-k3Quq87Mm+geGUu1GWv6knPk0ALsfY6EKSJGw9xUJDHzY/RkYSBnh0RiOrUhtFm2TDNjOailg8/m0VHmi3reFA==} + engines: {node: '>=20.18.0'} peerDependencies: - '@babel/core': ^7.0.0 || ^8.0.0-0 + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - babel-preset-jest@30.0.0-alpha.6: - resolution: {integrity: sha512-Xsis7RI2oT2zlyCIEzMtjDiES0wKoQxTUo5BGzx1q3ZemnDE1/7xTC4/lI4eBLmAtwk/hpZLRYwltvbQEvyRWw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + '@solana/sysvars@6.5.0': + resolution: {integrity: sha512-iLSS5qj0MWNiGH1LN1E4jhGsXH9D3tWSjwaB6zK9LjhLdVYcPfkosBkj7s0EHHrH03QlwiuFdU0Y2kH8Jcp8kw==} + engines: {node: '>=20.18.0'} peerDependencies: - '@babel/core': ^7.11.0 + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + '@solana/transaction-confirmation@2.3.0': + resolution: {integrity: sha512-UiEuiHCfAAZEKdfne/XljFNJbsKAe701UQHKXEInYzIgBjRbvaeYZlBmkkqtxwcasgBTOmEaEKT44J14N9VZDw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - better-path-resolve@1.0.0: - resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} - engines: {node: '>=4'} + '@solana/transaction-confirmation@5.5.1': + resolution: {integrity: sha512-j4mKlYPHEyu+OD7MBt3jRoX4ScFgkhZC6H65on4Fux6LMScgivPJlwnKoZMnsgxFgWds0pl+BYzSiALDsXlYtw==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - brace-expansion@1.1.12: - resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} + '@solana/transaction-confirmation@6.5.0': + resolution: {integrity: sha512-hfdRBq4toZj7DRMgBN3F0VtJpmTAEtcVTTDZoiszoSpSVa2cAvFth6KypIqASVFZyi9t4FKolLP8ASd3/39UQg==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - brace-expansion@2.0.2: - resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} + '@solana/transaction-messages@2.3.0': + resolution: {integrity: sha512-bgqvWuy3MqKS5JdNLH649q+ngiyOu5rGS3DizSnWwYUd76RxZl1kN6CoqHSrrMzFMvis6sck/yPGG3wqrMlAww==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - braces@3.0.3: - resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} - engines: {node: '>=8'} + '@solana/transaction-messages@5.5.1': + resolution: {integrity: sha512-aXyhMCEaAp3M/4fP0akwBBQkFPr4pfwoC5CLDq999r/FUwDax2RE/h4Ic7h2Xk+JdcUwsb+rLq85Y52hq84XvQ==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - browserslist-to-esbuild@2.1.1: - resolution: {integrity: sha512-KN+mty6C3e9AN8Z5dI1xeN15ExcRNeISoC3g7V0Kax/MMF9MSoYA2G7lkTTcVUFntiEjkpI0HNgqJC1NjdyNUw==} - engines: {node: '>=18'} - hasBin: true + '@solana/transaction-messages@6.5.0': + resolution: {integrity: sha512-ueXkm5xaRlqYBFAlABhaCKK/DuzIYSot0FybwSDeOQCDy2hvU9Zda16Iwa1n56M0fG+XUvFJz2woG3u9DhQh1g==} + engines: {node: '>=20.18.0'} peerDependencies: - browserslist: '*' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - browserslist@4.25.4: - resolution: {integrity: sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - bser@2.1.1: - resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + '@solana/transactions@2.3.0': + resolution: {integrity: sha512-LnTvdi8QnrQtuEZor5Msje61sDpPstTVwKg4y81tNxDhiyomjuvnSNLAq6QsB9gIxUqbNzPZgOG9IU4I4/Uaug==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: '>=5.3.3' - buffer-from@1.1.2: - resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + '@solana/transactions@5.5.1': + resolution: {integrity: sha512-8hHtDxtqalZ157pnx6p8k10D7J/KY/biLzfgh9R09VNLLY3Fqi7kJvJCr7M2ik3oRll56pxhraAGCC9yIT6eOA==} + engines: {node: '>=20.18.0'} + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - bundle-require@5.1.0: - resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + '@solana/transactions@6.5.0': + resolution: {integrity: sha512-b3eJrrGmwpk64VLHjOrmXKAahPpba42WX/FqSUn4WRXPoQjga7Mb57yp+EaRVeQfjszKCkF+13yu+ni6iv2NFQ==} + engines: {node: '>=20.18.0'} peerDependencies: - esbuild: '>=0.18' + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true - cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - call-bind-apply-helpers@1.0.1: - resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==} - engines: {node: '>= 0.4'} + '@types/babel__core@7.20.5': + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} - call-bind-apply-helpers@1.0.2: - resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} - engines: {node: '>= 0.4'} + '@types/babel__generator@7.27.0': + resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==} - call-bind@1.0.8: - resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} - engines: {node: '>= 0.4'} + '@types/babel__template@7.4.4': + resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - call-bound@1.0.4: - resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} - engines: {node: '>= 0.4'} + '@types/babel__traverse@7.28.0': + resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} - callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} - camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} + '@types/eslint@9.6.1': + resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} - caniuse-lite@1.0.30001760: - resolution: {integrity: sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw==} + '@types/eslint__js@8.42.3': + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} - chai@6.2.1: - resolution: {integrity: sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==} - engines: {node: '>=18'} + '@types/estree@1.0.8': + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} - chalk@5.6.2: - resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} - char-regex@1.0.2: - resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} - engines: {node: '>=10'} + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - chardet@2.1.1: - resolution: {integrity: sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==} + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - chokidar@4.0.3: - resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} - engines: {node: '>= 14.16.0'} + '@types/json-stable-stringify@1.2.0': + resolution: {integrity: sha512-PEHY3ohqolHqAzDyB1+31tFaAMnoLN7x/JgdcGmNZ2uvtEJ6rlFCUYNQc0Xe754xxCYLNGZbLUGydSE6tS4S9A==} + deprecated: This is a stub types definition. json-stable-stringify provides its own type definitions, so you do not need this installed. - ci-info@3.9.0: - resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} - engines: {node: '>=8'} + '@types/node@12.20.55': + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - ci-info@4.3.1: - resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==} - engines: {node: '>=8'} + '@types/node@22.12.0': + resolution: {integrity: sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==} - cjs-module-lexer@1.4.3: - resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + '@types/node@25.0.3': + resolution: {integrity: sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==} - cliui@8.0.1: - resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} - engines: {node: '>=12'} + '@types/node@25.5.0': + resolution: {integrity: sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==} - co@4.6.0: - resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} - engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + '@types/prompts@2.4.9': + resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==} - collect-v8-coverage@1.0.3: - resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} + '@types/semver@7.7.1': + resolution: {integrity: sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==} - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + '@types/whatwg-mimetype@3.0.2': + resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==} - commander@14.0.2: - resolution: {integrity: sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==} - engines: {node: '>=20'} + '@types/ws@8.18.1': + resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} - commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} - engines: {node: '>= 6'} + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} - concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + '@types/yargs@17.0.35': + resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} - confbox@0.1.8: - resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + '@typescript-eslint/eslint-plugin@8.43.0': + resolution: {integrity: sha512-8tg+gt7ENL7KewsKMKDHXR1vm8tt9eMxjJBYINf6swonlWgkYn5NwyIgXpbbDxTNU5DgpDFfj95prcTq2clIQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/parser': ^8.43.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' - consola@3.4.2: - resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} - engines: {node: ^14.18.0 || >=16.10.0} + '@typescript-eslint/experimental-utils@5.62.0': + resolution: {integrity: sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + '@typescript-eslint/parser@8.43.0': + resolution: {integrity: sha512-B7RIQiTsCBBmY+yW4+ILd6mF5h1FUwJsVvpqkrgpszYifetQ2Ke+Z4u6aZh0CblkUGIdR59iYVyXqqZGkZ3aBw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} + '@typescript-eslint/project-service@8.43.0': + resolution: {integrity: sha512-htB/+D/BIGoNTQYffZw4uM4NzzuolCoaA/BusuSIcC8YjmBYQioew5VUZAYdAETPjeed0hqCaW7EHg+Robq8uw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' - dataloader@1.4.0: - resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} + '@typescript-eslint/scope-manager@5.62.0': + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} + '@typescript-eslint/scope-manager@8.43.0': + resolution: {integrity: sha512-daSWlQ87ZhsjrbMLvpuuMAt3y4ba57AuvadcR7f3nl8eS3BjRc8L9VLxFLk92RL5xdXOg6IQ+qKjjqNEimGuAg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/tsconfig-utils@8.43.0': + resolution: {integrity: sha512-ALC2prjZcj2YqqL5X/bwWQmHA2em6/94GcbB/KKu5SX3EBDOsqztmmX1kMkvAJHzxk7TazKzJfFiEIagNV3qEA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true + typescript: '>=4.8.4 <6.0.0' - dedent@1.7.0: - resolution: {integrity: sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==} + '@typescript-eslint/type-utils@8.43.0': + resolution: {integrity: sha512-qaH1uLBpBuBBuRf8c1mLJ6swOfzCXryhKND04Igr4pckzSEW9JX5Aw9AgW00kwfjWJF0kk0ps9ExKTfvXfw4Qg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - babel-plugin-macros: ^3.1.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + + '@typescript-eslint/types@5.62.0': + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@typescript-eslint/types@8.43.0': + resolution: {integrity: sha512-vQ2FZaxJpydjSZJKiSW/LJsabFFvV7KgLC5DiLhkBcykhQj8iK9BOaDmQt74nnKdLvceM5xmhaTF+pLekrxEkw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + '@typescript-eslint/typescript-estree@5.62.0': + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' peerDependenciesMeta: - babel-plugin-macros: + typescript: optional: true - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + '@typescript-eslint/typescript-estree@8.43.0': + resolution: {integrity: sha512-7Vv6zlAhPb+cvEpP06WXXy/ZByph9iL6BQRBDj4kmBsW98AqEeQHlj/13X+sZOrKSo9/rNKH4Ul4f6EICREFdw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '>=4.8.4 <6.0.0' - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} + '@typescript-eslint/utils@5.62.0': + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} + '@typescript-eslint/utils@8.43.0': + resolution: {integrity: sha512-S1/tEmkUeeswxd0GGcnwuVQPFWo8NzZTOMxCvw8BX7OMxnNae+i8Tm7REQen/SwUIPoPqfKn7EaZ+YLpiB3k9g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' - detect-indent@6.1.0: - resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} - engines: {node: '>=8'} + '@typescript-eslint/visitor-keys@5.62.0': + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - detect-newline@3.1.0: - resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} - engines: {node: '>=8'} + '@typescript-eslint/visitor-keys@8.43.0': + resolution: {integrity: sha512-T+S1KqRD4sg/bHfLwrpF/K3gQLBM1n7Rp7OjjikjTEssI2YJzQpi5WXoynOaQ93ERIuq3O8RBTOUYDKszUCEHw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - diff-sequences@30.0.0-alpha.6: - resolution: {integrity: sha512-DVGt3/yzbneMUTuupsMqyfSXMnU2fE0lVsC9uFsJmRpluvSi7ZhrS0GX5tnMna6Ta788FGfOUx+irI/+cAZ4EA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - - dotenv@8.6.0: - resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} - engines: {node: '>=10'} + '@ungap/structured-clone@1.3.0': + resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} - dunder-proto@1.0.1: - resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} - engines: {node: '>= 0.4'} + '@vitest/expect@4.0.16': + resolution: {integrity: sha512-eshqULT2It7McaJkQGLkPjPjNph+uevROGuIMJdG3V+0BSR2w9u6J9Lwu+E8cK5TETlfou8GRijhafIMhXsimA==} - eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + '@vitest/mocker@4.0.16': + resolution: {integrity: sha512-yb6k4AZxJTB+q9ycAvsoxGn+j/po0UaPgajllBgt1PzoMAAmJGYFdDk0uCcRcxb3BrME34I6u8gHZTQlkqSZpg==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true - electron-to-chromium@1.5.267: - resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} + '@vitest/pretty-format@4.0.16': + resolution: {integrity: sha512-eNCYNsSty9xJKi/UdVD8Ou16alu7AYiS2fCPRs0b1OdhJiV89buAXQLpTbe+X8V9L6qrs9CqyvU7OaAopJYPsA==} - emittery@0.13.1: - resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} - engines: {node: '>=12'} + '@vitest/runner@4.0.16': + resolution: {integrity: sha512-VWEDm5Wv9xEo80ctjORcTQRJ539EGPB3Pb9ApvVRAY1U/WkHXmmYISqU5E79uCwcW7xYUV38gwZD+RV755fu3Q==} - emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + '@vitest/snapshot@4.0.16': + resolution: {integrity: sha512-sf6NcrYhYBsSYefxnry+DR8n3UV4xWZwWxYbCJUt2YdvtqzSPR7VfGrY0zsv090DAbjFZsi7ZaMi1KnSRyK1XA==} - emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + '@vitest/spy@4.0.16': + resolution: {integrity: sha512-4jIOWjKP0ZUaEmJm00E0cOBLU+5WE0BpeNr3XN6TEF05ltro6NJqHWxXD0kA8/Zc8Nh23AT8WQxwNG+WeROupw==} - enquirer@2.4.1: - resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} - engines: {node: '>=8.6'} + '@vitest/utils@4.0.16': + resolution: {integrity: sha512-h8z9yYhV3e1LEfaQ3zdypIrnAg/9hguReGZoS7Gl0aBG5xgA410zBqECqmaF/+RkTggRsfnzc1XaAHA6bmUufA==} - entities@4.5.0: - resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} - engines: {node: '>=0.12'} + acorn-jsx@5.3.2: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - error-ex@1.3.4: - resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} + acorn@7.4.1: + resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} + engines: {node: '>=0.4.0'} + hasBin: true - es-define-property@1.0.1: - resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} - engines: {node: '>= 0.4'} + acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} + acorn@8.15.0: + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + engines: {node: '>=0.4.0'} + hasBin: true - es-module-lexer@1.7.0: - resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + agadoo@3.0.0: + resolution: {integrity: sha512-gq+fjT3Ilrhb88Jf+vYMjdO/+3znYfa7vJ4IMLPFsBPUxglnr40Ed3yCLrW6IABdJAedB94b2BkqR6I04lh3dg==} + hasBin: true - es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} - engines: {node: '>= 0.4'} + ajv@6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - es-object-atoms@1.1.1: - resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} - engines: {node: '>= 0.4'} + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} - esbuild@0.27.0: - resolution: {integrity: sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==} - engines: {node: '>=18'} - hasBin: true + ansi-escapes@4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} - esbuild@0.27.2: - resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} - engines: {node: '>=18'} - hasBin: true + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} - escalade@3.2.0: - resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} - engines: {node: '>=6'} + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} + engines: {node: '>=12'} - escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} - eslint-plugin-jest@27.9.0: - resolution: {integrity: sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 || ^7.0.0 - eslint: ^7.0.0 || ^8.0.0 - jest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - jest: - optional: true + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} + engines: {node: '>=12'} - eslint-plugin-react-hooks@4.6.0: - resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} - engines: {node: '>=10'} - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - eslint-plugin-simple-import-sort@12.1.1: - resolution: {integrity: sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==} - peerDependencies: - eslint: '>=5.0.0' + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} - eslint-plugin-sort-keys-fix@1.1.2: - resolution: {integrity: sha512-DNPHFGCA0/hZIsfODbeLZqaGY/+q3vgtshF85r+YWDNCQ2apd9PNs/zL6ttKm0nD1IFwvxyg3YOTI7FHl4unrw==} - engines: {node: '>=0.10.0'} + argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - eslint-plugin-typescript-sort-keys@3.3.0: - resolution: {integrity: sha512-bRW3Rc/VNdrSP9OoY5wgjjaXCOOkZKpzvl/Mk6l8Sg8CMehVIcg9K4y33l+ZcZiknpl0aR6rKusxuCJNGZWmVw==} - engines: {node: '>= 16'} - peerDependencies: - '@typescript-eslint/parser': '>=6' - eslint: ^7 || ^8 - typescript: ^3 || ^4 || ^5 + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} + array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} - eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} - eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} + babel-jest@30.0.0-alpha.6: + resolution: {integrity: sha512-WOQkqpBz2q8d/AT6D6rZXW5xnKHDmk3kIukaXlzUyoBBIvLh1SEvi2RGS4fboEtS0kNkyL+zf1rSfkt5OCIgmw==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + peerDependencies: + '@babel/core': ^7.11.0 - eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + babel-plugin-istanbul@7.0.1: + resolution: {integrity: sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==} + engines: {node: '>=12'} - eslint-visitor-keys@4.2.1: - resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + babel-plugin-jest-hoist@30.0.0-alpha.6: + resolution: {integrity: sha512-e/aPv0pmnvJqXM5SfCBpyMwZFEZrKW1Mb4unwTkxewk6/0TjwBk6l3B3F9H9OKZ3ErhkH4b+Epd3IIM5E53I2g==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - eslint@9.39.2: - resolution: {integrity: sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - hasBin: true + babel-preset-current-node-syntax@1.2.0: + resolution: {integrity: sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==} peerDependencies: - jiti: '*' - peerDependenciesMeta: - jiti: - optional: true + '@babel/core': ^7.0.0 || ^8.0.0-0 - espree@10.4.0: - resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + babel-preset-jest@30.0.0-alpha.6: + resolution: {integrity: sha512-Xsis7RI2oT2zlyCIEzMtjDiES0wKoQxTUo5BGzx1q3ZemnDE1/7xTC4/lI4eBLmAtwk/hpZLRYwltvbQEvyRWw==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + peerDependencies: + '@babel/core': ^7.11.0 - espree@6.2.1: - resolution: {integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==} - engines: {node: '>=6.0.0'} + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + + better-path-resolve@1.0.0: + resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - hasBin: true - esquery@1.6.0: - resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} - engines: {node: '>=0.10'} + borsh@2.0.0: + resolution: {integrity: sha512-kc9+BgR3zz9+cjbwM8ODoUB4fs3X3I5A/HtX7LZKxCLaMrEeDFoBpnhZY//DTS1VZBSs6S5v46RZRbZjRFspEg==} - esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} + borsher@4.0.0: + resolution: {integrity: sha512-DrbMSz/xg0bFRiiqe8S0nXEr1whp96hcEHAriKFOlpG2wTihMrg5zZNFH+m4tMcnDY/klKws2YRVHjD4jpdiKg==} - estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} + brace-expansion@1.1.12: + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} - estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} + brace-expansion@1.1.13: + resolution: {integrity: sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==} - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + brace-expansion@2.0.2: + resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} + brace-expansion@2.0.3: + resolution: {integrity: sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==} - execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} - exit@0.1.2: - resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} - engines: {node: '>= 0.8.0'} - - expect-type@1.3.0: - resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} - engines: {node: '>=12.0.0'} + browserslist-to-esbuild@2.1.1: + resolution: {integrity: sha512-KN+mty6C3e9AN8Z5dI1xeN15ExcRNeISoC3g7V0Kax/MMF9MSoYA2G7lkTTcVUFntiEjkpI0HNgqJC1NjdyNUw==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + browserslist: '*' - expect@30.0.0-alpha.6: - resolution: {integrity: sha512-WVi2V4iHKw/vHEyye00Q9CSZz7KHDbJkJyteUI8kTih9jiyMl3bIk7wLYFcY9D1Blnadlyb5w5NBuNjQBow99g==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + browserslist@4.25.4: + resolution: {integrity: sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true - extendable-error@0.1.7: - resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + bser@2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + bufferutil@4.1.0: + resolution: {integrity: sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==} + engines: {node: '>=6.14.2'} - fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + bundle-require@5.1.0: + resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.18' - fastestsmallesttextencoderdecoder@1.0.22: - resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==} + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} - fastq@1.19.1: - resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + call-bind-apply-helpers@1.0.1: + resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==} + engines: {node: '>= 0.4'} - fb-watchman@2.0.2: - resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} + call-bound@1.0.4: + resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} + engines: {node: '>= 0.4'} - fill-range@7.1.1: - resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} - engines: {node: '>=8'} + callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} - find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} - find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + camelcase@6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - fix-dts-default-cjs-exports@1.0.1: - resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==} - - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} + caniuse-lite@1.0.30001782: + resolution: {integrity: sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw==} - flatted@3.3.3: - resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} + chai@6.2.1: + resolution: {integrity: sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==} + engines: {node: '>=18'} - foreground-child@3.3.1: - resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} - engines: {node: '>=14'} + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} - fs-extra@7.0.1: - resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} - engines: {node: '>=6 <7 || >=8'} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - fs-extra@8.1.0: - resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} - engines: {node: '>=6 <7 || >=8'} + char-regex@1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} - fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + chardet@2.1.1: + resolution: {integrity: sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==} - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} - gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} + ci-info@4.4.0: + resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==} + engines: {node: '>=8'} - get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} + cjs-module-lexer@1.4.3: + resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} - get-intrinsic@1.2.6: - resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} - engines: {node: '>= 0.4'} + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} - get-intrinsic@1.3.0: - resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} - engines: {node: '>= 0.4'} + co@4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - get-package-type@0.1.0: - resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} - engines: {node: '>=8.0.0'} + collect-v8-coverage@1.0.3: + resolution: {integrity: sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==} - get-proto@1.0.1: - resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} - engines: {node: '>= 0.4'} + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} - get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} - engines: {node: '>=10'} + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} + commander@13.1.0: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} + engines: {node: '>=18'} - glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} + commander@14.0.2: + resolution: {integrity: sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==} + engines: {node: '>=20'} - glob@10.5.0: - resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} - hasBin: true + commander@14.0.3: + resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} + engines: {node: '>=20'} - glob@13.0.0: - resolution: {integrity: sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==} - engines: {node: 20 || >=22} + commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + concat-map@0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} + consola@3.4.2: + resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} + engines: {node: ^14.18.0 || >=16.10.0} - gopd@1.2.0: - resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} - engines: {node: '>= 0.4'} + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} - graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dataloader@1.4.0: + resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} - happy-dom@20.5.0: - resolution: {integrity: sha512-VQe+Q5CYiGOgcCERXhcfNsbnrN92FDEKciMH/x6LppU9dd0j4aTjCTlqONFOIMcAm/5JxS3+utowbXV1OoFr+g==} - engines: {node: '>=20.0.0'} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} + dedent@1.7.2: + resolution: {integrity: sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - has-symbols@1.1.0: - resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} - engines: {node: '>= 0.4'} + deepmerge@4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} - html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + detect-indent@6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} - human-id@4.1.3: - resolution: {integrity: sha512-tsYlhAYpjCKa//8rXZ9DqKEawhPoSytweBC2eNvcaDK+57RZLHGqNs3PZTQO6yekLFSuvA6AlnAfrw1uBvtb+Q==} - hasBin: true - - human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - - iconv-lite@0.7.0: - resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} - engines: {node: '>=0.10.0'} - - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - - ignore@7.0.5: - resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} - engines: {node: '>= 4'} - - import-fresh@3.3.1: - resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} - engines: {node: '>=6'} - - import-local@3.2.0: - resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + detect-newline@3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} - hasBin: true - - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + diff-sequences@30.0.0-alpha.6: + resolution: {integrity: sha512-DVGt3/yzbneMUTuupsMqyfSXMnU2fE0lVsC9uFsJmRpluvSi7ZhrS0GX5tnMna6Ta788FGfOUx+irI/+cAZ4EA==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} - is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dotenv@8.6.0: + resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} + engines: {node: '>=10'} - is-core-module@2.16.1: - resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - is-generator-fn@2.1.0: - resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} - engines: {node: '>=6'} + electron-to-chromium@1.5.329: + resolution: {integrity: sha512-/4t+AS1l4S3ZC0Ja7PHFIWeBIxGA3QGqV8/yKsP36v7NcyUCl+bIcmw6s5zVuMIECWwBrAK/6QLzTmbJChBboQ==} - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} + emittery@0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - is-stream@2.0.1: - resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} - engines: {node: '>=8'} + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - is-subdir@1.2.0: - resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} - engines: {node: '>=4'} + enquirer@2.4.1: + resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} + engines: {node: '>=8.6'} - is-windows@1.0.2: - resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} - engines: {node: '>=0.10.0'} + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} - isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + error-ex@1.3.4: + resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} - istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} - istanbul-lib-instrument@6.0.3: - resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} - engines: {node: '>=10'} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} - istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} + es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} - istanbul-lib-source-maps@5.0.6: - resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} - engines: {node: '>=10'} + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} - istanbul-reports@3.2.0: - resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} - engines: {node: '>=8'} + esbuild@0.27.0: + resolution: {integrity: sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==} + engines: {node: '>=18'} + hasBin: true - jackspeak@3.4.3: - resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + esbuild@0.27.2: + resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} + engines: {node: '>=18'} + hasBin: true - jest-changed-files@30.0.0-alpha.6: - resolution: {integrity: sha512-Fmyt6W27L4fRBl/gReFC4WU+3XIqB7ySHu+a9QxrERapfCb43o7y81TCvTwJHSw5dxGzXLOObVB0tRMDWMafnw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} - jest-circus@30.0.0-alpha.6: - resolution: {integrity: sha512-1C62WeTyWinn6zR61syYKe5yqVbV+ftf21vOgj8AtTxGfMUAlGCpeZ5zh4Kc9Qk7r/PiPiHWZtgZmeT4oe9Dug==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} - jest-cli@30.0.0-alpha.6: - resolution: {integrity: sha512-3VYzI2KgpMNAsf+LdRAQtAbhH3IDyFnT36U6URXot+2JWwoCGQQ6w4HIfqyOSlH4aejKgTPSfxki2shRPDFtlQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true + escape-string-regexp@4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} - jest-config@30.0.0-alpha.6: - resolution: {integrity: sha512-Tq9rH1mg9+nlIhh3efGwMSogFVKZ9z7c6P33ZlK74iJlnqqIAKYERZL2nNmNC5+5p8uxlTPSFZfBz9O8NGKotw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-plugin-jest@27.9.0: + resolution: {integrity: sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: - '@types/node': '*' - esbuild-register: '>=3.4.0' - ts-node: '>=9.0.0' + '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 || ^7.0.0 + eslint: ^7.0.0 || ^8.0.0 + jest: '*' peerDependenciesMeta: - '@types/node': - optional: true - esbuild-register: + '@typescript-eslint/eslint-plugin': optional: true - ts-node: + jest: optional: true - jest-diff@30.0.0-alpha.6: - resolution: {integrity: sha512-43j1DoYwVKrkbB67a2gC0ijjIY9biF0JSPXv7H6zlOkzNlqYg8hSDzrurLNo6zGKatW4JSBLE79LmXPJPj1m6A==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - - jest-docblock@30.0.0-alpha.6: - resolution: {integrity: sha512-KXRLgRo7/rF1wqxQupsFCZa6wOp1qrDg4GdSXKfIHODYQb0dpi4rYaYA8xV5l2g9KwYc9/zV7l1tPe9TOr27ew==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-plugin-react-hooks@4.6.0: + resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 - jest-each@30.0.0-alpha.6: - resolution: {integrity: sha512-snLI2JNYkoBMlZRrNk67XiauUy+uEzRCszKdj+cqHyZ4/MU8fz7gCxbn3g0zmiGUxr0RX0534UxMjc82Sk++tg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-plugin-simple-import-sort@12.1.1: + resolution: {integrity: sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==} + peerDependencies: + eslint: '>=5.0.0' - jest-environment-node@30.0.0-alpha.6: - resolution: {integrity: sha512-UN9W3dFzO150Bqj1x+1pq7dMUqw/QhpqhdtmC3B1P6GD9eKEMFGuRw3EButx5SGzrZOqRNlF+tUNC8CoWGW2Og==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-plugin-sort-keys-fix@1.1.2: + resolution: {integrity: sha512-DNPHFGCA0/hZIsfODbeLZqaGY/+q3vgtshF85r+YWDNCQ2apd9PNs/zL6ttKm0nD1IFwvxyg3YOTI7FHl4unrw==} + engines: {node: '>=0.10.0'} - jest-get-type@30.0.0-alpha.6: - resolution: {integrity: sha512-lJEoQdCY4ICN6+T0lJ9BODKuqPOEpCv2NnJsEO1nmsK0fbWZmN/pgOPHVqLfK8i3jZpUmgupJ1w8r36mc8iiBQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-plugin-typescript-sort-keys@3.3.0: + resolution: {integrity: sha512-bRW3Rc/VNdrSP9OoY5wgjjaXCOOkZKpzvl/Mk6l8Sg8CMehVIcg9K4y33l+ZcZiknpl0aR6rKusxuCJNGZWmVw==} + engines: {node: '>= 16'} + peerDependencies: + '@typescript-eslint/parser': '>=6' + eslint: ^7 || ^8 + typescript: ^3 || ^4 || ^5 - jest-haste-map@30.0.0-alpha.6: - resolution: {integrity: sha512-NR/Kw8HyOkuWIdT8ynsp9KnsTDvWnlz8WSOmtQxySTIzOWbZaeJ2FJi9LoDL6+vhKpdlLfUvhgZVtnFJSLCzew==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} - jest-leak-detector@30.0.0-alpha.6: - resolution: {integrity: sha512-a6fh/6h6dCDyj+aplGqkajVqzmi+qYHs5X8orMZv+u56++gUezJZJf8GCiQqw2vtxcsWVPUuQXa3kF33tAYzNQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-scope@8.4.0: + resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - jest-matcher-utils@30.0.0-alpha.6: - resolution: {integrity: sha512-jaq7+HznsK54G0qzu96ZwfMEKHmlPiDqg6qG2p/hVQzr6Y/qVMRh8abI9Y1lX6SSXkr+S9mPAkmOsuJNLTLYmQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-visitor-keys@1.3.0: + resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} + engines: {node: '>=4'} - jest-message-util@30.0.0-alpha.6: - resolution: {integrity: sha512-XAGJqkrBo7m3bFxWqiNqL0PyAWGf1XHR6bTve90MjBKJuIzhJsounGTzBNUw8JoU7Uzcj5Z6ZmEhaE3CDnwjfw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - jest-mock@30.0.0-alpha.6: - resolution: {integrity: sha512-ezW02IXiKyFYAgDuxfAlONWULitSaB66t411fq2BJxQtgyMGtv59CsnhgbKb0gQp+9vig5MO5ytDCUPalTbarg==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + eslint-visitor-keys@4.2.1: + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - jest-pnp-resolver@1.2.3: - resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} - engines: {node: '>=6'} + eslint@9.39.2: + resolution: {integrity: sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + hasBin: true peerDependencies: - jest-resolve: '*' + jiti: '*' peerDependenciesMeta: - jest-resolve: + jiti: optional: true - jest-regex-util@30.0.0-alpha.6: - resolution: {integrity: sha512-XcsAVaqc69QyMz1/FChyhWSoAMaKcDPhFOuWJz/H51LppsyZRAJPXkPnMopsS+qfut8cggExr9QLcsYaX6hqqA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + espree@10.4.0: + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - jest-resolve-dependencies@30.0.0-alpha.6: - resolution: {integrity: sha512-G+st0nBR4FNIvVCHq8YNJBiG6t7u0+cxM099lbtOoJNJU+ZTdIxSyzPnnmp/C+YHd1QOlDNlplvL+xe1KHhPUA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + espree@6.2.1: + resolution: {integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==} + engines: {node: '>=6.0.0'} - jest-resolve@30.0.0-alpha.6: - resolution: {integrity: sha512-0EyeId+RFng52qHvuxOzKjZd2uDF/2Hdzpzt54+biGgY/VVAvf8mYE9UV7g6154Ozpq6KLztSqqMCfPgVs4CbA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true - jest-runner@30.0.0-alpha.6: - resolution: {integrity: sha512-SoADy4YnspMpXLNnRCXNIoinm1N5SMci+iF6Y29Duv3wnWhcL14XjEOcyUKBB+AIL52YwouLeUHkCyCspbBk1Q==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} - jest-runtime@30.0.0-alpha.6: - resolution: {integrity: sha512-p7w7DSFFzwHyR4HsNXca/p32VpL9MLT1c71+VplFJIEgeRHvyqxrARentlul6uJniwtlqvZrVVf5baCQ5a5GUw==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} - jest-snapshot@30.0.0-alpha.6: - resolution: {integrity: sha512-YCBUxSNJ9YGch3tyQdxQkOUitbmXahHL6UhSQeSMERFfX1UMrHyEDHggglocCUg4G3jdU8YzshxOJ/oaR6Ph8w==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} - jest-util@30.0.0-alpha.6: - resolution: {integrity: sha512-JlimakOVDyoMC8TEG+knoufxUqLG+Btihf1G8o5sHxz54C6oL54Wetfepp+Nhuj/1hSL0sQtkovvjlEycf9i0w==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} - jest-validate@30.0.0-alpha.6: - resolution: {integrity: sha512-sINLwCenOUeJVzS5p+o1NhwKsY0de5Es0J7bsaSuZJQGRY67W20idceflr+aZ2akrKgvvqU8Tsg6lkFQyq+a6Q==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - jest-watcher@30.0.0-alpha.6: - resolution: {integrity: sha512-+zL1y3GSJG8EOxVSc2p0dndis0rNDcwKTs4b1bpNTI0XneeTiZlCpRBNYI+sqBl/eZtJBrQdiBRSYz7kJqg7NQ==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} - jest-worker@30.0.0-alpha.6: - resolution: {integrity: sha512-qlzX7zFT/QdUV/LWsJwZBlaIBaJ+E2VH3d1gArGVP+9hUHGpJkEzCSBK7yuZrkt+M/U0Jre5+maPRmkinEF4DA==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} - jest@30.0.0-alpha.6: - resolution: {integrity: sha512-9T3nAcIAcEpCX2MdxcjG2IDfG/0tjumnCkVNGh+AKkRXcWF4Er5jLROKvXsgXUJCmr/nMqLF6LG0GrDJ0kjFag==} - engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true + exit@0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} - joycon@3.1.1: - resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} - engines: {node: '>=10'} + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + engines: {node: '>=12.0.0'} - js-tokens@4.0.0: - resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + expect@30.0.0-alpha.6: + resolution: {integrity: sha512-WVi2V4iHKw/vHEyye00Q9CSZz7KHDbJkJyteUI8kTih9jiyMl3bIk7wLYFcY9D1Blnadlyb5w5NBuNjQBow99g==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - js-yaml@3.14.2: - resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} - hasBin: true + extendable-error@0.1.7: + resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} - js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} - hasBin: true + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - jsesc@3.1.0: - resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} - engines: {node: '>=6'} - hasBin: true + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + fast-json-stable-stringify@2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + fastestsmallesttextencoderdecoder@1.0.22: + resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==} - json-schema@0.4.0: - resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + fb-watchman@2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} - json-stable-stringify@1.3.0: - resolution: {integrity: sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==} - engines: {node: '>= 0.4'} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true - json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} - jsonfile@4.0.0: - resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} - jsonify@0.0.1: - resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} + find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} - kleur@3.0.3: - resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} - engines: {node: '>=6'} + fix-dts-default-cjs-exports@1.0.1: + resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==} - leven@3.1.0: - resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} - engines: {node: '>=6'} + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} - levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} + flatted@3.3.3: + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} - lilconfig@3.1.3: - resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - lines-and-columns@1.2.4: - resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} - load-tsconfig@0.2.5: - resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} - locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - lodash.startcase@4.4.0: - resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} - lru-cache@10.4.3: - resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} - lru-cache@11.2.2: - resolution: {integrity: sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==} - engines: {node: 20 || >=22} + get-intrinsic@1.2.6: + resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} + engines: {node: '>= 0.4'} - lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} - magic-string@0.30.21: - resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + get-package-type@0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} - make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} - makeerror@1.0.12: - resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} - math-intrinsics@1.1.0: - resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} - engines: {node: '>= 0.4'} + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} - meow@13.2.0: - resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} - engines: {node: '>=18'} + glob@10.5.0: + resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + hasBin: true - merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + glob@13.0.0: + resolution: {integrity: sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==} + engines: {node: 20 || >=22} - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - - micromatch@4.0.8: - resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} - engines: {node: '>=8.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - minimatch@10.1.1: - resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} - engines: {node: 20 || >=22} - - minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - - minimatch@9.0.5: - resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} - engines: {node: '>=16 || 14 >=14.17'} + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me - minipass@7.1.2: - resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} - engines: {node: '>=16 || 14 >=14.17'} + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} - mlly@1.8.0: - resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} + globby@11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} - mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - nanoid@3.3.11: - resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true + happy-dom@20.5.0: + resolution: {integrity: sha512-VQe+Q5CYiGOgcCERXhcfNsbnrN92FDEKciMH/x6LppU9dd0j4aTjCTlqONFOIMcAm/5JxS3+utowbXV1OoFr+g==} + engines: {node: '>=20.0.0'} - natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} - node-int64@0.4.0: - resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} - node-releases@2.0.27: - resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} + html-escaper@2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} + human-id@4.1.3: + resolution: {integrity: sha512-tsYlhAYpjCKa//8rXZ9DqKEawhPoSytweBC2eNvcaDK+57RZLHGqNs3PZTQO6yekLFSuvA6AlnAfrw1uBvtb+Q==} + hasBin: true - npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} + human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + iconv-lite@0.7.0: + resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} engines: {node: '>=0.10.0'} - object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - obug@2.1.1: - resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} + ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + ignore@7.0.5: + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} + engines: {node: '>= 4'} - onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + import-fresh@3.3.1: + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} - optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} + import-local@3.2.0: + resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + engines: {node: '>=8'} + hasBin: true - outdent@0.5.0: - resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} - p-filter@2.1.0: - resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} - engines: {node: '>=8'} + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} + is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} - p-map@2.1.0: - resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} - engines: {node: '>=6'} + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + is-generator-fn@2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} - package-json-from-dist@1.0.1: - resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - - package-manager-detector@0.2.11: - resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} - parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} - parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} + is-subdir@1.2.0: + resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} + engines: {node: '>=4'} - path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-parse@1.0.7: - resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - - path-scurry@1.11.1: - resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} - engines: {node: '>=16 || 14 >=14.18'} + isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - path-scurry@2.0.1: - resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} - engines: {node: 20 || >=22} + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + istanbul-lib-coverage@3.2.2: + resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} - pathe@2.0.3: - resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + istanbul-lib-instrument@6.0.3: + resolution: {integrity: sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==} + engines: {node: '>=10'} - picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + istanbul-lib-report@3.0.1: + resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} + engines: {node: '>=10'} - picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} + istanbul-lib-source-maps@5.0.6: + resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} + engines: {node: '>=10'} - picomatch@4.0.3: - resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} - engines: {node: '>=12'} + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} + engines: {node: '>=8'} - pify@4.0.1: - resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} - engines: {node: '>=6'} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - pirates@4.0.7: - resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} - engines: {node: '>= 6'} + jest-changed-files@30.0.0-alpha.6: + resolution: {integrity: sha512-Fmyt6W27L4fRBl/gReFC4WU+3XIqB7ySHu+a9QxrERapfCb43o7y81TCvTwJHSw5dxGzXLOObVB0tRMDWMafnw==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - pkg-dir@4.2.0: - resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} - engines: {node: '>=8'} + jest-circus@30.0.0-alpha.6: + resolution: {integrity: sha512-1C62WeTyWinn6zR61syYKe5yqVbV+ftf21vOgj8AtTxGfMUAlGCpeZ5zh4Kc9Qk7r/PiPiHWZtgZmeT4oe9Dug==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - pkg-types@1.3.1: - resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} - - postcss-load-config@6.0.1: - resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} - engines: {node: '>= 18'} + jest-cli@30.0.0-alpha.6: + resolution: {integrity: sha512-3VYzI2KgpMNAsf+LdRAQtAbhH3IDyFnT36U6URXot+2JWwoCGQQ6w4HIfqyOSlH4aejKgTPSfxki2shRPDFtlQ==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + hasBin: true peerDependencies: - jiti: '>=1.21.0' - postcss: '>=8.0.9' - tsx: ^4.8.1 - yaml: ^2.4.2 + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: - jiti: + node-notifier: optional: true - postcss: + + jest-config@30.0.0-alpha.6: + resolution: {integrity: sha512-Tq9rH1mg9+nlIhh3efGwMSogFVKZ9z7c6P33ZlK74iJlnqqIAKYERZL2nNmNC5+5p8uxlTPSFZfBz9O8NGKotw==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + peerDependencies: + '@types/node': '*' + esbuild-register: '>=3.4.0' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': optional: true - tsx: + esbuild-register: optional: true - yaml: + ts-node: optional: true - postcss@8.5.6: - resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} - engines: {node: ^10 || ^12 || >=14} - - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} + jest-diff@30.0.0-alpha.6: + resolution: {integrity: sha512-43j1DoYwVKrkbB67a2gC0ijjIY9biF0JSPXv7H6zlOkzNlqYg8hSDzrurLNo6zGKatW4JSBLE79LmXPJPj1m6A==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true + jest-docblock@30.0.0-alpha.6: + resolution: {integrity: sha512-KXRLgRo7/rF1wqxQupsFCZa6wOp1qrDg4GdSXKfIHODYQb0dpi4rYaYA8xV5l2g9KwYc9/zV7l1tPe9TOr27ew==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - prettier@3.7.4: - resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==} - engines: {node: '>=14'} - hasBin: true + jest-each@30.0.0-alpha.6: + resolution: {integrity: sha512-snLI2JNYkoBMlZRrNk67XiauUy+uEzRCszKdj+cqHyZ4/MU8fz7gCxbn3g0zmiGUxr0RX0534UxMjc82Sk++tg==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - pretty-format@30.0.0-alpha.6: - resolution: {integrity: sha512-xkeffkZoqQmRrcNewpOsUCKNOl+CkPqjt3Ld749uz1S7/O7GuPNPv2fZk3v/1U/FE8/B4Zz0llVL80MKON1tOQ==} + jest-environment-node@30.0.0-alpha.6: + resolution: {integrity: sha512-UN9W3dFzO150Bqj1x+1pq7dMUqw/QhpqhdtmC3B1P6GD9eKEMFGuRw3EButx5SGzrZOqRNlF+tUNC8CoWGW2Og==} engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - prompts@2.4.2: - resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} - engines: {node: '>= 6'} + jest-get-type@30.0.0-alpha.6: + resolution: {integrity: sha512-lJEoQdCY4ICN6+T0lJ9BODKuqPOEpCv2NnJsEO1nmsK0fbWZmN/pgOPHVqLfK8i3jZpUmgupJ1w8r36mc8iiBQ==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} + jest-haste-map@30.0.0-alpha.6: + resolution: {integrity: sha512-NR/Kw8HyOkuWIdT8ynsp9KnsTDvWnlz8WSOmtQxySTIzOWbZaeJ2FJi9LoDL6+vhKpdlLfUvhgZVtnFJSLCzew==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - pure-rand@6.1.0: - resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + jest-leak-detector@30.0.0-alpha.6: + resolution: {integrity: sha512-a6fh/6h6dCDyj+aplGqkajVqzmi+qYHs5X8orMZv+u56++gUezJZJf8GCiQqw2vtxcsWVPUuQXa3kF33tAYzNQ==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - quansync@0.2.11: - resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + jest-matcher-utils@30.0.0-alpha.6: + resolution: {integrity: sha512-jaq7+HznsK54G0qzu96ZwfMEKHmlPiDqg6qG2p/hVQzr6Y/qVMRh8abI9Y1lX6SSXkr+S9mPAkmOsuJNLTLYmQ==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + jest-message-util@30.0.0-alpha.6: + resolution: {integrity: sha512-XAGJqkrBo7m3bFxWqiNqL0PyAWGf1XHR6bTve90MjBKJuIzhJsounGTzBNUw8JoU7Uzcj5Z6ZmEhaE3CDnwjfw==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - react-is@18.3.1: - resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + jest-mock@30.0.0-alpha.6: + resolution: {integrity: sha512-ezW02IXiKyFYAgDuxfAlONWULitSaB66t411fq2BJxQtgyMGtv59CsnhgbKb0gQp+9vig5MO5ytDCUPalTbarg==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - read-yaml-file@1.1.0: - resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + jest-pnp-resolver@1.2.3: + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true - readdirp@4.1.2: - resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} - engines: {node: '>= 14.18.0'} + jest-regex-util@30.0.0-alpha.6: + resolution: {integrity: sha512-XcsAVaqc69QyMz1/FChyhWSoAMaKcDPhFOuWJz/H51LppsyZRAJPXkPnMopsS+qfut8cggExr9QLcsYaX6hqqA==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} + jest-resolve-dependencies@30.0.0-alpha.6: + resolution: {integrity: sha512-G+st0nBR4FNIvVCHq8YNJBiG6t7u0+cxM099lbtOoJNJU+ZTdIxSyzPnnmp/C+YHd1QOlDNlplvL+xe1KHhPUA==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - requireindex@1.2.0: - resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} - engines: {node: '>=0.10.5'} + jest-resolve@30.0.0-alpha.6: + resolution: {integrity: sha512-0EyeId+RFng52qHvuxOzKjZd2uDF/2Hdzpzt54+biGgY/VVAvf8mYE9UV7g6154Ozpq6KLztSqqMCfPgVs4CbA==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - resolve-cwd@3.0.0: - resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} - engines: {node: '>=8'} + jest-runner@30.0.0-alpha.6: + resolution: {integrity: sha512-SoADy4YnspMpXLNnRCXNIoinm1N5SMci+iF6Y29Duv3wnWhcL14XjEOcyUKBB+AIL52YwouLeUHkCyCspbBk1Q==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} + jest-runtime@30.0.0-alpha.6: + resolution: {integrity: sha512-p7w7DSFFzwHyR4HsNXca/p32VpL9MLT1c71+VplFJIEgeRHvyqxrARentlul6uJniwtlqvZrVVf5baCQ5a5GUw==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - resolve-from@5.0.0: - resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} - engines: {node: '>=8'} + jest-snapshot@30.0.0-alpha.6: + resolution: {integrity: sha512-YCBUxSNJ9YGch3tyQdxQkOUitbmXahHL6UhSQeSMERFfX1UMrHyEDHggglocCUg4G3jdU8YzshxOJ/oaR6Ph8w==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - resolve.exports@2.0.3: - resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} - engines: {node: '>=10'} + jest-util@30.0.0-alpha.6: + resolution: {integrity: sha512-JlimakOVDyoMC8TEG+knoufxUqLG+Btihf1G8o5sHxz54C6oL54Wetfepp+Nhuj/1hSL0sQtkovvjlEycf9i0w==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - resolve@1.22.11: - resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} - engines: {node: '>= 0.4'} - hasBin: true + jest-validate@30.0.0-alpha.6: + resolution: {integrity: sha512-sINLwCenOUeJVzS5p+o1NhwKsY0de5Es0J7bsaSuZJQGRY67W20idceflr+aZ2akrKgvvqU8Tsg6lkFQyq+a6Q==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + jest-watcher@30.0.0-alpha.6: + resolution: {integrity: sha512-+zL1y3GSJG8EOxVSc2p0dndis0rNDcwKTs4b1bpNTI0XneeTiZlCpRBNYI+sqBl/eZtJBrQdiBRSYz7kJqg7NQ==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} - rimraf@6.1.2: - resolution: {integrity: sha512-cFCkPslJv7BAXJsYlK1dZsbP8/ZNLkCAQ0bi1hf5EKX2QHegmDFEFA6QhuYJlk7UDdc+02JjO80YSOrWPpw06g==} - engines: {node: 20 || >=22} + jest-worker@30.0.0-alpha.6: + resolution: {integrity: sha512-qlzX7zFT/QdUV/LWsJwZBlaIBaJ+E2VH3d1gArGVP+9hUHGpJkEzCSBK7yuZrkt+M/U0Jre5+maPRmkinEF4DA==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + + jest@30.0.0-alpha.6: + resolution: {integrity: sha512-9T3nAcIAcEpCX2MdxcjG2IDfG/0tjumnCkVNGh+AKkRXcWF4Er5jLROKvXsgXUJCmr/nMqLF6LG0GrDJ0kjFag==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true - rollup@3.29.4: - resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} - engines: {node: '>=14.18.0', npm: '>=8.0.0'} + joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} hasBin: true - rollup@4.53.2: - resolution: {integrity: sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true - rollup@4.53.5: - resolution: {integrity: sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} hasBin: true - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true + json-schema-traverse@0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} - engines: {node: '>=10'} - hasBin: true + json-schema@0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + json-stable-stringify@1.3.0: + resolution: {integrity: sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==} engines: {node: '>= 0.4'} - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} + jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - siginfo@2.0.0: - resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + jsonify@0.0.1: + resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + keyv@4.5.4: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} + kleur@3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} - sisteransi@1.0.5: - resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} + levn@0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} - source-map-js@1.2.1: - resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} - engines: {node: '>=0.10.0'} - - source-map-support@0.5.13: - resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} - - source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} + lilconfig@3.1.3: + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} + engines: {node: '>=14'} - source-map@0.7.6: - resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} - engines: {node: '>= 12'} + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - spawndamnit@3.0.1: - resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} + litesvm-darwin-arm64@1.0.0: + resolution: {integrity: sha512-Fl1i0G+DbsMh4M0nLtFvJcbYcxVZyYOnJhvLTxzFy26CN5dtOHRTWcHTkQZpfEwdIQxCJAvjsGIHAg4K/ecycQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [darwin] - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + litesvm-darwin-x64@1.0.0: + resolution: {integrity: sha512-4gSTuYdOCZ0SpjbGRhZ6g8ua8oSJtMgHwz7qpjTPvXw5Zc1K2bdWDlV0FNwg+NSTTQhCn7PzmpFKip2lI/CU3w==} + engines: {node: '>= 20'} + cpu: [x64] + os: [darwin] - stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} - engines: {node: '>=10'} + litesvm-linux-arm64-gnu@1.0.0: + resolution: {integrity: sha512-i/NdIvl/D3AJE2PbvYOqORKAe5EYpKO6hlgqKEukzWDQd/yx7hmevg/yEI5rJuI0BfTDPZzRuK4Y5wMKdKu42A==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] - stackback@0.0.2: - resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + litesvm-linux-arm64-musl@1.0.0: + resolution: {integrity: sha512-suv1yKYH4oBcR9dIf4JdoMOjdDPyi4QHsO6dKB7Kw/0/tGxnWy/ZcZCMqE283exEyGc64bZXqFTZQQcZxqJrRw==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] - std-env@3.10.0: - resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + litesvm-linux-x64-gnu@1.0.0: + resolution: {integrity: sha512-mM+0lSof8Kb45EXUOqM6E+uVNEZgfOn7Vy0PgEgHI9igDhoxID7S4Z44AAcw5k0hzfPT7qtHGH/uOeIFz6w5fw==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] - string-length@4.0.2: - resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} - engines: {node: '>=10'} + litesvm-linux-x64-musl@1.0.0: + resolution: {integrity: sha512-xBuFg4PYicqrkthgEgX7GkY2XftqwwBhqZoxEjMjLT9XiRAu82xZJsZTQ0yC749+phXeWT7fjp3W6uVEKvDjAQ==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] - string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} + litesvm@1.0.0: + resolution: {integrity: sha512-+uM5Uqut++IKNoG4rw2QzMNspZhqqqRXZ5XDPxb68kJMBrOdvIJX9Ie7IAHTD26qdX074FqMDqlOqlJR9H3xIw==} + engines: {node: '>= 20'} - string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} + load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} - strip-ansi@7.1.2: - resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} - engines: {node: '>=12'} + locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} - strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} + lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - strip-bom@4.0.0: - resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} - engines: {node: '>=8'} + lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} + lru-cache@11.2.2: + resolution: {integrity: sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==} + engines: {node: 20 || >=22} - sucrase@3.35.0: - resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} - supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + make-dir@4.0.0: + resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} - supports-preserve-symlinks-flag@1.0.0: - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + makeerror@1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - synckit@0.9.3: - resolution: {integrity: sha512-JJoOEKTfL1urb1mDoEblhD9NhEbWmq9jHEMEnxoC4ujUaZ4itA8vKgwkFAyNClgxplLi9tsUKX+EduK0p/l7sg==} - engines: {node: ^14.18.0 || >=16.0.0} + meow@13.2.0: + resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} + engines: {node: '>=18'} - term-size@2.2.1: - resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} - engines: {node: '>=8'} + merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} - thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} - thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} - tinybench@2.9.0: - resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + minimatch@10.1.1: + resolution: {integrity: sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==} + engines: {node: 20 || >=22} - tinyexec@0.3.2: - resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + minimatch@3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - tinyexec@1.0.2: - resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} - engines: {node: '>=18'} + minimatch@3.1.5: + resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} - tinyglobby@0.2.15: - resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} - engines: {node: '>=12.0.0'} + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} - tinyrainbow@3.0.3: - resolution: {integrity: sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==} - engines: {node: '>=14.0.0'} + minimatch@9.0.9: + resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==} + engines: {node: '>=16 || 14 >=14.17'} - tmpl@1.0.5: - resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} - to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} + mlly@1.8.0: + resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} - tree-kill@1.2.2: - resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - ts-api-utils@2.1.0: - resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} - engines: {node: '>=18.12'} - peerDependencies: - typescript: '>=4.8.4' + mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true - tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - tsup@8.5.1: - resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==} - engines: {node: '>=18'} - hasBin: true + node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} peerDependencies: - '@microsoft/api-extractor': ^7.36.0 - '@swc/core': ^1 - postcss: ^8.4.12 - typescript: '>=4.5.0' + encoding: ^0.1.0 peerDependenciesMeta: - '@microsoft/api-extractor': - optional: true - '@swc/core': - optional: true - postcss: - optional: true - typescript: + encoding: optional: true - tsutils@3.21.0: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} + hasBin: true - turbo-darwin-64@2.8.3: - resolution: {integrity: sha512-4kXRLfcygLOeNcP6JquqRLmGB/ATjjfehiojL2dJkL7GFm3SPSXbq7oNj8UbD8XriYQ5hPaSuz59iF1ijPHkTw==} - cpu: [x64] - os: [darwin] + node-int64@0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - turbo-darwin-arm64@2.8.3: - resolution: {integrity: sha512-xF7uCeC0UY0Hrv/tqax0BMbFlVP1J/aRyeGQPZT4NjvIPj8gSPDgFhfkfz06DhUwDg5NgMo04uiSkAWE8WB/QQ==} - cpu: [arm64] - os: [darwin] + node-releases@2.0.36: + resolution: {integrity: sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==} - turbo-linux-64@2.8.3: - resolution: {integrity: sha512-vxMDXwaOjweW/4etY7BxrXCSkvtwh0PbwVafyfT1Ww659SedUxd5rM3V2ZCmbwG8NiCfY7d6VtxyHx3Wh1GoZA==} - cpu: [x64] - os: [linux] + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} - turbo-linux-arm64@2.8.3: - resolution: {integrity: sha512-mQX7uYBZFkuPLLlKaNe9IjR1JIef4YvY8f21xFocvttXvdPebnq3PK1Zjzl9A1zun2BEuWNUwQIL8lgvN9Pm3Q==} - cpu: [arm64] - os: [linux] + npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} - turbo-windows-64@2.8.3: - resolution: {integrity: sha512-YLGEfppGxZj3VWcNOVa08h6ISsVKiG85aCAWosOKNUjb6yErWEuydv6/qImRJUI+tDLvDvW7BxopAkujRnWCrw==} - cpu: [x64] - os: [win32] + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} - turbo-windows-arm64@2.8.3: - resolution: {integrity: sha512-afTUGKBRmOJU1smQSBnFGcbq0iabAPwh1uXu2BVk7BREg30/1gMnJh9DFEQTah+UD3n3ru8V55J83RQNFfqoyw==} - cpu: [arm64] - os: [win32] + object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} - turbo@2.8.3: - resolution: {integrity: sha512-8Osxz5Tu/Dw2kb31EAY+nhq/YZ3wzmQSmYa1nIArqxgCAldxv9TPlrAiaBUDVnKA4aiPn0OFBD1ACcpc5VFOAQ==} - hasBin: true + obug@2.1.1: + resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + + optionator@0.9.4: + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} - type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} + outdent@0.5.0: + resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + p-filter@2.1.0: + resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + engines: {node: '>=8'} + + p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + + p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - typescript-eslint@8.43.0: - resolution: {integrity: sha512-FyRGJKUGvcFekRRcBKFBlAhnp4Ng8rhe8tuvvkR9OiU0gfd4vyvTRQHEckO6VDlH57jbeUQem2IpqPq9kLJH+w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <6.0.0' + p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} - hasBin: true + p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} - ufo@1.6.1: - resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} + p-map@2.1.0: + resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} + engines: {node: '>=6'} - undici-types@6.20.0: - resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} - undici-types@7.16.0: - resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - universalify@0.1.2: - resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} - engines: {node: '>= 4.0.0'} + package-manager-detector@0.2.11: + resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==} - update-browserslist-db@1.2.3: - resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' + pako@2.1.0: + resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} - v8-to-istanbul@9.3.0: - resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} - engines: {node: '>=10.12.0'} + parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} - vite@7.3.0: - resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true + path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + + path-scurry@2.0.1: + resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} + engines: {node: 20 || >=22} + + path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@2.3.2: + resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} + engines: {node: '>=8.6'} + + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + engines: {node: '>=12'} + + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + + pify@4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + + pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + + postcss-load-config@6.0.1: + resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} + engines: {node: '>= 18'} peerDependencies: - '@types/node': ^20.19.0 || >=22.12.0 jiti: '>=1.21.0' - less: ^4.0.0 - lightningcss: ^1.21.0 - sass: ^1.70.0 - sass-embedded: ^1.70.0 - stylus: '>=0.54.8' - sugarss: ^5.0.0 - terser: ^5.16.0 + postcss: '>=8.0.9' tsx: ^4.8.1 yaml: ^2.4.2 peerDependenciesMeta: - '@types/node': - optional: true jiti: optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: + postcss: optional: true tsx: optional: true yaml: optional: true - vitest@4.0.16: - resolution: {integrity: sha512-E4t7DJ9pESL6E3I8nFjPa4xGUd3PmiWDLsDztS2qXSJWfHtbQnwAWylaBvSNY48I3vr8PTqIZlyK8TE3V3CA4Q==} - engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + engines: {node: ^10 || ^12 || >=14} + + prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@opentelemetry/api': ^1.9.0 - '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.0.16 - '@vitest/browser-preview': 4.0.16 - '@vitest/browser-webdriverio': 4.0.16 - '@vitest/ui': 4.0.16 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@opentelemetry/api': - optional: true - '@types/node': - optional: true - '@vitest/browser-playwright': - optional: true - '@vitest/browser-preview': - optional: true - '@vitest/browser-webdriverio': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - walker@1.0.8: - resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + prettier@3.7.4: + resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==} + engines: {node: '>=14'} + hasBin: true + + pretty-format@30.0.0-alpha.6: + resolution: {integrity: sha512-xkeffkZoqQmRrcNewpOsUCKNOl+CkPqjt3Ld749uz1S7/O7GuPNPv2fZk3v/1U/FE8/B4Zz0llVL80MKON1tOQ==} + engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} + + prompts@2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + pure-rand@6.1.0: + resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} + + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + + read-yaml-file@1.1.0: + resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + engines: {node: '>=6'} + + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + + requireindex@1.2.0: + resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} + engines: {node: '>=0.10.5'} + + resolve-cwd@3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + + resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + + resolve.exports@2.0.3: + resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} + engines: {node: '>=10'} + + resolve@1.22.11: + resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} + engines: {node: '>= 0.4'} + hasBin: true + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rimraf@6.1.2: + resolution: {integrity: sha512-cFCkPslJv7BAXJsYlK1dZsbP8/ZNLkCAQ0bi1hf5EKX2QHegmDFEFA6QhuYJlk7UDdc+02JjO80YSOrWPpw06g==} + engines: {node: 20 || >=22} + hasBin: true + + rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + + rollup@4.53.2: + resolution: {integrity: sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + rollup@4.53.5: + resolution: {integrity: sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + + sas-lib@1.0.10: + resolution: {integrity: sha512-aV99DALl1EfoL0rnEKaa9ygufvnWtojvuxJPETh3aqKmQUNoKFQbnLNBijxblu7VZ648LrnhlwH3tYCAiLSNig==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + semver@7.7.3: + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + engines: {node: '>=10'} + hasBin: true + + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + engines: {node: '>=10'} + hasBin: true + + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + source-map-support@0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + + source-map@0.7.6: + resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} + engines: {node: '>= 12'} + + spawndamnit@3.0.1: + resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} + + sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@3.10.0: + resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} + + string-length@4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.1.2: + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} + engines: {node: '>=12'} + + strip-bom@3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + + strip-bom@4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + + strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + + strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} + engines: {node: '>=14.0.0'} + + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + supports-color@8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + synckit@0.9.3: + resolution: {integrity: sha512-JJoOEKTfL1urb1mDoEblhD9NhEbWmq9jHEMEnxoC4ujUaZ4itA8vKgwkFAyNClgxplLi9tsUKX+EduK0p/l7sg==} + engines: {node: ^14.18.0 || >=16.0.0} + + term-size@2.2.1: + resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} + engines: {node: '>=8'} + + test-exclude@6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + + thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + + thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + + tinyexec@1.0.2: + resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} + engines: {node: '>=18'} + + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + tinyrainbow@3.0.3: + resolution: {integrity: sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==} + engines: {node: '>=14.0.0'} + + tmpl@1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + ts-api-utils@2.5.0: + resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} + engines: {node: '>=18.12'} + peerDependencies: + typescript: '>=4.8.4' + + ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + + tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + tsup@8.5.1: + resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@microsoft/api-extractor': ^7.36.0 + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + + tsutils@3.21.0: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + + turbo-darwin-64@2.8.3: + resolution: {integrity: sha512-4kXRLfcygLOeNcP6JquqRLmGB/ATjjfehiojL2dJkL7GFm3SPSXbq7oNj8UbD8XriYQ5hPaSuz59iF1ijPHkTw==} + cpu: [x64] + os: [darwin] + + turbo-darwin-arm64@2.8.3: + resolution: {integrity: sha512-xF7uCeC0UY0Hrv/tqax0BMbFlVP1J/aRyeGQPZT4NjvIPj8gSPDgFhfkfz06DhUwDg5NgMo04uiSkAWE8WB/QQ==} + cpu: [arm64] + os: [darwin] + + turbo-linux-64@2.8.3: + resolution: {integrity: sha512-vxMDXwaOjweW/4etY7BxrXCSkvtwh0PbwVafyfT1Ww659SedUxd5rM3V2ZCmbwG8NiCfY7d6VtxyHx3Wh1GoZA==} + cpu: [x64] + os: [linux] + + turbo-linux-arm64@2.8.3: + resolution: {integrity: sha512-mQX7uYBZFkuPLLlKaNe9IjR1JIef4YvY8f21xFocvttXvdPebnq3PK1Zjzl9A1zun2BEuWNUwQIL8lgvN9Pm3Q==} + cpu: [arm64] + os: [linux] + + turbo-windows-64@2.8.3: + resolution: {integrity: sha512-YLGEfppGxZj3VWcNOVa08h6ISsVKiG85aCAWosOKNUjb6yErWEuydv6/qImRJUI+tDLvDvW7BxopAkujRnWCrw==} + cpu: [x64] + os: [win32] + + turbo-windows-arm64@2.8.3: + resolution: {integrity: sha512-afTUGKBRmOJU1smQSBnFGcbq0iabAPwh1uXu2BVk7BREg30/1gMnJh9DFEQTah+UD3n3ru8V55J83RQNFfqoyw==} + cpu: [arm64] + os: [win32] + + turbo@2.8.3: + resolution: {integrity: sha512-8Osxz5Tu/Dw2kb31EAY+nhq/YZ3wzmQSmYa1nIArqxgCAldxv9TPlrAiaBUDVnKA4aiPn0OFBD1ACcpc5VFOAQ==} + hasBin: true + + type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + + type-fest@0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + + typescript-eslint@8.43.0: + resolution: {integrity: sha512-FyRGJKUGvcFekRRcBKFBlAhnp4Ng8rhe8tuvvkR9OiU0gfd4vyvTRQHEckO6VDlH57jbeUQem2IpqPq9kLJH+w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + ufo@1.6.1: + resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} + + undici-types@6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + + undici-types@7.18.2: + resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + + undici-types@7.24.6: + resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} + + universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + + update-browserslist-db@1.2.3: + resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + utf-8-validate@6.0.6: + resolution: {integrity: sha512-q3l3P9UtEEiAHcsgsqTgf9PPjctrDWoIXW3NpOHFdRDbLvu4DLIcxHangJ4RLrWkBcKjmcs/6NkerI8T/rE4LA==} + engines: {node: '>=6.14.2'} + + v8-to-istanbul@9.3.0: + resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} + engines: {node: '>=10.12.0'} + + vite@7.3.0: + resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@4.0.16: + resolution: {integrity: sha512-E4t7DJ9pESL6E3I8nFjPa4xGUd3PmiWDLsDztS2qXSJWfHtbQnwAWylaBvSNY48I3vr8PTqIZlyK8TE3V3CA4Q==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.0.16 + '@vitest/browser-preview': 4.0.16 + '@vitest/browser-webdriverio': 4.0.16 + '@vitest/ui': 4.0.16 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + walker@1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + + webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + + whatwg-mimetype@3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + + whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + word-wrap@1.2.5: + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + engines: {node: '>=0.10.0'} + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + write-file-atomic@5.0.1: + resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + + ws@8.19.0: + resolution: {integrity: sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + ws@8.20.0: + resolution: {integrity: sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yaml@2.8.2: + resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} + engines: {node: '>= 14.6'} + hasBin: true + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + + yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + +snapshots: + + '@babel/code-frame@7.29.0': + dependencies: + '@babel/helper-validator-identifier': 7.28.5 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.29.0': {} + + '@babel/core@7.29.0': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/helper-compilation-targets': 7.28.6 + '@babel/helper-module-transforms': 7.28.6(@babel/core@7.29.0) + '@babel/helpers': 7.29.2 + '@babel/parser': 7.29.2 + '@babel/template': 7.28.6 + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + '@jridgewell/remapping': 2.3.5 + convert-source-map: 2.0.0 + debug: 4.4.3 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.29.1': + dependencies: + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-compilation-targets@7.28.6': + dependencies: + '@babel/compat-data': 7.29.0 + '@babel/helper-validator-option': 7.27.1 + browserslist: 4.25.4 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-globals@7.28.0': {} + + '@babel/helper-module-imports@7.28.6': + dependencies: + '@babel/traverse': 7.29.0 + '@babel/types': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-module-imports': 7.28.6 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.29.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-plugin-utils@7.28.6': {} + + '@babel/helper-string-parser@7.27.1': {} + + '@babel/helper-validator-identifier@7.28.5': {} + + '@babel/helper-validator-option@7.27.1': {} + + '@babel/helpers@7.29.2': + dependencies: + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + + '@babel/parser@7.29.2': + dependencies: + '@babel/types': 7.29.0 + + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-import-attributes@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-jsx@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.29.0)': + dependencies: + '@babel/core': 7.29.0 + '@babel/helper-plugin-utils': 7.28.6 + + '@babel/runtime@7.28.4': {} + + '@babel/template@7.28.6': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 + + '@babel/traverse@7.29.0': + dependencies: + '@babel/code-frame': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/helper-globals': 7.28.0 + '@babel/parser': 7.29.2 + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.29.0': + dependencies: + '@babel/helper-string-parser': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + + '@bcoe/v8-coverage@0.2.3': {} + + '@changesets/apply-release-plan@7.0.14': + dependencies: + '@changesets/config': 3.1.2 + '@changesets/get-version-range-type': 0.4.0 + '@changesets/git': 3.0.4 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.8.8 + resolve-from: 5.0.0 + semver: 7.7.3 + + '@changesets/assemble-release-plan@6.0.9': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + semver: 7.7.3 + + '@changesets/changelog-git@0.2.1': + dependencies: + '@changesets/types': 6.1.0 + + '@changesets/changelog-github@0.5.2': + dependencies: + '@changesets/get-github-info': 0.7.0 + '@changesets/types': 6.1.0 + dotenv: 8.6.0 + transitivePeerDependencies: + - encoding + + '@changesets/cli@2.29.8(@types/node@25.0.3)': + dependencies: + '@changesets/apply-release-plan': 7.0.14 + '@changesets/assemble-release-plan': 6.0.9 + '@changesets/changelog-git': 0.2.1 + '@changesets/config': 3.1.2 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/get-release-plan': 4.0.14 + '@changesets/git': 3.0.4 + '@changesets/logger': 0.1.1 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.6 + '@changesets/should-skip-package': 0.1.2 + '@changesets/types': 6.1.0 + '@changesets/write': 0.4.0 + '@inquirer/external-editor': 1.0.3(@types/node@25.0.3) + '@manypkg/get-packages': 1.1.3 + ansi-colors: 4.1.3 + ci-info: 3.9.0 + enquirer: 2.4.1 + fs-extra: 7.0.1 + mri: 1.2.0 + p-limit: 2.3.0 + package-manager-detector: 0.2.11 + picocolors: 1.1.1 + resolve-from: 5.0.0 + semver: 7.7.3 + spawndamnit: 3.0.1 + term-size: 2.2.1 + transitivePeerDependencies: + - '@types/node' + + '@changesets/config@3.1.2': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.3 + '@changesets/logger': 0.1.1 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.8 + + '@changesets/errors@0.2.0': + dependencies: + extendable-error: 0.1.7 + + '@changesets/get-dependents-graph@2.1.3': + dependencies: + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + picocolors: 1.1.1 + semver: 7.7.3 + + '@changesets/get-github-info@0.7.0': + dependencies: + dataloader: 1.4.0 + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding + + '@changesets/get-release-plan@4.0.14': + dependencies: + '@changesets/assemble-release-plan': 6.0.9 + '@changesets/config': 3.1.2 + '@changesets/pre': 2.0.2 + '@changesets/read': 0.6.6 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + + '@changesets/get-version-range-type@0.4.0': {} + + '@changesets/git@3.0.4': + dependencies: + '@changesets/errors': 0.2.0 + '@manypkg/get-packages': 1.1.3 + is-subdir: 1.2.0 + micromatch: 4.0.8 + spawndamnit: 3.0.1 + + '@changesets/logger@0.1.1': + dependencies: + picocolors: 1.1.1 + + '@changesets/parse@0.4.2': + dependencies: + '@changesets/types': 6.1.0 + js-yaml: 4.1.1 + + '@changesets/pre@2.0.2': + dependencies: + '@changesets/errors': 0.2.0 + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + + '@changesets/read@0.6.6': + dependencies: + '@changesets/git': 3.0.4 + '@changesets/logger': 0.1.1 + '@changesets/parse': 0.4.2 + '@changesets/types': 6.1.0 + fs-extra: 7.0.1 + p-filter: 2.1.0 + picocolors: 1.1.1 + + '@changesets/should-skip-package@0.1.2': + dependencies: + '@changesets/types': 6.1.0 + '@manypkg/get-packages': 1.1.3 + + '@changesets/types@4.1.0': {} + + '@changesets/types@6.1.0': {} + + '@changesets/write@0.4.0': + dependencies: + '@changesets/types': 6.1.0 + fs-extra: 7.0.1 + human-id: 4.1.3 + prettier: 2.8.8 + + '@esbuild/aix-ppc64@0.27.0': + optional: true + + '@esbuild/aix-ppc64@0.27.2': + optional: true + + '@esbuild/android-arm64@0.27.0': + optional: true + + '@esbuild/android-arm64@0.27.2': + optional: true + + '@esbuild/android-arm@0.27.0': + optional: true + + '@esbuild/android-arm@0.27.2': + optional: true + + '@esbuild/android-x64@0.27.0': + optional: true + + '@esbuild/android-x64@0.27.2': + optional: true + + '@esbuild/darwin-arm64@0.27.0': + optional: true + + '@esbuild/darwin-arm64@0.27.2': + optional: true + + '@esbuild/darwin-x64@0.27.0': + optional: true + + '@esbuild/darwin-x64@0.27.2': + optional: true + + '@esbuild/freebsd-arm64@0.27.0': + optional: true + + '@esbuild/freebsd-arm64@0.27.2': + optional: true + + '@esbuild/freebsd-x64@0.27.0': + optional: true + + '@esbuild/freebsd-x64@0.27.2': + optional: true + + '@esbuild/linux-arm64@0.27.0': + optional: true + + '@esbuild/linux-arm64@0.27.2': + optional: true + + '@esbuild/linux-arm@0.27.0': + optional: true + + '@esbuild/linux-arm@0.27.2': + optional: true + + '@esbuild/linux-ia32@0.27.0': + optional: true + + '@esbuild/linux-ia32@0.27.2': + optional: true + + '@esbuild/linux-loong64@0.27.0': + optional: true + + '@esbuild/linux-loong64@0.27.2': + optional: true + + '@esbuild/linux-mips64el@0.27.0': + optional: true + + '@esbuild/linux-mips64el@0.27.2': + optional: true + + '@esbuild/linux-ppc64@0.27.0': + optional: true + + '@esbuild/linux-ppc64@0.27.2': + optional: true + + '@esbuild/linux-riscv64@0.27.0': + optional: true + + '@esbuild/linux-riscv64@0.27.2': + optional: true + + '@esbuild/linux-s390x@0.27.0': + optional: true + + '@esbuild/linux-s390x@0.27.2': + optional: true - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + '@esbuild/linux-x64@0.27.0': + optional: true - whatwg-mimetype@3.0.0: - resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} - engines: {node: '>=12'} + '@esbuild/linux-x64@0.27.2': + optional: true - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + '@esbuild/netbsd-arm64@0.27.0': + optional: true - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true + '@esbuild/netbsd-arm64@0.27.2': + optional: true - why-is-node-running@2.3.0: - resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} - engines: {node: '>=8'} - hasBin: true + '@esbuild/netbsd-x64@0.27.0': + optional: true - word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} + '@esbuild/netbsd-x64@0.27.2': + optional: true - wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} + '@esbuild/openbsd-arm64@0.27.0': + optional: true - wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} - engines: {node: '>=12'} + '@esbuild/openbsd-arm64@0.27.2': + optional: true - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + '@esbuild/openbsd-x64@0.27.0': + optional: true - write-file-atomic@5.0.1: - resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@esbuild/openbsd-x64@0.27.2': + optional: true - ws@8.19.0: - resolution: {integrity: sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true + '@esbuild/openharmony-arm64@0.27.0': + optional: true - y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} + '@esbuild/openharmony-arm64@0.27.2': + optional: true - yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + '@esbuild/sunos-x64@0.27.0': + optional: true - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} + '@esbuild/sunos-x64@0.27.2': + optional: true - yargs@17.7.2: - resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} - engines: {node: '>=12'} + '@esbuild/win32-arm64@0.27.0': + optional: true - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} + '@esbuild/win32-arm64@0.27.2': + optional: true -snapshots: + '@esbuild/win32-ia32@0.27.0': + optional: true - '@babel/code-frame@7.27.1': - dependencies: - '@babel/helper-validator-identifier': 7.28.5 - js-tokens: 4.0.0 - picocolors: 1.1.1 + '@esbuild/win32-ia32@0.27.2': + optional: true - '@babel/compat-data@7.28.5': {} + '@esbuild/win32-x64@0.27.0': + optional: true - '@babel/core@7.28.5': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.5 - '@babel/helper-compilation-targets': 7.27.2 - '@babel/helper-module-transforms': 7.28.3(@babel/core@7.28.5) - '@babel/helpers': 7.28.4 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.2 - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 - '@jridgewell/remapping': 2.3.5 - convert-source-map: 2.0.0 - debug: 4.4.3 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color + '@esbuild/win32-x64@0.27.2': + optional: true - '@babel/generator@7.28.5': + '@eslint-community/eslint-utils@4.9.0(eslint@9.39.2)': dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - jsesc: 3.1.0 + eslint: 9.39.2 + eslint-visitor-keys: 3.4.3 - '@babel/helper-compilation-targets@7.27.2': + '@eslint-community/eslint-utils@4.9.1(eslint@9.39.2)': dependencies: - '@babel/compat-data': 7.28.5 - '@babel/helper-validator-option': 7.27.1 - browserslist: 4.25.4 - lru-cache: 5.1.1 - semver: 6.3.1 + eslint: 9.39.2 + eslint-visitor-keys: 3.4.3 - '@babel/helper-globals@7.28.0': {} + '@eslint-community/regexpp@4.12.2': {} - '@babel/helper-module-imports@7.27.1': + '@eslint/config-array@0.21.1': dependencies: - '@babel/traverse': 7.28.5 - '@babel/types': 7.28.5 + '@eslint/object-schema': 2.1.7 + debug: 4.4.3 + minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.28.3(@babel/core@7.28.5)': + '@eslint/config-helpers@0.4.2': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 - '@babel/traverse': 7.28.5 - transitivePeerDependencies: - - supports-color - - '@babel/helper-plugin-utils@7.27.1': {} - - '@babel/helper-string-parser@7.27.1': {} - - '@babel/helper-validator-identifier@7.28.5': {} - - '@babel/helper-validator-option@7.27.1': {} + '@eslint/core': 0.17.0 - '@babel/helpers@7.28.4': + '@eslint/core@0.17.0': dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.28.5 + '@types/json-schema': 7.0.15 - '@babel/parser@7.28.5': + '@eslint/eslintrc@3.3.3': dependencies: - '@babel/types': 7.28.5 + ajv: 6.12.6 + debug: 4.4.3 + espree: 10.4.0 + globals: 14.0.0 + ignore: 5.3.2 + import-fresh: 3.3.1 + js-yaml: 4.1.1 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@eslint/js@9.39.2': {} - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@eslint/object-schema@2.1.7': {} - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.28.5)': + '@eslint/plugin-kit@0.4.1': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@eslint/core': 0.17.0 + levn: 0.4.1 - '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@humanfs/core@0.19.1': {} - '@babel/plugin-syntax-import-attributes@7.27.1(@babel/core@7.28.5)': + '@humanfs/node@0.16.7': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.4.3 - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@humanwhocodes/module-importer@1.0.1': {} - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@humanwhocodes/retry@0.4.3': {} - '@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@iarna/toml@2.2.5': {} - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.28.5)': + '@inquirer/external-editor@1.0.3(@types/node@25.0.3)': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + chardet: 2.1.1 + iconv-lite: 0.7.0 + optionalDependencies: + '@types/node': 25.0.3 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.28.5)': - dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@isaacs/balanced-match@4.0.1': {} - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.28.5)': + '@isaacs/brace-expansion@5.0.0': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@isaacs/balanced-match': 4.0.1 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.28.5)': + '@isaacs/cliui@8.0.2': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.1.2 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.28.5)': + '@istanbuljs/load-nyc-config@1.1.0': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.2 + resolve-from: 5.0.0 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.28.5)': + '@istanbuljs/schema@0.1.3': {} + + '@jest/console@30.0.0-alpha.6': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@jest/types': 30.0.0-alpha.6 + '@types/node': 25.5.0 + chalk: 4.1.2 + jest-message-util: 30.0.0-alpha.6 + jest-util: 30.0.0-alpha.6 + slash: 3.0.0 - '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.28.5)': + '@jest/core@30.0.0-alpha.6': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@jest/console': 30.0.0-alpha.6 + '@jest/pattern': 30.0.0-alpha.6 + '@jest/reporters': 30.0.0-alpha.6 + '@jest/test-result': 30.0.0-alpha.6 + '@jest/transform': 30.0.0-alpha.6 + '@jest/types': 30.0.0-alpha.6 + '@types/node': 25.5.0 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 4.4.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 30.0.0-alpha.6 + jest-config: 30.0.0-alpha.6(@types/node@25.5.0) + jest-haste-map: 30.0.0-alpha.6 + jest-message-util: 30.0.0-alpha.6 + jest-regex-util: 30.0.0-alpha.6 + jest-resolve: 30.0.0-alpha.6 + jest-resolve-dependencies: 30.0.0-alpha.6 + jest-runner: 30.0.0-alpha.6 + jest-runtime: 30.0.0-alpha.6 + jest-snapshot: 30.0.0-alpha.6 + jest-util: 30.0.0-alpha.6 + jest-validate: 30.0.0-alpha.6 + jest-watcher: 30.0.0-alpha.6 + micromatch: 4.0.8 + pretty-format: 30.0.0-alpha.6 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - esbuild-register + - supports-color + - ts-node - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.28.5)': + '@jest/environment@30.0.0-alpha.6': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + '@jest/fake-timers': 30.0.0-alpha.6 + '@jest/types': 30.0.0-alpha.6 + '@types/node': 25.5.0 + jest-mock: 30.0.0-alpha.6 - '@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.5)': + '@jest/expect-utils@30.0.0-alpha.6': dependencies: - '@babel/core': 7.28.5 - '@babel/helper-plugin-utils': 7.27.1 + jest-get-type: 30.0.0-alpha.6 - '@babel/runtime@7.28.4': {} + '@jest/expect@30.0.0-alpha.6': + dependencies: + expect: 30.0.0-alpha.6 + jest-snapshot: 30.0.0-alpha.6 + transitivePeerDependencies: + - supports-color - '@babel/template@7.27.2': + '@jest/fake-timers@30.0.0-alpha.6': dependencies: - '@babel/code-frame': 7.27.1 - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 + '@jest/types': 30.0.0-alpha.6 + '@sinonjs/fake-timers': 11.3.1 + '@types/node': 25.5.0 + jest-message-util: 30.0.0-alpha.6 + jest-mock: 30.0.0-alpha.6 + jest-util: 30.0.0-alpha.6 - '@babel/traverse@7.28.5': + '@jest/globals@30.0.0-alpha.6': dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.28.5 - '@babel/helper-globals': 7.28.0 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.2 - '@babel/types': 7.28.5 - debug: 4.4.3 + '@jest/environment': 30.0.0-alpha.6 + '@jest/expect': 30.0.0-alpha.6 + '@jest/types': 30.0.0-alpha.6 + jest-mock: 30.0.0-alpha.6 transitivePeerDependencies: - supports-color - '@babel/types@7.28.5': + '@jest/pattern@30.0.0-alpha.6': dependencies: - '@babel/helper-string-parser': 7.27.1 - '@babel/helper-validator-identifier': 7.28.5 + '@types/node': 25.5.0 + jest-regex-util: 30.0.0-alpha.6 - '@bcoe/v8-coverage@0.2.3': {} + '@jest/reporters@30.0.0-alpha.6': + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 30.0.0-alpha.6 + '@jest/test-result': 30.0.0-alpha.6 + '@jest/transform': 30.0.0-alpha.6 + '@jest/types': 30.0.0-alpha.6 + '@jridgewell/trace-mapping': 0.3.31 + '@types/node': 25.5.0 + chalk: 4.1.2 + collect-v8-coverage: 1.0.3 + exit: 0.1.2 + glob: 10.5.0 + graceful-fs: 4.2.11 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-instrument: 6.0.3 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 5.0.6 + istanbul-reports: 3.2.0 + jest-message-util: 30.0.0-alpha.6 + jest-util: 30.0.0-alpha.6 + jest-worker: 30.0.0-alpha.6 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.3.0 + transitivePeerDependencies: + - supports-color - '@changesets/apply-release-plan@7.0.14': + '@jest/schemas@30.0.0-alpha.6': dependencies: - '@changesets/config': 3.1.2 - '@changesets/get-version-range-type': 0.4.0 - '@changesets/git': 3.0.4 - '@changesets/should-skip-package': 0.1.2 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - detect-indent: 6.1.0 - fs-extra: 7.0.1 - lodash.startcase: 4.4.0 - outdent: 0.5.0 - prettier: 2.8.8 - resolve-from: 5.0.0 - semver: 7.7.3 + '@sinclair/typebox': 0.33.22 - '@changesets/assemble-release-plan@6.0.9': + '@jest/snapshot-utils@30.0.0-alpha.6': dependencies: - '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.3 - '@changesets/should-skip-package': 0.1.2 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - semver: 7.7.3 + '@jest/types': 30.0.0-alpha.6 + chalk: 4.1.2 + graceful-fs: 4.2.11 + natural-compare: 1.4.0 - '@changesets/changelog-git@0.2.1': + '@jest/source-map@30.0.0-alpha.6': dependencies: - '@changesets/types': 6.1.0 + '@jridgewell/trace-mapping': 0.3.31 + callsites: 3.1.0 + graceful-fs: 4.2.11 - '@changesets/changelog-github@0.5.2': + '@jest/test-result@30.0.0-alpha.6': dependencies: - '@changesets/get-github-info': 0.7.0 - '@changesets/types': 6.1.0 - dotenv: 8.6.0 - transitivePeerDependencies: - - encoding + '@jest/console': 30.0.0-alpha.6 + '@jest/types': 30.0.0-alpha.6 + '@types/istanbul-lib-coverage': 2.0.6 + collect-v8-coverage: 1.0.3 - '@changesets/cli@2.29.8(@types/node@25.0.3)': + '@jest/test-sequencer@30.0.0-alpha.6': dependencies: - '@changesets/apply-release-plan': 7.0.14 - '@changesets/assemble-release-plan': 6.0.9 - '@changesets/changelog-git': 0.2.1 - '@changesets/config': 3.1.2 - '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.3 - '@changesets/get-release-plan': 4.0.14 - '@changesets/git': 3.0.4 - '@changesets/logger': 0.1.1 - '@changesets/pre': 2.0.2 - '@changesets/read': 0.6.6 - '@changesets/should-skip-package': 0.1.2 - '@changesets/types': 6.1.0 - '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.3(@types/node@25.0.3) - '@manypkg/get-packages': 1.1.3 - ansi-colors: 4.1.3 - ci-info: 3.9.0 - enquirer: 2.4.1 - fs-extra: 7.0.1 - mri: 1.2.0 - p-limit: 2.3.0 - package-manager-detector: 0.2.11 - picocolors: 1.1.1 - resolve-from: 5.0.0 - semver: 7.7.3 - spawndamnit: 3.0.1 - term-size: 2.2.1 - transitivePeerDependencies: - - '@types/node' + '@jest/test-result': 30.0.0-alpha.6 + graceful-fs: 4.2.11 + jest-haste-map: 30.0.0-alpha.6 + slash: 3.0.0 - '@changesets/config@3.1.2': + '@jest/transform@30.0.0-alpha.6': dependencies: - '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.3 - '@changesets/logger': 0.1.1 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - fs-extra: 7.0.1 + '@babel/core': 7.29.0 + '@jest/types': 30.0.0-alpha.6 + '@jridgewell/trace-mapping': 0.3.31 + babel-plugin-istanbul: 7.0.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 30.0.0-alpha.6 + jest-regex-util: 30.0.0-alpha.6 + jest-util: 30.0.0-alpha.6 micromatch: 4.0.8 + pirates: 4.0.7 + slash: 3.0.0 + write-file-atomic: 5.0.1 + transitivePeerDependencies: + - supports-color - '@changesets/errors@0.2.0': + '@jest/types@30.0.0-alpha.6': dependencies: - extendable-error: 0.1.7 + '@jest/pattern': 30.0.0-alpha.6 + '@jest/schemas': 30.0.0-alpha.6 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 25.5.0 + '@types/yargs': 17.0.35 + chalk: 4.1.2 - '@changesets/get-dependents-graph@2.1.3': + '@jridgewell/gen-mapping@0.3.13': dependencies: - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - picocolors: 1.1.1 - semver: 7.7.3 + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 - '@changesets/get-github-info@0.7.0': + '@jridgewell/remapping@2.3.5': dependencies: - dataloader: 1.4.0 - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 - '@changesets/get-release-plan@4.0.14': - dependencies: - '@changesets/assemble-release-plan': 6.0.9 - '@changesets/config': 3.1.2 - '@changesets/pre': 2.0.2 - '@changesets/read': 0.6.6 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 + '@jridgewell/resolve-uri@3.1.2': {} - '@changesets/get-version-range-type@0.4.0': {} + '@jridgewell/sourcemap-codec@1.5.5': {} - '@changesets/git@3.0.4': + '@jridgewell/trace-mapping@0.3.31': dependencies: - '@changesets/errors': 0.2.0 - '@manypkg/get-packages': 1.1.3 - is-subdir: 1.2.0 - micromatch: 4.0.8 - spawndamnit: 3.0.1 + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 - '@changesets/logger@0.1.1': + '@manypkg/find-root@1.1.0': dependencies: - picocolors: 1.1.1 + '@babel/runtime': 7.28.4 + '@types/node': 12.20.55 + find-up: 4.1.0 + fs-extra: 8.1.0 - '@changesets/parse@0.4.2': + '@manypkg/get-packages@1.1.3': dependencies: - '@changesets/types': 6.1.0 - js-yaml: 4.1.1 + '@babel/runtime': 7.28.4 + '@changesets/types': 4.1.0 + '@manypkg/find-root': 1.1.0 + fs-extra: 8.1.0 + globby: 11.1.0 + read-yaml-file: 1.1.0 - '@changesets/pre@2.0.2': + '@metaplex-foundation/mpl-token-metadata-kit@0.0.2(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': dependencies: - '@changesets/errors': 0.2.0 - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - fs-extra: 7.0.1 + '@solana-program/token': 0.9.0(@solana/kit@5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana/accounts': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/instructions': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/kit': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/signers': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-confirmation': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + - ws - '@changesets/read@0.6.6': - dependencies: - '@changesets/git': 3.0.4 - '@changesets/logger': 0.1.1 - '@changesets/parse': 0.4.2 - '@changesets/types': 6.1.0 - fs-extra: 7.0.1 - p-filter: 2.1.0 - picocolors: 1.1.1 + '@noble/hashes@2.0.1': {} - '@changesets/should-skip-package@0.1.2': + '@nodelib/fs.scandir@2.1.5': dependencies: - '@changesets/types': 6.1.0 - '@manypkg/get-packages': 1.1.3 - - '@changesets/types@4.1.0': {} + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 - '@changesets/types@6.1.0': {} + '@nodelib/fs.stat@2.0.5': {} - '@changesets/write@0.4.0': + '@nodelib/fs.walk@1.2.8': dependencies: - '@changesets/types': 6.1.0 - fs-extra: 7.0.1 - human-id: 4.1.3 - prettier: 2.8.8 - - '@esbuild/aix-ppc64@0.27.0': - optional: true + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.19.1 - '@esbuild/aix-ppc64@0.27.2': + '@pkgjs/parseargs@0.11.0': optional: true - '@esbuild/android-arm64@0.27.0': - optional: true + '@pkgr/core@0.1.2': {} - '@esbuild/android-arm64@0.27.2': - optional: true + '@rollup/plugin-virtual@3.0.2(rollup@3.29.4)': + optionalDependencies: + rollup: 3.29.4 - '@esbuild/android-arm@0.27.0': + '@rollup/rollup-android-arm-eabi@4.53.2': optional: true - '@esbuild/android-arm@0.27.2': + '@rollup/rollup-android-arm-eabi@4.53.5': optional: true - '@esbuild/android-x64@0.27.0': + '@rollup/rollup-android-arm64@4.53.2': optional: true - '@esbuild/android-x64@0.27.2': + '@rollup/rollup-android-arm64@4.53.5': optional: true - '@esbuild/darwin-arm64@0.27.0': + '@rollup/rollup-darwin-arm64@4.53.2': optional: true - '@esbuild/darwin-arm64@0.27.2': + '@rollup/rollup-darwin-arm64@4.53.5': optional: true - '@esbuild/darwin-x64@0.27.0': + '@rollup/rollup-darwin-x64@4.53.2': optional: true - '@esbuild/darwin-x64@0.27.2': + '@rollup/rollup-darwin-x64@4.53.5': optional: true - '@esbuild/freebsd-arm64@0.27.0': + '@rollup/rollup-freebsd-arm64@4.53.2': optional: true - '@esbuild/freebsd-arm64@0.27.2': + '@rollup/rollup-freebsd-arm64@4.53.5': optional: true - '@esbuild/freebsd-x64@0.27.0': + '@rollup/rollup-freebsd-x64@4.53.2': optional: true - '@esbuild/freebsd-x64@0.27.2': + '@rollup/rollup-freebsd-x64@4.53.5': optional: true - '@esbuild/linux-arm64@0.27.0': + '@rollup/rollup-linux-arm-gnueabihf@4.53.2': optional: true - '@esbuild/linux-arm64@0.27.2': + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': optional: true - '@esbuild/linux-arm@0.27.0': + '@rollup/rollup-linux-arm-musleabihf@4.53.2': optional: true - '@esbuild/linux-arm@0.27.2': + '@rollup/rollup-linux-arm-musleabihf@4.53.5': optional: true - '@esbuild/linux-ia32@0.27.0': + '@rollup/rollup-linux-arm64-gnu@4.53.2': optional: true - '@esbuild/linux-ia32@0.27.2': + '@rollup/rollup-linux-arm64-gnu@4.53.5': optional: true - '@esbuild/linux-loong64@0.27.0': + '@rollup/rollup-linux-arm64-musl@4.53.2': optional: true - '@esbuild/linux-loong64@0.27.2': + '@rollup/rollup-linux-arm64-musl@4.53.5': optional: true - '@esbuild/linux-mips64el@0.27.0': + '@rollup/rollup-linux-loong64-gnu@4.53.2': optional: true - '@esbuild/linux-mips64el@0.27.2': + '@rollup/rollup-linux-loong64-gnu@4.53.5': optional: true - '@esbuild/linux-ppc64@0.27.0': + '@rollup/rollup-linux-ppc64-gnu@4.53.2': optional: true - '@esbuild/linux-ppc64@0.27.2': + '@rollup/rollup-linux-ppc64-gnu@4.53.5': optional: true - '@esbuild/linux-riscv64@0.27.0': + '@rollup/rollup-linux-riscv64-gnu@4.53.2': optional: true - '@esbuild/linux-riscv64@0.27.2': + '@rollup/rollup-linux-riscv64-gnu@4.53.5': optional: true - '@esbuild/linux-s390x@0.27.0': + '@rollup/rollup-linux-riscv64-musl@4.53.2': optional: true - '@esbuild/linux-s390x@0.27.2': + '@rollup/rollup-linux-riscv64-musl@4.53.5': optional: true - '@esbuild/linux-x64@0.27.0': + '@rollup/rollup-linux-s390x-gnu@4.53.2': optional: true - '@esbuild/linux-x64@0.27.2': + '@rollup/rollup-linux-s390x-gnu@4.53.5': optional: true - '@esbuild/netbsd-arm64@0.27.0': + '@rollup/rollup-linux-x64-gnu@4.53.2': optional: true - '@esbuild/netbsd-arm64@0.27.2': + '@rollup/rollup-linux-x64-gnu@4.53.5': optional: true - '@esbuild/netbsd-x64@0.27.0': + '@rollup/rollup-linux-x64-musl@4.53.2': optional: true - '@esbuild/netbsd-x64@0.27.2': + '@rollup/rollup-linux-x64-musl@4.53.5': optional: true - '@esbuild/openbsd-arm64@0.27.0': + '@rollup/rollup-openharmony-arm64@4.53.2': optional: true - '@esbuild/openbsd-arm64@0.27.2': + '@rollup/rollup-openharmony-arm64@4.53.5': optional: true - '@esbuild/openbsd-x64@0.27.0': + '@rollup/rollup-win32-arm64-msvc@4.53.2': optional: true - '@esbuild/openbsd-x64@0.27.2': + '@rollup/rollup-win32-arm64-msvc@4.53.5': optional: true - '@esbuild/openharmony-arm64@0.27.0': + '@rollup/rollup-win32-ia32-msvc@4.53.2': optional: true - '@esbuild/openharmony-arm64@0.27.2': + '@rollup/rollup-win32-ia32-msvc@4.53.5': optional: true - '@esbuild/sunos-x64@0.27.0': + '@rollup/rollup-win32-x64-gnu@4.53.2': optional: true - '@esbuild/sunos-x64@0.27.2': + '@rollup/rollup-win32-x64-gnu@4.53.5': optional: true - '@esbuild/win32-arm64@0.27.0': + '@rollup/rollup-win32-x64-msvc@4.53.2': optional: true - '@esbuild/win32-arm64@0.27.2': + '@rollup/rollup-win32-x64-msvc@4.53.5': optional: true - '@esbuild/win32-ia32@0.27.0': - optional: true + '@sinclair/typebox@0.33.22': {} - '@esbuild/win32-ia32@0.27.2': - optional: true + '@sinonjs/commons@3.0.1': + dependencies: + type-detect: 4.0.8 - '@esbuild/win32-x64@0.27.0': - optional: true + '@sinonjs/fake-timers@11.3.1': + dependencies: + '@sinonjs/commons': 3.0.1 - '@esbuild/win32-x64@0.27.2': - optional: true + '@solana-program/compute-budget@0.13.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': + dependencies: + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) - '@eslint-community/eslint-utils@4.9.0(eslint@9.39.2)': + '@solana-program/program-metadata@0.5.1(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': dependencies: - eslint: 9.39.2 - eslint-visitor-keys: 3.4.3 + '@iarna/toml': 2.2.5 + '@solana-program/compute-budget': 0.13.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana-program/system': 0.11.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + commander: 13.1.0 + pako: 2.1.0 + picocolors: 1.1.1 + yaml: 2.8.2 - '@eslint-community/regexpp@4.12.2': {} + '@solana-program/system@0.11.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': + dependencies: + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) - '@eslint/config-array@0.21.1': + '@solana-program/system@0.12.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': dependencies: - '@eslint/object-schema': 2.1.7 - debug: 4.4.3 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) - '@eslint/config-helpers@0.4.2': + '@solana-program/token-2022@0.9.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))(@solana/sysvars@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3))': dependencies: - '@eslint/core': 0.17.0 + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/sysvars': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@eslint/core@0.17.0': + '@solana-program/token@0.10.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': dependencies: - '@types/json-schema': 7.0.15 + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) - '@eslint/eslintrc@3.3.3': + '@solana-program/token@0.12.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': dependencies: - ajv: 6.12.6 - debug: 4.4.3 - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.1.1 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color + '@solana-program/system': 0.12.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) - '@eslint/js@9.39.2': {} + '@solana-program/token@0.9.0(@solana/kit@5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6))': + dependencies: + '@solana/kit': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) - '@eslint/object-schema@2.1.7': {} + '@solana/accounts@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec': 5.5.1(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@eslint/plugin-kit@0.4.1': + '@solana/accounts@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@eslint/core': 0.17.0 - levn: 0.4.1 + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@humanfs/core@0.19.1': {} + '@solana/addresses@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/assertions': 2.3.0(typescript@5.9.3) + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-strings': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/nominal-types': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@humanfs/node@0.16.7': + '@solana/addresses@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@humanfs/core': 0.19.1 - '@humanwhocodes/retry': 0.4.3 + '@solana/assertions': 5.5.1(typescript@5.9.3) + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@humanwhocodes/module-importer@1.0.1': {} + '@solana/addresses@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/assertions': 6.5.0(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@humanwhocodes/retry@0.4.3': {} + '@solana/assertions@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@inquirer/external-editor@1.0.3(@types/node@25.0.3)': + '@solana/assertions@5.5.1(typescript@5.9.3)': dependencies: - chardet: 2.1.1 - iconv-lite: 0.7.0 + '@solana/errors': 5.5.1(typescript@5.9.3) optionalDependencies: - '@types/node': 25.0.3 + typescript: 5.9.3 - '@isaacs/balanced-match@4.0.1': {} + '@solana/assertions@6.5.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@isaacs/brace-expansion@5.0.0': + '@solana/codecs-core@2.3.0(typescript@5.9.3)': dependencies: - '@isaacs/balanced-match': 4.0.1 + '@solana/errors': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@isaacs/cliui@8.0.2': + '@solana/codecs-core@5.5.1(typescript@5.9.3)': dependencies: - string-width: 5.1.2 - string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.2 - strip-ansi-cjs: strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: wrap-ansi@7.0.0 + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@istanbuljs/load-nyc-config@1.1.0': + '@solana/codecs-core@6.5.0(typescript@5.9.3)': dependencies: - camelcase: 5.3.1 - find-up: 4.1.0 - get-package-type: 0.1.0 - js-yaml: 3.14.2 - resolve-from: 5.0.0 + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@istanbuljs/schema@0.1.3': {} + '@solana/codecs-data-structures@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@jest/console@30.0.0-alpha.6': + '@solana/codecs-data-structures@5.5.1(typescript@5.9.3)': dependencies: - '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 - chalk: 4.1.2 - jest-message-util: 30.0.0-alpha.6 - jest-util: 30.0.0-alpha.6 - slash: 3.0.0 + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@jest/core@30.0.0-alpha.6': + '@solana/codecs-data-structures@6.5.0(typescript@5.9.3)': dependencies: - '@jest/console': 30.0.0-alpha.6 - '@jest/pattern': 30.0.0-alpha.6 - '@jest/reporters': 30.0.0-alpha.6 - '@jest/test-result': 30.0.0-alpha.6 - '@jest/transform': 30.0.0-alpha.6 - '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - ci-info: 4.3.1 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 30.0.0-alpha.6 - jest-config: 30.0.0-alpha.6(@types/node@25.0.3) - jest-haste-map: 30.0.0-alpha.6 - jest-message-util: 30.0.0-alpha.6 - jest-regex-util: 30.0.0-alpha.6 - jest-resolve: 30.0.0-alpha.6 - jest-resolve-dependencies: 30.0.0-alpha.6 - jest-runner: 30.0.0-alpha.6 - jest-runtime: 30.0.0-alpha.6 - jest-snapshot: 30.0.0-alpha.6 - jest-util: 30.0.0-alpha.6 - jest-validate: 30.0.0-alpha.6 - jest-watcher: 30.0.0-alpha.6 - micromatch: 4.0.8 - pretty-format: 30.0.0-alpha.6 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - babel-plugin-macros - - esbuild-register - - supports-color - - ts-node + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@jest/environment@30.0.0-alpha.6': + '@solana/codecs-numbers@2.3.0(typescript@5.9.3)': dependencies: - '@jest/fake-timers': 30.0.0-alpha.6 - '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 - jest-mock: 30.0.0-alpha.6 + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@jest/expect-utils@30.0.0-alpha.6': + '@solana/codecs-numbers@5.5.1(typescript@5.9.3)': dependencies: - jest-get-type: 30.0.0-alpha.6 + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@jest/expect@30.0.0-alpha.6': + '@solana/codecs-numbers@6.5.0(typescript@5.9.3)': dependencies: - expect: 30.0.0-alpha.6 - jest-snapshot: 30.0.0-alpha.6 - transitivePeerDependencies: - - supports-color + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@jest/fake-timers@30.0.0-alpha.6': + '@solana/codecs-strings@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@jest/types': 30.0.0-alpha.6 - '@sinonjs/fake-timers': 11.3.1 - '@types/node': 25.0.3 - jest-message-util: 30.0.0-alpha.6 - jest-mock: 30.0.0-alpha.6 - jest-util: 30.0.0-alpha.6 + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + fastestsmallesttextencoderdecoder: 1.0.22 + typescript: 5.9.3 - '@jest/globals@30.0.0-alpha.6': + '@solana/codecs-strings@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@jest/environment': 30.0.0-alpha.6 - '@jest/expect': 30.0.0-alpha.6 - '@jest/types': 30.0.0-alpha.6 - jest-mock: 30.0.0-alpha.6 - transitivePeerDependencies: - - supports-color + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + fastestsmallesttextencoderdecoder: 1.0.22 + typescript: 5.9.3 - '@jest/pattern@30.0.0-alpha.6': + '@solana/codecs-strings@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@types/node': 25.0.3 - jest-regex-util: 30.0.0-alpha.6 + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + fastestsmallesttextencoderdecoder: 1.0.22 + typescript: 5.9.3 - '@jest/reporters@30.0.0-alpha.6': + '@solana/codecs@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 30.0.0-alpha.6 - '@jest/test-result': 30.0.0-alpha.6 - '@jest/transform': 30.0.0-alpha.6 - '@jest/types': 30.0.0-alpha.6 - '@jridgewell/trace-mapping': 0.3.31 - '@types/node': 25.0.3 - chalk: 4.1.2 - collect-v8-coverage: 1.0.3 - exit: 0.1.2 - glob: 10.5.0 - graceful-fs: 4.2.11 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-instrument: 6.0.3 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 5.0.6 - istanbul-reports: 3.2.0 - jest-message-util: 30.0.0-alpha.6 - jest-util: 30.0.0-alpha.6 - jest-worker: 30.0.0-alpha.6 - slash: 3.0.0 - string-length: 4.0.2 - strip-ansi: 6.0.1 - v8-to-istanbul: 9.3.0 + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-data-structures': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/options': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 transitivePeerDependencies: - - supports-color + - fastestsmallesttextencoderdecoder - '@jest/schemas@30.0.0-alpha.6': + '@solana/codecs@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@sinclair/typebox': 0.33.22 + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-data-structures': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/options': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@jest/snapshot-utils@30.0.0-alpha.6': + '@solana/errors@2.3.0(typescript@5.9.3)': dependencies: - '@jest/types': 30.0.0-alpha.6 - chalk: 4.1.2 - graceful-fs: 4.2.11 - natural-compare: 1.4.0 + chalk: 5.6.2 + commander: 14.0.3 + typescript: 5.9.3 - '@jest/source-map@30.0.0-alpha.6': + '@solana/errors@5.5.1(typescript@5.9.3)': dependencies: - '@jridgewell/trace-mapping': 0.3.31 - callsites: 3.1.0 - graceful-fs: 4.2.11 + chalk: 5.6.2 + commander: 14.0.2 + optionalDependencies: + typescript: 5.9.3 - '@jest/test-result@30.0.0-alpha.6': + '@solana/errors@6.5.0(typescript@5.9.3)': dependencies: - '@jest/console': 30.0.0-alpha.6 - '@jest/types': 30.0.0-alpha.6 - '@types/istanbul-lib-coverage': 2.0.6 - collect-v8-coverage: 1.0.3 + chalk: 5.6.2 + commander: 14.0.3 + optionalDependencies: + typescript: 5.9.3 - '@jest/test-sequencer@30.0.0-alpha.6': + '@solana/eslint-config-solana@5.0.0(@eslint/js@9.39.2)(@types/eslint__js@8.42.3)(eslint-plugin-jest@27.9.0(eslint@9.39.2)(jest@30.0.0-alpha.6(@types/node@25.0.3))(typescript@5.9.3))(eslint-plugin-react-hooks@4.6.0(eslint@9.39.2))(eslint-plugin-simple-import-sort@12.1.1(eslint@9.39.2))(eslint-plugin-sort-keys-fix@1.1.2)(eslint-plugin-typescript-sort-keys@3.3.0(@typescript-eslint/parser@8.43.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(globals@14.0.0)(jest@30.0.0-alpha.6(@types/node@25.0.3))(typescript-eslint@8.43.0(eslint@9.39.2)(typescript@5.9.3))(typescript@5.9.3)': dependencies: - '@jest/test-result': 30.0.0-alpha.6 - graceful-fs: 4.2.11 - jest-haste-map: 30.0.0-alpha.6 - slash: 3.0.0 + '@eslint/js': 9.39.2 + '@types/eslint__js': 8.42.3 + eslint: 9.39.2 + eslint-plugin-jest: 27.9.0(eslint@9.39.2)(jest@30.0.0-alpha.6(@types/node@25.0.3))(typescript@5.9.3) + eslint-plugin-react-hooks: 4.6.0(eslint@9.39.2) + eslint-plugin-simple-import-sort: 12.1.1(eslint@9.39.2) + eslint-plugin-sort-keys-fix: 1.1.2 + eslint-plugin-typescript-sort-keys: 3.3.0(@typescript-eslint/parser@8.43.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3) + globals: 14.0.0 + jest: 30.0.0-alpha.6(@types/node@25.0.3) + typescript: 5.9.3 + typescript-eslint: 8.43.0(eslint@9.39.2)(typescript@5.9.3) - '@jest/transform@30.0.0-alpha.6': + '@solana/fast-stable-stringify@2.3.0(typescript@5.9.3)': dependencies: - '@babel/core': 7.28.5 - '@jest/types': 30.0.0-alpha.6 - '@jridgewell/trace-mapping': 0.3.31 - babel-plugin-istanbul: 7.0.1 - chalk: 4.1.2 - convert-source-map: 2.0.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.11 - jest-haste-map: 30.0.0-alpha.6 - jest-regex-util: 30.0.0-alpha.6 - jest-util: 30.0.0-alpha.6 - micromatch: 4.0.8 - pirates: 4.0.7 - slash: 3.0.0 - write-file-atomic: 5.0.1 - transitivePeerDependencies: - - supports-color + typescript: 5.9.3 - '@jest/types@30.0.0-alpha.6': + '@solana/fast-stable-stringify@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 + + '@solana/fast-stable-stringify@6.5.0(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 + + '@solana/functional@2.3.0(typescript@5.9.3)': dependencies: - '@jest/pattern': 30.0.0-alpha.6 - '@jest/schemas': 30.0.0-alpha.6 - '@types/istanbul-lib-coverage': 2.0.6 - '@types/istanbul-reports': 3.0.4 - '@types/node': 25.0.3 - '@types/yargs': 17.0.35 - chalk: 4.1.2 + typescript: 5.9.3 - '@jridgewell/gen-mapping@0.3.13': + '@solana/functional@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 + + '@solana/functional@6.5.0(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 + + '@solana/instruction-plans@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.31 + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/instructions': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/promises': 5.5.1(typescript@5.9.3) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@jridgewell/remapping@2.3.5': + '@solana/instruction-plans@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/instructions': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/promises': 6.5.0(typescript@5.9.3) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@jridgewell/resolve-uri@3.1.2': {} + '@solana/instructions@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@jridgewell/sourcemap-codec@1.5.5': {} + '@solana/instructions@5.5.1(typescript@5.9.3)': + dependencies: + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@jridgewell/trace-mapping@0.3.31': + '@solana/instructions@6.5.0(typescript@5.9.3)': dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@manypkg/find-root@1.1.0': + '@solana/keys@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@babel/runtime': 7.28.4 - '@types/node': 12.20.55 - find-up: 4.1.0 - fs-extra: 8.1.0 + '@solana/assertions': 2.3.0(typescript@5.9.3) + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-strings': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/nominal-types': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@manypkg/get-packages@1.1.3': + '@solana/keys@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@babel/runtime': 7.28.4 - '@changesets/types': 4.1.0 - '@manypkg/find-root': 1.1.0 - fs-extra: 8.1.0 - globby: 11.1.0 - read-yaml-file: 1.1.0 + '@solana/assertions': 5.5.1(typescript@5.9.3) + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@noble/hashes@2.0.1': {} + '@solana/keys@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/assertions': 6.5.0(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@nodelib/fs.scandir@2.1.5': + '@solana/kit@5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)': dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 + '@solana/accounts': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/instruction-plans': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/instructions': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/offchain-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/plugin-core': 5.5.1(typescript@5.9.3) + '@solana/programs': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-api': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-parsed-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-subscriptions': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/signers': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/sysvars': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-confirmation': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - utf-8-validate - '@nodelib/fs.stat@2.0.5': {} + '@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)': + dependencies: + '@solana/accounts': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/instruction-plans': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/instructions': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/offchain-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/plugin-core': 6.5.0(typescript@5.9.3) + '@solana/plugin-interfaces': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/program-client-core': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/programs': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-api': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-parsed-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-subscriptions': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/signers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/sysvars': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-confirmation': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - utf-8-validate - '@nodelib/fs.walk@1.2.8': + '@solana/nominal-types@2.3.0(typescript@5.9.3)': dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.19.1 - - '@pkgjs/parseargs@0.11.0': - optional: true + typescript: 5.9.3 - '@pkgr/core@0.1.2': {} + '@solana/nominal-types@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/plugin-virtual@3.0.2(rollup@3.29.4)': + '@solana/nominal-types@6.5.0(typescript@5.9.3)': optionalDependencies: - rollup: 3.29.4 + typescript: 5.9.3 - '@rollup/rollup-android-arm-eabi@4.53.2': - optional: true + '@solana/offchain-messages@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-data-structures': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-android-arm-eabi@4.53.5': - optional: true + '@solana/offchain-messages@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-data-structures': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-android-arm64@4.53.2': - optional: true + '@solana/options@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-data-structures': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-android-arm64@4.53.5': - optional: true + '@solana/options@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-data-structures': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-darwin-arm64@4.53.2': - optional: true + '@solana/plugin-core@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-darwin-arm64@4.53.5': - optional: true + '@solana/plugin-core@6.5.0(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-darwin-x64@4.53.2': - optional: true + '@solana/plugin-interfaces@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/instruction-plans': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/signers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-darwin-x64@4.53.5': - optional: true + '@solana/prettier-config-solana@0.0.6(prettier@3.7.4)': + dependencies: + prettier: 3.7.4 - '@rollup/rollup-freebsd-arm64@4.53.2': - optional: true + '@solana/program-client-core@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/accounts': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/instruction-plans': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/instructions': 6.5.0(typescript@5.9.3) + '@solana/plugin-interfaces': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-api': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/signers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-freebsd-arm64@4.53.5': - optional: true + '@solana/programs@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-freebsd-x64@4.53.2': - optional: true + '@solana/programs@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-freebsd-x64@4.53.5': - optional: true + '@solana/promises@2.3.0(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-arm-gnueabihf@4.53.2': - optional: true + '@solana/promises@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-arm-gnueabihf@4.53.5': - optional: true + '@solana/promises@6.5.0(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-arm-musleabihf@4.53.2': - optional: true + '@solana/rpc-api@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-strings': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/keys': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-parsed-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec': 2.3.0(typescript@5.9.3) + '@solana/rpc-transformers': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-linux-arm-musleabihf@4.53.5': - optional: true + '@solana/rpc-api@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-parsed-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec': 5.5.1(typescript@5.9.3) + '@solana/rpc-transformers': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-linux-arm64-gnu@4.53.2': - optional: true + '@solana/rpc-api@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-parsed-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-transformers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-linux-arm64-gnu@4.53.5': - optional: true + '@solana/rpc-parsed-types@2.3.0(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-arm64-musl@4.53.2': - optional: true + '@solana/rpc-parsed-types@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-arm64-musl@4.53.5': - optional: true + '@solana/rpc-parsed-types@6.5.0(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-loong64-gnu@4.53.2': - optional: true + '@solana/rpc-spec-types@2.3.0(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-loong64-gnu@4.53.5': - optional: true + '@solana/rpc-spec-types@5.5.1(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-ppc64-gnu@4.53.2': - optional: true + '@solana/rpc-spec-types@6.5.0(typescript@5.9.3)': + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-ppc64-gnu@4.53.5': - optional: true + '@solana/rpc-spec@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec-types': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@rollup/rollup-linux-riscv64-gnu@4.53.2': - optional: true + '@solana/rpc-spec@5.5.1(typescript@5.9.3)': + dependencies: + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-riscv64-gnu@4.53.5': - optional: true + '@solana/rpc-spec@6.5.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-linux-riscv64-musl@4.53.2': - optional: true + '@solana/rpc-subscriptions-api@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/keys': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 2.3.0(typescript@5.9.3) + '@solana/rpc-transformers': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-linux-riscv64-musl@4.53.5': - optional: true + '@solana/rpc-subscriptions-api@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 5.5.1(typescript@5.9.3) + '@solana/rpc-transformers': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-linux-s390x-gnu@4.53.2': - optional: true + '@solana/rpc-subscriptions-api@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-transformers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-linux-s390x-gnu@4.53.5': - optional: true + '@solana/rpc-subscriptions-channel-websocket@2.3.0(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/functional': 2.3.0(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 2.3.0(typescript@5.9.3) + '@solana/subscribable': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + ws: 8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) - '@rollup/rollup-linux-x64-gnu@4.53.2': - optional: true + '@solana/rpc-subscriptions-channel-websocket@5.5.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)': + dependencies: + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 5.5.1(typescript@5.9.3) + '@solana/subscribable': 5.5.1(typescript@5.9.3) + ws: 8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate - '@rollup/rollup-linux-x64-gnu@4.53.5': - optional: true + '@solana/rpc-subscriptions-channel-websocket@6.5.0(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/rpc-subscriptions-spec': 6.5.0(typescript@5.9.3) + '@solana/subscribable': 6.5.0(typescript@5.9.3) + ws: 8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate - '@rollup/rollup-linux-x64-musl@4.53.2': - optional: true + '@solana/rpc-subscriptions-spec@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/promises': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec-types': 2.3.0(typescript@5.9.3) + '@solana/subscribable': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 - '@rollup/rollup-linux-x64-musl@4.53.5': - optional: true + '@solana/rpc-subscriptions-spec@5.5.1(typescript@5.9.3)': + dependencies: + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/promises': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + '@solana/subscribable': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-openharmony-arm64@4.53.2': - optional: true + '@solana/rpc-subscriptions-spec@6.5.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/promises': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + '@solana/subscribable': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-openharmony-arm64@4.53.5': - optional: true + '@solana/rpc-subscriptions@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/fast-stable-stringify': 2.3.0(typescript@5.9.3) + '@solana/functional': 2.3.0(typescript@5.9.3) + '@solana/promises': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-subscriptions-api': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions-channel-websocket': 2.3.0(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + '@solana/rpc-subscriptions-spec': 2.3.0(typescript@5.9.3) + '@solana/rpc-transformers': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/subscribable': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + - ws - '@rollup/rollup-win32-arm64-msvc@4.53.2': - optional: true + '@solana/rpc-subscriptions@5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)': + dependencies: + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/fast-stable-stringify': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/promises': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-subscriptions-api': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions-channel-websocket': 5.5.1(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-subscriptions-spec': 5.5.1(typescript@5.9.3) + '@solana/rpc-transformers': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/subscribable': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - utf-8-validate - '@rollup/rollup-win32-arm64-msvc@4.53.5': - optional: true + '@solana/rpc-subscriptions@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/fast-stable-stringify': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/promises': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-subscriptions-api': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions-channel-websocket': 6.5.0(bufferutil@4.1.0)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-subscriptions-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-transformers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/subscribable': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - utf-8-validate - '@rollup/rollup-win32-ia32-msvc@4.53.2': - optional: true + '@solana/rpc-transformers@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/functional': 2.3.0(typescript@5.9.3) + '@solana/nominal-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-win32-ia32-msvc@4.53.5': - optional: true + '@solana/rpc-transformers@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-win32-x64-gnu@4.53.2': - optional: true + '@solana/rpc-transformers@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@rollup/rollup-win32-x64-gnu@4.53.5': - optional: true + '@solana/rpc-transport-http@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec-types': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + undici-types: 7.24.6 - '@rollup/rollup-win32-x64-msvc@4.53.2': - optional: true + '@solana/rpc-transport-http@5.5.1(typescript@5.9.3)': + dependencies: + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + undici-types: 7.24.6 + optionalDependencies: + typescript: 5.9.3 - '@rollup/rollup-win32-x64-msvc@4.53.5': - optional: true + '@solana/rpc-transport-http@6.5.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + undici-types: 7.24.6 + optionalDependencies: + typescript: 5.9.3 - '@sinclair/typebox@0.33.22': {} + '@solana/rpc-types@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.3) + '@solana/codecs-strings': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/nominal-types': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@sinonjs/commons@3.0.1': + '@solana/rpc-types@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - type-detect: 4.0.8 + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@sinonjs/fake-timers@11.3.1': + '@solana/rpc-types@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@sinonjs/commons': 3.0.1 + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@solana/codecs-core@5.5.1(typescript@5.9.3)': + '@solana/rpc@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/fast-stable-stringify': 2.3.0(typescript@5.9.3) + '@solana/functional': 2.3.0(typescript@5.9.3) + '@solana/rpc-api': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-spec': 2.3.0(typescript@5.9.3) + '@solana/rpc-spec-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-transformers': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-transport-http': 2.3.0(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/rpc@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/fast-stable-stringify': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/rpc-api': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-spec': 5.5.1(typescript@5.9.3) + '@solana/rpc-spec-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-transformers': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-transport-http': 5.5.1(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@solana/codecs-data-structures@5.5.1(typescript@5.9.3)': + '@solana/rpc@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/fast-stable-stringify': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/rpc-api': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-spec': 6.5.0(typescript@5.9.3) + '@solana/rpc-spec-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-transformers': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-transport-http': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/signers@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@solana/codecs-core': 5.5.1(typescript@5.9.3) - '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/instructions': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + '@solana/offchain-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@solana/codecs-numbers@5.5.1(typescript@5.9.3)': + '@solana/signers@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/instructions': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + '@solana/offchain-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/subscribable@2.3.0(typescript@5.9.3)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.3) + typescript: 5.9.3 + + '@solana/subscribable@5.5.1(typescript@5.9.3)': dependencies: - '@solana/codecs-core': 5.5.1(typescript@5.9.3) '@solana/errors': 5.5.1(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 - '@solana/codecs-strings@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/subscribable@6.5.0(typescript@5.9.3)': dependencies: - '@solana/codecs-core': 5.5.1(typescript@5.9.3) - '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) - '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) optionalDependencies: - fastestsmallesttextencoderdecoder: 1.0.22 typescript: 5.9.3 - '@solana/codecs@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/sysvars@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@solana/codecs-core': 5.5.1(typescript@5.9.3) - '@solana/codecs-data-structures': 5.5.1(typescript@5.9.3) - '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) - '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/options': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/accounts': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/errors@5.5.1(typescript@5.9.3)': + '@solana/sysvars@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - chalk: 5.6.2 - commander: 14.0.2 + '@solana/accounts': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-data-structures': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/transaction-confirmation@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))': + dependencies: + '@solana/addresses': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-strings': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/keys': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/promises': 2.3.0(typescript@5.9.3) + '@solana/rpc': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + - ws - '@solana/eslint-config-solana@5.0.0(@eslint/js@9.39.2)(@types/eslint__js@8.42.3)(eslint-plugin-jest@27.9.0(eslint@9.39.2)(jest@30.0.0-alpha.6(@types/node@25.0.3))(typescript@5.9.3))(eslint-plugin-react-hooks@4.6.0(eslint@9.39.2))(eslint-plugin-simple-import-sort@12.1.1(eslint@9.39.2))(eslint-plugin-sort-keys-fix@1.1.2)(eslint-plugin-typescript-sort-keys@3.3.0(@typescript-eslint/parser@8.43.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(globals@14.0.0)(jest@30.0.0-alpha.6(@types/node@25.0.3))(typescript-eslint@8.43.0(eslint@9.39.2)(typescript@5.9.3))(typescript@5.9.3)': + '@solana/transaction-confirmation@5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)': dependencies: - '@eslint/js': 9.39.2 - '@types/eslint__js': 8.42.3 - eslint: 9.39.2 - eslint-plugin-jest: 27.9.0(eslint@9.39.2)(jest@30.0.0-alpha.6(@types/node@25.0.3))(typescript@5.9.3) - eslint-plugin-react-hooks: 4.6.0(eslint@9.39.2) - eslint-plugin-simple-import-sort: 12.1.1(eslint@9.39.2) - eslint-plugin-sort-keys-fix: 1.1.2 - eslint-plugin-typescript-sort-keys: 3.3.0(@typescript-eslint/parser@8.43.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3) - globals: 14.0.0 - jest: 30.0.0-alpha.6(@types/node@25.0.3) + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/promises': 5.5.1(typescript@5.9.3) + '@solana/rpc': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: typescript: 5.9.3 - typescript-eslint: 8.43.0(eslint@9.39.2)(typescript@5.9.3) + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - utf-8-validate - '@solana/instructions@5.5.1(typescript@5.9.3)': + '@solana/transaction-confirmation@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/promises': 6.5.0(typescript@5.9.3) + '@solana/rpc': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/rpc-subscriptions': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transactions': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - utf-8-validate + + '@solana/transaction-messages@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-data-structures': 2.3.0(typescript@5.9.3) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/functional': 2.3.0(typescript@5.9.3) + '@solana/instructions': 2.3.0(typescript@5.9.3) + '@solana/nominal-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/transaction-messages@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@solana/codecs-core': 5.5.1(typescript@5.9.3) + '@solana/codecs-data-structures': 5.5.1(typescript@5.9.3) + '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/instructions': 5.5.1(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder - '@solana/options@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/transaction-messages@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-data-structures': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/instructions': 6.5.0(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/transactions@2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 2.3.0(typescript@5.9.3) + '@solana/codecs-data-structures': 2.3.0(typescript@5.9.3) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.3) + '@solana/codecs-strings': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 2.3.0(typescript@5.9.3) + '@solana/functional': 2.3.0(typescript@5.9.3) + '@solana/instructions': 2.3.0(typescript@5.9.3) + '@solana/keys': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 2.3.0(typescript@5.9.3) + '@solana/rpc-types': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 2.3.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/transactions@5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: + '@solana/addresses': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@solana/codecs-core': 5.5.1(typescript@5.9.3) '@solana/codecs-data-structures': 5.5.1(typescript@5.9.3) '@solana/codecs-numbers': 5.5.1(typescript@5.9.3) '@solana/codecs-strings': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@solana/errors': 5.5.1(typescript@5.9.3) + '@solana/functional': 5.5.1(typescript@5.9.3) + '@solana/instructions': 5.5.1(typescript@5.9.3) + '@solana/keys': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 5.5.1(typescript@5.9.3) + '@solana/rpc-types': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 5.5.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/prettier-config-solana@0.0.6(prettier@3.7.4)': - dependencies: - prettier: 3.7.4 + '@solana/transactions@6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + dependencies: + '@solana/addresses': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs-core': 6.5.0(typescript@5.9.3) + '@solana/codecs-data-structures': 6.5.0(typescript@5.9.3) + '@solana/codecs-numbers': 6.5.0(typescript@5.9.3) + '@solana/codecs-strings': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/errors': 6.5.0(typescript@5.9.3) + '@solana/functional': 6.5.0(typescript@5.9.3) + '@solana/instructions': 6.5.0(typescript@5.9.3) + '@solana/keys': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/nominal-types': 6.5.0(typescript@5.9.3) + '@solana/rpc-types': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/transaction-messages': 6.5.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder '@standard-schema/spec@1.1.0': {} '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.28.0 '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.28.5 - '@babel/types': 7.28.5 + '@babel/parser': 7.29.2 + '@babel/types': 7.29.0 '@types/babel__traverse@7.28.0': dependencies: - '@babel/types': 7.28.5 + '@babel/types': 7.29.0 '@types/chai@5.2.3': dependencies: @@ -4432,6 +6658,10 @@ snapshots: dependencies: undici-types: 7.16.0 + '@types/node@25.5.0': + dependencies: + undici-types: 7.18.2 + '@types/prompts@2.4.9': dependencies: '@types/node': 22.12.0 @@ -4465,7 +6695,7 @@ snapshots: graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.9.3) + ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -4520,7 +6750,7 @@ snapshots: '@typescript-eslint/utils': 8.43.0(eslint@9.39.2)(typescript@5.9.3) debug: 4.4.3 eslint: 9.39.2 - ts-api-utils: 2.1.0(typescript@5.9.3) + ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color @@ -4536,7 +6766,7 @@ snapshots: debug: 4.4.3 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.7.3 + semver: 7.7.4 tsutils: 3.21.0(typescript@5.9.3) optionalDependencies: typescript: 5.9.3 @@ -4552,16 +6782,16 @@ snapshots: debug: 4.4.3 fast-glob: 3.3.3 is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.7.3 - ts-api-utils: 2.1.0(typescript@5.9.3) + minimatch: 9.0.9 + semver: 7.7.4 + ts-api-utils: 2.5.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color '@typescript-eslint/utils@5.62.0(eslint@9.39.2)(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2) '@types/json-schema': 7.0.15 '@types/semver': 7.7.1 '@typescript-eslint/scope-manager': 5.62.0 @@ -4569,14 +6799,14 @@ snapshots: '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) eslint: 9.39.2 eslint-scope: 5.1.1 - semver: 7.7.3 + semver: 7.7.4 transitivePeerDependencies: - supports-color - typescript '@typescript-eslint/utils@8.43.0(eslint@9.39.2)(typescript@5.9.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2) '@typescript-eslint/scope-manager': 8.43.0 '@typescript-eslint/types': 8.43.0 '@typescript-eslint/typescript-estree': 8.43.0(typescript@5.9.3) @@ -4606,13 +6836,13 @@ snapshots: chai: 6.2.1 tinyrainbow: 3.0.3 - '@vitest/mocker@4.0.16(vite@7.3.0(@types/node@25.0.3))': + '@vitest/mocker@4.0.16(vite@7.3.0(@types/node@25.0.3)(yaml@2.8.2))': dependencies: '@vitest/spy': 4.0.16 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.0(@types/node@25.0.3) + vite: 7.3.0(@types/node@25.0.3)(yaml@2.8.2) '@vitest/pretty-format@4.0.16': dependencies: @@ -4686,7 +6916,7 @@ snapshots: anymatch@3.1.3: dependencies: normalize-path: 3.0.0 - picomatch: 2.3.1 + picomatch: 2.3.2 argparse@1.0.10: dependencies: @@ -4698,13 +6928,13 @@ snapshots: assertion-error@2.0.1: {} - babel-jest@30.0.0-alpha.6(@babel/core@7.28.5): + babel-jest@30.0.0-alpha.6(@babel/core@7.29.0): dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.0 '@jest/transform': 30.0.0-alpha.6 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 7.0.1 - babel-preset-jest: 30.0.0-alpha.6(@babel/core@7.28.5) + babel-preset-jest: 30.0.0-alpha.6(@babel/core@7.29.0) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -4713,7 +6943,7 @@ snapshots: babel-plugin-istanbul@7.0.1: dependencies: - '@babel/helper-plugin-utils': 7.27.1 + '@babel/helper-plugin-utils': 7.28.6 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 6.0.3 @@ -4723,50 +6953,68 @@ snapshots: babel-plugin-jest-hoist@30.0.0-alpha.6: dependencies: - '@babel/template': 7.27.2 - '@babel/types': 7.28.5 + '@babel/template': 7.28.6 + '@babel/types': 7.29.0 '@types/babel__core': 7.20.5 - babel-preset-current-node-syntax@1.2.0(@babel/core@7.28.5): - dependencies: - '@babel/core': 7.28.5 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.28.5) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.28.5) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.28.5) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.28.5) - '@babel/plugin-syntax-import-attributes': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.28.5) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.28.5) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.28.5) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.28.5) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.28.5) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.28.5) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.28.5) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.28.5) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.28.5) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.28.5) - - babel-preset-jest@30.0.0-alpha.6(@babel/core@7.28.5): - dependencies: - '@babel/core': 7.28.5 + babel-preset-current-node-syntax@1.2.0(@babel/core@7.29.0): + dependencies: + '@babel/core': 7.29.0 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.29.0) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.29.0) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.29.0) + '@babel/plugin-syntax-import-attributes': 7.28.6(@babel/core@7.29.0) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.29.0) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.29.0) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.29.0) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.29.0) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.29.0) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.29.0) + + babel-preset-jest@30.0.0-alpha.6(@babel/core@7.29.0): + dependencies: + '@babel/core': 7.29.0 babel-plugin-jest-hoist: 30.0.0-alpha.6 - babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.5) + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.29.0) balanced-match@1.0.2: {} + base64-js@1.5.1: {} + better-path-resolve@1.0.0: dependencies: is-windows: 1.0.2 + borsh@2.0.0: {} + + borsher@4.0.0: + dependencies: + borsh: 2.0.0 + buffer: 6.0.3 + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + brace-expansion@1.1.13: + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + brace-expansion@2.0.2: dependencies: balanced-match: 1.0.2 + brace-expansion@2.0.3: + dependencies: + balanced-match: 1.0.2 + braces@3.0.3: dependencies: fill-range: 7.1.1 @@ -4778,9 +7026,9 @@ snapshots: browserslist@4.25.4: dependencies: - caniuse-lite: 1.0.30001760 - electron-to-chromium: 1.5.267 - node-releases: 2.0.27 + caniuse-lite: 1.0.30001782 + electron-to-chromium: 1.5.329 + node-releases: 2.0.36 update-browserslist-db: 1.2.3(browserslist@4.25.4) bser@2.1.1: @@ -4789,6 +7037,16 @@ snapshots: buffer-from@1.1.2: {} + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + bufferutil@4.1.0: + dependencies: + node-gyp-build: 4.8.4 + optional: true + bundle-require@5.1.0(esbuild@0.27.0): dependencies: esbuild: 0.27.0 @@ -4824,7 +7082,7 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001760: {} + caniuse-lite@1.0.30001782: {} chai@6.2.1: {} @@ -4845,7 +7103,7 @@ snapshots: ci-info@3.9.0: {} - ci-info@4.3.1: {} + ci-info@4.4.0: {} cjs-module-lexer@1.4.3: {} @@ -4865,8 +7123,12 @@ snapshots: color-name@1.1.4: {} + commander@13.1.0: {} + commander@14.0.2: {} + commander@14.0.3: {} + commander@4.1.1: {} concat-map@0.0.1: {} @@ -4889,7 +7151,7 @@ snapshots: dependencies: ms: 2.1.3 - dedent@1.7.0: {} + dedent@1.7.2: {} deep-is@0.1.4: {} @@ -4921,7 +7183,7 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.5.267: {} + electron-to-chromium@1.5.329: {} emittery@0.13.1: {} @@ -5182,8 +7444,7 @@ snapshots: fast-levenshtein@2.0.6: {} - fastestsmallesttextencoderdecoder@1.0.22: - optional: true + fastestsmallesttextencoderdecoder@1.0.22: {} fastq@1.19.1: dependencies: @@ -5319,7 +7580,7 @@ snapshots: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.1.2 + minimatch: 3.1.5 once: 1.4.0 path-is-absolute: 1.0.1 @@ -5340,14 +7601,14 @@ snapshots: graphemer@1.4.0: {} - happy-dom@20.5.0: + happy-dom@20.5.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): dependencies: '@types/node': 25.0.3 '@types/whatwg-mimetype': 3.0.2 '@types/ws': 8.18.1 entities: 4.5.0 whatwg-mimetype: 3.0.0 - ws: 8.19.0 + ws: 8.19.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -5374,6 +7635,8 @@ snapshots: dependencies: safer-buffer: 2.1.2 + ieee754@1.2.1: {} + ignore@5.3.2: {} ignore@7.0.5: {} @@ -5431,11 +7694,11 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: - '@babel/core': 7.28.5 - '@babel/parser': 7.28.5 + '@babel/core': 7.29.0 + '@babel/parser': 7.29.2 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.7.3 + semver: 7.7.4 transitivePeerDependencies: - supports-color @@ -5476,10 +7739,10 @@ snapshots: '@jest/expect': 30.0.0-alpha.6 '@jest/test-result': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 chalk: 4.1.2 co: 4.6.0 - dedent: 1.7.0 + dedent: 1.7.2 is-generator-fn: 2.1.0 jest-each: 30.0.0-alpha.6 jest-matcher-utils: 30.0.0-alpha.6 @@ -5517,13 +7780,13 @@ snapshots: jest-config@30.0.0-alpha.6(@types/node@25.0.3): dependencies: - '@babel/core': 7.28.5 + '@babel/core': 7.29.0 '@jest/pattern': 30.0.0-alpha.6 '@jest/test-sequencer': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - babel-jest: 30.0.0-alpha.6(@babel/core@7.28.5) + babel-jest: 30.0.0-alpha.6(@babel/core@7.29.0) chalk: 4.1.2 - ci-info: 4.3.1 + ci-info: 4.4.0 deepmerge: 4.3.1 glob: 10.5.0 graceful-fs: 4.2.11 @@ -5547,6 +7810,38 @@ snapshots: - babel-plugin-macros - supports-color + jest-config@30.0.0-alpha.6(@types/node@25.5.0): + dependencies: + '@babel/core': 7.29.0 + '@jest/pattern': 30.0.0-alpha.6 + '@jest/test-sequencer': 30.0.0-alpha.6 + '@jest/types': 30.0.0-alpha.6 + babel-jest: 30.0.0-alpha.6(@babel/core@7.29.0) + chalk: 4.1.2 + ci-info: 4.4.0 + deepmerge: 4.3.1 + glob: 10.5.0 + graceful-fs: 4.2.11 + jest-circus: 30.0.0-alpha.6 + jest-docblock: 30.0.0-alpha.6 + jest-environment-node: 30.0.0-alpha.6 + jest-get-type: 30.0.0-alpha.6 + jest-regex-util: 30.0.0-alpha.6 + jest-resolve: 30.0.0-alpha.6 + jest-runner: 30.0.0-alpha.6 + jest-util: 30.0.0-alpha.6 + jest-validate: 30.0.0-alpha.6 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 30.0.0-alpha.6 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 25.5.0 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + jest-diff@30.0.0-alpha.6: dependencies: chalk: 4.1.2 @@ -5571,7 +7866,7 @@ snapshots: '@jest/environment': 30.0.0-alpha.6 '@jest/fake-timers': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 jest-mock: 30.0.0-alpha.6 jest-util: 30.0.0-alpha.6 @@ -5580,7 +7875,7 @@ snapshots: jest-haste-map@30.0.0-alpha.6: dependencies: '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -5606,7 +7901,7 @@ snapshots: jest-message-util@30.0.0-alpha.6: dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.0 '@jest/types': 30.0.0-alpha.6 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -5619,7 +7914,7 @@ snapshots: jest-mock@30.0.0-alpha.6: dependencies: '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 jest-util: 30.0.0-alpha.6 jest-pnp-resolver@1.2.3(jest-resolve@30.0.0-alpha.6): @@ -5654,7 +7949,7 @@ snapshots: '@jest/test-result': 30.0.0-alpha.6 '@jest/transform': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -5682,7 +7977,7 @@ snapshots: '@jest/test-result': 30.0.0-alpha.6 '@jest/transform': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 chalk: 4.1.2 cjs-module-lexer: 1.4.3 collect-v8-coverage: 1.0.3 @@ -5702,16 +7997,16 @@ snapshots: jest-snapshot@30.0.0-alpha.6: dependencies: - '@babel/core': 7.28.5 - '@babel/generator': 7.28.5 - '@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5) - '@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.5) - '@babel/types': 7.28.5 + '@babel/core': 7.29.0 + '@babel/generator': 7.29.1 + '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) + '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) + '@babel/types': 7.29.0 '@jest/expect-utils': 30.0.0-alpha.6 '@jest/snapshot-utils': 30.0.0-alpha.6 '@jest/transform': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.5) + babel-preset-current-node-syntax: 1.2.0(@babel/core@7.29.0) chalk: 4.1.2 expect: 30.0.0-alpha.6 graceful-fs: 4.2.11 @@ -5721,7 +8016,7 @@ snapshots: jest-message-util: 30.0.0-alpha.6 jest-util: 30.0.0-alpha.6 pretty-format: 30.0.0-alpha.6 - semver: 7.7.3 + semver: 7.7.4 synckit: 0.9.3 transitivePeerDependencies: - supports-color @@ -5729,11 +8024,11 @@ snapshots: jest-util@30.0.0-alpha.6: dependencies: '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 chalk: 4.1.2 - ci-info: 4.3.1 + ci-info: 4.4.0 graceful-fs: 4.2.11 - picomatch: 4.0.3 + picomatch: 4.0.4 jest-validate@30.0.0-alpha.6: dependencies: @@ -5748,7 +8043,7 @@ snapshots: dependencies: '@jest/test-result': 30.0.0-alpha.6 '@jest/types': 30.0.0-alpha.6 - '@types/node': 25.0.3 + '@types/node': 25.5.0 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -5757,7 +8052,7 @@ snapshots: jest-worker@30.0.0-alpha.6: dependencies: - '@types/node': 25.0.3 + '@types/node': 25.5.0 '@ungap/structured-clone': 1.3.0 jest-util: 30.0.0-alpha.6 merge-stream: 2.0.0 @@ -5834,6 +8129,42 @@ snapshots: lines-and-columns@1.2.4: {} + litesvm-darwin-arm64@1.0.0: + optional: true + + litesvm-darwin-x64@1.0.0: + optional: true + + litesvm-linux-arm64-gnu@1.0.0: + optional: true + + litesvm-linux-arm64-musl@1.0.0: + optional: true + + litesvm-linux-x64-gnu@1.0.0: + optional: true + + litesvm-linux-x64-musl@1.0.0: + optional: true + + litesvm@1.0.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6): + dependencies: + '@solana-program/system': 0.12.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana-program/token': 0.12.0(@solana/kit@6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6)) + '@solana/kit': 6.5.0(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + optionalDependencies: + litesvm-darwin-arm64: 1.0.0 + litesvm-darwin-x64: 1.0.0 + litesvm-linux-arm64-gnu: 1.0.0 + litesvm-linux-arm64-musl: 1.0.0 + litesvm-linux-x64-gnu: 1.0.0 + litesvm-linux-x64-musl: 1.0.0 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + load-tsconfig@0.2.5: {} locate-path@5.0.0: @@ -5862,7 +8193,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.7.3 + semver: 7.7.4 makeerror@1.0.12: dependencies: @@ -5891,10 +8222,18 @@ snapshots: dependencies: brace-expansion: 1.1.12 + minimatch@3.1.5: + dependencies: + brace-expansion: 1.1.13 + minimatch@9.0.5: dependencies: brace-expansion: 2.0.2 + minimatch@9.0.9: + dependencies: + brace-expansion: 2.0.3 + minipass@7.1.2: {} mlly@1.8.0: @@ -5924,9 +8263,12 @@ snapshots: dependencies: whatwg-url: 5.0.0 + node-gyp-build@4.8.4: + optional: true + node-int64@0.4.0: {} - node-releases@2.0.27: {} + node-releases@2.0.36: {} normalize-path@3.0.0: {} @@ -5989,13 +8331,15 @@ snapshots: dependencies: quansync: 0.2.11 + pako@2.1.0: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.27.1 + '@babel/code-frame': 7.29.0 error-ex: 1.3.4 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -6026,8 +8370,12 @@ snapshots: picomatch@2.3.1: {} + picomatch@2.3.2: {} + picomatch@4.0.3: {} + picomatch@4.0.4: {} + pify@4.0.1: {} pirates@4.0.7: {} @@ -6042,11 +8390,12 @@ snapshots: mlly: 1.8.0 pathe: 2.0.3 - postcss-load-config@6.0.1(postcss@8.5.6): + postcss-load-config@6.0.1(postcss@8.5.6)(yaml@2.8.2): dependencies: lilconfig: 3.1.3 optionalDependencies: postcss: 8.5.6 + yaml: 2.8.2 postcss@8.5.6: dependencies: @@ -6183,10 +8532,23 @@ snapshots: safer-buffer@2.1.2: {} + sas-lib@1.0.10(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6): + dependencies: + '@solana/kit': 5.5.1(bufferutil@4.1.0)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@6.0.6) + borsh: 2.0.0 + borsher: 4.0.0 + transitivePeerDependencies: + - bufferutil + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + semver@6.3.1: {} semver@7.7.3: {} + semver@7.7.4: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -6281,6 +8643,8 @@ snapshots: pirates: 4.0.7 ts-interface-checker: 0.1.13 + superstruct@2.0.2: {} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -6302,7 +8666,7 @@ snapshots: dependencies: '@istanbuljs/schema': 0.1.3 glob: 7.2.3 - minimatch: 3.1.2 + minimatch: 3.1.5 thenify-all@1.6.0: dependencies: @@ -6335,7 +8699,7 @@ snapshots: tree-kill@1.2.2: {} - ts-api-utils@2.1.0(typescript@5.9.3): + ts-api-utils@2.5.0(typescript@5.9.3): dependencies: typescript: 5.9.3 @@ -6345,7 +8709,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.5.1(postcss@8.5.6)(typescript@5.9.3): + tsup@8.5.1(postcss@8.5.6)(typescript@5.9.3)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.27.0) cac: 6.7.14 @@ -6356,7 +8720,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(postcss@8.5.6) + postcss-load-config: 6.0.1(postcss@8.5.6)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.53.2 source-map: 0.7.6 @@ -6432,6 +8796,10 @@ snapshots: undici-types@7.16.0: {} + undici-types@7.18.2: {} + + undici-types@7.24.6: {} + universalify@0.1.2: {} update-browserslist-db@1.2.3(browserslist@4.25.4): @@ -6444,13 +8812,18 @@ snapshots: dependencies: punycode: 2.3.1 + utf-8-validate@6.0.6: + dependencies: + node-gyp-build: 4.8.4 + optional: true + v8-to-istanbul@9.3.0: dependencies: '@jridgewell/trace-mapping': 0.3.31 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 - vite@7.3.0(@types/node@25.0.3): + vite@7.3.0(@types/node@25.0.3)(yaml@2.8.2): dependencies: esbuild: 0.27.2 fdir: 6.5.0(picomatch@4.0.3) @@ -6461,11 +8834,12 @@ snapshots: optionalDependencies: '@types/node': 25.0.3 fsevents: 2.3.3 + yaml: 2.8.2 - vitest@4.0.16(@types/node@25.0.3)(happy-dom@20.5.0): + vitest@4.0.16(@types/node@25.0.3)(happy-dom@20.5.0(bufferutil@4.1.0)(utf-8-validate@6.0.6))(yaml@2.8.2): dependencies: '@vitest/expect': 4.0.16 - '@vitest/mocker': 4.0.16(vite@7.3.0(@types/node@25.0.3)) + '@vitest/mocker': 4.0.16(vite@7.3.0(@types/node@25.0.3)(yaml@2.8.2)) '@vitest/pretty-format': 4.0.16 '@vitest/runner': 4.0.16 '@vitest/snapshot': 4.0.16 @@ -6482,11 +8856,11 @@ snapshots: tinyexec: 1.0.2 tinyglobby: 0.2.15 tinyrainbow: 3.0.3 - vite: 7.3.0(@types/node@25.0.3) + vite: 7.3.0(@types/node@25.0.3)(yaml@2.8.2) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 25.0.3 - happy-dom: 20.5.0 + happy-dom: 20.5.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - jiti - less @@ -6543,12 +8917,22 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.1.0 - ws@8.19.0: {} + ws@8.19.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 + + ws@8.20.0(bufferutil@4.1.0)(utf-8-validate@6.0.6): + optionalDependencies: + bufferutil: 4.1.0 + utf-8-validate: 6.0.6 y18n@5.0.8: {} yallist@3.1.1: {} + yaml@2.8.2: {} + yargs-parser@21.1.1: {} yargs@17.7.2: