├── mpl-core ├── .gitignore ├── src │ ├── index.ts │ ├── helpers │ │ └── index.ts │ └── generated │ │ ├── errors │ │ └── index.ts │ │ ├── programs │ │ └── index.ts │ │ ├── index.ts │ │ ├── accounts │ │ └── index.ts │ │ ├── types │ │ ├── addBlocker.ts │ │ ├── burnDelegate.ts │ │ ├── dataState.ts │ │ ├── key.ts │ │ ├── edition.ts │ │ ├── transferDelegate.ts │ │ ├── immutableMetadata.ts │ │ ├── permanentBurnDelegate.ts │ │ ├── freezeDelegate.ts │ │ ├── validationResult.ts │ │ ├── permanentTransferDelegate.ts │ │ ├── externalCheckResult.ts │ │ ├── creator.ts │ │ ├── hookableLifecycleEvent.ts │ │ ├── externalValidationResult.ts │ │ ├── externalPluginAdapterType.ts │ │ ├── permanentFreezeDelegate.ts │ │ ├── externalPluginAdapterSchema.ts │ │ ├── pluginType.ts │ │ ├── updateDelegate.ts │ │ ├── attributes.ts │ │ ├── autograph.ts │ │ ├── attribute.ts │ │ ├── verifiedCreatorsSignature.ts │ │ ├── verifiedCreators.ts │ │ └── autographSignature.ts │ │ └── instructions │ │ └── index.ts ├── typedoc.json ├── test │ └── _shared.ts ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── program │ └── Cargo.toml ├── scripts │ ├── stop-validator.mjs │ ├── generate-clients.mjs │ └── utils.mjs ├── tsconfig.json └── tsup.config.ts ├── common-helpers ├── .gitignore ├── src │ ├── DAS │ │ └── index.ts │ ├── transactions │ │ └── index.ts │ ├── compression │ │ ├── index.ts │ │ └── codecs │ │ │ └── merkleTreeDecoderFactories.ts │ ├── index.ts │ ├── metadata │ │ ├── index.ts │ │ ├── metaHash.ts │ │ └── tMetadataArgsArgs.ts │ ├── constants.ts │ └── shared-types │ │ ├── index.ts │ │ ├── tUseMethod.ts │ │ ├── tTokenStandard.ts │ │ ├── tTokenProgramVersion.ts │ │ ├── tCollection.ts │ │ └── tUses.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── .eslintrc.cjs ├── tsup.config.ts └── tsconfig.json ├── compat-helpers ├── .gitignore ├── src │ ├── index.ts │ ├── keys.ts │ └── accounts.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── .eslintrc.cjs ├── tsup.config.ts └── tsconfig.json ├── mpl-bubblegum ├── .gitignore ├── src │ ├── account_compression │ │ ├── index.ts │ │ └── generated │ │ │ ├── errors │ │ │ └── index.ts │ │ │ ├── programs │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── instructions │ │ │ └── index.ts │ │ │ └── types │ │ │ ├── index.ts │ │ │ ├── compressionAccountType.ts │ │ │ ├── pathNode.ts │ │ │ └── applicationDataEventV1.ts │ ├── codecs │ │ ├── index.ts │ │ ├── canopyDecoderFactories.ts │ │ └── merkleTreeDecoderFactories.ts │ ├── index.ts │ ├── compression │ │ ├── index.ts │ │ └── helpers.ts │ └── generated │ │ ├── errors │ │ └── index.ts │ │ ├── programs │ │ └── index.ts │ │ ├── accounts │ │ └── index.ts │ │ ├── index.ts │ │ ├── types │ │ ├── index.ts │ │ ├── version.ts │ │ ├── useMethod.ts │ │ ├── tokenStandard.ts │ │ ├── bubblegumEventType.ts │ │ ├── decompressibleState.ts │ │ ├── tokenProgramVersion.ts │ │ ├── collection.ts │ │ ├── instructionName.ts │ │ ├── uses.ts │ │ └── creator.ts │ │ └── instructions │ │ └── index.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── program │ └── Cargo.toml ├── scripts │ ├── stop-validator.mjs │ └── utils.mjs ├── tsup.config.ts └── tsconfig.json ├── mpl-token-metadata ├── .gitignore ├── src │ ├── nft │ │ └── index.ts │ ├── index.ts │ ├── generated │ │ ├── errors │ │ │ └── index.ts │ │ ├── programs │ │ │ └── index.ts │ │ ├── pdas │ │ │ ├── index.ts │ │ │ ├── metadata.ts │ │ │ ├── masterEdition.ts │ │ │ └── tokenRecord.ts │ │ ├── index.ts │ │ ├── accounts │ │ │ └── index.ts │ │ └── types │ │ │ ├── useMethod.ts │ │ │ ├── tokenState.ts │ │ │ ├── migrationType.ts │ │ │ ├── authorityType.ts │ │ │ ├── verificationArgs.ts │ │ │ ├── holderDelegateRole.ts │ │ │ ├── payloadKey.ts │ │ │ ├── tokenStandard.ts │ │ │ ├── key.ts │ │ │ ├── tokenDelegateRole.ts │ │ │ ├── setCollectionSizeArgs.ts │ │ │ ├── revokeArgs.ts │ │ │ ├── collection.ts │ │ │ ├── authorizationData.ts │ │ │ ├── proofInfo.ts │ │ │ ├── metadataDelegateRole.ts │ │ │ ├── creator.ts │ │ │ ├── seedsVec.ts │ │ │ ├── uses.ts │ │ │ ├── reservationV1.ts │ │ │ ├── mintNewEditionFromMasterEditionViaTokenArgs.ts │ │ │ └── reservation.ts │ └── token │ │ └── index.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── scripts │ ├── stop-validator.mjs │ └── utils.mjs ├── program │ └── Cargo.toml ├── tsconfig.json └── tsup.config.ts ├── wns ├── src │ ├── index.ts │ └── generated │ │ ├── errors │ │ └── index.ts │ │ ├── programs │ │ └── index.ts │ │ ├── accounts │ │ └── index.ts │ │ ├── types │ │ ├── index.ts │ │ ├── creatorWithShare.ts │ │ ├── addMetadataArgs.ts │ │ └── removeMetadataArgs.ts │ │ ├── pdas │ │ ├── index.ts │ │ ├── manager.ts │ │ ├── group.ts │ │ ├── member.ts │ │ ├── approveAccount.ts │ │ └── extraMetasAccount.ts │ │ ├── index.ts │ │ ├── global.d.ts │ │ └── instructions │ │ └── index.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── program │ └── Cargo.toml ├── scripts │ ├── stop-validator.mjs │ ├── generate-clients.mjs │ └── utils.mjs ├── tsup.config.ts └── tsconfig.json ├── test-helpers ├── src │ ├── wns │ │ └── index.ts │ ├── index.ts │ ├── token │ │ └── index.ts │ ├── constants.ts │ ├── addresses.ts │ └── whitelist.ts ├── program │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── typedoc.json ├── Cargo.toml ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── scripts │ ├── program │ │ └── build.mjs │ └── stop-validator.mjs ├── tsconfig.json └── tsup.config.ts ├── .github ├── CODEOWNERS ├── .env └── file-filters.yml ├── phoenix ├── src │ ├── index.ts │ └── generated │ │ ├── errors │ │ └── index.ts │ │ ├── programs │ │ └── index.ts │ │ ├── index.ts │ │ ├── types │ │ ├── side.ts │ │ ├── marketStatus.ts │ │ ├── selfTradeBehavior.ts │ │ ├── seatApprovalStatus.ts │ │ ├── feeEvent.ts │ │ ├── index.ts │ │ ├── fIFOOrderId.ts │ │ ├── failedMultipleLimitOrderBehavior.ts │ │ ├── tokenParams.ts │ │ ├── marketSizeParams.ts │ │ └── reduceOrderParams.ts │ │ └── instructions │ │ └── index.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── program │ └── Cargo.toml ├── scripts │ ├── stop-validator.mjs │ ├── generate-clients.mjs │ └── utils.mjs ├── tsconfig.json └── tsup.config.ts ├── .gitignore ├── wns-distribution ├── src │ ├── index.ts │ ├── generated │ │ ├── types │ │ │ ├── index.ts │ │ │ └── creator.ts │ │ ├── accounts │ │ │ └── index.ts │ │ ├── errors │ │ │ └── index.ts │ │ ├── programs │ │ │ └── index.ts │ │ ├── instructions │ │ │ └── index.ts │ │ └── index.ts │ └── helpers.ts ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── tsconfig.declarations.json ├── program │ └── Cargo.toml ├── scripts │ ├── stop-validator.mjs │ ├── generate-clients.mjs │ └── utils.mjs ├── tsup.config.ts └── tsconfig.json ├── resolvers ├── typedoc.json ├── .prettierrc.json ├── env-shim.ts ├── src │ ├── types.ts │ └── index.ts ├── tsconfig.declarations.json ├── tsup.config.ts ├── tsconfig.json └── package.json ├── pnpm-workspace.yaml ├── .eslintrc.js ├── tsconfig.json └── README.md /mpl-core/.gitignore: -------------------------------------------------------------------------------- 1 | .vercel 2 | docs 3 | -------------------------------------------------------------------------------- /common-helpers/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /compat-helpers/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /mpl-bubblegum/.gitignore: -------------------------------------------------------------------------------- 1 | .vercel 2 | docs 3 | -------------------------------------------------------------------------------- /mpl-token-metadata/.gitignore: -------------------------------------------------------------------------------- 1 | .vercel 2 | docs 3 | -------------------------------------------------------------------------------- /wns/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './generated'; 2 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/nft/index.ts: -------------------------------------------------------------------------------- 1 | export * from './mint'; 2 | -------------------------------------------------------------------------------- /test-helpers/src/wns/index.ts: -------------------------------------------------------------------------------- 1 | export * from './createNft'; 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @richardwu @samuelvanderwaal @leantOnSol 2 | -------------------------------------------------------------------------------- /common-helpers/src/DAS/index.ts: -------------------------------------------------------------------------------- 1 | export * from './helius_queries'; 2 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/index.ts: -------------------------------------------------------------------------------- 1 | export * from './generated'; 2 | -------------------------------------------------------------------------------- /common-helpers/src/transactions/index.ts: -------------------------------------------------------------------------------- 1 | export * from './simulateInstructions'; 2 | -------------------------------------------------------------------------------- /mpl-core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './generated'; 2 | export * from './helpers'; 3 | -------------------------------------------------------------------------------- /phoenix/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './generated'; 2 | export * from './helpers'; 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | **/target 4 | **/test-ledger 5 | .vscode 6 | .zed 7 | -------------------------------------------------------------------------------- /wns-distribution/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './generated'; 2 | export * from './helpers'; 3 | -------------------------------------------------------------------------------- /mpl-core/src/helpers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './create'; 2 | export * from './fetchPlugins'; 3 | -------------------------------------------------------------------------------- /common-helpers/src/compression/index.ts: -------------------------------------------------------------------------------- 1 | export * from './cNFT_instruction_args'; 2 | export * from './merkleTree'; 3 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './generated'; 2 | export * from './nft'; 3 | export * from './token'; 4 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/codecs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './canopyDecoderFactories'; 2 | export * from './merkleTreeDecoderFactories'; 3 | -------------------------------------------------------------------------------- /wns/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /mpl-core/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /phoenix/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /resolvers/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /common-helpers/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /compat-helpers/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './accounts'; 2 | export * from './instructions'; 3 | export * from './keys'; 4 | export * from './rpc'; 5 | -------------------------------------------------------------------------------- /compat-helpers/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /mpl-bubblegum/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /test-helpers/program/src/lib.rs: -------------------------------------------------------------------------------- 1 | extern crate solana_program; 2 | 3 | solana_program::declare_id!("dummytest1111111111111111111111111111111111"); 4 | -------------------------------------------------------------------------------- /test-helpers/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /common-helpers/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './compression'; 2 | export * from './DAS'; 3 | export * from './metadata'; 4 | export * from './transactions'; 5 | -------------------------------------------------------------------------------- /mpl-token-metadata/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /wns-distribution/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/index.ts"], 3 | "includeVersion": true, 4 | "readme": "none", 5 | "out": "docs" 6 | } 7 | -------------------------------------------------------------------------------- /test-helpers/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = ["program"] 4 | 5 | [workspace.metadata.solana] 6 | external-programs-repositories = [] 7 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './account_compression'; 2 | export * from './generated'; 3 | export * from './codecs'; 4 | export * from './compression'; 5 | -------------------------------------------------------------------------------- /common-helpers/src/metadata/index.ts: -------------------------------------------------------------------------------- 1 | export * from './metadata'; 2 | export * from './metaHash'; 3 | export * from './metadataArgs'; 4 | export * from './tMetadataArgsArgs'; 5 | -------------------------------------------------------------------------------- /mpl-core/test/_shared.ts: -------------------------------------------------------------------------------- 1 | import { address } from '@solana/web3.js'; 2 | 3 | export const NOOP_PROGRAM_ID = address( 4 | 'noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV' 5 | ); 6 | -------------------------------------------------------------------------------- /common-helpers/src/constants.ts: -------------------------------------------------------------------------------- 1 | import { address } from '@solana/web3.js'; 2 | 3 | export const MPL_TOKEN_METADATA_PROGRAM_ID = address( 4 | 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' 5 | ); 6 | -------------------------------------------------------------------------------- /wns/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /mpl-core/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /phoenix/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /wns/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /mpl-bubblegum/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /mpl-core/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /phoenix/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /resolvers/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /test-helpers/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /common-helpers/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /compat-helpers/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /mpl-bubblegum/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /mpl-token-metadata/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /resolvers/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /test-helpers/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /wns-distribution/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "always", 8 | "printWidth": 80 9 | } 10 | -------------------------------------------------------------------------------- /common-helpers/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /compat-helpers/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /mpl-token-metadata/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /wns-distribution/env-shim.ts: -------------------------------------------------------------------------------- 1 | // Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV` 2 | export const __DEV__ = /* @__PURE__ */ (() => 3 | (process as any)['en' + 'v'].NODE_ENV === 'development')(); 4 | -------------------------------------------------------------------------------- /test-helpers/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './addresses'; 2 | export * from './constants'; 3 | export * from './programIds'; 4 | export * from './setup'; 5 | export * from './shared'; 6 | export * from './token'; 7 | export * from './wns'; 8 | -------------------------------------------------------------------------------- /common-helpers/src/shared-types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './tCollection'; 2 | export * from './tMetadataArgs'; 3 | export * from './tTokenProgramVersion'; 4 | export * from './tTokenStandard'; 5 | export * from './tUseMethod'; 6 | export * from './tUses'; 7 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/compression/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hashing'; 2 | export * from './helpers'; 3 | export * from './merkleTree'; 4 | export * from './setup'; 5 | export * from './token'; 6 | export * from './tree'; 7 | export * from './verification'; 8 | -------------------------------------------------------------------------------- /compat-helpers/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types" 7 | }, 8 | "extends": "./tsconfig.json" 9 | } 10 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "wns" 3 | - "wns-distribution" 4 | - "phoenix" 5 | - "resolvers" 6 | - "test-helpers" 7 | - "mpl-token-metadata" 8 | - "mpl-core" 9 | - "mpl-bubblegum" 10 | - "common-helpers" 11 | - "compat-helpers" 12 | -------------------------------------------------------------------------------- /resolvers/src/types.ts: -------------------------------------------------------------------------------- 1 | export enum TokenStandard { 2 | NonFungible, 3 | FungibleAsset, 4 | Fungible, 5 | NonFungibleEdition, 6 | ProgrammableNonFungible, 7 | ProgrammableNonFungibleEdition, 8 | } 9 | 10 | export type TokenStandardArgs = TokenStandard; 11 | -------------------------------------------------------------------------------- /resolvers/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types", 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } -------------------------------------------------------------------------------- /test-helpers/src/token/index.ts: -------------------------------------------------------------------------------- 1 | export * from './extensions'; 2 | export * from './initializeExtraMetasAccount'; 3 | export * from './initializeMint'; 4 | export * from './mintTo'; 5 | export * from './setAuthorityT22'; 6 | export * from './token'; 7 | export * from './token22'; 8 | -------------------------------------------------------------------------------- /wns/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types" 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /common-helpers/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types", 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } -------------------------------------------------------------------------------- /mpl-bubblegum/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types", 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } -------------------------------------------------------------------------------- /mpl-core/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types" 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /phoenix/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types" 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /test-helpers/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types", 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } -------------------------------------------------------------------------------- /mpl-token-metadata/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types", 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } -------------------------------------------------------------------------------- /wns-distribution/tsconfig.declarations.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationMap": true, 5 | "emitDeclarationOnly": true, 6 | "outDir": "./dist/types" 7 | }, 8 | "extends": "./tsconfig.json", 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /.github/.env: -------------------------------------------------------------------------------- 1 | CARGO_TERM_COLOR=always 2 | NODE_VERSION=20.x 3 | PROGRAMS=["mpl-bubblegum/program","mpl-core/program","mpl-token-metadata/program","phoenix/program","test-helpers/program"] 4 | RUST_VERSION=1.75.0 5 | SOLANA_VERSION=1.17.22 6 | TEST_PACKAGES=mpl-core mpl-token-metadata phoenix test-helpers 7 | -------------------------------------------------------------------------------- /wns/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wns" 3 | version = "0.4.1-alpha" 4 | 5 | [package.metadata.solana] 6 | program-id = "wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM" 7 | # Include program itself as a dep so it downloads the binary. 8 | program-dependencies = ["wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM"] 9 | -------------------------------------------------------------------------------- /mpl-core/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mpl_core" 3 | version = "0.7.1" 4 | 5 | [package.metadata.solana] 6 | program-id = "CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d" 7 | # Include program itself as a dep so it downloads the binary. 8 | program-dependencies = ["CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d"] 9 | -------------------------------------------------------------------------------- /phoenix/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "phoenix-v1" 3 | version = "0.2.4" 4 | 5 | [package.metadata.solana] 6 | program-id = "PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY" 7 | # Include program itself as a dep so it downloads the binary. 8 | program-dependencies = ["PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY"] 9 | -------------------------------------------------------------------------------- /phoenix/src/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './phoenixV1'; 10 | -------------------------------------------------------------------------------- /wns/src/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './wenNewStandard'; 10 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './bubblegum'; 10 | -------------------------------------------------------------------------------- /mpl-core/src/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './mplCoreProgram'; 10 | -------------------------------------------------------------------------------- /phoenix/src/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './phoenixV1'; 10 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/types/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './creator'; 10 | -------------------------------------------------------------------------------- /wns/src/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './wenNewStandard'; 10 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './bubblegum'; 10 | -------------------------------------------------------------------------------- /mpl-core/src/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './mplCoreProgram'; 10 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './tokenMetadata'; 10 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './tokenMetadata'; 10 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/accounts/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './distributionAccount'; 10 | -------------------------------------------------------------------------------- /wns-distribution/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wen-royalty-distribution" 3 | version = "0.2.0-alpha" 4 | 5 | [package.metadata.solana] 6 | program-id = "diste3nXmK7ddDTs1zb6uday6j4etCa9RChD8fJ1xay" 7 | # Include program itself as a dep so it downloads the binary. 8 | program-dependencies = ["diste3nXmK7ddDTs1zb6uday6j4etCa9RChD8fJ1xay"] 9 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './wenRoyaltyDistribution'; 10 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './wenRoyaltyDistribution'; 10 | -------------------------------------------------------------------------------- /common-helpers/src/metadata/metaHash.ts: -------------------------------------------------------------------------------- 1 | import { DAS } from 'helius-sdk'; 2 | import { computeMetadataArgsHash, findMetadataArgs } from './metadataArgs'; 3 | 4 | // retrieves metaHash from DAS assetFields input 5 | export function getMetaHash(assetFields: DAS.GetAssetResponse): Uint8Array { 6 | return computeMetadataArgsHash(findMetadataArgs(assetFields)); 7 | } 8 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/errors/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './splAccountCompression'; 10 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/programs/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './splAccountCompression'; 10 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/accounts/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './treeConfig'; 10 | export * from './voucher'; 11 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@solana/eslint-config-solana"], 3 | rules: { 4 | "@typescript-eslint/ban-types": "off", 5 | "@typescript-eslint/sort-type-constituents": "off", 6 | "prefer-destructuring": "off", 7 | "simple-import-sort/imports": "off", 8 | "sort-keys-fix/sort-keys-fix": "off", 9 | "typescript-sort-keys/interface": "off" 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/pdas/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './masterEdition'; 10 | export * from './metadata'; 11 | export * from './tokenRecord'; 12 | -------------------------------------------------------------------------------- /phoenix/src/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './errors'; 10 | export * from './instructions'; 11 | export * from './programs'; 12 | export * from './types'; 13 | -------------------------------------------------------------------------------- /compat-helpers/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@solana/eslint-config-solana'], 3 | rules: { 4 | '@typescript-eslint/ban-types': 'off', 5 | '@typescript-eslint/sort-type-constituents': 'off', 6 | 'prefer-destructuring': 'off', 7 | 'simple-import-sort/imports': 'off', 8 | 'sort-keys-fix/sort-keys-fix': 'off', 9 | 'typescript-sort-keys/interface': 'off', 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /wns/src/generated/accounts/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './approveAccount'; 10 | export * from './manager'; 11 | export * from './tokenGroup'; 12 | export * from './tokenGroupMember'; 13 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './errors'; 10 | export * from './instructions'; 11 | export * from './programs'; 12 | export * from './types'; 13 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/instructions/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './claimDistribution'; 10 | export * from './initializeDistribution'; 11 | export * from './updateDistribution'; 12 | -------------------------------------------------------------------------------- /mpl-core/src/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './accounts'; 10 | export * from './errors'; 11 | export * from './instructions'; 12 | export * from './programs'; 13 | export * from './types'; 14 | -------------------------------------------------------------------------------- /mpl-bubblegum/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bubblegum" 3 | version = "0.12.0" 4 | 5 | [package.metadata.solana] 6 | program-id = "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY" 7 | program-dependencies = [ 8 | "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY", 9 | "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", 10 | "cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK", 11 | "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV", 12 | ] 13 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/codecs/canopyDecoderFactories.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getArrayDecoder, 3 | getStructDecoder, 4 | getU8Decoder, 5 | } from '@solana/web3.js'; 6 | 7 | export const getCanopyDecoderFactory = (canopyDepth: number) => { 8 | const canopyBytesSize = Math.max(((1 << (canopyDepth + 1)) - 2) * 32, 0); 9 | return getStructDecoder([ 10 | ['canopyBytes', getArrayDecoder(getU8Decoder(), { size: canopyBytesSize })], 11 | ]); 12 | }; 13 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './accounts'; 10 | export * from './errors'; 11 | export * from './instructions'; 12 | export * from './programs'; 13 | export * from './types'; 14 | -------------------------------------------------------------------------------- /test-helpers/scripts/program/build.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | import { workingDirectory, getProgramFolders } from '../utils.mjs'; 4 | 5 | // Save external programs binaries to the output directory. 6 | import './dump.mjs'; 7 | 8 | // Build the programs. 9 | for (const folder of getProgramFolders()) { 10 | cd(`${path.join(workingDirectory, folder)}`); 11 | await $`cargo-build-sbf ${process.argv.slice(3)}`; 12 | } 13 | -------------------------------------------------------------------------------- /wns/src/generated/types/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './addMetadataArgs'; 10 | export * from './creatorWithShare'; 11 | export * from './removeMetadataArgs'; 12 | export * from './updateRoyaltiesArgs'; 13 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './accounts'; 10 | export * from './errors'; 11 | export * from './instructions'; 12 | export * from './programs'; 13 | export * from './types'; 14 | -------------------------------------------------------------------------------- /wns/src/generated/pdas/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './approveAccount'; 10 | export * from './extraMetasAccount'; 11 | export * from './group'; 12 | export * from './manager'; 13 | export * from './member'; 14 | -------------------------------------------------------------------------------- /common-helpers/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@solana/eslint-config-solana'], 3 | rules: { 4 | '@typescript-eslint/ban-types': 'off', 5 | '@typescript-eslint/sort-type-constituents': 'off', 6 | '@typescript-eslint/no-explicit-any': 'off', 7 | 'prefer-destructuring': 'off', 8 | 'simple-import-sort/imports': 'off', 9 | 'sort-keys-fix/sort-keys-fix': 'off', 10 | 'typescript-sort-keys/interface': 'off', 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /wns/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /wns/src/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './accounts'; 10 | export * from './errors'; 11 | export * from './instructions'; 12 | export * from './pdas'; 13 | export * from './programs'; 14 | export * from './types'; 15 | -------------------------------------------------------------------------------- /mpl-core/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /mpl-core/src/generated/accounts/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './assetV1'; 10 | export * from './collectionV1'; 11 | export * from './hashedAssetV1'; 12 | export * from './pluginHeaderV1'; 13 | export * from './pluginRegistryV1'; 14 | -------------------------------------------------------------------------------- /phoenix/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /mpl-bubblegum/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /test-helpers/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /mpl-token-metadata/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './accounts'; 10 | export * from './errors'; 11 | export * from './instructions'; 12 | export * from './pdas'; 13 | export * from './programs'; 14 | export * from './types'; 15 | -------------------------------------------------------------------------------- /wns-distribution/scripts/stop-validator.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | 4 | const isValidatorRunning = (await $`lsof -t -i:8899`.quiet().exitCode) === 0; 5 | 6 | if (isValidatorRunning) { 7 | // Kill the validator if it's already running. 8 | await $`pkill -f solana-test-validator`.quiet(); 9 | await sleep(1000); 10 | echo(chalk.green('Local validator terminated!')); 11 | } else { 12 | echo(chalk.yellow('Local validator is not running.')); 13 | } 14 | -------------------------------------------------------------------------------- /wns/src/generated/global.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | /** Global variable provided by bundlers telling us if we are building for production or not. */ 10 | // eslint-disable-next-line @typescript-eslint/naming-convention 11 | declare const __DEV__: boolean; 12 | -------------------------------------------------------------------------------- /test-helpers/src/constants.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Lamports in one Sol. 3 | */ 4 | export const LAMPORTS_PER_SOL = 1_000_000_000n; 5 | 6 | /** 7 | * Rent-exempt reserve for new accounts. 8 | */ 9 | export const ZERO_ACCOUNT_RENT_LAMPORTS = 890880n; 10 | 11 | /** 12 | * Lamports in one Sol. 13 | */ 14 | export const ONE_SOL = 1n * LAMPORTS_PER_SOL; 15 | 16 | /** 17 | * Creates a lamports value from a sol value. 18 | */ 19 | export const sol = (amount: number) => amount * Number(LAMPORTS_PER_SOL); 20 | -------------------------------------------------------------------------------- /common-helpers/src/metadata/tMetadataArgsArgs.ts: -------------------------------------------------------------------------------- 1 | import { DAS } from 'helius-sdk'; 2 | import { TMetadataArgsArgs } from '../shared-types'; 3 | import { 4 | findMetadataArgs, 5 | metadataArgsToTMetadataArgsArgs, 6 | } from './metadataArgs'; 7 | 8 | // retrieves tMetadataArgsArgs from DAS assetFields input 9 | export function getTMetadataArgsArgs( 10 | assetFields: DAS.GetAssetResponse 11 | ): TMetadataArgsArgs { 12 | return metadataArgsToTMetadataArgsArgs(findMetadataArgs(assetFields)); 13 | } 14 | -------------------------------------------------------------------------------- /mpl-token-metadata/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "token_metadata" 3 | version = "1.14.0" 4 | 5 | [package.metadata.solana] 6 | program-id = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" 7 | program-dependencies = [ 8 | "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s", 9 | "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", 10 | "SysExL2WDyJi9aRZrXorrjHJut3JwHQ7R9bTyctbNNG", 11 | "TokExjvjJmhKaRBShsBAsbSvEWMA1AgUNK7ps4SAc2p", 12 | "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", 13 | ] 14 | -------------------------------------------------------------------------------- /test-helpers/src/addresses.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Address, 3 | ReadonlyUint8Array, 4 | getAddressDecoder, 5 | getAddressEncoder, 6 | } from '@solana/web3.js'; 7 | 8 | export type NumberData = number[] | Uint8Array | Buffer; 9 | 10 | export const toAddress = (data: NumberData): Address => { 11 | const decoder = getAddressDecoder(); 12 | return decoder.decode(Uint8Array.from(data)); 13 | }; 14 | 15 | export const fromAddress = (address: Address): ReadonlyUint8Array => { 16 | const encoder = getAddressEncoder(); 17 | return encoder.encode(address); 18 | }; 19 | -------------------------------------------------------------------------------- /test-helpers/src/whitelist.ts: -------------------------------------------------------------------------------- 1 | import { v4 } from 'uuid'; 2 | 3 | export const generateUuid = () => uuidToUint8Array(v4()); 4 | 5 | export const uuidToUint8Array = (uuid: string) => { 6 | const encoder = new TextEncoder(); 7 | // replace any '-' to handle uuids 8 | return encoder.encode(uuid.replaceAll('-', '')); 9 | }; 10 | 11 | export const nameToUint8Array = (name: string) => { 12 | const encoder = new TextEncoder(); 13 | const encodedName = encoder.encode(name); 14 | const paddedName = new Uint8Array(32); 15 | paddedName.set(encodedName); 16 | return paddedName; 17 | }; 18 | -------------------------------------------------------------------------------- /wns/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | ]); -------------------------------------------------------------------------------- /compat-helpers/src/keys.ts: -------------------------------------------------------------------------------- 1 | import { fromLegacyKeypair } from '@solana/compat'; 2 | import { Keypair, PublicKey } from '@solana/web3.js'; 3 | import { 4 | createSignerFromKeyPair, 5 | KeyPairSigner, 6 | NoopSigner, 7 | address, 8 | createNoopSigner, 9 | } from '@solana/web3.js-next'; 10 | 11 | export async function fromLegacyKeypairToKeyPairSigner( 12 | keypair: Keypair 13 | ): Promise { 14 | return await createSignerFromKeyPair(await fromLegacyKeypair(keypair)); 15 | } 16 | 17 | export function fromPublicKeyToNoopSigner(publickey: PublicKey): NoopSigner { 18 | return createNoopSigner(address(publickey.toBase58())); 19 | } 20 | -------------------------------------------------------------------------------- /mpl-bubblegum/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | ]); -------------------------------------------------------------------------------- /resolvers/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | ]); 20 | -------------------------------------------------------------------------------- /common-helpers/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | ]); 20 | -------------------------------------------------------------------------------- /compat-helpers/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | ]); 20 | -------------------------------------------------------------------------------- /wns-distribution/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | ]); -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/instructions/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './append'; 10 | export * from './appendCanopyNodes'; 11 | export * from './closeEmptyTree'; 12 | export * from './initEmptyMerkleTree'; 13 | export * from './initPreparedTreeWithRoot'; 14 | export * from './insertOrAppend'; 15 | export * from './prepareBatchMerkleTree'; 16 | export * from './replaceLeaf'; 17 | export * from './transferAuthority'; 18 | export * from './verifyLeaf'; 19 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './bubblegumEventType'; 10 | export * from './collection'; 11 | export * from './creator'; 12 | export * from './decompressibleState'; 13 | export * from './instructionName'; 14 | export * from './leafSchema'; 15 | export * from './metadataArgs'; 16 | export * from './tokenProgramVersion'; 17 | export * from './tokenStandard'; 18 | export * from './useMethod'; 19 | export * from './uses'; 20 | export * from './version'; 21 | -------------------------------------------------------------------------------- /common-helpers/src/shared-types/tUseMethod.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Codec, 3 | Decoder, 4 | Encoder, 5 | combineCodec, 6 | getEnumDecoder, 7 | getEnumEncoder, 8 | } from '@solana/web3.js'; 9 | 10 | export enum TUseMethod { 11 | Burn, 12 | Multiple, 13 | Single, 14 | } 15 | 16 | export type TUseMethodArgs = TUseMethod; 17 | 18 | export function getTUseMethodEncoder(): Encoder { 19 | return getEnumEncoder(TUseMethod); 20 | } 21 | 22 | export function getTUseMethodDecoder(): Decoder { 23 | return getEnumDecoder(TUseMethod); 24 | } 25 | 26 | export function getTUseMethodCodec(): Codec { 27 | return combineCodec(getTUseMethodEncoder(), getTUseMethodDecoder()); 28 | } 29 | -------------------------------------------------------------------------------- /wns/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src"] 24 | } -------------------------------------------------------------------------------- /resolvers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src"] 24 | } -------------------------------------------------------------------------------- /common-helpers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src"] 24 | } -------------------------------------------------------------------------------- /mpl-bubblegum/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src"] 24 | } -------------------------------------------------------------------------------- /phoenix/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src", "test"] 24 | } -------------------------------------------------------------------------------- /compat-helpers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": false, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext", 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src"] 24 | } -------------------------------------------------------------------------------- /mpl-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src", "test"] 24 | } -------------------------------------------------------------------------------- /wns-distribution/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src"] 24 | } -------------------------------------------------------------------------------- /mpl-core/scripts/generate-clients.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | import * as c from 'codama'; 4 | import { rootNodeFromAnchor } from '@codama/nodes-from-anchor'; 5 | import { renderVisitor as renderJavaScriptVisitor } from '@codama/renderers-js'; 6 | 7 | // Paths. 8 | const packageDir = path.join(__dirname, '..'); 9 | const idlDir = path.join(__dirname, '..'); 10 | 11 | // Render MPL Core types. 12 | const idl = rootNodeFromAnchor(require(path.join(idlDir, 'mpl-core.json'))); 13 | const codama = c.createFromRoot(idl, []); 14 | 15 | // Render JavaScript. 16 | codama.accept( 17 | renderJavaScriptVisitor(path.join(packageDir, 'src', 'generated'), { 18 | prettier: require(path.join(packageDir, '.prettierrc.json')), 19 | }) 20 | ); 21 | -------------------------------------------------------------------------------- /phoenix/scripts/generate-clients.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import "zx/globals"; 3 | import * as c from "codama"; 4 | import { rootNodeFromAnchor } from "@codama/nodes-from-anchor"; 5 | import { renderVisitor as renderJavaScriptVisitor } from "@codama/renderers-js"; 6 | 7 | // Paths. 8 | const packageDir = path.join(__dirname, ".."); 9 | const idlDir = path.join(__dirname, ".."); 10 | 11 | // Render Phoenix types. 12 | const idl = rootNodeFromAnchor(require(path.join(idlDir, "phoenix_v1.json"))); 13 | const codama = c.createFromRoot(idl, []); 14 | 15 | // Render JavaScript. 16 | codama.accept( 17 | renderJavaScriptVisitor(path.join(packageDir, "src", "generated"), { 18 | prettier: require(path.join(packageDir, ".prettierrc.json")), 19 | }), 20 | ); 21 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/types/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './accountCompressionEvent'; 10 | export * from './applicationDataEvent'; 11 | export * from './applicationDataEventV1'; 12 | export * from './changeLogEvent'; 13 | export * from './changeLogEventV1'; 14 | export * from './compressionAccountType'; 15 | export * from './concurrentMerkleTreeHeader'; 16 | export * from './concurrentMerkleTreeHeaderData'; 17 | export * from './concurrentMerkleTreeHeaderDataV1'; 18 | export * from './pathNode'; 19 | -------------------------------------------------------------------------------- /mpl-token-metadata/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src", "test"] 24 | } -------------------------------------------------------------------------------- /test-helpers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": false, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": ["src", "test"] 24 | } 25 | -------------------------------------------------------------------------------- /wns-distribution/scripts/generate-clients.mjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zx 2 | import 'zx/globals'; 3 | import * as c from 'codama'; 4 | import { rootNodeFromAnchor } from '@codama/nodes-from-anchor'; 5 | import { renderVisitor as renderJavaScriptVisitor } from '@codama/renderers-js'; 6 | 7 | // Paths. 8 | const packageDir = path.join(__dirname, '..'); 9 | const idlDir = path.join(__dirname, '..'); 10 | 11 | // Render types from the IDL. 12 | const idl = rootNodeFromAnchor( 13 | require(path.join(idlDir, 'wen-royalty-distribution.json')) 14 | ); 15 | const codama = c.createFromRoot(idl, []); 16 | 17 | // Render JavaScript. 18 | codama.accept( 19 | renderJavaScriptVisitor(path.join(packageDir, 'src', 'generated'), { 20 | prettier: require(path.join(packageDir, '.prettierrc.json')), 21 | }) 22 | ); 23 | -------------------------------------------------------------------------------- /test-helpers/program/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dummy_test_program" 3 | version = "0.1.0" 4 | 5 | [lib] 6 | crate-type = ["cdylib", "lib"] 7 | 8 | [features] 9 | no-entrypoint = [] 10 | 11 | [dependencies] 12 | solana-program = "~1.17.22" 13 | 14 | # Used to get programs needed for the test validator. 15 | [package.metadata.solana] 16 | program-id = "dummytest1111111111111111111111111111111111" 17 | program-dependencies = [ 18 | "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", 19 | "CZ1rQoAHSqWBoAEfqGsiLhgbM59dDrCWk3rnG5FXaoRV", 20 | "wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM", 21 | "diste3nXmK7ddDTs1zb6uday6j4etCa9RChD8fJ1xay", 22 | ] 23 | account-dependencies = [ 24 | "99jtJwGDfaBKXtc7kxQneAGbERGK8F5XyJWHv7qTbj9G", 25 | "9SUrE3EPBoXVjNywEDHSJKJdxebs8H8sLgEWdueEvnKX", 26 | ] 27 | -------------------------------------------------------------------------------- /mpl-core/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | 20 | // Tests. 21 | { 22 | ...SHARED_OPTIONS, 23 | bundle: false, 24 | entry: ['./test/**/*.ts'], 25 | format: 'cjs', 26 | outDir: './dist/test', 27 | }, 28 | ]); -------------------------------------------------------------------------------- /phoenix/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | 20 | // Tests. 21 | { 22 | ...SHARED_OPTIONS, 23 | bundle: false, 24 | entry: ['./test/**/*.ts'], 25 | format: 'cjs', 26 | outDir: './dist/test', 27 | }, 28 | ]); -------------------------------------------------------------------------------- /mpl-token-metadata/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | 20 | // Tests. 21 | { 22 | ...SHARED_OPTIONS, 23 | bundle: false, 24 | entry: ['./test/**/*.ts'], 25 | format: 'cjs', 26 | outDir: './dist/test', 27 | }, 28 | ]); -------------------------------------------------------------------------------- /test-helpers/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { env } from 'node:process'; 2 | import path from 'path'; 3 | import { defineConfig, Options } from 'tsup'; 4 | 5 | const SHARED_OPTIONS: Options = { 6 | define: { __VERSION__: `"${env.npm_package_version}"` }, 7 | entry: ['./src/index.ts'], 8 | inject: [path.resolve(__dirname, 'env-shim.ts')], 9 | outDir: './dist/src', 10 | outExtension: ({ format }) => ({ js: format === 'cjs' ? '.js' : '.mjs' }), 11 | sourcemap: true, 12 | treeshake: true, 13 | }; 14 | 15 | export default defineConfig(() => [ 16 | // Source. 17 | { ...SHARED_OPTIONS, format: 'cjs' }, 18 | { ...SHARED_OPTIONS, format: 'esm' }, 19 | 20 | // Tests. 21 | { 22 | ...SHARED_OPTIONS, 23 | bundle: false, 24 | entry: ['./test/**/*.ts'], 25 | format: 'cjs', 26 | outDir: './dist/test', 27 | }, 28 | ]); 29 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/accounts/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './collectionAuthorityRecord'; 10 | export * from './edition'; 11 | export * from './editionMarker'; 12 | export * from './editionMarkerV2'; 13 | export * from './holderDelegateRecord'; 14 | export * from './masterEdition'; 15 | export * from './masterEditionV1'; 16 | export * from './metadata'; 17 | export * from './metadataDelegateRecord'; 18 | export * from './reservationListV1'; 19 | export * from './reservationListV2'; 20 | export * from './tokenOwnedEscrow'; 21 | export * from './tokenRecord'; 22 | export * from './useAuthorityRecord'; 23 | -------------------------------------------------------------------------------- /common-helpers/src/shared-types/tTokenStandard.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Codec, 3 | Decoder, 4 | Encoder, 5 | combineCodec, 6 | getEnumDecoder, 7 | getEnumEncoder, 8 | } from '@solana/web3.js'; 9 | 10 | export enum TTokenStandard { 11 | NonFungible, 12 | FungibleAsset, 13 | Fungible, 14 | NonFungibleEdition, 15 | } 16 | 17 | export type TTokenStandardArgs = TTokenStandard; 18 | 19 | export function getTTokenStandardEncoder(): Encoder { 20 | return getEnumEncoder(TTokenStandard); 21 | } 22 | 23 | export function getTTokenStandardDecoder(): Decoder { 24 | return getEnumDecoder(TTokenStandard); 25 | } 26 | 27 | export function getTTokenStandardCodec(): Codec< 28 | TTokenStandardArgs, 29 | TTokenStandard 30 | > { 31 | return combineCodec(getTTokenStandardEncoder(), getTTokenStandardDecoder()); 32 | } 33 | -------------------------------------------------------------------------------- /wns/scripts/generate-clients.mjs: -------------------------------------------------------------------------------- 1 | // DO NOT GENERATE UNTIL IDL IS FIXED 2 | // #!/usr/bin/env zx 3 | // import 'zx/globals'; 4 | // import * as c from 'codama'; 5 | // import { rootNodeFromAnchor } from '@codama/nodes-from-anchor'; 6 | // import { renderVisitor as renderJavaScriptVisitor } from '@codama/renderers-js'; 7 | 8 | // // Paths. 9 | // const packageDir = path.join(__dirname, '..'); 10 | // const idlDir = path.join(__dirname, '..'); 11 | 12 | // // Render Token Metadata types. 13 | // const idl = rootNodeFromAnchor(require(path.join(idlDir, 'wen-new-standard.json'))); 14 | // const codama = c.createFromRoot(idl, []); 15 | 16 | // // Render JavaScript. 17 | // codama.accept( 18 | // renderJavaScriptVisitor(path.join(packageDir, 'src', 'generated'), { 19 | // prettier: require(path.join(packageDir, '.prettierrc.json')), 20 | // }) 21 | // ); 22 | -------------------------------------------------------------------------------- /wns/src/generated/instructions/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | export * from './addMetadata'; 10 | export * from './addMintToGroup'; 11 | export * from './addRoyalties'; 12 | export * from './approveTransfer'; 13 | export * from './burnMintAccount'; 14 | export * from './createGroupAccount'; 15 | export * from './createMintAccount'; 16 | export * from './execute'; 17 | export * from './freezeMintAccount'; 18 | export * from './initManagerAccount'; 19 | export * from './modifyRoyalties'; 20 | export * from './removeMetadata'; 21 | export * from './removeMintFromGroup'; 22 | export * from './thawMintAccount'; 23 | export * from './updateGroupAccount'; 24 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/side.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum Side { 19 | Bid, 20 | Ask, 21 | } 22 | 23 | export type SideArgs = Side; 24 | 25 | export function getSideEncoder(): Encoder { 26 | return getEnumEncoder(Side); 27 | } 28 | 29 | export function getSideDecoder(): Decoder { 30 | return getEnumDecoder(Side); 31 | } 32 | 33 | export function getSideCodec(): Codec { 34 | return combineCodec(getSideEncoder(), getSideDecoder()); 35 | } 36 | -------------------------------------------------------------------------------- /common-helpers/src/shared-types/tTokenProgramVersion.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Codec, 3 | Decoder, 4 | Encoder, 5 | combineCodec, 6 | getEnumDecoder, 7 | getEnumEncoder, 8 | } from '@solana/web3.js'; 9 | 10 | export enum TTokenProgramVersion { 11 | Original, 12 | Token2022, 13 | } 14 | 15 | export type TTokenProgramVersionArgs = TTokenProgramVersion; 16 | 17 | export function getTTokenProgramVersionEncoder(): Encoder { 18 | return getEnumEncoder(TTokenProgramVersion); 19 | } 20 | 21 | export function getTTokenProgramVersionDecoder(): Decoder { 22 | return getEnumDecoder(TTokenProgramVersion); 23 | } 24 | 25 | export function getTTokenProgramVersionCodec(): Codec< 26 | TTokenProgramVersionArgs, 27 | TTokenProgramVersion 28 | > { 29 | return combineCodec( 30 | getTTokenProgramVersionEncoder(), 31 | getTTokenProgramVersionDecoder() 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/version.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum Version { 19 | V1, 20 | } 21 | 22 | export type VersionArgs = Version; 23 | 24 | export function getVersionEncoder(): Encoder { 25 | return getEnumEncoder(Version); 26 | } 27 | 28 | export function getVersionDecoder(): Decoder { 29 | return getEnumDecoder(Version); 30 | } 31 | 32 | export function getVersionCodec(): Codec { 33 | return combineCodec(getVersionEncoder(), getVersionDecoder()); 34 | } 35 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/addBlocker.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export type AddBlocker = {}; 19 | 20 | export type AddBlockerArgs = AddBlocker; 21 | 22 | export function getAddBlockerEncoder(): Encoder { 23 | return getStructEncoder([]); 24 | } 25 | 26 | export function getAddBlockerDecoder(): Decoder { 27 | return getStructDecoder([]); 28 | } 29 | 30 | export function getAddBlockerCodec(): Codec { 31 | return combineCodec(getAddBlockerEncoder(), getAddBlockerDecoder()); 32 | } 33 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/burnDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export type BurnDelegate = {}; 19 | 20 | export type BurnDelegateArgs = BurnDelegate; 21 | 22 | export function getBurnDelegateEncoder(): Encoder { 23 | return getStructEncoder([]); 24 | } 25 | 26 | export function getBurnDelegateDecoder(): Decoder { 27 | return getStructDecoder([]); 28 | } 29 | 30 | export function getBurnDelegateCodec(): Codec { 31 | return combineCodec(getBurnDelegateEncoder(), getBurnDelegateDecoder()); 32 | } 33 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "composite": false, 5 | "declaration": true, 6 | "declarationMap": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "inlineSources": false, 10 | "isolatedModules": true, 11 | "module": "ESNext", 12 | "moduleResolution": "node", 13 | "noFallthroughCasesInSwitch": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "outDir": "./dist", 17 | "preserveWatchOutput": true, 18 | "skipLibCheck": true, 19 | "strict": true, 20 | "target": "ESNext" 21 | }, 22 | "exclude": ["node_modules"], 23 | "include": [ 24 | "test-helpers/src", 25 | "mpl-core/src", 26 | "mpl-core/test", 27 | "mpl-token-metadata/src", 28 | "mpl-token-metadata/test", 29 | "common-helpers/src", 30 | "test-helpers/test", 31 | ".eslintrc.js" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/dataState.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum DataState { 19 | AccountState, 20 | LedgerState, 21 | } 22 | 23 | export type DataStateArgs = DataState; 24 | 25 | export function getDataStateEncoder(): Encoder { 26 | return getEnumEncoder(DataState); 27 | } 28 | 29 | export function getDataStateDecoder(): Decoder { 30 | return getEnumDecoder(DataState); 31 | } 32 | 33 | export function getDataStateCodec(): Codec { 34 | return combineCodec(getDataStateEncoder(), getDataStateDecoder()); 35 | } 36 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/key.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum Key { 19 | Uninitialized, 20 | AssetV1, 21 | HashedAssetV1, 22 | PluginHeaderV1, 23 | PluginRegistryV1, 24 | CollectionV1, 25 | } 26 | 27 | export type KeyArgs = Key; 28 | 29 | export function getKeyEncoder(): Encoder { 30 | return getEnumEncoder(Key); 31 | } 32 | 33 | export function getKeyDecoder(): Decoder { 34 | return getEnumDecoder(Key); 35 | } 36 | 37 | export function getKeyCodec(): Codec { 38 | return combineCodec(getKeyEncoder(), getKeyDecoder()); 39 | } 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Tensor Toolkit 3 |

