From ee9b0d0caab9122fa57b81048bdafe98ffedc897 Mon Sep 17 00:00:00 2001 From: Kabie Date: Sun, 23 Jun 2024 21:28:12 +0800 Subject: [PATCH 1/2] remove sysvar --- cli/src/main.rs | 66 ++++++++++++++++++++++++++------------ package.json | 17 +++++----- program/idl.json | 8 ----- program/src/instruction.rs | 17 +++++----- program/tests/lib.rs | 36 ++++++--------------- scripts/generate-idls.mjs | 21 +++++------- 6 files changed, 78 insertions(+), 87 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 445f499..4b130d8 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,14 +1,24 @@ -use std::{error::Error, str::FromStr, time::Duration}; use std::time::{SystemTime, UNIX_EPOCH}; +use std::{error::Error, str::FromStr, time::Duration}; use arrayref::array_ref; use clap::{Args, Parser, Subcommand, ValueEnum}; -use dephy_id_program_client::{instructions::{ - ActivateDeviceBuilder, CreateDeviceBuilder, CreateProductBuilder, InitializeBuilder, -}, types::{self, DeviceActivationSignature}, DEVICE_MESSAGE_PREFIX, DEVICE_MINT_SEED_PREFIX, ID as PROGRAM_ID, PRODUCT_MINT_SEED_PREFIX, PROGRAM_PDA_SEED_PREFIX, EIP191_MESSAGE_PREFIX}; +use dephy_id_program_client::{ + instructions::{ + ActivateDeviceBuilder, CreateDeviceBuilder, CreateProductBuilder, InitializeBuilder, + }, + types::{self, DeviceActivationSignature}, + DEVICE_MESSAGE_PREFIX, DEVICE_MINT_SEED_PREFIX, EIP191_MESSAGE_PREFIX, ID as PROGRAM_ID, + PRODUCT_MINT_SEED_PREFIX, PROGRAM_PDA_SEED_PREFIX, +}; use solana_client::rpc_client::RpcClient; use solana_sdk::{ - commitment_config::CommitmentConfig, keccak, pubkey::Pubkey, signature::{Keypair, Signature}, signer::{EncodableKey, Signer}, sysvar::instructions, transaction::Transaction + commitment_config::CommitmentConfig, + keccak, + pubkey::Pubkey, + signature::{Keypair, Signature}, + signer::{EncodableKey, Signer}, + transaction::Transaction, }; #[derive(Debug, Parser)] @@ -192,7 +202,6 @@ fn main() { } } - fn get_client(url: &String) -> RpcClient { let timeout = Duration::from_secs(10); let commitment_config = CommitmentConfig::processed(); @@ -361,7 +370,6 @@ fn dev_activate_device(args: DevActivateDeviceCliArgs) { let client = get_client(&args.common.url); let program_id = args.common.program_id.unwrap_or(PROGRAM_ID); let token_program_id = spl_token_2022::ID; - let instructions_id = instructions::ID; let device = read_key(&args.device_keypair); let user = read_key(&args.user_keypair); @@ -391,13 +399,18 @@ fn dev_activate_device(args: DevActivateDeviceCliArgs) { &token_program_id, ); - let timestamp = SystemTime::now().duration_since(UNIX_EPOCH).ok().unwrap().as_secs(); + let timestamp = SystemTime::now() + .duration_since(UNIX_EPOCH) + .ok() + .unwrap() + .as_secs(); let message = [ DEVICE_MESSAGE_PREFIX, args.product_mint_pubkey.as_ref(), user.pubkey().as_ref(), ×tamp.to_le_bytes(), - ].concat(); + ] + .concat(); let latest_block = client.get_latest_blockhash().unwrap(); let signature = sign(args.signature_type, &device, &message); @@ -405,7 +418,6 @@ fn dev_activate_device(args: DevActivateDeviceCliArgs) { let transaction = Transaction::new_signed_with_payer( &[ActivateDeviceBuilder::new() .token2022_program(token_program_id) - .instructions(instructions_id) .payer(payer.pubkey()) .device(device_pubkey) .vendor(args.vendor_pubkey) @@ -436,7 +448,11 @@ fn dev_activate_device(args: DevActivateDeviceCliArgs) { }; } -fn sign(signature_type: SignatureType, keypair: &Keypair, message: &[u8]) -> DeviceActivationSignature { +fn sign( + signature_type: SignatureType, + keypair: &Keypair, + message: &[u8], +) -> DeviceActivationSignature { match signature_type { SignatureType::Ed25519 => { let signature = keypair.sign_message(message); @@ -459,7 +475,8 @@ fn sign(signature_type: SignatureType, keypair: &Keypair, message: &[u8]) -> Dev EIP191_MESSAGE_PREFIX, message.len().to_string().as_bytes(), message, - ].concat(); + ] + .concat(); let message_hash = keccak::hash(ð_message); let (signature, recovery_id) = libsecp256k1::sign( &libsecp256k1::Message::parse(&message_hash.to_bytes()), @@ -484,13 +501,18 @@ fn generate_message(args: GenerateMessageCliArgs) { &program_id, ); - let timestamp = SystemTime::now().duration_since(UNIX_EPOCH).ok().unwrap().as_secs(); + let timestamp = SystemTime::now() + .duration_since(UNIX_EPOCH) + .ok() + .unwrap() + .as_secs(); let message = [ DEVICE_MESSAGE_PREFIX, did_mint_pubkey.as_ref(), args.user_pubkey.as_ref(), ×tamp.to_le_bytes(), - ].concat(); + ] + .concat(); assert_eq!(message.len(), 96); assert_eq!(array_ref![message, 0, 24], DEVICE_MESSAGE_PREFIX); @@ -527,11 +549,15 @@ fn sign_message(args: SignMessageCliArgs) { DeviceActivationSignature::Ed25519(signature_bytes) => { eprintln!("Pubkey: {}", keypair.pubkey()); println!("Signature: 0x{}", hex::encode(signature_bytes)); - }, - DeviceActivationSignature::Secp256k1(signature_bytes, recovery_id) | - DeviceActivationSignature::EthSecp256k1(signature_bytes, recovery_id) => { - println!("Signature: {}{}", hex::encode(&signature_bytes), hex::encode(&[recovery_id])); - }, + } + DeviceActivationSignature::Secp256k1(signature_bytes, recovery_id) + | DeviceActivationSignature::EthSecp256k1(signature_bytes, recovery_id) => { + println!( + "Signature: {}{}", + hex::encode(&signature_bytes), + hex::encode(&[recovery_id]) + ); + } } } @@ -539,7 +565,6 @@ fn activate_device_offchain(args: ActivateDeviceOffchainCliArgs) { let client = get_client(&args.common.url); let program_id = args.common.program_id.unwrap_or(PROGRAM_ID); let token_program_id = spl_token_2022::ID; - let instructions_id = instructions::ID; let device_pubkey = args.device_pubkey; let user = read_key(&args.user_keypair); @@ -608,7 +633,6 @@ fn activate_device_offchain(args: ActivateDeviceOffchainCliArgs) { let transaction = Transaction::new_signed_with_payer( &[ActivateDeviceBuilder::new() .token2022_program(token_program_id) - .instructions(instructions_id) .payer(payer.pubkey()) .device(device_pubkey) .vendor(args.vendor_pubkey) diff --git a/package.json b/package.json index 9dd791d..637c405 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "programs:clean": "zx ./scripts/program/clean.mjs", "programs:format": "zx ./scripts/program/format.mjs", "programs:lint": "zx ./scripts/program/lint.mjs", - "generate:idls": "zx ./scripts/generate-idls.mjs", - "generate": "pnpm generate:idls && pnpm generate:clients", + "generate:idls": "bun ./scripts/generate-idls.mjs", + "generate": "bun generate:idls && bun generate:clients", "generate:clients": "zx ./scripts/generate-clients.mjs", "validator:start": "zx ./scripts/start-validator.mjs", "validator:restart": "pnpm validator:start --restart", @@ -19,13 +19,12 @@ }, "devDependencies": { "@iarna/toml": "^2.2.5", - "@kinobi-so/nodes-from-anchor": "^0.20.5", - "@kinobi-so/renderers-js": "^0.20.5", - "@kinobi-so/renderers-js-umi": "^0.20.4", - "@kinobi-so/renderers-rust": "^0.20.6", - "@metaplex-foundation/shank-js": "^0.1.7", - "kinobi": "^0.20.3", - "typescript": "^5.4.5", + "@kinobi-so/nodes-from-anchor": "^0.20.6", + "@kinobi-so/renderers-js": "^0.20.9", + "@kinobi-so/renderers-js-umi": "^0.20.6", + "@kinobi-so/renderers-rust": "^0.20.10", + "kinobi": "^0.20.4", + "typescript": "^5.5.2", "zx": "^7.2.3" }, "packageManager": "pnpm@9.1.2" diff --git a/program/idl.json b/program/idl.json index 77643f5..e3afb4f 100644 --- a/program/idl.json +++ b/program/idl.json @@ -224,14 +224,6 @@ "The associated token program" ] }, - { - "name": "instructions", - "isMut": false, - "isSigner": false, - "docs": [ - "The instructions sysvar" - ] - }, { "name": "payer", "isMut": true, diff --git a/program/src/instruction.rs b/program/src/instruction.rs index 87a1db2..5ef4b2b 100644 --- a/program/src/instruction.rs +++ b/program/src/instruction.rs @@ -37,15 +37,14 @@ pub enum Instruction { #[account(0, name="system_program", desc="The system program")] #[account(1, name="token_2022_program", desc="The SPL Token 2022 program")] #[account(2, name="ata_program", desc="The associated token program")] - #[account(3, name="instructions", desc="The instructions sysvar")] - #[account(4, writable, signer, name="payer", desc="The account paying for the storage fees")] - #[account(5, name="vendor", desc="The vendor")] - #[account(6, name="product_mint", desc="The mint account for the product")] - #[account(7, name="product_associated_token", desc="The associated token account for the product")] - #[account(8, name="device", desc="The device")] - #[account(9, writable, name="device_mint", desc="The mint account for the device")] - #[account(10, writable, name="device_associated_token", desc="The associated token account for the device")] - #[account(11, name="owner", desc="The device's owner")] + #[account(3, writable, signer, name="payer", desc="The account paying for the storage fees")] + #[account(4, name="vendor", desc="The vendor")] + #[account(5, name="product_mint", desc="The mint account for the product")] + #[account(6, name="product_associated_token", desc="The associated token account for the product")] + #[account(7, name="device", desc="The device")] + #[account(8, writable, name="device_mint", desc="The mint account for the device")] + #[account(9, writable, name="device_associated_token", desc="The associated token account for the device")] + #[account(10, name="owner", desc="The device's owner")] ActivateDevice(ActivateDeviceArgs), } diff --git a/program/tests/lib.rs b/program/tests/lib.rs index 3b37b58..6e9b088 100644 --- a/program/tests/lib.rs +++ b/program/tests/lib.rs @@ -19,7 +19,7 @@ use solana_sdk::{ keccak, signature::Keypair, signer::Signer, - system_program, sysvar, + system_program, transaction::Transaction, }; use spl_token_2022::{ @@ -364,22 +364,6 @@ async fn test_activate_device( ); DeviceActivationSignature::EthSecp256k1(signature.serialize(), recovery_id.serialize()) }, - // DeviceSigningAlgorithm::Secp256k1 => { - // let device_secp256k1_priv_key = - // libsecp256k1::SecretKey::parse(device.secret().as_bytes()).unwrap(); - // let message = [ - // DEVICE_MESSAGE_PREFIX, - // device_mint_pubkey.as_ref(), - // user.pubkey().as_ref(), - // ×tamp.to_le_bytes(), - // ].concat(); - // let message_hash = keccak::hash(&message); - // let (signature, recovery_id) = libsecp256k1::sign( - // &libsecp256k1::Message::parse(&message_hash.to_bytes()), - // &device_secp256k1_priv_key, - // ); - // DeviceActivationSignature::Secp256k1(signature.serialize(), recovery_id.serialize()) - // } }; let activate_device_ix = SolanaInstruction::new_with_borsh( @@ -395,23 +379,21 @@ async fn test_activate_device( AccountMeta::new(spl_token_2022::id(), false), // #[account(2, name="ata_program", desc="The associated token program")] AccountMeta::new(spl_associated_token_account::id(), false), - // #[account(3, name="instructions", desc="The instructions sys var")] - AccountMeta::new(sysvar::instructions::id(), false), - // #[account(4, writable, signer, name="payer", desc="The account paying for the storage fees")] + // #[account(3, writable, signer, name="payer", desc="The account paying for the storage fees")] AccountMeta::new(ctx.payer.pubkey(), true), - // #[account(5, name="vendor", desc="The vendor")] + // #[account(4, name="vendor", desc="The vendor")] AccountMeta::new(vendor.pubkey(), false), - // #[account(6, name="product_program_data", desc="The PDA for the product to store mint data")] + // #[account(5, name="product_program_data", desc="The PDA for the product to store mint data")] AccountMeta::new(product_mint_pubkey, false), - // #[account(7, name="product_associated_token", desc="The ATA for the product")] + // #[account(6, name="product_associated_token", desc="The ATA for the product")] AccountMeta::new(product_ata_pubkey, false), - // #[account(8, name="device", desc="The device")] + // #[account(7, name="device", desc="The device")] AccountMeta::new(device_pubkey, false), - // #[account(9, writable, name="device_program_data", desc="The PDA for the device to store mint data")] + // #[account(8, writable, name="device_program_data", desc="The PDA for the device to store mint data")] AccountMeta::new(device_mint_pubkey, false), - // #[account(10, writable, name="device_associated_token", desc="The ATA for the device")] + // #[account(9, writable, name="device_associated_token", desc="The ATA for the device")] AccountMeta::new(device_ata_pubkey, false), - // #[account(11, name="owner", desc="The device's owner")] + // #[account(10, name="owner", desc="The device's owner")] AccountMeta::new(user.pubkey(), true), ], ); diff --git a/scripts/generate-idls.mjs b/scripts/generate-idls.mjs index faf2db8..e108ff7 100644 --- a/scripts/generate-idls.mjs +++ b/scripts/generate-idls.mjs @@ -1,22 +1,17 @@ #!/usr/bin/env zx import 'zx/globals'; -import { generateIdl } from '@metaplex-foundation/shank-js'; import { getCargo, getProgramFolders } from './utils.mjs'; +import { $ } from "bun" const binaryInstallDir = path.join(__dirname, '..', '.cargo'); -getProgramFolders().forEach((folder) => { +getProgramFolders().forEach(async (folder) => { const cargo = getCargo(folder); const isShank = Object.keys(cargo.dependencies).includes('shank'); - const programDir = path.join(__dirname, '..', folder); + const programDir = path.join(__dirname, '..', folder) + const programId = cargo.package.metadata.solana['program-id'] - generateIdl({ - generator: isShank ? 'shank' : 'anchor', - programName: cargo.package.name.replace(/-/g, '_'), - programId: cargo.package.metadata.solana['program-id'], - idlDir: programDir, - idlName: 'idl', - programDir, - binaryInstallDir, - }); -}); + if (isShank) { + await $`shank idl -r ${programDir} -o ${programDir} -p ${programId} --out-filename idl.json` + } +}) From 13059c4252c995239901811623dde8c281a2f269 Mon Sep 17 00:00:00 2001 From: Kabie Date: Sun, 23 Jun 2024 21:42:20 +0800 Subject: [PATCH 2/2] update clients --- clients/js/dist/src/index.js | 13 ++- clients/js/dist/src/index.js.map | 2 +- clients/js/dist/src/index.mjs | 13 ++- clients/js/dist/src/index.mjs.map | 2 +- .../accounts/programDataAccount.d.ts | 4 +- .../accounts/programDataAccount.d.ts.map | 2 +- .../instructions/activateDevice.d.ts | 31 +++---- .../instructions/activateDevice.d.ts.map | 2 +- .../generated/instructions/createDevice.d.ts | 4 +- .../instructions/createDevice.d.ts.map | 2 +- .../generated/instructions/createProduct.d.ts | 2 +- .../instructions/createProduct.d.ts.map | 2 +- .../generated/instructions/initialize.d.ts | 2 +- .../instructions/initialize.d.ts.map | 2 +- .../dist/types/generated/pdas/deviceMint.d.ts | 2 +- .../types/generated/pdas/deviceMint.d.ts.map | 2 +- .../types/generated/pdas/productMint.d.ts | 2 +- .../types/generated/pdas/productMint.d.ts.map | 2 +- .../generated/pdas/programDataAccount.d.ts | 2 +- .../pdas/programDataAccount.d.ts.map | 2 +- .../types/generated/programs/dephyId.d.ts | 4 +- .../types/generated/programs/dephyId.d.ts.map | 2 +- .../js/dist/types/generated/shared/index.d.ts | 2 +- .../types/generated/shared/index.d.ts.map | 2 +- .../types/deviceActivationSignature.d.ts | 2 +- .../types/deviceActivationSignature.d.ts.map | 2 +- .../types/deviceSigningAlgorithm.d.ts | 2 +- .../types/deviceSigningAlgorithm.d.ts.map | 2 +- .../js/dist/types/generated/types/key.d.ts | 2 +- .../dist/types/generated/types/key.d.ts.map | 2 +- .../types/generated/types/programData.d.ts | 2 +- .../generated/types/programData.d.ts.map | 2 +- .../generated/accounts/programDataAccount.ts | 24 +++--- .../generated/instructions/activateDevice.ts | 66 ++++++--------- .../generated/instructions/createDevice.ts | 34 ++++---- .../generated/instructions/createProduct.ts | 30 +++---- .../src/generated/instructions/initialize.ts | 30 +++---- clients/js/src/generated/pdas/deviceMint.ts | 4 +- clients/js/src/generated/pdas/productMint.ts | 4 +- .../src/generated/pdas/programDataAccount.ts | 4 +- clients/js/src/generated/programs/dephyId.ts | 10 +-- clients/js/src/generated/shared/index.ts | 10 +-- .../types/deviceActivationSignature.ts | 12 +-- .../generated/types/deviceSigningAlgorithm.ts | 6 +- clients/js/src/generated/types/key.ts | 6 +- clients/js/src/generated/types/programData.ts | 6 +- .../accounts/program_data_account.rs | 25 ++++++ .../generated/instructions/activate_device.rs | 80 +++++-------------- .../types/device_signing_algorithm.rs | 11 ++- clients/rust/src/generated/types/key.rs | 11 ++- 50 files changed, 234 insertions(+), 260 deletions(-) diff --git a/clients/js/dist/src/index.js b/clients/js/dist/src/index.js index b813123..0e4d5ed 100644 --- a/clients/js/dist/src/index.js +++ b/clients/js/dist/src/index.js @@ -119,10 +119,10 @@ function deviceActivationSignature(kind, data) { function isDeviceActivationSignature(kind, value) { return value.__kind === kind; } -var DeviceSigningAlgorithm = /* @__PURE__ */ ((DeviceSigningAlgorithm3) => { - DeviceSigningAlgorithm3[DeviceSigningAlgorithm3["Ed25519"] = 0] = "Ed25519"; - DeviceSigningAlgorithm3[DeviceSigningAlgorithm3["Secp256k1"] = 1] = "Secp256k1"; - return DeviceSigningAlgorithm3; +var DeviceSigningAlgorithm = /* @__PURE__ */ ((DeviceSigningAlgorithm2) => { + DeviceSigningAlgorithm2[DeviceSigningAlgorithm2["Ed25519"] = 0] = "Ed25519"; + DeviceSigningAlgorithm2[DeviceSigningAlgorithm2["Secp256k1"] = 1] = "Secp256k1"; + return DeviceSigningAlgorithm2; })(DeviceSigningAlgorithm || {}); function getDeviceSigningAlgorithmEncoder() { return web3_js.getEnumEncoder(DeviceSigningAlgorithm); @@ -370,7 +370,6 @@ function getActivateDeviceInstruction(input) { isWritable: false }, ataProgram: { value: input.ataProgram ?? null, isWritable: false }, - instructions: { value: input.instructions ?? null, isWritable: false }, payer: { value: input.payer ?? null, isWritable: true }, vendor: { value: input.vendor ?? null, isWritable: false }, productMint: { value: input.productMint ?? null, isWritable: false }, @@ -400,7 +399,6 @@ function getActivateDeviceInstruction(input) { getAccountMeta(accounts.systemProgram), getAccountMeta(accounts.token2022Program), getAccountMeta(accounts.ataProgram), - getAccountMeta(accounts.instructions), getAccountMeta(accounts.payer), getAccountMeta(accounts.vendor), getAccountMeta(accounts.productMint), @@ -418,7 +416,7 @@ function getActivateDeviceInstruction(input) { return instruction; } function parseActivateDeviceInstruction(instruction) { - if (instruction.accounts.length < 12) { + if (instruction.accounts.length < 11) { throw new Error("Not enough accounts"); } let accountIndex = 0; @@ -433,7 +431,6 @@ function parseActivateDeviceInstruction(instruction) { systemProgram: getNextAccount(), token2022Program: getNextAccount(), ataProgram: getNextAccount(), - instructions: getNextAccount(), payer: getNextAccount(), vendor: getNextAccount(), productMint: getNextAccount(), diff --git a/clients/js/dist/src/index.js.map b/clients/js/dist/src/index.js.map index b671932..21f7c6a 100644 --- a/clients/js/dist/src/index.js.map +++ b/clients/js/dist/src/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../env-shim.ts","../../src/generated/accounts/programDataAccount.ts","../../src/generated/pdas/deviceMint.ts","../../src/generated/pdas/productMint.ts","../../src/generated/pdas/programDataAccount.ts","../../src/generated/types/deviceActivationSignature.ts","../../src/generated/types/deviceSigningAlgorithm.ts","../../src/generated/types/key.ts","../../src/generated/types/programData.ts","../../src/generated/errors/dephyId.ts","../../src/generated/instructions/activateDevice.ts","../../src/generated/programs/dephyId.ts","../../src/generated/shared/index.ts","../../src/generated/instructions/createDevice.ts","../../src/generated/instructions/createProduct.ts","../../src/generated/instructions/initialize.ts"],"names":["combineCodec","getAddressEncoder","getStructDecoder","getStructEncoder","getProgramDerivedAddress","getUtf8Encoder","DeviceSigningAlgorithm","getEnumDecoder","getEnumEncoder","Key","getU8Decoder","getU8Encoder","transformEncoder","DephyIdAccount","DephyIdInstruction","getTupleDecoder","getTupleEncoder","addDecoderSizePrefix","addEncoderSizePrefix","getArrayDecoder","getArrayEncoder","getU32Decoder","getU32Encoder","getUtf8Decoder"],"mappings":";AACO,IAAM,UAA2B,uBACrC,QAAgB,KAAU,EAAE,aAAa,eAAe;;;ACM3D;AAAA,EAWE;AAAA,EACA;AAAA,EACA,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA;AAAA,OACK;;;ACtBP;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,eAAsB,kBACpB,OACA,SAAmD,CAAC,GACpB;AAChC,QAAM;AAAA,IACJ,iBAAiB;AAAA,EACnB,IAAI;AACJ,SAAO,MAAM,yBAAyB;AAAA,IACpC;AAAA,IACA,OAAO;AAAA,MACL,eAAe,EAAE,OAAO,iBAAiB;AAAA,MACzC,kBAAkB,EAAE,OAAO,MAAM,iBAAiB;AAAA,MAClD,kBAAkB,EAAE,OAAO,MAAM,YAAY;AAAA,IAC/C;AAAA,EACF,CAAC;AACH;;;AC7BA;AAAA,EAGE,qBAAAF;AAAA,EACA,4BAAAG;AAAA,EACA,kBAAAC;AAAA,OACK;AAQP,eAAsB,mBACpB,OACA,SAAmD,CAAC,GACpB;AAChC,QAAM;AAAA,IACJ,iBAAiB;AAAA,EACnB,IAAI;AACJ,SAAO,MAAMD,0BAAyB;AAAA,IACpC;AAAA,IACA,OAAO;AAAA,MACLC,gBAAe,EAAE,OAAO,kBAAkB;AAAA,MAC1CJ,mBAAkB,EAAE,OAAO,MAAM,YAAY;AAAA,MAC7CI,gBAAe,EAAE,OAAO,MAAM,WAAW;AAAA,IAC3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`\nexport const __DEV__ = /* @__PURE__ */ (() =>\n (process as any)['en' + 'v'].NODE_ENV === 'development')();\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Account,\n Address,\n Codec,\n Decoder,\n EncodedAccount,\n Encoder,\n FetchAccountConfig,\n FetchAccountsConfig,\n MaybeAccount,\n MaybeEncodedAccount,\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { findProgramDataAccountPda } from '../pdas';\nimport {\n Key,\n ProgramData,\n ProgramDataArgs,\n getKeyDecoder,\n getKeyEncoder,\n getProgramDataDecoder,\n getProgramDataEncoder,\n} from '../types';\n\nexport type ProgramDataAccount = {\n key: Key;\n authority: Address;\n data: ProgramData;\n};\n\nexport type ProgramDataAccountArgs = {\n authority: Address;\n data: ProgramDataArgs;\n};\n\nexport function getProgramDataAccountEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['key', getKeyEncoder()],\n ['authority', getAddressEncoder()],\n ['data', getProgramDataEncoder()],\n ]),\n (value) => ({ ...value, key: Key.ProgramDataAccount })\n );\n}\n\nexport function getProgramDataAccountDecoder(): Decoder {\n return getStructDecoder([\n ['key', getKeyDecoder()],\n ['authority', getAddressDecoder()],\n ['data', getProgramDataDecoder()],\n ]);\n}\n\nexport function getProgramDataAccountCodec(): Codec<\n ProgramDataAccountArgs,\n ProgramDataAccount\n> {\n return combineCodec(\n getProgramDataAccountEncoder(),\n getProgramDataAccountDecoder()\n );\n}\n\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount\n): Account;\nexport function decodeProgramDataAccount(\n encodedAccount: MaybeEncodedAccount\n): MaybeAccount;\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount | MaybeEncodedAccount\n):\n | Account\n | MaybeAccount {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount,\n getProgramDataAccountDecoder()\n );\n}\n\nexport async function fetchProgramDataAccount(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccount(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccount<\n TAddress extends string = string,\n>(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeProgramDataAccount(maybeAccount);\n}\n\nexport async function fetchAllProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchAllMaybeProgramDataAccount(\n rpc,\n addresses,\n config\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) =>\n decodeProgramDataAccount(maybeAccount)\n );\n}\n\nexport function getProgramDataAccountSize(): number {\n return 34;\n}\n\nexport async function fetchProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccountFromSeeds(rpc, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findProgramDataAccountPda({ programAddress });\n return await fetchMaybeProgramDataAccount(rpc, address, fetchConfig);\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n ProgramDerivedAddress,\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n} from '@solana/web3.js';\n\nexport type DeviceMintSeeds = {\n productMintPubkey: Address;\n\n devicePubkey: Address;\n};\n\nexport async function findDeviceMintPda(\n seeds: DeviceMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-DEVICE'),\n getAddressEncoder().encode(seeds.productMintPubkey),\n getAddressEncoder().encode(seeds.devicePubkey),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n ProgramDerivedAddress,\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n} from '@solana/web3.js';\n\nexport type ProductMintSeeds = {\n vendorPubkey: Address;\n\n productName: string;\n};\n\nexport async function findProductMintPda(\n seeds: ProductMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-PRODUCT'),\n getAddressEncoder().encode(seeds.vendorPubkey),\n getUtf8Encoder().encode(seeds.productName),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n ProgramDerivedAddress,\n getProgramDerivedAddress,\n getUtf8Encoder,\n} from '@solana/web3.js';\n\nexport async function findProgramDataAccountPda(\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('DePHY_ID')],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n GetDiscriminatedUnionVariant,\n GetDiscriminatedUnionVariantContent,\n ReadonlyUint8Array,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getDiscriminatedUnionDecoder,\n getDiscriminatedUnionEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU8Decoder,\n getU8Encoder,\n} from '@solana/web3.js';\n\nexport type DeviceActivationSignature =\n | { __kind: 'Ed25519'; fields: readonly [ReadonlyUint8Array] }\n | { __kind: 'Secp256k1'; fields: readonly [ReadonlyUint8Array, number] }\n | { __kind: 'EthSecp256k1'; fields: readonly [ReadonlyUint8Array, number] };\n\nexport type DeviceActivationSignatureArgs = DeviceActivationSignature;\n\nexport function getDeviceActivationSignatureEncoder(): Encoder {\n return getDiscriminatedUnionEncoder([\n [\n 'Ed25519',\n getStructEncoder([\n ['fields', getTupleEncoder([fixEncoderSize(getBytesEncoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureDecoder(): Decoder {\n return getDiscriminatedUnionDecoder([\n [\n 'Ed25519',\n getStructDecoder([\n ['fields', getTupleDecoder([fixDecoderSize(getBytesDecoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureCodec(): Codec<\n DeviceActivationSignatureArgs,\n DeviceActivationSignature\n> {\n return combineCodec(\n getDeviceActivationSignatureEncoder(),\n getDeviceActivationSignatureDecoder()\n );\n}\n\n// Data Enum Helpers.\nexport function deviceActivationSignature(\n kind: 'Ed25519',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n>;\nexport function deviceActivationSignature(\n kind: 'Secp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n>;\nexport function deviceActivationSignature(\n kind: 'EthSecp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n>;\nexport function deviceActivationSignature<\n K extends DeviceActivationSignatureArgs['__kind'],\n Data,\n>(kind: K, data?: Data) {\n return Array.isArray(data)\n ? { __kind: kind, fields: data }\n : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isDeviceActivationSignature<\n K extends DeviceActivationSignature['__kind'],\n>(\n kind: K,\n value: DeviceActivationSignature\n): value is DeviceActivationSignature & { __kind: K } {\n return value.__kind === kind;\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n} from '@solana/web3.js';\n\nexport enum DeviceSigningAlgorithm {\n Ed25519,\n Secp256k1,\n}\n\nexport type DeviceSigningAlgorithmArgs = DeviceSigningAlgorithm;\n\nexport function getDeviceSigningAlgorithmEncoder(): Encoder {\n return getEnumEncoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmDecoder(): Decoder {\n return getEnumDecoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmCodec(): Codec<\n DeviceSigningAlgorithmArgs,\n DeviceSigningAlgorithm\n> {\n return combineCodec(\n getDeviceSigningAlgorithmEncoder(),\n getDeviceSigningAlgorithmDecoder()\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n} from '@solana/web3.js';\n\nexport enum Key {\n Uninitialized,\n ProgramDataAccount,\n}\n\nexport type KeyArgs = Key;\n\nexport function getKeyEncoder(): Encoder {\n return getEnumEncoder(Key);\n}\n\nexport function getKeyDecoder(): Decoder {\n return getEnumDecoder(Key);\n}\n\nexport function getKeyCodec(): Codec {\n return combineCodec(getKeyEncoder(), getKeyDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n} from '@solana/web3.js';\n\nexport type ProgramData = { bump: number };\n\nexport type ProgramDataArgs = ProgramData;\n\nexport function getProgramDataEncoder(): Encoder {\n return getStructEncoder([['bump', getU8Encoder()]]);\n}\n\nexport function getProgramDataDecoder(): Decoder {\n return getStructDecoder([['bump', getU8Decoder()]]);\n}\n\nexport function getProgramDataCodec(): Codec {\n return combineCodec(getProgramDataEncoder(), getProgramDataDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\n/** DeserializationError: Error deserializing an account */\nexport const DEPHY_ID_ERROR__DESERIALIZATION_ERROR = 0x0; // 0\n/** SerializationError: Error serializing an account */\nexport const DEPHY_ID_ERROR__SERIALIZATION_ERROR = 0x1; // 1\n/** InvalidProgramOwner: Invalid program owner. This likely mean the provided account does not exist */\nexport const DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER = 0x2; // 2\n/** InvalidPda: Invalid PDA derivation */\nexport const DEPHY_ID_ERROR__INVALID_PDA = 0x3; // 3\n/** ExpectedEmptyAccount: Expected empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT = 0x4; // 4\n/** ExpectedNonEmptyAccount: Expected non empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT = 0x5; // 5\n/** ExpectedSignerAccount: Expected signer account */\nexport const DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT = 0x6; // 6\n/** ExpectedWritableAccount: Expected writable account */\nexport const DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT = 0x7; // 7\n/** AccountMismatch: Account mismatch */\nexport const DEPHY_ID_ERROR__ACCOUNT_MISMATCH = 0x8; // 8\n/** InvalidAccountKey: Invalid account key */\nexport const DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY = 0x9; // 9\n/** NumericalOverflow: Numerical overflow */\nexport const DEPHY_ID_ERROR__NUMERICAL_OVERFLOW = 0xa; // 10\n/** MissingInstruction: Missing instruction */\nexport const DEPHY_ID_ERROR__MISSING_INSTRUCTION = 0xb; // 11\n/** SignatureMismatch: Signature mismatch */\nexport const DEPHY_ID_ERROR__SIGNATURE_MISMATCH = 0xc; // 12\n\nexport type DephyIdError =\n | typeof DEPHY_ID_ERROR__ACCOUNT_MISMATCH\n | typeof DEPHY_ID_ERROR__DESERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT\n | typeof DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY\n | typeof DEPHY_ID_ERROR__INVALID_PDA\n | typeof DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER\n | typeof DEPHY_ID_ERROR__MISSING_INSTRUCTION\n | typeof DEPHY_ID_ERROR__NUMERICAL_OVERFLOW\n | typeof DEPHY_ID_ERROR__SERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__SIGNATURE_MISMATCH;\n\nlet dephyIdErrorMessages: Record | undefined;\nif (__DEV__) {\n dephyIdErrorMessages = {\n [DEPHY_ID_ERROR__ACCOUNT_MISMATCH]: `Account mismatch`,\n [DEPHY_ID_ERROR__DESERIALIZATION_ERROR]: `Error deserializing an account`,\n [DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT]: `Expected empty account`,\n [DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT]: `Expected non empty account`,\n [DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT]: `Expected signer account`,\n [DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT]: `Expected writable account`,\n [DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY]: `Invalid account key`,\n [DEPHY_ID_ERROR__INVALID_PDA]: `Invalid PDA derivation`,\n [DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER]: `Invalid program owner. This likely mean the provided account does not exist`,\n [DEPHY_ID_ERROR__MISSING_INSTRUCTION]: `Missing instruction`,\n [DEPHY_ID_ERROR__NUMERICAL_OVERFLOW]: `Numerical overflow`,\n [DEPHY_ID_ERROR__SERIALIZATION_ERROR]: `Error serializing an account`,\n [DEPHY_ID_ERROR__SIGNATURE_MISMATCH]: `Signature mismatch`,\n };\n}\n\nexport function getDephyIdErrorMessage(code: DephyIdError): string {\n if (__DEV__) {\n return (dephyIdErrorMessages as Record)[code];\n }\n\n return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.';\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\nimport {\n DeviceActivationSignature,\n DeviceActivationSignatureArgs,\n getDeviceActivationSignatureDecoder,\n getDeviceActivationSignatureEncoder,\n} from '../types';\n\nexport type ActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends string | IAccountMeta = string,\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountInstructions extends string | IAccountMeta = string,\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TAccountDeviceAssociatedToken extends string | IAccountMeta = string,\n TAccountOwner extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountInstructions extends string\n ? ReadonlyAccount\n : TAccountInstructions,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlyAccount\n : TAccountVendor,\n TAccountProductMint extends string\n ? ReadonlyAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? ReadonlyAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n TAccountDeviceAssociatedToken extends string\n ? WritableAccount\n : TAccountDeviceAssociatedToken,\n TAccountOwner extends string\n ? ReadonlyAccount\n : TAccountOwner,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ActivateDeviceInstructionData = {\n discriminator: number;\n signature: DeviceActivationSignature;\n timestamp: bigint;\n};\n\nexport type ActivateDeviceInstructionDataArgs = {\n signature: DeviceActivationSignatureArgs;\n timestamp: number | bigint;\n};\n\nexport function getActivateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['signature', getDeviceActivationSignatureEncoder()],\n ['timestamp', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 3 })\n );\n}\n\nexport function getActivateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['signature', getDeviceActivationSignatureDecoder()],\n ['timestamp', getU64Decoder()],\n ]);\n}\n\nexport function getActivateDeviceInstructionDataCodec(): Codec<\n ActivateDeviceInstructionDataArgs,\n ActivateDeviceInstructionData\n> {\n return combineCodec(\n getActivateDeviceInstructionDataEncoder(),\n getActivateDeviceInstructionDataDecoder()\n );\n}\n\nexport type ActivateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountInstructions extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n TAccountDeviceAssociatedToken extends string = string,\n TAccountOwner extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The instructions sysvar */\n instructions: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: Address;\n /** The mint account for the product */\n productMint: Address;\n /** The associated token account for the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account for the device */\n deviceMint: Address;\n /** The associated token account for the device */\n deviceAssociatedToken: Address;\n /** The device's owner */\n owner: Address;\n signature: ActivateDeviceInstructionDataArgs['signature'];\n timestamp: ActivateDeviceInstructionDataArgs['timestamp'];\n};\n\nexport function getActivateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountInstructions extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n TAccountDeviceAssociatedToken extends string,\n TAccountOwner extends string,\n>(\n input: ActivateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountInstructions,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >\n): ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountInstructions,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n instructions: { value: input.instructions ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: false },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: false,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n deviceAssociatedToken: {\n value: input.deviceAssociatedToken ?? null,\n isWritable: true,\n },\n owner: { value: input.owner ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.instructions),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n getAccountMeta(accounts.deviceAssociatedToken),\n getAccountMeta(accounts.owner),\n ],\n programAddress,\n data: getActivateDeviceInstructionDataEncoder().encode(\n args as ActivateDeviceInstructionDataArgs\n ),\n } as ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountInstructions,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >;\n\n return instruction;\n}\n\nexport type ParsedActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The instructions sysvar */\n instructions: TAccountMetas[3];\n /** The account paying for the storage fees */\n payer: TAccountMetas[4];\n /** The vendor */\n vendor: TAccountMetas[5];\n /** The mint account for the product */\n productMint: TAccountMetas[6];\n /** The associated token account for the product */\n productAssociatedToken: TAccountMetas[7];\n /** The device */\n device: TAccountMetas[8];\n /** The mint account for the device */\n deviceMint: TAccountMetas[9];\n /** The associated token account for the device */\n deviceAssociatedToken: TAccountMetas[10];\n /** The device's owner */\n owner: TAccountMetas[11];\n };\n data: ActivateDeviceInstructionData;\n};\n\nexport function parseActivateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedActivateDeviceInstruction {\n if (instruction.accounts.length < 12) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n instructions: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n deviceAssociatedToken: getNextAccount(),\n owner: getNextAccount(),\n },\n data: getActivateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport { Address, containsBytes, getU8Encoder } from '@solana/web3.js';\nimport {\n ParsedActivateDeviceInstruction,\n ParsedCreateDeviceInstruction,\n ParsedCreateProductInstruction,\n ParsedInitializeInstruction,\n} from '../instructions';\nimport { Key, getKeyEncoder } from '../types';\n\nexport const DEPHY_ID_PROGRAM_ADDRESS =\n 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>;\n\nexport enum DephyIdAccount {\n ProgramDataAccount,\n}\n\nexport function identifyDephyIdAccount(\n account: { data: Uint8Array } | Uint8Array\n): DephyIdAccount {\n const data = account instanceof Uint8Array ? account : account.data;\n if (containsBytes(data, getKeyEncoder().encode(Key.ProgramDataAccount), 0)) {\n return DephyIdAccount.ProgramDataAccount;\n }\n throw new Error(\n 'The provided account could not be identified as a dephyId account.'\n );\n}\n\nexport enum DephyIdInstruction {\n Initialize,\n CreateProduct,\n CreateDevice,\n ActivateDevice,\n}\n\nexport function identifyDephyIdInstruction(\n instruction: { data: Uint8Array } | Uint8Array\n): DephyIdInstruction {\n const data =\n instruction instanceof Uint8Array ? instruction : instruction.data;\n if (containsBytes(data, getU8Encoder().encode(0), 0)) {\n return DephyIdInstruction.Initialize;\n }\n if (containsBytes(data, getU8Encoder().encode(1), 0)) {\n return DephyIdInstruction.CreateProduct;\n }\n if (containsBytes(data, getU8Encoder().encode(2), 0)) {\n return DephyIdInstruction.CreateDevice;\n }\n if (containsBytes(data, getU8Encoder().encode(3), 0)) {\n return DephyIdInstruction.ActivateDevice;\n }\n throw new Error(\n 'The provided instruction could not be identified as a dephyId instruction.'\n );\n}\n\nexport type ParsedDephyIdInstruction<\n TProgram extends string = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1',\n> =\n | ({\n instructionType: DephyIdInstruction.Initialize;\n } & ParsedInitializeInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateProduct;\n } & ParsedCreateProductInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateDevice;\n } & ParsedCreateDeviceInstruction)\n | ({\n instructionType: DephyIdInstruction.ActivateDevice;\n } & ParsedActivateDeviceInstruction);\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n AccountRole,\n Address,\n IAccountMeta,\n IAccountSignerMeta,\n ProgramDerivedAddress,\n TransactionSigner,\n isProgramDerivedAddress,\n isTransactionSigner as web3JsIsTransactionSigner,\n upgradeRoleToSigner,\n} from '@solana/web3.js';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome(value: T | null | undefined): T {\n if (value == null) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): Address {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0];\n }\n return value as Address;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): ProgramDerivedAddress {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): TransactionSigner {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null =\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null,\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(\n programAddress: Address,\n optionalAccountStrategy: 'omitted' | 'programId'\n) {\n return (\n account: ResolvedAccount\n ): IAccountMeta | IAccountSignerMeta | undefined => {\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n return Object.freeze({\n address: programAddress,\n role: AccountRole.READONLY,\n });\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n return Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n };\n}\n\nexport function isTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n): value is TransactionSigner {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n web3JsIsTransactionSigner(value)\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n ReadonlySignerAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\nimport {\n DeviceSigningAlgorithm,\n DeviceSigningAlgorithmArgs,\n getDeviceSigningAlgorithmDecoder,\n getDeviceSigningAlgorithmEncoder,\n} from '../types';\n\nexport type CreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? WritableAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateDeviceInstructionData = {\n discriminator: number;\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithm;\n};\n\nexport type CreateDeviceInstructionDataArgs = {\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithmArgs;\n};\n\nexport function getCreateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmEncoder()],\n ]),\n (value) => ({ ...value, discriminator: 2 })\n );\n}\n\nexport function getCreateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmDecoder()],\n ]);\n}\n\nexport function getCreateDeviceInstructionDataCodec(): Codec<\n CreateDeviceInstructionDataArgs,\n CreateDeviceInstructionData\n> {\n return combineCodec(\n getCreateDeviceInstructionDataEncoder(),\n getCreateDeviceInstructionDataDecoder()\n );\n}\n\nexport type CreateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n /** The associated token account of the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account of the device */\n deviceMint: Address;\n name: CreateDeviceInstructionDataArgs['name'];\n uri: CreateDeviceInstructionDataArgs['uri'];\n additionalMetadata: CreateDeviceInstructionDataArgs['additionalMetadata'];\n signingAlg: CreateDeviceInstructionDataArgs['signingAlg'];\n};\n\nexport function getCreateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n>(\n input: CreateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >\n): CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: true,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n ],\n programAddress,\n data: getCreateDeviceInstructionDataEncoder().encode(\n args as CreateDeviceInstructionDataArgs\n ),\n } as CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The account paying for the storage fees */\n payer: TAccountMetas[3];\n /** The vendor */\n vendor: TAccountMetas[4];\n /** The mint account of the product */\n productMint: TAccountMetas[5];\n /** The associated token account of the product */\n productAssociatedToken: TAccountMetas[6];\n /** The device */\n device: TAccountMetas[7];\n /** The mint account of the device */\n deviceMint: TAccountMetas[8];\n };\n data: CreateDeviceInstructionData;\n};\n\nexport function parseCreateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateDeviceInstruction {\n if (instruction.accounts.length < 9) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n },\n data: getCreateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n ReadonlySignerAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\n\nexport type CreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateProductInstructionData = {\n discriminator: number;\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport type CreateProductInstructionDataArgs = {\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport function getCreateProductInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ]),\n (value) => ({ ...value, discriminator: 1 })\n );\n}\n\nexport function getCreateProductInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ]);\n}\n\nexport function getCreateProductInstructionDataCodec(): Codec<\n CreateProductInstructionDataArgs,\n CreateProductInstructionData\n> {\n return combineCodec(\n getCreateProductInstructionDataEncoder(),\n getCreateProductInstructionDataDecoder()\n );\n}\n\nexport type CreateProductInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n name: CreateProductInstructionDataArgs['name'];\n symbol: CreateProductInstructionDataArgs['symbol'];\n uri: CreateProductInstructionDataArgs['uri'];\n additionalMetadata: CreateProductInstructionDataArgs['additionalMetadata'];\n};\n\nexport function getCreateProductInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n>(\n input: CreateProductInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >\n): CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n ],\n programAddress,\n data: getCreateProductInstructionDataEncoder().encode(\n args as CreateProductInstructionDataArgs\n ),\n } as CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The account paying for the storage fees */\n payer: TAccountMetas[2];\n /** The vendor */\n vendor: TAccountMetas[3];\n /** The mint account of the product */\n productMint: TAccountMetas[4];\n };\n data: CreateProductInstructionData;\n};\n\nexport function parseCreateProductInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateProductInstruction {\n if (instruction.accounts.length < 5) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n },\n data: getCreateProductInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n ReadonlySignerAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\n\nexport type InitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountProgramData extends string | IAccountMeta = string,\n TAccountAuthority extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountProgramData extends string\n ? WritableAccount\n : TAccountProgramData,\n TAccountAuthority extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountAuthority,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeInstructionData = { discriminator: number; bump: number };\n\nexport type InitializeInstructionDataArgs = { bump: number };\n\nexport function getInitializeInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['bump', getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 0 })\n );\n}\n\nexport function getInitializeInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['bump', getU8Decoder()],\n ]);\n}\n\nexport function getInitializeInstructionDataCodec(): Codec<\n InitializeInstructionDataArgs,\n InitializeInstructionData\n> {\n return combineCodec(\n getInitializeInstructionDataEncoder(),\n getInitializeInstructionDataDecoder()\n );\n}\n\nexport type InitializeInput<\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountProgramData extends string = string,\n TAccountAuthority extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The program data account for the program */\n programData: Address;\n /** The authority account of the program */\n authority: TransactionSigner;\n bump: InitializeInstructionDataArgs['bump'];\n};\n\nexport function getInitializeInstruction<\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TAccountProgramData extends string,\n TAccountAuthority extends string,\n>(\n input: InitializeInput<\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >\n): InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.programData),\n getAccountMeta(accounts.authority),\n ],\n programAddress,\n data: getInitializeInstructionDataEncoder().encode(\n args as InitializeInstructionDataArgs\n ),\n } as InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The account paying for the storage fees */\n payer: TAccountMetas[1];\n /** The program data account for the program */\n programData: TAccountMetas[2];\n /** The authority account of the program */\n authority: TAccountMetas[3];\n };\n data: InitializeInstructionData;\n};\n\nexport function parseInitializeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedInitializeInstruction {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n payer: getNextAccount(),\n programData: getNextAccount(),\n authority: getNextAccount(),\n },\n data: getInitializeInstructionDataDecoder().decode(instruction.data),\n };\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../env-shim.ts","../../src/generated/accounts/programDataAccount.ts","../../src/generated/pdas/deviceMint.ts","../../src/generated/pdas/productMint.ts","../../src/generated/pdas/programDataAccount.ts","../../src/generated/types/deviceActivationSignature.ts","../../src/generated/types/deviceSigningAlgorithm.ts","../../src/generated/types/key.ts","../../src/generated/types/programData.ts","../../src/generated/errors/dephyId.ts","../../src/generated/instructions/activateDevice.ts","../../src/generated/programs/dephyId.ts","../../src/generated/shared/index.ts","../../src/generated/instructions/createDevice.ts","../../src/generated/instructions/createProduct.ts","../../src/generated/instructions/initialize.ts"],"names":["combineCodec","getAddressEncoder","getStructDecoder","getStructEncoder","getProgramDerivedAddress","getUtf8Encoder","DeviceSigningAlgorithm","getEnumDecoder","getEnumEncoder","Key","getU8Decoder","getU8Encoder","transformEncoder","DephyIdAccount","DephyIdInstruction","getTupleDecoder","getTupleEncoder","addDecoderSizePrefix","addEncoderSizePrefix","getArrayDecoder","getArrayEncoder","getU32Decoder","getU32Encoder","getUtf8Decoder"],"mappings":";AACO,IAAM,UAA2B,uBACrC,QAAgB,KAAU,EAAE,aAAa,eAAe;;;ACM3D;AAAA,EACE;AAAA,EACA;AAAA,EACA,gBAAAA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A,IAClB,UAAU;AAAA,MACR,eAAe,SAAS,aAAa;AAAA,MACrC,eAAe,SAAS,KAAK;AAAA,MAC7B,eAAe,SAAS,WAAW;AAAA,MACnC,eAAe,SAAS,SAAS;AAAA,IACnC;AAAA,IACA;AAAA,IACA,MAAM,oCAAoC,EAAE;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AAQA,SAAO;AACT;AAoBO,SAAS,2BAId,aAGsD;AACtD,MAAI,YAAY,SAAS,SAAS,GAAG;AAEnC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AACA,MAAI,eAAe;AACnB,QAAM,iBAAiB,MAAM;AAC3B,UAAM,cAAc,YAAY,SAAU,YAAY;AACtD,oBAAgB;AAChB,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,gBAAgB,YAAY;AAAA,IAC5B,UAAU;AAAA,MACR,eAAe,eAAe;AAAA,MAC9B,OAAO,eAAe;AAAA,MACtB,aAAa,eAAe;AAAA,MAC5B,WAAW,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,oCAAoC,EAAE,OAAO,YAAY,IAAI;AAAA,EACrE;AACF","sourcesContent":["// Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV`\nexport const __DEV__ = /* @__PURE__ */ (() =>\n (process as any)['en' + 'v'].NODE_ENV === 'development')();\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/web3.js';\nimport { findProgramDataAccountPda } from '../pdas';\nimport {\n Key,\n getKeyDecoder,\n getKeyEncoder,\n getProgramDataDecoder,\n getProgramDataEncoder,\n type ProgramData,\n type ProgramDataArgs,\n} from '../types';\n\nexport type ProgramDataAccount = {\n key: Key;\n authority: Address;\n data: ProgramData;\n};\n\nexport type ProgramDataAccountArgs = {\n authority: Address;\n data: ProgramDataArgs;\n};\n\nexport function getProgramDataAccountEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['key', getKeyEncoder()],\n ['authority', getAddressEncoder()],\n ['data', getProgramDataEncoder()],\n ]),\n (value) => ({ ...value, key: Key.ProgramDataAccount })\n );\n}\n\nexport function getProgramDataAccountDecoder(): Decoder {\n return getStructDecoder([\n ['key', getKeyDecoder()],\n ['authority', getAddressDecoder()],\n ['data', getProgramDataDecoder()],\n ]);\n}\n\nexport function getProgramDataAccountCodec(): Codec<\n ProgramDataAccountArgs,\n ProgramDataAccount\n> {\n return combineCodec(\n getProgramDataAccountEncoder(),\n getProgramDataAccountDecoder()\n );\n}\n\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount\n): Account;\nexport function decodeProgramDataAccount(\n encodedAccount: MaybeEncodedAccount\n): MaybeAccount;\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount | MaybeEncodedAccount\n):\n | Account\n | MaybeAccount {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount,\n getProgramDataAccountDecoder()\n );\n}\n\nexport async function fetchProgramDataAccount(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccount(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccount<\n TAddress extends string = string,\n>(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeProgramDataAccount(maybeAccount);\n}\n\nexport async function fetchAllProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchAllMaybeProgramDataAccount(\n rpc,\n addresses,\n config\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) =>\n decodeProgramDataAccount(maybeAccount)\n );\n}\n\nexport function getProgramDataAccountSize(): number {\n return 34;\n}\n\nexport async function fetchProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccountFromSeeds(rpc, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findProgramDataAccountPda({ programAddress });\n return await fetchMaybeProgramDataAccount(rpc, address, fetchConfig);\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/web3.js';\n\nexport type DeviceMintSeeds = {\n productMintPubkey: Address;\n\n devicePubkey: Address;\n};\n\nexport async function findDeviceMintPda(\n seeds: DeviceMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-DEVICE'),\n getAddressEncoder().encode(seeds.productMintPubkey),\n getAddressEncoder().encode(seeds.devicePubkey),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/web3.js';\n\nexport type ProductMintSeeds = {\n vendorPubkey: Address;\n\n productName: string;\n};\n\nexport async function findProductMintPda(\n seeds: ProductMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-PRODUCT'),\n getAddressEncoder().encode(seeds.vendorPubkey),\n getUtf8Encoder().encode(seeds.productName),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/web3.js';\n\nexport async function findProgramDataAccountPda(\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('DePHY_ID')],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getDiscriminatedUnionDecoder,\n getDiscriminatedUnionEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU8Decoder,\n getU8Encoder,\n type Codec,\n type Decoder,\n type Encoder,\n type GetDiscriminatedUnionVariant,\n type GetDiscriminatedUnionVariantContent,\n type ReadonlyUint8Array,\n} from '@solana/web3.js';\n\nexport type DeviceActivationSignature =\n | { __kind: 'Ed25519'; fields: readonly [ReadonlyUint8Array] }\n | { __kind: 'Secp256k1'; fields: readonly [ReadonlyUint8Array, number] }\n | { __kind: 'EthSecp256k1'; fields: readonly [ReadonlyUint8Array, number] };\n\nexport type DeviceActivationSignatureArgs = DeviceActivationSignature;\n\nexport function getDeviceActivationSignatureEncoder(): Encoder {\n return getDiscriminatedUnionEncoder([\n [\n 'Ed25519',\n getStructEncoder([\n ['fields', getTupleEncoder([fixEncoderSize(getBytesEncoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureDecoder(): Decoder {\n return getDiscriminatedUnionDecoder([\n [\n 'Ed25519',\n getStructDecoder([\n ['fields', getTupleDecoder([fixDecoderSize(getBytesDecoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureCodec(): Codec<\n DeviceActivationSignatureArgs,\n DeviceActivationSignature\n> {\n return combineCodec(\n getDeviceActivationSignatureEncoder(),\n getDeviceActivationSignatureDecoder()\n );\n}\n\n// Data Enum Helpers.\nexport function deviceActivationSignature(\n kind: 'Ed25519',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n>;\nexport function deviceActivationSignature(\n kind: 'Secp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n>;\nexport function deviceActivationSignature(\n kind: 'EthSecp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n>;\nexport function deviceActivationSignature<\n K extends DeviceActivationSignatureArgs['__kind'],\n Data,\n>(kind: K, data?: Data) {\n return Array.isArray(data)\n ? { __kind: kind, fields: data }\n : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isDeviceActivationSignature<\n K extends DeviceActivationSignature['__kind'],\n>(\n kind: K,\n value: DeviceActivationSignature\n): value is DeviceActivationSignature & { __kind: K } {\n return value.__kind === kind;\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/web3.js';\n\nexport enum DeviceSigningAlgorithm {\n Ed25519,\n Secp256k1,\n}\n\nexport type DeviceSigningAlgorithmArgs = DeviceSigningAlgorithm;\n\nexport function getDeviceSigningAlgorithmEncoder(): Encoder {\n return getEnumEncoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmDecoder(): Decoder {\n return getEnumDecoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmCodec(): Codec<\n DeviceSigningAlgorithmArgs,\n DeviceSigningAlgorithm\n> {\n return combineCodec(\n getDeviceSigningAlgorithmEncoder(),\n getDeviceSigningAlgorithmDecoder()\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/web3.js';\n\nexport enum Key {\n Uninitialized,\n ProgramDataAccount,\n}\n\nexport type KeyArgs = Key;\n\nexport function getKeyEncoder(): Encoder {\n return getEnumEncoder(Key);\n}\n\nexport function getKeyDecoder(): Decoder {\n return getEnumDecoder(Key);\n}\n\nexport function getKeyCodec(): Codec {\n return combineCodec(getKeyEncoder(), getKeyDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/web3.js';\n\nexport type ProgramData = { bump: number };\n\nexport type ProgramDataArgs = ProgramData;\n\nexport function getProgramDataEncoder(): Encoder {\n return getStructEncoder([['bump', getU8Encoder()]]);\n}\n\nexport function getProgramDataDecoder(): Decoder {\n return getStructDecoder([['bump', getU8Decoder()]]);\n}\n\nexport function getProgramDataCodec(): Codec {\n return combineCodec(getProgramDataEncoder(), getProgramDataDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\n/** DeserializationError: Error deserializing an account */\nexport const DEPHY_ID_ERROR__DESERIALIZATION_ERROR = 0x0; // 0\n/** SerializationError: Error serializing an account */\nexport const DEPHY_ID_ERROR__SERIALIZATION_ERROR = 0x1; // 1\n/** InvalidProgramOwner: Invalid program owner. This likely mean the provided account does not exist */\nexport const DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER = 0x2; // 2\n/** InvalidPda: Invalid PDA derivation */\nexport const DEPHY_ID_ERROR__INVALID_PDA = 0x3; // 3\n/** ExpectedEmptyAccount: Expected empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT = 0x4; // 4\n/** ExpectedNonEmptyAccount: Expected non empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT = 0x5; // 5\n/** ExpectedSignerAccount: Expected signer account */\nexport const DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT = 0x6; // 6\n/** ExpectedWritableAccount: Expected writable account */\nexport const DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT = 0x7; // 7\n/** AccountMismatch: Account mismatch */\nexport const DEPHY_ID_ERROR__ACCOUNT_MISMATCH = 0x8; // 8\n/** InvalidAccountKey: Invalid account key */\nexport const DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY = 0x9; // 9\n/** NumericalOverflow: Numerical overflow */\nexport const DEPHY_ID_ERROR__NUMERICAL_OVERFLOW = 0xa; // 10\n/** MissingInstruction: Missing instruction */\nexport const DEPHY_ID_ERROR__MISSING_INSTRUCTION = 0xb; // 11\n/** SignatureMismatch: Signature mismatch */\nexport const DEPHY_ID_ERROR__SIGNATURE_MISMATCH = 0xc; // 12\n\nexport type DephyIdError =\n | typeof DEPHY_ID_ERROR__ACCOUNT_MISMATCH\n | typeof DEPHY_ID_ERROR__DESERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT\n | typeof DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY\n | typeof DEPHY_ID_ERROR__INVALID_PDA\n | typeof DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER\n | typeof DEPHY_ID_ERROR__MISSING_INSTRUCTION\n | typeof DEPHY_ID_ERROR__NUMERICAL_OVERFLOW\n | typeof DEPHY_ID_ERROR__SERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__SIGNATURE_MISMATCH;\n\nlet dephyIdErrorMessages: Record | undefined;\nif (__DEV__) {\n dephyIdErrorMessages = {\n [DEPHY_ID_ERROR__ACCOUNT_MISMATCH]: `Account mismatch`,\n [DEPHY_ID_ERROR__DESERIALIZATION_ERROR]: `Error deserializing an account`,\n [DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT]: `Expected empty account`,\n [DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT]: `Expected non empty account`,\n [DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT]: `Expected signer account`,\n [DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT]: `Expected writable account`,\n [DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY]: `Invalid account key`,\n [DEPHY_ID_ERROR__INVALID_PDA]: `Invalid PDA derivation`,\n [DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER]: `Invalid program owner. This likely mean the provided account does not exist`,\n [DEPHY_ID_ERROR__MISSING_INSTRUCTION]: `Missing instruction`,\n [DEPHY_ID_ERROR__NUMERICAL_OVERFLOW]: `Numerical overflow`,\n [DEPHY_ID_ERROR__SERIALIZATION_ERROR]: `Error serializing an account`,\n [DEPHY_ID_ERROR__SIGNATURE_MISMATCH]: `Signature mismatch`,\n };\n}\n\nexport function getDephyIdErrorMessage(code: DephyIdError): string {\n if (__DEV__) {\n return (dephyIdErrorMessages as Record)[code];\n }\n\n return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.';\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\nimport {\n getDeviceActivationSignatureDecoder,\n getDeviceActivationSignatureEncoder,\n type DeviceActivationSignature,\n type DeviceActivationSignatureArgs,\n} from '../types';\n\nexport type ActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends string | IAccountMeta = string,\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TAccountDeviceAssociatedToken extends string | IAccountMeta = string,\n TAccountOwner extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlyAccount\n : TAccountVendor,\n TAccountProductMint extends string\n ? ReadonlyAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? ReadonlyAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n TAccountDeviceAssociatedToken extends string\n ? WritableAccount\n : TAccountDeviceAssociatedToken,\n TAccountOwner extends string\n ? ReadonlyAccount\n : TAccountOwner,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ActivateDeviceInstructionData = {\n discriminator: number;\n signature: DeviceActivationSignature;\n timestamp: bigint;\n};\n\nexport type ActivateDeviceInstructionDataArgs = {\n signature: DeviceActivationSignatureArgs;\n timestamp: number | bigint;\n};\n\nexport function getActivateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['signature', getDeviceActivationSignatureEncoder()],\n ['timestamp', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 3 })\n );\n}\n\nexport function getActivateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['signature', getDeviceActivationSignatureDecoder()],\n ['timestamp', getU64Decoder()],\n ]);\n}\n\nexport function getActivateDeviceInstructionDataCodec(): Codec<\n ActivateDeviceInstructionDataArgs,\n ActivateDeviceInstructionData\n> {\n return combineCodec(\n getActivateDeviceInstructionDataEncoder(),\n getActivateDeviceInstructionDataDecoder()\n );\n}\n\nexport type ActivateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n TAccountDeviceAssociatedToken extends string = string,\n TAccountOwner extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: Address;\n /** The mint account for the product */\n productMint: Address;\n /** The associated token account for the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account for the device */\n deviceMint: Address;\n /** The associated token account for the device */\n deviceAssociatedToken: Address;\n /** The device's owner */\n owner: Address;\n signature: ActivateDeviceInstructionDataArgs['signature'];\n timestamp: ActivateDeviceInstructionDataArgs['timestamp'];\n};\n\nexport function getActivateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n TAccountDeviceAssociatedToken extends string,\n TAccountOwner extends string,\n>(\n input: ActivateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >\n): ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: false },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: false,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n deviceAssociatedToken: {\n value: input.deviceAssociatedToken ?? null,\n isWritable: true,\n },\n owner: { value: input.owner ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n getAccountMeta(accounts.deviceAssociatedToken),\n getAccountMeta(accounts.owner),\n ],\n programAddress,\n data: getActivateDeviceInstructionDataEncoder().encode(\n args as ActivateDeviceInstructionDataArgs\n ),\n } as ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >;\n\n return instruction;\n}\n\nexport type ParsedActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The account paying for the storage fees */\n payer: TAccountMetas[3];\n /** The vendor */\n vendor: TAccountMetas[4];\n /** The mint account for the product */\n productMint: TAccountMetas[5];\n /** The associated token account for the product */\n productAssociatedToken: TAccountMetas[6];\n /** The device */\n device: TAccountMetas[7];\n /** The mint account for the device */\n deviceMint: TAccountMetas[8];\n /** The associated token account for the device */\n deviceAssociatedToken: TAccountMetas[9];\n /** The device's owner */\n owner: TAccountMetas[10];\n };\n data: ActivateDeviceInstructionData;\n};\n\nexport function parseActivateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedActivateDeviceInstruction {\n if (instruction.accounts.length < 11) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n deviceAssociatedToken: getNextAccount(),\n owner: getNextAccount(),\n },\n data: getActivateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport { containsBytes, getU8Encoder, type Address } from '@solana/web3.js';\nimport {\n type ParsedActivateDeviceInstruction,\n type ParsedCreateDeviceInstruction,\n type ParsedCreateProductInstruction,\n type ParsedInitializeInstruction,\n} from '../instructions';\nimport { Key, getKeyEncoder } from '../types';\n\nexport const DEPHY_ID_PROGRAM_ADDRESS =\n 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>;\n\nexport enum DephyIdAccount {\n ProgramDataAccount,\n}\n\nexport function identifyDephyIdAccount(\n account: { data: Uint8Array } | Uint8Array\n): DephyIdAccount {\n const data = account instanceof Uint8Array ? account : account.data;\n if (containsBytes(data, getKeyEncoder().encode(Key.ProgramDataAccount), 0)) {\n return DephyIdAccount.ProgramDataAccount;\n }\n throw new Error(\n 'The provided account could not be identified as a dephyId account.'\n );\n}\n\nexport enum DephyIdInstruction {\n Initialize,\n CreateProduct,\n CreateDevice,\n ActivateDevice,\n}\n\nexport function identifyDephyIdInstruction(\n instruction: { data: Uint8Array } | Uint8Array\n): DephyIdInstruction {\n const data =\n instruction instanceof Uint8Array ? instruction : instruction.data;\n if (containsBytes(data, getU8Encoder().encode(0), 0)) {\n return DephyIdInstruction.Initialize;\n }\n if (containsBytes(data, getU8Encoder().encode(1), 0)) {\n return DephyIdInstruction.CreateProduct;\n }\n if (containsBytes(data, getU8Encoder().encode(2), 0)) {\n return DephyIdInstruction.CreateDevice;\n }\n if (containsBytes(data, getU8Encoder().encode(3), 0)) {\n return DephyIdInstruction.ActivateDevice;\n }\n throw new Error(\n 'The provided instruction could not be identified as a dephyId instruction.'\n );\n}\n\nexport type ParsedDephyIdInstruction<\n TProgram extends string = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1',\n> =\n | ({\n instructionType: DephyIdInstruction.Initialize;\n } & ParsedInitializeInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateProduct;\n } & ParsedCreateProductInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateDevice;\n } & ParsedCreateDeviceInstruction)\n | ({\n instructionType: DephyIdInstruction.ActivateDevice;\n } & ParsedActivateDeviceInstruction);\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n AccountRole,\n isProgramDerivedAddress,\n isTransactionSigner as web3JsIsTransactionSigner,\n type Address,\n type IAccountMeta,\n type IAccountSignerMeta,\n type ProgramDerivedAddress,\n type TransactionSigner,\n upgradeRoleToSigner,\n} from '@solana/web3.js';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome(value: T | null | undefined): T {\n if (value == null) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): Address {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0];\n }\n return value as Address;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): ProgramDerivedAddress {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): TransactionSigner {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null =\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null,\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(\n programAddress: Address,\n optionalAccountStrategy: 'omitted' | 'programId'\n) {\n return (\n account: ResolvedAccount\n ): IAccountMeta | IAccountSignerMeta | undefined => {\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n return Object.freeze({\n address: programAddress,\n role: AccountRole.READONLY,\n });\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n return Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n };\n}\n\nexport function isTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n): value is TransactionSigner {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n web3JsIsTransactionSigner(value)\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\nimport {\n getDeviceSigningAlgorithmDecoder,\n getDeviceSigningAlgorithmEncoder,\n type DeviceSigningAlgorithm,\n type DeviceSigningAlgorithmArgs,\n} from '../types';\n\nexport type CreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? WritableAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateDeviceInstructionData = {\n discriminator: number;\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithm;\n};\n\nexport type CreateDeviceInstructionDataArgs = {\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithmArgs;\n};\n\nexport function getCreateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmEncoder()],\n ]),\n (value) => ({ ...value, discriminator: 2 })\n );\n}\n\nexport function getCreateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmDecoder()],\n ]);\n}\n\nexport function getCreateDeviceInstructionDataCodec(): Codec<\n CreateDeviceInstructionDataArgs,\n CreateDeviceInstructionData\n> {\n return combineCodec(\n getCreateDeviceInstructionDataEncoder(),\n getCreateDeviceInstructionDataDecoder()\n );\n}\n\nexport type CreateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n /** The associated token account of the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account of the device */\n deviceMint: Address;\n name: CreateDeviceInstructionDataArgs['name'];\n uri: CreateDeviceInstructionDataArgs['uri'];\n additionalMetadata: CreateDeviceInstructionDataArgs['additionalMetadata'];\n signingAlg: CreateDeviceInstructionDataArgs['signingAlg'];\n};\n\nexport function getCreateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n>(\n input: CreateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >\n): CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: true,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n ],\n programAddress,\n data: getCreateDeviceInstructionDataEncoder().encode(\n args as CreateDeviceInstructionDataArgs\n ),\n } as CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The account paying for the storage fees */\n payer: TAccountMetas[3];\n /** The vendor */\n vendor: TAccountMetas[4];\n /** The mint account of the product */\n productMint: TAccountMetas[5];\n /** The associated token account of the product */\n productAssociatedToken: TAccountMetas[6];\n /** The device */\n device: TAccountMetas[7];\n /** The mint account of the device */\n deviceMint: TAccountMetas[8];\n };\n data: CreateDeviceInstructionData;\n};\n\nexport function parseCreateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateDeviceInstruction {\n if (instruction.accounts.length < 9) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n },\n data: getCreateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\n\nexport type CreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateProductInstructionData = {\n discriminator: number;\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport type CreateProductInstructionDataArgs = {\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport function getCreateProductInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ]),\n (value) => ({ ...value, discriminator: 1 })\n );\n}\n\nexport function getCreateProductInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ]);\n}\n\nexport function getCreateProductInstructionDataCodec(): Codec<\n CreateProductInstructionDataArgs,\n CreateProductInstructionData\n> {\n return combineCodec(\n getCreateProductInstructionDataEncoder(),\n getCreateProductInstructionDataDecoder()\n );\n}\n\nexport type CreateProductInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n name: CreateProductInstructionDataArgs['name'];\n symbol: CreateProductInstructionDataArgs['symbol'];\n uri: CreateProductInstructionDataArgs['uri'];\n additionalMetadata: CreateProductInstructionDataArgs['additionalMetadata'];\n};\n\nexport function getCreateProductInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n>(\n input: CreateProductInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >\n): CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n ],\n programAddress,\n data: getCreateProductInstructionDataEncoder().encode(\n args as CreateProductInstructionDataArgs\n ),\n } as CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The account paying for the storage fees */\n payer: TAccountMetas[2];\n /** The vendor */\n vendor: TAccountMetas[3];\n /** The mint account of the product */\n productMint: TAccountMetas[4];\n };\n data: CreateProductInstructionData;\n};\n\nexport function parseCreateProductInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateProductInstruction {\n if (instruction.accounts.length < 5) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n },\n data: getCreateProductInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\n\nexport type InitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountProgramData extends string | IAccountMeta = string,\n TAccountAuthority extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountProgramData extends string\n ? WritableAccount\n : TAccountProgramData,\n TAccountAuthority extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountAuthority,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeInstructionData = { discriminator: number; bump: number };\n\nexport type InitializeInstructionDataArgs = { bump: number };\n\nexport function getInitializeInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['bump', getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 0 })\n );\n}\n\nexport function getInitializeInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['bump', getU8Decoder()],\n ]);\n}\n\nexport function getInitializeInstructionDataCodec(): Codec<\n InitializeInstructionDataArgs,\n InitializeInstructionData\n> {\n return combineCodec(\n getInitializeInstructionDataEncoder(),\n getInitializeInstructionDataDecoder()\n );\n}\n\nexport type InitializeInput<\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountProgramData extends string = string,\n TAccountAuthority extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The program data account for the program */\n programData: Address;\n /** The authority account of the program */\n authority: TransactionSigner;\n bump: InitializeInstructionDataArgs['bump'];\n};\n\nexport function getInitializeInstruction<\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TAccountProgramData extends string,\n TAccountAuthority extends string,\n>(\n input: InitializeInput<\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >\n): InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.programData),\n getAccountMeta(accounts.authority),\n ],\n programAddress,\n data: getInitializeInstructionDataEncoder().encode(\n args as InitializeInstructionDataArgs\n ),\n } as InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The account paying for the storage fees */\n payer: TAccountMetas[1];\n /** The program data account for the program */\n programData: TAccountMetas[2];\n /** The authority account of the program */\n authority: TAccountMetas[3];\n };\n data: InitializeInstructionData;\n};\n\nexport function parseInitializeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedInitializeInstruction {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n payer: getNextAccount(),\n programData: getNextAccount(),\n authority: getNextAccount(),\n },\n data: getInitializeInstructionDataDecoder().decode(instruction.data),\n };\n}\n"]} \ No newline at end of file diff --git a/clients/js/dist/src/index.mjs b/clients/js/dist/src/index.mjs index f9703e1..9ce3885 100644 --- a/clients/js/dist/src/index.mjs +++ b/clients/js/dist/src/index.mjs @@ -117,10 +117,10 @@ function deviceActivationSignature(kind, data) { function isDeviceActivationSignature(kind, value) { return value.__kind === kind; } -var DeviceSigningAlgorithm = /* @__PURE__ */ ((DeviceSigningAlgorithm3) => { - DeviceSigningAlgorithm3[DeviceSigningAlgorithm3["Ed25519"] = 0] = "Ed25519"; - DeviceSigningAlgorithm3[DeviceSigningAlgorithm3["Secp256k1"] = 1] = "Secp256k1"; - return DeviceSigningAlgorithm3; +var DeviceSigningAlgorithm = /* @__PURE__ */ ((DeviceSigningAlgorithm2) => { + DeviceSigningAlgorithm2[DeviceSigningAlgorithm2["Ed25519"] = 0] = "Ed25519"; + DeviceSigningAlgorithm2[DeviceSigningAlgorithm2["Secp256k1"] = 1] = "Secp256k1"; + return DeviceSigningAlgorithm2; })(DeviceSigningAlgorithm || {}); function getDeviceSigningAlgorithmEncoder() { return getEnumEncoder(DeviceSigningAlgorithm); @@ -368,7 +368,6 @@ function getActivateDeviceInstruction(input) { isWritable: false }, ataProgram: { value: input.ataProgram ?? null, isWritable: false }, - instructions: { value: input.instructions ?? null, isWritable: false }, payer: { value: input.payer ?? null, isWritable: true }, vendor: { value: input.vendor ?? null, isWritable: false }, productMint: { value: input.productMint ?? null, isWritable: false }, @@ -398,7 +397,6 @@ function getActivateDeviceInstruction(input) { getAccountMeta(accounts.systemProgram), getAccountMeta(accounts.token2022Program), getAccountMeta(accounts.ataProgram), - getAccountMeta(accounts.instructions), getAccountMeta(accounts.payer), getAccountMeta(accounts.vendor), getAccountMeta(accounts.productMint), @@ -416,7 +414,7 @@ function getActivateDeviceInstruction(input) { return instruction; } function parseActivateDeviceInstruction(instruction) { - if (instruction.accounts.length < 12) { + if (instruction.accounts.length < 11) { throw new Error("Not enough accounts"); } let accountIndex = 0; @@ -431,7 +429,6 @@ function parseActivateDeviceInstruction(instruction) { systemProgram: getNextAccount(), token2022Program: getNextAccount(), ataProgram: getNextAccount(), - instructions: getNextAccount(), payer: getNextAccount(), vendor: getNextAccount(), productMint: getNextAccount(), diff --git a/clients/js/dist/src/index.mjs.map b/clients/js/dist/src/index.mjs.map index b671932..21f7c6a 100644 --- a/clients/js/dist/src/index.mjs.map +++ b/clients/js/dist/src/index.mjs.map @@ -1 +1 @@ -{"version":3,"sources":["../../env-shim.ts","../../src/generated/accounts/programDataAccount.ts","../../src/generated/pdas/deviceMint.ts","../../src/generated/pdas/productMint.ts","../../src/generated/pdas/programDataAccount.ts","../../src/generated/types/deviceActivationSignature.ts","../../src/generated/types/deviceSigningAlgorithm.ts","../../src/generated/types/key.ts","../../src/generated/types/programData.ts","../../src/generated/errors/dephyId.ts","../../src/generated/instructions/activateDevice.ts","../../src/generated/programs/dephyId.ts","../../src/generated/shared/index.ts","../../src/generated/instructions/createDevice.ts","../../src/generated/instructions/createProduct.ts","../../src/generated/instructions/initialize.ts"],"names":["combineCodec","getAddressEncoder","getStructDecoder","getStructEncoder","getProgramDerivedAddress","getUtf8Encoder","DeviceSigningAlgorithm","getEnumDecoder","getEnumEncoder","Key","getU8Decoder","getU8Encoder","transformEncoder","DephyIdAccount","DephyIdInstruction","getTupleDecoder","getTupleEncoder","addDecoderSizePrefix","addEncoderSizePrefix","getArrayDecoder","getArrayEncoder","getU32Decoder","getU32Encoder","getUtf8Decoder"],"mappings":";AACO,IAAM,UAA2B,uBACrC,QAAgB,KAAU,EAAE,aAAa,eAAe;;;ACM3D;AAAA,EAWE;AAAA,EACA;AAAA,EACA,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA;AAAA,OACK;;;ACtBP;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,eAAsB,kBACpB,OACA,SAAmD,CAAC,GACpB;AAChC,QAAM;AAAA,IACJ,iBAAiB;AAAA,EACnB,IAAI;AACJ,SAAO,MAAM,yBAAyB;AAAA,IACpC;AAAA,IACA,OAAO;AAAA,MACL,eAAe,EAAE,OAAO,iBAAiB;AAAA,MACzC,kBAAkB,EAA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ACtD,MAAI,YAAY,SAAS,SAAS,GAAG;AAEnC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AACA,MAAI,eAAe;AACnB,QAAM,iBAAiB,MAAM;AAC3B,UAAM,cAAc,YAAY,SAAU,YAAY;AACtD,oBAAgB;AAChB,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,gBAAgB,YAAY;AAAA,IAC5B,UAAU;AAAA,MACR,eAAe,eAAe;AAAA,MAC9B,OAAO,eAAe;AAAA,MACtB,aAAa,eAAe;AAAA,MAC5B,WAAW,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,oCAAoC,EAAE,OAAO,YAAY,IAAI;AAAA,EACrE;AACF","sourcesContent":["// Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV`\nexport const __DEV__ = /* @__PURE__ */ (() =>\n (process as any)['en' + 'v'].NODE_ENV === 'development')();\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Account,\n Address,\n Codec,\n Decoder,\n EncodedAccount,\n Encoder,\n FetchAccountConfig,\n FetchAccountsConfig,\n MaybeAccount,\n MaybeEncodedAccount,\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { findProgramDataAccountPda } from '../pdas';\nimport {\n Key,\n ProgramData,\n ProgramDataArgs,\n getKeyDecoder,\n getKeyEncoder,\n getProgramDataDecoder,\n getProgramDataEncoder,\n} from '../types';\n\nexport type ProgramDataAccount = {\n key: Key;\n authority: Address;\n data: ProgramData;\n};\n\nexport type ProgramDataAccountArgs = {\n authority: Address;\n data: ProgramDataArgs;\n};\n\nexport function getProgramDataAccountEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['key', getKeyEncoder()],\n ['authority', getAddressEncoder()],\n ['data', getProgramDataEncoder()],\n ]),\n (value) => ({ ...value, key: Key.ProgramDataAccount })\n );\n}\n\nexport function getProgramDataAccountDecoder(): Decoder {\n return getStructDecoder([\n ['key', getKeyDecoder()],\n ['authority', getAddressDecoder()],\n ['data', getProgramDataDecoder()],\n ]);\n}\n\nexport function getProgramDataAccountCodec(): Codec<\n ProgramDataAccountArgs,\n ProgramDataAccount\n> {\n return combineCodec(\n getProgramDataAccountEncoder(),\n getProgramDataAccountDecoder()\n );\n}\n\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount\n): Account;\nexport function decodeProgramDataAccount(\n encodedAccount: MaybeEncodedAccount\n): MaybeAccount;\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount | MaybeEncodedAccount\n):\n | Account\n | MaybeAccount {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount,\n getProgramDataAccountDecoder()\n );\n}\n\nexport async function fetchProgramDataAccount(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccount(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccount<\n TAddress extends string = string,\n>(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeProgramDataAccount(maybeAccount);\n}\n\nexport async function fetchAllProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchAllMaybeProgramDataAccount(\n rpc,\n addresses,\n config\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) =>\n decodeProgramDataAccount(maybeAccount)\n );\n}\n\nexport function getProgramDataAccountSize(): number {\n return 34;\n}\n\nexport async function fetchProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccountFromSeeds(rpc, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findProgramDataAccountPda({ programAddress });\n return await fetchMaybeProgramDataAccount(rpc, address, fetchConfig);\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n ProgramDerivedAddress,\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n} from '@solana/web3.js';\n\nexport type DeviceMintSeeds = {\n productMintPubkey: Address;\n\n devicePubkey: Address;\n};\n\nexport async function findDeviceMintPda(\n seeds: DeviceMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-DEVICE'),\n getAddressEncoder().encode(seeds.productMintPubkey),\n getAddressEncoder().encode(seeds.devicePubkey),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n ProgramDerivedAddress,\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n} from '@solana/web3.js';\n\nexport type ProductMintSeeds = {\n vendorPubkey: Address;\n\n productName: string;\n};\n\nexport async function findProductMintPda(\n seeds: ProductMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-PRODUCT'),\n getAddressEncoder().encode(seeds.vendorPubkey),\n getUtf8Encoder().encode(seeds.productName),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n ProgramDerivedAddress,\n getProgramDerivedAddress,\n getUtf8Encoder,\n} from '@solana/web3.js';\n\nexport async function findProgramDataAccountPda(\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('DePHY_ID')],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n GetDiscriminatedUnionVariant,\n GetDiscriminatedUnionVariantContent,\n ReadonlyUint8Array,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getDiscriminatedUnionDecoder,\n getDiscriminatedUnionEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU8Decoder,\n getU8Encoder,\n} from '@solana/web3.js';\n\nexport type DeviceActivationSignature =\n | { __kind: 'Ed25519'; fields: readonly [ReadonlyUint8Array] }\n | { __kind: 'Secp256k1'; fields: readonly [ReadonlyUint8Array, number] }\n | { __kind: 'EthSecp256k1'; fields: readonly [ReadonlyUint8Array, number] };\n\nexport type DeviceActivationSignatureArgs = DeviceActivationSignature;\n\nexport function getDeviceActivationSignatureEncoder(): Encoder {\n return getDiscriminatedUnionEncoder([\n [\n 'Ed25519',\n getStructEncoder([\n ['fields', getTupleEncoder([fixEncoderSize(getBytesEncoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureDecoder(): Decoder {\n return getDiscriminatedUnionDecoder([\n [\n 'Ed25519',\n getStructDecoder([\n ['fields', getTupleDecoder([fixDecoderSize(getBytesDecoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureCodec(): Codec<\n DeviceActivationSignatureArgs,\n DeviceActivationSignature\n> {\n return combineCodec(\n getDeviceActivationSignatureEncoder(),\n getDeviceActivationSignatureDecoder()\n );\n}\n\n// Data Enum Helpers.\nexport function deviceActivationSignature(\n kind: 'Ed25519',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n>;\nexport function deviceActivationSignature(\n kind: 'Secp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n>;\nexport function deviceActivationSignature(\n kind: 'EthSecp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n>;\nexport function deviceActivationSignature<\n K extends DeviceActivationSignatureArgs['__kind'],\n Data,\n>(kind: K, data?: Data) {\n return Array.isArray(data)\n ? { __kind: kind, fields: data }\n : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isDeviceActivationSignature<\n K extends DeviceActivationSignature['__kind'],\n>(\n kind: K,\n value: DeviceActivationSignature\n): value is DeviceActivationSignature & { __kind: K } {\n return value.__kind === kind;\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n} from '@solana/web3.js';\n\nexport enum DeviceSigningAlgorithm {\n Ed25519,\n Secp256k1,\n}\n\nexport type DeviceSigningAlgorithmArgs = DeviceSigningAlgorithm;\n\nexport function getDeviceSigningAlgorithmEncoder(): Encoder {\n return getEnumEncoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmDecoder(): Decoder {\n return getEnumDecoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmCodec(): Codec<\n DeviceSigningAlgorithmArgs,\n DeviceSigningAlgorithm\n> {\n return combineCodec(\n getDeviceSigningAlgorithmEncoder(),\n getDeviceSigningAlgorithmDecoder()\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n} from '@solana/web3.js';\n\nexport enum Key {\n Uninitialized,\n ProgramDataAccount,\n}\n\nexport type KeyArgs = Key;\n\nexport function getKeyEncoder(): Encoder {\n return getEnumEncoder(Key);\n}\n\nexport function getKeyDecoder(): Decoder {\n return getEnumDecoder(Key);\n}\n\nexport function getKeyCodec(): Codec {\n return combineCodec(getKeyEncoder(), getKeyDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n} from '@solana/web3.js';\n\nexport type ProgramData = { bump: number };\n\nexport type ProgramDataArgs = ProgramData;\n\nexport function getProgramDataEncoder(): Encoder {\n return getStructEncoder([['bump', getU8Encoder()]]);\n}\n\nexport function getProgramDataDecoder(): Decoder {\n return getStructDecoder([['bump', getU8Decoder()]]);\n}\n\nexport function getProgramDataCodec(): Codec {\n return combineCodec(getProgramDataEncoder(), getProgramDataDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\n/** DeserializationError: Error deserializing an account */\nexport const DEPHY_ID_ERROR__DESERIALIZATION_ERROR = 0x0; // 0\n/** SerializationError: Error serializing an account */\nexport const DEPHY_ID_ERROR__SERIALIZATION_ERROR = 0x1; // 1\n/** InvalidProgramOwner: Invalid program owner. This likely mean the provided account does not exist */\nexport const DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER = 0x2; // 2\n/** InvalidPda: Invalid PDA derivation */\nexport const DEPHY_ID_ERROR__INVALID_PDA = 0x3; // 3\n/** ExpectedEmptyAccount: Expected empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT = 0x4; // 4\n/** ExpectedNonEmptyAccount: Expected non empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT = 0x5; // 5\n/** ExpectedSignerAccount: Expected signer account */\nexport const DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT = 0x6; // 6\n/** ExpectedWritableAccount: Expected writable account */\nexport const DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT = 0x7; // 7\n/** AccountMismatch: Account mismatch */\nexport const DEPHY_ID_ERROR__ACCOUNT_MISMATCH = 0x8; // 8\n/** InvalidAccountKey: Invalid account key */\nexport const DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY = 0x9; // 9\n/** NumericalOverflow: Numerical overflow */\nexport const DEPHY_ID_ERROR__NUMERICAL_OVERFLOW = 0xa; // 10\n/** MissingInstruction: Missing instruction */\nexport const DEPHY_ID_ERROR__MISSING_INSTRUCTION = 0xb; // 11\n/** SignatureMismatch: Signature mismatch */\nexport const DEPHY_ID_ERROR__SIGNATURE_MISMATCH = 0xc; // 12\n\nexport type DephyIdError =\n | typeof DEPHY_ID_ERROR__ACCOUNT_MISMATCH\n | typeof DEPHY_ID_ERROR__DESERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT\n | typeof DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY\n | typeof DEPHY_ID_ERROR__INVALID_PDA\n | typeof DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER\n | typeof DEPHY_ID_ERROR__MISSING_INSTRUCTION\n | typeof DEPHY_ID_ERROR__NUMERICAL_OVERFLOW\n | typeof DEPHY_ID_ERROR__SERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__SIGNATURE_MISMATCH;\n\nlet dephyIdErrorMessages: Record | undefined;\nif (__DEV__) {\n dephyIdErrorMessages = {\n [DEPHY_ID_ERROR__ACCOUNT_MISMATCH]: `Account mismatch`,\n [DEPHY_ID_ERROR__DESERIALIZATION_ERROR]: `Error deserializing an account`,\n [DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT]: `Expected empty account`,\n [DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT]: `Expected non empty account`,\n [DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT]: `Expected signer account`,\n [DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT]: `Expected writable account`,\n [DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY]: `Invalid account key`,\n [DEPHY_ID_ERROR__INVALID_PDA]: `Invalid PDA derivation`,\n [DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER]: `Invalid program owner. This likely mean the provided account does not exist`,\n [DEPHY_ID_ERROR__MISSING_INSTRUCTION]: `Missing instruction`,\n [DEPHY_ID_ERROR__NUMERICAL_OVERFLOW]: `Numerical overflow`,\n [DEPHY_ID_ERROR__SERIALIZATION_ERROR]: `Error serializing an account`,\n [DEPHY_ID_ERROR__SIGNATURE_MISMATCH]: `Signature mismatch`,\n };\n}\n\nexport function getDephyIdErrorMessage(code: DephyIdError): string {\n if (__DEV__) {\n return (dephyIdErrorMessages as Record)[code];\n }\n\n return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.';\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\nimport {\n DeviceActivationSignature,\n DeviceActivationSignatureArgs,\n getDeviceActivationSignatureDecoder,\n getDeviceActivationSignatureEncoder,\n} from '../types';\n\nexport type ActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends string | IAccountMeta = string,\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountInstructions extends string | IAccountMeta = string,\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TAccountDeviceAssociatedToken extends string | IAccountMeta = string,\n TAccountOwner extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountInstructions extends string\n ? ReadonlyAccount\n : TAccountInstructions,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlyAccount\n : TAccountVendor,\n TAccountProductMint extends string\n ? ReadonlyAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? ReadonlyAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n TAccountDeviceAssociatedToken extends string\n ? WritableAccount\n : TAccountDeviceAssociatedToken,\n TAccountOwner extends string\n ? ReadonlyAccount\n : TAccountOwner,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ActivateDeviceInstructionData = {\n discriminator: number;\n signature: DeviceActivationSignature;\n timestamp: bigint;\n};\n\nexport type ActivateDeviceInstructionDataArgs = {\n signature: DeviceActivationSignatureArgs;\n timestamp: number | bigint;\n};\n\nexport function getActivateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['signature', getDeviceActivationSignatureEncoder()],\n ['timestamp', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 3 })\n );\n}\n\nexport function getActivateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['signature', getDeviceActivationSignatureDecoder()],\n ['timestamp', getU64Decoder()],\n ]);\n}\n\nexport function getActivateDeviceInstructionDataCodec(): Codec<\n ActivateDeviceInstructionDataArgs,\n ActivateDeviceInstructionData\n> {\n return combineCodec(\n getActivateDeviceInstructionDataEncoder(),\n getActivateDeviceInstructionDataDecoder()\n );\n}\n\nexport type ActivateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountInstructions extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n TAccountDeviceAssociatedToken extends string = string,\n TAccountOwner extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The instructions sysvar */\n instructions: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: Address;\n /** The mint account for the product */\n productMint: Address;\n /** The associated token account for the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account for the device */\n deviceMint: Address;\n /** The associated token account for the device */\n deviceAssociatedToken: Address;\n /** The device's owner */\n owner: Address;\n signature: ActivateDeviceInstructionDataArgs['signature'];\n timestamp: ActivateDeviceInstructionDataArgs['timestamp'];\n};\n\nexport function getActivateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountInstructions extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n TAccountDeviceAssociatedToken extends string,\n TAccountOwner extends string,\n>(\n input: ActivateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountInstructions,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >\n): ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountInstructions,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n instructions: { value: input.instructions ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: false },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: false,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n deviceAssociatedToken: {\n value: input.deviceAssociatedToken ?? null,\n isWritable: true,\n },\n owner: { value: input.owner ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.instructions),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n getAccountMeta(accounts.deviceAssociatedToken),\n getAccountMeta(accounts.owner),\n ],\n programAddress,\n data: getActivateDeviceInstructionDataEncoder().encode(\n args as ActivateDeviceInstructionDataArgs\n ),\n } as ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountInstructions,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >;\n\n return instruction;\n}\n\nexport type ParsedActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The instructions sysvar */\n instructions: TAccountMetas[3];\n /** The account paying for the storage fees */\n payer: TAccountMetas[4];\n /** The vendor */\n vendor: TAccountMetas[5];\n /** The mint account for the product */\n productMint: TAccountMetas[6];\n /** The associated token account for the product */\n productAssociatedToken: TAccountMetas[7];\n /** The device */\n device: TAccountMetas[8];\n /** The mint account for the device */\n deviceMint: TAccountMetas[9];\n /** The associated token account for the device */\n deviceAssociatedToken: TAccountMetas[10];\n /** The device's owner */\n owner: TAccountMetas[11];\n };\n data: ActivateDeviceInstructionData;\n};\n\nexport function parseActivateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedActivateDeviceInstruction {\n if (instruction.accounts.length < 12) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n instructions: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n deviceAssociatedToken: getNextAccount(),\n owner: getNextAccount(),\n },\n data: getActivateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport { Address, containsBytes, getU8Encoder } from '@solana/web3.js';\nimport {\n ParsedActivateDeviceInstruction,\n ParsedCreateDeviceInstruction,\n ParsedCreateProductInstruction,\n ParsedInitializeInstruction,\n} from '../instructions';\nimport { Key, getKeyEncoder } from '../types';\n\nexport const DEPHY_ID_PROGRAM_ADDRESS =\n 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>;\n\nexport enum DephyIdAccount {\n ProgramDataAccount,\n}\n\nexport function identifyDephyIdAccount(\n account: { data: Uint8Array } | Uint8Array\n): DephyIdAccount {\n const data = account instanceof Uint8Array ? account : account.data;\n if (containsBytes(data, getKeyEncoder().encode(Key.ProgramDataAccount), 0)) {\n return DephyIdAccount.ProgramDataAccount;\n }\n throw new Error(\n 'The provided account could not be identified as a dephyId account.'\n );\n}\n\nexport enum DephyIdInstruction {\n Initialize,\n CreateProduct,\n CreateDevice,\n ActivateDevice,\n}\n\nexport function identifyDephyIdInstruction(\n instruction: { data: Uint8Array } | Uint8Array\n): DephyIdInstruction {\n const data =\n instruction instanceof Uint8Array ? instruction : instruction.data;\n if (containsBytes(data, getU8Encoder().encode(0), 0)) {\n return DephyIdInstruction.Initialize;\n }\n if (containsBytes(data, getU8Encoder().encode(1), 0)) {\n return DephyIdInstruction.CreateProduct;\n }\n if (containsBytes(data, getU8Encoder().encode(2), 0)) {\n return DephyIdInstruction.CreateDevice;\n }\n if (containsBytes(data, getU8Encoder().encode(3), 0)) {\n return DephyIdInstruction.ActivateDevice;\n }\n throw new Error(\n 'The provided instruction could not be identified as a dephyId instruction.'\n );\n}\n\nexport type ParsedDephyIdInstruction<\n TProgram extends string = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1',\n> =\n | ({\n instructionType: DephyIdInstruction.Initialize;\n } & ParsedInitializeInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateProduct;\n } & ParsedCreateProductInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateDevice;\n } & ParsedCreateDeviceInstruction)\n | ({\n instructionType: DephyIdInstruction.ActivateDevice;\n } & ParsedActivateDeviceInstruction);\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n AccountRole,\n Address,\n IAccountMeta,\n IAccountSignerMeta,\n ProgramDerivedAddress,\n TransactionSigner,\n isProgramDerivedAddress,\n isTransactionSigner as web3JsIsTransactionSigner,\n upgradeRoleToSigner,\n} from '@solana/web3.js';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome(value: T | null | undefined): T {\n if (value == null) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): Address {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0];\n }\n return value as Address;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): ProgramDerivedAddress {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): TransactionSigner {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null =\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null,\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(\n programAddress: Address,\n optionalAccountStrategy: 'omitted' | 'programId'\n) {\n return (\n account: ResolvedAccount\n ): IAccountMeta | IAccountSignerMeta | undefined => {\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n return Object.freeze({\n address: programAddress,\n role: AccountRole.READONLY,\n });\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n return Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n };\n}\n\nexport function isTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n): value is TransactionSigner {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n web3JsIsTransactionSigner(value)\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n ReadonlySignerAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\nimport {\n DeviceSigningAlgorithm,\n DeviceSigningAlgorithmArgs,\n getDeviceSigningAlgorithmDecoder,\n getDeviceSigningAlgorithmEncoder,\n} from '../types';\n\nexport type CreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? WritableAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateDeviceInstructionData = {\n discriminator: number;\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithm;\n};\n\nexport type CreateDeviceInstructionDataArgs = {\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithmArgs;\n};\n\nexport function getCreateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmEncoder()],\n ]),\n (value) => ({ ...value, discriminator: 2 })\n );\n}\n\nexport function getCreateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmDecoder()],\n ]);\n}\n\nexport function getCreateDeviceInstructionDataCodec(): Codec<\n CreateDeviceInstructionDataArgs,\n CreateDeviceInstructionData\n> {\n return combineCodec(\n getCreateDeviceInstructionDataEncoder(),\n getCreateDeviceInstructionDataDecoder()\n );\n}\n\nexport type CreateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n /** The associated token account of the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account of the device */\n deviceMint: Address;\n name: CreateDeviceInstructionDataArgs['name'];\n uri: CreateDeviceInstructionDataArgs['uri'];\n additionalMetadata: CreateDeviceInstructionDataArgs['additionalMetadata'];\n signingAlg: CreateDeviceInstructionDataArgs['signingAlg'];\n};\n\nexport function getCreateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n>(\n input: CreateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >\n): CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: true,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n ],\n programAddress,\n data: getCreateDeviceInstructionDataEncoder().encode(\n args as CreateDeviceInstructionDataArgs\n ),\n } as CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The account paying for the storage fees */\n payer: TAccountMetas[3];\n /** The vendor */\n vendor: TAccountMetas[4];\n /** The mint account of the product */\n productMint: TAccountMetas[5];\n /** The associated token account of the product */\n productAssociatedToken: TAccountMetas[6];\n /** The device */\n device: TAccountMetas[7];\n /** The mint account of the device */\n deviceMint: TAccountMetas[8];\n };\n data: CreateDeviceInstructionData;\n};\n\nexport function parseCreateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateDeviceInstruction {\n if (instruction.accounts.length < 9) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n },\n data: getCreateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n ReadonlySignerAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\n\nexport type CreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateProductInstructionData = {\n discriminator: number;\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport type CreateProductInstructionDataArgs = {\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport function getCreateProductInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ]),\n (value) => ({ ...value, discriminator: 1 })\n );\n}\n\nexport function getCreateProductInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ]);\n}\n\nexport function getCreateProductInstructionDataCodec(): Codec<\n CreateProductInstructionDataArgs,\n CreateProductInstructionData\n> {\n return combineCodec(\n getCreateProductInstructionDataEncoder(),\n getCreateProductInstructionDataDecoder()\n );\n}\n\nexport type CreateProductInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n name: CreateProductInstructionDataArgs['name'];\n symbol: CreateProductInstructionDataArgs['symbol'];\n uri: CreateProductInstructionDataArgs['uri'];\n additionalMetadata: CreateProductInstructionDataArgs['additionalMetadata'];\n};\n\nexport function getCreateProductInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n>(\n input: CreateProductInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >\n): CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n ],\n programAddress,\n data: getCreateProductInstructionDataEncoder().encode(\n args as CreateProductInstructionDataArgs\n ),\n } as CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The account paying for the storage fees */\n payer: TAccountMetas[2];\n /** The vendor */\n vendor: TAccountMetas[3];\n /** The mint account of the product */\n productMint: TAccountMetas[4];\n };\n data: CreateProductInstructionData;\n};\n\nexport function parseCreateProductInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateProductInstruction {\n if (instruction.accounts.length < 5) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n },\n data: getCreateProductInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n Address,\n Codec,\n Decoder,\n Encoder,\n IAccountMeta,\n IAccountSignerMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n ReadonlyAccount,\n ReadonlySignerAccount,\n TransactionSigner,\n WritableAccount,\n WritableSignerAccount,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { ResolvedAccount, getAccountMetaFactory } from '../shared';\n\nexport type InitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountProgramData extends string | IAccountMeta = string,\n TAccountAuthority extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountProgramData extends string\n ? WritableAccount\n : TAccountProgramData,\n TAccountAuthority extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountAuthority,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeInstructionData = { discriminator: number; bump: number };\n\nexport type InitializeInstructionDataArgs = { bump: number };\n\nexport function getInitializeInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['bump', getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 0 })\n );\n}\n\nexport function getInitializeInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['bump', getU8Decoder()],\n ]);\n}\n\nexport function getInitializeInstructionDataCodec(): Codec<\n InitializeInstructionDataArgs,\n InitializeInstructionData\n> {\n return combineCodec(\n getInitializeInstructionDataEncoder(),\n getInitializeInstructionDataDecoder()\n );\n}\n\nexport type InitializeInput<\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountProgramData extends string = string,\n TAccountAuthority extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The program data account for the program */\n programData: Address;\n /** The authority account of the program */\n authority: TransactionSigner;\n bump: InitializeInstructionDataArgs['bump'];\n};\n\nexport function getInitializeInstruction<\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TAccountProgramData extends string,\n TAccountAuthority extends string,\n>(\n input: InitializeInput<\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >\n): InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.programData),\n getAccountMeta(accounts.authority),\n ],\n programAddress,\n data: getInitializeInstructionDataEncoder().encode(\n args as InitializeInstructionDataArgs\n ),\n } as InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The account paying for the storage fees */\n payer: TAccountMetas[1];\n /** The program data account for the program */\n programData: TAccountMetas[2];\n /** The authority account of the program */\n authority: TAccountMetas[3];\n };\n data: InitializeInstructionData;\n};\n\nexport function parseInitializeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedInitializeInstruction {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n payer: getNextAccount(),\n programData: getNextAccount(),\n authority: getNextAccount(),\n },\n data: getInitializeInstructionDataDecoder().decode(instruction.data),\n };\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../../env-shim.ts","../../src/generated/accounts/programDataAccount.ts","../../src/generated/pdas/deviceMint.ts","../../src/generated/pdas/productMint.ts","../../src/generated/pdas/programDataAccount.ts","../../src/generated/types/deviceActivationSignature.ts","../../src/generated/types/deviceSigningAlgorithm.ts","../../src/generated/types/key.ts","../../src/generated/types/programData.ts","../../src/generated/errors/dephyId.ts","../../src/generated/instructions/activateDevice.ts","../../src/generated/programs/dephyId.ts","../../src/generated/shared/index.ts","../../src/generated/instructions/createDevice.ts","../../src/generated/instructions/createProduct.ts","../../src/generated/instructions/initialize.ts"],"names":["combineCodec","getAddressEncoder","getStructDecoder","getStructEncoder","getProgramDerivedAddress","getUtf8Encoder","DeviceSigningAlgorithm","getEnumDecoder","getEnumEncoder","Key","getU8Decoder","getU8Encoder","transformEncoder","DephyIdAccount","DephyIdInstruction","getTupleDecoder","getTupleEncoder","addDecoderSizePrefix","addEncoderSizePrefix","getArrayDecoder","getArrayEncoder","getU32Decoder","getU32Encoder","getUtf8Decoder"],"mappings":";AACO,IAAM,UAA2B,uBACrC,QAAgB,KAAU,EAAE,aAAa,eAAe;;;ACM3D;AAAA,EACE;AAAA,EACA;AAAA,EACA,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,qBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA;AAAA,OAWK;;;ACtBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAQP,eAAsB,kBACpB,OACA,SAAmD,CAAC,GACpB;AAChC,QAAM;AAAA,IACJ,iBAAiB;AAAA,EACnB,IAAI;AACJ,SAAO,MAAM,yBAAyB;AAAA,IACpC;AAAA,IACA,OAAO;AAAA,MACL,eAAe,EAAE,OAAO,iBAAiB;AAAA,MACzC,kBAAkB,EAAE,OAAO,MAAM,iBAAiB;AAAA,MAClD,kBAAkB,EAAE,OAAO,MAAM,YAAY;AAAA,IAC/C;AAAA,EACF,CAAC;AACH;;;AC7BA;AAAA,EACE,qBAAAF;AAAA,EACA,4BAAAG;AAAA,EACA,kBAAAC;AAAA,OAGK;AAQP,eAAsB,mBACpB,OACA,SAAmD,CAAC,GACpB;AAChC,QAAM;AAAA,IACJ,iBAAiB;AAAA,EACnB,IAAI;AACJ,SAAO,MAAMD,0BAAyB;AAAA,IACpC;AAAA,IACA,OAAO;AAAA,MACLC,gBAAe,EAAE,OAAO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iBAAiB;AAGvB,QAAM,mBAAmB;AAAA,IACvB,eAAe,EAAE,OAAO,MAAM,iBAAiB,MAAM,YAAY,MAAM;AAAA,IACvE,OAAO,EAAE,OAAO,MAAM,SAAS,MAAM,YAAY,KAAK;AAAA,IACtD,aAAa,EAAE,OAAO,MAAM,eAAe,MAAM,YAAY,KAAK;AAAA,IAClE,WAAW,EAAE,OAAO,MAAM,aAAa,MAAM,YAAY,MAAM;AAAA,EACjE;AACA,QAAM,WAAW;AAMjB,QAAM,OAAO,EAAE,GAAG,MAAM;AAGxB,MAAI,CAAC,SAAS,cAAc,OAAO;AACjC,aAAS,cAAc,QACrB;AAAA,EACJ;AAEA,QAAM,iBAAiB,sBAAsB,gBAAgB,WAAW;AACxE,QAAM,cAAc;AAAA,IAClB,UAAU;AAAA,MACR,eAAe,SAAS,aAAa;AAAA,MACrC,eAAe,SAAS,KAAK;AAAA,MAC7B,eAAe,SAAS,WAAW;AAAA,MACnC,eAAe,SAAS,SAAS;AAAA,IACnC;AAAA,IACA;AAAA,IACA,MAAM,oCAAoC,EAAE;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AAQA,SAAO;AACT;AAoBO,SAAS,2BAId,aAGsD;AACtD,MAAI,YAAY,SAAS,SAAS,GAAG;AAEnC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AACA,MAAI,eAAe;AACnB,QAAM,iBAAiB,MAAM;AAC3B,UAAM,cAAc,YAAY,SAAU,YAAY;AACtD,oBAAgB;AAChB,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,gBAAgB,YAAY;AAAA,IAC5B,UAAU;AAAA,MACR,eAAe,eAAe;AAAA,MAC9B,OAAO,eAAe;AAAA,MACtB,aAAa,eAAe;AAAA,MAC5B,WAAW,eAAe;AAAA,IAC5B;AAAA,IACA,MAAM,oCAAoC,EAAE,OAAO,YAAY,IAAI;AAAA,EACrE;AACF","sourcesContent":["// Clever obfuscation to prevent the build system from inlining the value of `NODE_ENV`\nexport const __DEV__ = /* @__PURE__ */ (() =>\n (process as any)['en' + 'v'].NODE_ENV === 'development')();\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/web3.js';\nimport { findProgramDataAccountPda } from '../pdas';\nimport {\n Key,\n getKeyDecoder,\n getKeyEncoder,\n getProgramDataDecoder,\n getProgramDataEncoder,\n type ProgramData,\n type ProgramDataArgs,\n} from '../types';\n\nexport type ProgramDataAccount = {\n key: Key;\n authority: Address;\n data: ProgramData;\n};\n\nexport type ProgramDataAccountArgs = {\n authority: Address;\n data: ProgramDataArgs;\n};\n\nexport function getProgramDataAccountEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['key', getKeyEncoder()],\n ['authority', getAddressEncoder()],\n ['data', getProgramDataEncoder()],\n ]),\n (value) => ({ ...value, key: Key.ProgramDataAccount })\n );\n}\n\nexport function getProgramDataAccountDecoder(): Decoder {\n return getStructDecoder([\n ['key', getKeyDecoder()],\n ['authority', getAddressDecoder()],\n ['data', getProgramDataDecoder()],\n ]);\n}\n\nexport function getProgramDataAccountCodec(): Codec<\n ProgramDataAccountArgs,\n ProgramDataAccount\n> {\n return combineCodec(\n getProgramDataAccountEncoder(),\n getProgramDataAccountDecoder()\n );\n}\n\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount\n): Account;\nexport function decodeProgramDataAccount(\n encodedAccount: MaybeEncodedAccount\n): MaybeAccount;\nexport function decodeProgramDataAccount(\n encodedAccount: EncodedAccount | MaybeEncodedAccount\n):\n | Account\n | MaybeAccount {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount,\n getProgramDataAccountDecoder()\n );\n}\n\nexport async function fetchProgramDataAccount(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccount(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccount<\n TAddress extends string = string,\n>(\n rpc: Parameters[0],\n address: Address,\n config?: FetchAccountConfig\n): Promise> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeProgramDataAccount(maybeAccount);\n}\n\nexport async function fetchAllProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchAllMaybeProgramDataAccount(\n rpc,\n addresses,\n config\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeProgramDataAccount(\n rpc: Parameters[0],\n addresses: Array
,\n config?: FetchAccountsConfig\n): Promise[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) =>\n decodeProgramDataAccount(maybeAccount)\n );\n}\n\nexport function getProgramDataAccountSize(): number {\n return 34;\n}\n\nexport async function fetchProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const maybeAccount = await fetchMaybeProgramDataAccountFromSeeds(rpc, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeProgramDataAccountFromSeeds(\n rpc: Parameters[0],\n config: FetchAccountConfig & { programAddress?: Address } = {}\n): Promise> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findProgramDataAccountPda({ programAddress });\n return await fetchMaybeProgramDataAccount(rpc, address, fetchConfig);\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/web3.js';\n\nexport type DeviceMintSeeds = {\n productMintPubkey: Address;\n\n devicePubkey: Address;\n};\n\nexport async function findDeviceMintPda(\n seeds: DeviceMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-DEVICE'),\n getAddressEncoder().encode(seeds.productMintPubkey),\n getAddressEncoder().encode(seeds.devicePubkey),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/web3.js';\n\nexport type ProductMintSeeds = {\n vendorPubkey: Address;\n\n productName: string;\n};\n\nexport async function findProductMintPda(\n seeds: ProductMintSeeds,\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('DePHY_ID-PRODUCT'),\n getAddressEncoder().encode(seeds.vendorPubkey),\n getUtf8Encoder().encode(seeds.productName),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/web3.js';\n\nexport async function findProgramDataAccountPda(\n config: { programAddress?: Address | undefined } = {}\n): Promise {\n const {\n programAddress = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('DePHY_ID')],\n });\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getDiscriminatedUnionDecoder,\n getDiscriminatedUnionEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU8Decoder,\n getU8Encoder,\n type Codec,\n type Decoder,\n type Encoder,\n type GetDiscriminatedUnionVariant,\n type GetDiscriminatedUnionVariantContent,\n type ReadonlyUint8Array,\n} from '@solana/web3.js';\n\nexport type DeviceActivationSignature =\n | { __kind: 'Ed25519'; fields: readonly [ReadonlyUint8Array] }\n | { __kind: 'Secp256k1'; fields: readonly [ReadonlyUint8Array, number] }\n | { __kind: 'EthSecp256k1'; fields: readonly [ReadonlyUint8Array, number] };\n\nexport type DeviceActivationSignatureArgs = DeviceActivationSignature;\n\nexport function getDeviceActivationSignatureEncoder(): Encoder {\n return getDiscriminatedUnionEncoder([\n [\n 'Ed25519',\n getStructEncoder([\n ['fields', getTupleEncoder([fixEncoderSize(getBytesEncoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructEncoder([\n [\n 'fields',\n getTupleEncoder([\n fixEncoderSize(getBytesEncoder(), 64),\n getU8Encoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureDecoder(): Decoder {\n return getDiscriminatedUnionDecoder([\n [\n 'Ed25519',\n getStructDecoder([\n ['fields', getTupleDecoder([fixDecoderSize(getBytesDecoder(), 64)])],\n ]),\n ],\n [\n 'Secp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n [\n 'EthSecp256k1',\n getStructDecoder([\n [\n 'fields',\n getTupleDecoder([\n fixDecoderSize(getBytesDecoder(), 64),\n getU8Decoder(),\n ]),\n ],\n ]),\n ],\n ]);\n}\n\nexport function getDeviceActivationSignatureCodec(): Codec<\n DeviceActivationSignatureArgs,\n DeviceActivationSignature\n> {\n return combineCodec(\n getDeviceActivationSignatureEncoder(),\n getDeviceActivationSignatureDecoder()\n );\n}\n\n// Data Enum Helpers.\nexport function deviceActivationSignature(\n kind: 'Ed25519',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Ed25519'\n>;\nexport function deviceActivationSignature(\n kind: 'Secp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'Secp256k1'\n>;\nexport function deviceActivationSignature(\n kind: 'EthSecp256k1',\n data: GetDiscriminatedUnionVariantContent<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n >['fields']\n): GetDiscriminatedUnionVariant<\n DeviceActivationSignatureArgs,\n '__kind',\n 'EthSecp256k1'\n>;\nexport function deviceActivationSignature<\n K extends DeviceActivationSignatureArgs['__kind'],\n Data,\n>(kind: K, data?: Data) {\n return Array.isArray(data)\n ? { __kind: kind, fields: data }\n : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isDeviceActivationSignature<\n K extends DeviceActivationSignature['__kind'],\n>(\n kind: K,\n value: DeviceActivationSignature\n): value is DeviceActivationSignature & { __kind: K } {\n return value.__kind === kind;\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/web3.js';\n\nexport enum DeviceSigningAlgorithm {\n Ed25519,\n Secp256k1,\n}\n\nexport type DeviceSigningAlgorithmArgs = DeviceSigningAlgorithm;\n\nexport function getDeviceSigningAlgorithmEncoder(): Encoder {\n return getEnumEncoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmDecoder(): Decoder {\n return getEnumDecoder(DeviceSigningAlgorithm);\n}\n\nexport function getDeviceSigningAlgorithmCodec(): Codec<\n DeviceSigningAlgorithmArgs,\n DeviceSigningAlgorithm\n> {\n return combineCodec(\n getDeviceSigningAlgorithmEncoder(),\n getDeviceSigningAlgorithmDecoder()\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/web3.js';\n\nexport enum Key {\n Uninitialized,\n ProgramDataAccount,\n}\n\nexport type KeyArgs = Key;\n\nexport function getKeyEncoder(): Encoder {\n return getEnumEncoder(Key);\n}\n\nexport function getKeyDecoder(): Decoder {\n return getEnumDecoder(Key);\n}\n\nexport function getKeyCodec(): Codec {\n return combineCodec(getKeyEncoder(), getKeyDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/web3.js';\n\nexport type ProgramData = { bump: number };\n\nexport type ProgramDataArgs = ProgramData;\n\nexport function getProgramDataEncoder(): Encoder {\n return getStructEncoder([['bump', getU8Encoder()]]);\n}\n\nexport function getProgramDataDecoder(): Decoder {\n return getStructDecoder([['bump', getU8Decoder()]]);\n}\n\nexport function getProgramDataCodec(): Codec {\n return combineCodec(getProgramDataEncoder(), getProgramDataDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\n/** DeserializationError: Error deserializing an account */\nexport const DEPHY_ID_ERROR__DESERIALIZATION_ERROR = 0x0; // 0\n/** SerializationError: Error serializing an account */\nexport const DEPHY_ID_ERROR__SERIALIZATION_ERROR = 0x1; // 1\n/** InvalidProgramOwner: Invalid program owner. This likely mean the provided account does not exist */\nexport const DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER = 0x2; // 2\n/** InvalidPda: Invalid PDA derivation */\nexport const DEPHY_ID_ERROR__INVALID_PDA = 0x3; // 3\n/** ExpectedEmptyAccount: Expected empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT = 0x4; // 4\n/** ExpectedNonEmptyAccount: Expected non empty account */\nexport const DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT = 0x5; // 5\n/** ExpectedSignerAccount: Expected signer account */\nexport const DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT = 0x6; // 6\n/** ExpectedWritableAccount: Expected writable account */\nexport const DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT = 0x7; // 7\n/** AccountMismatch: Account mismatch */\nexport const DEPHY_ID_ERROR__ACCOUNT_MISMATCH = 0x8; // 8\n/** InvalidAccountKey: Invalid account key */\nexport const DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY = 0x9; // 9\n/** NumericalOverflow: Numerical overflow */\nexport const DEPHY_ID_ERROR__NUMERICAL_OVERFLOW = 0xa; // 10\n/** MissingInstruction: Missing instruction */\nexport const DEPHY_ID_ERROR__MISSING_INSTRUCTION = 0xb; // 11\n/** SignatureMismatch: Signature mismatch */\nexport const DEPHY_ID_ERROR__SIGNATURE_MISMATCH = 0xc; // 12\n\nexport type DephyIdError =\n | typeof DEPHY_ID_ERROR__ACCOUNT_MISMATCH\n | typeof DEPHY_ID_ERROR__DESERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT\n | typeof DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT\n | typeof DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY\n | typeof DEPHY_ID_ERROR__INVALID_PDA\n | typeof DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER\n | typeof DEPHY_ID_ERROR__MISSING_INSTRUCTION\n | typeof DEPHY_ID_ERROR__NUMERICAL_OVERFLOW\n | typeof DEPHY_ID_ERROR__SERIALIZATION_ERROR\n | typeof DEPHY_ID_ERROR__SIGNATURE_MISMATCH;\n\nlet dephyIdErrorMessages: Record | undefined;\nif (__DEV__) {\n dephyIdErrorMessages = {\n [DEPHY_ID_ERROR__ACCOUNT_MISMATCH]: `Account mismatch`,\n [DEPHY_ID_ERROR__DESERIALIZATION_ERROR]: `Error deserializing an account`,\n [DEPHY_ID_ERROR__EXPECTED_EMPTY_ACCOUNT]: `Expected empty account`,\n [DEPHY_ID_ERROR__EXPECTED_NON_EMPTY_ACCOUNT]: `Expected non empty account`,\n [DEPHY_ID_ERROR__EXPECTED_SIGNER_ACCOUNT]: `Expected signer account`,\n [DEPHY_ID_ERROR__EXPECTED_WRITABLE_ACCOUNT]: `Expected writable account`,\n [DEPHY_ID_ERROR__INVALID_ACCOUNT_KEY]: `Invalid account key`,\n [DEPHY_ID_ERROR__INVALID_PDA]: `Invalid PDA derivation`,\n [DEPHY_ID_ERROR__INVALID_PROGRAM_OWNER]: `Invalid program owner. This likely mean the provided account does not exist`,\n [DEPHY_ID_ERROR__MISSING_INSTRUCTION]: `Missing instruction`,\n [DEPHY_ID_ERROR__NUMERICAL_OVERFLOW]: `Numerical overflow`,\n [DEPHY_ID_ERROR__SERIALIZATION_ERROR]: `Error serializing an account`,\n [DEPHY_ID_ERROR__SIGNATURE_MISMATCH]: `Signature mismatch`,\n };\n}\n\nexport function getDephyIdErrorMessage(code: DephyIdError): string {\n if (__DEV__) {\n return (dephyIdErrorMessages as Record)[code];\n }\n\n return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.';\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\nimport {\n getDeviceActivationSignatureDecoder,\n getDeviceActivationSignatureEncoder,\n type DeviceActivationSignature,\n type DeviceActivationSignatureArgs,\n} from '../types';\n\nexport type ActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends string | IAccountMeta = string,\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TAccountDeviceAssociatedToken extends string | IAccountMeta = string,\n TAccountOwner extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlyAccount\n : TAccountVendor,\n TAccountProductMint extends string\n ? ReadonlyAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? ReadonlyAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n TAccountDeviceAssociatedToken extends string\n ? WritableAccount\n : TAccountDeviceAssociatedToken,\n TAccountOwner extends string\n ? ReadonlyAccount\n : TAccountOwner,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ActivateDeviceInstructionData = {\n discriminator: number;\n signature: DeviceActivationSignature;\n timestamp: bigint;\n};\n\nexport type ActivateDeviceInstructionDataArgs = {\n signature: DeviceActivationSignatureArgs;\n timestamp: number | bigint;\n};\n\nexport function getActivateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['signature', getDeviceActivationSignatureEncoder()],\n ['timestamp', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 3 })\n );\n}\n\nexport function getActivateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['signature', getDeviceActivationSignatureDecoder()],\n ['timestamp', getU64Decoder()],\n ]);\n}\n\nexport function getActivateDeviceInstructionDataCodec(): Codec<\n ActivateDeviceInstructionDataArgs,\n ActivateDeviceInstructionData\n> {\n return combineCodec(\n getActivateDeviceInstructionDataEncoder(),\n getActivateDeviceInstructionDataDecoder()\n );\n}\n\nexport type ActivateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n TAccountDeviceAssociatedToken extends string = string,\n TAccountOwner extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: Address;\n /** The mint account for the product */\n productMint: Address;\n /** The associated token account for the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account for the device */\n deviceMint: Address;\n /** The associated token account for the device */\n deviceAssociatedToken: Address;\n /** The device's owner */\n owner: Address;\n signature: ActivateDeviceInstructionDataArgs['signature'];\n timestamp: ActivateDeviceInstructionDataArgs['timestamp'];\n};\n\nexport function getActivateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n TAccountDeviceAssociatedToken extends string,\n TAccountOwner extends string,\n>(\n input: ActivateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >\n): ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: false },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: false,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n deviceAssociatedToken: {\n value: input.deviceAssociatedToken ?? null,\n isWritable: true,\n },\n owner: { value: input.owner ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n getAccountMeta(accounts.deviceAssociatedToken),\n getAccountMeta(accounts.owner),\n ],\n programAddress,\n data: getActivateDeviceInstructionDataEncoder().encode(\n args as ActivateDeviceInstructionDataArgs\n ),\n } as ActivateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint,\n TAccountDeviceAssociatedToken,\n TAccountOwner\n >;\n\n return instruction;\n}\n\nexport type ParsedActivateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The account paying for the storage fees */\n payer: TAccountMetas[3];\n /** The vendor */\n vendor: TAccountMetas[4];\n /** The mint account for the product */\n productMint: TAccountMetas[5];\n /** The associated token account for the product */\n productAssociatedToken: TAccountMetas[6];\n /** The device */\n device: TAccountMetas[7];\n /** The mint account for the device */\n deviceMint: TAccountMetas[8];\n /** The associated token account for the device */\n deviceAssociatedToken: TAccountMetas[9];\n /** The device's owner */\n owner: TAccountMetas[10];\n };\n data: ActivateDeviceInstructionData;\n};\n\nexport function parseActivateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedActivateDeviceInstruction {\n if (instruction.accounts.length < 11) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n deviceAssociatedToken: getNextAccount(),\n owner: getNextAccount(),\n },\n data: getActivateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport { containsBytes, getU8Encoder, type Address } from '@solana/web3.js';\nimport {\n type ParsedActivateDeviceInstruction,\n type ParsedCreateDeviceInstruction,\n type ParsedCreateProductInstruction,\n type ParsedInitializeInstruction,\n} from '../instructions';\nimport { Key, getKeyEncoder } from '../types';\n\nexport const DEPHY_ID_PROGRAM_ADDRESS =\n 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1' as Address<'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1'>;\n\nexport enum DephyIdAccount {\n ProgramDataAccount,\n}\n\nexport function identifyDephyIdAccount(\n account: { data: Uint8Array } | Uint8Array\n): DephyIdAccount {\n const data = account instanceof Uint8Array ? account : account.data;\n if (containsBytes(data, getKeyEncoder().encode(Key.ProgramDataAccount), 0)) {\n return DephyIdAccount.ProgramDataAccount;\n }\n throw new Error(\n 'The provided account could not be identified as a dephyId account.'\n );\n}\n\nexport enum DephyIdInstruction {\n Initialize,\n CreateProduct,\n CreateDevice,\n ActivateDevice,\n}\n\nexport function identifyDephyIdInstruction(\n instruction: { data: Uint8Array } | Uint8Array\n): DephyIdInstruction {\n const data =\n instruction instanceof Uint8Array ? instruction : instruction.data;\n if (containsBytes(data, getU8Encoder().encode(0), 0)) {\n return DephyIdInstruction.Initialize;\n }\n if (containsBytes(data, getU8Encoder().encode(1), 0)) {\n return DephyIdInstruction.CreateProduct;\n }\n if (containsBytes(data, getU8Encoder().encode(2), 0)) {\n return DephyIdInstruction.CreateDevice;\n }\n if (containsBytes(data, getU8Encoder().encode(3), 0)) {\n return DephyIdInstruction.ActivateDevice;\n }\n throw new Error(\n 'The provided instruction could not be identified as a dephyId instruction.'\n );\n}\n\nexport type ParsedDephyIdInstruction<\n TProgram extends string = 'hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1',\n> =\n | ({\n instructionType: DephyIdInstruction.Initialize;\n } & ParsedInitializeInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateProduct;\n } & ParsedCreateProductInstruction)\n | ({\n instructionType: DephyIdInstruction.CreateDevice;\n } & ParsedCreateDeviceInstruction)\n | ({\n instructionType: DephyIdInstruction.ActivateDevice;\n } & ParsedActivateDeviceInstruction);\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n AccountRole,\n isProgramDerivedAddress,\n isTransactionSigner as web3JsIsTransactionSigner,\n type Address,\n type IAccountMeta,\n type IAccountSignerMeta,\n type ProgramDerivedAddress,\n type TransactionSigner,\n upgradeRoleToSigner,\n} from '@solana/web3.js';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome(value: T | null | undefined): T {\n if (value == null) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): Address {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0];\n }\n return value as Address;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): ProgramDerivedAddress {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null\n | undefined\n): TransactionSigner {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null =\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n | null,\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(\n programAddress: Address,\n optionalAccountStrategy: 'omitted' | 'programId'\n) {\n return (\n account: ResolvedAccount\n ): IAccountMeta | IAccountSignerMeta | undefined => {\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n return Object.freeze({\n address: programAddress,\n role: AccountRole.READONLY,\n });\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n return Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n };\n}\n\nexport function isTransactionSigner(\n value:\n | Address\n | ProgramDerivedAddress\n | TransactionSigner\n): value is TransactionSigner {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n web3JsIsTransactionSigner(value)\n );\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\nimport {\n getDeviceSigningAlgorithmDecoder,\n getDeviceSigningAlgorithmEncoder,\n type DeviceSigningAlgorithm,\n type DeviceSigningAlgorithmArgs,\n} from '../types';\n\nexport type CreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountAtaProgram extends\n | string\n | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TAccountProductAssociatedToken extends string | IAccountMeta = string,\n TAccountDevice extends string | IAccountMeta = string,\n TAccountDeviceMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountAtaProgram extends string\n ? ReadonlyAccount\n : TAccountAtaProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n TAccountProductAssociatedToken extends string\n ? WritableAccount\n : TAccountProductAssociatedToken,\n TAccountDevice extends string\n ? ReadonlyAccount\n : TAccountDevice,\n TAccountDeviceMint extends string\n ? WritableAccount\n : TAccountDeviceMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateDeviceInstructionData = {\n discriminator: number;\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithm;\n};\n\nexport type CreateDeviceInstructionDataArgs = {\n name: string;\n uri: string;\n additionalMetadata: Array;\n signingAlg: DeviceSigningAlgorithmArgs;\n};\n\nexport function getCreateDeviceInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmEncoder()],\n ]),\n (value) => ({ ...value, discriminator: 2 })\n );\n}\n\nexport function getCreateDeviceInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ['signingAlg', getDeviceSigningAlgorithmDecoder()],\n ]);\n}\n\nexport function getCreateDeviceInstructionDataCodec(): Codec<\n CreateDeviceInstructionDataArgs,\n CreateDeviceInstructionData\n> {\n return combineCodec(\n getCreateDeviceInstructionDataEncoder(),\n getCreateDeviceInstructionDataDecoder()\n );\n}\n\nexport type CreateDeviceInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountAtaProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n TAccountProductAssociatedToken extends string = string,\n TAccountDevice extends string = string,\n TAccountDeviceMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The associated token program */\n ataProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n /** The associated token account of the product */\n productAssociatedToken: Address;\n /** The device */\n device: Address;\n /** The mint account of the device */\n deviceMint: Address;\n name: CreateDeviceInstructionDataArgs['name'];\n uri: CreateDeviceInstructionDataArgs['uri'];\n additionalMetadata: CreateDeviceInstructionDataArgs['additionalMetadata'];\n signingAlg: CreateDeviceInstructionDataArgs['signingAlg'];\n};\n\nexport function getCreateDeviceInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountAtaProgram extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n TAccountProductAssociatedToken extends string,\n TAccountDevice extends string,\n TAccountDeviceMint extends string,\n>(\n input: CreateDeviceInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >\n): CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n ataProgram: { value: input.ataProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n productAssociatedToken: {\n value: input.productAssociatedToken ?? null,\n isWritable: true,\n },\n device: { value: input.device ?? null, isWritable: false },\n deviceMint: { value: input.deviceMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n if (!accounts.ataProgram.value) {\n accounts.ataProgram.value =\n 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' as Address<'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.ataProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n getAccountMeta(accounts.productAssociatedToken),\n getAccountMeta(accounts.device),\n getAccountMeta(accounts.deviceMint),\n ],\n programAddress,\n data: getCreateDeviceInstructionDataEncoder().encode(\n args as CreateDeviceInstructionDataArgs\n ),\n } as CreateDeviceInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountAtaProgram,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint,\n TAccountProductAssociatedToken,\n TAccountDevice,\n TAccountDeviceMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateDeviceInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The associated token program */\n ataProgram: TAccountMetas[2];\n /** The account paying for the storage fees */\n payer: TAccountMetas[3];\n /** The vendor */\n vendor: TAccountMetas[4];\n /** The mint account of the product */\n productMint: TAccountMetas[5];\n /** The associated token account of the product */\n productAssociatedToken: TAccountMetas[6];\n /** The device */\n device: TAccountMetas[7];\n /** The mint account of the device */\n deviceMint: TAccountMetas[8];\n };\n data: CreateDeviceInstructionData;\n};\n\nexport function parseCreateDeviceInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateDeviceInstruction {\n if (instruction.accounts.length < 9) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n ataProgram: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n productAssociatedToken: getNextAccount(),\n device: getNextAccount(),\n deviceMint: getNextAccount(),\n },\n data: getCreateDeviceInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\n\nexport type CreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountToken2022Program extends\n | string\n | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountVendor extends string | IAccountMeta = string,\n TAccountProductMint extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountToken2022Program extends string\n ? ReadonlyAccount\n : TAccountToken2022Program,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountVendor extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountVendor,\n TAccountProductMint extends string\n ? WritableAccount\n : TAccountProductMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateProductInstructionData = {\n discriminator: number;\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport type CreateProductInstructionDataArgs = {\n name: string;\n symbol: string;\n uri: string;\n additionalMetadata: Array;\n};\n\nexport function getCreateProductInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['name', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['symbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['uri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'additionalMetadata',\n getArrayEncoder(\n getTupleEncoder([\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ])\n ),\n ],\n ]),\n (value) => ({ ...value, discriminator: 1 })\n );\n}\n\nexport function getCreateProductInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['name', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['symbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['uri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n [\n 'additionalMetadata',\n getArrayDecoder(\n getTupleDecoder([\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder()),\n ])\n ),\n ],\n ]);\n}\n\nexport function getCreateProductInstructionDataCodec(): Codec<\n CreateProductInstructionDataArgs,\n CreateProductInstructionData\n> {\n return combineCodec(\n getCreateProductInstructionDataEncoder(),\n getCreateProductInstructionDataDecoder()\n );\n}\n\nexport type CreateProductInput<\n TAccountSystemProgram extends string = string,\n TAccountToken2022Program extends string = string,\n TAccountPayer extends string = string,\n TAccountVendor extends string = string,\n TAccountProductMint extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The SPL Token 2022 program */\n token2022Program?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The vendor */\n vendor: TransactionSigner;\n /** The mint account of the product */\n productMint: Address;\n name: CreateProductInstructionDataArgs['name'];\n symbol: CreateProductInstructionDataArgs['symbol'];\n uri: CreateProductInstructionDataArgs['uri'];\n additionalMetadata: CreateProductInstructionDataArgs['additionalMetadata'];\n};\n\nexport function getCreateProductInstruction<\n TAccountSystemProgram extends string,\n TAccountToken2022Program extends string,\n TAccountPayer extends string,\n TAccountVendor extends string,\n TAccountProductMint extends string,\n>(\n input: CreateProductInput<\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >\n): CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n token2022Program: {\n value: input.token2022Program ?? null,\n isWritable: false,\n },\n payer: { value: input.payer ?? null, isWritable: true },\n vendor: { value: input.vendor ?? null, isWritable: false },\n productMint: { value: input.productMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.token2022Program.value) {\n accounts.token2022Program.value =\n 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' as Address<'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.token2022Program),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.vendor),\n getAccountMeta(accounts.productMint),\n ],\n programAddress,\n data: getCreateProductInstructionDataEncoder().encode(\n args as CreateProductInstructionDataArgs\n ),\n } as CreateProductInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountToken2022Program,\n TAccountPayer,\n TAccountVendor,\n TAccountProductMint\n >;\n\n return instruction;\n}\n\nexport type ParsedCreateProductInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The SPL Token 2022 program */\n token2022Program: TAccountMetas[1];\n /** The account paying for the storage fees */\n payer: TAccountMetas[2];\n /** The vendor */\n vendor: TAccountMetas[3];\n /** The mint account of the product */\n productMint: TAccountMetas[4];\n };\n data: CreateProductInstructionData;\n};\n\nexport function parseCreateProductInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedCreateProductInstruction {\n if (instruction.accounts.length < 5) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n token2022Program: getNextAccount(),\n payer: getNextAccount(),\n vendor: getNextAccount(),\n productMint: getNextAccount(),\n },\n data: getCreateProductInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/kinobi-so/kinobi\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type IAccountMeta,\n type IAccountSignerMeta,\n type IInstruction,\n type IInstructionWithAccounts,\n type IInstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/web3.js';\nimport { DEPHY_ID_PROGRAM_ADDRESS } from '../programs';\nimport { getAccountMetaFactory, type ResolvedAccount } from '../shared';\n\nexport type InitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram extends\n | string\n | IAccountMeta = '11111111111111111111111111111111',\n TAccountPayer extends string | IAccountMeta = string,\n TAccountProgramData extends string | IAccountMeta = string,\n TAccountAuthority extends string | IAccountMeta = string,\n TRemainingAccounts extends readonly IAccountMeta[] = [],\n> = IInstruction &\n IInstructionWithData &\n IInstructionWithAccounts<\n [\n TAccountSystemProgram extends string\n ? ReadonlyAccount\n : TAccountSystemProgram,\n TAccountPayer extends string\n ? WritableSignerAccount &\n IAccountSignerMeta\n : TAccountPayer,\n TAccountProgramData extends string\n ? WritableAccount\n : TAccountProgramData,\n TAccountAuthority extends string\n ? ReadonlySignerAccount &\n IAccountSignerMeta\n : TAccountAuthority,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeInstructionData = { discriminator: number; bump: number };\n\nexport type InitializeInstructionDataArgs = { bump: number };\n\nexport function getInitializeInstructionDataEncoder(): Encoder {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['bump', getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 0 })\n );\n}\n\nexport function getInitializeInstructionDataDecoder(): Decoder {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['bump', getU8Decoder()],\n ]);\n}\n\nexport function getInitializeInstructionDataCodec(): Codec<\n InitializeInstructionDataArgs,\n InitializeInstructionData\n> {\n return combineCodec(\n getInitializeInstructionDataEncoder(),\n getInitializeInstructionDataDecoder()\n );\n}\n\nexport type InitializeInput<\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n TAccountProgramData extends string = string,\n TAccountAuthority extends string = string,\n> = {\n /** The system program */\n systemProgram?: Address;\n /** The account paying for the storage fees */\n payer: TransactionSigner;\n /** The program data account for the program */\n programData: Address;\n /** The authority account of the program */\n authority: TransactionSigner;\n bump: InitializeInstructionDataArgs['bump'];\n};\n\nexport function getInitializeInstruction<\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TAccountProgramData extends string,\n TAccountAuthority extends string,\n>(\n input: InitializeInput<\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >\n): InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n> {\n // Program address.\n const programAddress = DEPHY_ID_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n const instruction = {\n accounts: [\n getAccountMeta(accounts.systemProgram),\n getAccountMeta(accounts.payer),\n getAccountMeta(accounts.programData),\n getAccountMeta(accounts.authority),\n ],\n programAddress,\n data: getInitializeInstructionDataEncoder().encode(\n args as InitializeInstructionDataArgs\n ),\n } as InitializeInstruction<\n typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountSystemProgram,\n TAccountPayer,\n TAccountProgramData,\n TAccountAuthority\n >;\n\n return instruction;\n}\n\nexport type ParsedInitializeInstruction<\n TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS,\n TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],\n> = {\n programAddress: Address;\n accounts: {\n /** The system program */\n systemProgram: TAccountMetas[0];\n /** The account paying for the storage fees */\n payer: TAccountMetas[1];\n /** The program data account for the program */\n programData: TAccountMetas[2];\n /** The authority account of the program */\n authority: TAccountMetas[3];\n };\n data: InitializeInstructionData;\n};\n\nexport function parseInitializeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly IAccountMeta[],\n>(\n instruction: IInstruction &\n IInstructionWithAccounts &\n IInstructionWithData\n): ParsedInitializeInstruction {\n if (instruction.accounts.length < 4) {\n // TODO: Coded error.\n throw new Error('Not enough accounts');\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = instruction.accounts![accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n systemProgram: getNextAccount(),\n payer: getNextAccount(),\n programData: getNextAccount(),\n authority: getNextAccount(),\n },\n data: getInitializeInstructionDataDecoder().decode(instruction.data),\n };\n}\n"]} \ No newline at end of file diff --git a/clients/js/dist/types/generated/accounts/programDataAccount.d.ts b/clients/js/dist/types/generated/accounts/programDataAccount.d.ts index 0bab8be..2e1ceca 100644 --- a/clients/js/dist/types/generated/accounts/programDataAccount.d.ts +++ b/clients/js/dist/types/generated/accounts/programDataAccount.d.ts @@ -5,8 +5,8 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Account, Address, Codec, Decoder, EncodedAccount, Encoder, FetchAccountConfig, FetchAccountsConfig, MaybeAccount, MaybeEncodedAccount, fetchEncodedAccount, fetchEncodedAccounts } from '@solana/web3.js'; -import { Key, ProgramData, ProgramDataArgs } from '../types'; +import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount } from '@solana/web3.js'; +import { Key, type ProgramData, type ProgramDataArgs } from '../types'; export type ProgramDataAccount = { key: Key; authority: Address; diff --git a/clients/js/dist/types/generated/accounts/programDataAccount.d.ts.map b/clients/js/dist/types/generated/accounts/programDataAccount.d.ts.map index 539d01a..ed63bb6 100644 --- a/clients/js/dist/types/generated/accounts/programDataAccount.d.ts.map +++ b/clients/js/dist/types/generated/accounts/programDataAccount.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"programDataAccount.d.ts","sourceRoot":"","sources":["../../../../src/generated/accounts/programDataAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAC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AAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAI3C"} \ No newline at end of file +{"version":3,"file":"programDataAccount.d.ts","sourceRoot":"","sources":["../../../../src/generated/accounts/programDataAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,mBAAmB,EACnB,oBAAoB,EAMpB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,GAAG,EAKH,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,wBAAgB,4BAA4B,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAS9E;AAED,wBAAgB,4BAA4B,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAM1E;AAED,wBAAgB,0BAA0B,IAAI,KAAK,CACjD,sBAAsB,EACtB,kBAAkB,CACnB,CAKA;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EACvE,cAAc,EAAE,cAAc,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;AACzC,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EACvE,cAAc,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAC5C,YAAY,CAAC,kBAAkB,EAAE,Q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AO,CAAA;CAAO,GAC7D,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAItC;AAED,wBAAsB,qCAAqC,CACzD,GAAG,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAC9C,MAAM,GAAE,kBAAkB,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7D,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAI3C"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/instructions/activateDevice.d.ts b/clients/js/dist/types/generated/instructions/activateDevice.d.ts index 1b11c7f..2784c8b 100644 --- a/clients/js/dist/types/generated/instructions/activateDevice.d.ts +++ b/clients/js/dist/types/generated/instructions/activateDevice.d.ts @@ -5,14 +5,13 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, Codec, Decoder, Encoder, IAccountMeta, IAccountSignerMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData, ReadonlyAccount, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/web3.js'; +import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; -import { DeviceActivationSignature, DeviceActivationSignatureArgs } from '../types'; -export type ActivateDeviceInstruction = '11111111111111111111111111111111', TAccountToken2022Program extends string | IAccountMeta = string, TAccountAtaProgram extends string | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', TAccountInstructions extends string | IAccountMeta = string, TAccountPayer extends string | IAccountMeta = string, TAccountVendor extends string | IAccountMeta = string, TAccountProductMint extends string | IAccountMeta = string, TAccountProductAssociatedToken extends string | IAccountMeta = string, TAccountDevice extends string | IAccountMeta = string, TAccountDeviceMint extends string | IAccountMeta = string, TAccountDeviceAssociatedToken extends string | IAccountMeta = string, TAccountOwner extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = []> = IInstruction & IInstructionWithData & IInstructionWithAccounts<[ +import { type DeviceActivationSignature, type DeviceActivationSignatureArgs } from '../types'; +export type ActivateDeviceInstruction = '11111111111111111111111111111111', TAccountToken2022Program extends string | IAccountMeta = string, TAccountAtaProgram extends string | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', TAccountPayer extends string | IAccountMeta = string, TAccountVendor extends string | IAccountMeta = string, TAccountProductMint extends string | IAccountMeta = string, TAccountProductAssociatedToken extends string | IAccountMeta = string, TAccountDevice extends string | IAccountMeta = string, TAccountDeviceMint extends string | IAccountMeta = string, TAccountDeviceAssociatedToken extends string | IAccountMeta = string, TAccountOwner extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = []> = IInstruction & IInstructionWithData & IInstructionWithAccounts<[ TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountToken2022Program extends string ? ReadonlyAccount : TAccountToken2022Program, TAccountAtaProgram extends string ? ReadonlyAccount : TAccountAtaProgram, - TAccountInstructions extends string ? ReadonlyAccount : TAccountInstructions, TAccountPayer extends string ? WritableSignerAccount & IAccountSignerMeta : TAccountPayer, TAccountVendor extends string ? ReadonlyAccount : TAccountVendor, TAccountProductMint extends string ? ReadonlyAccount : TAccountProductMint, @@ -35,15 +34,13 @@ export type ActivateDeviceInstructionDataArgs = { export declare function getActivateDeviceInstructionDataEncoder(): Encoder; export declare function getActivateDeviceInstructionDataDecoder(): Decoder; export declare function getActivateDeviceInstructionDataCodec(): Codec; -export type ActivateDeviceInput = { +export type ActivateDeviceInput = { /** The system program */ systemProgram?: Address; /** The SPL Token 2022 program */ token2022Program: Address; /** The associated token program */ ataProgram?: Address; - /** The instructions sysvar */ - instructions: Address; /** The account paying for the storage fees */ payer: TransactionSigner; /** The vendor */ @@ -63,7 +60,7 @@ export type ActivateDeviceInput(input: ActivateDeviceInput): ActivateDeviceInstruction; +export declare function getActivateDeviceInstruction(input: ActivateDeviceInput): ActivateDeviceInstruction; export type ParsedActivateDeviceInstruction = { programAddress: Address; accounts: { @@ -73,24 +70,22 @@ export type ParsedActivateDeviceInstruction = '11111111111111111111111111111111', TAccountToken2022Program extends string | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TAccountAtaProgram extends string | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', TAccountPayer extends string | IAccountMeta = string, TAccountVendor extends string | IAccountMeta = string, TAccountProductMint extends string | IAccountMeta = string, TAccountProductAssociatedToken extends string | IAccountMeta = string, TAccountDevice extends string | IAccountMeta = string, TAccountDeviceMint extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = []> = IInstruction & IInstructionWithData & IInstructionWithAccounts<[ TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, TAccountToken2022Program extends string ? ReadonlyAccount : TAccountToken2022Program, diff --git a/clients/js/dist/types/generated/instructions/createDevice.d.ts.map b/clients/js/dist/types/generated/instructions/createDevice.d.ts.map index 37df987..f8987a2 100644 --- a/clients/js/dist/types/generated/instructions/createDevice.d.ts.map +++ b/clients/js/dist/types/generated/instructions/createDevice.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"createDevice.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/createDevice.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EAiBtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,OA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AC;CACnC,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,YAAY,EAAE,EAE7C,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GACjC,wBAAwB,CAAC,aAAa,CAAC,GACvC,oBAAoB,CAAC,UAAU,CAAC,GACjC,6BAA6B,CAAC,QAAQ,EAAE,aAAa,CAAC,CA0BxD"} \ No newline at end of file +{"version":3,"file":"createDevice.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/createDevice.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAiBL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,MAAM,GAAG,OAAO,wBAAwB,EACzD,qBAAqB,SACjB,MAAM,GACN,YAAY,CAAC,MAAM,CAAC,GAAG,kCAAkC,EAC7D,wBAAwB,SACpB,MAAM,GACN,YAAY,CAAC,MAAM,CAAC,GAAG,6CAA6C,EACxE,kBAAkB,SACd,MAAM,GACN,YAAY,CAAC,MAAM,CAAC,GAAG,8CAA8C,EACzE,aAAa,SAAS,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,EAC5D,cAAc,SAAS,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,EA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AAO,wBAAwB,EACzD,aAAa,SAAS,SAAS,YAAY,EAAE,GAAG,SAAS,YAAY,EAAE,IACrE;IACF,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,EAAE;QACR,yBAAyB;QACzB,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,iCAAiC;QACjC,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACnC,mCAAmC;QACnC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC7B,8CAA8C;QAC9C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACxB,iBAAiB;QACjB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACzB,sCAAsC;QACtC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,kDAAkD;QAClD,sBAAsB,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACzC,iBAAiB;QACjB,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACzB,qCAAqC;QACrC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KAC9B,CAAC;IACF,IAAI,EAAE,2BAA2B,CAAC;CACnC,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,YAAY,EAAE,EAE7C,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GACjC,wBAAwB,CAAC,aAAa,CAAC,GACvC,oBAAoB,CAAC,UAAU,CAAC,GACjC,6BAA6B,CAAC,QAAQ,EAAE,aAAa,CAAC,CA0BxD"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/instructions/createProduct.d.ts b/clients/js/dist/types/generated/instructions/createProduct.d.ts index 3391876..28ac3df 100644 --- a/clients/js/dist/types/generated/instructions/createProduct.d.ts +++ b/clients/js/dist/types/generated/instructions/createProduct.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, Codec, Decoder, Encoder, IAccountMeta, IAccountSignerMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData, ReadonlyAccount, ReadonlySignerAccount, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/web3.js'; +import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; export type CreateProductInstruction = '11111111111111111111111111111111', TAccountToken2022Program extends string | IAccountMeta = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', TAccountPayer extends string | IAccountMeta = string, TAccountVendor extends string | IAccountMeta = string, TAccountProductMint extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = []> = IInstruction & IInstructionWithData & IInstructionWithAccounts<[ TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, diff --git a/clients/js/dist/types/generated/instructions/createProduct.d.ts.map b/clients/js/dist/types/generated/instructions/createProduct.d.ts.map index 5a79df6..501d65d 100644 --- a/clients/js/dist/types/generated/instructions/createProduct.d.ts.map +++ b/clients/js/dist/types/generated/instructions/createProduct.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"createProduct.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/createProduct.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EAiBtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM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AM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACzB,sCAAsC;QACtC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KAC/B,CAAC;IACF,IAAI,EAAE,4BAA4B,CAAC;CACpC,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,YAAY,EAAE,EAE7C,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GACjC,wBAAwB,CAAC,aAAa,CAAC,GACvC,oBAAoB,CAAC,UAAU,CAAC,GACjC,8BAA8B,CAAC,QAAQ,EAAE,aAAa,CAAC,CAsBzD"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/instructions/initialize.d.ts b/clients/js/dist/types/generated/instructions/initialize.d.ts index 36185fd..0c54ec6 100644 --- a/clients/js/dist/types/generated/instructions/initialize.d.ts +++ b/clients/js/dist/types/generated/instructions/initialize.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, Codec, Decoder, Encoder, IAccountMeta, IAccountSignerMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData, ReadonlyAccount, ReadonlySignerAccount, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/web3.js'; +import { type Address, type Codec, type Decoder, type Encoder, type IAccountMeta, type IAccountSignerMeta, type IInstruction, type IInstructionWithAccounts, type IInstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type TransactionSigner, type WritableAccount, type WritableSignerAccount } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; export type InitializeInstruction = '11111111111111111111111111111111', TAccountPayer extends string | IAccountMeta = string, TAccountProgramData extends string | IAccountMeta = string, TAccountAuthority extends string | IAccountMeta = string, TRemainingAccounts extends readonly IAccountMeta[] = []> = IInstruction & IInstructionWithData & IInstructionWithAccounts<[ TAccountSystemProgram extends string ? ReadonlyAccount : TAccountSystemProgram, diff --git a/clients/js/dist/types/generated/instructions/initialize.d.ts.map b/clients/js/dist/types/generated/instructions/initialize.d.ts.map index c82db18..d9f772c 100644 --- a/clients/js/dist/types/generated/instructions/initialize.d.ts.map +++ b/clients/js/dist/types/generated/instructions/initialize.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EAOtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAGvD,MAAM,MAAM,qBAAqB,CAC/B,QAAQ,SAAS,MAAM,GAAG,OAAO,wBAAwB,EACzD,qBAAqB,SACjB,MAAM,GACN,YAAY,CAAC,MAAM,CAAC,GAAG,kCAAkC,EAC7D,aAAa,SAAS,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,EAC5D,mBAAmB,SAAS,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,EAClE,iBAAiB,SAAS,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM,EAChE,kBAAkB,SAAS,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAC7D,YAAY,CAAC,QAAQ,CAAC,GACxB,oBAAoB,CAAC,UAAU,CAAC,GAChC,wBAAwB,CACtB;IACE,qBAAqB,SAAS,MAAM,GAChC,eAAe,CAAC,qBAAqB,CAAC,GACtC,qBAAqB;IACzB,aAAa,SAAS,MAAM,GACxB,qBAAqB,CAAC,aAAa,CAAC,GAClC,kBAAkB,CAAC,aAAa,CAAC,GACnC,aAAa;IACjB,mBAAmB,SAAS,MAAM,GAC9B,eAAe,C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E,eAAe,CACpB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,CAClB,GACA,qBAAqB,CACtB,OAAO,wBAAwB,EAC/B,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,CAClB,CA8CA;AAED,MAAM,MAAM,2BAA2B,CACrC,QAAQ,SAAS,MAAM,GAAG,OAAO,wBAAwB,EACzD,aAAa,SAAS,SAAS,YAAY,EAAE,GAAG,SAAS,YAAY,EAAE,IACrE;IACF,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,QAAQ,EAAE;QACR,yBAAyB;QACzB,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,8CAA8C;QAC9C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACxB,+CAA+C;QAC/C,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,2CAA2C;QAC3C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KAC7B,CAAC;IACF,IAAI,EAAE,yBAAyB,CAAC;CACjC,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,YAAY,EAAE,EAE7C,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GACjC,wBAAwB,CAAC,aAAa,CAAC,GACvC,oBAAoB,CAAC,UAAU,CAAC,GACjC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,CAAC,CAqBtD"} \ No newline at end of file +{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/generated/instructions/initialize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KA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AAC,CAAC;IAClC,QAAQ,EAAE;QACR,yBAAyB;QACzB,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAChC,8CAA8C;QAC9C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QACxB,+CAA+C;QAC/C,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;QAC9B,2CAA2C;QAC3C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;KAC7B,CAAC;IACF,IAAI,EAAE,yBAAyB,CAAC;CACjC,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,QAAQ,SAAS,MAAM,EACvB,aAAa,SAAS,SAAS,YAAY,EAAE,EAE7C,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GACjC,wBAAwB,CAAC,aAAa,CAAC,GACvC,oBAAoB,CAAC,UAAU,CAAC,GACjC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,CAAC,CAqBtD"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/pdas/deviceMint.d.ts b/clients/js/dist/types/generated/pdas/deviceMint.d.ts index 297e369..59e38d5 100644 --- a/clients/js/dist/types/generated/pdas/deviceMint.d.ts +++ b/clients/js/dist/types/generated/pdas/deviceMint.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, ProgramDerivedAddress } from '@solana/web3.js'; +import { type Address, type ProgramDerivedAddress } from '@solana/web3.js'; export type DeviceMintSeeds = { productMintPubkey: Address; devicePubkey: Address; diff --git a/clients/js/dist/types/generated/pdas/deviceMint.d.ts.map b/clients/js/dist/types/generated/pdas/deviceMint.d.ts.map index f0d8ed0..76ce3d3 100644 --- a/clients/js/dist/types/generated/pdas/deviceMint.d.ts.map +++ b/clients/js/dist/types/generated/pdas/deviceMint.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"deviceMint.d.ts","sourceRoot":"","sources":["../../../../src/generated/pdas/deviceMint.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,qBAAqB,EAItB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAE3B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,eAAe,EACtB,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAYhC"} \ No newline at end of file +{"version":3,"file":"deviceMint.d.ts","sourceRoot":"","sources":["../../../../src/generated/pdas/deviceMint.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAE3B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,eAAe,EACtB,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAYhC"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/pdas/productMint.d.ts b/clients/js/dist/types/generated/pdas/productMint.d.ts index 97b0f40..8621ec8 100644 --- a/clients/js/dist/types/generated/pdas/productMint.d.ts +++ b/clients/js/dist/types/generated/pdas/productMint.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, ProgramDerivedAddress } from '@solana/web3.js'; +import { type Address, type ProgramDerivedAddress } from '@solana/web3.js'; export type ProductMintSeeds = { vendorPubkey: Address; productName: string; diff --git a/clients/js/dist/types/generated/pdas/productMint.d.ts.map b/clients/js/dist/types/generated/pdas/productMint.d.ts.map index 14495c3..722611f 100644 --- a/clients/js/dist/types/generated/pdas/productMint.d.ts.map +++ b/clients/js/dist/types/generated/pdas/productMint.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"productMint.d.ts","sourceRoot":"","sources":["../../../../src/generated/pdas/productMint.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,qBAAqB,EAItB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,OAAO,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,gBAAgB,EACvB,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAYhC"} \ No newline at end of file +{"version":3,"file":"productMint.d.ts","sourceRoot":"","sources":["../../../../src/generated/pdas/productMint.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,OAAO,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,gBAAgB,EACvB,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAYhC"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/pdas/programDataAccount.d.ts b/clients/js/dist/types/generated/pdas/programDataAccount.d.ts index dab249c..0887408 100644 --- a/clients/js/dist/types/generated/pdas/programDataAccount.d.ts +++ b/clients/js/dist/types/generated/pdas/programDataAccount.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, ProgramDerivedAddress } from '@solana/web3.js'; +import { type Address, type ProgramDerivedAddress } from '@solana/web3.js'; export declare function findProgramDataAccountPda(config?: { programAddress?: Address | undefined; }): Promise; diff --git a/clients/js/dist/types/generated/pdas/programDataAccount.d.ts.map b/clients/js/dist/types/generated/pdas/programDataAccount.d.ts.map index 696bb2c..14e8eaa 100644 --- a/clients/js/dist/types/generated/pdas/programDataAccount.d.ts.map +++ b/clients/js/dist/types/generated/pdas/programDataAccount.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"programDataAccount.d.ts","sourceRoot":"","sources":["../../../../src/generated/pdas/programDataAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,qBAAqB,EAGtB,MAAM,iBAAiB,CAAC;AAEzB,wBAAsB,yBAAyB,CAC7C,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAQhC"} \ No newline at end of file +{"version":3,"file":"programDataAccount.d.ts","sourceRoot":"","sources":["../../../../src/generated/pdas/programDataAccount.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,wBAAsB,yBAAyB,CAC7C,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAQhC"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/programs/dephyId.d.ts b/clients/js/dist/types/generated/programs/dephyId.d.ts index aaab370..44551d0 100644 --- a/clients/js/dist/types/generated/programs/dephyId.d.ts +++ b/clients/js/dist/types/generated/programs/dephyId.d.ts @@ -5,8 +5,8 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address } from '@solana/web3.js'; -import { ParsedActivateDeviceInstruction, ParsedCreateDeviceInstruction, ParsedCreateProductInstruction, ParsedInitializeInstruction } from '../instructions'; +import { type Address } from '@solana/web3.js'; +import { type ParsedActivateDeviceInstruction, type ParsedCreateDeviceInstruction, type ParsedCreateProductInstruction, type ParsedInitializeInstruction } from '../instructions'; export declare const DEPHY_ID_PROGRAM_ADDRESS: Address<"hdMghjD73uASxgJXi6e1mGPsXqnADMsrqB1bveqABP1">; export declare enum DephyIdAccount { ProgramDataAccount = 0 diff --git a/clients/js/dist/types/generated/programs/dephyId.d.ts.map b/clients/js/dist/types/generated/programs/dephyId.d.ts.map index a838894..0673772 100644 --- a/clients/js/dist/types/generated/programs/dephyId.d.ts.map +++ b/clients/js/dist/types/generated/programs/dephyId.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"dephyId.d.ts","sourceRoot":"","sources":["../../../../src/generated/programs/dephyId.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAA+B,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,wBAAwB,wDACoE,CAAC;AAE1G,oBAAY,cAAc;IACxB,kBAAkB,IAAA;CACnB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,GACzC,cAAc,CAQhB;AAED,oBAAY,kBAAkB;IAC5B,UAAU,IAAA;IACV,aAAa,IAAA;IACb,YAAY,IAAA;IACZ,cAAc,IAAA;CACf;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,GAC7C,kBAAkB,CAkBpB;AAED,MAAM,MAAM,wBAAwB,CAClC,QAAQ,SAAS,MAAM,GAAG,6CAA6C,IAErE,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,UAAU,CAAC;CAChD,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC,GAC1C,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,aAAa,CAAC;CACnD,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC,GAC7C,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,YAAY,CAAC;CAClD,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC,GAC5C,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,cAAc,CAAC;CACpD,GAAG,+BAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"dephyId.d.ts","sourceRoot":"","sources":["../../../../src/generated/programs/dephyId.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EACjC,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,wBAAwB,wDACoE,CAAC;AAE1G,oBAAY,cAAc;IACxB,kBAAkB,IAAA;CACnB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,GACzC,cAAc,CAQhB;AAED,oBAAY,kBAAkB;IAC5B,UAAU,IAAA;IACV,aAAa,IAAA;IACb,YAAY,IAAA;IACZ,cAAc,IAAA;CACf;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,GAC7C,kBAAkB,CAkBpB;AAED,MAAM,MAAM,wBAAwB,CAClC,QAAQ,SAAS,MAAM,GAAG,6CAA6C,IAErE,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,UAAU,CAAC;CAChD,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC,GAC1C,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,aAAa,CAAC;CACnD,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC,GAC7C,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,YAAY,CAAC;CAClD,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC,GAC5C,CAAC;IACC,eAAe,EAAE,kBAAkB,CAAC,cAAc,CAAC;CACpD,GAAG,+BAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/shared/index.d.ts b/clients/js/dist/types/generated/shared/index.d.ts index 1a7bf58..e85d805 100644 --- a/clients/js/dist/types/generated/shared/index.d.ts +++ b/clients/js/dist/types/generated/shared/index.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Address, IAccountMeta, IAccountSignerMeta, ProgramDerivedAddress, TransactionSigner } from '@solana/web3.js'; +import { type Address, type IAccountMeta, type IAccountSignerMeta, type ProgramDerivedAddress, type TransactionSigner } from '@solana/web3.js'; /** * Asserts that the given value is not null or undefined. * @internal diff --git a/clients/js/dist/types/generated/shared/index.d.ts.map b/clients/js/dist/types/generated/shared/index.d.ts.map index fa58fa3..7c1463a 100644 --- a/clients/js/dist/types/generated/shared/index.d.ts.map +++ b/clients/js/dist/types/generated/shared/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAIlB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,CAK5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACrD,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC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SAAS,MAAM,GAAG,MAAM,EAClE,KAAK,EACD,OAAO,CAAC,QAAQ,CAAC,GACjB,qBAAqB,CAAC,QAAQ,CAAC,GAC/B,iBAAiB,CAAC,QAAQ,CAAC,GAC9B,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAOtC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,CAK5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACrD,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,CAAC,CAAC,CAWZ;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACnE,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,SAAS,GACZ,qBAAqB,CAAC,CAAC,CAAC,CAK1B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC/D,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,SAAS,GACZ,iBAAiB,CAAC,CAAC,CAAC,CAKtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,CAAC,SACG,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,IACN;IACF,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,OAAO,EACvB,uBAAuB,EAAE,SAAS,GAAG,WAAW,aAGrC,eAAe,KACvB,YAAY,GAAG,kBAAkB,GAAG,SAAS,CAoBjD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClE,KAAK,EACD,OAAO,CAAC,QAAQ,CAAC,GACjB,qBAAqB,CAAC,QAAQ,CAAC,GAC/B,iBAAiB,CAAC,QAAQ,CAAC,GAC9B,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAOtC"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts b/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts index afe4c37..0f83172 100644 --- a/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts +++ b/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Codec, Decoder, Encoder, GetDiscriminatedUnionVariant, GetDiscriminatedUnionVariantContent, ReadonlyUint8Array } from '@solana/web3.js'; +import { type Codec, type Decoder, type Encoder, type GetDiscriminatedUnionVariant, type GetDiscriminatedUnionVariantContent, type ReadonlyUint8Array } from '@solana/web3.js'; export type DeviceActivationSignature = { __kind: 'Ed25519'; fields: readonly [ReadonlyUint8Array]; diff --git a/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts.map b/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts.map index 04249ac..be18657 100644 --- a/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts.map +++ b/clients/js/dist/types/generated/types/deviceActivationSignature.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"deviceActivationSignature.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/deviceActivationSignature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,4BAA4B,EAC5B,mCAAmC,EACnC,kBAAkB,EAcnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,yBAAyB,GACjC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAA;CAAE,GAC5D;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;CAAE,GACtE;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEtE,wBAAgB,mCAAmC,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAiC5F;AAED,wBAAgB,mCAAmC,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAiCxF;AAED,wBAAgB,iCAAiC,IAAI,KAAK,CACxD,6BAA6B,EAC7B,yBAAyB,CAC1B,CAKA;AAGD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,mCAAmC,CACvC,6BAA6B,EAC7B,QAAQ,EACR,SAAS,CACV,CAAC,QAAQ,CAAC,GACV,4BAA4B,CAC7B,6BAA6B,EAC7B,QAAQ,EACR,SAAS,CACV,CAAC;AACF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mCAAmC,CACvC,6BAA6B,EAC7B,QAAQ,EACR,WAAW,CACZ,CAAC,QAAQ,CAAC,GACV,4BAA4B,CAC7B,6BAA6B,EAC7B,QAAQ,EACR,WAAW,CACZ,CAAC;AACF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,mCAAmC,CACvC,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACf,CAAC,QAAQ,CAAC,GACV,4BAA4B,CAC7B,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACf,CAAC;AAUF,wBAAgB,2BAA2B,CACzC,CAAC,SAAS,yBAAyB,CAAC,QAAQ,CAAC,EAE7C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,yBAAyB,GAC/B,KAAK,IAAI,yBAAyB,GAAG;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAEpD"} \ No newline at end of file +{"version":3,"file":"deviceActivationSignature.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/deviceActivationSignature.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAcL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,4BAA4B,EACjC,KAAK,mCAAmC,EACxC,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,yBAAyB,GACjC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAA;CAAE,GAC5D;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;CAAE,GACtE;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEtE,wBAAgB,mCAAmC,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAiC5F;AAED,wBAAgB,mCAAmC,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAiCxF;AAED,wBAAgB,iCAAiC,IAAI,KAAK,CACxD,6BAA6B,EAC7B,yBAAyB,CAC1B,CAKA;AAGD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,mCAAmC,CACvC,6BAA6B,EAC7B,QAAQ,EACR,SAAS,CACV,CAAC,QAAQ,CAAC,GACV,4BAA4B,CAC7B,6BAA6B,EAC7B,QAAQ,EACR,SAAS,CACV,CAAC;AACF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,mCAAmC,CACvC,6BAA6B,EAC7B,QAAQ,EACR,WAAW,CACZ,CAAC,QAAQ,CAAC,GACV,4BAA4B,CAC7B,6BAA6B,EAC7B,QAAQ,EACR,WAAW,CACZ,CAAC;AACF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,mCAAmC,CACvC,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACf,CAAC,QAAQ,CAAC,GACV,4BAA4B,CAC7B,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACf,CAAC;AAUF,wBAAgB,2BAA2B,CACzC,CAAC,SAAS,yBAAyB,CAAC,QAAQ,CAAC,EAE7C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,yBAAyB,GAC/B,KAAK,IAAI,yBAAyB,GAAG;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAEpD"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts b/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts index 29b0fbc..e0219ad 100644 --- a/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts +++ b/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Codec, Decoder, Encoder } from '@solana/web3.js'; +import { type Codec, type Decoder, type Encoder } from '@solana/web3.js'; export declare enum DeviceSigningAlgorithm { Ed25519 = 0, Secp256k1 = 1 diff --git a/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts.map b/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts.map index 6c1e276..0131ef4 100644 --- a/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts.map +++ b/clients/js/dist/types/generated/types/deviceSigningAlgorithm.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"deviceSigningAlgorithm.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/deviceSigningAlgorithm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EAIR,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,sBAAsB;IAChC,OAAO,IAAA;IACP,SAAS,IAAA;CACV;AAED,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEhE,wBAAgB,gCAAgC,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAEtF;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAElF;AAED,wBAAgB,8BAA8B,IAAI,KAAK,CACrD,0BAA0B,EAC1B,sBAAsB,CACvB,CAKA"} \ No newline at end of file +{"version":3,"file":"deviceSigningAlgorithm.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/deviceSigningAlgorithm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,sBAAsB;IAChC,OAAO,IAAA;IACP,SAAS,IAAA;CACV;AAED,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEhE,wBAAgB,gCAAgC,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAEtF;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAElF;AAED,wBAAgB,8BAA8B,IAAI,KAAK,CACrD,0BAA0B,EAC1B,sBAAsB,CACvB,CAKA"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/types/key.d.ts b/clients/js/dist/types/generated/types/key.d.ts index 7db36e7..c629b68 100644 --- a/clients/js/dist/types/generated/types/key.d.ts +++ b/clients/js/dist/types/generated/types/key.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Codec, Decoder, Encoder } from '@solana/web3.js'; +import { type Codec, type Decoder, type Encoder } from '@solana/web3.js'; export declare enum Key { Uninitialized = 0, ProgramDataAccount = 1 diff --git a/clients/js/dist/types/generated/types/key.d.ts.map b/clients/js/dist/types/generated/types/key.d.ts.map index aeabfb6..da6a80d 100644 --- a/clients/js/dist/types/generated/types/key.d.ts.map +++ b/clients/js/dist/types/generated/types/key.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/key.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EAIR,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,GAAG;IACb,aAAa,IAAA;IACb,kBAAkB,IAAA;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,wBAAgB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAEhD;AAED,wBAAgB,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAE5C;AAED,wBAAgB,WAAW,IAAI,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAEjD"} \ No newline at end of file +{"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/key.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,oBAAY,GAAG;IACb,aAAa,IAAA;IACb,kBAAkB,IAAA;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAE1B,wBAAgB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAEhD;AAED,wBAAgB,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAE5C;AAED,wBAAgB,WAAW,IAAI,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAEjD"} \ No newline at end of file diff --git a/clients/js/dist/types/generated/types/programData.d.ts b/clients/js/dist/types/generated/types/programData.d.ts index f115870..68ed1fe 100644 --- a/clients/js/dist/types/generated/types/programData.d.ts +++ b/clients/js/dist/types/generated/types/programData.d.ts @@ -5,7 +5,7 @@ * * @see https://github.com/kinobi-so/kinobi */ -import { Codec, Decoder, Encoder } from '@solana/web3.js'; +import { type Codec, type Decoder, type Encoder } from '@solana/web3.js'; export type ProgramData = { bump: number; }; diff --git a/clients/js/dist/types/generated/types/programData.d.ts.map b/clients/js/dist/types/generated/types/programData.d.ts.map index afcdab7..9a99344 100644 --- a/clients/js/dist/types/generated/types/programData.d.ts.map +++ b/clients/js/dist/types/generated/types/programData.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"programData.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/programData.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EAMR,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,eAAe,CAAC,CAEhE;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,WAAW,CAAC,CAE5D;AAED,wBAAgB,mBAAmB,IAAI,KAAK,CAAC,eAAe,EAAE,WAAW,CAAC,CAEzE"} \ No newline at end of file +{"version":3,"file":"programData.d.ts","sourceRoot":"","sources":["../../../../src/generated/types/programData.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAML,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,eAAe,CAAC,CAEhE;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,WAAW,CAAC,CAE5D;AAED,wBAAgB,mBAAmB,IAAI,KAAK,CAAC,eAAe,EAAE,WAAW,CAAC,CAEzE"} \ No newline at end of file diff --git a/clients/js/src/generated/accounts/programDataAccount.ts b/clients/js/src/generated/accounts/programDataAccount.ts index 6b0a4b9..c848282 100644 --- a/clients/js/src/generated/accounts/programDataAccount.ts +++ b/clients/js/src/generated/accounts/programDataAccount.ts @@ -7,16 +7,6 @@ */ import { - Account, - Address, - Codec, - Decoder, - EncodedAccount, - Encoder, - FetchAccountConfig, - FetchAccountsConfig, - MaybeAccount, - MaybeEncodedAccount, assertAccountExists, assertAccountsExist, combineCodec, @@ -28,16 +18,26 @@ import { getStructDecoder, getStructEncoder, transformEncoder, + type Account, + type Address, + type Codec, + type Decoder, + type EncodedAccount, + type Encoder, + type FetchAccountConfig, + type FetchAccountsConfig, + type MaybeAccount, + type MaybeEncodedAccount, } from '@solana/web3.js'; import { findProgramDataAccountPda } from '../pdas'; import { Key, - ProgramData, - ProgramDataArgs, getKeyDecoder, getKeyEncoder, getProgramDataDecoder, getProgramDataEncoder, + type ProgramData, + type ProgramDataArgs, } from '../types'; export type ProgramDataAccount = { diff --git a/clients/js/src/generated/instructions/activateDevice.ts b/clients/js/src/generated/instructions/activateDevice.ts index 174a3e6..d454655 100644 --- a/clients/js/src/generated/instructions/activateDevice.ts +++ b/clients/js/src/generated/instructions/activateDevice.ts @@ -7,19 +7,6 @@ */ import { - Address, - Codec, - Decoder, - Encoder, - IAccountMeta, - IAccountSignerMeta, - IInstruction, - IInstructionWithAccounts, - IInstructionWithData, - ReadonlyAccount, - TransactionSigner, - WritableAccount, - WritableSignerAccount, combineCodec, getStructDecoder, getStructEncoder, @@ -28,14 +15,27 @@ import { getU8Decoder, getU8Encoder, transformEncoder, + type Address, + type Codec, + type Decoder, + type Encoder, + type IAccountMeta, + type IAccountSignerMeta, + type IInstruction, + type IInstructionWithAccounts, + type IInstructionWithData, + type ReadonlyAccount, + type TransactionSigner, + type WritableAccount, + type WritableSignerAccount, } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; -import { ResolvedAccount, getAccountMetaFactory } from '../shared'; +import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; import { - DeviceActivationSignature, - DeviceActivationSignatureArgs, getDeviceActivationSignatureDecoder, getDeviceActivationSignatureEncoder, + type DeviceActivationSignature, + type DeviceActivationSignatureArgs, } from '../types'; export type ActivateDeviceInstruction< @@ -47,7 +47,6 @@ export type ActivateDeviceInstruction< TAccountAtaProgram extends | string | IAccountMeta = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', - TAccountInstructions extends string | IAccountMeta = string, TAccountPayer extends string | IAccountMeta = string, TAccountVendor extends string | IAccountMeta = string, TAccountProductMint extends string | IAccountMeta = string, @@ -70,9 +69,6 @@ export type ActivateDeviceInstruction< TAccountAtaProgram extends string ? ReadonlyAccount : TAccountAtaProgram, - TAccountInstructions extends string - ? ReadonlyAccount - : TAccountInstructions, TAccountPayer extends string ? WritableSignerAccount & IAccountSignerMeta @@ -146,7 +142,6 @@ export type ActivateDeviceInput< TAccountSystemProgram extends string = string, TAccountToken2022Program extends string = string, TAccountAtaProgram extends string = string, - TAccountInstructions extends string = string, TAccountPayer extends string = string, TAccountVendor extends string = string, TAccountProductMint extends string = string, @@ -162,8 +157,6 @@ export type ActivateDeviceInput< token2022Program: Address; /** The associated token program */ ataProgram?: Address; - /** The instructions sysvar */ - instructions: Address; /** The account paying for the storage fees */ payer: TransactionSigner; /** The vendor */ @@ -188,7 +181,6 @@ export function getActivateDeviceInstruction< TAccountSystemProgram extends string, TAccountToken2022Program extends string, TAccountAtaProgram extends string, - TAccountInstructions extends string, TAccountPayer extends string, TAccountVendor extends string, TAccountProductMint extends string, @@ -202,7 +194,6 @@ export function getActivateDeviceInstruction< TAccountSystemProgram, TAccountToken2022Program, TAccountAtaProgram, - TAccountInstructions, TAccountPayer, TAccountVendor, TAccountProductMint, @@ -217,7 +208,6 @@ export function getActivateDeviceInstruction< TAccountSystemProgram, TAccountToken2022Program, TAccountAtaProgram, - TAccountInstructions, TAccountPayer, TAccountVendor, TAccountProductMint, @@ -238,7 +228,6 @@ export function getActivateDeviceInstruction< isWritable: false, }, ataProgram: { value: input.ataProgram ?? null, isWritable: false }, - instructions: { value: input.instructions ?? null, isWritable: false }, payer: { value: input.payer ?? null, isWritable: true }, vendor: { value: input.vendor ?? null, isWritable: false }, productMint: { value: input.productMint ?? null, isWritable: false }, @@ -278,7 +267,6 @@ export function getActivateDeviceInstruction< getAccountMeta(accounts.systemProgram), getAccountMeta(accounts.token2022Program), getAccountMeta(accounts.ataProgram), - getAccountMeta(accounts.instructions), getAccountMeta(accounts.payer), getAccountMeta(accounts.vendor), getAccountMeta(accounts.productMint), @@ -297,7 +285,6 @@ export function getActivateDeviceInstruction< TAccountSystemProgram, TAccountToken2022Program, TAccountAtaProgram, - TAccountInstructions, TAccountPayer, TAccountVendor, TAccountProductMint, @@ -323,24 +310,22 @@ export type ParsedActivateDeviceInstruction< token2022Program: TAccountMetas[1]; /** The associated token program */ ataProgram: TAccountMetas[2]; - /** The instructions sysvar */ - instructions: TAccountMetas[3]; /** The account paying for the storage fees */ - payer: TAccountMetas[4]; + payer: TAccountMetas[3]; /** The vendor */ - vendor: TAccountMetas[5]; + vendor: TAccountMetas[4]; /** The mint account for the product */ - productMint: TAccountMetas[6]; + productMint: TAccountMetas[5]; /** The associated token account for the product */ - productAssociatedToken: TAccountMetas[7]; + productAssociatedToken: TAccountMetas[6]; /** The device */ - device: TAccountMetas[8]; + device: TAccountMetas[7]; /** The mint account for the device */ - deviceMint: TAccountMetas[9]; + deviceMint: TAccountMetas[8]; /** The associated token account for the device */ - deviceAssociatedToken: TAccountMetas[10]; + deviceAssociatedToken: TAccountMetas[9]; /** The device's owner */ - owner: TAccountMetas[11]; + owner: TAccountMetas[10]; }; data: ActivateDeviceInstructionData; }; @@ -353,7 +338,7 @@ export function parseActivateDeviceInstruction< IInstructionWithAccounts & IInstructionWithData ): ParsedActivateDeviceInstruction { - if (instruction.accounts.length < 12) { + if (instruction.accounts.length < 11) { // TODO: Coded error. throw new Error('Not enough accounts'); } @@ -369,7 +354,6 @@ export function parseActivateDeviceInstruction< systemProgram: getNextAccount(), token2022Program: getNextAccount(), ataProgram: getNextAccount(), - instructions: getNextAccount(), payer: getNextAccount(), vendor: getNextAccount(), productMint: getNextAccount(), diff --git a/clients/js/src/generated/instructions/createDevice.ts b/clients/js/src/generated/instructions/createDevice.ts index fdc3483..63a9aaa 100644 --- a/clients/js/src/generated/instructions/createDevice.ts +++ b/clients/js/src/generated/instructions/createDevice.ts @@ -7,20 +7,6 @@ */ import { - Address, - Codec, - Decoder, - Encoder, - IAccountMeta, - IAccountSignerMeta, - IInstruction, - IInstructionWithAccounts, - IInstructionWithData, - ReadonlyAccount, - ReadonlySignerAccount, - TransactionSigner, - WritableAccount, - WritableSignerAccount, addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, @@ -37,14 +23,28 @@ import { getUtf8Decoder, getUtf8Encoder, transformEncoder, + type Address, + type Codec, + type Decoder, + type Encoder, + type IAccountMeta, + type IAccountSignerMeta, + type IInstruction, + type IInstructionWithAccounts, + type IInstructionWithData, + type ReadonlyAccount, + type ReadonlySignerAccount, + type TransactionSigner, + type WritableAccount, + type WritableSignerAccount, } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; -import { ResolvedAccount, getAccountMetaFactory } from '../shared'; +import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; import { - DeviceSigningAlgorithm, - DeviceSigningAlgorithmArgs, getDeviceSigningAlgorithmDecoder, getDeviceSigningAlgorithmEncoder, + type DeviceSigningAlgorithm, + type DeviceSigningAlgorithmArgs, } from '../types'; export type CreateDeviceInstruction< diff --git a/clients/js/src/generated/instructions/createProduct.ts b/clients/js/src/generated/instructions/createProduct.ts index 3d9156f..a19968e 100644 --- a/clients/js/src/generated/instructions/createProduct.ts +++ b/clients/js/src/generated/instructions/createProduct.ts @@ -7,20 +7,6 @@ */ import { - Address, - Codec, - Decoder, - Encoder, - IAccountMeta, - IAccountSignerMeta, - IInstruction, - IInstructionWithAccounts, - IInstructionWithData, - ReadonlyAccount, - ReadonlySignerAccount, - TransactionSigner, - WritableAccount, - WritableSignerAccount, addDecoderSizePrefix, addEncoderSizePrefix, combineCodec, @@ -37,9 +23,23 @@ import { getUtf8Decoder, getUtf8Encoder, transformEncoder, + type Address, + type Codec, + type Decoder, + type Encoder, + type IAccountMeta, + type IAccountSignerMeta, + type IInstruction, + type IInstructionWithAccounts, + type IInstructionWithData, + type ReadonlyAccount, + type ReadonlySignerAccount, + type TransactionSigner, + type WritableAccount, + type WritableSignerAccount, } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; -import { ResolvedAccount, getAccountMetaFactory } from '../shared'; +import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; export type CreateProductInstruction< TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS, diff --git a/clients/js/src/generated/instructions/initialize.ts b/clients/js/src/generated/instructions/initialize.ts index f62f480..c413a20 100644 --- a/clients/js/src/generated/instructions/initialize.ts +++ b/clients/js/src/generated/instructions/initialize.ts @@ -7,29 +7,29 @@ */ import { - Address, - Codec, - Decoder, - Encoder, - IAccountMeta, - IAccountSignerMeta, - IInstruction, - IInstructionWithAccounts, - IInstructionWithData, - ReadonlyAccount, - ReadonlySignerAccount, - TransactionSigner, - WritableAccount, - WritableSignerAccount, combineCodec, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, transformEncoder, + type Address, + type Codec, + type Decoder, + type Encoder, + type IAccountMeta, + type IAccountSignerMeta, + type IInstruction, + type IInstructionWithAccounts, + type IInstructionWithData, + type ReadonlyAccount, + type ReadonlySignerAccount, + type TransactionSigner, + type WritableAccount, + type WritableSignerAccount, } from '@solana/web3.js'; import { DEPHY_ID_PROGRAM_ADDRESS } from '../programs'; -import { ResolvedAccount, getAccountMetaFactory } from '../shared'; +import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; export type InitializeInstruction< TProgram extends string = typeof DEPHY_ID_PROGRAM_ADDRESS, diff --git a/clients/js/src/generated/pdas/deviceMint.ts b/clients/js/src/generated/pdas/deviceMint.ts index c74ca52..384bdc3 100644 --- a/clients/js/src/generated/pdas/deviceMint.ts +++ b/clients/js/src/generated/pdas/deviceMint.ts @@ -7,11 +7,11 @@ */ import { - Address, - ProgramDerivedAddress, getAddressEncoder, getProgramDerivedAddress, getUtf8Encoder, + type Address, + type ProgramDerivedAddress, } from '@solana/web3.js'; export type DeviceMintSeeds = { diff --git a/clients/js/src/generated/pdas/productMint.ts b/clients/js/src/generated/pdas/productMint.ts index 6b41a72..2e6416d 100644 --- a/clients/js/src/generated/pdas/productMint.ts +++ b/clients/js/src/generated/pdas/productMint.ts @@ -7,11 +7,11 @@ */ import { - Address, - ProgramDerivedAddress, getAddressEncoder, getProgramDerivedAddress, getUtf8Encoder, + type Address, + type ProgramDerivedAddress, } from '@solana/web3.js'; export type ProductMintSeeds = { diff --git a/clients/js/src/generated/pdas/programDataAccount.ts b/clients/js/src/generated/pdas/programDataAccount.ts index 0704f51..94deebb 100644 --- a/clients/js/src/generated/pdas/programDataAccount.ts +++ b/clients/js/src/generated/pdas/programDataAccount.ts @@ -7,10 +7,10 @@ */ import { - Address, - ProgramDerivedAddress, getProgramDerivedAddress, getUtf8Encoder, + type Address, + type ProgramDerivedAddress, } from '@solana/web3.js'; export async function findProgramDataAccountPda( diff --git a/clients/js/src/generated/programs/dephyId.ts b/clients/js/src/generated/programs/dephyId.ts index ca1d776..3798131 100644 --- a/clients/js/src/generated/programs/dephyId.ts +++ b/clients/js/src/generated/programs/dephyId.ts @@ -6,12 +6,12 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Address, containsBytes, getU8Encoder } from '@solana/web3.js'; +import { containsBytes, getU8Encoder, type Address } from '@solana/web3.js'; import { - ParsedActivateDeviceInstruction, - ParsedCreateDeviceInstruction, - ParsedCreateProductInstruction, - ParsedInitializeInstruction, + type ParsedActivateDeviceInstruction, + type ParsedCreateDeviceInstruction, + type ParsedCreateProductInstruction, + type ParsedInitializeInstruction, } from '../instructions'; import { Key, getKeyEncoder } from '../types'; diff --git a/clients/js/src/generated/shared/index.ts b/clients/js/src/generated/shared/index.ts index 75fbe89..278bf59 100644 --- a/clients/js/src/generated/shared/index.ts +++ b/clients/js/src/generated/shared/index.ts @@ -8,13 +8,13 @@ import { AccountRole, - Address, - IAccountMeta, - IAccountSignerMeta, - ProgramDerivedAddress, - TransactionSigner, isProgramDerivedAddress, isTransactionSigner as web3JsIsTransactionSigner, + type Address, + type IAccountMeta, + type IAccountSignerMeta, + type ProgramDerivedAddress, + type TransactionSigner, upgradeRoleToSigner, } from '@solana/web3.js'; diff --git a/clients/js/src/generated/types/deviceActivationSignature.ts b/clients/js/src/generated/types/deviceActivationSignature.ts index f817b96..8423d1a 100644 --- a/clients/js/src/generated/types/deviceActivationSignature.ts +++ b/clients/js/src/generated/types/deviceActivationSignature.ts @@ -7,12 +7,6 @@ */ import { - Codec, - Decoder, - Encoder, - GetDiscriminatedUnionVariant, - GetDiscriminatedUnionVariantContent, - ReadonlyUint8Array, combineCodec, fixDecoderSize, fixEncoderSize, @@ -26,6 +20,12 @@ import { getTupleEncoder, getU8Decoder, getU8Encoder, + type Codec, + type Decoder, + type Encoder, + type GetDiscriminatedUnionVariant, + type GetDiscriminatedUnionVariantContent, + type ReadonlyUint8Array, } from '@solana/web3.js'; export type DeviceActivationSignature = diff --git a/clients/js/src/generated/types/deviceSigningAlgorithm.ts b/clients/js/src/generated/types/deviceSigningAlgorithm.ts index 4222a4f..338b069 100644 --- a/clients/js/src/generated/types/deviceSigningAlgorithm.ts +++ b/clients/js/src/generated/types/deviceSigningAlgorithm.ts @@ -7,12 +7,12 @@ */ import { - Codec, - Decoder, - Encoder, combineCodec, getEnumDecoder, getEnumEncoder, + type Codec, + type Decoder, + type Encoder, } from '@solana/web3.js'; export enum DeviceSigningAlgorithm { diff --git a/clients/js/src/generated/types/key.ts b/clients/js/src/generated/types/key.ts index 511892d..3bcf84a 100644 --- a/clients/js/src/generated/types/key.ts +++ b/clients/js/src/generated/types/key.ts @@ -7,12 +7,12 @@ */ import { - Codec, - Decoder, - Encoder, combineCodec, getEnumDecoder, getEnumEncoder, + type Codec, + type Decoder, + type Encoder, } from '@solana/web3.js'; export enum Key { diff --git a/clients/js/src/generated/types/programData.ts b/clients/js/src/generated/types/programData.ts index c6b3a18..7e90596 100644 --- a/clients/js/src/generated/types/programData.ts +++ b/clients/js/src/generated/types/programData.ts @@ -7,14 +7,14 @@ */ import { - Codec, - Decoder, - Encoder, combineCodec, getStructDecoder, getStructEncoder, getU8Decoder, getU8Encoder, + type Codec, + type Decoder, + type Encoder, } from '@solana/web3.js'; export type ProgramData = { bump: number }; diff --git a/clients/rust/src/generated/accounts/program_data_account.rs b/clients/rust/src/generated/accounts/program_data_account.rs index bd7504d..c16904c 100644 --- a/clients/rust/src/generated/accounts/program_data_account.rs +++ b/clients/rust/src/generated/accounts/program_data_account.rs @@ -66,3 +66,28 @@ impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for ProgramData Self::deserialize(&mut data) } } + +#[cfg(feature = "anchor")] +impl anchor_lang::AccountDeserialize for ProgramDataAccount { + fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result { + Ok(Self::deserialize(buf)?) + } +} + +#[cfg(feature = "anchor")] +impl anchor_lang::AccountSerialize for ProgramDataAccount {} + +#[cfg(feature = "anchor")] +impl anchor_lang::Owner for ProgramDataAccount { + fn owner() -> Pubkey { + crate::DEPHY_ID_ID + } +} + +#[cfg(feature = "anchor-idl-build")] +impl anchor_lang::IdlBuild for ProgramDataAccount {} + +#[cfg(feature = "anchor-idl-build")] +impl anchor_lang::Discriminator for ProgramDataAccount { + const DISCRIMINATOR: [u8; 8] = [0; 8]; +} diff --git a/clients/rust/src/generated/instructions/activate_device.rs b/clients/rust/src/generated/instructions/activate_device.rs index 36507f0..992dba0 100644 --- a/clients/rust/src/generated/instructions/activate_device.rs +++ b/clients/rust/src/generated/instructions/activate_device.rs @@ -17,8 +17,6 @@ pub struct ActivateDevice { pub token2022_program: solana_program::pubkey::Pubkey, /// The associated token program pub ata_program: solana_program::pubkey::Pubkey, - /// The instructions sysvar - pub instructions: solana_program::pubkey::Pubkey, /// The account paying for the storage fees pub payer: solana_program::pubkey::Pubkey, /// The vendor @@ -50,7 +48,7 @@ impl ActivateDevice { args: ActivateDeviceInstructionArgs, remaining_accounts: &[solana_program::instruction::AccountMeta], ) -> solana_program::instruction::Instruction { - let mut accounts = Vec::with_capacity(12 + remaining_accounts.len()); + let mut accounts = Vec::with_capacity(11 + remaining_accounts.len()); accounts.push(solana_program::instruction::AccountMeta::new_readonly( self.system_program, false, @@ -63,10 +61,6 @@ impl ActivateDevice { self.ata_program, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - self.instructions, - false, - )); accounts.push(solana_program::instruction::AccountMeta::new( self.payer, true, )); @@ -141,21 +135,19 @@ pub struct ActivateDeviceInstructionArgs { /// 0. `[optional]` system_program (default to `11111111111111111111111111111111`) /// 1. `[]` token2022_program /// 2. `[optional]` ata_program (default to `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`) -/// 3. `[]` instructions -/// 4. `[writable, signer]` payer -/// 5. `[]` vendor -/// 6. `[]` product_mint -/// 7. `[]` product_associated_token -/// 8. `[]` device -/// 9. `[writable]` device_mint -/// 10. `[writable]` device_associated_token -/// 11. `[]` owner +/// 3. `[writable, signer]` payer +/// 4. `[]` vendor +/// 5. `[]` product_mint +/// 6. `[]` product_associated_token +/// 7. `[]` device +/// 8. `[writable]` device_mint +/// 9. `[writable]` device_associated_token +/// 10. `[]` owner #[derive(Clone, Debug, Default)] pub struct ActivateDeviceBuilder { system_program: Option, token2022_program: Option, ata_program: Option, - instructions: Option, payer: Option, vendor: Option, product_mint: Option, @@ -196,12 +188,6 @@ impl ActivateDeviceBuilder { self.ata_program = Some(ata_program); self } - /// The instructions sysvar - #[inline(always)] - pub fn instructions(&mut self, instructions: solana_program::pubkey::Pubkey) -> &mut Self { - self.instructions = Some(instructions); - self - } /// The account paying for the storage fees #[inline(always)] pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self { @@ -296,7 +282,6 @@ impl ActivateDeviceBuilder { ata_program: self.ata_program.unwrap_or(solana_program::pubkey!( "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" )), - instructions: self.instructions.expect("instructions is not set"), payer: self.payer.expect("payer is not set"), vendor: self.vendor.expect("vendor is not set"), product_mint: self.product_mint.expect("product_mint is not set"), @@ -327,8 +312,6 @@ pub struct ActivateDeviceCpiAccounts<'a, 'b> { pub token2022_program: &'b solana_program::account_info::AccountInfo<'a>, /// The associated token program pub ata_program: &'b solana_program::account_info::AccountInfo<'a>, - /// The instructions sysvar - pub instructions: &'b solana_program::account_info::AccountInfo<'a>, /// The account paying for the storage fees pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The vendor @@ -357,8 +340,6 @@ pub struct ActivateDeviceCpi<'a, 'b> { pub token2022_program: &'b solana_program::account_info::AccountInfo<'a>, /// The associated token program pub ata_program: &'b solana_program::account_info::AccountInfo<'a>, - /// The instructions sysvar - pub instructions: &'b solana_program::account_info::AccountInfo<'a>, /// The account paying for the storage fees pub payer: &'b solana_program::account_info::AccountInfo<'a>, /// The vendor @@ -390,7 +371,6 @@ impl<'a, 'b> ActivateDeviceCpi<'a, 'b> { system_program: accounts.system_program, token2022_program: accounts.token2022_program, ata_program: accounts.ata_program, - instructions: accounts.instructions, payer: accounts.payer, vendor: accounts.vendor, product_mint: accounts.product_mint, @@ -435,7 +415,7 @@ impl<'a, 'b> ActivateDeviceCpi<'a, 'b> { bool, )], ) -> solana_program::entrypoint::ProgramResult { - let mut accounts = Vec::with_capacity(12 + remaining_accounts.len()); + let mut accounts = Vec::with_capacity(11 + remaining_accounts.len()); accounts.push(solana_program::instruction::AccountMeta::new_readonly( *self.system_program.key, false, @@ -448,10 +428,6 @@ impl<'a, 'b> ActivateDeviceCpi<'a, 'b> { *self.ata_program.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( - *self.instructions.key, - false, - )); accounts.push(solana_program::instruction::AccountMeta::new( *self.payer.key, true, @@ -500,12 +476,11 @@ impl<'a, 'b> ActivateDeviceCpi<'a, 'b> { accounts, data, }; - let mut account_infos = Vec::with_capacity(12 + 1 + remaining_accounts.len()); + let mut account_infos = Vec::with_capacity(11 + 1 + remaining_accounts.len()); account_infos.push(self.__program.clone()); account_infos.push(self.system_program.clone()); account_infos.push(self.token2022_program.clone()); account_infos.push(self.ata_program.clone()); - account_infos.push(self.instructions.clone()); account_infos.push(self.payer.clone()); account_infos.push(self.vendor.clone()); account_infos.push(self.product_mint.clone()); @@ -533,15 +508,14 @@ impl<'a, 'b> ActivateDeviceCpi<'a, 'b> { /// 0. `[]` system_program /// 1. `[]` token2022_program /// 2. `[]` ata_program -/// 3. `[]` instructions -/// 4. `[writable, signer]` payer -/// 5. `[]` vendor -/// 6. `[]` product_mint -/// 7. `[]` product_associated_token -/// 8. `[]` device -/// 9. `[writable]` device_mint -/// 10. `[writable]` device_associated_token -/// 11. `[]` owner +/// 3. `[writable, signer]` payer +/// 4. `[]` vendor +/// 5. `[]` product_mint +/// 6. `[]` product_associated_token +/// 7. `[]` device +/// 8. `[writable]` device_mint +/// 9. `[writable]` device_associated_token +/// 10. `[]` owner #[derive(Clone, Debug)] pub struct ActivateDeviceCpiBuilder<'a, 'b> { instruction: Box>, @@ -554,7 +528,6 @@ impl<'a, 'b> ActivateDeviceCpiBuilder<'a, 'b> { system_program: None, token2022_program: None, ata_program: None, - instructions: None, payer: None, vendor: None, product_mint: None, @@ -596,15 +569,6 @@ impl<'a, 'b> ActivateDeviceCpiBuilder<'a, 'b> { self.instruction.ata_program = Some(ata_program); self } - /// The instructions sysvar - #[inline(always)] - pub fn instructions( - &mut self, - instructions: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { - self.instruction.instructions = Some(instructions); - self - } /// The account paying for the storage fees #[inline(always)] pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { @@ -752,11 +716,6 @@ impl<'a, 'b> ActivateDeviceCpiBuilder<'a, 'b> { .ata_program .expect("ata_program is not set"), - instructions: self - .instruction - .instructions - .expect("instructions is not set"), - payer: self.instruction.payer.expect("payer is not set"), vendor: self.instruction.vendor.expect("vendor is not set"), @@ -799,7 +758,6 @@ struct ActivateDeviceCpiBuilderInstruction<'a, 'b> { system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, token2022_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, ata_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, - instructions: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, vendor: Option<&'b solana_program::account_info::AccountInfo<'a>>, product_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>, diff --git a/clients/rust/src/generated/types/device_signing_algorithm.rs b/clients/rust/src/generated/types/device_signing_algorithm.rs index aeee6d0..abe3c27 100644 --- a/clients/rust/src/generated/types/device_signing_algorithm.rs +++ b/clients/rust/src/generated/types/device_signing_algorithm.rs @@ -10,7 +10,16 @@ use borsh::BorshSerialize; use num_derive::FromPrimitive; #[derive( - BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash, FromPrimitive, + BorshSerialize, + BorshDeserialize, + Clone, + Debug, + Eq, + PartialEq, + Copy, + PartialOrd, + Hash, + FromPrimitive, )] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum DeviceSigningAlgorithm { diff --git a/clients/rust/src/generated/types/key.rs b/clients/rust/src/generated/types/key.rs index 25883d9..59c8544 100644 --- a/clients/rust/src/generated/types/key.rs +++ b/clients/rust/src/generated/types/key.rs @@ -10,7 +10,16 @@ use borsh::BorshSerialize; use num_derive::FromPrimitive; #[derive( - BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Hash, FromPrimitive, + BorshSerialize, + BorshDeserialize, + Clone, + Debug, + Eq, + PartialEq, + Copy, + PartialOrd, + Hash, + FromPrimitive, )] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Key {