4 |

5 | Tensor Toolkit 6 |

7 |

8 | A set of useful JavaScript libraries for Solana development. 9 |

10 | 11 | ## License 12 | 13 | Copyright (c) 2024 Tensor Protocol Foundation 14 | 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this file except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/useMethod.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum UseMethod { 19 | Burn, 20 | Multiple, 21 | Single, 22 | } 23 | 24 | export type UseMethodArgs = UseMethod; 25 | 26 | export function getUseMethodEncoder(): Encoder { 27 | return getEnumEncoder(UseMethod); 28 | } 29 | 30 | export function getUseMethodDecoder(): Decoder { 31 | return getEnumDecoder(UseMethod); 32 | } 33 | 34 | export function getUseMethodCodec(): Codec { 35 | return combineCodec(getUseMethodEncoder(), getUseMethodDecoder()); 36 | } 37 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/useMethod.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum UseMethod { 19 | Burn, 20 | Multiple, 21 | Single, 22 | } 23 | 24 | export type UseMethodArgs = UseMethod; 25 | 26 | export function getUseMethodEncoder(): Encoder { 27 | return getEnumEncoder(UseMethod); 28 | } 29 | 30 | export function getUseMethodDecoder(): Decoder { 31 | return getEnumDecoder(UseMethod); 32 | } 33 | 34 | export function getUseMethodCodec(): Codec { 35 | return combineCodec(getUseMethodEncoder(), getUseMethodDecoder()); 36 | } 37 | -------------------------------------------------------------------------------- /wns/src/generated/pdas/manager.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Address, 11 | ProgramDerivedAddress, 12 | fixEncoderSize, 13 | getBytesEncoder, 14 | getProgramDerivedAddress, 15 | } from '@solana/web3.js'; 16 | 17 | export async function findManagerPda( 18 | config: { programAddress?: Address | undefined } = {} 19 | ): Promise { 20 | const { 21 | programAddress = 'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM' as Address<'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM'>, 22 | } = config; 23 | return await getProgramDerivedAddress({ 24 | programAddress, 25 | seeds: [ 26 | fixEncoderSize(getBytesEncoder(), 7).encode( 27 | new Uint8Array([109, 97, 110, 97, 103, 101, 114]) 28 | ), 29 | ], 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/instructions/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './burn'; 10 | export * from './cancelRedeem'; 11 | export * from './compress'; 12 | export * from './createTree'; 13 | export * from './decompressV1'; 14 | export * from './delegate'; 15 | export * from './mintToCollectionV1'; 16 | export * from './mintV1'; 17 | export * from './redeem'; 18 | export * from './setAndVerifyCollection'; 19 | export * from './setDecompressableState'; 20 | export * from './setDecompressibleState'; 21 | export * from './setTreeDelegate'; 22 | export * from './transfer'; 23 | export * from './unverifyCollection'; 24 | export * from './unverifyCreator'; 25 | export * from './updateMetadata'; 26 | export * from './verifyCollection'; 27 | export * from './verifyCreator'; 28 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/tokenState.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum TokenState { 19 | Unlocked, 20 | Locked, 21 | Listed, 22 | } 23 | 24 | export type TokenStateArgs = TokenState; 25 | 26 | export function getTokenStateEncoder(): Encoder { 27 | return getEnumEncoder(TokenState); 28 | } 29 | 30 | export function getTokenStateDecoder(): Decoder { 31 | return getEnumDecoder(TokenState); 32 | } 33 | 34 | export function getTokenStateCodec(): Codec { 35 | return combineCodec(getTokenStateEncoder(), getTokenStateDecoder()); 36 | } 37 | -------------------------------------------------------------------------------- /common-helpers/src/shared-types/tCollection.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Address, 3 | getAddressDecoder, 4 | getAddressEncoder, 5 | Codec, 6 | Decoder, 7 | Encoder, 8 | combineCodec, 9 | getBooleanDecoder, 10 | getBooleanEncoder, 11 | getStructDecoder, 12 | getStructEncoder, 13 | } from '@solana/web3.js'; 14 | 15 | export type TCollection = { verified: boolean; key: Address }; 16 | 17 | export type TCollectionArgs = TCollection; 18 | 19 | export function getTCollectionEncoder(): Encoder { 20 | return getStructEncoder([ 21 | ['verified', getBooleanEncoder()], 22 | ['key', getAddressEncoder()], 23 | ]); 24 | } 25 | 26 | export function getTCollectionDecoder(): Decoder { 27 | return getStructDecoder([ 28 | ['verified', getBooleanDecoder()], 29 | ['key', getAddressDecoder()], 30 | ]); 31 | } 32 | 33 | export function getTCollectionCodec(): Codec { 34 | return combineCodec(getTCollectionEncoder(), getTCollectionDecoder()); 35 | } 36 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/edition.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU32Decoder, 14 | getU32Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type Edition = { number: number }; 21 | 22 | export type EditionArgs = Edition; 23 | 24 | export function getEditionEncoder(): Encoder { 25 | return getStructEncoder([['number', getU32Encoder()]]); 26 | } 27 | 28 | export function getEditionDecoder(): Decoder { 29 | return getStructDecoder([['number', getU32Decoder()]]); 30 | } 31 | 32 | export function getEditionCodec(): Codec { 33 | return combineCodec(getEditionEncoder(), getEditionDecoder()); 34 | } 35 | -------------------------------------------------------------------------------- /wns-distribution/src/helpers.ts: -------------------------------------------------------------------------------- 1 | import { 2 | address, 3 | Address, 4 | getAddressEncoder, 5 | getProgramDerivedAddress, 6 | ProgramDerivedAddress, 7 | } from '@solana/web3.js'; 8 | 9 | export type WnsDistributionSeeds = { 10 | /** The address of the collection account */ 11 | collection: Address; 12 | 13 | /** The address of the payment mint account */ 14 | paymentMint?: Address | null; 15 | }; 16 | 17 | export function findWnsDistributionPda( 18 | seeds: WnsDistributionSeeds, 19 | config: { programAddress?: Address | undefined } = {} 20 | ): Promise { 21 | const { 22 | programAddress = 'diste3nXmK7ddDTs1zb6uday6j4etCa9RChD8fJ1xay' as Address<'diste3nXmK7ddDTs1zb6uday6j4etCa9RChD8fJ1xay'>, 23 | } = config; 24 | return getProgramDerivedAddress({ 25 | programAddress, 26 | seeds: [ 27 | getAddressEncoder().encode(seeds.collection), 28 | getAddressEncoder().encode( 29 | seeds.paymentMint ?? address('11111111111111111111111111111111') 30 | ), 31 | ], 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /.github/file-filters.yml: -------------------------------------------------------------------------------- 1 | # This file is used by the dorny/paths-filter action to figure out if a program or 2 | # client has changed and thus if it should be built or tested. Any changes in the 3 | # files listed below will trigger the appropriate workflow for that program or client. 4 | 5 | # Programs. 6 | 7 | programs_common: &programs_common 8 | - ".github/workflows/main.yml" 9 | - ".github/file-filters.yml" 10 | - ".github/.env" 11 | 12 | program_binary: &program_binary 13 | - *programs_common 14 | - "*/program/**" 15 | 16 | programs: &programs 17 | - *program_binary 18 | 19 | # Clients. 20 | client_common: &client_common 21 | - *programs 22 | - ".github/workflows/test-js-client.yml" 23 | - ".github/workflows/main.yml" 24 | - ".github/file-filters.yml" 25 | - ".github/.env" 26 | - "*/scripts/generate-clients.cjs" 27 | 28 | js_client: &js_client 29 | - *client_common 30 | - "*/src/**" 31 | - "*/test/**" 32 | 33 | clients: &clients 34 | - *js_client 35 | 36 | # Any. 37 | 38 | any: &any 39 | - *programs 40 | - *clients 41 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/transferDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export type TransferDelegate = {}; 19 | 20 | export type TransferDelegateArgs = TransferDelegate; 21 | 22 | export function getTransferDelegateEncoder(): Encoder { 23 | return getStructEncoder([]); 24 | } 25 | 26 | export function getTransferDelegateDecoder(): Decoder { 27 | return getStructDecoder([]); 28 | } 29 | 30 | export function getTransferDelegateCodec(): Codec< 31 | TransferDelegateArgs, 32 | TransferDelegate 33 | > { 34 | return combineCodec( 35 | getTransferDelegateEncoder(), 36 | getTransferDelegateDecoder() 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/migrationType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum MigrationType { 19 | CollectionV1, 20 | ProgrammableV1, 21 | } 22 | 23 | export type MigrationTypeArgs = MigrationType; 24 | 25 | export function getMigrationTypeEncoder(): Encoder { 26 | return getEnumEncoder(MigrationType); 27 | } 28 | 29 | export function getMigrationTypeDecoder(): Decoder { 30 | return getEnumDecoder(MigrationType); 31 | } 32 | 33 | export function getMigrationTypeCodec(): Codec< 34 | MigrationTypeArgs, 35 | MigrationType 36 | > { 37 | return combineCodec(getMigrationTypeEncoder(), getMigrationTypeDecoder()); 38 | } 39 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/immutableMetadata.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export type ImmutableMetadata = {}; 19 | 20 | export type ImmutableMetadataArgs = ImmutableMetadata; 21 | 22 | export function getImmutableMetadataEncoder(): Encoder { 23 | return getStructEncoder([]); 24 | } 25 | 26 | export function getImmutableMetadataDecoder(): Decoder { 27 | return getStructDecoder([]); 28 | } 29 | 30 | export function getImmutableMetadataCodec(): Codec< 31 | ImmutableMetadataArgs, 32 | ImmutableMetadata 33 | > { 34 | return combineCodec( 35 | getImmutableMetadataEncoder(), 36 | getImmutableMetadataDecoder() 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/marketStatus.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum MarketStatus { 19 | Uninitialized, 20 | Active, 21 | PostOnly, 22 | Paused, 23 | Closed, 24 | Tombstoned, 25 | } 26 | 27 | export type MarketStatusArgs = MarketStatus; 28 | 29 | export function getMarketStatusEncoder(): Encoder { 30 | return getEnumEncoder(MarketStatus); 31 | } 32 | 33 | export function getMarketStatusDecoder(): Decoder { 34 | return getEnumDecoder(MarketStatus); 35 | } 36 | 37 | export function getMarketStatusCodec(): Codec { 38 | return combineCodec(getMarketStatusEncoder(), getMarketStatusDecoder()); 39 | } 40 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/tokenStandard.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum TokenStandard { 19 | NonFungible, 20 | FungibleAsset, 21 | Fungible, 22 | NonFungibleEdition, 23 | } 24 | 25 | export type TokenStandardArgs = TokenStandard; 26 | 27 | export function getTokenStandardEncoder(): Encoder { 28 | return getEnumEncoder(TokenStandard); 29 | } 30 | 31 | export function getTokenStandardDecoder(): Decoder { 32 | return getEnumDecoder(TokenStandard); 33 | } 34 | 35 | export function getTokenStandardCodec(): Codec< 36 | TokenStandardArgs, 37 | TokenStandard 38 | > { 39 | return combineCodec(getTokenStandardEncoder(), getTokenStandardDecoder()); 40 | } 41 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/token/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Address, 3 | ProgramDerivedAddress, 4 | getAddressEncoder, 5 | getProgramDerivedAddress, 6 | } from '@solana/web3.js'; 7 | import { 8 | ASSOCIATED_TOKEN_ACCOUNTS_PROGRAM_ID, 9 | TOKEN_PROGRAM_ID, 10 | } from '@tensor-foundation/test-helpers'; 11 | 12 | export type AtaSeeds = { 13 | /** The address of the owner of the associated token account */ 14 | owner: Address; 15 | /** The address of the mint account */ 16 | mint: Address; 17 | /** The address of the token program */ 18 | tokenProgram?: Address; 19 | }; 20 | 21 | // Find the associated token account address for a given owner, mint and token program. 22 | export const findAtaPda = async ( 23 | seeds: AtaSeeds 24 | ): Promise => { 25 | return await getProgramDerivedAddress({ 26 | seeds: [ 27 | getAddressEncoder().encode(seeds.owner), 28 | getAddressEncoder().encode(seeds.tokenProgram ?? TOKEN_PROGRAM_ID), 29 | getAddressEncoder().encode(seeds.mint), 30 | ], 31 | programAddress: ASSOCIATED_TOKEN_ACCOUNTS_PROGRAM_ID, 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/authorityType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum AuthorityType { 19 | None, 20 | Metadata, 21 | Holder, 22 | MetadataDelegate, 23 | TokenDelegate, 24 | } 25 | 26 | export type AuthorityTypeArgs = AuthorityType; 27 | 28 | export function getAuthorityTypeEncoder(): Encoder { 29 | return getEnumEncoder(AuthorityType); 30 | } 31 | 32 | export function getAuthorityTypeDecoder(): Decoder { 33 | return getEnumDecoder(AuthorityType); 34 | } 35 | 36 | export function getAuthorityTypeCodec(): Codec< 37 | AuthorityTypeArgs, 38 | AuthorityType 39 | > { 40 | return combineCodec(getAuthorityTypeEncoder(), getAuthorityTypeDecoder()); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/permanentBurnDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export type PermanentBurnDelegate = {}; 19 | 20 | export type PermanentBurnDelegateArgs = PermanentBurnDelegate; 21 | 22 | export function getPermanentBurnDelegateEncoder(): Encoder { 23 | return getStructEncoder([]); 24 | } 25 | 26 | export function getPermanentBurnDelegateDecoder(): Decoder { 27 | return getStructDecoder([]); 28 | } 29 | 30 | export function getPermanentBurnDelegateCodec(): Codec< 31 | PermanentBurnDelegateArgs, 32 | PermanentBurnDelegate 33 | > { 34 | return combineCodec( 35 | getPermanentBurnDelegateEncoder(), 36 | getPermanentBurnDelegateDecoder() 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/verificationArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum VerificationArgs { 19 | CreatorV1, 20 | CollectionV1, 21 | } 22 | 23 | export type VerificationArgsArgs = VerificationArgs; 24 | 25 | export function getVerificationArgsEncoder(): Encoder { 26 | return getEnumEncoder(VerificationArgs); 27 | } 28 | 29 | export function getVerificationArgsDecoder(): Decoder { 30 | return getEnumDecoder(VerificationArgs); 31 | } 32 | 33 | export function getVerificationArgsCodec(): Codec< 34 | VerificationArgsArgs, 35 | VerificationArgs 36 | > { 37 | return combineCodec( 38 | getVerificationArgsEncoder(), 39 | getVerificationArgsDecoder() 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/freezeDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getBooleanDecoder, 12 | getBooleanEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type FreezeDelegate = { frozen: boolean }; 21 | 22 | export type FreezeDelegateArgs = FreezeDelegate; 23 | 24 | export function getFreezeDelegateEncoder(): Encoder { 25 | return getStructEncoder([['frozen', getBooleanEncoder()]]); 26 | } 27 | 28 | export function getFreezeDelegateDecoder(): Decoder { 29 | return getStructDecoder([['frozen', getBooleanDecoder()]]); 30 | } 31 | 32 | export function getFreezeDelegateCodec(): Codec< 33 | FreezeDelegateArgs, 34 | FreezeDelegate 35 | > { 36 | return combineCodec(getFreezeDelegateEncoder(), getFreezeDelegateDecoder()); 37 | } 38 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/holderDelegateRole.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum HolderDelegateRole { 19 | PrintDelegate, 20 | } 21 | 22 | export type HolderDelegateRoleArgs = HolderDelegateRole; 23 | 24 | export function getHolderDelegateRoleEncoder(): Encoder { 25 | return getEnumEncoder(HolderDelegateRole); 26 | } 27 | 28 | export function getHolderDelegateRoleDecoder(): Decoder { 29 | return getEnumDecoder(HolderDelegateRole); 30 | } 31 | 32 | export function getHolderDelegateRoleCodec(): Codec< 33 | HolderDelegateRoleArgs, 34 | HolderDelegateRole 35 | > { 36 | return combineCodec( 37 | getHolderDelegateRoleEncoder(), 38 | getHolderDelegateRoleDecoder() 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/payloadKey.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum PayloadKey { 19 | Amount, 20 | Authority, 21 | AuthoritySeeds, 22 | Delegate, 23 | DelegateSeeds, 24 | Destination, 25 | DestinationSeeds, 26 | Holder, 27 | Source, 28 | SourceSeeds, 29 | } 30 | 31 | export type PayloadKeyArgs = PayloadKey; 32 | 33 | export function getPayloadKeyEncoder(): Encoder { 34 | return getEnumEncoder(PayloadKey); 35 | } 36 | 37 | export function getPayloadKeyDecoder(): Decoder { 38 | return getEnumDecoder(PayloadKey); 39 | } 40 | 41 | export function getPayloadKeyCodec(): Codec { 42 | return combineCodec(getPayloadKeyEncoder(), getPayloadKeyDecoder()); 43 | } 44 | -------------------------------------------------------------------------------- /wns/src/generated/pdas/group.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Address, 11 | ProgramDerivedAddress, 12 | fixEncoderSize, 13 | getAddressEncoder, 14 | getBytesEncoder, 15 | getProgramDerivedAddress, 16 | } from '@solana/web3.js'; 17 | 18 | export type GroupSeeds = { 19 | mint: Address; 20 | }; 21 | 22 | export async function findGroupPda( 23 | seeds: GroupSeeds, 24 | config: { programAddress?: Address | undefined } = {} 25 | ): Promise { 26 | const { 27 | programAddress = 'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM' as Address<'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM'>, 28 | } = config; 29 | return await getProgramDerivedAddress({ 30 | programAddress, 31 | seeds: [ 32 | fixEncoderSize(getBytesEncoder(), 5).encode( 33 | new Uint8Array([103, 114, 111, 117, 112]) 34 | ), 35 | getAddressEncoder().encode(seeds.mint), 36 | ], 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/validationResult.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum ValidationResult { 19 | Approved, 20 | Rejected, 21 | Pass, 22 | ForceApproved, 23 | } 24 | 25 | export type ValidationResultArgs = ValidationResult; 26 | 27 | export function getValidationResultEncoder(): Encoder { 28 | return getEnumEncoder(ValidationResult); 29 | } 30 | 31 | export function getValidationResultDecoder(): Decoder { 32 | return getEnumDecoder(ValidationResult); 33 | } 34 | 35 | export function getValidationResultCodec(): Codec< 36 | ValidationResultArgs, 37 | ValidationResult 38 | > { 39 | return combineCodec( 40 | getValidationResultEncoder(), 41 | getValidationResultDecoder() 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/selfTradeBehavior.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum SelfTradeBehavior { 19 | Abort, 20 | CancelProvide, 21 | DecrementTake, 22 | } 23 | 24 | export type SelfTradeBehaviorArgs = SelfTradeBehavior; 25 | 26 | export function getSelfTradeBehaviorEncoder(): Encoder { 27 | return getEnumEncoder(SelfTradeBehavior); 28 | } 29 | 30 | export function getSelfTradeBehaviorDecoder(): Decoder { 31 | return getEnumDecoder(SelfTradeBehavior); 32 | } 33 | 34 | export function getSelfTradeBehaviorCodec(): Codec< 35 | SelfTradeBehaviorArgs, 36 | SelfTradeBehavior 37 | > { 38 | return combineCodec( 39 | getSelfTradeBehaviorEncoder(), 40 | getSelfTradeBehaviorDecoder() 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /wns/src/generated/pdas/member.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Address, 11 | ProgramDerivedAddress, 12 | fixEncoderSize, 13 | getAddressEncoder, 14 | getBytesEncoder, 15 | getProgramDerivedAddress, 16 | } from '@solana/web3.js'; 17 | 18 | export type MemberSeeds = { 19 | mint: Address; 20 | }; 21 | 22 | export async function findMemberPda( 23 | seeds: MemberSeeds, 24 | config: { programAddress?: Address | undefined } = {} 25 | ): Promise { 26 | const { 27 | programAddress = 'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM' as Address<'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM'>, 28 | } = config; 29 | return await getProgramDerivedAddress({ 30 | programAddress, 31 | seeds: [ 32 | fixEncoderSize(getBytesEncoder(), 6).encode( 33 | new Uint8Array([109, 101, 109, 98, 101, 114]) 34 | ), 35 | getAddressEncoder().encode(seeds.mint), 36 | ], 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/bubblegumEventType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum BubblegumEventType { 19 | Uninitialized, 20 | LeafSchemaEvent, 21 | } 22 | 23 | export type BubblegumEventTypeArgs = BubblegumEventType; 24 | 25 | export function getBubblegumEventTypeEncoder(): Encoder { 26 | return getEnumEncoder(BubblegumEventType); 27 | } 28 | 29 | export function getBubblegumEventTypeDecoder(): Decoder { 30 | return getEnumDecoder(BubblegumEventType); 31 | } 32 | 33 | export function getBubblegumEventTypeCodec(): Codec< 34 | BubblegumEventTypeArgs, 35 | BubblegumEventType 36 | > { 37 | return combineCodec( 38 | getBubblegumEventTypeEncoder(), 39 | getBubblegumEventTypeDecoder() 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/decompressibleState.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum DecompressibleState { 19 | Enabled, 20 | Disabled, 21 | } 22 | 23 | export type DecompressibleStateArgs = DecompressibleState; 24 | 25 | export function getDecompressibleStateEncoder(): Encoder { 26 | return getEnumEncoder(DecompressibleState); 27 | } 28 | 29 | export function getDecompressibleStateDecoder(): Decoder { 30 | return getEnumDecoder(DecompressibleState); 31 | } 32 | 33 | export function getDecompressibleStateCodec(): Codec< 34 | DecompressibleStateArgs, 35 | DecompressibleState 36 | > { 37 | return combineCodec( 38 | getDecompressibleStateEncoder(), 39 | getDecompressibleStateDecoder() 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/seatApprovalStatus.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum SeatApprovalStatus { 19 | NotApproved, 20 | Approved, 21 | Retired, 22 | } 23 | 24 | export type SeatApprovalStatusArgs = SeatApprovalStatus; 25 | 26 | export function getSeatApprovalStatusEncoder(): Encoder { 27 | return getEnumEncoder(SeatApprovalStatus); 28 | } 29 | 30 | export function getSeatApprovalStatusDecoder(): Decoder { 31 | return getEnumDecoder(SeatApprovalStatus); 32 | } 33 | 34 | export function getSeatApprovalStatusCodec(): Codec< 35 | SeatApprovalStatusArgs, 36 | SeatApprovalStatus 37 | > { 38 | return combineCodec( 39 | getSeatApprovalStatusEncoder(), 40 | getSeatApprovalStatusDecoder() 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/tokenProgramVersion.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum TokenProgramVersion { 19 | Original, 20 | Token2022, 21 | } 22 | 23 | export type TokenProgramVersionArgs = TokenProgramVersion; 24 | 25 | export function getTokenProgramVersionEncoder(): Encoder { 26 | return getEnumEncoder(TokenProgramVersion); 27 | } 28 | 29 | export function getTokenProgramVersionDecoder(): Decoder { 30 | return getEnumDecoder(TokenProgramVersion); 31 | } 32 | 33 | export function getTokenProgramVersionCodec(): Codec< 34 | TokenProgramVersionArgs, 35 | TokenProgramVersion 36 | > { 37 | return combineCodec( 38 | getTokenProgramVersionEncoder(), 39 | getTokenProgramVersionDecoder() 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/permanentTransferDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export type PermanentTransferDelegate = {}; 19 | 20 | export type PermanentTransferDelegateArgs = PermanentTransferDelegate; 21 | 22 | export function getPermanentTransferDelegateEncoder(): Encoder { 23 | return getStructEncoder([]); 24 | } 25 | 26 | export function getPermanentTransferDelegateDecoder(): Decoder { 27 | return getStructDecoder([]); 28 | } 29 | 30 | export function getPermanentTransferDelegateCodec(): Codec< 31 | PermanentTransferDelegateArgs, 32 | PermanentTransferDelegate 33 | > { 34 | return combineCodec( 35 | getPermanentTransferDelegateEncoder(), 36 | getPermanentTransferDelegateDecoder() 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/tokenStandard.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum TokenStandard { 19 | NonFungible, 20 | FungibleAsset, 21 | Fungible, 22 | NonFungibleEdition, 23 | ProgrammableNonFungible, 24 | ProgrammableNonFungibleEdition, 25 | } 26 | 27 | export type TokenStandardArgs = TokenStandard; 28 | 29 | export function getTokenStandardEncoder(): Encoder { 30 | return getEnumEncoder(TokenStandard); 31 | } 32 | 33 | export function getTokenStandardDecoder(): Decoder { 34 | return getEnumDecoder(TokenStandard); 35 | } 36 | 37 | export function getTokenStandardCodec(): Codec< 38 | TokenStandardArgs, 39 | TokenStandard 40 | > { 41 | return combineCodec(getTokenStandardEncoder(), getTokenStandardDecoder()); 42 | } 43 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/pdas/metadata.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | getAddressEncoder, 11 | getProgramDerivedAddress, 12 | getUtf8Encoder, 13 | type Address, 14 | type ProgramDerivedAddress, 15 | } from '@solana/web3.js'; 16 | 17 | export type MetadataSeeds = { 18 | /** The address of the mint account */ 19 | mint: Address; 20 | }; 21 | 22 | export async function findMetadataPda( 23 | seeds: MetadataSeeds, 24 | config: { programAddress?: Address | undefined } = {} 25 | ): Promise { 26 | const { 27 | programAddress = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' as Address<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'>, 28 | } = config; 29 | return await getProgramDerivedAddress({ 30 | programAddress, 31 | seeds: [ 32 | getUtf8Encoder().encode('metadata'), 33 | getAddressEncoder().encode(programAddress), 34 | getAddressEncoder().encode(seeds.mint), 35 | ], 36 | }); 37 | } 38 | -------------------------------------------------------------------------------- /common-helpers/src/shared-types/tUses.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Codec, 3 | Decoder, 4 | Encoder, 5 | combineCodec, 6 | getStructDecoder, 7 | getStructEncoder, 8 | getU64Decoder, 9 | getU64Encoder, 10 | } from '@solana/web3.js'; 11 | import { 12 | TUseMethod, 13 | TUseMethodArgs, 14 | getTUseMethodDecoder, 15 | getTUseMethodEncoder, 16 | } from '.'; 17 | 18 | export type TUses = { useMethod: TUseMethod; remaining: bigint; total: bigint }; 19 | 20 | export type TUsesArgs = { 21 | useMethod: TUseMethodArgs; 22 | remaining: number | bigint; 23 | total: number | bigint; 24 | }; 25 | 26 | export function getTUsesEncoder(): Encoder { 27 | return getStructEncoder([ 28 | ['useMethod', getTUseMethodEncoder()], 29 | ['remaining', getU64Encoder()], 30 | ['total', getU64Encoder()], 31 | ]); 32 | } 33 | 34 | export function getTUsesDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['useMethod', getTUseMethodDecoder()], 37 | ['remaining', getU64Decoder()], 38 | ['total', getU64Decoder()], 39 | ]); 40 | } 41 | 42 | export function getTUsesCodec(): Codec { 43 | return combineCodec(getTUsesEncoder(), getTUsesDecoder()); 44 | } 45 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/externalCheckResult.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU32Decoder, 14 | getU32Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type ExternalCheckResult = { flags: number }; 21 | 22 | export type ExternalCheckResultArgs = ExternalCheckResult; 23 | 24 | export function getExternalCheckResultEncoder(): Encoder { 25 | return getStructEncoder([['flags', getU32Encoder()]]); 26 | } 27 | 28 | export function getExternalCheckResultDecoder(): Decoder { 29 | return getStructDecoder([['flags', getU32Decoder()]]); 30 | } 31 | 32 | export function getExternalCheckResultCodec(): Codec< 33 | ExternalCheckResultArgs, 34 | ExternalCheckResult 35 | > { 36 | return combineCodec( 37 | getExternalCheckResultEncoder(), 38 | getExternalCheckResultDecoder() 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/key.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum Key { 19 | Uninitialized, 20 | EditionV1, 21 | MasterEditionV1, 22 | ReservationListV1, 23 | MetadataV1, 24 | ReservationListV2, 25 | MasterEditionV2, 26 | EditionMarker, 27 | UseAuthorityRecord, 28 | CollectionAuthorityRecord, 29 | TokenOwnedEscrow, 30 | TokenRecord, 31 | MetadataDelegate, 32 | EditionMarkerV2, 33 | HolderDelegate, 34 | } 35 | 36 | export type KeyArgs = Key; 37 | 38 | export function getKeyEncoder(): Encoder { 39 | return getEnumEncoder(Key); 40 | } 41 | 42 | export function getKeyDecoder(): Decoder { 43 | return getEnumDecoder(Key); 44 | } 45 | 46 | export function getKeyCodec(): Codec { 47 | return combineCodec(getKeyEncoder(), getKeyDecoder()); 48 | } 49 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/tokenDelegateRole.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum TokenDelegateRole { 19 | Sale, 20 | Transfer, 21 | Utility, 22 | Staking, 23 | Standard, 24 | LockedTransfer, 25 | Migration, 26 | } 27 | 28 | export type TokenDelegateRoleArgs = TokenDelegateRole; 29 | 30 | export function getTokenDelegateRoleEncoder(): Encoder { 31 | return getEnumEncoder(TokenDelegateRole); 32 | } 33 | 34 | export function getTokenDelegateRoleDecoder(): Decoder { 35 | return getEnumDecoder(TokenDelegateRole); 36 | } 37 | 38 | export function getTokenDelegateRoleCodec(): Codec< 39 | TokenDelegateRoleArgs, 40 | TokenDelegateRole 41 | > { 42 | return combineCodec( 43 | getTokenDelegateRoleEncoder(), 44 | getTokenDelegateRoleDecoder() 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/creator.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | getU8Decoder, 16 | getU8Encoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type Creator = { address: Address; percentage: number }; 24 | 25 | export type CreatorArgs = Creator; 26 | 27 | export function getCreatorEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['address', getAddressEncoder()], 30 | ['percentage', getU8Encoder()], 31 | ]); 32 | } 33 | 34 | export function getCreatorDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['address', getAddressDecoder()], 37 | ['percentage', getU8Decoder()], 38 | ]); 39 | } 40 | 41 | export function getCreatorCodec(): Codec { 42 | return combineCodec(getCreatorEncoder(), getCreatorDecoder()); 43 | } 44 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/hookableLifecycleEvent.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum HookableLifecycleEvent { 19 | Create, 20 | Transfer, 21 | Burn, 22 | Update, 23 | } 24 | 25 | export type HookableLifecycleEventArgs = HookableLifecycleEvent; 26 | 27 | export function getHookableLifecycleEventEncoder(): Encoder { 28 | return getEnumEncoder(HookableLifecycleEvent); 29 | } 30 | 31 | export function getHookableLifecycleEventDecoder(): Decoder { 32 | return getEnumDecoder(HookableLifecycleEvent); 33 | } 34 | 35 | export function getHookableLifecycleEventCodec(): Codec< 36 | HookableLifecycleEventArgs, 37 | HookableLifecycleEvent 38 | > { 39 | return combineCodec( 40 | getHookableLifecycleEventEncoder(), 41 | getHookableLifecycleEventDecoder() 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/types/compressionAccountType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum CompressionAccountType { 19 | Uninitialized, 20 | ConcurrentMerkleTree, 21 | } 22 | 23 | export type CompressionAccountTypeArgs = CompressionAccountType; 24 | 25 | export function getCompressionAccountTypeEncoder(): Encoder { 26 | return getEnumEncoder(CompressionAccountType); 27 | } 28 | 29 | export function getCompressionAccountTypeDecoder(): Decoder { 30 | return getEnumDecoder(CompressionAccountType); 31 | } 32 | 33 | export function getCompressionAccountTypeCodec(): Codec< 34 | CompressionAccountTypeArgs, 35 | CompressionAccountType 36 | > { 37 | return combineCodec( 38 | getCompressionAccountTypeEncoder(), 39 | getCompressionAccountTypeDecoder() 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/externalValidationResult.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum ExternalValidationResult { 19 | Approved, 20 | Rejected, 21 | Pass, 22 | } 23 | 24 | export type ExternalValidationResultArgs = ExternalValidationResult; 25 | 26 | export function getExternalValidationResultEncoder(): Encoder { 27 | return getEnumEncoder(ExternalValidationResult); 28 | } 29 | 30 | export function getExternalValidationResultDecoder(): Decoder { 31 | return getEnumDecoder(ExternalValidationResult); 32 | } 33 | 34 | export function getExternalValidationResultCodec(): Codec< 35 | ExternalValidationResultArgs, 36 | ExternalValidationResult 37 | > { 38 | return combineCodec( 39 | getExternalValidationResultEncoder(), 40 | getExternalValidationResultDecoder() 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/setCollectionSizeArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type SetCollectionSizeArgs = { size: bigint }; 21 | 22 | export type SetCollectionSizeArgsArgs = { size: number | bigint }; 23 | 24 | export function getSetCollectionSizeArgsEncoder(): Encoder { 25 | return getStructEncoder([['size', getU64Encoder()]]); 26 | } 27 | 28 | export function getSetCollectionSizeArgsDecoder(): Decoder { 29 | return getStructDecoder([['size', getU64Decoder()]]); 30 | } 31 | 32 | export function getSetCollectionSizeArgsCodec(): Codec< 33 | SetCollectionSizeArgsArgs, 34 | SetCollectionSizeArgs 35 | > { 36 | return combineCodec( 37 | getSetCollectionSizeArgsEncoder(), 38 | getSetCollectionSizeArgsDecoder() 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/pdas/masterEdition.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | getAddressEncoder, 11 | getProgramDerivedAddress, 12 | getUtf8Encoder, 13 | type Address, 14 | type ProgramDerivedAddress, 15 | } from '@solana/web3.js'; 16 | 17 | export type MasterEditionSeeds = { 18 | /** The address of the mint account */ 19 | mint: Address; 20 | }; 21 | 22 | export async function findMasterEditionPda( 23 | seeds: MasterEditionSeeds, 24 | config: { programAddress?: Address | undefined } = {} 25 | ): Promise { 26 | const { 27 | programAddress = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' as Address<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'>, 28 | } = config; 29 | return await getProgramDerivedAddress({ 30 | programAddress, 31 | seeds: [ 32 | getUtf8Encoder().encode('metadata'), 33 | getAddressEncoder().encode(programAddress), 34 | getAddressEncoder().encode(seeds.mint), 35 | getUtf8Encoder().encode('edition'), 36 | ], 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /resolvers/src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Address, 3 | ProgramDerivedAddress, 4 | TransactionSigner, 5 | } from '@solana/web3.js'; 6 | 7 | export * from './pdas'; 8 | export * from './resolvers'; 9 | export * from './types'; 10 | 11 | /** 12 | * Defines an instruction account to resolve. 13 | * @internal 14 | */ 15 | export type ResolvedAccount< 16 | T extends string = string, 17 | U extends 18 | | Address 19 | | ProgramDerivedAddress 20 | | TransactionSigner 21 | | null = 22 | | Address 23 | | ProgramDerivedAddress 24 | | TransactionSigner 25 | | null, 26 | > = { 27 | isWritable: boolean; 28 | value: U; 29 | }; 30 | 31 | /** 32 | * Asserts that the given value is an Address. 33 | * @internal 34 | */ 35 | export function expectAddress( 36 | value: 37 | | Address 38 | | ProgramDerivedAddress 39 | | TransactionSigner 40 | | null 41 | | undefined 42 | ): Address { 43 | if (!value) { 44 | throw new Error('Expected a Address.'); 45 | } 46 | if (typeof value === 'object' && 'address' in value) { 47 | return value.address; 48 | } 49 | if (Array.isArray(value)) { 50 | return value[0]; 51 | } 52 | return value as Address; 53 | } 54 | -------------------------------------------------------------------------------- /wns/src/generated/pdas/approveAccount.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Address, 11 | ProgramDerivedAddress, 12 | fixEncoderSize, 13 | getAddressEncoder, 14 | getBytesEncoder, 15 | getProgramDerivedAddress, 16 | } from '@solana/web3.js'; 17 | 18 | export type ApproveAccountSeeds = { 19 | mint: Address; 20 | }; 21 | 22 | export async function findApproveAccountPda( 23 | seeds: ApproveAccountSeeds, 24 | config: { programAddress?: Address | undefined } = {} 25 | ): Promise { 26 | const { 27 | programAddress = 'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM' as Address<'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM'>, 28 | } = config; 29 | return await getProgramDerivedAddress({ 30 | programAddress, 31 | seeds: [ 32 | fixEncoderSize(getBytesEncoder(), 15).encode( 33 | new Uint8Array([ 34 | 97, 112, 112, 114, 111, 118, 101, 45, 97, 99, 99, 111, 117, 110, 116, 35 | ]) 36 | ), 37 | getAddressEncoder().encode(seeds.mint), 38 | ], 39 | }); 40 | } 41 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/externalPluginAdapterType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum ExternalPluginAdapterType { 19 | LifecycleHook, 20 | Oracle, 21 | DataStore, 22 | } 23 | 24 | export type ExternalPluginAdapterTypeArgs = ExternalPluginAdapterType; 25 | 26 | export function getExternalPluginAdapterTypeEncoder(): Encoder { 27 | return getEnumEncoder(ExternalPluginAdapterType); 28 | } 29 | 30 | export function getExternalPluginAdapterTypeDecoder(): Decoder { 31 | return getEnumDecoder(ExternalPluginAdapterType); 32 | } 33 | 34 | export function getExternalPluginAdapterTypeCodec(): Codec< 35 | ExternalPluginAdapterTypeArgs, 36 | ExternalPluginAdapterType 37 | > { 38 | return combineCodec( 39 | getExternalPluginAdapterTypeEncoder(), 40 | getExternalPluginAdapterTypeDecoder() 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/collection.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getBooleanDecoder, 14 | getBooleanEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type Collection = { verified: boolean; key: Address }; 24 | 25 | export type CollectionArgs = Collection; 26 | 27 | export function getCollectionEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['verified', getBooleanEncoder()], 30 | ['key', getAddressEncoder()], 31 | ]); 32 | } 33 | 34 | export function getCollectionDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['verified', getBooleanDecoder()], 37 | ['key', getAddressDecoder()], 38 | ]); 39 | } 40 | 41 | export function getCollectionCodec(): Codec { 42 | return combineCodec(getCollectionEncoder(), getCollectionDecoder()); 43 | } 44 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/revokeArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum RevokeArgs { 19 | CollectionV1, 20 | SaleV1, 21 | TransferV1, 22 | DataV1, 23 | UtilityV1, 24 | StakingV1, 25 | StandardV1, 26 | LockedTransferV1, 27 | ProgrammableConfigV1, 28 | MigrationV1, 29 | AuthorityItemV1, 30 | DataItemV1, 31 | CollectionItemV1, 32 | ProgrammableConfigItemV1, 33 | PrintDelegateV1, 34 | } 35 | 36 | export type RevokeArgsArgs = RevokeArgs; 37 | 38 | export function getRevokeArgsEncoder(): Encoder { 39 | return getEnumEncoder(RevokeArgs); 40 | } 41 | 42 | export function getRevokeArgsDecoder(): Decoder { 43 | return getEnumDecoder(RevokeArgs); 44 | } 45 | 46 | export function getRevokeArgsCodec(): Codec { 47 | return combineCodec(getRevokeArgsEncoder(), getRevokeArgsDecoder()); 48 | } 49 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/permanentFreezeDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getBooleanDecoder, 12 | getBooleanEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type PermanentFreezeDelegate = { frozen: boolean }; 21 | 22 | export type PermanentFreezeDelegateArgs = PermanentFreezeDelegate; 23 | 24 | export function getPermanentFreezeDelegateEncoder(): Encoder { 25 | return getStructEncoder([['frozen', getBooleanEncoder()]]); 26 | } 27 | 28 | export function getPermanentFreezeDelegateDecoder(): Decoder { 29 | return getStructDecoder([['frozen', getBooleanDecoder()]]); 30 | } 31 | 32 | export function getPermanentFreezeDelegateCodec(): Codec< 33 | PermanentFreezeDelegateArgs, 34 | PermanentFreezeDelegate 35 | > { 36 | return combineCodec( 37 | getPermanentFreezeDelegateEncoder(), 38 | getPermanentFreezeDelegateDecoder() 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/collection.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getBooleanDecoder, 14 | getBooleanEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type Collection = { verified: boolean; key: Address }; 24 | 25 | export type CollectionArgs = Collection; 26 | 27 | export function getCollectionEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['verified', getBooleanEncoder()], 30 | ['key', getAddressEncoder()], 31 | ]); 32 | } 33 | 34 | export function getCollectionDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['verified', getBooleanDecoder()], 37 | ['key', getAddressDecoder()], 38 | ]); 39 | } 40 | 41 | export function getCollectionCodec(): Codec { 42 | return combineCodec(getCollectionEncoder(), getCollectionDecoder()); 43 | } 44 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/externalPluginAdapterSchema.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum ExternalPluginAdapterSchema { 19 | Binary, 20 | Json, 21 | MsgPack, 22 | } 23 | 24 | export type ExternalPluginAdapterSchemaArgs = ExternalPluginAdapterSchema; 25 | 26 | export function getExternalPluginAdapterSchemaEncoder(): Encoder { 27 | return getEnumEncoder(ExternalPluginAdapterSchema); 28 | } 29 | 30 | export function getExternalPluginAdapterSchemaDecoder(): Decoder { 31 | return getEnumDecoder(ExternalPluginAdapterSchema); 32 | } 33 | 34 | export function getExternalPluginAdapterSchemaCodec(): Codec< 35 | ExternalPluginAdapterSchemaArgs, 36 | ExternalPluginAdapterSchema 37 | > { 38 | return combineCodec( 39 | getExternalPluginAdapterSchemaEncoder(), 40 | getExternalPluginAdapterSchemaDecoder() 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/pluginType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum PluginType { 19 | Royalties, 20 | FreezeDelegate, 21 | BurnDelegate, 22 | TransferDelegate, 23 | UpdateDelegate, 24 | PermanentFreezeDelegate, 25 | Attributes, 26 | PermanentTransferDelegate, 27 | PermanentBurnDelegate, 28 | Edition, 29 | MasterEdition, 30 | AddBlocker, 31 | ImmutableMetadata, 32 | VerifiedCreators, 33 | Autograph, 34 | } 35 | 36 | export type PluginTypeArgs = PluginType; 37 | 38 | export function getPluginTypeEncoder(): Encoder { 39 | return getEnumEncoder(PluginType); 40 | } 41 | 42 | export function getPluginTypeDecoder(): Decoder { 43 | return getEnumDecoder(PluginType); 44 | } 45 | 46 | export function getPluginTypeCodec(): Codec { 47 | return combineCodec(getPluginTypeEncoder(), getPluginTypeDecoder()); 48 | } 49 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/authorizationData.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | import { 18 | getPayloadDecoder, 19 | getPayloadEncoder, 20 | type Payload, 21 | type PayloadArgs, 22 | } from '.'; 23 | 24 | export type AuthorizationData = { payload: Payload }; 25 | 26 | export type AuthorizationDataArgs = { payload: PayloadArgs }; 27 | 28 | export function getAuthorizationDataEncoder(): Encoder { 29 | return getStructEncoder([['payload', getPayloadEncoder()]]); 30 | } 31 | 32 | export function getAuthorizationDataDecoder(): Decoder { 33 | return getStructDecoder([['payload', getPayloadDecoder()]]); 34 | } 35 | 36 | export function getAuthorizationDataCodec(): Codec< 37 | AuthorizationDataArgs, 38 | AuthorizationData 39 | > { 40 | return combineCodec( 41 | getAuthorizationDataEncoder(), 42 | getAuthorizationDataDecoder() 43 | ); 44 | } 45 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/proofInfo.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | fixDecoderSize, 12 | fixEncoderSize, 13 | getArrayDecoder, 14 | getArrayEncoder, 15 | getBytesDecoder, 16 | getBytesEncoder, 17 | getStructDecoder, 18 | getStructEncoder, 19 | type Codec, 20 | type Decoder, 21 | type Encoder, 22 | type ReadonlyUint8Array, 23 | } from '@solana/web3.js'; 24 | 25 | export type ProofInfo = { proof: Array }; 26 | 27 | export type ProofInfoArgs = ProofInfo; 28 | 29 | export function getProofInfoEncoder(): Encoder { 30 | return getStructEncoder([ 31 | ['proof', getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32))], 32 | ]); 33 | } 34 | 35 | export function getProofInfoDecoder(): Decoder { 36 | return getStructDecoder([ 37 | ['proof', getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32))], 38 | ]); 39 | } 40 | 41 | export function getProofInfoCodec(): Codec { 42 | return combineCodec(getProofInfoEncoder(), getProofInfoDecoder()); 43 | } 44 | -------------------------------------------------------------------------------- /wns/src/generated/pdas/extraMetasAccount.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Address, 11 | ProgramDerivedAddress, 12 | fixEncoderSize, 13 | getAddressEncoder, 14 | getBytesEncoder, 15 | getProgramDerivedAddress, 16 | } from '@solana/web3.js'; 17 | 18 | export type ExtraMetasAccountSeeds = { 19 | mint: Address; 20 | }; 21 | 22 | export async function findExtraMetasAccountPda( 23 | seeds: ExtraMetasAccountSeeds, 24 | config: { programAddress?: Address | undefined } = {} 25 | ): Promise { 26 | const { 27 | programAddress = 'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM' as Address<'wns1gDLt8fgLcGhWi5MqAqgXpwEP1JftKE9eZnXS1HM'>, 28 | } = config; 29 | return await getProgramDerivedAddress({ 30 | programAddress, 31 | seeds: [ 32 | fixEncoderSize(getBytesEncoder(), 19).encode( 33 | new Uint8Array([ 34 | 101, 120, 116, 114, 97, 45, 97, 99, 99, 111, 117, 110, 116, 45, 109, 35 | 101, 116, 97, 115, 36 | ]) 37 | ), 38 | getAddressEncoder().encode(seeds.mint), 39 | ], 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/metadataDelegateRole.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum MetadataDelegateRole { 19 | AuthorityItem, 20 | Collection, 21 | Use, 22 | Data, 23 | ProgrammableConfig, 24 | DataItem, 25 | CollectionItem, 26 | ProgrammableConfigItem, 27 | } 28 | 29 | export type MetadataDelegateRoleArgs = MetadataDelegateRole; 30 | 31 | export function getMetadataDelegateRoleEncoder(): Encoder { 32 | return getEnumEncoder(MetadataDelegateRole); 33 | } 34 | 35 | export function getMetadataDelegateRoleDecoder(): Decoder { 36 | return getEnumDecoder(MetadataDelegateRole); 37 | } 38 | 39 | export function getMetadataDelegateRoleCodec(): Codec< 40 | MetadataDelegateRoleArgs, 41 | MetadataDelegateRole 42 | > { 43 | return combineCodec( 44 | getMetadataDelegateRoleEncoder(), 45 | getMetadataDelegateRoleDecoder() 46 | ); 47 | } 48 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/feeEvent.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU16Decoder, 14 | getU16Encoder, 15 | getU64Decoder, 16 | getU64Encoder, 17 | type Codec, 18 | type Decoder, 19 | type Encoder, 20 | } from '@solana/web3.js'; 21 | 22 | export type FeeEvent = { index: number; feesCollectedInQuoteLots: bigint }; 23 | 24 | export type FeeEventArgs = { 25 | index: number; 26 | feesCollectedInQuoteLots: number | bigint; 27 | }; 28 | 29 | export function getFeeEventEncoder(): Encoder { 30 | return getStructEncoder([ 31 | ['index', getU16Encoder()], 32 | ['feesCollectedInQuoteLots', getU64Encoder()], 33 | ]); 34 | } 35 | 36 | export function getFeeEventDecoder(): Decoder { 37 | return getStructDecoder([ 38 | ['index', getU16Decoder()], 39 | ['feesCollectedInQuoteLots', getU64Decoder()], 40 | ]); 41 | } 42 | 43 | export function getFeeEventCodec(): Codec { 44 | return combineCodec(getFeeEventEncoder(), getFeeEventDecoder()); 45 | } 46 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './auditLogHeader'; 10 | export * from './cancelMultipleOrdersByIdParams'; 11 | export * from './cancelOrderParams'; 12 | export * from './cancelUpToParams'; 13 | export * from './condensedOrder'; 14 | export * from './evictEvent'; 15 | export * from './expiredOrderEvent'; 16 | export * from './failedMultipleLimitOrderBehavior'; 17 | export * from './feeEvent'; 18 | export * from './fIFOOrderId'; 19 | export * from './fillEvent'; 20 | export * from './fillSummaryEvent'; 21 | export * from './marketHeader'; 22 | export * from './marketSizeParams'; 23 | export * from './marketStatus'; 24 | export * from './multipleOrderPacket'; 25 | export * from './orderPacket'; 26 | export * from './phoenixMarketEvent'; 27 | export * from './placeEvent'; 28 | export * from './reduceEvent'; 29 | export * from './reduceOrderParams'; 30 | export * from './seat'; 31 | export * from './seatApprovalStatus'; 32 | export * from './selfTradeBehavior'; 33 | export * from './side'; 34 | export * from './timeInForceEvent'; 35 | export * from './tokenParams'; 36 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/updateDelegate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getArrayDecoder, 14 | getArrayEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type UpdateDelegate = { additionalDelegates: Array
}; 24 | 25 | export type UpdateDelegateArgs = UpdateDelegate; 26 | 27 | export function getUpdateDelegateEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['additionalDelegates', getArrayEncoder(getAddressEncoder())], 30 | ]); 31 | } 32 | 33 | export function getUpdateDelegateDecoder(): Decoder { 34 | return getStructDecoder([ 35 | ['additionalDelegates', getArrayDecoder(getAddressDecoder())], 36 | ]); 37 | } 38 | 39 | export function getUpdateDelegateCodec(): Codec< 40 | UpdateDelegateArgs, 41 | UpdateDelegate 42 | > { 43 | return combineCodec(getUpdateDelegateEncoder(), getUpdateDelegateDecoder()); 44 | } 45 | -------------------------------------------------------------------------------- /compat-helpers/src/accounts.ts: -------------------------------------------------------------------------------- 1 | import { AccountInfo, PublicKey } from '@solana/web3.js'; 2 | import { 3 | type EncodedAccount, 4 | type Address, 5 | lamports, 6 | Lamports, 7 | } from '@solana/web3.js-next'; 8 | 9 | export function fromAccountInfoToEncodedAccount< 10 | TAddress extends string = string, 11 | >(address: PublicKey, account: AccountInfo): EncodedAccount { 12 | return { 13 | address: address.toString() as Address, 14 | data: new Uint8Array(account.data), 15 | executable: account.executable, 16 | lamports: lamports(BigInt(account.lamports)), 17 | programAddress: account.owner.toString() as Address, 18 | }; 19 | } 20 | 21 | export function fromEncodedAccountToAccountInfo< 22 | TAddress extends string = string, 23 | >(account: EncodedAccount): AccountInfo { 24 | return { 25 | executable: account.executable, 26 | owner: new PublicKey(account.programAddress), 27 | lamports: lamportsToNumber(account.lamports), 28 | data: Buffer.from(account.data), 29 | }; 30 | } 31 | 32 | function lamportsToNumber(lamportsValue: Lamports): number { 33 | const num = Number(lamportsValue); 34 | if (!Number.isSafeInteger(num)) { 35 | throw new Error('Lamports value too large to convert to number safely'); 36 | } 37 | return num; 38 | } 39 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/fIFOOrderId.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type FIFOOrderId = { priceInTicks: bigint; orderSequenceNumber: bigint }; 21 | 22 | export type FIFOOrderIdArgs = { 23 | priceInTicks: number | bigint; 24 | orderSequenceNumber: number | bigint; 25 | }; 26 | 27 | export function getFIFOOrderIdEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['priceInTicks', getU64Encoder()], 30 | ['orderSequenceNumber', getU64Encoder()], 31 | ]); 32 | } 33 | 34 | export function getFIFOOrderIdDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['priceInTicks', getU64Decoder()], 37 | ['orderSequenceNumber', getU64Decoder()], 38 | ]); 39 | } 40 | 41 | export function getFIFOOrderIdCodec(): Codec { 42 | return combineCodec(getFIFOOrderIdEncoder(), getFIFOOrderIdDecoder()); 43 | } 44 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/attributes.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getArrayDecoder, 12 | getArrayEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | import { 20 | getAttributeDecoder, 21 | getAttributeEncoder, 22 | type Attribute, 23 | type AttributeArgs, 24 | } from '.'; 25 | 26 | export type Attributes = { attributeList: Array }; 27 | 28 | export type AttributesArgs = { attributeList: Array }; 29 | 30 | export function getAttributesEncoder(): Encoder { 31 | return getStructEncoder([ 32 | ['attributeList', getArrayEncoder(getAttributeEncoder())], 33 | ]); 34 | } 35 | 36 | export function getAttributesDecoder(): Decoder { 37 | return getStructDecoder([ 38 | ['attributeList', getArrayDecoder(getAttributeDecoder())], 39 | ]); 40 | } 41 | 42 | export function getAttributesCodec(): Codec { 43 | return combineCodec(getAttributesEncoder(), getAttributesDecoder()); 44 | } 45 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/codecs/merkleTreeDecoderFactories.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getAddressDecoder, 3 | getStructDecoder, 4 | getU32Decoder, 5 | getU64Decoder, 6 | getArrayDecoder, 7 | } from '@solana/web3.js'; 8 | 9 | export function getConcurrentMerkleTreeDecoderFactory( 10 | maxDepth: number, 11 | maxBufferSize: number 12 | ) { 13 | return getStructDecoder([ 14 | ['sequenceNumber', getU64Decoder()], 15 | ['activeIndex', getU64Decoder()], 16 | ['bufferSize', getU64Decoder()], 17 | [ 18 | 'changeLogs', 19 | getArrayDecoder(getChangeLogDecoderFactory(maxDepth), { 20 | size: maxBufferSize, 21 | }), 22 | ], 23 | ['rightMostPath', getPathDecoderFactory(maxDepth)], 24 | ]); 25 | } 26 | 27 | function getChangeLogDecoderFactory(maxDepth: number) { 28 | return getStructDecoder([ 29 | ['root', getAddressDecoder()], 30 | ['pathNodes', getArrayDecoder(getAddressDecoder(), { size: maxDepth })], 31 | ['index', getU32Decoder()], 32 | ['_padding', getU32Decoder()], 33 | ]); 34 | } 35 | 36 | function getPathDecoderFactory(maxDepth: number) { 37 | return getStructDecoder([ 38 | ['proof', getArrayDecoder(getAddressDecoder(), { size: maxDepth })], 39 | ['leaf', getAddressDecoder()], 40 | ['index', getU32Decoder()], 41 | ['_padding', getU32Decoder()], 42 | ]); 43 | } 44 | -------------------------------------------------------------------------------- /common-helpers/src/compression/codecs/merkleTreeDecoderFactories.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getAddressDecoder, 3 | getStructDecoder, 4 | getU32Decoder, 5 | getU64Decoder, 6 | getArrayDecoder, 7 | } from '@solana/web3.js'; 8 | 9 | export function getConcurrentMerkleTreeDecoderFactory( 10 | maxDepth: number, 11 | maxBufferSize: number 12 | ) { 13 | return getStructDecoder([ 14 | ['sequenceNumber', getU64Decoder()], 15 | ['activeIndex', getU64Decoder()], 16 | ['bufferSize', getU64Decoder()], 17 | [ 18 | 'changeLogs', 19 | getArrayDecoder(getChangeLogDecoderFactory(maxDepth), { 20 | size: maxBufferSize, 21 | }), 22 | ], 23 | ['rightMostPath', getPathDecoderFactory(maxDepth)], 24 | ]); 25 | } 26 | 27 | function getChangeLogDecoderFactory(maxDepth: number) { 28 | return getStructDecoder([ 29 | ['root', getAddressDecoder()], 30 | ['pathNodes', getArrayDecoder(getAddressDecoder(), { size: maxDepth })], 31 | ['index', getU32Decoder()], 32 | ['_padding', getU32Decoder()], 33 | ]); 34 | } 35 | 36 | function getPathDecoderFactory(maxDepth: number) { 37 | return getStructDecoder([ 38 | ['proof', getArrayDecoder(getAddressDecoder(), { size: maxDepth })], 39 | ['leaf', getAddressDecoder()], 40 | ['index', getU32Decoder()], 41 | ['_padding', getU32Decoder()], 42 | ]); 43 | } 44 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/types/pathNode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | fixDecoderSize, 12 | fixEncoderSize, 13 | getBytesDecoder, 14 | getBytesEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | getU32Decoder, 18 | getU32Encoder, 19 | type Codec, 20 | type Decoder, 21 | type Encoder, 22 | type ReadonlyUint8Array, 23 | } from '@solana/web3.js'; 24 | 25 | export type PathNode = { node: ReadonlyUint8Array; index: number }; 26 | 27 | export type PathNodeArgs = PathNode; 28 | 29 | export function getPathNodeEncoder(): Encoder { 30 | return getStructEncoder([ 31 | ['node', fixEncoderSize(getBytesEncoder(), 32)], 32 | ['index', getU32Encoder()], 33 | ]); 34 | } 35 | 36 | export function getPathNodeDecoder(): Decoder { 37 | return getStructDecoder([ 38 | ['node', fixDecoderSize(getBytesDecoder(), 32)], 39 | ['index', getU32Decoder()], 40 | ]); 41 | } 42 | 43 | export function getPathNodeCodec(): Codec { 44 | return combineCodec(getPathNodeEncoder(), getPathNodeDecoder()); 45 | } 46 | -------------------------------------------------------------------------------- /wns/src/generated/types/creatorWithShare.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Address, 11 | Codec, 12 | Decoder, 13 | Encoder, 14 | combineCodec, 15 | getAddressDecoder, 16 | getAddressEncoder, 17 | getStructDecoder, 18 | getStructEncoder, 19 | getU8Decoder, 20 | getU8Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type CreatorWithShare = { address: Address; share: number }; 24 | 25 | export type CreatorWithShareArgs = CreatorWithShare; 26 | 27 | export function getCreatorWithShareEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['address', getAddressEncoder()], 30 | ['share', getU8Encoder()], 31 | ]); 32 | } 33 | 34 | export function getCreatorWithShareDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['address', getAddressDecoder()], 37 | ['share', getU8Decoder()], 38 | ]); 39 | } 40 | 41 | export function getCreatorWithShareCodec(): Codec< 42 | CreatorWithShareArgs, 43 | CreatorWithShare 44 | > { 45 | return combineCodec( 46 | getCreatorWithShareEncoder(), 47 | getCreatorWithShareDecoder() 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/autograph.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getArrayDecoder, 12 | getArrayEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | import { 20 | getAutographSignatureDecoder, 21 | getAutographSignatureEncoder, 22 | type AutographSignature, 23 | type AutographSignatureArgs, 24 | } from '.'; 25 | 26 | export type Autograph = { signatures: Array }; 27 | 28 | export type AutographArgs = { signatures: Array }; 29 | 30 | export function getAutographEncoder(): Encoder { 31 | return getStructEncoder([ 32 | ['signatures', getArrayEncoder(getAutographSignatureEncoder())], 33 | ]); 34 | } 35 | 36 | export function getAutographDecoder(): Decoder { 37 | return getStructDecoder([ 38 | ['signatures', getArrayDecoder(getAutographSignatureDecoder())], 39 | ]); 40 | } 41 | 42 | export function getAutographCodec(): Codec { 43 | return combineCodec(getAutographEncoder(), getAutographDecoder()); 44 | } 45 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/creator.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getBooleanDecoder, 14 | getBooleanEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | getU8Decoder, 18 | getU8Encoder, 19 | type Address, 20 | type Codec, 21 | type Decoder, 22 | type Encoder, 23 | } from '@solana/web3.js'; 24 | 25 | export type Creator = { address: Address; verified: boolean; share: number }; 26 | 27 | export type CreatorArgs = Creator; 28 | 29 | export function getCreatorEncoder(): Encoder { 30 | return getStructEncoder([ 31 | ['address', getAddressEncoder()], 32 | ['verified', getBooleanEncoder()], 33 | ['share', getU8Encoder()], 34 | ]); 35 | } 36 | 37 | export function getCreatorDecoder(): Decoder { 38 | return getStructDecoder([ 39 | ['address', getAddressDecoder()], 40 | ['verified', getBooleanDecoder()], 41 | ['share', getU8Decoder()], 42 | ]); 43 | } 44 | 45 | export function getCreatorCodec(): Codec { 46 | return combineCodec(getCreatorEncoder(), getCreatorDecoder()); 47 | } 48 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/pdas/tokenRecord.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | getAddressEncoder, 11 | getProgramDerivedAddress, 12 | getUtf8Encoder, 13 | type Address, 14 | type ProgramDerivedAddress, 15 | } from '@solana/web3.js'; 16 | 17 | export type TokenRecordSeeds = { 18 | /** The address of the mint account */ 19 | mint: Address; 20 | /** The address of the token account (ata or not) */ 21 | token: Address; 22 | }; 23 | 24 | export async function findTokenRecordPda( 25 | seeds: TokenRecordSeeds, 26 | config: { programAddress?: Address | undefined } = {} 27 | ): Promise { 28 | const { 29 | programAddress = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' as Address<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'>, 30 | } = config; 31 | return await getProgramDerivedAddress({ 32 | programAddress, 33 | seeds: [ 34 | getUtf8Encoder().encode('metadata'), 35 | getAddressEncoder().encode(programAddress), 36 | getAddressEncoder().encode(seeds.mint), 37 | getUtf8Encoder().encode('token_record'), 38 | getAddressEncoder().encode(seeds.token), 39 | ], 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/attribute.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | addDecoderSizePrefix, 11 | addEncoderSizePrefix, 12 | combineCodec, 13 | getStructDecoder, 14 | getStructEncoder, 15 | getU32Decoder, 16 | getU32Encoder, 17 | getUtf8Decoder, 18 | getUtf8Encoder, 19 | type Codec, 20 | type Decoder, 21 | type Encoder, 22 | } from '@solana/web3.js'; 23 | 24 | export type Attribute = { key: string; value: string }; 25 | 26 | export type AttributeArgs = Attribute; 27 | 28 | export function getAttributeEncoder(): Encoder { 29 | return getStructEncoder([ 30 | ['key', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 31 | ['value', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 32 | ]); 33 | } 34 | 35 | export function getAttributeDecoder(): Decoder { 36 | return getStructDecoder([ 37 | ['key', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 38 | ['value', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 39 | ]); 40 | } 41 | 42 | export function getAttributeCodec(): Codec { 43 | return combineCodec(getAttributeEncoder(), getAttributeDecoder()); 44 | } 45 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/instructionName.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum InstructionName { 19 | Unknown, 20 | MintV1, 21 | Redeem, 22 | CancelRedeem, 23 | Transfer, 24 | Delegate, 25 | DecompressV1, 26 | Compress, 27 | Burn, 28 | CreateTree, 29 | VerifyCreator, 30 | UnverifyCreator, 31 | VerifyCollection, 32 | UnverifyCollection, 33 | SetAndVerifyCollection, 34 | MintToCollectionV1, 35 | SetDecompressibleState, 36 | UpdateMetadata, 37 | } 38 | 39 | export type InstructionNameArgs = InstructionName; 40 | 41 | export function getInstructionNameEncoder(): Encoder { 42 | return getEnumEncoder(InstructionName); 43 | } 44 | 45 | export function getInstructionNameDecoder(): Decoder { 46 | return getEnumDecoder(InstructionName); 47 | } 48 | 49 | export function getInstructionNameCodec(): Codec< 50 | InstructionNameArgs, 51 | InstructionName 52 | > { 53 | return combineCodec(getInstructionNameEncoder(), getInstructionNameDecoder()); 54 | } 55 | -------------------------------------------------------------------------------- /phoenix/scripts/utils.mjs: -------------------------------------------------------------------------------- 1 | import "zx/globals"; 2 | import { parse as parseToml } from "@iarna/toml"; 3 | 4 | process.env.FORCE_COLOR = 3; 5 | process.env.CARGO_TERM_COLOR = "always"; 6 | 7 | export const workingDirectory = (await $`pwd`.quiet()).toString().trim(); 8 | 9 | export function getAllProgramIdls() { 10 | return getAllProgramFolders().map((folder) => 11 | path.join(workingDirectory, folder, "idl.json") 12 | ); 13 | } 14 | 15 | export function getExternalProgramOutputDir() { 16 | return path.join(workingDirectory, "target/deploy"); 17 | } 18 | 19 | export function getExternalProgramAddresses() { 20 | const addresses = getProgramFolders().flatMap( 21 | (folder) => 22 | getCargo(folder).package?.metadata?.solana?.["program-dependencies"] ?? [] 23 | ); 24 | return Array.from(new Set(addresses)); 25 | } 26 | 27 | let didWarnAboutMissingPrograms = false; 28 | export function getProgramFolders() { 29 | // fixed here since we are only simulating having a program 30 | return ['program']; 31 | } 32 | 33 | export function getAllProgramFolders() { 34 | return getCargo().workspace.members.filter((member) => 35 | (getCargo(member).lib?.["crate-type"] ?? []).includes("cdylib") 36 | ); 37 | } 38 | 39 | export function getCargo(folder) { 40 | return parseToml( 41 | fs.readFileSync( 42 | path.join(workingDirectory, folder ? folder : ".", "Cargo.toml"), 43 | "utf8" 44 | ) 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /wns/scripts/utils.mjs: -------------------------------------------------------------------------------- 1 | import "zx/globals"; 2 | import { parse as parseToml } from "@iarna/toml"; 3 | 4 | process.env.FORCE_COLOR = 3; 5 | process.env.CARGO_TERM_COLOR = "always"; 6 | 7 | export const workingDirectory = (await $`pwd`.quiet()).toString().trim(); 8 | 9 | export function getAllProgramIdls() { 10 | return getAllProgramFolders().map((folder) => 11 | path.join(workingDirectory, folder, "idl.json") 12 | ); 13 | } 14 | 15 | export function getExternalProgramOutputDir() { 16 | return path.join(workingDirectory, "target/deploy"); 17 | } 18 | 19 | export function getExternalProgramAddresses() { 20 | const addresses = getProgramFolders().flatMap( 21 | (folder) => 22 | getCargo(folder).package?.metadata?.solana?.["program-dependencies"] ?? [] 23 | ); 24 | return Array.from(new Set(addresses)); 25 | } 26 | 27 | let didWarnAboutMissingPrograms = false; 28 | export function getProgramFolders() { 29 | // fixed here since we are only simulating having a program 30 | return ['program']; 31 | } 32 | 33 | export function getAllProgramFolders() { 34 | return getCargo().workspace.members.filter((member) => 35 | (getCargo(member).lib?.["crate-type"] ?? []).includes("cdylib") 36 | ); 37 | } 38 | 39 | export function getCargo(folder) { 40 | return parseToml( 41 | fs.readFileSync( 42 | path.join(workingDirectory, folder ? folder : ".", "Cargo.toml"), 43 | "utf8" 44 | ) 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /mpl-core/scripts/utils.mjs: -------------------------------------------------------------------------------- 1 | import "zx/globals"; 2 | import { parse as parseToml } from "@iarna/toml"; 3 | 4 | process.env.FORCE_COLOR = 3; 5 | process.env.CARGO_TERM_COLOR = "always"; 6 | 7 | export const workingDirectory = (await $`pwd`.quiet()).toString().trim(); 8 | 9 | export function getAllProgramIdls() { 10 | return getAllProgramFolders().map((folder) => 11 | path.join(workingDirectory, folder, "idl.json") 12 | ); 13 | } 14 | 15 | export function getExternalProgramOutputDir() { 16 | return path.join(workingDirectory, "target/deploy"); 17 | } 18 | 19 | export function getExternalProgramAddresses() { 20 | const addresses = getProgramFolders().flatMap( 21 | (folder) => 22 | getCargo(folder).package?.metadata?.solana?.["program-dependencies"] ?? [] 23 | ); 24 | return Array.from(new Set(addresses)); 25 | } 26 | 27 | let didWarnAboutMissingPrograms = false; 28 | export function getProgramFolders() { 29 | // fixed here since we are only simulating having a program 30 | return ['program']; 31 | } 32 | 33 | export function getAllProgramFolders() { 34 | return getCargo().workspace.members.filter((member) => 35 | (getCargo(member).lib?.["crate-type"] ?? []).includes("cdylib") 36 | ); 37 | } 38 | 39 | export function getCargo(folder) { 40 | return parseToml( 41 | fs.readFileSync( 42 | path.join(workingDirectory, folder ? folder : ".", "Cargo.toml"), 43 | "utf8" 44 | ) 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /mpl-bubblegum/scripts/utils.mjs: -------------------------------------------------------------------------------- 1 | import "zx/globals"; 2 | import { parse as parseToml } from "@iarna/toml"; 3 | 4 | process.env.FORCE_COLOR = 3; 5 | process.env.CARGO_TERM_COLOR = "always"; 6 | 7 | export const workingDirectory = (await $`pwd`.quiet()).toString().trim(); 8 | 9 | export function getAllProgramIdls() { 10 | return getAllProgramFolders().map((folder) => 11 | path.join(workingDirectory, folder, "idl.json") 12 | ); 13 | } 14 | 15 | export function getExternalProgramOutputDir() { 16 | return path.join(workingDirectory, "target/deploy"); 17 | } 18 | 19 | export function getExternalProgramAddresses() { 20 | const addresses = getProgramFolders().flatMap( 21 | (folder) => 22 | getCargo(folder).package?.metadata?.solana?.["program-dependencies"] ?? [] 23 | ); 24 | return Array.from(new Set(addresses)); 25 | } 26 | 27 | let didWarnAboutMissingPrograms = false; 28 | export function getProgramFolders() { 29 | // fixed here since we are only simulating having a program 30 | return ['program']; 31 | } 32 | 33 | export function getAllProgramFolders() { 34 | return getCargo().workspace.members.filter((member) => 35 | (getCargo(member).lib?.["crate-type"] ?? []).includes("cdylib") 36 | ); 37 | } 38 | 39 | export function getCargo(folder) { 40 | return parseToml( 41 | fs.readFileSync( 42 | path.join(workingDirectory, folder ? folder : ".", "Cargo.toml"), 43 | "utf8" 44 | ) 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /wns-distribution/scripts/utils.mjs: -------------------------------------------------------------------------------- 1 | import "zx/globals"; 2 | import { parse as parseToml } from "@iarna/toml"; 3 | 4 | process.env.FORCE_COLOR = 3; 5 | process.env.CARGO_TERM_COLOR = "always"; 6 | 7 | export const workingDirectory = (await $`pwd`.quiet()).toString().trim(); 8 | 9 | export function getAllProgramIdls() { 10 | return getAllProgramFolders().map((folder) => 11 | path.join(workingDirectory, folder, "idl.json") 12 | ); 13 | } 14 | 15 | export function getExternalProgramOutputDir() { 16 | return path.join(workingDirectory, "target/deploy"); 17 | } 18 | 19 | export function getExternalProgramAddresses() { 20 | const addresses = getProgramFolders().flatMap( 21 | (folder) => 22 | getCargo(folder).package?.metadata?.solana?.["program-dependencies"] ?? [] 23 | ); 24 | return Array.from(new Set(addresses)); 25 | } 26 | 27 | let didWarnAboutMissingPrograms = false; 28 | export function getProgramFolders() { 29 | // fixed here since we are only simulating having a program 30 | return ['program']; 31 | } 32 | 33 | export function getAllProgramFolders() { 34 | return getCargo().workspace.members.filter((member) => 35 | (getCargo(member).lib?.["crate-type"] ?? []).includes("cdylib") 36 | ); 37 | } 38 | 39 | export function getCargo(folder) { 40 | return parseToml( 41 | fs.readFileSync( 42 | path.join(workingDirectory, folder ? folder : ".", "Cargo.toml"), 43 | "utf8" 44 | ) 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /mpl-token-metadata/scripts/utils.mjs: -------------------------------------------------------------------------------- 1 | import "zx/globals"; 2 | import { parse as parseToml } from "@iarna/toml"; 3 | 4 | process.env.FORCE_COLOR = 3; 5 | process.env.CARGO_TERM_COLOR = "always"; 6 | 7 | export const workingDirectory = (await $`pwd`.quiet()).toString().trim(); 8 | 9 | export function getAllProgramIdls() { 10 | return getAllProgramFolders().map((folder) => 11 | path.join(workingDirectory, folder, "idl.json") 12 | ); 13 | } 14 | 15 | export function getExternalProgramOutputDir() { 16 | return path.join(workingDirectory, "target/deploy"); 17 | } 18 | 19 | export function getExternalProgramAddresses() { 20 | const addresses = getProgramFolders().flatMap( 21 | (folder) => 22 | getCargo(folder).package?.metadata?.solana?.["program-dependencies"] ?? [] 23 | ); 24 | return Array.from(new Set(addresses)); 25 | } 26 | 27 | let didWarnAboutMissingPrograms = false; 28 | export function getProgramFolders() { 29 | // fixed here since we are only simulating having a program 30 | return ['program']; 31 | } 32 | 33 | export function getAllProgramFolders() { 34 | return getCargo().workspace.members.filter((member) => 35 | (getCargo(member).lib?.["crate-type"] ?? []).includes("cdylib") 36 | ); 37 | } 38 | 39 | export function getCargo(folder) { 40 | return parseToml( 41 | fs.readFileSync( 42 | path.join(workingDirectory, folder ? folder : ".", "Cargo.toml"), 43 | "utf8" 44 | ) 45 | ); 46 | } 47 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/seedsVec.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | addDecoderSizePrefix, 11 | addEncoderSizePrefix, 12 | combineCodec, 13 | getArrayDecoder, 14 | getArrayEncoder, 15 | getBytesDecoder, 16 | getBytesEncoder, 17 | getStructDecoder, 18 | getStructEncoder, 19 | getU32Decoder, 20 | getU32Encoder, 21 | type Codec, 22 | type Decoder, 23 | type Encoder, 24 | type ReadonlyUint8Array, 25 | } from '@solana/web3.js'; 26 | 27 | export type SeedsVec = { seeds: Array }; 28 | 29 | export type SeedsVecArgs = SeedsVec; 30 | 31 | export function getSeedsVecEncoder(): Encoder { 32 | return getStructEncoder([ 33 | [ 34 | 'seeds', 35 | getArrayEncoder(addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())), 36 | ], 37 | ]); 38 | } 39 | 40 | export function getSeedsVecDecoder(): Decoder { 41 | return getStructDecoder([ 42 | [ 43 | 'seeds', 44 | getArrayDecoder(addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())), 45 | ], 46 | ]); 47 | } 48 | 49 | export function getSeedsVecCodec(): Codec { 50 | return combineCodec(getSeedsVecEncoder(), getSeedsVecDecoder()); 51 | } 52 | -------------------------------------------------------------------------------- /phoenix/src/generated/instructions/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './cancelAllOrders'; 10 | export * from './cancelAllOrdersWithFreeFunds'; 11 | export * from './cancelMultipleOrdersById'; 12 | export * from './cancelMultipleOrdersByIdWithFreeFunds'; 13 | export * from './cancelUpTo'; 14 | export * from './cancelUpToWithFreeFunds'; 15 | export * from './changeFeeRecipient'; 16 | export * from './changeMarketStatus'; 17 | export * from './changeSeatStatus'; 18 | export * from './claimAuthority'; 19 | export * from './collectFees'; 20 | export * from './depositFunds'; 21 | export * from './evictSeat'; 22 | export * from './forceCancelOrders'; 23 | export * from './initializeMarket'; 24 | export * from './log'; 25 | export * from './nameSuccessor'; 26 | export * from './placeLimitOrder'; 27 | export * from './placeLimitOrderWithFreeFunds'; 28 | export * from './placeMultiplePostOnlyOrders'; 29 | export * from './placeMultiplePostOnlyOrdersWithFreeFunds'; 30 | export * from './reduceOrder'; 31 | export * from './reduceOrderWithFreeFunds'; 32 | export * from './requestSeat'; 33 | export * from './requestSeatAuthorized'; 34 | export * from './swap'; 35 | export * from './swapWithFreeFunds'; 36 | export * from './withdrawFunds'; 37 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/uses.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | import { 20 | getUseMethodDecoder, 21 | getUseMethodEncoder, 22 | type UseMethod, 23 | type UseMethodArgs, 24 | } from '.'; 25 | 26 | export type Uses = { useMethod: UseMethod; remaining: bigint; total: bigint }; 27 | 28 | export type UsesArgs = { 29 | useMethod: UseMethodArgs; 30 | remaining: number | bigint; 31 | total: number | bigint; 32 | }; 33 | 34 | export function getUsesEncoder(): Encoder { 35 | return getStructEncoder([ 36 | ['useMethod', getUseMethodEncoder()], 37 | ['remaining', getU64Encoder()], 38 | ['total', getU64Encoder()], 39 | ]); 40 | } 41 | 42 | export function getUsesDecoder(): Decoder { 43 | return getStructDecoder([ 44 | ['useMethod', getUseMethodDecoder()], 45 | ['remaining', getU64Decoder()], 46 | ['total', getU64Decoder()], 47 | ]); 48 | } 49 | 50 | export function getUsesCodec(): Codec { 51 | return combineCodec(getUsesEncoder(), getUsesDecoder()); 52 | } 53 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/uses.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | import { 20 | getUseMethodDecoder, 21 | getUseMethodEncoder, 22 | type UseMethod, 23 | type UseMethodArgs, 24 | } from '.'; 25 | 26 | export type Uses = { useMethod: UseMethod; remaining: bigint; total: bigint }; 27 | 28 | export type UsesArgs = { 29 | useMethod: UseMethodArgs; 30 | remaining: number | bigint; 31 | total: number | bigint; 32 | }; 33 | 34 | export function getUsesEncoder(): Encoder { 35 | return getStructEncoder([ 36 | ['useMethod', getUseMethodEncoder()], 37 | ['remaining', getU64Encoder()], 38 | ['total', getU64Encoder()], 39 | ]); 40 | } 41 | 42 | export function getUsesDecoder(): Decoder { 43 | return getStructDecoder([ 44 | ['useMethod', getUseMethodDecoder()], 45 | ['remaining', getU64Decoder()], 46 | ['total', getU64Decoder()], 47 | ]); 48 | } 49 | 50 | export function getUsesCodec(): Codec { 51 | return combineCodec(getUsesEncoder(), getUsesDecoder()); 52 | } 53 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/reservationV1.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | getU8Decoder, 16 | getU8Encoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type ReservationV1 = { 24 | address: Address; 25 | spotsRemaining: number; 26 | totalSpots: number; 27 | }; 28 | 29 | export type ReservationV1Args = ReservationV1; 30 | 31 | export function getReservationV1Encoder(): Encoder { 32 | return getStructEncoder([ 33 | ['address', getAddressEncoder()], 34 | ['spotsRemaining', getU8Encoder()], 35 | ['totalSpots', getU8Encoder()], 36 | ]); 37 | } 38 | 39 | export function getReservationV1Decoder(): Decoder { 40 | return getStructDecoder([ 41 | ['address', getAddressDecoder()], 42 | ['spotsRemaining', getU8Decoder()], 43 | ['totalSpots', getU8Decoder()], 44 | ]); 45 | } 46 | 47 | export function getReservationV1Codec(): Codec< 48 | ReservationV1Args, 49 | ReservationV1 50 | > { 51 | return combineCodec(getReservationV1Encoder(), getReservationV1Decoder()); 52 | } 53 | -------------------------------------------------------------------------------- /wns-distribution/src/generated/types/creator.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | getU64Decoder, 16 | getU64Encoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type Creator = { 24 | /** creator address */ 25 | address: Address; 26 | /** token amount that creator can claim */ 27 | claimAmount: bigint; 28 | }; 29 | 30 | export type CreatorArgs = { 31 | /** creator address */ 32 | address: Address; 33 | /** token amount that creator can claim */ 34 | claimAmount: number | bigint; 35 | }; 36 | 37 | export function getCreatorEncoder(): Encoder { 38 | return getStructEncoder([ 39 | ['address', getAddressEncoder()], 40 | ['claimAmount', getU64Encoder()], 41 | ]); 42 | } 43 | 44 | export function getCreatorDecoder(): Decoder { 45 | return getStructDecoder([ 46 | ['address', getAddressDecoder()], 47 | ['claimAmount', getU64Decoder()], 48 | ]); 49 | } 50 | 51 | export function getCreatorCodec(): Codec { 52 | return combineCodec(getCreatorEncoder(), getCreatorDecoder()); 53 | } 54 | -------------------------------------------------------------------------------- /wns/src/generated/types/addMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Codec, 11 | Decoder, 12 | Encoder, 13 | addDecoderSizePrefix, 14 | addEncoderSizePrefix, 15 | combineCodec, 16 | getStructDecoder, 17 | getStructEncoder, 18 | getU32Decoder, 19 | getU32Encoder, 20 | getUtf8Decoder, 21 | getUtf8Encoder, 22 | } from '@solana/web3.js'; 23 | 24 | export type AddMetadataArgs = { field: string; value: string }; 25 | 26 | export type AddMetadataArgsArgs = AddMetadataArgs; 27 | 28 | export function getAddMetadataArgsEncoder(): Encoder { 29 | return getStructEncoder([ 30 | ['field', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 31 | ['value', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 32 | ]); 33 | } 34 | 35 | export function getAddMetadataArgsDecoder(): Decoder { 36 | return getStructDecoder([ 37 | ['field', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 38 | ['value', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 39 | ]); 40 | } 41 | 42 | export function getAddMetadataArgsCodec(): Codec< 43 | AddMetadataArgsArgs, 44 | AddMetadataArgs 45 | > { 46 | return combineCodec(getAddMetadataArgsEncoder(), getAddMetadataArgsDecoder()); 47 | } 48 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/failedMultipleLimitOrderBehavior.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getEnumDecoder, 12 | getEnumEncoder, 13 | type Codec, 14 | type Decoder, 15 | type Encoder, 16 | } from '@solana/web3.js'; 17 | 18 | export enum FailedMultipleLimitOrderBehavior { 19 | FailOnInsufficientFundsAndAmendOnCross, 20 | FailOnInsufficientFundsAndFailOnCross, 21 | SkipOnInsufficientFundsAndAmendOnCross, 22 | SkipOnInsufficientFundsAndFailOnCross, 23 | } 24 | 25 | export type FailedMultipleLimitOrderBehaviorArgs = 26 | FailedMultipleLimitOrderBehavior; 27 | 28 | export function getFailedMultipleLimitOrderBehaviorEncoder(): Encoder { 29 | return getEnumEncoder(FailedMultipleLimitOrderBehavior); 30 | } 31 | 32 | export function getFailedMultipleLimitOrderBehaviorDecoder(): Decoder { 33 | return getEnumDecoder(FailedMultipleLimitOrderBehavior); 34 | } 35 | 36 | export function getFailedMultipleLimitOrderBehaviorCodec(): Codec< 37 | FailedMultipleLimitOrderBehaviorArgs, 38 | FailedMultipleLimitOrderBehavior 39 | > { 40 | return combineCodec( 41 | getFailedMultipleLimitOrderBehaviorEncoder(), 42 | getFailedMultipleLimitOrderBehaviorDecoder() 43 | ); 44 | } 45 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/tokenParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | getU32Decoder, 16 | getU32Encoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type TokenParams = { 24 | decimals: number; 25 | vaultBump: number; 26 | mintKey: Address; 27 | vaultKey: Address; 28 | }; 29 | 30 | export type TokenParamsArgs = TokenParams; 31 | 32 | export function getTokenParamsEncoder(): Encoder { 33 | return getStructEncoder([ 34 | ['decimals', getU32Encoder()], 35 | ['vaultBump', getU32Encoder()], 36 | ['mintKey', getAddressEncoder()], 37 | ['vaultKey', getAddressEncoder()], 38 | ]); 39 | } 40 | 41 | export function getTokenParamsDecoder(): Decoder { 42 | return getStructDecoder([ 43 | ['decimals', getU32Decoder()], 44 | ['vaultBump', getU32Decoder()], 45 | ['mintKey', getAddressDecoder()], 46 | ['vaultKey', getAddressDecoder()], 47 | ]); 48 | } 49 | 50 | export function getTokenParamsCodec(): Codec { 51 | return combineCodec(getTokenParamsEncoder(), getTokenParamsDecoder()); 52 | } 53 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/generated/types/creator.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getBooleanDecoder, 14 | getBooleanEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | getU8Decoder, 18 | getU8Encoder, 19 | type Address, 20 | type Codec, 21 | type Decoder, 22 | type Encoder, 23 | } from '@solana/web3.js'; 24 | 25 | export type Creator = { 26 | address: Address; 27 | verified: boolean; 28 | /** 29 | * The percentage share. 30 | * 31 | * The value is a percentage, not basis points. 32 | */ 33 | share: number; 34 | }; 35 | 36 | export type CreatorArgs = Creator; 37 | 38 | export function getCreatorEncoder(): Encoder { 39 | return getStructEncoder([ 40 | ['address', getAddressEncoder()], 41 | ['verified', getBooleanEncoder()], 42 | ['share', getU8Encoder()], 43 | ]); 44 | } 45 | 46 | export function getCreatorDecoder(): Decoder { 47 | return getStructDecoder([ 48 | ['address', getAddressDecoder()], 49 | ['verified', getBooleanDecoder()], 50 | ['share', getU8Decoder()], 51 | ]); 52 | } 53 | 54 | export function getCreatorCodec(): Codec { 55 | return combineCodec(getCreatorEncoder(), getCreatorDecoder()); 56 | } 57 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/verifiedCreatorsSignature.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getBooleanDecoder, 14 | getBooleanEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type VerifiedCreatorsSignature = { address: Address; verified: boolean }; 24 | 25 | export type VerifiedCreatorsSignatureArgs = VerifiedCreatorsSignature; 26 | 27 | export function getVerifiedCreatorsSignatureEncoder(): Encoder { 28 | return getStructEncoder([ 29 | ['address', getAddressEncoder()], 30 | ['verified', getBooleanEncoder()], 31 | ]); 32 | } 33 | 34 | export function getVerifiedCreatorsSignatureDecoder(): Decoder { 35 | return getStructDecoder([ 36 | ['address', getAddressDecoder()], 37 | ['verified', getBooleanDecoder()], 38 | ]); 39 | } 40 | 41 | export function getVerifiedCreatorsSignatureCodec(): Codec< 42 | VerifiedCreatorsSignatureArgs, 43 | VerifiedCreatorsSignature 44 | > { 45 | return combineCodec( 46 | getVerifiedCreatorsSignatureEncoder(), 47 | getVerifiedCreatorsSignatureDecoder() 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/mintNewEditionFromMasterEditionViaTokenArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type MintNewEditionFromMasterEditionViaTokenArgs = { edition: bigint }; 21 | 22 | export type MintNewEditionFromMasterEditionViaTokenArgsArgs = { 23 | edition: number | bigint; 24 | }; 25 | 26 | export function getMintNewEditionFromMasterEditionViaTokenArgsEncoder(): Encoder { 27 | return getStructEncoder([['edition', getU64Encoder()]]); 28 | } 29 | 30 | export function getMintNewEditionFromMasterEditionViaTokenArgsDecoder(): Decoder { 31 | return getStructDecoder([['edition', getU64Decoder()]]); 32 | } 33 | 34 | export function getMintNewEditionFromMasterEditionViaTokenArgsCodec(): Codec< 35 | MintNewEditionFromMasterEditionViaTokenArgsArgs, 36 | MintNewEditionFromMasterEditionViaTokenArgs 37 | > { 38 | return combineCodec( 39 | getMintNewEditionFromMasterEditionViaTokenArgsEncoder(), 40 | getMintNewEditionFromMasterEditionViaTokenArgsDecoder() 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/marketSizeParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | 20 | export type MarketSizeParams = { 21 | bidsSize: bigint; 22 | asksSize: bigint; 23 | numSeats: bigint; 24 | }; 25 | 26 | export type MarketSizeParamsArgs = { 27 | bidsSize: number | bigint; 28 | asksSize: number | bigint; 29 | numSeats: number | bigint; 30 | }; 31 | 32 | export function getMarketSizeParamsEncoder(): Encoder { 33 | return getStructEncoder([ 34 | ['bidsSize', getU64Encoder()], 35 | ['asksSize', getU64Encoder()], 36 | ['numSeats', getU64Encoder()], 37 | ]); 38 | } 39 | 40 | export function getMarketSizeParamsDecoder(): Decoder { 41 | return getStructDecoder([ 42 | ['bidsSize', getU64Decoder()], 43 | ['asksSize', getU64Decoder()], 44 | ['numSeats', getU64Decoder()], 45 | ]); 46 | } 47 | 48 | export function getMarketSizeParamsCodec(): Codec< 49 | MarketSizeParamsArgs, 50 | MarketSizeParams 51 | > { 52 | return combineCodec( 53 | getMarketSizeParamsEncoder(), 54 | getMarketSizeParamsDecoder() 55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /mpl-token-metadata/src/generated/types/reservation.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getAddressDecoder, 12 | getAddressEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | getU64Decoder, 16 | getU64Encoder, 17 | type Address, 18 | type Codec, 19 | type Decoder, 20 | type Encoder, 21 | } from '@solana/web3.js'; 22 | 23 | export type Reservation = { 24 | address: Address; 25 | spotsRemaining: bigint; 26 | totalSpots: bigint; 27 | }; 28 | 29 | export type ReservationArgs = { 30 | address: Address; 31 | spotsRemaining: number | bigint; 32 | totalSpots: number | bigint; 33 | }; 34 | 35 | export function getReservationEncoder(): Encoder { 36 | return getStructEncoder([ 37 | ['address', getAddressEncoder()], 38 | ['spotsRemaining', getU64Encoder()], 39 | ['totalSpots', getU64Encoder()], 40 | ]); 41 | } 42 | 43 | export function getReservationDecoder(): Decoder { 44 | return getStructDecoder([ 45 | ['address', getAddressDecoder()], 46 | ['spotsRemaining', getU64Decoder()], 47 | ['totalSpots', getU64Decoder()], 48 | ]); 49 | } 50 | 51 | export function getReservationCodec(): Codec { 52 | return combineCodec(getReservationEncoder(), getReservationDecoder()); 53 | } 54 | -------------------------------------------------------------------------------- /wns/src/generated/types/removeMetadataArgs.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the kinobi library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun kinobi to update it. 5 | * 6 | * @see https://github.com/kinobi-so/kinobi 7 | */ 8 | 9 | import { 10 | Codec, 11 | Decoder, 12 | Encoder, 13 | addDecoderSizePrefix, 14 | addEncoderSizePrefix, 15 | combineCodec, 16 | getStructDecoder, 17 | getStructEncoder, 18 | getU32Decoder, 19 | getU32Encoder, 20 | getUtf8Decoder, 21 | getUtf8Encoder, 22 | } from '@solana/web3.js'; 23 | 24 | export type RemoveMetadataArgs = { field: string; value: string }; 25 | 26 | export type RemoveMetadataArgsArgs = RemoveMetadataArgs; 27 | 28 | export function getRemoveMetadataArgsEncoder(): Encoder { 29 | return getStructEncoder([ 30 | ['field', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 31 | ['value', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 32 | ]); 33 | } 34 | 35 | export function getRemoveMetadataArgsDecoder(): Decoder { 36 | return getStructDecoder([ 37 | ['field', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 38 | ['value', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 39 | ]); 40 | } 41 | 42 | export function getRemoveMetadataArgsCodec(): Codec< 43 | RemoveMetadataArgsArgs, 44 | RemoveMetadataArgs 45 | > { 46 | return combineCodec( 47 | getRemoveMetadataArgsEncoder(), 48 | getRemoveMetadataArgsDecoder() 49 | ); 50 | } 51 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/verifiedCreators.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getArrayDecoder, 12 | getArrayEncoder, 13 | getStructDecoder, 14 | getStructEncoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | import { 20 | getVerifiedCreatorsSignatureDecoder, 21 | getVerifiedCreatorsSignatureEncoder, 22 | type VerifiedCreatorsSignature, 23 | type VerifiedCreatorsSignatureArgs, 24 | } from '.'; 25 | 26 | export type VerifiedCreators = { signatures: Array }; 27 | 28 | export type VerifiedCreatorsArgs = { 29 | signatures: Array; 30 | }; 31 | 32 | export function getVerifiedCreatorsEncoder(): Encoder { 33 | return getStructEncoder([ 34 | ['signatures', getArrayEncoder(getVerifiedCreatorsSignatureEncoder())], 35 | ]); 36 | } 37 | 38 | export function getVerifiedCreatorsDecoder(): Decoder { 39 | return getStructDecoder([ 40 | ['signatures', getArrayDecoder(getVerifiedCreatorsSignatureDecoder())], 41 | ]); 42 | } 43 | 44 | export function getVerifiedCreatorsCodec(): Codec< 45 | VerifiedCreatorsArgs, 46 | VerifiedCreators 47 | > { 48 | return combineCodec( 49 | getVerifiedCreatorsEncoder(), 50 | getVerifiedCreatorsDecoder() 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /phoenix/src/generated/types/reduceOrderParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | combineCodec, 11 | getStructDecoder, 12 | getStructEncoder, 13 | getU64Decoder, 14 | getU64Encoder, 15 | type Codec, 16 | type Decoder, 17 | type Encoder, 18 | } from '@solana/web3.js'; 19 | import { 20 | getCancelOrderParamsDecoder, 21 | getCancelOrderParamsEncoder, 22 | type CancelOrderParams, 23 | type CancelOrderParamsArgs, 24 | } from '.'; 25 | 26 | export type ReduceOrderParams = { baseParams: CancelOrderParams; size: bigint }; 27 | 28 | export type ReduceOrderParamsArgs = { 29 | baseParams: CancelOrderParamsArgs; 30 | size: number | bigint; 31 | }; 32 | 33 | export function getReduceOrderParamsEncoder(): Encoder { 34 | return getStructEncoder([ 35 | ['baseParams', getCancelOrderParamsEncoder()], 36 | ['size', getU64Encoder()], 37 | ]); 38 | } 39 | 40 | export function getReduceOrderParamsDecoder(): Decoder { 41 | return getStructDecoder([ 42 | ['baseParams', getCancelOrderParamsDecoder()], 43 | ['size', getU64Decoder()], 44 | ]); 45 | } 46 | 47 | export function getReduceOrderParamsCodec(): Codec< 48 | ReduceOrderParamsArgs, 49 | ReduceOrderParams 50 | > { 51 | return combineCodec( 52 | getReduceOrderParamsEncoder(), 53 | getReduceOrderParamsDecoder() 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /mpl-core/src/generated/types/autographSignature.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | addDecoderSizePrefix, 11 | addEncoderSizePrefix, 12 | combineCodec, 13 | getAddressDecoder, 14 | getAddressEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | getU32Decoder, 18 | getU32Encoder, 19 | getUtf8Decoder, 20 | getUtf8Encoder, 21 | type Address, 22 | type Codec, 23 | type Decoder, 24 | type Encoder, 25 | } from '@solana/web3.js'; 26 | 27 | export type AutographSignature = { address: Address; message: string }; 28 | 29 | export type AutographSignatureArgs = AutographSignature; 30 | 31 | export function getAutographSignatureEncoder(): Encoder { 32 | return getStructEncoder([ 33 | ['address', getAddressEncoder()], 34 | ['message', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())], 35 | ]); 36 | } 37 | 38 | export function getAutographSignatureDecoder(): Decoder { 39 | return getStructDecoder([ 40 | ['address', getAddressDecoder()], 41 | ['message', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())], 42 | ]); 43 | } 44 | 45 | export function getAutographSignatureCodec(): Codec< 46 | AutographSignatureArgs, 47 | AutographSignature 48 | > { 49 | return combineCodec( 50 | getAutographSignatureEncoder(), 51 | getAutographSignatureDecoder() 52 | ); 53 | } 54 | -------------------------------------------------------------------------------- /resolvers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@tensor-foundation/resolvers", 3 | "version": "1.0.0-beta.1", 4 | "description": "Codama resolvers for Tensor protocols", 5 | "sideEffects": false, 6 | "module": "./dist/src/index.mjs", 7 | "main": "./dist/src/index.js", 8 | "types": "./dist/types/index.d.ts", 9 | "type": "commonjs", 10 | "exports": { 11 | ".": { 12 | "types": "./dist/types/index.d.ts", 13 | "import": "./dist/src/index.mjs", 14 | "require": "./dist/src/index.js" 15 | } 16 | }, 17 | "files": [ 18 | "./dist/src", 19 | "./dist/types" 20 | ], 21 | "scripts": { 22 | "build": "rimraf dist && tsup && tsc -p ./tsconfig.declarations.json", 23 | "build:docs": "typedoc", 24 | "clean": "rm -rf node_modules && rm -rf dist", 25 | "generate": "node ./generate.cjs", 26 | "lint": "eslint --ext js,ts,tsx src", 27 | "lint:fix": "eslint --fix --ext js,ts,tsx src", 28 | "format": "prettier --check src", 29 | "format:fix": "prettier --write src" 30 | }, 31 | "publishConfig": { 32 | "access": "public", 33 | "registry": "https://registry.npmjs.org/" 34 | }, 35 | "homepage": "https://github.com/tensor-foundation", 36 | "repository": "https://github.com/tensor-foundation/toolkit.git", 37 | "author": "Tensor Protocol Foundation ", 38 | "license": "Apache-2.0", 39 | "peerDependencies": { 40 | "@solana/web3.js": "2.0.0" 41 | }, 42 | "devDependencies": { 43 | "rimraf": "^5.0.5", 44 | "tsup": "^8.0.2", 45 | "typescript": "^5.4.2" 46 | }, 47 | "packageManager": "pnpm@9.1.0" 48 | } 49 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/compression/helpers.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Address, 3 | ProgramDerivedAddress, 4 | getProgramDerivedAddress, 5 | getAddressEncoder, 6 | } from '@solana/web3.js'; 7 | import { 8 | getCanopyDecoderFactory, 9 | getConcurrentMerkleTreeDecoderFactory, 10 | } from '../codecs'; 11 | 12 | export function getConcurrentMerkleTreeAccountSize( 13 | maxDepth: number, 14 | maxBufferSize: number, 15 | canopyDepth?: number, 16 | headerVersion = 'V1' 17 | ): number { 18 | if (headerVersion != 'V1') { 19 | throw Error('Unsupported header version'); 20 | } 21 | 22 | // The additional 2 bytes are needed for 23 | // - the account disciminant (1 byte) 24 | // - the header version (1 byte) 25 | return ( 26 | 2 + 27 | 54 + // concurrentMerkleTreeHeaderDataV1Beet.byteSize shoule be constant for V1 28 | getConcurrentMerkleTreeDecoderFactory(maxDepth, maxBufferSize).fixedSize + 29 | (canopyDepth ? getCanopyDecoderFactory(canopyDepth).fixedSize : 0) 30 | ); 31 | } 32 | 33 | export type TreeAuthoritySeeds = { 34 | /** The address of the merkle tree */ 35 | merkleTree: Address; 36 | }; 37 | 38 | export async function findTreeAuthorityPda( 39 | seeds: TreeAuthoritySeeds, 40 | config: { programAddress?: Address | undefined } = {} 41 | ): Promise { 42 | const { 43 | programAddress = 'BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY' as Address<'BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY'>, 44 | } = config; 45 | return await getProgramDerivedAddress({ 46 | programAddress, 47 | seeds: [getAddressEncoder().encode(seeds.merkleTree)], 48 | }); 49 | } 50 | -------------------------------------------------------------------------------- /mpl-bubblegum/src/account_compression/generated/types/applicationDataEventV1.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | import { 10 | addDecoderSizePrefix, 11 | addEncoderSizePrefix, 12 | combineCodec, 13 | getBytesDecoder, 14 | getBytesEncoder, 15 | getStructDecoder, 16 | getStructEncoder, 17 | getU32Decoder, 18 | getU32Encoder, 19 | type Codec, 20 | type Decoder, 21 | type Encoder, 22 | type ReadonlyUint8Array, 23 | } from '@solana/web3.js'; 24 | 25 | export type ApplicationDataEventV1 = { applicationData: ReadonlyUint8Array }; 26 | 27 | export type ApplicationDataEventV1Args = ApplicationDataEventV1; 28 | 29 | export function getApplicationDataEventV1Encoder(): Encoder { 30 | return getStructEncoder([ 31 | [ 32 | 'applicationData', 33 | addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()), 34 | ], 35 | ]); 36 | } 37 | 38 | export function getApplicationDataEventV1Decoder(): Decoder { 39 | return getStructDecoder([ 40 | [ 41 | 'applicationData', 42 | addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()), 43 | ], 44 | ]); 45 | } 46 | 47 | export function getApplicationDataEventV1Codec(): Codec< 48 | ApplicationDataEventV1Args, 49 | ApplicationDataEventV1 50 | > { 51 | return combineCodec( 52 | getApplicationDataEventV1Encoder(), 53 | getApplicationDataEventV1Decoder() 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /mpl-core/src/generated/instructions/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This code was AUTOGENERATED using the codama library. 3 | * Please DO NOT EDIT THIS FILE, instead use visitors 4 | * to add features, then rerun codama to update it. 5 | * 6 | * @see https://github.com/codama-idl/codama 7 | */ 8 | 9 | export * from './addCollectionExternalPluginAdapterV1'; 10 | export * from './addCollectionPluginV1'; 11 | export * from './addExternalPluginAdapterV1'; 12 | export * from './addPluginV1'; 13 | export * from './approveCollectionPluginAuthorityV1'; 14 | export * from './approvePluginAuthorityV1'; 15 | export * from './burnCollectionV1'; 16 | export * from './burnV1'; 17 | export * from './collect'; 18 | export * from './compressV1'; 19 | export * from './createCollectionV1'; 20 | export * from './createCollectionV2'; 21 | export * from './createV1'; 22 | export * from './createV2'; 23 | export * from './decompressV1'; 24 | export * from './removeCollectionExternalPluginAdapterV1'; 25 | export * from './removeCollectionPluginV1'; 26 | export * from './removeExternalPluginAdapterV1'; 27 | export * from './removePluginV1'; 28 | export * from './revokeCollectionPluginAuthorityV1'; 29 | export * from './revokePluginAuthorityV1'; 30 | export * from './transferV1'; 31 | export * from './updateCollectionExternalPluginAdapterV1'; 32 | export * from './updateCollectionPluginV1'; 33 | export * from './updateCollectionV1'; 34 | export * from './updateExternalPluginAdapterV1'; 35 | export * from './updatePluginV1'; 36 | export * from './updateV1'; 37 | export * from './writeCollectionExternalPluginAdapterDataV1'; 38 | export * from './writeExternalPluginAdapterDataV1'; 39 | --------------------------------------------------------------------------------