From b0061fcdc993335a8e9d12b1b778b47193261b95 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Thu, 27 Nov 2025 22:53:46 -0300 Subject: [PATCH 01/24] evm debug task --- examples/oapp-solana/tasks/evm/debug.ts | 29 +++++++++++++++++++++++++ examples/oapp-solana/tasks/index.ts | 1 + 2 files changed, 30 insertions(+) create mode 100644 examples/oapp-solana/tasks/evm/debug.ts diff --git a/examples/oapp-solana/tasks/evm/debug.ts b/examples/oapp-solana/tasks/evm/debug.ts new file mode 100644 index 000000000..8b8600f82 --- /dev/null +++ b/examples/oapp-solana/tasks/evm/debug.ts @@ -0,0 +1,29 @@ +import { task, types } from 'hardhat/config' +import { ActionType, HardhatRuntimeEnvironment } from 'hardhat/types' + +import { DebugLogger } from '../common/utils' + +interface DebugTaskArgs { + contractName: string +} + +const action: ActionType = async ({ contractName }, hre: HardhatRuntimeEnvironment) => { + const contract = await hre.ethers.getContract(contractName) + const readableContract = contract as unknown as { data: () => Promise } + + const storedData = await readableContract.data() + + DebugLogger.header('EVM OApp Store Information') + DebugLogger.keyValue('Network', hre.network.name) + DebugLogger.keyValue('Contract Name', contractName) + DebugLogger.keyValue('Contract Address', contract.address) + DebugLogger.keyValue('String', storedData) + DebugLogger.separator() +} + +task('lz:oapp:evm:debug', 'Reads the stored string data from the EVM OApp', action).addOptionalParam( + 'contractName', + 'Name of the deployed EVM OApp contract (default: MyOApp)', + 'MyOApp', + types.string +) diff --git a/examples/oapp-solana/tasks/index.ts b/examples/oapp-solana/tasks/index.ts index a9233bd4d..c2c878bab 100644 --- a/examples/oapp-solana/tasks/index.ts +++ b/examples/oapp-solana/tasks/index.ts @@ -5,3 +5,4 @@ import './solana/oappCreate' import './solana/initConfig' import './solana/retryMessage' import './solana/debug' +import './evm/debug' From 414feaa5995735a9e9b9ae1ad74b24107b04c011 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Thu, 27 Nov 2025 22:53:55 -0300 Subject: [PATCH 02/24] instructions to view sent srings --- examples/oapp-solana/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/examples/oapp-solana/README.md b/examples/oapp-solana/README.md index 66df439d6..e8f19f638 100644 --- a/examples/oapp-solana/README.md +++ b/examples/oapp-solana/README.md @@ -299,6 +299,26 @@ npx hardhat --network arbitrum-sepolia lz:oapp:send --from-eid 40231 --dst-eid 4 Congratulations, you have now successfully set up an EVM <> Solana OApp. +### Viewing Sent Strings + +After sending cross-chain messages you can inspect the stored string on either side directly from the terminal: + +- Solana store account: + + ```bash + npx hardhat lz:oapp:solana:debug --eid 40168 --action store + ``` + + Use the Solana endpoint ID that matches your environment (e.g., `40168` for Devnet, `30168` for Mainnet) and optionally pass `--store ` if you need to override the derived PDA. + +- EVM contract storage: + + ```bash + npx hardhat lz:oapp:evm:debug --network arbitrum-sepolia --contract-name MyOApp + ``` + + Switch `--network` to the EVM chain you deployed to and supply a different `--contract-name` if your deployment artifact uses another name. The task performs a read-only call to the `data()` getter and prints the latest received message. + ### Running tests The `test` command will execute the hardhat and forge tests: From 488df769c7256bed18b9f8cb1c7bb51d5726097b Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Thu, 27 Nov 2025 23:46:05 -0300 Subject: [PATCH 03/24] introduce changes --- .../my_oapp/src/instructions/init_store.rs | 1 + .../src/instructions/lz_receive_types_info.rs | 69 +++++++++++++++++++ .../src/instructions/lz_receive_types_v2.rs | 67 ++++++++++++++++++ .../programs/my_oapp/src/instructions/mod.rs | 4 ++ .../oapp-solana/programs/my_oapp/src/lib.rs | 23 +++++-- .../programs/my_oapp/src/state/store.rs | 10 +-- 6 files changed, 164 insertions(+), 10 deletions(-) create mode 100644 examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_info.rs create mode 100644 examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs index 7fa831edf..30dc624d0 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs @@ -36,6 +36,7 @@ impl InitStore<'_> { ctx.accounts.store.bump = ctx.bumps.store; ctx.accounts.store.endpoint_program = params.endpoint; ctx.accounts.lz_receive_types_accounts.store = ctx.accounts.store.key(); + ctx.accounts.lz_receive_types_accounts.bump = ctx.bumps.lz_receive_types_accounts; // the above lines are required for all OApp implementations // the line below is specific to this string-passing example diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_info.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_info.rs new file mode 100644 index 000000000..817f00e36 --- /dev/null +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_info.rs @@ -0,0 +1,69 @@ +use oapp::{ + lz_receive_types_v2::{LzReceiveTypesV2Accounts, LZ_RECEIVE_TYPES_VERSION}, + LzReceiveParams, LZ_RECEIVE_TYPES_SEED, +}; + +use crate::*; + +/// LzReceiveTypesInfo instruction implements the versioning mechanism introduced in V2. +/// +/// This instruction addresses the compatibility risk of the original LzReceiveType V1 design, +/// which lacked any formal versioning mechanism. The LzReceiveTypesInfo instruction allows +/// the Executor to determine how to interpret the structure of the data returned by +/// lz_receive_types() for different versions. +/// +/// Returns (version, versioned_data): +/// - version: u8 — A protocol-defined version identifier for the LzReceiveType logic and return +/// type +/// - versioned_data: Any — A version-specific structure that the Executor decodes based on the +/// version +/// +/// For Version 2, the versioned_data contains LzReceiveTypesV2Accounts which provides information +/// needed to construct the call to lz_receive_types_v2. +#[derive(Accounts)] +pub struct LzReceiveTypesInfo<'info> { + #[account(seeds = [STORE_SEED], bump = store.bump)] + pub store: Account<'info, Store>, + + /// PDA account containing the versioned data structure for V2 + /// Contains the accounts needed to construct lz_receive_types_v2 instruction + #[account(seeds = [LZ_RECEIVE_TYPES_SEED, &store.key().to_bytes()], bump = lz_receive_types_accounts.bump)] + pub lz_receive_types_accounts: Account<'info, LzReceiveTypesAccounts>, +} + +impl LzReceiveTypesInfo<'_> { + /// Returns the version and versioned data for LzReceiveTypes + /// + /// Version Compatibility: + /// - Forward Compatibility: Executors must gracefully reject unknown versions + /// - Backward Compatibility: Version 1 OApps do not implement lz_receive_types_info; Executors + /// may fall back to assuming V1 if the version instruction is missing or unimplemented + /// + /// For V2, returns: + /// - version: 2 (u8) + /// - versioned_data: LzReceiveTypesV2Accounts containing the accounts needed for + /// lz_receive_types_v2 + pub fn apply( + ctx: &Context, + _params: &LzReceiveParams, + ) -> Result<(u8, LzReceiveTypesV2Accounts)> { + let receive_types_account = &ctx.accounts.lz_receive_types_accounts; + + // If there are accounts that need to be dynamically derived based on contents of the message, + // ...you can access params.message + + let required_accounts = if receive_types_account.alt == Pubkey::default() { + vec![ + receive_types_account.store + // You can include more accounts here if necessary + ] + } else { + vec![ + receive_types_account.store, + receive_types_account.alt, + // You can include more accounts here if necessary + ] + }; + Ok((LZ_RECEIVE_TYPES_VERSION, LzReceiveTypesV2Accounts { accounts: required_accounts })) + } +} \ No newline at end of file diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs new file mode 100644 index 000000000..f1423a358 --- /dev/null +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -0,0 +1,67 @@ +use crate::*; + +use anchor_lang::solana_program; +use oapp::{ + common::{ + compact_accounts_with_alts, AccountMetaRef, AddressLocator, EXECUTION_CONTEXT_VERSION_1, + }, + lz_receive_types_v2::{ + Instruction, LzReceiveTypesV2Result, + }, + LzReceiveParams, +}; + + +#[derive(Accounts)] +#[instruction(params: LzReceiveParams)] +pub struct LzReceiveTypesV2<'info> { + #[account(seeds = [STORE_SEED], bump = store.bump)] + pub store: Account<'info, Store>, + // Note: include more accounts here if you had done so in the previous steps +} + +impl LzReceiveTypesV2<'_> { + /// Returns the execution plan for lz_receive with a minimal account set. + pub fn apply( + ctx: &Context, + params: &LzReceiveParams, + ) -> Result { + // Derive peer PDA from src_eid + let peer_seeds = [PEER_SEED, ¶ms.src_eid.to_be_bytes()]; + let (peer, _) = Pubkey::find_program_address(&peer_seeds, ctx.program_id); + + // Event authority used for logging + let (event_authority_account, _) = + Pubkey::find_program_address(&[oapp::endpoint_cpi::EVENT_SEED], &ctx.program_id); + + let accounts = vec![ + // payer + AccountMetaRef { pubkey: AddressLocator::Payer, is_writable: true }, + // peer + AccountMetaRef { pubkey: peer.into(), is_writable: false }, + // event authority account - used for event logging + AccountMetaRef { pubkey: event_authority_account.into(), is_writable: false }, + // system program + AccountMetaRef { + pubkey: solana_program::system_program::ID.into(), + is_writable: false, + }, + // program id - the program that is executing this instruction + AccountMetaRef { pubkey: crate::ID.into(), is_writable: false }, + ]; + + // Return the execution plan (no clear/compose helper accounts) + Ok(LzReceiveTypesV2Result { + context_version: EXECUTION_CONTEXT_VERSION_1, + alts: ctx.remaining_accounts.iter().map(|alt| alt.key()).collect(), + instructions: vec![ + Instruction::LzReceive { + // In this example, ALTs are passed in via remaining_accounts + // This decision allows for flexibility in terms of passing in any number of ALTs without needing to change the accounts struct + // However, if you need stronger schema guarantees and require only a single ALT, you may opt to have it passed in explicitly via ctx.accounts.alt (or similar) + accounts: compact_accounts_with_alts(&ctx.remaining_accounts, accounts)?, + }, + ], + }) + } +} \ No newline at end of file diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs index a09baf414..f76f48581 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs @@ -2,6 +2,8 @@ pub mod send; pub mod init_store; pub mod lz_receive; pub mod lz_receive_types; +pub mod lz_receive_types_info; +pub mod lz_receive_types_v2; pub mod quote_send; pub mod set_peer_config; @@ -10,5 +12,7 @@ pub use send::*; pub use init_store::*; pub use lz_receive::*; pub use lz_receive_types::*; +pub use lz_receive_types_info::*; +pub use lz_receive_types_v2::*; pub use quote_send::*; pub use set_peer_config::*; diff --git a/examples/oapp-solana/programs/my_oapp/src/lib.rs b/examples/oapp-solana/programs/my_oapp/src/lib.rs index 232c7b009..eeba63444 100644 --- a/examples/oapp-solana/programs/my_oapp/src/lib.rs +++ b/examples/oapp-solana/programs/my_oapp/src/lib.rs @@ -5,7 +5,11 @@ mod state; use anchor_lang::prelude::*; use instructions::*; -use oapp::{endpoint::MessagingFee, endpoint_cpi::LzAccount, LzReceiveParams}; +use oapp::{ + endpoint::MessagingFee, + LzReceiveParams, + lz_receive_types_v2::{LzReceiveTypesV2Accounts, LzReceiveTypesV2Result} +}; use solana_helper::program_id_from_env; use state::*; @@ -57,12 +61,19 @@ pub mod my_oapp { LzReceive::apply(&mut ctx, ¶ms) } - // handler that returns the list of accounts required to execute lz_receive - pub fn lz_receive_types( - ctx: Context, + pub fn lz_receive_types_v2( + ctx: Context, params: LzReceiveParams, - ) -> Result> { - LzReceiveTypes::apply(&ctx, ¶ms) + ) -> Result { + LzReceiveTypesV2::apply(&ctx, ¶ms) + } + + // returns the version and the accounts required to execute lz_receive_types_v2 + pub fn lz_receive_types_info( + ctx: Context, + params: LzReceiveParams, + ) -> Result<(u8, LzReceiveTypesV2Accounts)> { + LzReceiveTypesInfo::apply(&ctx, ¶ms) } } diff --git a/examples/oapp-solana/programs/my_oapp/src/state/store.rs b/examples/oapp-solana/programs/my_oapp/src/state/store.rs index 89263751e..a0554907f 100644 --- a/examples/oapp-solana/programs/my_oapp/src/state/store.rs +++ b/examples/oapp-solana/programs/my_oapp/src/state/store.rs @@ -2,9 +2,9 @@ use crate::*; #[account] pub struct Store { - pub admin: Pubkey, // This is required and should be consistent. - pub bump: u8, // This is required and should be consistent. - pub endpoint_program: Pubkey, // This is required and should be consistent. + pub admin: Pubkey, + pub bump: u8, // the bump of the store PDA + pub endpoint_program: Pubkey, pub string: String, // This is specific to this string-passing example. // You can add more fields as needed for your OApp implementation. } @@ -17,7 +17,9 @@ impl Store { // The LzReceiveTypesAccounts PDA is used by the Executor as a prerequisite to calling `lz_receive`. #[account] pub struct LzReceiveTypesAccounts { - pub store: Pubkey, // This is required and should be consistent. + pub store: Pubkey, // Note: This is used as your OApp address. + pub alt: Pubkey, // Note: in this example, we store a single ALT. You can modify this to store a Vec of Pubkeys too. + pub bump: u8, // the bump of the lz_receive_types_accounts PDA } impl LzReceiveTypesAccounts { From a92702faeb103bf68aa981cac8a85847d7273a4a Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Thu, 27 Nov 2025 23:49:00 -0300 Subject: [PATCH 04/24] fix --- .../my_oapp/src/instructions/lz_receive_types_v2.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index f1423a358..c75a324c3 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -26,8 +26,11 @@ impl LzReceiveTypesV2<'_> { ctx: &Context, params: &LzReceiveParams, ) -> Result { - // Derive peer PDA from src_eid - let peer_seeds = [PEER_SEED, ¶ms.src_eid.to_be_bytes()]; + // 1. Store PDA (writable) – matches LzReceive's `store` account + let store_key = ctx.accounts.store.key(); + + // 2. Derive peer PDA using store key + src_eid to match LzReceive + let peer_seeds = [PEER_SEED, store_key.as_ref(), ¶ms.src_eid.to_be_bytes()]; let (peer, _) = Pubkey::find_program_address(&peer_seeds, ctx.program_id); // Event authority used for logging @@ -37,6 +40,8 @@ impl LzReceiveTypesV2<'_> { let accounts = vec![ // payer AccountMetaRef { pubkey: AddressLocator::Payer, is_writable: true }, + // store (writable) + AccountMetaRef { pubkey: store_key.into(), is_writable: true }, // peer AccountMetaRef { pubkey: peer.into(), is_writable: false }, // event authority account - used for event logging From e1d547763e0e758a3bfcbcb5fd3b2439cd4759b7 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:02:23 -0300 Subject: [PATCH 05/24] fix lzrt v2 --- .../my_oapp/src/instructions/lz_receive.rs | 2 ++ .../src/instructions/lz_receive_types_v2.rs | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs index 41552f85f..f8265496f 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs @@ -57,6 +57,8 @@ impl LzReceive<'_> { let store = &mut ctx.accounts.store; store.string = string_value; + // You can add logic here to handle compose if the message contains a compose message + Ok(()) } } diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index c75a324c3..497830013 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -5,7 +5,9 @@ use oapp::{ common::{ compact_accounts_with_alts, AccountMetaRef, AddressLocator, EXECUTION_CONTEXT_VERSION_1, }, + endpoint::ID as ENDPOINT_ID, lz_receive_types_v2::{ + get_accounts_for_clear, Instruction, LzReceiveTypesV2Result, }, LzReceiveParams, @@ -37,7 +39,7 @@ impl LzReceiveTypesV2<'_> { let (event_authority_account, _) = Pubkey::find_program_address(&[oapp::endpoint_cpi::EVENT_SEED], &ctx.program_id); - let accounts = vec![ + let mut accounts = vec![ // payer AccountMetaRef { pubkey: AddressLocator::Payer, is_writable: true }, // store (writable) @@ -55,17 +57,32 @@ impl LzReceiveTypesV2<'_> { AccountMetaRef { pubkey: crate::ID.into(), is_writable: false }, ]; + // Add accounts required for LayerZero's clear operation + // These accounts handle the core message verification and processing + let accounts_for_clear: Vec = get_accounts_for_clear( + ENDPOINT_ID, + &store_key, + params.src_eid, + ¶ms.sender, + params.nonce, + ); + accounts.extend(accounts_for_clear); + + // You can add handling of compose message here. Use accounts.extend() to add accounts needed for the send compose operation. + // Return the execution plan (no clear/compose helper accounts) Ok(LzReceiveTypesV2Result { context_version: EXECUTION_CONTEXT_VERSION_1, + // In this example, ALTs are passed in via remaining_accounts + // This decision allows for flexibility in terms of passing in any number of ALTs without needing to change the accounts struct + // However, if you need stronger schema guarantees and require only a single ALT, you may opt to have it passed in explicitly via ctx.accounts.alt (or similar) alts: ctx.remaining_accounts.iter().map(|alt| alt.key()).collect(), instructions: vec![ + // You can add additional instructions before the LzReceive instruction Instruction::LzReceive { - // In this example, ALTs are passed in via remaining_accounts - // This decision allows for flexibility in terms of passing in any number of ALTs without needing to change the accounts struct - // However, if you need stronger schema guarantees and require only a single ALT, you may opt to have it passed in explicitly via ctx.accounts.alt (or similar) accounts: compact_accounts_with_alts(&ctx.remaining_accounts, accounts)?, }, + // You can add additional instructions after the LzReceive instruction ], }) } From 2415e10bb4eba0be247ee0ca283864b665e410fd Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:06:49 -0300 Subject: [PATCH 06/24] update --- .../my_oapp/instructions/initStore.ts | 2 +- .../instructions/lzReceiveTypesInfo.ts | 97 ++++++++++++++ ...{lzReceiveTypes.ts => lzReceiveTypesV2.ts} | 38 +++--- .../generated/my_oapp/types/accountMetaRef.ts | 43 ++++++ .../generated/my_oapp/types/addressLocator.ts | 86 ++++++++++++ .../generated/my_oapp/types/instruction.ts | 125 ++++++++++++++++++ .../generated/my_oapp/types/lzAccount.ts | 30 ----- .../my_oapp/types/lzReceiveTypesV2Result.ts | 66 +++++++++ 8 files changed, 438 insertions(+), 49 deletions(-) create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts rename examples/oapp-solana/lib/client/generated/my_oapp/instructions/{lzReceiveTypes.ts => lzReceiveTypesV2.ts} (59%) create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts delete mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts index 0d9c61325..5360f67ad 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts @@ -65,7 +65,7 @@ export function initStore( input: InitStoreInstructionAccounts & InitStoreInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts new file mode 100644 index 000000000..53cca9710 --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts @@ -0,0 +1,97 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' + +// Accounts. +export type LzReceiveTypesInfoInstructionAccounts = { + store: PublicKey | Pda + /** + * PDA account containing the versioned data structure for V2 + * Contains the accounts needed to construct lz_receive_types_v2 instruction + */ + + lzReceiveTypesAccounts: PublicKey | Pda +} + +// Data. +export type LzReceiveTypesInfoInstructionData = { + discriminator: Uint8Array + params: LzReceiveParams +} + +export type LzReceiveTypesInfoInstructionDataArgs = { + params: LzReceiveParamsArgs +} + +export function getLzReceiveTypesInfoInstructionDataSerializer(): Serializer< + LzReceiveTypesInfoInstructionDataArgs, + LzReceiveTypesInfoInstructionData +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveTypesInfoInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]), + }) + ) as Serializer +} + +// Args. +export type LzReceiveTypesInfoInstructionArgs = LzReceiveTypesInfoInstructionDataArgs + +// Instruction. +export function lzReceiveTypesInfo( + context: Pick, + input: LzReceiveTypesInfoInstructionAccounts & LzReceiveTypesInfoInstructionArgs +): TransactionBuilder { + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') + + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + lzReceiveTypesAccounts: { + index: 1, + isWritable: false as boolean, + value: input.lzReceiveTypesAccounts ?? null, + }, + } satisfies ResolvedAccountsWithIndices + + // Arguments. + const resolvedArgs: LzReceiveTypesInfoInstructionArgs = { ...input } + + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + + // Data. + const data = getLzReceiveTypesInfoInstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesInfoInstructionDataArgs + ) + + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 + + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) +} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts similarity index 59% rename from examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts rename to examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts index 9de0e5d9d..2e0c2a06b 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts @@ -12,47 +12,49 @@ import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' // Accounts. -export type LzReceiveTypesInstructionAccounts = { +export type LzReceiveTypesV2InstructionAccounts = { store: PublicKey | Pda } // Data. -export type LzReceiveTypesInstructionData = { +export type LzReceiveTypesV2InstructionData = { discriminator: Uint8Array params: LzReceiveParams } -export type LzReceiveTypesInstructionDataArgs = { params: LzReceiveParamsArgs } +export type LzReceiveTypesV2InstructionDataArgs = { + params: LzReceiveParamsArgs +} -export function getLzReceiveTypesInstructionDataSerializer(): Serializer< - LzReceiveTypesInstructionDataArgs, - LzReceiveTypesInstructionData +export function getLzReceiveTypesV2InstructionDataSerializer(): Serializer< + LzReceiveTypesV2InstructionDataArgs, + LzReceiveTypesV2InstructionData > { - return mapSerializer( - struct( + return mapSerializer( + struct( [ ['discriminator', bytes({ size: 8 })], ['params', getLzReceiveParamsSerializer()], ], - { description: 'LzReceiveTypesInstructionData' } + { description: 'LzReceiveTypesV2InstructionData' } ), (value) => ({ ...value, - discriminator: new Uint8Array([221, 17, 246, 159, 248, 128, 31, 96]), + discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]), }) - ) as Serializer + ) as Serializer } // Args. -export type LzReceiveTypesInstructionArgs = LzReceiveTypesInstructionDataArgs +export type LzReceiveTypesV2InstructionArgs = LzReceiveTypesV2InstructionDataArgs // Instruction. -export function lzReceiveTypes( +export function lzReceiveTypesV2( context: Pick, - input: LzReceiveTypesInstructionAccounts & LzReceiveTypesInstructionArgs + input: LzReceiveTypesV2InstructionAccounts & LzReceiveTypesV2InstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { @@ -64,7 +66,7 @@ export function lzReceiveTypes( } satisfies ResolvedAccountsWithIndices // Arguments. - const resolvedArgs: LzReceiveTypesInstructionArgs = { ...input } + const resolvedArgs: LzReceiveTypesV2InstructionArgs = { ...input } // Accounts in order. const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) @@ -73,8 +75,8 @@ export function lzReceiveTypes( const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) // Data. - const data = getLzReceiveTypesInstructionDataSerializer().serialize( - resolvedArgs as LzReceiveTypesInstructionDataArgs + const data = getLzReceiveTypesV2InstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesV2InstructionDataArgs ) // Bytes Created On Chain. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts new file mode 100644 index 000000000..d7a990a26 --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts @@ -0,0 +1,43 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { Serializer, bool, struct } from '@metaplex-foundation/umi/serializers' +import { AddressLocator, AddressLocatorArgs, getAddressLocatorSerializer } from '.' + +/** + * Account metadata for V2 execution planning. + * Used by the Executor to construct the final transaction. + * + * V2 removes the legacy is_signer flag from V1's AccountMeta. + * Instead, signer roles are explicitly declared through AddressLocator variants. + * This provides clearer semantics and enables multiple signer support. + */ + +export type AccountMetaRef = { + /** The account address locator - supports multiple resolution strategies */ + pubkey: AddressLocator + /** Whether the account should be writable in the final transaction */ + isWritable: boolean +} + +export type AccountMetaRefArgs = { + /** The account address locator - supports multiple resolution strategies */ + pubkey: AddressLocatorArgs + /** Whether the account should be writable in the final transaction */ + isWritable: boolean +} + +export function getAccountMetaRefSerializer(): Serializer { + return struct( + [ + ['pubkey', getAddressLocatorSerializer()], + ['isWritable', bool()], + ], + { description: 'AccountMetaRef' } + ) as Serializer +} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts new file mode 100644 index 000000000..5ef83846a --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts @@ -0,0 +1,86 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { PublicKey } from '@metaplex-foundation/umi' +import { + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + dataEnum, + publicKey as publicKeySerializer, + struct, + tuple, + u8, + unit, +} from '@metaplex-foundation/umi/serializers' + +/** + * A generic account locator used in LZ execution planning for V2. + * Can reference the address directly, via ALT, or as a placeholder. + * + * This enum enables the compact account referencing design of V2, supporting: + * - OApps to request multiple signer accounts, not just a single Executor EOA + * - Dynamic creation of writable EOA-based data accounts + * - Efficient encoding of addresses via ALTs, reducing account list size + * + * The legacy is_signer flag is removed. Instead, signer roles are explicitly + * declared through Payer and indexed Signer(u8) variants. + */ + +export type AddressLocator = + | { __kind: 'Address'; fields: [PublicKey] } + | { __kind: 'AltIndex'; fields: [number, number] } + | { __kind: 'Payer' } + | { __kind: 'Signer'; fields: [number] } + | { __kind: 'Context' } + +export type AddressLocatorArgs = AddressLocator + +export function getAddressLocatorSerializer(): Serializer { + return dataEnum( + [ + [ + 'Address', + struct>([['fields', tuple([publicKeySerializer()])]]), + ], + ['AltIndex', struct>([['fields', tuple([u8(), u8()])]])], + ['Payer', unit()], + ['Signer', struct>([['fields', tuple([u8()])]])], + ['Context', unit()], + ], + { description: 'AddressLocator' } + ) as Serializer +} + +// Data Enum Helpers. +export function addressLocator( + kind: 'Address', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind +export function addressLocator( + kind: 'AltIndex', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind +export function addressLocator(kind: 'Payer'): GetDataEnumKind +export function addressLocator( + kind: 'Signer', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind +export function addressLocator(kind: 'Context'): GetDataEnumKind +export function addressLocator( + kind: K, + data?: any +): Extract { + return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } +} +export function isAddressLocator( + kind: K, + value: AddressLocator +): value is AddressLocator & { __kind: K } { + return value.__kind === kind +} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts new file mode 100644 index 000000000..53dbbf974 --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts @@ -0,0 +1,125 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { PublicKey } from '@metaplex-foundation/umi' +import { + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + array, + bytes, + dataEnum, + publicKey as publicKeySerializer, + struct, + u32, +} from '@metaplex-foundation/umi/serializers' +import { AccountMetaRef, AccountMetaRefArgs, getAccountMetaRefSerializer } from '.' + +/** + * The list of instructions that can be executed in the LzReceive transaction. + * + * V2's multi-instruction model enables complex patterns such as: + * - Preprocessing steps before lz_receive (e.g., account initialization) + * - Postprocessing steps after lz_receive (e.g., verification, cleanup) + * - ABA messaging patterns with additional LayerZero sends + * - Conditional execution flows based on message content + */ + +export type Instruction = + | { + __kind: 'LzReceive' + /** + * Account list for the lz_receive instruction + * Uses AddressLocator for flexible address resolution + */ + accounts: Array + } + | { + __kind: 'Standard' + /** Target program ID for the custom instruction */ + programId: PublicKey + /** + * Account list for the custom instruction + * Uses same AddressLocator system as LzReceive + */ + accounts: Array + /** + * Instruction data payload + * Raw bytes containing the instruction's parameters + */ + data: Uint8Array + } + +export type InstructionArgs = + | { + __kind: 'LzReceive' + /** + * Account list for the lz_receive instruction + * Uses AddressLocator for flexible address resolution + */ + accounts: Array + } + | { + __kind: 'Standard' + /** Target program ID for the custom instruction */ + programId: PublicKey + /** + * Account list for the custom instruction + * Uses same AddressLocator system as LzReceive + */ + accounts: Array + /** + * Instruction data payload + * Raw bytes containing the instruction's parameters + */ + data: Uint8Array + } + +export function getInstructionSerializer(): Serializer { + return dataEnum( + [ + [ + 'LzReceive', + struct>([ + ['accounts', array(getAccountMetaRefSerializer())], + ]), + ], + [ + 'Standard', + struct>([ + ['programId', publicKeySerializer()], + ['accounts', array(getAccountMetaRefSerializer())], + ['data', bytes({ size: u32() })], + ]), + ], + ], + { description: 'Instruction' } + ) as Serializer +} + +// Data Enum Helpers. +export function instruction( + kind: 'LzReceive', + data: GetDataEnumKindContent +): GetDataEnumKind +export function instruction( + kind: 'Standard', + data: GetDataEnumKindContent +): GetDataEnumKind +export function instruction( + kind: K, + data?: any +): Extract { + return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } +} +export function isInstruction( + kind: K, + value: Instruction +): value is Instruction & { __kind: K } { + return value.__kind === kind +} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts deleted file mode 100644 index 15771c19b..000000000 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/kinobi-so/kinobi - */ - -import { PublicKey } from '@metaplex-foundation/umi' -import { Serializer, bool, publicKey as publicKeySerializer, struct } from '@metaplex-foundation/umi/serializers' - -/** same to anchor_lang::prelude::AccountMeta */ -export type LzAccount = { - pubkey: PublicKey - isSigner: boolean - isWritable: boolean -} - -export type LzAccountArgs = LzAccount - -export function getLzAccountSerializer(): Serializer { - return struct( - [ - ['pubkey', publicKeySerializer()], - ['isSigner', bool()], - ['isWritable', bool()], - ], - { description: 'LzAccount' } - ) as Serializer -} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts new file mode 100644 index 000000000..8b36124ed --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts @@ -0,0 +1,66 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { PublicKey } from '@metaplex-foundation/umi' +import { Serializer, array, publicKey as publicKeySerializer, struct, u8 } from '@metaplex-foundation/umi/serializers' +import { Instruction, InstructionArgs, getInstructionSerializer } from '.' + +/** + * Output of the lz_receive_types_v2 instruction. + * + * This structure enables the multi-instruction execution model where OApps can + * define multiple instructions to be executed atomically by the Executor. + * The Executor constructs a single transaction containing all returned instructions. + */ + +export type LzReceiveTypesV2Result = { + /** The version of context account */ + contextVersion: number + /** + * ALTs required for this execution context + * Used by the Executor to resolve AltIndex references in AccountMetaRef + * Enables efficient account list compression for complex transactions + */ + alts: Array + /** + * The complete list of instructions required for LzReceive execution + * MUST include exactly one LzReceive instruction + * MAY include additional Standard instructions for preprocessing/postprocessing + * Instructions are executed in the order returned + */ + instructions: Array +} + +export type LzReceiveTypesV2ResultArgs = { + /** The version of context account */ + contextVersion: number + /** + * ALTs required for this execution context + * Used by the Executor to resolve AltIndex references in AccountMetaRef + * Enables efficient account list compression for complex transactions + */ + alts: Array + /** + * The complete list of instructions required for LzReceive execution + * MUST include exactly one LzReceive instruction + * MAY include additional Standard instructions for preprocessing/postprocessing + * Instructions are executed in the order returned + */ + instructions: Array +} + +export function getLzReceiveTypesV2ResultSerializer(): Serializer { + return struct( + [ + ['contextVersion', u8()], + ['alts', array(publicKeySerializer())], + ['instructions', array(getInstructionSerializer())], + ], + { description: 'LzReceiveTypesV2Result' } + ) as Serializer +} From 9a66e43315c8ba3e4a28b10b325d88003bfb74c5 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:09:29 -0300 Subject: [PATCH 07/24] update generated --- .../my_oapp/accounts/endpointSettings.ts | 2 +- .../accounts/lzReceiveTypesAccounts.ts | 25 +++++++++++++++---- .../generated/my_oapp/accounts/peerConfig.ts | 2 +- .../generated/my_oapp/accounts/store.ts | 2 +- .../client/generated/my_oapp/errors/myOapp.ts | 2 +- .../generated/my_oapp/instructions/index.ts | 3 ++- .../my_oapp/instructions/lzReceive.ts | 9 ++++++- .../my_oapp/instructions/quoteSend.ts | 2 +- .../generated/my_oapp/instructions/send.ts | 8 +++++- .../my_oapp/instructions/setPeerConfig.ts | 5 +++- .../generated/my_oapp/programs/myOapp.ts | 5 ++-- .../client/generated/my_oapp/types/index.ts | 5 +++- 12 files changed, 52 insertions(+), 18 deletions(-) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts index 0e2d2c4af..5ba37c5fb 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts @@ -124,7 +124,7 @@ export async function safeFetchAllEndpointSettings( } export function getEndpointSettingsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts index e22ebdbdc..0a2fd22ef 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts @@ -25,17 +25,23 @@ import { mapSerializer, publicKey as publicKeySerializer, struct, + u8, } from '@metaplex-foundation/umi/serializers' -/** LzReceiveTypesAccounts includes accounts that are used in the LzReceiveTypes instruction. */ export type LzReceiveTypesAccounts = Account export type LzReceiveTypesAccountsAccountData = { discriminator: Uint8Array store: PublicKey + alt: PublicKey + bump: number } -export type LzReceiveTypesAccountsAccountDataArgs = { store: PublicKey } +export type LzReceiveTypesAccountsAccountDataArgs = { + store: PublicKey + alt: PublicKey + bump: number +} export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< LzReceiveTypesAccountsAccountDataArgs, @@ -46,6 +52,8 @@ export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< [ ['discriminator', bytes({ size: 8 })], ['store', publicKeySerializer()], + ['alt', publicKeySerializer()], + ['bump', u8()], ], { description: 'LzReceiveTypesAccountsAccountData' } ), @@ -109,16 +117,23 @@ export async function safeFetchAllLzReceiveTypesAccounts( } export function getLzReceiveTypesAccountsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) - .registerFields<{ discriminator: Uint8Array; store: PublicKey }>({ + .registerFields<{ + discriminator: Uint8Array + store: PublicKey + alt: PublicKey + bump: number + }>({ discriminator: [0, bytes({ size: 8 })], store: [8, publicKeySerializer()], + alt: [40, publicKeySerializer()], + bump: [72, u8()], }) .deserializeUsing((account) => deserializeLzReceiveTypesAccounts(account)) .whereField('discriminator', new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126])) } export function getLzReceiveTypesAccountsSize(): number { - return 40 + return 73 } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts index c8cf3b6ea..98e0a11d4 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts @@ -108,7 +108,7 @@ export async function safeFetchAllPeerConfig( } export function getPeerConfigGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts index 2ba28e4e3..fa50e9ba6 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts @@ -118,7 +118,7 @@ export async function safeFetchAllStore( } export function getStoreGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts index 7296cf805..b7dd3da2f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts @@ -12,7 +12,7 @@ type ProgramErrorConstructor = new (program: Program, cause?: Error) => ProgramE const codeToErrorMap: Map = new Map() const nameToErrorMap: Map = new Map() -/** InvalidMessageType */ +/** InvalidMessageType: */ export class InvalidMessageTypeError extends ProgramError { override readonly name: string = 'InvalidMessageType' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts index 148e47ba1..0668265aa 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts @@ -8,7 +8,8 @@ export * from './initStore' export * from './lzReceive' -export * from './lzReceiveTypes' +export * from './lzReceiveTypesInfo' +export * from './lzReceiveTypesV2' export * from './quoteSend' export * from './send' export * from './setPeerConfig' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts index 863ba4eae..73b414e33 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts @@ -13,7 +13,14 @@ import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } fr // Accounts. export type LzReceiveInstructionAccounts = { + /** + * OApp Store PDA. This account represents the "address" of your OApp on + * Solana and can contain any state relevant to your application. + * Customize the fields in `Store` as needed. + */ + store: PublicKey | Pda + /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ peer: PublicKey | Pda } @@ -53,7 +60,7 @@ export function lzReceive( input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts index d6f460d2c..8638b1c7f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts @@ -67,7 +67,7 @@ export function quoteSend( input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts index 005a63753..ab73d8d06 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts @@ -12,7 +12,13 @@ import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners // Accounts. export type SendInstructionAccounts = { + /** + * Configuration for the destination chain. Holds the peer address and any + * enforced messaging options. + */ + peer: PublicKey | Pda + /** OApp Store PDA that signs the send instruction */ store: PublicKey | Pda endpoint: PublicKey | Pda } @@ -64,7 +70,7 @@ export function send( input: SendInstructionAccounts & SendInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts index 68fc3c594..3b0e5fb9a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts @@ -13,8 +13,11 @@ import { PeerConfigParam, PeerConfigParamArgs, getPeerConfigParamSerializer } fr // Accounts. export type SetPeerConfigInstructionAccounts = { + /** Admin of the OApp store */ admin: Signer + /** Peer configuration PDA for a specific remote chain */ peer: PublicKey | Pda + /** Store PDA of this OApp */ store: PublicKey | Pda systemProgram?: PublicKey | Pda } @@ -60,7 +63,7 @@ export function setPeerConfig( input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts index d767c0131..8cc8afeb2 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts @@ -9,12 +9,11 @@ import { ClusterFilter, Context, Program, PublicKey } from '@metaplex-foundation/umi' import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors' -export const MY_OAPP_PROGRAM_ID = - 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay' as PublicKey<'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay'> +export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''> export function createMyOappProgram(): Program { return { - name: 'myoapp', + name: 'myOapp', publicKey: MY_OAPP_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { return getMyOappErrorFromCode(code, this, cause) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts index 5cc85a6f0..3c6132257 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts @@ -6,8 +6,11 @@ * @see https://github.com/kinobi-so/kinobi */ +export * from './accountMetaRef' +export * from './addressLocator' export * from './enforcedOptions' -export * from './lzAccount' +export * from './instruction' export * from './lzReceiveParams' +export * from './lzReceiveTypesV2Result' export * from './messagingFee' export * from './peerConfigParam' From 3e222bc6300047744b1432e25a678bf7c9d1e225 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:11:07 -0300 Subject: [PATCH 08/24] generated --- .../my_oapp/accounts/endpointSettings.ts | 232 ++++++++++-------- .../generated/my_oapp/accounts/index.ts | 8 +- .../accounts/lzReceiveTypesAccounts.ts | 221 +++++++++-------- .../generated/my_oapp/accounts/peerConfig.ts | 202 ++++++++------- .../generated/my_oapp/accounts/store.ts | 210 ++++++++-------- .../client/generated/my_oapp/errors/index.ts | 2 +- .../client/generated/my_oapp/errors/myOapp.ts | 45 ++-- .../lib/client/generated/my_oapp/index.ts | 12 +- .../generated/my_oapp/instructions/index.ts | 14 +- .../my_oapp/instructions/initStore.ts | 195 ++++++++------- .../my_oapp/instructions/lzReceive.ts | 145 ++++++----- .../instructions/lzReceiveTypesInfo.ts | 158 +++++++----- .../my_oapp/instructions/lzReceiveTypesV2.ts | 137 +++++++---- .../my_oapp/instructions/quoteSend.ts | 168 ++++++++----- .../generated/my_oapp/instructions/send.ts | 177 +++++++------ .../my_oapp/instructions/setPeerConfig.ts | 192 +++++++++------ .../generated/my_oapp/programs/index.ts | 2 +- .../generated/my_oapp/programs/myOapp.ts | 54 ++-- .../client/generated/my_oapp/shared/index.ts | 100 ++++---- .../generated/my_oapp/types/accountMetaRef.ts | 47 ++-- .../generated/my_oapp/types/addressLocator.ts | 117 +++++---- .../my_oapp/types/enforcedOptions.ts | 30 ++- .../client/generated/my_oapp/types/index.ts | 16 +- .../generated/my_oapp/types/instruction.ts | 189 +++++++------- .../my_oapp/types/lzReceiveParams.ts | 63 +++-- .../my_oapp/types/lzReceiveTypesV2Result.ts | 97 ++++---- .../generated/my_oapp/types/messagingFee.ts | 29 ++- .../my_oapp/types/peerConfigParam.ts | 91 +++---- 28 files changed, 1691 insertions(+), 1262 deletions(-) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts index 5ba37c5fb..3d3965b4b 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts @@ -7,138 +7,162 @@ */ import { - Account, - Context, - Option, - OptionOrNullable, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi' + Account, + Context, + Option, + OptionOrNullable, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; import { - Serializer, - bytes, - mapSerializer, - option, - publicKey as publicKeySerializer, - struct, - u32, - u8, -} from '@metaplex-foundation/umi/serializers' + Serializer, + bytes, + mapSerializer, + option, + publicKey as publicKeySerializer, + struct, + u32, + u8, +} from '@metaplex-foundation/umi/serializers'; -export type EndpointSettings = Account +export type EndpointSettings = Account; export type EndpointSettingsAccountData = { - discriminator: Uint8Array - eid: number - bump: number - admin: PublicKey - lzTokenMint: Option -} + discriminator: Uint8Array; + eid: number; + bump: number; + admin: PublicKey; + lzTokenMint: Option; +}; export type EndpointSettingsAccountDataArgs = { - eid: number - bump: number - admin: PublicKey - lzTokenMint: OptionOrNullable -} + eid: number; + bump: number; + admin: PublicKey; + lzTokenMint: OptionOrNullable; +}; export function getEndpointSettingsAccountDataSerializer(): Serializer< + EndpointSettingsAccountDataArgs, + EndpointSettingsAccountData +> { + return mapSerializer< EndpointSettingsAccountDataArgs, + any, EndpointSettingsAccountData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['eid', u32()], - ['bump', u8()], - ['admin', publicKeySerializer()], - ['lzTokenMint', option(publicKeySerializer())], - ], - { description: 'EndpointSettingsAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['eid', u32()], + ['bump', u8()], + ['admin', publicKeySerializer()], + ['lzTokenMint', option(publicKeySerializer())], + ], + { description: 'EndpointSettingsAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]), + }) + ) as Serializer; } -export function deserializeEndpointSettings(rawAccount: RpcAccount): EndpointSettings { - return deserializeAccount(rawAccount, getEndpointSettingsAccountDataSerializer()) +export function deserializeEndpointSettings( + rawAccount: RpcAccount +): EndpointSettings { + return deserializeAccount( + rawAccount, + getEndpointSettingsAccountDataSerializer() + ); } export async function fetchEndpointSettings( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - assertAccountExists(maybeAccount, 'EndpointSettings') - return deserializeEndpointSettings(maybeAccount) + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'EndpointSettings'); + return deserializeEndpointSettings(maybeAccount); } export async function safeFetchEndpointSettings( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - return maybeAccount.exists ? deserializeEndpointSettings(maybeAccount) : null + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists ? deserializeEndpointSettings(maybeAccount) : null; } export async function fetchAllEndpointSettings( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'EndpointSettings') - return deserializeEndpointSettings(maybeAccount) - }) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'EndpointSettings'); + return deserializeEndpointSettings(maybeAccount); + }); } export async function safeFetchAllEndpointSettings( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => deserializeEndpointSettings(maybeAccount as RpcAccount)) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => + deserializeEndpointSettings(maybeAccount as RpcAccount) + ); } -export function getEndpointSettingsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array - eid: number - bump: number - admin: PublicKey - lzTokenMint: OptionOrNullable - }>({ - discriminator: [0, bytes({ size: 8 })], - eid: [8, u32()], - bump: [12, u8()], - admin: [13, publicKeySerializer()], - lzTokenMint: [45, option(publicKeySerializer())], - }) - .deserializeUsing((account) => deserializeEndpointSettings(account)) - .whereField('discriminator', new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14])) +export function getEndpointSettingsGpaBuilder( + context: Pick +) { + const programId = context.programs.getPublicKey('myOapp', ''); + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array; + eid: number; + bump: number; + admin: PublicKey; + lzTokenMint: OptionOrNullable; + }>({ + discriminator: [0, bytes({ size: 8 })], + eid: [8, u32()], + bump: [12, u8()], + admin: [13, publicKeySerializer()], + lzTokenMint: [45, option(publicKeySerializer())], + }) + .deserializeUsing((account) => + deserializeEndpointSettings(account) + ) + .whereField( + 'discriminator', + new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]) + ); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts index 6715ff0fa..f7b5f898a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts @@ -6,7 +6,7 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './endpointSettings' -export * from './lzReceiveTypesAccounts' -export * from './peerConfig' -export * from './store' +export * from './endpointSettings'; +export * from './lzReceiveTypesAccounts'; +export * from './peerConfig'; +export * from './store'; diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts index 0a2fd22ef..552c7afde 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts @@ -7,133 +7,162 @@ */ import { - Account, - Context, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi' + Account, + Context, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; import { - Serializer, - bytes, - mapSerializer, - publicKey as publicKeySerializer, - struct, - u8, -} from '@metaplex-foundation/umi/serializers' + Serializer, + bytes, + mapSerializer, + publicKey as publicKeySerializer, + struct, + u8, +} from '@metaplex-foundation/umi/serializers'; -export type LzReceiveTypesAccounts = Account +export type LzReceiveTypesAccounts = Account; export type LzReceiveTypesAccountsAccountData = { - discriminator: Uint8Array - store: PublicKey - alt: PublicKey - bump: number -} + discriminator: Uint8Array; + store: PublicKey; + alt: PublicKey; + bump: number; +}; export type LzReceiveTypesAccountsAccountDataArgs = { - store: PublicKey - alt: PublicKey - bump: number -} + store: PublicKey; + alt: PublicKey; + bump: number; +}; export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< + LzReceiveTypesAccountsAccountDataArgs, + LzReceiveTypesAccountsAccountData +> { + return mapSerializer< LzReceiveTypesAccountsAccountDataArgs, + any, LzReceiveTypesAccountsAccountData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['store', publicKeySerializer()], - ['alt', publicKeySerializer()], - ['bump', u8()], - ], - { description: 'LzReceiveTypesAccountsAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['store', publicKeySerializer()], + ['alt', publicKeySerializer()], + ['bump', u8()], + ], + { description: 'LzReceiveTypesAccountsAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]), + }) + ) as Serializer< + LzReceiveTypesAccountsAccountDataArgs, + LzReceiveTypesAccountsAccountData + >; } -export function deserializeLzReceiveTypesAccounts(rawAccount: RpcAccount): LzReceiveTypesAccounts { - return deserializeAccount(rawAccount, getLzReceiveTypesAccountsAccountDataSerializer()) +export function deserializeLzReceiveTypesAccounts( + rawAccount: RpcAccount +): LzReceiveTypesAccounts { + return deserializeAccount( + rawAccount, + getLzReceiveTypesAccountsAccountDataSerializer() + ); } export async function fetchLzReceiveTypesAccounts( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts') - return deserializeLzReceiveTypesAccounts(maybeAccount) + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts'); + return deserializeLzReceiveTypesAccounts(maybeAccount); } export async function safeFetchLzReceiveTypesAccounts( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - return maybeAccount.exists ? deserializeLzReceiveTypesAccounts(maybeAccount) : null + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists + ? deserializeLzReceiveTypesAccounts(maybeAccount) + : null; } export async function fetchAllLzReceiveTypesAccounts( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts') - return deserializeLzReceiveTypesAccounts(maybeAccount) - }) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts'); + return deserializeLzReceiveTypesAccounts(maybeAccount); + }); } export async function safeFetchAllLzReceiveTypesAccounts( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => deserializeLzReceiveTypesAccounts(maybeAccount as RpcAccount)) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => + deserializeLzReceiveTypesAccounts(maybeAccount as RpcAccount) + ); } -export function getLzReceiveTypesAccountsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array - store: PublicKey - alt: PublicKey - bump: number - }>({ - discriminator: [0, bytes({ size: 8 })], - store: [8, publicKeySerializer()], - alt: [40, publicKeySerializer()], - bump: [72, u8()], - }) - .deserializeUsing((account) => deserializeLzReceiveTypesAccounts(account)) - .whereField('discriminator', new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126])) +export function getLzReceiveTypesAccountsGpaBuilder( + context: Pick +) { + const programId = context.programs.getPublicKey('myOapp', ''); + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array; + store: PublicKey; + alt: PublicKey; + bump: number; + }>({ + discriminator: [0, bytes({ size: 8 })], + store: [8, publicKeySerializer()], + alt: [40, publicKeySerializer()], + bump: [72, u8()], + }) + .deserializeUsing((account) => + deserializeLzReceiveTypesAccounts(account) + ) + .whereField( + 'discriminator', + new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]) + ); } export function getLzReceiveTypesAccountsSize(): number { - return 73 + return 73; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts index 98e0a11d4..41f8e9c66 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts @@ -7,120 +7,144 @@ */ import { - Account, - Context, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, struct, u8 } from '@metaplex-foundation/umi/serializers' -import { EnforcedOptions, EnforcedOptionsArgs, getEnforcedOptionsSerializer } from '../types' + Account, + Context, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + struct, + u8, +} from '@metaplex-foundation/umi/serializers'; +import { + EnforcedOptions, + EnforcedOptionsArgs, + getEnforcedOptionsSerializer, +} from '../types'; -export type PeerConfig = Account +export type PeerConfig = Account; export type PeerConfigAccountData = { - discriminator: Uint8Array - peerAddress: Uint8Array - enforcedOptions: EnforcedOptions - bump: number -} + discriminator: Uint8Array; + peerAddress: Uint8Array; + enforcedOptions: EnforcedOptions; + bump: number; +}; export type PeerConfigAccountDataArgs = { - peerAddress: Uint8Array - enforcedOptions: EnforcedOptionsArgs - bump: number -} + peerAddress: Uint8Array; + enforcedOptions: EnforcedOptionsArgs; + bump: number; +}; -export function getPeerConfigAccountDataSerializer(): Serializer { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['peerAddress', bytes({ size: 32 })], - ['enforcedOptions', getEnforcedOptionsSerializer()], - ['bump', u8()], - ], - { description: 'PeerConfigAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]), - }) - ) as Serializer +export function getPeerConfigAccountDataSerializer(): Serializer< + PeerConfigAccountDataArgs, + PeerConfigAccountData +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['peerAddress', bytes({ size: 32 })], + ['enforcedOptions', getEnforcedOptionsSerializer()], + ['bump', u8()], + ], + { description: 'PeerConfigAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]), + }) + ) as Serializer; } export function deserializePeerConfig(rawAccount: RpcAccount): PeerConfig { - return deserializeAccount(rawAccount, getPeerConfigAccountDataSerializer()) + return deserializeAccount(rawAccount, getPeerConfigAccountDataSerializer()); } export async function fetchPeerConfig( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - assertAccountExists(maybeAccount, 'PeerConfig') - return deserializePeerConfig(maybeAccount) + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'PeerConfig'); + return deserializePeerConfig(maybeAccount); } export async function safeFetchPeerConfig( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - return maybeAccount.exists ? deserializePeerConfig(maybeAccount) : null + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists ? deserializePeerConfig(maybeAccount) : null; } export async function fetchAllPeerConfig( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'PeerConfig') - return deserializePeerConfig(maybeAccount) - }) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'PeerConfig'); + return deserializePeerConfig(maybeAccount); + }); } export async function safeFetchAllPeerConfig( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => deserializePeerConfig(maybeAccount as RpcAccount)) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => deserializePeerConfig(maybeAccount as RpcAccount)); } -export function getPeerConfigGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array - peerAddress: Uint8Array - enforcedOptions: EnforcedOptionsArgs - bump: number - }>({ - discriminator: [0, bytes({ size: 8 })], - peerAddress: [8, bytes({ size: 32 })], - enforcedOptions: [40, getEnforcedOptionsSerializer()], - bump: [null, u8()], - }) - .deserializeUsing((account) => deserializePeerConfig(account)) - .whereField('discriminator', new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203])) +export function getPeerConfigGpaBuilder( + context: Pick +) { + const programId = context.programs.getPublicKey('myOapp', ''); + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array; + peerAddress: Uint8Array; + enforcedOptions: EnforcedOptionsArgs; + bump: number; + }>({ + discriminator: [0, bytes({ size: 8 })], + peerAddress: [8, bytes({ size: 32 })], + enforcedOptions: [40, getEnforcedOptionsSerializer()], + bump: [null, u8()], + }) + .deserializeUsing((account) => deserializePeerConfig(account)) + .whereField( + 'discriminator', + new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]) + ); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts index fa50e9ba6..177ac3ccb 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts @@ -7,132 +7,144 @@ */ import { - Account, - Context, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi' + Account, + Context, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi'; import { - Serializer, - bytes, - mapSerializer, - publicKey as publicKeySerializer, - string, - struct, - u8, -} from '@metaplex-foundation/umi/serializers' + Serializer, + bytes, + mapSerializer, + publicKey as publicKeySerializer, + string, + struct, + u8, +} from '@metaplex-foundation/umi/serializers'; -export type Store = Account +export type Store = Account; export type StoreAccountData = { - discriminator: Uint8Array - admin: PublicKey - bump: number - endpointProgram: PublicKey - string: string -} + discriminator: Uint8Array; + admin: PublicKey; + bump: number; + endpointProgram: PublicKey; + string: string; +}; export type StoreAccountDataArgs = { - admin: PublicKey - bump: number - endpointProgram: PublicKey - string: string -} + admin: PublicKey; + bump: number; + endpointProgram: PublicKey; + string: string; +}; -export function getStoreAccountDataSerializer(): Serializer { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['admin', publicKeySerializer()], - ['bump', u8()], - ['endpointProgram', publicKeySerializer()], - ['string', string()], - ], - { description: 'StoreAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]), - }) - ) as Serializer +export function getStoreAccountDataSerializer(): Serializer< + StoreAccountDataArgs, + StoreAccountData +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['admin', publicKeySerializer()], + ['bump', u8()], + ['endpointProgram', publicKeySerializer()], + ['string', string()], + ], + { description: 'StoreAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]), + }) + ) as Serializer; } export function deserializeStore(rawAccount: RpcAccount): Store { - return deserializeAccount(rawAccount, getStoreAccountDataSerializer()) + return deserializeAccount(rawAccount, getStoreAccountDataSerializer()); } export async function fetchStore( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - assertAccountExists(maybeAccount, 'Store') - return deserializeStore(maybeAccount) + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + assertAccountExists(maybeAccount, 'Store'); + return deserializeStore(maybeAccount); } export async function safeFetchStore( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) - return maybeAccount.exists ? deserializeStore(maybeAccount) : null + const maybeAccount = await context.rpc.getAccount( + toPublicKey(publicKey, false), + options + ); + return maybeAccount.exists ? deserializeStore(maybeAccount) : null; } export async function fetchAllStore( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'Store') - return deserializeStore(maybeAccount) - }) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'Store'); + return deserializeStore(maybeAccount); + }); } export async function safeFetchAllStore( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ) - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => deserializeStore(maybeAccount as RpcAccount)) + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ); + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => deserializeStore(maybeAccount as RpcAccount)); } export function getStoreGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array - admin: PublicKey - bump: number - endpointProgram: PublicKey - string: string - }>({ - discriminator: [0, bytes({ size: 8 })], - admin: [8, publicKeySerializer()], - bump: [40, u8()], - endpointProgram: [41, publicKeySerializer()], - string: [73, string()], - }) - .deserializeUsing((account) => deserializeStore(account)) - .whereField('discriminator', new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26])) + const programId = context.programs.getPublicKey('myOapp', ''); + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array; + admin: PublicKey; + bump: number; + endpointProgram: PublicKey; + string: string; + }>({ + discriminator: [0, bytes({ size: 8 })], + admin: [8, publicKeySerializer()], + bump: [40, u8()], + endpointProgram: [41, publicKeySerializer()], + string: [73, string()], + }) + .deserializeUsing((account) => deserializeStore(account)) + .whereField( + 'discriminator', + new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]) + ); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts index a38217af5..626465801 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './myOapp' +export * from './myOapp'; diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts index b7dd3da2f..33d62ca68 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts @@ -6,39 +6,50 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Program, ProgramError } from '@metaplex-foundation/umi' +import { Program, ProgramError } from '@metaplex-foundation/umi'; -type ProgramErrorConstructor = new (program: Program, cause?: Error) => ProgramError -const codeToErrorMap: Map = new Map() -const nameToErrorMap: Map = new Map() +type ProgramErrorConstructor = new ( + program: Program, + cause?: Error +) => ProgramError; +const codeToErrorMap: Map = new Map(); +const nameToErrorMap: Map = new Map(); /** InvalidMessageType: */ export class InvalidMessageTypeError extends ProgramError { - override readonly name: string = 'InvalidMessageType' + override readonly name: string = 'InvalidMessageType'; - readonly code: number = 0x1770 // 6000 + readonly code: number = 0x1770; // 6000 - constructor(program: Program, cause?: Error) { - super('', program, cause) - } + constructor(program: Program, cause?: Error) { + super('', program, cause); + } } -codeToErrorMap.set(0x1770, InvalidMessageTypeError) -nameToErrorMap.set('InvalidMessageType', InvalidMessageTypeError) +codeToErrorMap.set(0x1770, InvalidMessageTypeError); +nameToErrorMap.set('InvalidMessageType', InvalidMessageTypeError); /** * Attempts to resolve a custom program error from the provided error code. * @category Errors */ -export function getMyOappErrorFromCode(code: number, program: Program, cause?: Error): ProgramError | null { - const constructor = codeToErrorMap.get(code) - return constructor ? new constructor(program, cause) : null +export function getMyOappErrorFromCode( + code: number, + program: Program, + cause?: Error +): ProgramError | null { + const constructor = codeToErrorMap.get(code); + return constructor ? new constructor(program, cause) : null; } /** * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors */ -export function getMyOappErrorFromName(name: string, program: Program, cause?: Error): ProgramError | null { - const constructor = nameToErrorMap.get(name) - return constructor ? new constructor(program, cause) : null +export function getMyOappErrorFromName( + name: string, + program: Program, + cause?: Error +): ProgramError | null { + const constructor = nameToErrorMap.get(name); + return constructor ? new constructor(program, cause) : null; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/index.ts index 442708c95..4679ed0f1 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/index.ts @@ -6,9 +6,9 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './accounts' -export * from './errors' -export * from './instructions' -export * from './programs' -export * from './shared' -export * from './types' +export * from './accounts'; +export * from './errors'; +export * from './instructions'; +export * from './programs'; +export * from './shared'; +export * from './types'; diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts index 0668265aa..b767508cf 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts @@ -6,10 +6,10 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './initStore' -export * from './lzReceive' -export * from './lzReceiveTypesInfo' -export * from './lzReceiveTypesV2' -export * from './quoteSend' -export * from './send' -export * from './setPeerConfig' +export * from './initStore'; +export * from './lzReceive'; +export * from './lzReceiveTypesInfo'; +export * from './lzReceiveTypesV2'; +export * from './quoteSend'; +export * from './send'; +export * from './setPeerConfig'; diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts index 5360f67ad..e0fbf8e88 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts @@ -6,117 +6,142 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, Signer, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' import { - Serializer, - bytes, - mapSerializer, - publicKey as publicKeySerializer, - struct, -} from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' + Context, + Pda, + PublicKey, + Signer, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + publicKey as publicKeySerializer, + struct, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; // Accounts. export type InitStoreInstructionAccounts = { - payer?: Signer - store: PublicKey | Pda - lzReceiveTypesAccounts: PublicKey | Pda - systemProgram?: PublicKey | Pda -} + payer?: Signer; + store: PublicKey | Pda; + lzReceiveTypesAccounts: PublicKey | Pda; + systemProgram?: PublicKey | Pda; +}; // Data. export type InitStoreInstructionData = { - discriminator: Uint8Array - admin: PublicKey - endpoint: PublicKey -} + discriminator: Uint8Array; + admin: PublicKey; + endpoint: PublicKey; +}; export type InitStoreInstructionDataArgs = { - admin: PublicKey - endpoint: PublicKey -} + admin: PublicKey; + endpoint: PublicKey; +}; export function getInitStoreInstructionDataSerializer(): Serializer< + InitStoreInstructionDataArgs, + InitStoreInstructionData +> { + return mapSerializer< InitStoreInstructionDataArgs, + any, InitStoreInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['admin', publicKeySerializer()], - ['endpoint', publicKeySerializer()], - ], - { description: 'InitStoreInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([250, 74, 6, 95, 163, 188, 19, 181]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['admin', publicKeySerializer()], + ['endpoint', publicKeySerializer()], + ], + { description: 'InitStoreInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([250, 74, 6, 95, 163, 188, 19, 181]), + }) + ) as Serializer; } // Args. -export type InitStoreInstructionArgs = InitStoreInstructionDataArgs +export type InitStoreInstructionArgs = InitStoreInstructionDataArgs; // Instruction. export function initStore( - context: Pick, - input: InitStoreInstructionAccounts & InitStoreInstructionArgs + context: Pick, + input: InitStoreInstructionAccounts & InitStoreInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - payer: { - index: 0, - isWritable: true as boolean, - value: input.payer ?? null, - }, - store: { - index: 1, - isWritable: true as boolean, - value: input.store ?? null, - }, - lzReceiveTypesAccounts: { - index: 2, - isWritable: true as boolean, - value: input.lzReceiveTypesAccounts ?? null, - }, - systemProgram: { - index: 3, - isWritable: false as boolean, - value: input.systemProgram ?? null, - }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + payer: { + index: 0, + isWritable: true as boolean, + value: input.payer ?? null, + }, + store: { + index: 1, + isWritable: true as boolean, + value: input.store ?? null, + }, + lzReceiveTypesAccounts: { + index: 2, + isWritable: true as boolean, + value: input.lzReceiveTypesAccounts ?? null, + }, + systemProgram: { + index: 3, + isWritable: false as boolean, + value: input.systemProgram ?? null, + }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: InitStoreInstructionArgs = { ...input } + // Arguments. + const resolvedArgs: InitStoreInstructionArgs = { ...input }; - // Default values. - if (!resolvedAccounts.payer.value) { - resolvedAccounts.payer.value = context.payer - } - if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = context.programs.getPublicKey( - 'splSystem', - '11111111111111111111111111111111' - ) - resolvedAccounts.systemProgram.isWritable = false - } + // Default values. + if (!resolvedAccounts.payer.value) { + resolvedAccounts.payer.value = context.payer; + } + if (!resolvedAccounts.systemProgram.value) { + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', + '11111111111111111111111111111111' + ); + resolvedAccounts.systemProgram.isWritable = false; + } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getInitStoreInstructionDataSerializer().serialize(resolvedArgs as InitStoreInstructionDataArgs) + // Data. + const data = getInitStoreInstructionDataSerializer().serialize( + resolvedArgs as InitStoreInstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts index 73b414e33..aa0653818 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts @@ -6,86 +6,119 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' -import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' +import { + Context, + Pda, + PublicKey, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + struct, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; +import { + LzReceiveParams, + LzReceiveParamsArgs, + getLzReceiveParamsSerializer, +} from '../types'; // Accounts. export type LzReceiveInstructionAccounts = { - /** - * OApp Store PDA. This account represents the "address" of your OApp on - * Solana and can contain any state relevant to your application. - * Customize the fields in `Store` as needed. - */ + /** + * OApp Store PDA. This account represents the "address" of your OApp on + * Solana and can contain any state relevant to your application. + * Customize the fields in `Store` as needed. + */ - store: PublicKey | Pda - /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ - peer: PublicKey | Pda -} + store: PublicKey | Pda; + /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ + peer: PublicKey | Pda; +}; // Data. export type LzReceiveInstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} + discriminator: Uint8Array; + params: LzReceiveParams; +}; -export type LzReceiveInstructionDataArgs = { params: LzReceiveParamsArgs } +export type LzReceiveInstructionDataArgs = { params: LzReceiveParamsArgs }; export function getLzReceiveInstructionDataSerializer(): Serializer< + LzReceiveInstructionDataArgs, + LzReceiveInstructionData +> { + return mapSerializer< LzReceiveInstructionDataArgs, + any, LzReceiveInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([8, 179, 120, 109, 33, 118, 189, 80]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([8, 179, 120, 109, 33, 118, 189, 80]), + }) + ) as Serializer; } // Args. -export type LzReceiveInstructionArgs = LzReceiveInstructionDataArgs +export type LzReceiveInstructionArgs = LzReceiveInstructionDataArgs; // Instruction. export function lzReceive( - context: Pick, - input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs + context: Pick, + input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: true as boolean, - value: input.store ?? null, - }, - peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: true as boolean, + value: input.store ?? null, + }, + peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: LzReceiveInstructionArgs = { ...input } + // Arguments. + const resolvedArgs: LzReceiveInstructionArgs = { ...input }; - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getLzReceiveInstructionDataSerializer().serialize(resolvedArgs as LzReceiveInstructionDataArgs) + // Data. + const data = getLzReceiveInstructionDataSerializer().serialize( + resolvedArgs as LzReceiveInstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts index 53cca9710..f7954c10c 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts @@ -6,92 +6,128 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' -import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' +import { + Context, + Pda, + PublicKey, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + struct, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; +import { + LzReceiveParams, + LzReceiveParamsArgs, + getLzReceiveParamsSerializer, +} from '../types'; // Accounts. export type LzReceiveTypesInfoInstructionAccounts = { - store: PublicKey | Pda - /** - * PDA account containing the versioned data structure for V2 - * Contains the accounts needed to construct lz_receive_types_v2 instruction - */ + store: PublicKey | Pda; + /** + * PDA account containing the versioned data structure for V2 + * Contains the accounts needed to construct lz_receive_types_v2 instruction + */ - lzReceiveTypesAccounts: PublicKey | Pda -} + lzReceiveTypesAccounts: PublicKey | Pda; +}; // Data. export type LzReceiveTypesInfoInstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} + discriminator: Uint8Array; + params: LzReceiveParams; +}; export type LzReceiveTypesInfoInstructionDataArgs = { - params: LzReceiveParamsArgs -} + params: LzReceiveParamsArgs; +}; export function getLzReceiveTypesInfoInstructionDataSerializer(): Serializer< + LzReceiveTypesInfoInstructionDataArgs, + LzReceiveTypesInfoInstructionData +> { + return mapSerializer< LzReceiveTypesInfoInstructionDataArgs, + any, LzReceiveTypesInfoInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveTypesInfoInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveTypesInfoInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]), + }) + ) as Serializer< + LzReceiveTypesInfoInstructionDataArgs, + LzReceiveTypesInfoInstructionData + >; } // Args. -export type LzReceiveTypesInfoInstructionArgs = LzReceiveTypesInfoInstructionDataArgs +export type LzReceiveTypesInfoInstructionArgs = + LzReceiveTypesInfoInstructionDataArgs; // Instruction. export function lzReceiveTypesInfo( - context: Pick, - input: LzReceiveTypesInfoInstructionAccounts & LzReceiveTypesInfoInstructionArgs + context: Pick, + input: LzReceiveTypesInfoInstructionAccounts & + LzReceiveTypesInfoInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - lzReceiveTypesAccounts: { - index: 1, - isWritable: false as boolean, - value: input.lzReceiveTypesAccounts ?? null, - }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + lzReceiveTypesAccounts: { + index: 1, + isWritable: false as boolean, + value: input.lzReceiveTypesAccounts ?? null, + }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: LzReceiveTypesInfoInstructionArgs = { ...input } + // Arguments. + const resolvedArgs: LzReceiveTypesInfoInstructionArgs = { ...input }; - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getLzReceiveTypesInfoInstructionDataSerializer().serialize( - resolvedArgs as LzReceiveTypesInfoInstructionDataArgs - ) + // Data. + const data = getLzReceiveTypesInfoInstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesInfoInstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts index 2e0c2a06b..c8b6cceae 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts @@ -6,81 +6,116 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' -import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' +import { + Context, + Pda, + PublicKey, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + struct, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; +import { + LzReceiveParams, + LzReceiveParamsArgs, + getLzReceiveParamsSerializer, +} from '../types'; // Accounts. export type LzReceiveTypesV2InstructionAccounts = { - store: PublicKey | Pda -} + store: PublicKey | Pda; +}; // Data. export type LzReceiveTypesV2InstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} + discriminator: Uint8Array; + params: LzReceiveParams; +}; export type LzReceiveTypesV2InstructionDataArgs = { - params: LzReceiveParamsArgs -} + params: LzReceiveParamsArgs; +}; export function getLzReceiveTypesV2InstructionDataSerializer(): Serializer< + LzReceiveTypesV2InstructionDataArgs, + LzReceiveTypesV2InstructionData +> { + return mapSerializer< LzReceiveTypesV2InstructionDataArgs, + any, LzReceiveTypesV2InstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveTypesV2InstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveTypesV2InstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]), + }) + ) as Serializer< + LzReceiveTypesV2InstructionDataArgs, + LzReceiveTypesV2InstructionData + >; } // Args. -export type LzReceiveTypesV2InstructionArgs = LzReceiveTypesV2InstructionDataArgs +export type LzReceiveTypesV2InstructionArgs = + LzReceiveTypesV2InstructionDataArgs; // Instruction. export function lzReceiveTypesV2( - context: Pick, - input: LzReceiveTypesV2InstructionAccounts & LzReceiveTypesV2InstructionArgs + context: Pick, + input: LzReceiveTypesV2InstructionAccounts & LzReceiveTypesV2InstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: LzReceiveTypesV2InstructionArgs = { ...input } + // Arguments. + const resolvedArgs: LzReceiveTypesV2InstructionArgs = { ...input }; - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getLzReceiveTypesV2InstructionDataSerializer().serialize( - resolvedArgs as LzReceiveTypesV2InstructionDataArgs - ) + // Data. + const data = getLzReceiveTypesV2InstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesV2InstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts index 8638b1c7f..6c6d20248 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts @@ -6,98 +6,130 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bool, bytes, mapSerializer, string, struct, u32 } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { + Context, + Pda, + PublicKey, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bool, + bytes, + mapSerializer, + string, + struct, + u32, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; // Accounts. export type QuoteSendInstructionAccounts = { - store: PublicKey | Pda - peer: PublicKey | Pda - endpoint: PublicKey | Pda -} + store: PublicKey | Pda; + peer: PublicKey | Pda; + endpoint: PublicKey | Pda; +}; // Data. export type QuoteSendInstructionData = { - discriminator: Uint8Array - dstEid: number - receiver: Uint8Array - message: string - options: Uint8Array - payInLzToken: boolean -} + discriminator: Uint8Array; + dstEid: number; + receiver: Uint8Array; + message: string; + options: Uint8Array; + payInLzToken: boolean; +}; export type QuoteSendInstructionDataArgs = { - dstEid: number - receiver: Uint8Array - message: string - options: Uint8Array - payInLzToken: boolean -} + dstEid: number; + receiver: Uint8Array; + message: string; + options: Uint8Array; + payInLzToken: boolean; +}; export function getQuoteSendInstructionDataSerializer(): Serializer< + QuoteSendInstructionDataArgs, + QuoteSendInstructionData +> { + return mapSerializer< QuoteSendInstructionDataArgs, + any, QuoteSendInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['dstEid', u32()], - ['receiver', bytes({ size: 32 })], - ['message', string()], - ['options', bytes({ size: u32() })], - ['payInLzToken', bool()], - ], - { description: 'QuoteSendInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([207, 0, 49, 214, 160, 211, 76, 211]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['dstEid', u32()], + ['receiver', bytes({ size: 32 })], + ['message', string()], + ['options', bytes({ size: u32() })], + ['payInLzToken', bool()], + ], + { description: 'QuoteSendInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([207, 0, 49, 214, 160, 211, 76, 211]), + }) + ) as Serializer; } // Args. -export type QuoteSendInstructionArgs = QuoteSendInstructionDataArgs +export type QuoteSendInstructionArgs = QuoteSendInstructionDataArgs; // Instruction. export function quoteSend( - context: Pick, - input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs + context: Pick, + input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, - endpoint: { - index: 2, - isWritable: false as boolean, - value: input.endpoint ?? null, - }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, + endpoint: { + index: 2, + isWritable: false as boolean, + value: input.endpoint ?? null, + }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: QuoteSendInstructionArgs = { ...input } + // Arguments. + const resolvedArgs: QuoteSendInstructionArgs = { ...input }; - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getQuoteSendInstructionDataSerializer().serialize(resolvedArgs as QuoteSendInstructionDataArgs) + // Data. + const data = getQuoteSendInstructionDataSerializer().serialize( + resolvedArgs as QuoteSendInstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts index ab73d8d06..e3d560c50 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts @@ -6,101 +6,132 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, string, struct, u32, u64 } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { + Context, + Pda, + PublicKey, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + string, + struct, + u32, + u64, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; // Accounts. export type SendInstructionAccounts = { - /** - * Configuration for the destination chain. Holds the peer address and any - * enforced messaging options. - */ + /** + * Configuration for the destination chain. Holds the peer address and any + * enforced messaging options. + */ - peer: PublicKey | Pda - /** OApp Store PDA that signs the send instruction */ - store: PublicKey | Pda - endpoint: PublicKey | Pda -} + peer: PublicKey | Pda; + /** OApp Store PDA that signs the send instruction */ + store: PublicKey | Pda; + endpoint: PublicKey | Pda; +}; // Data. export type SendInstructionData = { - discriminator: Uint8Array - dstEid: number - message: string - options: Uint8Array - nativeFee: bigint - lzTokenFee: bigint -} + discriminator: Uint8Array; + dstEid: number; + message: string; + options: Uint8Array; + nativeFee: bigint; + lzTokenFee: bigint; +}; export type SendInstructionDataArgs = { - dstEid: number - message: string - options: Uint8Array - nativeFee: number | bigint - lzTokenFee: number | bigint -} + dstEid: number; + message: string; + options: Uint8Array; + nativeFee: number | bigint; + lzTokenFee: number | bigint; +}; -export function getSendInstructionDataSerializer(): Serializer { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['dstEid', u32()], - ['message', string()], - ['options', bytes({ size: u32() })], - ['nativeFee', u64()], - ['lzTokenFee', u64()], - ], - { description: 'SendInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([102, 251, 20, 187, 65, 75, 12, 69]), - }) - ) as Serializer +export function getSendInstructionDataSerializer(): Serializer< + SendInstructionDataArgs, + SendInstructionData +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['dstEid', u32()], + ['message', string()], + ['options', bytes({ size: u32() })], + ['nativeFee', u64()], + ['lzTokenFee', u64()], + ], + { description: 'SendInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([102, 251, 20, 187, 65, 75, 12, 69]), + }) + ) as Serializer; } // Args. -export type SendInstructionArgs = SendInstructionDataArgs +export type SendInstructionArgs = SendInstructionDataArgs; // Instruction. export function send( - context: Pick, - input: SendInstructionAccounts & SendInstructionArgs + context: Pick, + input: SendInstructionAccounts & SendInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - peer: { index: 0, isWritable: false as boolean, value: input.peer ?? null }, - store: { - index: 1, - isWritable: false as boolean, - value: input.store ?? null, - }, - endpoint: { - index: 2, - isWritable: false as boolean, - value: input.endpoint ?? null, - }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + peer: { index: 0, isWritable: false as boolean, value: input.peer ?? null }, + store: { + index: 1, + isWritable: false as boolean, + value: input.store ?? null, + }, + endpoint: { + index: 2, + isWritable: false as boolean, + value: input.endpoint ?? null, + }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: SendInstructionArgs = { ...input } + // Arguments. + const resolvedArgs: SendInstructionArgs = { ...input }; - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getSendInstructionDataSerializer().serialize(resolvedArgs as SendInstructionDataArgs) + // Data. + const data = getSendInstructionDataSerializer().serialize( + resolvedArgs as SendInstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts index 3b0e5fb9a..8cfdebcba 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts @@ -6,108 +6,146 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Context, Pda, PublicKey, Signer, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, struct, u32 } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' -import { PeerConfigParam, PeerConfigParamArgs, getPeerConfigParamSerializer } from '../types' +import { + Context, + Pda, + PublicKey, + Signer, + TransactionBuilder, + transactionBuilder, +} from '@metaplex-foundation/umi'; +import { + Serializer, + bytes, + mapSerializer, + struct, + u32, +} from '@metaplex-foundation/umi/serializers'; +import { + ResolvedAccount, + ResolvedAccountsWithIndices, + getAccountMetasAndSigners, +} from '../shared'; +import { + PeerConfigParam, + PeerConfigParamArgs, + getPeerConfigParamSerializer, +} from '../types'; // Accounts. export type SetPeerConfigInstructionAccounts = { - /** Admin of the OApp store */ - admin: Signer - /** Peer configuration PDA for a specific remote chain */ - peer: PublicKey | Pda - /** Store PDA of this OApp */ - store: PublicKey | Pda - systemProgram?: PublicKey | Pda -} + /** Admin of the OApp store */ + admin: Signer; + /** Peer configuration PDA for a specific remote chain */ + peer: PublicKey | Pda; + /** Store PDA of this OApp */ + store: PublicKey | Pda; + systemProgram?: PublicKey | Pda; +}; // Data. export type SetPeerConfigInstructionData = { - discriminator: Uint8Array - remoteEid: number - config: PeerConfigParam -} + discriminator: Uint8Array; + remoteEid: number; + config: PeerConfigParam; +}; export type SetPeerConfigInstructionDataArgs = { - remoteEid: number - config: PeerConfigParamArgs -} + remoteEid: number; + config: PeerConfigParamArgs; +}; export function getSetPeerConfigInstructionDataSerializer(): Serializer< + SetPeerConfigInstructionDataArgs, + SetPeerConfigInstructionData +> { + return mapSerializer< SetPeerConfigInstructionDataArgs, + any, SetPeerConfigInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['remoteEid', u32()], - ['config', getPeerConfigParamSerializer()], - ], - { description: 'SetPeerConfigInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([79, 187, 168, 57, 139, 140, 93, 47]), - }) - ) as Serializer + >( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['remoteEid', u32()], + ['config', getPeerConfigParamSerializer()], + ], + { description: 'SetPeerConfigInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([79, 187, 168, 57, 139, 140, 93, 47]), + }) + ) as Serializer< + SetPeerConfigInstructionDataArgs, + SetPeerConfigInstructionData + >; } // Args. -export type SetPeerConfigInstructionArgs = SetPeerConfigInstructionDataArgs +export type SetPeerConfigInstructionArgs = SetPeerConfigInstructionDataArgs; // Instruction. export function setPeerConfig( - context: Pick, - input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs + context: Pick, + input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + // Program ID. + const programId = context.programs.getPublicKey('myOapp', ''); - // Accounts. - const resolvedAccounts = { - admin: { - index: 0, - isWritable: true as boolean, - value: input.admin ?? null, - }, - peer: { index: 1, isWritable: true as boolean, value: input.peer ?? null }, - store: { - index: 2, - isWritable: false as boolean, - value: input.store ?? null, - }, - systemProgram: { - index: 3, - isWritable: false as boolean, - value: input.systemProgram ?? null, - }, - } satisfies ResolvedAccountsWithIndices + // Accounts. + const resolvedAccounts = { + admin: { + index: 0, + isWritable: true as boolean, + value: input.admin ?? null, + }, + peer: { index: 1, isWritable: true as boolean, value: input.peer ?? null }, + store: { + index: 2, + isWritable: false as boolean, + value: input.store ?? null, + }, + systemProgram: { + index: 3, + isWritable: false as boolean, + value: input.systemProgram ?? null, + }, + } satisfies ResolvedAccountsWithIndices; - // Arguments. - const resolvedArgs: SetPeerConfigInstructionArgs = { ...input } + // Arguments. + const resolvedArgs: SetPeerConfigInstructionArgs = { ...input }; - // Default values. - if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = context.programs.getPublicKey( - 'splSystem', - '11111111111111111111111111111111' - ) - resolvedAccounts.systemProgram.isWritable = false - } + // Default values. + if (!resolvedAccounts.systemProgram.value) { + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', + '11111111111111111111111111111111' + ); + resolvedAccounts.systemProgram.isWritable = false; + } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values( + resolvedAccounts + ).sort((a, b) => a.index - b.index); - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners( + orderedAccounts, + 'programId', + programId + ); - // Data. - const data = getSetPeerConfigInstructionDataSerializer().serialize(resolvedArgs as SetPeerConfigInstructionDataArgs) + // Data. + const data = getSetPeerConfigInstructionDataSerializer().serialize( + resolvedArgs as SetPeerConfigInstructionDataArgs + ); - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 + // Bytes Created On Chain. + const bytesCreatedOnChain = 0; - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) + return transactionBuilder([ + { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, + ]); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts index a38217af5..626465801 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './myOapp' +export * from './myOapp'; diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts index 8cc8afeb2..c58a13212 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts @@ -6,34 +6,46 @@ * @see https://github.com/kinobi-so/kinobi */ -import { ClusterFilter, Context, Program, PublicKey } from '@metaplex-foundation/umi' -import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors' +import { + ClusterFilter, + Context, + Program, + PublicKey, +} from '@metaplex-foundation/umi'; +import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors'; -export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''> +export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''>; export function createMyOappProgram(): Program { - return { - name: 'myOapp', - publicKey: MY_OAPP_PROGRAM_ID, - getErrorFromCode(code: number, cause?: Error) { - return getMyOappErrorFromCode(code, this, cause) - }, - getErrorFromName(name: string, cause?: Error) { - return getMyOappErrorFromName(name, this, cause) - }, - isOnCluster() { - return true - }, - } + return { + name: 'myOapp', + publicKey: MY_OAPP_PROGRAM_ID, + getErrorFromCode(code: number, cause?: Error) { + return getMyOappErrorFromCode(code, this, cause); + }, + getErrorFromName(name: string, cause?: Error) { + return getMyOappErrorFromName(name, this, cause); + }, + isOnCluster() { + return true; + }, + }; } export function getMyOappProgram( - context: Pick, - clusterFilter?: ClusterFilter + context: Pick, + clusterFilter?: ClusterFilter ): T { - return context.programs.get('myOapp', clusterFilter) + return context.programs.get('myOapp', clusterFilter); } -export function getMyOappProgramId(context: Pick, clusterFilter?: ClusterFilter): PublicKey { - return context.programs.getPublicKey('myOapp', MY_OAPP_PROGRAM_ID, clusterFilter) +export function getMyOappProgramId( + context: Pick, + clusterFilter?: ClusterFilter +): PublicKey { + return context.programs.getPublicKey( + 'myOapp', + MY_OAPP_PROGRAM_ID, + clusterFilter + ); } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts index 70554c289..0102e5646 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts @@ -6,45 +6,58 @@ * @see https://github.com/kinobi-so/kinobi */ -import { AccountMeta, isSigner, Pda, publicKey, PublicKey, Signer, isPda } from '@metaplex-foundation/umi' +import { + AccountMeta, + isSigner, + Pda, + publicKey, + PublicKey, + Signer, + isPda, +} from '@metaplex-foundation/umi'; /** * Transforms the given object such that the given keys are optional. * @internal */ -export type PickPartial = Omit & Partial> +export type PickPartial = Omit & + Partial>; /** * Asserts that the given value is not null or undefined. * @internal */ export function expectSome(value: T | null | undefined): T { - if (value == null) { - throw new Error('Expected a value but received null or undefined.') - } - return value + if (value == null) { + throw new Error('Expected a value but received null or undefined.'); + } + return value; } /** * Asserts that the given value is a PublicKey. * @internal */ -export function expectPublicKey(value: PublicKey | Pda | Signer | null | undefined): PublicKey { - if (!value) { - throw new Error('Expected a PublicKey.') - } - return publicKey(value, false) +export function expectPublicKey( + value: PublicKey | Pda | Signer | null | undefined +): PublicKey { + if (!value) { + throw new Error('Expected a PublicKey.'); + } + return publicKey(value, false); } /** * Asserts that the given value is a PDA. * @internal */ -export function expectPda(value: PublicKey | Pda | Signer | null | undefined): Pda { - if (!value || !Array.isArray(value) || !isPda(value)) { - throw new Error('Expected a PDA.') - } - return value +export function expectPda( + value: PublicKey | Pda | Signer | null | undefined +): Pda { + if (!value || !Array.isArray(value) || !isPda(value)) { + throw new Error('Expected a PDA.'); + } + return value; } /** @@ -52,50 +65,53 @@ export function expectPda(value: PublicKey | Pda | Signer | null | undefined): P * @internal */ export type ResolvedAccount = { - isWritable: boolean - value: T -} + isWritable: boolean; + value: T; +}; /** * Defines a set of instruction account to resolve. * @internal */ -export type ResolvedAccounts = Record +export type ResolvedAccounts = Record; /** * Defines a set of instruction account to resolve with their indices. * @internal */ -export type ResolvedAccountsWithIndices = Record +export type ResolvedAccountsWithIndices = Record< + string, + ResolvedAccount & { index: number } +>; /** * Get account metas and signers from resolved accounts. * @internal */ export function getAccountMetasAndSigners( - accounts: ResolvedAccount[], - optionalAccountStrategy: 'omitted' | 'programId', - programId: PublicKey + accounts: ResolvedAccount[], + optionalAccountStrategy: 'omitted' | 'programId', + programId: PublicKey ): [AccountMeta[], Signer[]] { - const keys: AccountMeta[] = [] - const signers: Signer[] = [] + const keys: AccountMeta[] = []; + const signers: Signer[] = []; - accounts.forEach((account) => { - if (!account.value) { - if (optionalAccountStrategy === 'omitted') return - keys.push({ pubkey: programId, isSigner: false, isWritable: false }) - return - } + accounts.forEach((account) => { + if (!account.value) { + if (optionalAccountStrategy === 'omitted') return; + keys.push({ pubkey: programId, isSigner: false, isWritable: false }); + return; + } - if (isSigner(account.value)) { - signers.push(account.value) - } - keys.push({ - pubkey: publicKey(account.value, false), - isSigner: isSigner(account.value), - isWritable: account.isWritable, - }) - }) + if (isSigner(account.value)) { + signers.push(account.value); + } + keys.push({ + pubkey: publicKey(account.value, false), + isSigner: isSigner(account.value), + isWritable: account.isWritable, + }); + }); - return [keys, signers] + return [keys, signers]; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts index d7a990a26..90d365a75 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts @@ -6,8 +6,12 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Serializer, bool, struct } from '@metaplex-foundation/umi/serializers' -import { AddressLocator, AddressLocatorArgs, getAddressLocatorSerializer } from '.' +import { Serializer, bool, struct } from '@metaplex-foundation/umi/serializers'; +import { + AddressLocator, + AddressLocatorArgs, + getAddressLocatorSerializer, +} from '.'; /** * Account metadata for V2 execution planning. @@ -19,25 +23,28 @@ import { AddressLocator, AddressLocatorArgs, getAddressLocatorSerializer } from */ export type AccountMetaRef = { - /** The account address locator - supports multiple resolution strategies */ - pubkey: AddressLocator - /** Whether the account should be writable in the final transaction */ - isWritable: boolean -} + /** The account address locator - supports multiple resolution strategies */ + pubkey: AddressLocator; + /** Whether the account should be writable in the final transaction */ + isWritable: boolean; +}; export type AccountMetaRefArgs = { - /** The account address locator - supports multiple resolution strategies */ - pubkey: AddressLocatorArgs - /** Whether the account should be writable in the final transaction */ - isWritable: boolean -} + /** The account address locator - supports multiple resolution strategies */ + pubkey: AddressLocatorArgs; + /** Whether the account should be writable in the final transaction */ + isWritable: boolean; +}; -export function getAccountMetaRefSerializer(): Serializer { - return struct( - [ - ['pubkey', getAddressLocatorSerializer()], - ['isWritable', bool()], - ], - { description: 'AccountMetaRef' } - ) as Serializer +export function getAccountMetaRefSerializer(): Serializer< + AccountMetaRefArgs, + AccountMetaRef +> { + return struct( + [ + ['pubkey', getAddressLocatorSerializer()], + ['isWritable', bool()], + ], + { description: 'AccountMetaRef' } + ) as Serializer; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts index 5ef83846a..41764b869 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts @@ -6,18 +6,18 @@ * @see https://github.com/kinobi-so/kinobi */ -import { PublicKey } from '@metaplex-foundation/umi' +import { PublicKey } from '@metaplex-foundation/umi'; import { - GetDataEnumKind, - GetDataEnumKindContent, - Serializer, - dataEnum, - publicKey as publicKeySerializer, - struct, - tuple, - u8, - unit, -} from '@metaplex-foundation/umi/serializers' + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + dataEnum, + publicKey as publicKeySerializer, + struct, + tuple, + u8, + unit, +} from '@metaplex-foundation/umi/serializers'; /** * A generic account locator used in LZ execution planning for V2. @@ -33,54 +33,75 @@ import { */ export type AddressLocator = - | { __kind: 'Address'; fields: [PublicKey] } - | { __kind: 'AltIndex'; fields: [number, number] } - | { __kind: 'Payer' } - | { __kind: 'Signer'; fields: [number] } - | { __kind: 'Context' } + | { __kind: 'Address'; fields: [PublicKey] } + | { __kind: 'AltIndex'; fields: [number, number] } + | { __kind: 'Payer' } + | { __kind: 'Signer'; fields: [number] } + | { __kind: 'Context' }; -export type AddressLocatorArgs = AddressLocator +export type AddressLocatorArgs = AddressLocator; -export function getAddressLocatorSerializer(): Serializer { - return dataEnum( - [ - [ - 'Address', - struct>([['fields', tuple([publicKeySerializer()])]]), - ], - ['AltIndex', struct>([['fields', tuple([u8(), u8()])]])], - ['Payer', unit()], - ['Signer', struct>([['fields', tuple([u8()])]])], - ['Context', unit()], - ], - { description: 'AddressLocator' } - ) as Serializer +export function getAddressLocatorSerializer(): Serializer< + AddressLocatorArgs, + AddressLocator +> { + return dataEnum( + [ + [ + 'Address', + struct>([ + ['fields', tuple([publicKeySerializer()])], + ]), + ], + [ + 'AltIndex', + struct>([ + ['fields', tuple([u8(), u8()])], + ]), + ], + ['Payer', unit()], + [ + 'Signer', + struct>([ + ['fields', tuple([u8()])], + ]), + ], + ['Context', unit()], + ], + { description: 'AddressLocator' } + ) as Serializer; } // Data Enum Helpers. export function addressLocator( - kind: 'Address', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind + kind: 'Address', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind; export function addressLocator( - kind: 'AltIndex', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind -export function addressLocator(kind: 'Payer'): GetDataEnumKind + kind: 'AltIndex', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind; export function addressLocator( - kind: 'Signer', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind -export function addressLocator(kind: 'Context'): GetDataEnumKind + kind: 'Payer' +): GetDataEnumKind; +export function addressLocator( + kind: 'Signer', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind; +export function addressLocator( + kind: 'Context' +): GetDataEnumKind; export function addressLocator( - kind: K, - data?: any + kind: K, + data?: any ): Extract { - return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } + return Array.isArray(data) + ? { __kind: kind, fields: data } + : { __kind: kind, ...(data ?? {}) }; } export function isAddressLocator( - kind: K, - value: AddressLocator + kind: K, + value: AddressLocator ): value is AddressLocator & { __kind: K } { - return value.__kind === kind + return value.__kind === kind; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts index ea99c95af..360398c81 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts @@ -6,18 +6,26 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Serializer, bytes, struct, u32 } from '@metaplex-foundation/umi/serializers' +import { + Serializer, + bytes, + struct, + u32, +} from '@metaplex-foundation/umi/serializers'; -export type EnforcedOptions = { send: Uint8Array; sendAndCall: Uint8Array } +export type EnforcedOptions = { send: Uint8Array; sendAndCall: Uint8Array }; -export type EnforcedOptionsArgs = EnforcedOptions +export type EnforcedOptionsArgs = EnforcedOptions; -export function getEnforcedOptionsSerializer(): Serializer { - return struct( - [ - ['send', bytes({ size: u32() })], - ['sendAndCall', bytes({ size: u32() })], - ], - { description: 'EnforcedOptions' } - ) as Serializer +export function getEnforcedOptionsSerializer(): Serializer< + EnforcedOptionsArgs, + EnforcedOptions +> { + return struct( + [ + ['send', bytes({ size: u32() })], + ['sendAndCall', bytes({ size: u32() })], + ], + { description: 'EnforcedOptions' } + ) as Serializer; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts index 3c6132257..cba7356a2 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts @@ -6,11 +6,11 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './accountMetaRef' -export * from './addressLocator' -export * from './enforcedOptions' -export * from './instruction' -export * from './lzReceiveParams' -export * from './lzReceiveTypesV2Result' -export * from './messagingFee' -export * from './peerConfigParam' +export * from './accountMetaRef'; +export * from './addressLocator'; +export * from './enforcedOptions'; +export * from './instruction'; +export * from './lzReceiveParams'; +export * from './lzReceiveTypesV2Result'; +export * from './messagingFee'; +export * from './peerConfigParam'; diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts index 53dbbf974..a8e36e94f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts @@ -6,19 +6,23 @@ * @see https://github.com/kinobi-so/kinobi */ -import { PublicKey } from '@metaplex-foundation/umi' +import { PublicKey } from '@metaplex-foundation/umi'; import { - GetDataEnumKind, - GetDataEnumKindContent, - Serializer, - array, - bytes, - dataEnum, - publicKey as publicKeySerializer, - struct, - u32, -} from '@metaplex-foundation/umi/serializers' -import { AccountMetaRef, AccountMetaRefArgs, getAccountMetaRefSerializer } from '.' + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + array, + bytes, + dataEnum, + publicKey as publicKeySerializer, + struct, + u32, +} from '@metaplex-foundation/umi/serializers'; +import { + AccountMetaRef, + AccountMetaRefArgs, + getAccountMetaRefSerializer, +} from '.'; /** * The list of instructions that can be executed in the LzReceive transaction. @@ -31,95 +35,100 @@ import { AccountMetaRef, AccountMetaRefArgs, getAccountMetaRefSerializer } from */ export type Instruction = - | { - __kind: 'LzReceive' - /** - * Account list for the lz_receive instruction - * Uses AddressLocator for flexible address resolution - */ - accounts: Array - } - | { - __kind: 'Standard' - /** Target program ID for the custom instruction */ - programId: PublicKey - /** - * Account list for the custom instruction - * Uses same AddressLocator system as LzReceive - */ - accounts: Array - /** - * Instruction data payload - * Raw bytes containing the instruction's parameters - */ - data: Uint8Array - } + | { + __kind: 'LzReceive'; + /** + * Account list for the lz_receive instruction + * Uses AddressLocator for flexible address resolution + */ + accounts: Array; + } + | { + __kind: 'Standard'; + /** Target program ID for the custom instruction */ + programId: PublicKey; + /** + * Account list for the custom instruction + * Uses same AddressLocator system as LzReceive + */ + accounts: Array; + /** + * Instruction data payload + * Raw bytes containing the instruction's parameters + */ + data: Uint8Array; + }; export type InstructionArgs = - | { - __kind: 'LzReceive' - /** - * Account list for the lz_receive instruction - * Uses AddressLocator for flexible address resolution - */ - accounts: Array - } - | { - __kind: 'Standard' - /** Target program ID for the custom instruction */ - programId: PublicKey - /** - * Account list for the custom instruction - * Uses same AddressLocator system as LzReceive - */ - accounts: Array - /** - * Instruction data payload - * Raw bytes containing the instruction's parameters - */ - data: Uint8Array - } + | { + __kind: 'LzReceive'; + /** + * Account list for the lz_receive instruction + * Uses AddressLocator for flexible address resolution + */ + accounts: Array; + } + | { + __kind: 'Standard'; + /** Target program ID for the custom instruction */ + programId: PublicKey; + /** + * Account list for the custom instruction + * Uses same AddressLocator system as LzReceive + */ + accounts: Array; + /** + * Instruction data payload + * Raw bytes containing the instruction's parameters + */ + data: Uint8Array; + }; -export function getInstructionSerializer(): Serializer { - return dataEnum( - [ - [ - 'LzReceive', - struct>([ - ['accounts', array(getAccountMetaRefSerializer())], - ]), - ], - [ - 'Standard', - struct>([ - ['programId', publicKeySerializer()], - ['accounts', array(getAccountMetaRefSerializer())], - ['data', bytes({ size: u32() })], - ]), - ], - ], - { description: 'Instruction' } - ) as Serializer +export function getInstructionSerializer(): Serializer< + InstructionArgs, + Instruction +> { + return dataEnum( + [ + [ + 'LzReceive', + struct>([ + ['accounts', array(getAccountMetaRefSerializer())], + ]), + ], + [ + 'Standard', + struct>([ + ['programId', publicKeySerializer()], + ['accounts', array(getAccountMetaRefSerializer())], + ['data', bytes({ size: u32() })], + ]), + ], + ], + { description: 'Instruction' } + ) as Serializer; } // Data Enum Helpers. export function instruction( - kind: 'LzReceive', - data: GetDataEnumKindContent -): GetDataEnumKind + kind: 'LzReceive', + data: GetDataEnumKindContent +): GetDataEnumKind; export function instruction( - kind: 'Standard', - data: GetDataEnumKindContent -): GetDataEnumKind + kind: 'Standard', + data: GetDataEnumKindContent +): GetDataEnumKind; export function instruction( - kind: K, - data?: any + kind: K, + data?: any ): Extract { - return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } + return Array.isArray(data) + ? { __kind: kind, fields: data } + : { __kind: kind, ...(data ?? {}) }; } export function isInstruction( - kind: K, - value: Instruction + kind: K, + value: Instruction ): value is Instruction & { __kind: K } { - return value.__kind === kind + return value.__kind === kind; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts index ca661c26a..59dd1b4ac 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts @@ -6,36 +6,45 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Serializer, bytes, struct, u32, u64 } from '@metaplex-foundation/umi/serializers' +import { + Serializer, + bytes, + struct, + u32, + u64, +} from '@metaplex-foundation/umi/serializers'; export type LzReceiveParams = { - srcEid: number - sender: Uint8Array - nonce: bigint - guid: Uint8Array - message: Uint8Array - extraData: Uint8Array -} + srcEid: number; + sender: Uint8Array; + nonce: bigint; + guid: Uint8Array; + message: Uint8Array; + extraData: Uint8Array; +}; export type LzReceiveParamsArgs = { - srcEid: number - sender: Uint8Array - nonce: number | bigint - guid: Uint8Array - message: Uint8Array - extraData: Uint8Array -} + srcEid: number; + sender: Uint8Array; + nonce: number | bigint; + guid: Uint8Array; + message: Uint8Array; + extraData: Uint8Array; +}; -export function getLzReceiveParamsSerializer(): Serializer { - return struct( - [ - ['srcEid', u32()], - ['sender', bytes({ size: 32 })], - ['nonce', u64()], - ['guid', bytes({ size: 32 })], - ['message', bytes({ size: u32() })], - ['extraData', bytes({ size: u32() })], - ], - { description: 'LzReceiveParams' } - ) as Serializer +export function getLzReceiveParamsSerializer(): Serializer< + LzReceiveParamsArgs, + LzReceiveParams +> { + return struct( + [ + ['srcEid', u32()], + ['sender', bytes({ size: 32 })], + ['nonce', u64()], + ['guid', bytes({ size: 32 })], + ['message', bytes({ size: u32() })], + ['extraData', bytes({ size: u32() })], + ], + { description: 'LzReceiveParams' } + ) as Serializer; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts index 8b36124ed..5149b6bc8 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts @@ -6,9 +6,15 @@ * @see https://github.com/kinobi-so/kinobi */ -import { PublicKey } from '@metaplex-foundation/umi' -import { Serializer, array, publicKey as publicKeySerializer, struct, u8 } from '@metaplex-foundation/umi/serializers' -import { Instruction, InstructionArgs, getInstructionSerializer } from '.' +import { PublicKey } from '@metaplex-foundation/umi'; +import { + Serializer, + array, + publicKey as publicKeySerializer, + struct, + u8, +} from '@metaplex-foundation/umi/serializers'; +import { Instruction, InstructionArgs, getInstructionSerializer } from '.'; /** * Output of the lz_receive_types_v2 instruction. @@ -19,48 +25,51 @@ import { Instruction, InstructionArgs, getInstructionSerializer } from '.' */ export type LzReceiveTypesV2Result = { - /** The version of context account */ - contextVersion: number - /** - * ALTs required for this execution context - * Used by the Executor to resolve AltIndex references in AccountMetaRef - * Enables efficient account list compression for complex transactions - */ - alts: Array - /** - * The complete list of instructions required for LzReceive execution - * MUST include exactly one LzReceive instruction - * MAY include additional Standard instructions for preprocessing/postprocessing - * Instructions are executed in the order returned - */ - instructions: Array -} + /** The version of context account */ + contextVersion: number; + /** + * ALTs required for this execution context + * Used by the Executor to resolve AltIndex references in AccountMetaRef + * Enables efficient account list compression for complex transactions + */ + alts: Array; + /** + * The complete list of instructions required for LzReceive execution + * MUST include exactly one LzReceive instruction + * MAY include additional Standard instructions for preprocessing/postprocessing + * Instructions are executed in the order returned + */ + instructions: Array; +}; export type LzReceiveTypesV2ResultArgs = { - /** The version of context account */ - contextVersion: number - /** - * ALTs required for this execution context - * Used by the Executor to resolve AltIndex references in AccountMetaRef - * Enables efficient account list compression for complex transactions - */ - alts: Array - /** - * The complete list of instructions required for LzReceive execution - * MUST include exactly one LzReceive instruction - * MAY include additional Standard instructions for preprocessing/postprocessing - * Instructions are executed in the order returned - */ - instructions: Array -} + /** The version of context account */ + contextVersion: number; + /** + * ALTs required for this execution context + * Used by the Executor to resolve AltIndex references in AccountMetaRef + * Enables efficient account list compression for complex transactions + */ + alts: Array; + /** + * The complete list of instructions required for LzReceive execution + * MUST include exactly one LzReceive instruction + * MAY include additional Standard instructions for preprocessing/postprocessing + * Instructions are executed in the order returned + */ + instructions: Array; +}; -export function getLzReceiveTypesV2ResultSerializer(): Serializer { - return struct( - [ - ['contextVersion', u8()], - ['alts', array(publicKeySerializer())], - ['instructions', array(getInstructionSerializer())], - ], - { description: 'LzReceiveTypesV2Result' } - ) as Serializer +export function getLzReceiveTypesV2ResultSerializer(): Serializer< + LzReceiveTypesV2ResultArgs, + LzReceiveTypesV2Result +> { + return struct( + [ + ['contextVersion', u8()], + ['alts', array(publicKeySerializer())], + ['instructions', array(getInstructionSerializer())], + ], + { description: 'LzReceiveTypesV2Result' } + ) as Serializer; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts index 310352e1a..91d035e85 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts @@ -6,21 +6,24 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Serializer, struct, u64 } from '@metaplex-foundation/umi/serializers' +import { Serializer, struct, u64 } from '@metaplex-foundation/umi/serializers'; -export type MessagingFee = { nativeFee: bigint; lzTokenFee: bigint } +export type MessagingFee = { nativeFee: bigint; lzTokenFee: bigint }; export type MessagingFeeArgs = { - nativeFee: number | bigint - lzTokenFee: number | bigint -} + nativeFee: number | bigint; + lzTokenFee: number | bigint; +}; -export function getMessagingFeeSerializer(): Serializer { - return struct( - [ - ['nativeFee', u64()], - ['lzTokenFee', u64()], - ], - { description: 'MessagingFee' } - ) as Serializer +export function getMessagingFeeSerializer(): Serializer< + MessagingFeeArgs, + MessagingFee +> { + return struct( + [ + ['nativeFee', u64()], + ['lzTokenFee', u64()], + ], + { description: 'MessagingFee' } + ) as Serializer; } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts index 1c77da73c..f3f7b6e9c 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts @@ -7,61 +7,66 @@ */ import { - GetDataEnumKind, - GetDataEnumKindContent, - Serializer, - bytes, - dataEnum, - struct, - tuple, - u32, -} from '@metaplex-foundation/umi/serializers' + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + bytes, + dataEnum, + struct, + tuple, + u32, +} from '@metaplex-foundation/umi/serializers'; export type PeerConfigParam = - | { __kind: 'PeerAddress'; fields: [Uint8Array] } - | { __kind: 'EnforcedOptions'; send: Uint8Array; sendAndCall: Uint8Array } + | { __kind: 'PeerAddress'; fields: [Uint8Array] } + | { __kind: 'EnforcedOptions'; send: Uint8Array; sendAndCall: Uint8Array }; -export type PeerConfigParamArgs = PeerConfigParam +export type PeerConfigParamArgs = PeerConfigParam; -export function getPeerConfigParamSerializer(): Serializer { - return dataEnum( - [ - [ - 'PeerAddress', - struct>([ - ['fields', tuple([bytes({ size: 32 })])], - ]), - ], - [ - 'EnforcedOptions', - struct>([ - ['send', bytes({ size: u32() })], - ['sendAndCall', bytes({ size: u32() })], - ]), - ], - ], - { description: 'PeerConfigParam' } - ) as Serializer +export function getPeerConfigParamSerializer(): Serializer< + PeerConfigParamArgs, + PeerConfigParam +> { + return dataEnum( + [ + [ + 'PeerAddress', + struct>([ + ['fields', tuple([bytes({ size: 32 })])], + ]), + ], + [ + 'EnforcedOptions', + struct>([ + ['send', bytes({ size: u32() })], + ['sendAndCall', bytes({ size: u32() })], + ]), + ], + ], + { description: 'PeerConfigParam' } + ) as Serializer; } // Data Enum Helpers. export function peerConfigParam( - kind: 'PeerAddress', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind + kind: 'PeerAddress', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind; export function peerConfigParam( - kind: 'EnforcedOptions', - data: GetDataEnumKindContent -): GetDataEnumKind + kind: 'EnforcedOptions', + data: GetDataEnumKindContent +): GetDataEnumKind; export function peerConfigParam( - kind: K, - data?: any + kind: K, + data?: any ): Extract { - return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } + return Array.isArray(data) + ? { __kind: kind, fields: data } + : { __kind: kind, ...(data ?? {}) }; } export function isPeerConfigParam( - kind: K, - value: PeerConfigParam + kind: K, + value: PeerConfigParam ): value is PeerConfigParam & { __kind: K } { - return value.__kind === kind + return value.__kind === kind; } From 1b45d6105927a9a91f9aa52e8a636e78be5db96f Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:11:15 -0300 Subject: [PATCH 09/24] generated --- .../my_oapp/accounts/endpointSettings.ts | 232 ++++++++---------- .../generated/my_oapp/accounts/index.ts | 8 +- .../accounts/lzReceiveTypesAccounts.ts | 221 ++++++++--------- .../generated/my_oapp/accounts/peerConfig.ts | 202 +++++++-------- .../generated/my_oapp/accounts/store.ts | 210 ++++++++-------- .../client/generated/my_oapp/errors/index.ts | 2 +- .../client/generated/my_oapp/errors/myOapp.ts | 45 ++-- .../lib/client/generated/my_oapp/index.ts | 12 +- .../generated/my_oapp/instructions/index.ts | 14 +- .../my_oapp/instructions/initStore.ts | 195 +++++++-------- .../my_oapp/instructions/lzReceive.ts | 145 +++++------ .../instructions/lzReceiveTypesInfo.ts | 158 +++++------- .../my_oapp/instructions/lzReceiveTypesV2.ts | 137 ++++------- .../my_oapp/instructions/quoteSend.ts | 168 +++++-------- .../generated/my_oapp/instructions/send.ts | 177 ++++++------- .../my_oapp/instructions/setPeerConfig.ts | 192 ++++++--------- .../generated/my_oapp/programs/index.ts | 2 +- .../generated/my_oapp/programs/myOapp.ts | 54 ++-- .../client/generated/my_oapp/shared/index.ts | 100 ++++---- .../generated/my_oapp/types/accountMetaRef.ts | 47 ++-- .../generated/my_oapp/types/addressLocator.ts | 117 ++++----- .../my_oapp/types/enforcedOptions.ts | 30 +-- .../client/generated/my_oapp/types/index.ts | 16 +- .../generated/my_oapp/types/instruction.ts | 189 +++++++------- .../my_oapp/types/lzReceiveParams.ts | 63 ++--- .../my_oapp/types/lzReceiveTypesV2Result.ts | 97 ++++---- .../generated/my_oapp/types/messagingFee.ts | 29 +-- .../my_oapp/types/peerConfigParam.ts | 91 ++++--- 28 files changed, 1262 insertions(+), 1691 deletions(-) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts index 3d3965b4b..5ba37c5fb 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts @@ -7,162 +7,138 @@ */ import { - Account, - Context, - Option, - OptionOrNullable, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; + Account, + Context, + Option, + OptionOrNullable, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi' import { - Serializer, - bytes, - mapSerializer, - option, - publicKey as publicKeySerializer, - struct, - u32, - u8, -} from '@metaplex-foundation/umi/serializers'; + Serializer, + bytes, + mapSerializer, + option, + publicKey as publicKeySerializer, + struct, + u32, + u8, +} from '@metaplex-foundation/umi/serializers' -export type EndpointSettings = Account; +export type EndpointSettings = Account export type EndpointSettingsAccountData = { - discriminator: Uint8Array; - eid: number; - bump: number; - admin: PublicKey; - lzTokenMint: Option; -}; + discriminator: Uint8Array + eid: number + bump: number + admin: PublicKey + lzTokenMint: Option +} export type EndpointSettingsAccountDataArgs = { - eid: number; - bump: number; - admin: PublicKey; - lzTokenMint: OptionOrNullable; -}; + eid: number + bump: number + admin: PublicKey + lzTokenMint: OptionOrNullable +} export function getEndpointSettingsAccountDataSerializer(): Serializer< - EndpointSettingsAccountDataArgs, - EndpointSettingsAccountData -> { - return mapSerializer< EndpointSettingsAccountDataArgs, - any, EndpointSettingsAccountData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['eid', u32()], - ['bump', u8()], - ['admin', publicKeySerializer()], - ['lzTokenMint', option(publicKeySerializer())], - ], - { description: 'EndpointSettingsAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]), - }) - ) as Serializer; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['eid', u32()], + ['bump', u8()], + ['admin', publicKeySerializer()], + ['lzTokenMint', option(publicKeySerializer())], + ], + { description: 'EndpointSettingsAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]), + }) + ) as Serializer } -export function deserializeEndpointSettings( - rawAccount: RpcAccount -): EndpointSettings { - return deserializeAccount( - rawAccount, - getEndpointSettingsAccountDataSerializer() - ); +export function deserializeEndpointSettings(rawAccount: RpcAccount): EndpointSettings { + return deserializeAccount(rawAccount, getEndpointSettingsAccountDataSerializer()) } export async function fetchEndpointSettings( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'EndpointSettings'); - return deserializeEndpointSettings(maybeAccount); + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + assertAccountExists(maybeAccount, 'EndpointSettings') + return deserializeEndpointSettings(maybeAccount) } export async function safeFetchEndpointSettings( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists ? deserializeEndpointSettings(maybeAccount) : null; + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + return maybeAccount.exists ? deserializeEndpointSettings(maybeAccount) : null } export async function fetchAllEndpointSettings( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'EndpointSettings'); - return deserializeEndpointSettings(maybeAccount); - }); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'EndpointSettings') + return deserializeEndpointSettings(maybeAccount) + }) } export async function safeFetchAllEndpointSettings( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => - deserializeEndpointSettings(maybeAccount as RpcAccount) - ); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => deserializeEndpointSettings(maybeAccount as RpcAccount)) } -export function getEndpointSettingsGpaBuilder( - context: Pick -) { - const programId = context.programs.getPublicKey('myOapp', ''); - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array; - eid: number; - bump: number; - admin: PublicKey; - lzTokenMint: OptionOrNullable; - }>({ - discriminator: [0, bytes({ size: 8 })], - eid: [8, u32()], - bump: [12, u8()], - admin: [13, publicKeySerializer()], - lzTokenMint: [45, option(publicKeySerializer())], - }) - .deserializeUsing((account) => - deserializeEndpointSettings(account) - ) - .whereField( - 'discriminator', - new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]) - ); +export function getEndpointSettingsGpaBuilder(context: Pick) { + const programId = context.programs.getPublicKey('myOapp', '') + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array + eid: number + bump: number + admin: PublicKey + lzTokenMint: OptionOrNullable + }>({ + discriminator: [0, bytes({ size: 8 })], + eid: [8, u32()], + bump: [12, u8()], + admin: [13, publicKeySerializer()], + lzTokenMint: [45, option(publicKeySerializer())], + }) + .deserializeUsing((account) => deserializeEndpointSettings(account)) + .whereField('discriminator', new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14])) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts index f7b5f898a..6715ff0fa 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/index.ts @@ -6,7 +6,7 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './endpointSettings'; -export * from './lzReceiveTypesAccounts'; -export * from './peerConfig'; -export * from './store'; +export * from './endpointSettings' +export * from './lzReceiveTypesAccounts' +export * from './peerConfig' +export * from './store' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts index 552c7afde..0a2fd22ef 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts @@ -7,162 +7,133 @@ */ import { - Account, - Context, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; + Account, + Context, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi' import { - Serializer, - bytes, - mapSerializer, - publicKey as publicKeySerializer, - struct, - u8, -} from '@metaplex-foundation/umi/serializers'; + Serializer, + bytes, + mapSerializer, + publicKey as publicKeySerializer, + struct, + u8, +} from '@metaplex-foundation/umi/serializers' -export type LzReceiveTypesAccounts = Account; +export type LzReceiveTypesAccounts = Account export type LzReceiveTypesAccountsAccountData = { - discriminator: Uint8Array; - store: PublicKey; - alt: PublicKey; - bump: number; -}; + discriminator: Uint8Array + store: PublicKey + alt: PublicKey + bump: number +} export type LzReceiveTypesAccountsAccountDataArgs = { - store: PublicKey; - alt: PublicKey; - bump: number; -}; + store: PublicKey + alt: PublicKey + bump: number +} export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< - LzReceiveTypesAccountsAccountDataArgs, - LzReceiveTypesAccountsAccountData -> { - return mapSerializer< - LzReceiveTypesAccountsAccountDataArgs, - any, - LzReceiveTypesAccountsAccountData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['store', publicKeySerializer()], - ['alt', publicKeySerializer()], - ['bump', u8()], - ], - { description: 'LzReceiveTypesAccountsAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]), - }) - ) as Serializer< LzReceiveTypesAccountsAccountDataArgs, LzReceiveTypesAccountsAccountData - >; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['store', publicKeySerializer()], + ['alt', publicKeySerializer()], + ['bump', u8()], + ], + { description: 'LzReceiveTypesAccountsAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]), + }) + ) as Serializer } -export function deserializeLzReceiveTypesAccounts( - rawAccount: RpcAccount -): LzReceiveTypesAccounts { - return deserializeAccount( - rawAccount, - getLzReceiveTypesAccountsAccountDataSerializer() - ); +export function deserializeLzReceiveTypesAccounts(rawAccount: RpcAccount): LzReceiveTypesAccounts { + return deserializeAccount(rawAccount, getLzReceiveTypesAccountsAccountDataSerializer()) } export async function fetchLzReceiveTypesAccounts( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts'); - return deserializeLzReceiveTypesAccounts(maybeAccount); + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts') + return deserializeLzReceiveTypesAccounts(maybeAccount) } export async function safeFetchLzReceiveTypesAccounts( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists - ? deserializeLzReceiveTypesAccounts(maybeAccount) - : null; + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + return maybeAccount.exists ? deserializeLzReceiveTypesAccounts(maybeAccount) : null } export async function fetchAllLzReceiveTypesAccounts( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts'); - return deserializeLzReceiveTypesAccounts(maybeAccount); - }); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'LzReceiveTypesAccounts') + return deserializeLzReceiveTypesAccounts(maybeAccount) + }) } export async function safeFetchAllLzReceiveTypesAccounts( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => - deserializeLzReceiveTypesAccounts(maybeAccount as RpcAccount) - ); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => deserializeLzReceiveTypesAccounts(maybeAccount as RpcAccount)) } -export function getLzReceiveTypesAccountsGpaBuilder( - context: Pick -) { - const programId = context.programs.getPublicKey('myOapp', ''); - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array; - store: PublicKey; - alt: PublicKey; - bump: number; - }>({ - discriminator: [0, bytes({ size: 8 })], - store: [8, publicKeySerializer()], - alt: [40, publicKeySerializer()], - bump: [72, u8()], - }) - .deserializeUsing((account) => - deserializeLzReceiveTypesAccounts(account) - ) - .whereField( - 'discriminator', - new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]) - ); +export function getLzReceiveTypesAccountsGpaBuilder(context: Pick) { + const programId = context.programs.getPublicKey('myOapp', '') + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array + store: PublicKey + alt: PublicKey + bump: number + }>({ + discriminator: [0, bytes({ size: 8 })], + store: [8, publicKeySerializer()], + alt: [40, publicKeySerializer()], + bump: [72, u8()], + }) + .deserializeUsing((account) => deserializeLzReceiveTypesAccounts(account)) + .whereField('discriminator', new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126])) } export function getLzReceiveTypesAccountsSize(): number { - return 73; + return 73 } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts index 41f8e9c66..98e0a11d4 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts @@ -7,144 +7,120 @@ */ import { - Account, - Context, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - struct, - u8, -} from '@metaplex-foundation/umi/serializers'; -import { - EnforcedOptions, - EnforcedOptionsArgs, - getEnforcedOptionsSerializer, -} from '../types'; + Account, + Context, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct, u8 } from '@metaplex-foundation/umi/serializers' +import { EnforcedOptions, EnforcedOptionsArgs, getEnforcedOptionsSerializer } from '../types' -export type PeerConfig = Account; +export type PeerConfig = Account export type PeerConfigAccountData = { - discriminator: Uint8Array; - peerAddress: Uint8Array; - enforcedOptions: EnforcedOptions; - bump: number; -}; + discriminator: Uint8Array + peerAddress: Uint8Array + enforcedOptions: EnforcedOptions + bump: number +} export type PeerConfigAccountDataArgs = { - peerAddress: Uint8Array; - enforcedOptions: EnforcedOptionsArgs; - bump: number; -}; + peerAddress: Uint8Array + enforcedOptions: EnforcedOptionsArgs + bump: number +} -export function getPeerConfigAccountDataSerializer(): Serializer< - PeerConfigAccountDataArgs, - PeerConfigAccountData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['peerAddress', bytes({ size: 32 })], - ['enforcedOptions', getEnforcedOptionsSerializer()], - ['bump', u8()], - ], - { description: 'PeerConfigAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]), - }) - ) as Serializer; +export function getPeerConfigAccountDataSerializer(): Serializer { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['peerAddress', bytes({ size: 32 })], + ['enforcedOptions', getEnforcedOptionsSerializer()], + ['bump', u8()], + ], + { description: 'PeerConfigAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]), + }) + ) as Serializer } export function deserializePeerConfig(rawAccount: RpcAccount): PeerConfig { - return deserializeAccount(rawAccount, getPeerConfigAccountDataSerializer()); + return deserializeAccount(rawAccount, getPeerConfigAccountDataSerializer()) } export async function fetchPeerConfig( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'PeerConfig'); - return deserializePeerConfig(maybeAccount); + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + assertAccountExists(maybeAccount, 'PeerConfig') + return deserializePeerConfig(maybeAccount) } export async function safeFetchPeerConfig( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists ? deserializePeerConfig(maybeAccount) : null; + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + return maybeAccount.exists ? deserializePeerConfig(maybeAccount) : null } export async function fetchAllPeerConfig( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'PeerConfig'); - return deserializePeerConfig(maybeAccount); - }); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'PeerConfig') + return deserializePeerConfig(maybeAccount) + }) } export async function safeFetchAllPeerConfig( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => deserializePeerConfig(maybeAccount as RpcAccount)); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => deserializePeerConfig(maybeAccount as RpcAccount)) } -export function getPeerConfigGpaBuilder( - context: Pick -) { - const programId = context.programs.getPublicKey('myOapp', ''); - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array; - peerAddress: Uint8Array; - enforcedOptions: EnforcedOptionsArgs; - bump: number; - }>({ - discriminator: [0, bytes({ size: 8 })], - peerAddress: [8, bytes({ size: 32 })], - enforcedOptions: [40, getEnforcedOptionsSerializer()], - bump: [null, u8()], - }) - .deserializeUsing((account) => deserializePeerConfig(account)) - .whereField( - 'discriminator', - new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]) - ); +export function getPeerConfigGpaBuilder(context: Pick) { + const programId = context.programs.getPublicKey('myOapp', '') + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array + peerAddress: Uint8Array + enforcedOptions: EnforcedOptionsArgs + bump: number + }>({ + discriminator: [0, bytes({ size: 8 })], + peerAddress: [8, bytes({ size: 32 })], + enforcedOptions: [40, getEnforcedOptionsSerializer()], + bump: [null, u8()], + }) + .deserializeUsing((account) => deserializePeerConfig(account)) + .whereField('discriminator', new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203])) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts index 177ac3ccb..fa50e9ba6 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts @@ -7,144 +7,132 @@ */ import { - Account, - Context, - Pda, - PublicKey, - RpcAccount, - RpcGetAccountOptions, - RpcGetAccountsOptions, - assertAccountExists, - deserializeAccount, - gpaBuilder, - publicKey as toPublicKey, -} from '@metaplex-foundation/umi'; + Account, + Context, + Pda, + PublicKey, + RpcAccount, + RpcGetAccountOptions, + RpcGetAccountsOptions, + assertAccountExists, + deserializeAccount, + gpaBuilder, + publicKey as toPublicKey, +} from '@metaplex-foundation/umi' import { - Serializer, - bytes, - mapSerializer, - publicKey as publicKeySerializer, - string, - struct, - u8, -} from '@metaplex-foundation/umi/serializers'; + Serializer, + bytes, + mapSerializer, + publicKey as publicKeySerializer, + string, + struct, + u8, +} from '@metaplex-foundation/umi/serializers' -export type Store = Account; +export type Store = Account export type StoreAccountData = { - discriminator: Uint8Array; - admin: PublicKey; - bump: number; - endpointProgram: PublicKey; - string: string; -}; + discriminator: Uint8Array + admin: PublicKey + bump: number + endpointProgram: PublicKey + string: string +} export type StoreAccountDataArgs = { - admin: PublicKey; - bump: number; - endpointProgram: PublicKey; - string: string; -}; + admin: PublicKey + bump: number + endpointProgram: PublicKey + string: string +} -export function getStoreAccountDataSerializer(): Serializer< - StoreAccountDataArgs, - StoreAccountData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['admin', publicKeySerializer()], - ['bump', u8()], - ['endpointProgram', publicKeySerializer()], - ['string', string()], - ], - { description: 'StoreAccountData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]), - }) - ) as Serializer; +export function getStoreAccountDataSerializer(): Serializer { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['admin', publicKeySerializer()], + ['bump', u8()], + ['endpointProgram', publicKeySerializer()], + ['string', string()], + ], + { description: 'StoreAccountData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]), + }) + ) as Serializer } export function deserializeStore(rawAccount: RpcAccount): Store { - return deserializeAccount(rawAccount, getStoreAccountDataSerializer()); + return deserializeAccount(rawAccount, getStoreAccountDataSerializer()) } export async function fetchStore( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - assertAccountExists(maybeAccount, 'Store'); - return deserializeStore(maybeAccount); + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + assertAccountExists(maybeAccount, 'Store') + return deserializeStore(maybeAccount) } export async function safeFetchStore( - context: Pick, - publicKey: PublicKey | Pda, - options?: RpcGetAccountOptions + context: Pick, + publicKey: PublicKey | Pda, + options?: RpcGetAccountOptions ): Promise { - const maybeAccount = await context.rpc.getAccount( - toPublicKey(publicKey, false), - options - ); - return maybeAccount.exists ? deserializeStore(maybeAccount) : null; + const maybeAccount = await context.rpc.getAccount(toPublicKey(publicKey, false), options) + return maybeAccount.exists ? deserializeStore(maybeAccount) : null } export async function fetchAllStore( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts.map((maybeAccount) => { - assertAccountExists(maybeAccount, 'Store'); - return deserializeStore(maybeAccount); - }); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts.map((maybeAccount) => { + assertAccountExists(maybeAccount, 'Store') + return deserializeStore(maybeAccount) + }) } export async function safeFetchAllStore( - context: Pick, - publicKeys: Array, - options?: RpcGetAccountsOptions + context: Pick, + publicKeys: Array, + options?: RpcGetAccountsOptions ): Promise { - const maybeAccounts = await context.rpc.getAccounts( - publicKeys.map((key) => toPublicKey(key, false)), - options - ); - return maybeAccounts - .filter((maybeAccount) => maybeAccount.exists) - .map((maybeAccount) => deserializeStore(maybeAccount as RpcAccount)); + const maybeAccounts = await context.rpc.getAccounts( + publicKeys.map((key) => toPublicKey(key, false)), + options + ) + return maybeAccounts + .filter((maybeAccount) => maybeAccount.exists) + .map((maybeAccount) => deserializeStore(maybeAccount as RpcAccount)) } export function getStoreGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', ''); - return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array; - admin: PublicKey; - bump: number; - endpointProgram: PublicKey; - string: string; - }>({ - discriminator: [0, bytes({ size: 8 })], - admin: [8, publicKeySerializer()], - bump: [40, u8()], - endpointProgram: [41, publicKeySerializer()], - string: [73, string()], - }) - .deserializeUsing((account) => deserializeStore(account)) - .whereField( - 'discriminator', - new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]) - ); + const programId = context.programs.getPublicKey('myOapp', '') + return gpaBuilder(context, programId) + .registerFields<{ + discriminator: Uint8Array + admin: PublicKey + bump: number + endpointProgram: PublicKey + string: string + }>({ + discriminator: [0, bytes({ size: 8 })], + admin: [8, publicKeySerializer()], + bump: [40, u8()], + endpointProgram: [41, publicKeySerializer()], + string: [73, string()], + }) + .deserializeUsing((account) => deserializeStore(account)) + .whereField('discriminator', new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26])) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts index 626465801..a38217af5 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './myOapp'; +export * from './myOapp' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts index 33d62ca68..b7dd3da2f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts @@ -6,50 +6,39 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Program, ProgramError } from '@metaplex-foundation/umi'; +import { Program, ProgramError } from '@metaplex-foundation/umi' -type ProgramErrorConstructor = new ( - program: Program, - cause?: Error -) => ProgramError; -const codeToErrorMap: Map = new Map(); -const nameToErrorMap: Map = new Map(); +type ProgramErrorConstructor = new (program: Program, cause?: Error) => ProgramError +const codeToErrorMap: Map = new Map() +const nameToErrorMap: Map = new Map() /** InvalidMessageType: */ export class InvalidMessageTypeError extends ProgramError { - override readonly name: string = 'InvalidMessageType'; + override readonly name: string = 'InvalidMessageType' - readonly code: number = 0x1770; // 6000 + readonly code: number = 0x1770 // 6000 - constructor(program: Program, cause?: Error) { - super('', program, cause); - } + constructor(program: Program, cause?: Error) { + super('', program, cause) + } } -codeToErrorMap.set(0x1770, InvalidMessageTypeError); -nameToErrorMap.set('InvalidMessageType', InvalidMessageTypeError); +codeToErrorMap.set(0x1770, InvalidMessageTypeError) +nameToErrorMap.set('InvalidMessageType', InvalidMessageTypeError) /** * Attempts to resolve a custom program error from the provided error code. * @category Errors */ -export function getMyOappErrorFromCode( - code: number, - program: Program, - cause?: Error -): ProgramError | null { - const constructor = codeToErrorMap.get(code); - return constructor ? new constructor(program, cause) : null; +export function getMyOappErrorFromCode(code: number, program: Program, cause?: Error): ProgramError | null { + const constructor = codeToErrorMap.get(code) + return constructor ? new constructor(program, cause) : null } /** * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors */ -export function getMyOappErrorFromName( - name: string, - program: Program, - cause?: Error -): ProgramError | null { - const constructor = nameToErrorMap.get(name); - return constructor ? new constructor(program, cause) : null; +export function getMyOappErrorFromName(name: string, program: Program, cause?: Error): ProgramError | null { + const constructor = nameToErrorMap.get(name) + return constructor ? new constructor(program, cause) : null } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/index.ts index 4679ed0f1..442708c95 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/index.ts @@ -6,9 +6,9 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './accounts'; -export * from './errors'; -export * from './instructions'; -export * from './programs'; -export * from './shared'; -export * from './types'; +export * from './accounts' +export * from './errors' +export * from './instructions' +export * from './programs' +export * from './shared' +export * from './types' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts index b767508cf..0668265aa 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts @@ -6,10 +6,10 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './initStore'; -export * from './lzReceive'; -export * from './lzReceiveTypesInfo'; -export * from './lzReceiveTypesV2'; -export * from './quoteSend'; -export * from './send'; -export * from './setPeerConfig'; +export * from './initStore' +export * from './lzReceive' +export * from './lzReceiveTypesInfo' +export * from './lzReceiveTypesV2' +export * from './quoteSend' +export * from './send' +export * from './setPeerConfig' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts index e0fbf8e88..5360f67ad 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts @@ -6,142 +6,117 @@ * @see https://github.com/kinobi-so/kinobi */ +import { Context, Pda, PublicKey, Signer, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' import { - Context, - Pda, - PublicKey, - Signer, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - publicKey as publicKeySerializer, - struct, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; + Serializer, + bytes, + mapSerializer, + publicKey as publicKeySerializer, + struct, +} from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' // Accounts. export type InitStoreInstructionAccounts = { - payer?: Signer; - store: PublicKey | Pda; - lzReceiveTypesAccounts: PublicKey | Pda; - systemProgram?: PublicKey | Pda; -}; + payer?: Signer + store: PublicKey | Pda + lzReceiveTypesAccounts: PublicKey | Pda + systemProgram?: PublicKey | Pda +} // Data. export type InitStoreInstructionData = { - discriminator: Uint8Array; - admin: PublicKey; - endpoint: PublicKey; -}; + discriminator: Uint8Array + admin: PublicKey + endpoint: PublicKey +} export type InitStoreInstructionDataArgs = { - admin: PublicKey; - endpoint: PublicKey; -}; + admin: PublicKey + endpoint: PublicKey +} export function getInitStoreInstructionDataSerializer(): Serializer< - InitStoreInstructionDataArgs, - InitStoreInstructionData -> { - return mapSerializer< InitStoreInstructionDataArgs, - any, InitStoreInstructionData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['admin', publicKeySerializer()], - ['endpoint', publicKeySerializer()], - ], - { description: 'InitStoreInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([250, 74, 6, 95, 163, 188, 19, 181]), - }) - ) as Serializer; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['admin', publicKeySerializer()], + ['endpoint', publicKeySerializer()], + ], + { description: 'InitStoreInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([250, 74, 6, 95, 163, 188, 19, 181]), + }) + ) as Serializer } // Args. -export type InitStoreInstructionArgs = InitStoreInstructionDataArgs; +export type InitStoreInstructionArgs = InitStoreInstructionDataArgs // Instruction. export function initStore( - context: Pick, - input: InitStoreInstructionAccounts & InitStoreInstructionArgs + context: Pick, + input: InitStoreInstructionAccounts & InitStoreInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - payer: { - index: 0, - isWritable: true as boolean, - value: input.payer ?? null, - }, - store: { - index: 1, - isWritable: true as boolean, - value: input.store ?? null, - }, - lzReceiveTypesAccounts: { - index: 2, - isWritable: true as boolean, - value: input.lzReceiveTypesAccounts ?? null, - }, - systemProgram: { - index: 3, - isWritable: false as boolean, - value: input.systemProgram ?? null, - }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + payer: { + index: 0, + isWritable: true as boolean, + value: input.payer ?? null, + }, + store: { + index: 1, + isWritable: true as boolean, + value: input.store ?? null, + }, + lzReceiveTypesAccounts: { + index: 2, + isWritable: true as boolean, + value: input.lzReceiveTypesAccounts ?? null, + }, + systemProgram: { + index: 3, + isWritable: false as boolean, + value: input.systemProgram ?? null, + }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: InitStoreInstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: InitStoreInstructionArgs = { ...input } - // Default values. - if (!resolvedAccounts.payer.value) { - resolvedAccounts.payer.value = context.payer; - } - if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = context.programs.getPublicKey( - 'splSystem', - '11111111111111111111111111111111' - ); - resolvedAccounts.systemProgram.isWritable = false; - } + // Default values. + if (!resolvedAccounts.payer.value) { + resolvedAccounts.payer.value = context.payer + } + if (!resolvedAccounts.systemProgram.value) { + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', + '11111111111111111111111111111111' + ) + resolvedAccounts.systemProgram.isWritable = false + } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getInitStoreInstructionDataSerializer().serialize( - resolvedArgs as InitStoreInstructionDataArgs - ); + // Data. + const data = getInitStoreInstructionDataSerializer().serialize(resolvedArgs as InitStoreInstructionDataArgs) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts index aa0653818..73b414e33 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts @@ -6,119 +6,86 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Context, - Pda, - PublicKey, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - struct, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; -import { - LzReceiveParams, - LzReceiveParamsArgs, - getLzReceiveParamsSerializer, -} from '../types'; +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' // Accounts. export type LzReceiveInstructionAccounts = { - /** - * OApp Store PDA. This account represents the "address" of your OApp on - * Solana and can contain any state relevant to your application. - * Customize the fields in `Store` as needed. - */ + /** + * OApp Store PDA. This account represents the "address" of your OApp on + * Solana and can contain any state relevant to your application. + * Customize the fields in `Store` as needed. + */ - store: PublicKey | Pda; - /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ - peer: PublicKey | Pda; -}; + store: PublicKey | Pda + /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ + peer: PublicKey | Pda +} // Data. export type LzReceiveInstructionData = { - discriminator: Uint8Array; - params: LzReceiveParams; -}; + discriminator: Uint8Array + params: LzReceiveParams +} -export type LzReceiveInstructionDataArgs = { params: LzReceiveParamsArgs }; +export type LzReceiveInstructionDataArgs = { params: LzReceiveParamsArgs } export function getLzReceiveInstructionDataSerializer(): Serializer< - LzReceiveInstructionDataArgs, - LzReceiveInstructionData -> { - return mapSerializer< LzReceiveInstructionDataArgs, - any, LzReceiveInstructionData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([8, 179, 120, 109, 33, 118, 189, 80]), - }) - ) as Serializer; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([8, 179, 120, 109, 33, 118, 189, 80]), + }) + ) as Serializer } // Args. -export type LzReceiveInstructionArgs = LzReceiveInstructionDataArgs; +export type LzReceiveInstructionArgs = LzReceiveInstructionDataArgs // Instruction. export function lzReceive( - context: Pick, - input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs + context: Pick, + input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: true as boolean, - value: input.store ?? null, - }, - peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: true as boolean, + value: input.store ?? null, + }, + peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: LzReceiveInstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: LzReceiveInstructionArgs = { ...input } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getLzReceiveInstructionDataSerializer().serialize( - resolvedArgs as LzReceiveInstructionDataArgs - ); + // Data. + const data = getLzReceiveInstructionDataSerializer().serialize(resolvedArgs as LzReceiveInstructionDataArgs) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts index f7954c10c..53cca9710 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts @@ -6,128 +6,92 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Context, - Pda, - PublicKey, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - struct, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; -import { - LzReceiveParams, - LzReceiveParamsArgs, - getLzReceiveParamsSerializer, -} from '../types'; +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' // Accounts. export type LzReceiveTypesInfoInstructionAccounts = { - store: PublicKey | Pda; - /** - * PDA account containing the versioned data structure for V2 - * Contains the accounts needed to construct lz_receive_types_v2 instruction - */ + store: PublicKey | Pda + /** + * PDA account containing the versioned data structure for V2 + * Contains the accounts needed to construct lz_receive_types_v2 instruction + */ - lzReceiveTypesAccounts: PublicKey | Pda; -}; + lzReceiveTypesAccounts: PublicKey | Pda +} // Data. export type LzReceiveTypesInfoInstructionData = { - discriminator: Uint8Array; - params: LzReceiveParams; -}; + discriminator: Uint8Array + params: LzReceiveParams +} export type LzReceiveTypesInfoInstructionDataArgs = { - params: LzReceiveParamsArgs; -}; + params: LzReceiveParamsArgs +} export function getLzReceiveTypesInfoInstructionDataSerializer(): Serializer< - LzReceiveTypesInfoInstructionDataArgs, - LzReceiveTypesInfoInstructionData -> { - return mapSerializer< LzReceiveTypesInfoInstructionDataArgs, - any, LzReceiveTypesInfoInstructionData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveTypesInfoInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]), - }) - ) as Serializer< - LzReceiveTypesInfoInstructionDataArgs, - LzReceiveTypesInfoInstructionData - >; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveTypesInfoInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]), + }) + ) as Serializer } // Args. -export type LzReceiveTypesInfoInstructionArgs = - LzReceiveTypesInfoInstructionDataArgs; +export type LzReceiveTypesInfoInstructionArgs = LzReceiveTypesInfoInstructionDataArgs // Instruction. export function lzReceiveTypesInfo( - context: Pick, - input: LzReceiveTypesInfoInstructionAccounts & - LzReceiveTypesInfoInstructionArgs + context: Pick, + input: LzReceiveTypesInfoInstructionAccounts & LzReceiveTypesInfoInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - lzReceiveTypesAccounts: { - index: 1, - isWritable: false as boolean, - value: input.lzReceiveTypesAccounts ?? null, - }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + lzReceiveTypesAccounts: { + index: 1, + isWritable: false as boolean, + value: input.lzReceiveTypesAccounts ?? null, + }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: LzReceiveTypesInfoInstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: LzReceiveTypesInfoInstructionArgs = { ...input } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getLzReceiveTypesInfoInstructionDataSerializer().serialize( - resolvedArgs as LzReceiveTypesInfoInstructionDataArgs - ); + // Data. + const data = getLzReceiveTypesInfoInstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesInfoInstructionDataArgs + ) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts index c8b6cceae..2e0c2a06b 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts @@ -6,116 +6,81 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Context, - Pda, - PublicKey, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - struct, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; -import { - LzReceiveParams, - LzReceiveParamsArgs, - getLzReceiveParamsSerializer, -} from '../types'; +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' // Accounts. export type LzReceiveTypesV2InstructionAccounts = { - store: PublicKey | Pda; -}; + store: PublicKey | Pda +} // Data. export type LzReceiveTypesV2InstructionData = { - discriminator: Uint8Array; - params: LzReceiveParams; -}; + discriminator: Uint8Array + params: LzReceiveParams +} export type LzReceiveTypesV2InstructionDataArgs = { - params: LzReceiveParamsArgs; -}; + params: LzReceiveParamsArgs +} export function getLzReceiveTypesV2InstructionDataSerializer(): Serializer< - LzReceiveTypesV2InstructionDataArgs, - LzReceiveTypesV2InstructionData -> { - return mapSerializer< LzReceiveTypesV2InstructionDataArgs, - any, LzReceiveTypesV2InstructionData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveTypesV2InstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]), - }) - ) as Serializer< - LzReceiveTypesV2InstructionDataArgs, - LzReceiveTypesV2InstructionData - >; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveTypesV2InstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]), + }) + ) as Serializer } // Args. -export type LzReceiveTypesV2InstructionArgs = - LzReceiveTypesV2InstructionDataArgs; +export type LzReceiveTypesV2InstructionArgs = LzReceiveTypesV2InstructionDataArgs // Instruction. export function lzReceiveTypesV2( - context: Pick, - input: LzReceiveTypesV2InstructionAccounts & LzReceiveTypesV2InstructionArgs + context: Pick, + input: LzReceiveTypesV2InstructionAccounts & LzReceiveTypesV2InstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: LzReceiveTypesV2InstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: LzReceiveTypesV2InstructionArgs = { ...input } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getLzReceiveTypesV2InstructionDataSerializer().serialize( - resolvedArgs as LzReceiveTypesV2InstructionDataArgs - ); + // Data. + const data = getLzReceiveTypesV2InstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesV2InstructionDataArgs + ) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts index 6c6d20248..8638b1c7f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts @@ -6,130 +6,98 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Context, - Pda, - PublicKey, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bool, - bytes, - mapSerializer, - string, - struct, - u32, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bool, bytes, mapSerializer, string, struct, u32 } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' // Accounts. export type QuoteSendInstructionAccounts = { - store: PublicKey | Pda; - peer: PublicKey | Pda; - endpoint: PublicKey | Pda; -}; + store: PublicKey | Pda + peer: PublicKey | Pda + endpoint: PublicKey | Pda +} // Data. export type QuoteSendInstructionData = { - discriminator: Uint8Array; - dstEid: number; - receiver: Uint8Array; - message: string; - options: Uint8Array; - payInLzToken: boolean; -}; + discriminator: Uint8Array + dstEid: number + receiver: Uint8Array + message: string + options: Uint8Array + payInLzToken: boolean +} export type QuoteSendInstructionDataArgs = { - dstEid: number; - receiver: Uint8Array; - message: string; - options: Uint8Array; - payInLzToken: boolean; -}; + dstEid: number + receiver: Uint8Array + message: string + options: Uint8Array + payInLzToken: boolean +} export function getQuoteSendInstructionDataSerializer(): Serializer< - QuoteSendInstructionDataArgs, - QuoteSendInstructionData -> { - return mapSerializer< QuoteSendInstructionDataArgs, - any, QuoteSendInstructionData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['dstEid', u32()], - ['receiver', bytes({ size: 32 })], - ['message', string()], - ['options', bytes({ size: u32() })], - ['payInLzToken', bool()], - ], - { description: 'QuoteSendInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([207, 0, 49, 214, 160, 211, 76, 211]), - }) - ) as Serializer; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['dstEid', u32()], + ['receiver', bytes({ size: 32 })], + ['message', string()], + ['options', bytes({ size: u32() })], + ['payInLzToken', bool()], + ], + { description: 'QuoteSendInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([207, 0, 49, 214, 160, 211, 76, 211]), + }) + ) as Serializer } // Args. -export type QuoteSendInstructionArgs = QuoteSendInstructionDataArgs; +export type QuoteSendInstructionArgs = QuoteSendInstructionDataArgs // Instruction. export function quoteSend( - context: Pick, - input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs + context: Pick, + input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, - endpoint: { - index: 2, - isWritable: false as boolean, - value: input.endpoint ?? null, - }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, + endpoint: { + index: 2, + isWritable: false as boolean, + value: input.endpoint ?? null, + }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: QuoteSendInstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: QuoteSendInstructionArgs = { ...input } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getQuoteSendInstructionDataSerializer().serialize( - resolvedArgs as QuoteSendInstructionDataArgs - ); + // Data. + const data = getQuoteSendInstructionDataSerializer().serialize(resolvedArgs as QuoteSendInstructionDataArgs) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts index e3d560c50..ab73d8d06 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts @@ -6,132 +6,101 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Context, - Pda, - PublicKey, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - string, - struct, - u32, - u64, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, string, struct, u32, u64 } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' // Accounts. export type SendInstructionAccounts = { - /** - * Configuration for the destination chain. Holds the peer address and any - * enforced messaging options. - */ + /** + * Configuration for the destination chain. Holds the peer address and any + * enforced messaging options. + */ - peer: PublicKey | Pda; - /** OApp Store PDA that signs the send instruction */ - store: PublicKey | Pda; - endpoint: PublicKey | Pda; -}; + peer: PublicKey | Pda + /** OApp Store PDA that signs the send instruction */ + store: PublicKey | Pda + endpoint: PublicKey | Pda +} // Data. export type SendInstructionData = { - discriminator: Uint8Array; - dstEid: number; - message: string; - options: Uint8Array; - nativeFee: bigint; - lzTokenFee: bigint; -}; + discriminator: Uint8Array + dstEid: number + message: string + options: Uint8Array + nativeFee: bigint + lzTokenFee: bigint +} export type SendInstructionDataArgs = { - dstEid: number; - message: string; - options: Uint8Array; - nativeFee: number | bigint; - lzTokenFee: number | bigint; -}; + dstEid: number + message: string + options: Uint8Array + nativeFee: number | bigint + lzTokenFee: number | bigint +} -export function getSendInstructionDataSerializer(): Serializer< - SendInstructionDataArgs, - SendInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['dstEid', u32()], - ['message', string()], - ['options', bytes({ size: u32() })], - ['nativeFee', u64()], - ['lzTokenFee', u64()], - ], - { description: 'SendInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([102, 251, 20, 187, 65, 75, 12, 69]), - }) - ) as Serializer; +export function getSendInstructionDataSerializer(): Serializer { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['dstEid', u32()], + ['message', string()], + ['options', bytes({ size: u32() })], + ['nativeFee', u64()], + ['lzTokenFee', u64()], + ], + { description: 'SendInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([102, 251, 20, 187, 65, 75, 12, 69]), + }) + ) as Serializer } // Args. -export type SendInstructionArgs = SendInstructionDataArgs; +export type SendInstructionArgs = SendInstructionDataArgs // Instruction. export function send( - context: Pick, - input: SendInstructionAccounts & SendInstructionArgs + context: Pick, + input: SendInstructionAccounts & SendInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - peer: { index: 0, isWritable: false as boolean, value: input.peer ?? null }, - store: { - index: 1, - isWritable: false as boolean, - value: input.store ?? null, - }, - endpoint: { - index: 2, - isWritable: false as boolean, - value: input.endpoint ?? null, - }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + peer: { index: 0, isWritable: false as boolean, value: input.peer ?? null }, + store: { + index: 1, + isWritable: false as boolean, + value: input.store ?? null, + }, + endpoint: { + index: 2, + isWritable: false as boolean, + value: input.endpoint ?? null, + }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: SendInstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: SendInstructionArgs = { ...input } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getSendInstructionDataSerializer().serialize( - resolvedArgs as SendInstructionDataArgs - ); + // Data. + const data = getSendInstructionDataSerializer().serialize(resolvedArgs as SendInstructionDataArgs) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts index 8cfdebcba..3b0e5fb9a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts @@ -6,146 +6,108 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Context, - Pda, - PublicKey, - Signer, - TransactionBuilder, - transactionBuilder, -} from '@metaplex-foundation/umi'; -import { - Serializer, - bytes, - mapSerializer, - struct, - u32, -} from '@metaplex-foundation/umi/serializers'; -import { - ResolvedAccount, - ResolvedAccountsWithIndices, - getAccountMetasAndSigners, -} from '../shared'; -import { - PeerConfigParam, - PeerConfigParamArgs, - getPeerConfigParamSerializer, -} from '../types'; +import { Context, Pda, PublicKey, Signer, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct, u32 } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { PeerConfigParam, PeerConfigParamArgs, getPeerConfigParamSerializer } from '../types' // Accounts. export type SetPeerConfigInstructionAccounts = { - /** Admin of the OApp store */ - admin: Signer; - /** Peer configuration PDA for a specific remote chain */ - peer: PublicKey | Pda; - /** Store PDA of this OApp */ - store: PublicKey | Pda; - systemProgram?: PublicKey | Pda; -}; + /** Admin of the OApp store */ + admin: Signer + /** Peer configuration PDA for a specific remote chain */ + peer: PublicKey | Pda + /** Store PDA of this OApp */ + store: PublicKey | Pda + systemProgram?: PublicKey | Pda +} // Data. export type SetPeerConfigInstructionData = { - discriminator: Uint8Array; - remoteEid: number; - config: PeerConfigParam; -}; + discriminator: Uint8Array + remoteEid: number + config: PeerConfigParam +} export type SetPeerConfigInstructionDataArgs = { - remoteEid: number; - config: PeerConfigParamArgs; -}; + remoteEid: number + config: PeerConfigParamArgs +} export function getSetPeerConfigInstructionDataSerializer(): Serializer< - SetPeerConfigInstructionDataArgs, - SetPeerConfigInstructionData -> { - return mapSerializer< SetPeerConfigInstructionDataArgs, - any, SetPeerConfigInstructionData - >( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['remoteEid', u32()], - ['config', getPeerConfigParamSerializer()], - ], - { description: 'SetPeerConfigInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([79, 187, 168, 57, 139, 140, 93, 47]), - }) - ) as Serializer< - SetPeerConfigInstructionDataArgs, - SetPeerConfigInstructionData - >; +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['remoteEid', u32()], + ['config', getPeerConfigParamSerializer()], + ], + { description: 'SetPeerConfigInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([79, 187, 168, 57, 139, 140, 93, 47]), + }) + ) as Serializer } // Args. -export type SetPeerConfigInstructionArgs = SetPeerConfigInstructionDataArgs; +export type SetPeerConfigInstructionArgs = SetPeerConfigInstructionDataArgs // Instruction. export function setPeerConfig( - context: Pick, - input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs + context: Pick, + input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs ): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', ''); + // Program ID. + const programId = context.programs.getPublicKey('myOapp', '') - // Accounts. - const resolvedAccounts = { - admin: { - index: 0, - isWritable: true as boolean, - value: input.admin ?? null, - }, - peer: { index: 1, isWritable: true as boolean, value: input.peer ?? null }, - store: { - index: 2, - isWritable: false as boolean, - value: input.store ?? null, - }, - systemProgram: { - index: 3, - isWritable: false as boolean, - value: input.systemProgram ?? null, - }, - } satisfies ResolvedAccountsWithIndices; + // Accounts. + const resolvedAccounts = { + admin: { + index: 0, + isWritable: true as boolean, + value: input.admin ?? null, + }, + peer: { index: 1, isWritable: true as boolean, value: input.peer ?? null }, + store: { + index: 2, + isWritable: false as boolean, + value: input.store ?? null, + }, + systemProgram: { + index: 3, + isWritable: false as boolean, + value: input.systemProgram ?? null, + }, + } satisfies ResolvedAccountsWithIndices - // Arguments. - const resolvedArgs: SetPeerConfigInstructionArgs = { ...input }; + // Arguments. + const resolvedArgs: SetPeerConfigInstructionArgs = { ...input } - // Default values. - if (!resolvedAccounts.systemProgram.value) { - resolvedAccounts.systemProgram.value = context.programs.getPublicKey( - 'splSystem', - '11111111111111111111111111111111' - ); - resolvedAccounts.systemProgram.isWritable = false; - } + // Default values. + if (!resolvedAccounts.systemProgram.value) { + resolvedAccounts.systemProgram.value = context.programs.getPublicKey( + 'splSystem', + '11111111111111111111111111111111' + ) + resolvedAccounts.systemProgram.isWritable = false + } - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values( - resolvedAccounts - ).sort((a, b) => a.index - b.index); + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners( - orderedAccounts, - 'programId', - programId - ); + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - // Data. - const data = getSetPeerConfigInstructionDataSerializer().serialize( - resolvedArgs as SetPeerConfigInstructionDataArgs - ); + // Data. + const data = getSetPeerConfigInstructionDataSerializer().serialize(resolvedArgs as SetPeerConfigInstructionDataArgs) - // Bytes Created On Chain. - const bytesCreatedOnChain = 0; + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 - return transactionBuilder([ - { instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, - ]); + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts index 626465801..a38217af5 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/index.ts @@ -6,4 +6,4 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './myOapp'; +export * from './myOapp' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts index c58a13212..8cc8afeb2 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts @@ -6,46 +6,34 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - ClusterFilter, - Context, - Program, - PublicKey, -} from '@metaplex-foundation/umi'; -import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors'; +import { ClusterFilter, Context, Program, PublicKey } from '@metaplex-foundation/umi' +import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors' -export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''>; +export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''> export function createMyOappProgram(): Program { - return { - name: 'myOapp', - publicKey: MY_OAPP_PROGRAM_ID, - getErrorFromCode(code: number, cause?: Error) { - return getMyOappErrorFromCode(code, this, cause); - }, - getErrorFromName(name: string, cause?: Error) { - return getMyOappErrorFromName(name, this, cause); - }, - isOnCluster() { - return true; - }, - }; + return { + name: 'myOapp', + publicKey: MY_OAPP_PROGRAM_ID, + getErrorFromCode(code: number, cause?: Error) { + return getMyOappErrorFromCode(code, this, cause) + }, + getErrorFromName(name: string, cause?: Error) { + return getMyOappErrorFromName(name, this, cause) + }, + isOnCluster() { + return true + }, + } } export function getMyOappProgram( - context: Pick, - clusterFilter?: ClusterFilter + context: Pick, + clusterFilter?: ClusterFilter ): T { - return context.programs.get('myOapp', clusterFilter); + return context.programs.get('myOapp', clusterFilter) } -export function getMyOappProgramId( - context: Pick, - clusterFilter?: ClusterFilter -): PublicKey { - return context.programs.getPublicKey( - 'myOapp', - MY_OAPP_PROGRAM_ID, - clusterFilter - ); +export function getMyOappProgramId(context: Pick, clusterFilter?: ClusterFilter): PublicKey { + return context.programs.getPublicKey('myOapp', MY_OAPP_PROGRAM_ID, clusterFilter) } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts index 0102e5646..70554c289 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts @@ -6,58 +6,45 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - AccountMeta, - isSigner, - Pda, - publicKey, - PublicKey, - Signer, - isPda, -} from '@metaplex-foundation/umi'; +import { AccountMeta, isSigner, Pda, publicKey, PublicKey, Signer, isPda } from '@metaplex-foundation/umi' /** * Transforms the given object such that the given keys are optional. * @internal */ -export type PickPartial = Omit & - Partial>; +export type PickPartial = Omit & Partial> /** * Asserts that the given value is not null or undefined. * @internal */ export function expectSome(value: T | null | undefined): T { - if (value == null) { - throw new Error('Expected a value but received null or undefined.'); - } - return value; + if (value == null) { + throw new Error('Expected a value but received null or undefined.') + } + return value } /** * Asserts that the given value is a PublicKey. * @internal */ -export function expectPublicKey( - value: PublicKey | Pda | Signer | null | undefined -): PublicKey { - if (!value) { - throw new Error('Expected a PublicKey.'); - } - return publicKey(value, false); +export function expectPublicKey(value: PublicKey | Pda | Signer | null | undefined): PublicKey { + if (!value) { + throw new Error('Expected a PublicKey.') + } + return publicKey(value, false) } /** * Asserts that the given value is a PDA. * @internal */ -export function expectPda( - value: PublicKey | Pda | Signer | null | undefined -): Pda { - if (!value || !Array.isArray(value) || !isPda(value)) { - throw new Error('Expected a PDA.'); - } - return value; +export function expectPda(value: PublicKey | Pda | Signer | null | undefined): Pda { + if (!value || !Array.isArray(value) || !isPda(value)) { + throw new Error('Expected a PDA.') + } + return value } /** @@ -65,53 +52,50 @@ export function expectPda( * @internal */ export type ResolvedAccount = { - isWritable: boolean; - value: T; -}; + isWritable: boolean + value: T +} /** * Defines a set of instruction account to resolve. * @internal */ -export type ResolvedAccounts = Record; +export type ResolvedAccounts = Record /** * Defines a set of instruction account to resolve with their indices. * @internal */ -export type ResolvedAccountsWithIndices = Record< - string, - ResolvedAccount & { index: number } ->; +export type ResolvedAccountsWithIndices = Record /** * Get account metas and signers from resolved accounts. * @internal */ export function getAccountMetasAndSigners( - accounts: ResolvedAccount[], - optionalAccountStrategy: 'omitted' | 'programId', - programId: PublicKey + accounts: ResolvedAccount[], + optionalAccountStrategy: 'omitted' | 'programId', + programId: PublicKey ): [AccountMeta[], Signer[]] { - const keys: AccountMeta[] = []; - const signers: Signer[] = []; + const keys: AccountMeta[] = [] + const signers: Signer[] = [] - accounts.forEach((account) => { - if (!account.value) { - if (optionalAccountStrategy === 'omitted') return; - keys.push({ pubkey: programId, isSigner: false, isWritable: false }); - return; - } + accounts.forEach((account) => { + if (!account.value) { + if (optionalAccountStrategy === 'omitted') return + keys.push({ pubkey: programId, isSigner: false, isWritable: false }) + return + } - if (isSigner(account.value)) { - signers.push(account.value); - } - keys.push({ - pubkey: publicKey(account.value, false), - isSigner: isSigner(account.value), - isWritable: account.isWritable, - }); - }); + if (isSigner(account.value)) { + signers.push(account.value) + } + keys.push({ + pubkey: publicKey(account.value, false), + isSigner: isSigner(account.value), + isWritable: account.isWritable, + }) + }) - return [keys, signers]; + return [keys, signers] } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts index 90d365a75..d7a990a26 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/accountMetaRef.ts @@ -6,12 +6,8 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Serializer, bool, struct } from '@metaplex-foundation/umi/serializers'; -import { - AddressLocator, - AddressLocatorArgs, - getAddressLocatorSerializer, -} from '.'; +import { Serializer, bool, struct } from '@metaplex-foundation/umi/serializers' +import { AddressLocator, AddressLocatorArgs, getAddressLocatorSerializer } from '.' /** * Account metadata for V2 execution planning. @@ -23,28 +19,25 @@ import { */ export type AccountMetaRef = { - /** The account address locator - supports multiple resolution strategies */ - pubkey: AddressLocator; - /** Whether the account should be writable in the final transaction */ - isWritable: boolean; -}; + /** The account address locator - supports multiple resolution strategies */ + pubkey: AddressLocator + /** Whether the account should be writable in the final transaction */ + isWritable: boolean +} export type AccountMetaRefArgs = { - /** The account address locator - supports multiple resolution strategies */ - pubkey: AddressLocatorArgs; - /** Whether the account should be writable in the final transaction */ - isWritable: boolean; -}; + /** The account address locator - supports multiple resolution strategies */ + pubkey: AddressLocatorArgs + /** Whether the account should be writable in the final transaction */ + isWritable: boolean +} -export function getAccountMetaRefSerializer(): Serializer< - AccountMetaRefArgs, - AccountMetaRef -> { - return struct( - [ - ['pubkey', getAddressLocatorSerializer()], - ['isWritable', bool()], - ], - { description: 'AccountMetaRef' } - ) as Serializer; +export function getAccountMetaRefSerializer(): Serializer { + return struct( + [ + ['pubkey', getAddressLocatorSerializer()], + ['isWritable', bool()], + ], + { description: 'AccountMetaRef' } + ) as Serializer } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts index 41764b869..5ef83846a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/addressLocator.ts @@ -6,18 +6,18 @@ * @see https://github.com/kinobi-so/kinobi */ -import { PublicKey } from '@metaplex-foundation/umi'; +import { PublicKey } from '@metaplex-foundation/umi' import { - GetDataEnumKind, - GetDataEnumKindContent, - Serializer, - dataEnum, - publicKey as publicKeySerializer, - struct, - tuple, - u8, - unit, -} from '@metaplex-foundation/umi/serializers'; + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + dataEnum, + publicKey as publicKeySerializer, + struct, + tuple, + u8, + unit, +} from '@metaplex-foundation/umi/serializers' /** * A generic account locator used in LZ execution planning for V2. @@ -33,75 +33,54 @@ import { */ export type AddressLocator = - | { __kind: 'Address'; fields: [PublicKey] } - | { __kind: 'AltIndex'; fields: [number, number] } - | { __kind: 'Payer' } - | { __kind: 'Signer'; fields: [number] } - | { __kind: 'Context' }; + | { __kind: 'Address'; fields: [PublicKey] } + | { __kind: 'AltIndex'; fields: [number, number] } + | { __kind: 'Payer' } + | { __kind: 'Signer'; fields: [number] } + | { __kind: 'Context' } -export type AddressLocatorArgs = AddressLocator; +export type AddressLocatorArgs = AddressLocator -export function getAddressLocatorSerializer(): Serializer< - AddressLocatorArgs, - AddressLocator -> { - return dataEnum( - [ - [ - 'Address', - struct>([ - ['fields', tuple([publicKeySerializer()])], - ]), - ], - [ - 'AltIndex', - struct>([ - ['fields', tuple([u8(), u8()])], - ]), - ], - ['Payer', unit()], - [ - 'Signer', - struct>([ - ['fields', tuple([u8()])], - ]), - ], - ['Context', unit()], - ], - { description: 'AddressLocator' } - ) as Serializer; +export function getAddressLocatorSerializer(): Serializer { + return dataEnum( + [ + [ + 'Address', + struct>([['fields', tuple([publicKeySerializer()])]]), + ], + ['AltIndex', struct>([['fields', tuple([u8(), u8()])]])], + ['Payer', unit()], + ['Signer', struct>([['fields', tuple([u8()])]])], + ['Context', unit()], + ], + { description: 'AddressLocator' } + ) as Serializer } // Data Enum Helpers. export function addressLocator( - kind: 'Address', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; + kind: 'Address', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind export function addressLocator( - kind: 'AltIndex', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; + kind: 'AltIndex', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind +export function addressLocator(kind: 'Payer'): GetDataEnumKind export function addressLocator( - kind: 'Payer' -): GetDataEnumKind; -export function addressLocator( - kind: 'Signer', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; -export function addressLocator( - kind: 'Context' -): GetDataEnumKind; + kind: 'Signer', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind +export function addressLocator(kind: 'Context'): GetDataEnumKind export function addressLocator( - kind: K, - data?: any + kind: K, + data?: any ): Extract { - return Array.isArray(data) - ? { __kind: kind, fields: data } - : { __kind: kind, ...(data ?? {}) }; + return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } } export function isAddressLocator( - kind: K, - value: AddressLocator + kind: K, + value: AddressLocator ): value is AddressLocator & { __kind: K } { - return value.__kind === kind; + return value.__kind === kind } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts index 360398c81..ea99c95af 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/enforcedOptions.ts @@ -6,26 +6,18 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Serializer, - bytes, - struct, - u32, -} from '@metaplex-foundation/umi/serializers'; +import { Serializer, bytes, struct, u32 } from '@metaplex-foundation/umi/serializers' -export type EnforcedOptions = { send: Uint8Array; sendAndCall: Uint8Array }; +export type EnforcedOptions = { send: Uint8Array; sendAndCall: Uint8Array } -export type EnforcedOptionsArgs = EnforcedOptions; +export type EnforcedOptionsArgs = EnforcedOptions -export function getEnforcedOptionsSerializer(): Serializer< - EnforcedOptionsArgs, - EnforcedOptions -> { - return struct( - [ - ['send', bytes({ size: u32() })], - ['sendAndCall', bytes({ size: u32() })], - ], - { description: 'EnforcedOptions' } - ) as Serializer; +export function getEnforcedOptionsSerializer(): Serializer { + return struct( + [ + ['send', bytes({ size: u32() })], + ['sendAndCall', bytes({ size: u32() })], + ], + { description: 'EnforcedOptions' } + ) as Serializer } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts index cba7356a2..3c6132257 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts @@ -6,11 +6,11 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './accountMetaRef'; -export * from './addressLocator'; -export * from './enforcedOptions'; -export * from './instruction'; -export * from './lzReceiveParams'; -export * from './lzReceiveTypesV2Result'; -export * from './messagingFee'; -export * from './peerConfigParam'; +export * from './accountMetaRef' +export * from './addressLocator' +export * from './enforcedOptions' +export * from './instruction' +export * from './lzReceiveParams' +export * from './lzReceiveTypesV2Result' +export * from './messagingFee' +export * from './peerConfigParam' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts index a8e36e94f..53dbbf974 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/instruction.ts @@ -6,23 +6,19 @@ * @see https://github.com/kinobi-so/kinobi */ -import { PublicKey } from '@metaplex-foundation/umi'; +import { PublicKey } from '@metaplex-foundation/umi' import { - GetDataEnumKind, - GetDataEnumKindContent, - Serializer, - array, - bytes, - dataEnum, - publicKey as publicKeySerializer, - struct, - u32, -} from '@metaplex-foundation/umi/serializers'; -import { - AccountMetaRef, - AccountMetaRefArgs, - getAccountMetaRefSerializer, -} from '.'; + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + array, + bytes, + dataEnum, + publicKey as publicKeySerializer, + struct, + u32, +} from '@metaplex-foundation/umi/serializers' +import { AccountMetaRef, AccountMetaRefArgs, getAccountMetaRefSerializer } from '.' /** * The list of instructions that can be executed in the LzReceive transaction. @@ -35,100 +31,95 @@ import { */ export type Instruction = - | { - __kind: 'LzReceive'; - /** - * Account list for the lz_receive instruction - * Uses AddressLocator for flexible address resolution - */ - accounts: Array; - } - | { - __kind: 'Standard'; - /** Target program ID for the custom instruction */ - programId: PublicKey; - /** - * Account list for the custom instruction - * Uses same AddressLocator system as LzReceive - */ - accounts: Array; - /** - * Instruction data payload - * Raw bytes containing the instruction's parameters - */ - data: Uint8Array; - }; + | { + __kind: 'LzReceive' + /** + * Account list for the lz_receive instruction + * Uses AddressLocator for flexible address resolution + */ + accounts: Array + } + | { + __kind: 'Standard' + /** Target program ID for the custom instruction */ + programId: PublicKey + /** + * Account list for the custom instruction + * Uses same AddressLocator system as LzReceive + */ + accounts: Array + /** + * Instruction data payload + * Raw bytes containing the instruction's parameters + */ + data: Uint8Array + } export type InstructionArgs = - | { - __kind: 'LzReceive'; - /** - * Account list for the lz_receive instruction - * Uses AddressLocator for flexible address resolution - */ - accounts: Array; - } - | { - __kind: 'Standard'; - /** Target program ID for the custom instruction */ - programId: PublicKey; - /** - * Account list for the custom instruction - * Uses same AddressLocator system as LzReceive - */ - accounts: Array; - /** - * Instruction data payload - * Raw bytes containing the instruction's parameters - */ - data: Uint8Array; - }; + | { + __kind: 'LzReceive' + /** + * Account list for the lz_receive instruction + * Uses AddressLocator for flexible address resolution + */ + accounts: Array + } + | { + __kind: 'Standard' + /** Target program ID for the custom instruction */ + programId: PublicKey + /** + * Account list for the custom instruction + * Uses same AddressLocator system as LzReceive + */ + accounts: Array + /** + * Instruction data payload + * Raw bytes containing the instruction's parameters + */ + data: Uint8Array + } -export function getInstructionSerializer(): Serializer< - InstructionArgs, - Instruction -> { - return dataEnum( - [ - [ - 'LzReceive', - struct>([ - ['accounts', array(getAccountMetaRefSerializer())], - ]), - ], - [ - 'Standard', - struct>([ - ['programId', publicKeySerializer()], - ['accounts', array(getAccountMetaRefSerializer())], - ['data', bytes({ size: u32() })], - ]), - ], - ], - { description: 'Instruction' } - ) as Serializer; +export function getInstructionSerializer(): Serializer { + return dataEnum( + [ + [ + 'LzReceive', + struct>([ + ['accounts', array(getAccountMetaRefSerializer())], + ]), + ], + [ + 'Standard', + struct>([ + ['programId', publicKeySerializer()], + ['accounts', array(getAccountMetaRefSerializer())], + ['data', bytes({ size: u32() })], + ]), + ], + ], + { description: 'Instruction' } + ) as Serializer } // Data Enum Helpers. export function instruction( - kind: 'LzReceive', - data: GetDataEnumKindContent -): GetDataEnumKind; + kind: 'LzReceive', + data: GetDataEnumKindContent +): GetDataEnumKind export function instruction( - kind: 'Standard', - data: GetDataEnumKindContent -): GetDataEnumKind; + kind: 'Standard', + data: GetDataEnumKindContent +): GetDataEnumKind export function instruction( - kind: K, - data?: any + kind: K, + data?: any ): Extract { - return Array.isArray(data) - ? { __kind: kind, fields: data } - : { __kind: kind, ...(data ?? {}) }; + return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } } export function isInstruction( - kind: K, - value: Instruction + kind: K, + value: Instruction ): value is Instruction & { __kind: K } { - return value.__kind === kind; + return value.__kind === kind } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts index 59dd1b4ac..ca661c26a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveParams.ts @@ -6,45 +6,36 @@ * @see https://github.com/kinobi-so/kinobi */ -import { - Serializer, - bytes, - struct, - u32, - u64, -} from '@metaplex-foundation/umi/serializers'; +import { Serializer, bytes, struct, u32, u64 } from '@metaplex-foundation/umi/serializers' export type LzReceiveParams = { - srcEid: number; - sender: Uint8Array; - nonce: bigint; - guid: Uint8Array; - message: Uint8Array; - extraData: Uint8Array; -}; + srcEid: number + sender: Uint8Array + nonce: bigint + guid: Uint8Array + message: Uint8Array + extraData: Uint8Array +} export type LzReceiveParamsArgs = { - srcEid: number; - sender: Uint8Array; - nonce: number | bigint; - guid: Uint8Array; - message: Uint8Array; - extraData: Uint8Array; -}; + srcEid: number + sender: Uint8Array + nonce: number | bigint + guid: Uint8Array + message: Uint8Array + extraData: Uint8Array +} -export function getLzReceiveParamsSerializer(): Serializer< - LzReceiveParamsArgs, - LzReceiveParams -> { - return struct( - [ - ['srcEid', u32()], - ['sender', bytes({ size: 32 })], - ['nonce', u64()], - ['guid', bytes({ size: 32 })], - ['message', bytes({ size: u32() })], - ['extraData', bytes({ size: u32() })], - ], - { description: 'LzReceiveParams' } - ) as Serializer; +export function getLzReceiveParamsSerializer(): Serializer { + return struct( + [ + ['srcEid', u32()], + ['sender', bytes({ size: 32 })], + ['nonce', u64()], + ['guid', bytes({ size: 32 })], + ['message', bytes({ size: u32() })], + ['extraData', bytes({ size: u32() })], + ], + { description: 'LzReceiveParams' } + ) as Serializer } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts index 5149b6bc8..8b36124ed 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzReceiveTypesV2Result.ts @@ -6,15 +6,9 @@ * @see https://github.com/kinobi-so/kinobi */ -import { PublicKey } from '@metaplex-foundation/umi'; -import { - Serializer, - array, - publicKey as publicKeySerializer, - struct, - u8, -} from '@metaplex-foundation/umi/serializers'; -import { Instruction, InstructionArgs, getInstructionSerializer } from '.'; +import { PublicKey } from '@metaplex-foundation/umi' +import { Serializer, array, publicKey as publicKeySerializer, struct, u8 } from '@metaplex-foundation/umi/serializers' +import { Instruction, InstructionArgs, getInstructionSerializer } from '.' /** * Output of the lz_receive_types_v2 instruction. @@ -25,51 +19,48 @@ import { Instruction, InstructionArgs, getInstructionSerializer } from '.'; */ export type LzReceiveTypesV2Result = { - /** The version of context account */ - contextVersion: number; - /** - * ALTs required for this execution context - * Used by the Executor to resolve AltIndex references in AccountMetaRef - * Enables efficient account list compression for complex transactions - */ - alts: Array; - /** - * The complete list of instructions required for LzReceive execution - * MUST include exactly one LzReceive instruction - * MAY include additional Standard instructions for preprocessing/postprocessing - * Instructions are executed in the order returned - */ - instructions: Array; -}; + /** The version of context account */ + contextVersion: number + /** + * ALTs required for this execution context + * Used by the Executor to resolve AltIndex references in AccountMetaRef + * Enables efficient account list compression for complex transactions + */ + alts: Array + /** + * The complete list of instructions required for LzReceive execution + * MUST include exactly one LzReceive instruction + * MAY include additional Standard instructions for preprocessing/postprocessing + * Instructions are executed in the order returned + */ + instructions: Array +} export type LzReceiveTypesV2ResultArgs = { - /** The version of context account */ - contextVersion: number; - /** - * ALTs required for this execution context - * Used by the Executor to resolve AltIndex references in AccountMetaRef - * Enables efficient account list compression for complex transactions - */ - alts: Array; - /** - * The complete list of instructions required for LzReceive execution - * MUST include exactly one LzReceive instruction - * MAY include additional Standard instructions for preprocessing/postprocessing - * Instructions are executed in the order returned - */ - instructions: Array; -}; + /** The version of context account */ + contextVersion: number + /** + * ALTs required for this execution context + * Used by the Executor to resolve AltIndex references in AccountMetaRef + * Enables efficient account list compression for complex transactions + */ + alts: Array + /** + * The complete list of instructions required for LzReceive execution + * MUST include exactly one LzReceive instruction + * MAY include additional Standard instructions for preprocessing/postprocessing + * Instructions are executed in the order returned + */ + instructions: Array +} -export function getLzReceiveTypesV2ResultSerializer(): Serializer< - LzReceiveTypesV2ResultArgs, - LzReceiveTypesV2Result -> { - return struct( - [ - ['contextVersion', u8()], - ['alts', array(publicKeySerializer())], - ['instructions', array(getInstructionSerializer())], - ], - { description: 'LzReceiveTypesV2Result' } - ) as Serializer; +export function getLzReceiveTypesV2ResultSerializer(): Serializer { + return struct( + [ + ['contextVersion', u8()], + ['alts', array(publicKeySerializer())], + ['instructions', array(getInstructionSerializer())], + ], + { description: 'LzReceiveTypesV2Result' } + ) as Serializer } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts index 91d035e85..310352e1a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts @@ -6,24 +6,21 @@ * @see https://github.com/kinobi-so/kinobi */ -import { Serializer, struct, u64 } from '@metaplex-foundation/umi/serializers'; +import { Serializer, struct, u64 } from '@metaplex-foundation/umi/serializers' -export type MessagingFee = { nativeFee: bigint; lzTokenFee: bigint }; +export type MessagingFee = { nativeFee: bigint; lzTokenFee: bigint } export type MessagingFeeArgs = { - nativeFee: number | bigint; - lzTokenFee: number | bigint; -}; + nativeFee: number | bigint + lzTokenFee: number | bigint +} -export function getMessagingFeeSerializer(): Serializer< - MessagingFeeArgs, - MessagingFee -> { - return struct( - [ - ['nativeFee', u64()], - ['lzTokenFee', u64()], - ], - { description: 'MessagingFee' } - ) as Serializer; +export function getMessagingFeeSerializer(): Serializer { + return struct( + [ + ['nativeFee', u64()], + ['lzTokenFee', u64()], + ], + { description: 'MessagingFee' } + ) as Serializer } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts index f3f7b6e9c..1c77da73c 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/peerConfigParam.ts @@ -7,66 +7,61 @@ */ import { - GetDataEnumKind, - GetDataEnumKindContent, - Serializer, - bytes, - dataEnum, - struct, - tuple, - u32, -} from '@metaplex-foundation/umi/serializers'; + GetDataEnumKind, + GetDataEnumKindContent, + Serializer, + bytes, + dataEnum, + struct, + tuple, + u32, +} from '@metaplex-foundation/umi/serializers' export type PeerConfigParam = - | { __kind: 'PeerAddress'; fields: [Uint8Array] } - | { __kind: 'EnforcedOptions'; send: Uint8Array; sendAndCall: Uint8Array }; + | { __kind: 'PeerAddress'; fields: [Uint8Array] } + | { __kind: 'EnforcedOptions'; send: Uint8Array; sendAndCall: Uint8Array } -export type PeerConfigParamArgs = PeerConfigParam; +export type PeerConfigParamArgs = PeerConfigParam -export function getPeerConfigParamSerializer(): Serializer< - PeerConfigParamArgs, - PeerConfigParam -> { - return dataEnum( - [ - [ - 'PeerAddress', - struct>([ - ['fields', tuple([bytes({ size: 32 })])], - ]), - ], - [ - 'EnforcedOptions', - struct>([ - ['send', bytes({ size: u32() })], - ['sendAndCall', bytes({ size: u32() })], - ]), - ], - ], - { description: 'PeerConfigParam' } - ) as Serializer; +export function getPeerConfigParamSerializer(): Serializer { + return dataEnum( + [ + [ + 'PeerAddress', + struct>([ + ['fields', tuple([bytes({ size: 32 })])], + ]), + ], + [ + 'EnforcedOptions', + struct>([ + ['send', bytes({ size: u32() })], + ['sendAndCall', bytes({ size: u32() })], + ]), + ], + ], + { description: 'PeerConfigParam' } + ) as Serializer } // Data Enum Helpers. export function peerConfigParam( - kind: 'PeerAddress', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; + kind: 'PeerAddress', + data: GetDataEnumKindContent['fields'] +): GetDataEnumKind export function peerConfigParam( - kind: 'EnforcedOptions', - data: GetDataEnumKindContent -): GetDataEnumKind; + kind: 'EnforcedOptions', + data: GetDataEnumKindContent +): GetDataEnumKind export function peerConfigParam( - kind: K, - data?: any + kind: K, + data?: any ): Extract { - return Array.isArray(data) - ? { __kind: kind, fields: data } - : { __kind: kind, ...(data ?? {}) }; + return Array.isArray(data) ? { __kind: kind, fields: data } : { __kind: kind, ...(data ?? {}) } } export function isPeerConfigParam( - kind: K, - value: PeerConfigParam + kind: K, + value: PeerConfigParam ): value is PeerConfigParam & { __kind: K } { - return value.__kind === kind; + return value.__kind === kind } From 93aa25c027ece360388e33c812a51a054fd79d15 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:14:14 -0300 Subject: [PATCH 10/24] fix generation styling --- .../my_oapp/accounts/endpointSettings.ts | 2 +- .../accounts/lzReceiveTypesAccounts.ts | 25 ++---- .../generated/my_oapp/accounts/peerConfig.ts | 2 +- .../generated/my_oapp/accounts/store.ts | 2 +- .../client/generated/my_oapp/errors/myOapp.ts | 2 +- .../generated/my_oapp/instructions/index.ts | 3 +- .../my_oapp/instructions/initStore.ts | 2 +- .../my_oapp/instructions/lzReceive.ts | 9 +- .../my_oapp/instructions/lzReceiveTypes.ts | 84 +++++++++++++++++++ .../my_oapp/instructions/quoteSend.ts | 2 +- .../generated/my_oapp/instructions/send.ts | 8 +- .../my_oapp/instructions/setPeerConfig.ts | 5 +- .../generated/my_oapp/programs/myOapp.ts | 5 +- .../client/generated/my_oapp/types/index.ts | 5 +- .../generated/my_oapp/types/lzAccount.ts | 30 +++++++ 15 files changed, 133 insertions(+), 53 deletions(-) create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts create mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts index 5ba37c5fb..0e2d2c4af 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts @@ -124,7 +124,7 @@ export async function safeFetchAllEndpointSettings( } export function getEndpointSettingsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts index 0a2fd22ef..e22ebdbdc 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts @@ -25,23 +25,17 @@ import { mapSerializer, publicKey as publicKeySerializer, struct, - u8, } from '@metaplex-foundation/umi/serializers' +/** LzReceiveTypesAccounts includes accounts that are used in the LzReceiveTypes instruction. */ export type LzReceiveTypesAccounts = Account export type LzReceiveTypesAccountsAccountData = { discriminator: Uint8Array store: PublicKey - alt: PublicKey - bump: number } -export type LzReceiveTypesAccountsAccountDataArgs = { - store: PublicKey - alt: PublicKey - bump: number -} +export type LzReceiveTypesAccountsAccountDataArgs = { store: PublicKey } export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< LzReceiveTypesAccountsAccountDataArgs, @@ -52,8 +46,6 @@ export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< [ ['discriminator', bytes({ size: 8 })], ['store', publicKeySerializer()], - ['alt', publicKeySerializer()], - ['bump', u8()], ], { description: 'LzReceiveTypesAccountsAccountData' } ), @@ -117,23 +109,16 @@ export async function safeFetchAllLzReceiveTypesAccounts( } export function getLzReceiveTypesAccountsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') return gpaBuilder(context, programId) - .registerFields<{ - discriminator: Uint8Array - store: PublicKey - alt: PublicKey - bump: number - }>({ + .registerFields<{ discriminator: Uint8Array; store: PublicKey }>({ discriminator: [0, bytes({ size: 8 })], store: [8, publicKeySerializer()], - alt: [40, publicKeySerializer()], - bump: [72, u8()], }) .deserializeUsing((account) => deserializeLzReceiveTypesAccounts(account)) .whereField('discriminator', new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126])) } export function getLzReceiveTypesAccountsSize(): number { - return 73 + return 40 } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts index 98e0a11d4..c8cf3b6ea 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts @@ -108,7 +108,7 @@ export async function safeFetchAllPeerConfig( } export function getPeerConfigGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts index fa50e9ba6..2ba28e4e3 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts @@ -118,7 +118,7 @@ export async function safeFetchAllStore( } export function getStoreGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts index b7dd3da2f..7296cf805 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts @@ -12,7 +12,7 @@ type ProgramErrorConstructor = new (program: Program, cause?: Error) => ProgramE const codeToErrorMap: Map = new Map() const nameToErrorMap: Map = new Map() -/** InvalidMessageType: */ +/** InvalidMessageType */ export class InvalidMessageTypeError extends ProgramError { override readonly name: string = 'InvalidMessageType' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts index 0668265aa..148e47ba1 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts @@ -8,8 +8,7 @@ export * from './initStore' export * from './lzReceive' -export * from './lzReceiveTypesInfo' -export * from './lzReceiveTypesV2' +export * from './lzReceiveTypes' export * from './quoteSend' export * from './send' export * from './setPeerConfig' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts index 5360f67ad..0d9c61325 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts @@ -65,7 +65,7 @@ export function initStore( input: InitStoreInstructionAccounts & InitStoreInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts index 73b414e33..863ba4eae 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts @@ -13,14 +13,7 @@ import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } fr // Accounts. export type LzReceiveInstructionAccounts = { - /** - * OApp Store PDA. This account represents the "address" of your OApp on - * Solana and can contain any state relevant to your application. - * Customize the fields in `Store` as needed. - */ - store: PublicKey | Pda - /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ peer: PublicKey | Pda } @@ -60,7 +53,7 @@ export function lzReceive( input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts new file mode 100644 index 000000000..9de0e5d9d --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts @@ -0,0 +1,84 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' +import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' +import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' +import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' + +// Accounts. +export type LzReceiveTypesInstructionAccounts = { + store: PublicKey | Pda +} + +// Data. +export type LzReceiveTypesInstructionData = { + discriminator: Uint8Array + params: LzReceiveParams +} + +export type LzReceiveTypesInstructionDataArgs = { params: LzReceiveParamsArgs } + +export function getLzReceiveTypesInstructionDataSerializer(): Serializer< + LzReceiveTypesInstructionDataArgs, + LzReceiveTypesInstructionData +> { + return mapSerializer( + struct( + [ + ['discriminator', bytes({ size: 8 })], + ['params', getLzReceiveParamsSerializer()], + ], + { description: 'LzReceiveTypesInstructionData' } + ), + (value) => ({ + ...value, + discriminator: new Uint8Array([221, 17, 246, 159, 248, 128, 31, 96]), + }) + ) as Serializer +} + +// Args. +export type LzReceiveTypesInstructionArgs = LzReceiveTypesInstructionDataArgs + +// Instruction. +export function lzReceiveTypes( + context: Pick, + input: LzReceiveTypesInstructionAccounts & LzReceiveTypesInstructionArgs +): TransactionBuilder { + // Program ID. + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + + // Accounts. + const resolvedAccounts = { + store: { + index: 0, + isWritable: false as boolean, + value: input.store ?? null, + }, + } satisfies ResolvedAccountsWithIndices + + // Arguments. + const resolvedArgs: LzReceiveTypesInstructionArgs = { ...input } + + // Accounts in order. + const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) + + // Keys and Signers. + const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) + + // Data. + const data = getLzReceiveTypesInstructionDataSerializer().serialize( + resolvedArgs as LzReceiveTypesInstructionDataArgs + ) + + // Bytes Created On Chain. + const bytesCreatedOnChain = 0 + + return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) +} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts index 8638b1c7f..d6f460d2c 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts @@ -67,7 +67,7 @@ export function quoteSend( input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts index ab73d8d06..005a63753 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts @@ -12,13 +12,7 @@ import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners // Accounts. export type SendInstructionAccounts = { - /** - * Configuration for the destination chain. Holds the peer address and any - * enforced messaging options. - */ - peer: PublicKey | Pda - /** OApp Store PDA that signs the send instruction */ store: PublicKey | Pda endpoint: PublicKey | Pda } @@ -70,7 +64,7 @@ export function send( input: SendInstructionAccounts & SendInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts index 3b0e5fb9a..68fc3c594 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts @@ -13,11 +13,8 @@ import { PeerConfigParam, PeerConfigParamArgs, getPeerConfigParamSerializer } fr // Accounts. export type SetPeerConfigInstructionAccounts = { - /** Admin of the OApp store */ admin: Signer - /** Peer configuration PDA for a specific remote chain */ peer: PublicKey | Pda - /** Store PDA of this OApp */ store: PublicKey | Pda systemProgram?: PublicKey | Pda } @@ -63,7 +60,7 @@ export function setPeerConfig( input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', '') + const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') // Accounts. const resolvedAccounts = { diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts index 8cc8afeb2..d767c0131 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts @@ -9,11 +9,12 @@ import { ClusterFilter, Context, Program, PublicKey } from '@metaplex-foundation/umi' import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors' -export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''> +export const MY_OAPP_PROGRAM_ID = + 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay' as PublicKey<'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay'> export function createMyOappProgram(): Program { return { - name: 'myOapp', + name: 'myoapp', publicKey: MY_OAPP_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { return getMyOappErrorFromCode(code, this, cause) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts index 3c6132257..5cc85a6f0 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts @@ -6,11 +6,8 @@ * @see https://github.com/kinobi-so/kinobi */ -export * from './accountMetaRef' -export * from './addressLocator' export * from './enforcedOptions' -export * from './instruction' +export * from './lzAccount' export * from './lzReceiveParams' -export * from './lzReceiveTypesV2Result' export * from './messagingFee' export * from './peerConfigParam' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts new file mode 100644 index 000000000..15771c19b --- /dev/null +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts @@ -0,0 +1,30 @@ +/** + * This code was AUTOGENERATED using the kinobi library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun kinobi to update it. + * + * @see https://github.com/kinobi-so/kinobi + */ + +import { PublicKey } from '@metaplex-foundation/umi' +import { Serializer, bool, publicKey as publicKeySerializer, struct } from '@metaplex-foundation/umi/serializers' + +/** same to anchor_lang::prelude::AccountMeta */ +export type LzAccount = { + pubkey: PublicKey + isSigner: boolean + isWritable: boolean +} + +export type LzAccountArgs = LzAccount + +export function getLzAccountSerializer(): Serializer { + return struct( + [ + ['pubkey', publicKeySerializer()], + ['isSigner', bool()], + ['isWritable', bool()], + ], + { description: 'LzAccount' } + ) as Serializer +} From c272a98af2adb2e9b0df838ec583b5a52a23eda2 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:14:24 -0300 Subject: [PATCH 11/24] fix generation styling --- .../my_oapp/accounts/endpointSettings.ts | 7 +- .../accounts/lzReceiveTypesAccounts.ts | 21 +++-- .../generated/my_oapp/accounts/peerConfig.ts | 13 +-- .../generated/my_oapp/accounts/store.ts | 14 +--- .../client/generated/my_oapp/errors/myOapp.ts | 2 +- .../generated/my_oapp/instructions/index.ts | 3 +- .../my_oapp/instructions/initStore.ts | 42 ++-------- .../my_oapp/instructions/lzReceive.ts | 25 +++--- .../my_oapp/instructions/lzReceiveTypes.ts | 84 ------------------- .../instructions/lzReceiveTypesInfo.ts | 26 ++---- .../my_oapp/instructions/lzReceiveTypesV2.ts | 20 +---- .../my_oapp/instructions/quoteSend.ts | 19 +---- .../generated/my_oapp/instructions/send.ts | 25 +++--- .../my_oapp/instructions/setPeerConfig.ts | 39 +++------ .../generated/my_oapp/programs/myOapp.ts | 5 +- .../client/generated/my_oapp/shared/index.ts | 5 +- .../client/generated/my_oapp/types/index.ts | 5 +- .../generated/my_oapp/types/lzAccount.ts | 30 ------- .../generated/my_oapp/types/messagingFee.ts | 5 +- examples/oapp-solana/lib/scripts/generate.ts | 12 ++- 20 files changed, 94 insertions(+), 308 deletions(-) delete mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts delete mode 100644 examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts index 0e2d2c4af..632449de6 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/endpointSettings.ts @@ -64,10 +64,7 @@ export function getEndpointSettingsAccountDataSerializer(): Serializer< ], { description: 'EndpointSettingsAccountData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([221, 232, 73, 56, 10, 66, 72, 14]) }) ) as Serializer } @@ -124,7 +121,7 @@ export async function safeFetchAllEndpointSettings( } export function getEndpointSettingsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts index e22ebdbdc..1cfdc3200 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/lzReceiveTypesAccounts.ts @@ -25,17 +25,19 @@ import { mapSerializer, publicKey as publicKeySerializer, struct, + u8, } from '@metaplex-foundation/umi/serializers' -/** LzReceiveTypesAccounts includes accounts that are used in the LzReceiveTypes instruction. */ export type LzReceiveTypesAccounts = Account export type LzReceiveTypesAccountsAccountData = { discriminator: Uint8Array store: PublicKey + alt: PublicKey + bump: number } -export type LzReceiveTypesAccountsAccountDataArgs = { store: PublicKey } +export type LzReceiveTypesAccountsAccountDataArgs = { store: PublicKey; alt: PublicKey; bump: number } export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< LzReceiveTypesAccountsAccountDataArgs, @@ -46,13 +48,12 @@ export function getLzReceiveTypesAccountsAccountDataSerializer(): Serializer< [ ['discriminator', bytes({ size: 8 })], ['store', publicKeySerializer()], + ['alt', publicKeySerializer()], + ['bump', u8()], ], { description: 'LzReceiveTypesAccountsAccountData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126]) }) ) as Serializer } @@ -109,16 +110,18 @@ export async function safeFetchAllLzReceiveTypesAccounts( } export function getLzReceiveTypesAccountsGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) - .registerFields<{ discriminator: Uint8Array; store: PublicKey }>({ + .registerFields<{ discriminator: Uint8Array; store: PublicKey; alt: PublicKey; bump: number }>({ discriminator: [0, bytes({ size: 8 })], store: [8, publicKeySerializer()], + alt: [40, publicKeySerializer()], + bump: [72, u8()], }) .deserializeUsing((account) => deserializeLzReceiveTypesAccounts(account)) .whereField('discriminator', new Uint8Array([248, 87, 167, 117, 5, 251, 21, 126])) } export function getLzReceiveTypesAccountsSize(): number { - return 40 + return 73 } diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts index c8cf3b6ea..3614f6db3 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/peerConfig.ts @@ -31,11 +31,7 @@ export type PeerConfigAccountData = { bump: number } -export type PeerConfigAccountDataArgs = { - peerAddress: Uint8Array - enforcedOptions: EnforcedOptionsArgs - bump: number -} +export type PeerConfigAccountDataArgs = { peerAddress: Uint8Array; enforcedOptions: EnforcedOptionsArgs; bump: number } export function getPeerConfigAccountDataSerializer(): Serializer { return mapSerializer( @@ -48,10 +44,7 @@ export function getPeerConfigAccountDataSerializer(): Serializer ({ - ...value, - discriminator: new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([181, 157, 86, 198, 33, 193, 94, 203]) }) ) as Serializer } @@ -108,7 +101,7 @@ export async function safeFetchAllPeerConfig( } export function getPeerConfigGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts index 2ba28e4e3..645241147 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/accounts/store.ts @@ -39,12 +39,7 @@ export type StoreAccountData = { string: string } -export type StoreAccountDataArgs = { - admin: PublicKey - bump: number - endpointProgram: PublicKey - string: string -} +export type StoreAccountDataArgs = { admin: PublicKey; bump: number; endpointProgram: PublicKey; string: string } export function getStoreAccountDataSerializer(): Serializer { return mapSerializer( @@ -58,10 +53,7 @@ export function getStoreAccountDataSerializer(): Serializer ({ - ...value, - discriminator: new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([130, 48, 247, 244, 182, 191, 30, 26]) }) ) as Serializer } @@ -118,7 +110,7 @@ export async function safeFetchAllStore( } export function getStoreGpaBuilder(context: Pick) { - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') return gpaBuilder(context, programId) .registerFields<{ discriminator: Uint8Array diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts index 7296cf805..b7dd3da2f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts @@ -12,7 +12,7 @@ type ProgramErrorConstructor = new (program: Program, cause?: Error) => ProgramE const codeToErrorMap: Map = new Map() const nameToErrorMap: Map = new Map() -/** InvalidMessageType */ +/** InvalidMessageType: */ export class InvalidMessageTypeError extends ProgramError { override readonly name: string = 'InvalidMessageType' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts index 148e47ba1..0668265aa 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/index.ts @@ -8,7 +8,8 @@ export * from './initStore' export * from './lzReceive' -export * from './lzReceiveTypes' +export * from './lzReceiveTypesInfo' +export * from './lzReceiveTypesV2' export * from './quoteSend' export * from './send' export * from './setPeerConfig' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts index 0d9c61325..5e4c5f14d 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts @@ -25,16 +25,9 @@ export type InitStoreInstructionAccounts = { } // Data. -export type InitStoreInstructionData = { - discriminator: Uint8Array - admin: PublicKey - endpoint: PublicKey -} +export type InitStoreInstructionData = { discriminator: Uint8Array; admin: PublicKey; endpoint: PublicKey } -export type InitStoreInstructionDataArgs = { - admin: PublicKey - endpoint: PublicKey -} +export type InitStoreInstructionDataArgs = { admin: PublicKey; endpoint: PublicKey } export function getInitStoreInstructionDataSerializer(): Serializer< InitStoreInstructionDataArgs, @@ -49,10 +42,7 @@ export function getInitStoreInstructionDataSerializer(): Serializer< ], { description: 'InitStoreInstructionData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([250, 74, 6, 95, 163, 188, 19, 181]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([250, 74, 6, 95, 163, 188, 19, 181]) }) ) as Serializer } @@ -65,30 +55,14 @@ export function initStore( input: InitStoreInstructionAccounts & InitStoreInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { - payer: { - index: 0, - isWritable: true as boolean, - value: input.payer ?? null, - }, - store: { - index: 1, - isWritable: true as boolean, - value: input.store ?? null, - }, - lzReceiveTypesAccounts: { - index: 2, - isWritable: true as boolean, - value: input.lzReceiveTypesAccounts ?? null, - }, - systemProgram: { - index: 3, - isWritable: false as boolean, - value: input.systemProgram ?? null, - }, + payer: { index: 0, isWritable: true as boolean, value: input.payer ?? null }, + store: { index: 1, isWritable: true as boolean, value: input.store ?? null }, + lzReceiveTypesAccounts: { index: 2, isWritable: true as boolean, value: input.lzReceiveTypesAccounts ?? null }, + systemProgram: { index: 3, isWritable: false as boolean, value: input.systemProgram ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts index 863ba4eae..5201a9e7d 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceive.ts @@ -13,15 +13,19 @@ import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } fr // Accounts. export type LzReceiveInstructionAccounts = { + /** + * OApp Store PDA. This account represents the "address" of your OApp on + * Solana and can contain any state relevant to your application. + * Customize the fields in `Store` as needed. + */ + store: PublicKey | Pda + /** Peer config PDA for the sending chain. Ensures `params.sender` can only be the allowed peer from that remote chain. */ peer: PublicKey | Pda } // Data. -export type LzReceiveInstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} +export type LzReceiveInstructionData = { discriminator: Uint8Array; params: LzReceiveParams } export type LzReceiveInstructionDataArgs = { params: LzReceiveParamsArgs } @@ -37,10 +41,7 @@ export function getLzReceiveInstructionDataSerializer(): Serializer< ], { description: 'LzReceiveInstructionData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([8, 179, 120, 109, 33, 118, 189, 80]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([8, 179, 120, 109, 33, 118, 189, 80]) }) ) as Serializer } @@ -53,15 +54,11 @@ export function lzReceive( input: LzReceiveInstructionAccounts & LzReceiveInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { - store: { - index: 0, - isWritable: true as boolean, - value: input.store ?? null, - }, + store: { index: 0, isWritable: true as boolean, value: input.store ?? null }, peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, } satisfies ResolvedAccountsWithIndices diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts deleted file mode 100644 index 9de0e5d9d..000000000 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypes.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/kinobi-so/kinobi - */ - -import { Context, Pda, PublicKey, TransactionBuilder, transactionBuilder } from '@metaplex-foundation/umi' -import { Serializer, bytes, mapSerializer, struct } from '@metaplex-foundation/umi/serializers' -import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners } from '../shared' -import { LzReceiveParams, LzReceiveParamsArgs, getLzReceiveParamsSerializer } from '../types' - -// Accounts. -export type LzReceiveTypesInstructionAccounts = { - store: PublicKey | Pda -} - -// Data. -export type LzReceiveTypesInstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} - -export type LzReceiveTypesInstructionDataArgs = { params: LzReceiveParamsArgs } - -export function getLzReceiveTypesInstructionDataSerializer(): Serializer< - LzReceiveTypesInstructionDataArgs, - LzReceiveTypesInstructionData -> { - return mapSerializer( - struct( - [ - ['discriminator', bytes({ size: 8 })], - ['params', getLzReceiveParamsSerializer()], - ], - { description: 'LzReceiveTypesInstructionData' } - ), - (value) => ({ - ...value, - discriminator: new Uint8Array([221, 17, 246, 159, 248, 128, 31, 96]), - }) - ) as Serializer -} - -// Args. -export type LzReceiveTypesInstructionArgs = LzReceiveTypesInstructionDataArgs - -// Instruction. -export function lzReceiveTypes( - context: Pick, - input: LzReceiveTypesInstructionAccounts & LzReceiveTypesInstructionArgs -): TransactionBuilder { - // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') - - // Accounts. - const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - } satisfies ResolvedAccountsWithIndices - - // Arguments. - const resolvedArgs: LzReceiveTypesInstructionArgs = { ...input } - - // Accounts in order. - const orderedAccounts: ResolvedAccount[] = Object.values(resolvedAccounts).sort((a, b) => a.index - b.index) - - // Keys and Signers. - const [keys, signers] = getAccountMetasAndSigners(orderedAccounts, 'programId', programId) - - // Data. - const data = getLzReceiveTypesInstructionDataSerializer().serialize( - resolvedArgs as LzReceiveTypesInstructionDataArgs - ) - - // Bytes Created On Chain. - const bytesCreatedOnChain = 0 - - return transactionBuilder([{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }]) -} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts index 53cca9710..695e91b44 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesInfo.ts @@ -23,14 +23,9 @@ export type LzReceiveTypesInfoInstructionAccounts = { } // Data. -export type LzReceiveTypesInfoInstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} +export type LzReceiveTypesInfoInstructionData = { discriminator: Uint8Array; params: LzReceiveParams } -export type LzReceiveTypesInfoInstructionDataArgs = { - params: LzReceiveParamsArgs -} +export type LzReceiveTypesInfoInstructionDataArgs = { params: LzReceiveParamsArgs } export function getLzReceiveTypesInfoInstructionDataSerializer(): Serializer< LzReceiveTypesInfoInstructionDataArgs, @@ -44,10 +39,7 @@ export function getLzReceiveTypesInfoInstructionDataSerializer(): Serializer< ], { description: 'LzReceiveTypesInfoInstructionData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([43, 148, 213, 93, 101, 127, 37, 170]) }) ) as Serializer } @@ -64,16 +56,8 @@ export function lzReceiveTypesInfo( // Accounts. const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, - lzReceiveTypesAccounts: { - index: 1, - isWritable: false as boolean, - value: input.lzReceiveTypesAccounts ?? null, - }, + store: { index: 0, isWritable: false as boolean, value: input.store ?? null }, + lzReceiveTypesAccounts: { index: 1, isWritable: false as boolean, value: input.lzReceiveTypesAccounts ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts index 2e0c2a06b..0566ed2c8 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/lzReceiveTypesV2.ts @@ -17,14 +17,9 @@ export type LzReceiveTypesV2InstructionAccounts = { } // Data. -export type LzReceiveTypesV2InstructionData = { - discriminator: Uint8Array - params: LzReceiveParams -} +export type LzReceiveTypesV2InstructionData = { discriminator: Uint8Array; params: LzReceiveParams } -export type LzReceiveTypesV2InstructionDataArgs = { - params: LzReceiveParamsArgs -} +export type LzReceiveTypesV2InstructionDataArgs = { params: LzReceiveParamsArgs } export function getLzReceiveTypesV2InstructionDataSerializer(): Serializer< LzReceiveTypesV2InstructionDataArgs, @@ -38,10 +33,7 @@ export function getLzReceiveTypesV2InstructionDataSerializer(): Serializer< ], { description: 'LzReceiveTypesV2InstructionData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([109, 157, 200, 142, 138, 223, 159, 164]) }) ) as Serializer } @@ -58,11 +50,7 @@ export function lzReceiveTypesV2( // Accounts. const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, + store: { index: 0, isWritable: false as boolean, value: input.store ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts index d6f460d2c..5eb6bd92a 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/quoteSend.ts @@ -51,10 +51,7 @@ export function getQuoteSendInstructionDataSerializer(): Serializer< ], { description: 'QuoteSendInstructionData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([207, 0, 49, 214, 160, 211, 76, 211]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([207, 0, 49, 214, 160, 211, 76, 211]) }) ) as Serializer } @@ -67,21 +64,13 @@ export function quoteSend( input: QuoteSendInstructionAccounts & QuoteSendInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { - store: { - index: 0, - isWritable: false as boolean, - value: input.store ?? null, - }, + store: { index: 0, isWritable: false as boolean, value: input.store ?? null }, peer: { index: 1, isWritable: false as boolean, value: input.peer ?? null }, - endpoint: { - index: 2, - isWritable: false as boolean, - value: input.endpoint ?? null, - }, + endpoint: { index: 2, isWritable: false as boolean, value: input.endpoint ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts index 005a63753..0be1ba0ae 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/send.ts @@ -12,7 +12,13 @@ import { ResolvedAccount, ResolvedAccountsWithIndices, getAccountMetasAndSigners // Accounts. export type SendInstructionAccounts = { + /** + * Configuration for the destination chain. Holds the peer address and any + * enforced messaging options. + */ + peer: PublicKey | Pda + /** OApp Store PDA that signs the send instruction */ store: PublicKey | Pda endpoint: PublicKey | Pda } @@ -48,10 +54,7 @@ export function getSendInstructionDataSerializer(): Serializer ({ - ...value, - discriminator: new Uint8Array([102, 251, 20, 187, 65, 75, 12, 69]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([102, 251, 20, 187, 65, 75, 12, 69]) }) ) as Serializer } @@ -64,21 +67,13 @@ export function send( input: SendInstructionAccounts & SendInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { peer: { index: 0, isWritable: false as boolean, value: input.peer ?? null }, - store: { - index: 1, - isWritable: false as boolean, - value: input.store ?? null, - }, - endpoint: { - index: 2, - isWritable: false as boolean, - value: input.endpoint ?? null, - }, + store: { index: 1, isWritable: false as boolean, value: input.store ?? null }, + endpoint: { index: 2, isWritable: false as boolean, value: input.endpoint ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts index 68fc3c594..e2dd6869e 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/setPeerConfig.ts @@ -13,23 +13,19 @@ import { PeerConfigParam, PeerConfigParamArgs, getPeerConfigParamSerializer } fr // Accounts. export type SetPeerConfigInstructionAccounts = { + /** Admin of the OApp store */ admin: Signer + /** Peer configuration PDA for a specific remote chain */ peer: PublicKey | Pda + /** Store PDA of this OApp */ store: PublicKey | Pda systemProgram?: PublicKey | Pda } // Data. -export type SetPeerConfigInstructionData = { - discriminator: Uint8Array - remoteEid: number - config: PeerConfigParam -} +export type SetPeerConfigInstructionData = { discriminator: Uint8Array; remoteEid: number; config: PeerConfigParam } -export type SetPeerConfigInstructionDataArgs = { - remoteEid: number - config: PeerConfigParamArgs -} +export type SetPeerConfigInstructionDataArgs = { remoteEid: number; config: PeerConfigParamArgs } export function getSetPeerConfigInstructionDataSerializer(): Serializer< SetPeerConfigInstructionDataArgs, @@ -44,10 +40,7 @@ export function getSetPeerConfigInstructionDataSerializer(): Serializer< ], { description: 'SetPeerConfigInstructionData' } ), - (value) => ({ - ...value, - discriminator: new Uint8Array([79, 187, 168, 57, 139, 140, 93, 47]), - }) + (value) => ({ ...value, discriminator: new Uint8Array([79, 187, 168, 57, 139, 140, 93, 47]) }) ) as Serializer } @@ -60,26 +53,14 @@ export function setPeerConfig( input: SetPeerConfigInstructionAccounts & SetPeerConfigInstructionArgs ): TransactionBuilder { // Program ID. - const programId = context.programs.getPublicKey('myOapp', 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay') + const programId = context.programs.getPublicKey('myOapp', '') // Accounts. const resolvedAccounts = { - admin: { - index: 0, - isWritable: true as boolean, - value: input.admin ?? null, - }, + admin: { index: 0, isWritable: true as boolean, value: input.admin ?? null }, peer: { index: 1, isWritable: true as boolean, value: input.peer ?? null }, - store: { - index: 2, - isWritable: false as boolean, - value: input.store ?? null, - }, - systemProgram: { - index: 3, - isWritable: false as boolean, - value: input.systemProgram ?? null, - }, + store: { index: 2, isWritable: false as boolean, value: input.store ?? null }, + systemProgram: { index: 3, isWritable: false as boolean, value: input.systemProgram ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts index d767c0131..8cc8afeb2 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/programs/myOapp.ts @@ -9,12 +9,11 @@ import { ClusterFilter, Context, Program, PublicKey } from '@metaplex-foundation/umi' import { getMyOappErrorFromCode, getMyOappErrorFromName } from '../errors' -export const MY_OAPP_PROGRAM_ID = - 'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay' as PublicKey<'HFyiETGKEUS9tr87K1HXmVJHkqQRtw8wShRNTMkKKxay'> +export const MY_OAPP_PROGRAM_ID = '' as PublicKey<''> export function createMyOappProgram(): Program { return { - name: 'myoapp', + name: 'myOapp', publicKey: MY_OAPP_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { return getMyOappErrorFromCode(code, this, cause) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts index 70554c289..4689b2826 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/shared/index.ts @@ -51,10 +51,7 @@ export function expectPda(value: PublicKey | Pda | Signer | null | undefined): P * Defines an instruction account to resolve. * @internal */ -export type ResolvedAccount = { - isWritable: boolean - value: T -} +export type ResolvedAccount = { isWritable: boolean; value: T } /** * Defines a set of instruction account to resolve. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts index 5cc85a6f0..3c6132257 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/index.ts @@ -6,8 +6,11 @@ * @see https://github.com/kinobi-so/kinobi */ +export * from './accountMetaRef' +export * from './addressLocator' export * from './enforcedOptions' -export * from './lzAccount' +export * from './instruction' export * from './lzReceiveParams' +export * from './lzReceiveTypesV2Result' export * from './messagingFee' export * from './peerConfigParam' diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts deleted file mode 100644 index 15771c19b..000000000 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/lzAccount.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/kinobi-so/kinobi - */ - -import { PublicKey } from '@metaplex-foundation/umi' -import { Serializer, bool, publicKey as publicKeySerializer, struct } from '@metaplex-foundation/umi/serializers' - -/** same to anchor_lang::prelude::AccountMeta */ -export type LzAccount = { - pubkey: PublicKey - isSigner: boolean - isWritable: boolean -} - -export type LzAccountArgs = LzAccount - -export function getLzAccountSerializer(): Serializer { - return struct( - [ - ['pubkey', publicKeySerializer()], - ['isSigner', bool()], - ['isWritable', bool()], - ], - { description: 'LzAccount' } - ) as Serializer -} diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts b/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts index 310352e1a..1d4f6ea2f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/types/messagingFee.ts @@ -10,10 +10,7 @@ import { Serializer, struct, u64 } from '@metaplex-foundation/umi/serializers' export type MessagingFee = { nativeFee: bigint; lzTokenFee: bigint } -export type MessagingFeeArgs = { - nativeFee: number | bigint - lzTokenFee: number | bigint -} +export type MessagingFeeArgs = { nativeFee: number | bigint; lzTokenFee: number | bigint } export function getMessagingFeeSerializer(): Serializer { return struct( diff --git a/examples/oapp-solana/lib/scripts/generate.ts b/examples/oapp-solana/lib/scripts/generate.ts index 9f66122c4..947d175a0 100644 --- a/examples/oapp-solana/lib/scripts/generate.ts +++ b/examples/oapp-solana/lib/scripts/generate.ts @@ -14,7 +14,17 @@ async function generateTypeScriptSDK(): Promise { // This is also acceptable as the client SDK requires the program ID to be provided at runtime. console.error('Generating TypeScript SDK to %s. IDL from %s', generatedSDKDir, anchorIdlPath) const kinobi = createFromRoot(rootNodeFromAnchor(anchorIdl as AnchorIdl)) - void kinobi.accept(renderVisitor(generatedSDKDir)) + void kinobi.accept( + renderVisitor(generatedSDKDir, { + prettierOptions: { + semi: false, + singleQuote: true, + tabWidth: 4, + printWidth: 120, + trailingComma: 'es5', + }, + }) + ) } ;(async (): Promise => { From fa649040adf9a31c209983c1fa07f34d38aeed4a Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:19:36 -0300 Subject: [PATCH 12/24] include alt --- .../programs/my_oapp/src/instructions/init_store.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs index 30dc624d0..eaa83384e 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/init_store.rs @@ -1,4 +1,9 @@ use crate::*; +use anchor_lang::{ + solana_program::{ + address_lookup_table::program::ID as ALT_PROGRAM_ID, + }, +}; use oapp::endpoint::{instructions::RegisterOAppParams, ID as ENDPOINT_ID}; #[derive(Accounts)] @@ -24,6 +29,8 @@ pub struct InitStore<'info> { bump )] pub lz_receive_types_accounts: Account<'info, LzReceiveTypesAccounts>, + #[account(owner = ALT_PROGRAM_ID)] + pub alt: Option>, pub system_program: Program<'info, System>, } @@ -36,6 +43,12 @@ impl InitStore<'_> { ctx.accounts.store.bump = ctx.bumps.store; ctx.accounts.store.endpoint_program = params.endpoint; ctx.accounts.lz_receive_types_accounts.store = ctx.accounts.store.key(); + ctx.accounts.lz_receive_types_accounts.alt = ctx + .accounts + .alt + .as_ref() + .map(|a| a.key()) + .unwrap_or_default(); ctx.accounts.lz_receive_types_accounts.bump = ctx.bumps.lz_receive_types_accounts; // the above lines are required for all OApp implementations From b07d28b3399cffbd6b69fddc96ebe11610f4779c Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:20:48 -0300 Subject: [PATCH 13/24] alt --- .../client/generated/my_oapp/errors/myOapp.ts | 36 ++++++++++++++++--- .../my_oapp/instructions/initStore.ts | 4 ++- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts index b7dd3da2f..03e8bef9f 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/errors/myOapp.ts @@ -12,9 +12,9 @@ type ProgramErrorConstructor = new (program: Program, cause?: Error) => ProgramE const codeToErrorMap: Map = new Map() const nameToErrorMap: Map = new Map() -/** InvalidMessageType: */ -export class InvalidMessageTypeError extends ProgramError { - override readonly name: string = 'InvalidMessageType' +/** InvalidLength: */ +export class InvalidLengthError extends ProgramError { + override readonly name: string = 'InvalidLength' readonly code: number = 0x1770 // 6000 @@ -22,8 +22,34 @@ export class InvalidMessageTypeError extends ProgramError { super('', program, cause) } } -codeToErrorMap.set(0x1770, InvalidMessageTypeError) -nameToErrorMap.set('InvalidMessageType', InvalidMessageTypeError) +codeToErrorMap.set(0x1770, InvalidLengthError) +nameToErrorMap.set('InvalidLength', InvalidLengthError) + +/** BodyTooShort: */ +export class BodyTooShortError extends ProgramError { + override readonly name: string = 'BodyTooShort' + + readonly code: number = 0x1771 // 6001 + + constructor(program: Program, cause?: Error) { + super('', program, cause) + } +} +codeToErrorMap.set(0x1771, BodyTooShortError) +nameToErrorMap.set('BodyTooShort', BodyTooShortError) + +/** InvalidUtf8: */ +export class InvalidUtf8Error extends ProgramError { + override readonly name: string = 'InvalidUtf8' + + readonly code: number = 0x1772 // 6002 + + constructor(program: Program, cause?: Error) { + super('', program, cause) + } +} +codeToErrorMap.set(0x1772, InvalidUtf8Error) +nameToErrorMap.set('InvalidUtf8', InvalidUtf8Error) /** * Attempts to resolve a custom program error from the provided error code. diff --git a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts index 5e4c5f14d..2cbe31027 100644 --- a/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts +++ b/examples/oapp-solana/lib/client/generated/my_oapp/instructions/initStore.ts @@ -21,6 +21,7 @@ export type InitStoreInstructionAccounts = { payer?: Signer store: PublicKey | Pda lzReceiveTypesAccounts: PublicKey | Pda + alt?: PublicKey | Pda systemProgram?: PublicKey | Pda } @@ -62,7 +63,8 @@ export function initStore( payer: { index: 0, isWritable: true as boolean, value: input.payer ?? null }, store: { index: 1, isWritable: true as boolean, value: input.store ?? null }, lzReceiveTypesAccounts: { index: 2, isWritable: true as boolean, value: input.lzReceiveTypesAccounts ?? null }, - systemProgram: { index: 3, isWritable: false as boolean, value: input.systemProgram ?? null }, + alt: { index: 3, isWritable: false as boolean, value: input.alt ?? null }, + systemProgram: { index: 4, isWritable: false as boolean, value: input.systemProgram ?? null }, } satisfies ResolvedAccountsWithIndices // Arguments. From 8cd2352147bb020b676e04057ffb513da656b85a Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:22:17 -0300 Subject: [PATCH 14/24] alt --- examples/oapp-solana/lib/client/myoapp.ts | 3 ++- examples/oapp-solana/lib/client/pda.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/oapp-solana/lib/client/myoapp.ts b/examples/oapp-solana/lib/client/myoapp.ts index bda8a02d0..61251e309 100644 --- a/examples/oapp-solana/lib/client/myoapp.ts +++ b/examples/oapp-solana/lib/client/myoapp.ts @@ -94,7 +94,7 @@ export class MyOApp { return accounts.safeFetchStore({ rpc }, count, { commitment }) } - initStore(payer: Signer, admin: PublicKey): WrappedInstruction { + initStore(payer: Signer, admin: PublicKey, alt?: PublicKey): WrappedInstruction { const [oapp] = this.pda.oapp() const remainingAccounts = this.endpointSDK.getRegisterOappIxAccountMetaForCPI(payer.publicKey, oapp) return instructions @@ -104,6 +104,7 @@ export class MyOApp { payer, store: oapp, lzReceiveTypesAccounts: this.pda.lzReceiveTypesAccounts()[0], + alt, // args admin: admin, diff --git a/examples/oapp-solana/lib/client/pda.ts b/examples/oapp-solana/lib/client/pda.ts index 06f0ae057..4d3774303 100644 --- a/examples/oapp-solana/lib/client/pda.ts +++ b/examples/oapp-solana/lib/client/pda.ts @@ -6,6 +6,8 @@ import { OmniAppPDA } from '@layerzerolabs/lz-solana-sdk-v2/umi' const eddsa = createWeb3JsEddsa() +export const LZ_RECEIVE_TYPES_SEED = 'LzReceiveTypes' + export class MyOAppPDA extends OmniAppPDA { static STORE_SEED = 'Store' static NONCE_SEED = 'Nonce' @@ -38,4 +40,10 @@ export class MyOAppPDA extends OmniAppPDA { sender, ]) } + + // seeds = [LZ_RECEIVE_TYPES_SEED, &store.key().to_bytes()] + lzReceiveTypesAccounts(): Pda { + const [store] = this.oapp() + return eddsa.findPda(this.programId, [Buffer.from(LZ_RECEIVE_TYPES_SEED, 'utf8'), publicKeyBytes(store)]) + } } From 748504cfcf82ba24ff815ccfc007800ee7745972 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:23:47 -0300 Subject: [PATCH 15/24] alt --- examples/oapp-solana/tasks/solana/oappCreate.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/oapp-solana/tasks/solana/oappCreate.ts b/examples/oapp-solana/tasks/solana/oappCreate.ts index 7693ac0d9..6de992ad3 100644 --- a/examples/oapp-solana/tasks/solana/oappCreate.ts +++ b/examples/oapp-solana/tasks/solana/oappCreate.ts @@ -15,17 +15,22 @@ interface Args { * The endpoint ID for the Solana network. */ eid: EndpointId + /** + * Optional Address Lookup Table (ALT) address. + */ + alt?: string } -const action: ActionType = async ({ programId, eid }, hre: HardhatRuntimeEnvironment) => { - // TODO: accept program ID as a param - +const action: ActionType = async ({ programId, eid, alt }, hre: HardhatRuntimeEnvironment) => { const isTestnet = eid == EndpointId.SOLANA_V2_TESTNET const myoappInstance: myoapp.MyOApp = new myoapp.MyOApp(publicKey(programId)) const [oapp] = myoappInstance.pda.oapp() const { umi, umiWalletSigner } = await deriveConnection(eid) - const txBuilder = transactionBuilder().add(myoappInstance.initStore(umiWalletSigner, umiWalletSigner.publicKey)) + const altPubkey = alt ? publicKey(alt) : undefined + const txBuilder = transactionBuilder().add( + myoappInstance.initStore(umiWalletSigner, umiWalletSigner.publicKey, altPubkey) + ) const tx = await txBuilder.sendAndConfirm(umi) console.log(`createTx: ${getExplorerTxLink(bs58.encode(tx.signature), isTestnet)}`) saveSolanaDeployment(eid, programId, oapp) @@ -34,3 +39,4 @@ const action: ActionType = async ({ programId, eid }, hre: HardhatRuntimeE task('lz:oapp:solana:create', 'inits the oapp account', action) .addParam('programId', 'The program ID of the OApp', undefined, types.string, false) .addParam('eid', 'The endpoint ID for the Solana network.', undefined, types.int, false) + .addOptionalParam('alt', 'Address Lookup Table (ALT) address', undefined, types.string) From d4a0fd491283d8fce0aa7e0e3aa9a85a39208dd9 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:32:52 -0300 Subject: [PATCH 16/24] name --- examples/oapp-solana/layerzero.config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/oapp-solana/layerzero.config.ts b/examples/oapp-solana/layerzero.config.ts index 9c24d632c..5031d88ba 100644 --- a/examples/oapp-solana/layerzero.config.ts +++ b/examples/oapp-solana/layerzero.config.ts @@ -38,14 +38,14 @@ const SOLANA_ENFORCED_OPTIONS: OAppEnforcedOption[] = [ // Arbitrum <-> Solana // With the config generator, pathways declared are automatically bidirectional -// i.e. if you declare A,B there's no need to declare B,A +// i.e. if you declare Arbitrum,Solana there's no need to declare Solana,Arbitrum const pathways: TwoWayConfig[] = [ [ - arbitrumContract, // Chain A contract - solanaContract, // Chain B contract + arbitrumContract, // Arbitrum contract + solanaContract, // Solana contract [['LayerZero Labs'], []], // [ requiredDVN[], [ optionalDVN[], threshold ] ] - [1, 32], // [A to B confirmations, B to A confirmations] - [SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS], // Chain B enforcedOptions, Chain A enforcedOptions + [20, 32], // [Arbitrum to Solana confirmations, Solana to Arbitrum confirmations] + [SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS], // Arbitrum to Solana enforcedOptions, Solana to Arbitrum enforcedOptions ], ] From 85308ab53a4b98414bedaaeb57cb17ddd6043837 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:33:20 -0300 Subject: [PATCH 17/24] comment --- examples/oapp-solana/layerzero.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/oapp-solana/layerzero.config.ts b/examples/oapp-solana/layerzero.config.ts index 5031d88ba..bad0ae470 100644 --- a/examples/oapp-solana/layerzero.config.ts +++ b/examples/oapp-solana/layerzero.config.ts @@ -44,7 +44,7 @@ const pathways: TwoWayConfig[] = [ arbitrumContract, // Arbitrum contract solanaContract, // Solana contract [['LayerZero Labs'], []], // [ requiredDVN[], [ optionalDVN[], threshold ] ] - [20, 32], // [Arbitrum to Solana confirmations, Solana to Arbitrum confirmations] + [20, 32], // [Arbitrum to Solana outbound confirmations, Solana to Arbitrum outbound confirmations] [SOLANA_ENFORCED_OPTIONS, EVM_ENFORCED_OPTIONS], // Arbitrum to Solana enforcedOptions, Solana to Arbitrum enforcedOptions ], ] From 8ff1f370ce682d07e97862a152350a40bb16ab01 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:38:24 -0300 Subject: [PATCH 18/24] remove payer --- .../programs/my_oapp/src/instructions/lz_receive_types_v2.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index 497830013..c6ddf42e4 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -40,8 +40,6 @@ impl LzReceiveTypesV2<'_> { Pubkey::find_program_address(&[oapp::endpoint_cpi::EVENT_SEED], &ctx.program_id); let mut accounts = vec![ - // payer - AccountMetaRef { pubkey: AddressLocator::Payer, is_writable: true }, // store (writable) AccountMetaRef { pubkey: store_key.into(), is_writable: true }, // peer From 6d33ecf3fb9bbc99e5c022b98fcbadafec16490c Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 00:48:48 -0300 Subject: [PATCH 19/24] payer --- .../oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs | 2 ++ .../programs/my_oapp/src/instructions/lz_receive_types_v2.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs index f8265496f..3f87ca21b 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive.rs @@ -12,6 +12,8 @@ use oapp::{ #[derive(Accounts)] #[instruction(params: LzReceiveParams)] pub struct LzReceive<'info> { + #[account(mut)] + pub payer: Signer<'info>, /// OApp Store PDA. This account represents the "address" of your OApp on /// Solana and can contain any state relevant to your application. /// Customize the fields in `Store` as needed. diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index c6ddf42e4..497830013 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -40,6 +40,8 @@ impl LzReceiveTypesV2<'_> { Pubkey::find_program_address(&[oapp::endpoint_cpi::EVENT_SEED], &ctx.program_id); let mut accounts = vec![ + // payer + AccountMetaRef { pubkey: AddressLocator::Payer, is_writable: true }, // store (writable) AccountMetaRef { pubkey: store_key.into(), is_writable: true }, // peer From 323a019780f09389b2d9d6456531da17afac6d19 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 01:06:58 -0300 Subject: [PATCH 20/24] delete --- .../src/instructions/lz_receive_types.rs | 52 ------------------- .../programs/my_oapp/src/instructions/mod.rs | 2 - 2 files changed, 54 deletions(-) delete mode 100644 examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types.rs diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types.rs deleted file mode 100644 index adcaffbc6..000000000 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types.rs +++ /dev/null @@ -1,52 +0,0 @@ -use crate::*; -use oapp::endpoint_cpi::{get_accounts_for_clear, LzAccount}; -use oapp::{endpoint::ID as ENDPOINT_ID, LzReceiveParams}; - -/// `lz_receive_types` is queried off-chain by the Executor before calling -/// `lz_receive`. It must return **every** account that will be touched by the -/// actual `lz_receive` instruction as well as the accounts required by -/// `Endpoint::clear`. -/// -/// The return order must match exactly what `lz_receive` expects or the -/// cross-program invocation will fail. -#[derive(Accounts)] -pub struct LzReceiveTypes<'info> { - #[account(seeds = [STORE_SEED], bump = store.bump)] - pub store: Account<'info, Store>, -} - -impl LzReceiveTypes<'_> { - pub fn apply( - ctx: &Context, - params: &LzReceiveParams, - ) -> Result> { - // 1. The store PDA is always the first account and is mutable. If your - // program derives the store PDA with additional seeds, ensure the same - // seeds are used when providing the store account. - let store = ctx.accounts.store.key(); - - // 2. The peer PDA for the remote chain needs to be retrieved, for later verification of the `params.sender`. - let peer_seeds = [PEER_SEED, &store.to_bytes(), ¶ms.src_eid.to_be_bytes()]; - let (peer, _) = Pubkey::find_program_address(&peer_seeds, ctx.program_id); - - // Accounts used directly by `lz_receive` - let mut accounts = vec![ - // store (mutable) - LzAccount { pubkey: store, is_signer: false, is_writable: true }, - // peer (read-only) - LzAccount { pubkey: peer, is_signer: false, is_writable: false } - ]; - - // Append the additional accounts required for `Endpoint::clear` - let accounts_for_clear = get_accounts_for_clear( - ENDPOINT_ID, - &store, - params.src_eid, - ¶ms.sender, - params.nonce, - ); - accounts.extend(accounts_for_clear); - - Ok(accounts) - } -} diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs index f76f48581..aea6d160e 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/mod.rs @@ -1,7 +1,6 @@ pub mod send; pub mod init_store; pub mod lz_receive; -pub mod lz_receive_types; pub mod lz_receive_types_info; pub mod lz_receive_types_v2; pub mod quote_send; @@ -11,7 +10,6 @@ pub mod set_peer_config; pub use send::*; pub use init_store::*; pub use lz_receive::*; -pub use lz_receive_types::*; pub use lz_receive_types_info::*; pub use lz_receive_types_v2::*; pub use quote_send::*; From 579f05f37dc0f6805e1312e4c6ca71dd9ef12483 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 01:20:47 -0300 Subject: [PATCH 21/24] rm system program --- .../programs/my_oapp/src/instructions/lz_receive_types_v2.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index 497830013..39b31231f 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -48,11 +48,6 @@ impl LzReceiveTypesV2<'_> { AccountMetaRef { pubkey: peer.into(), is_writable: false }, // event authority account - used for event logging AccountMetaRef { pubkey: event_authority_account.into(), is_writable: false }, - // system program - AccountMetaRef { - pubkey: solana_program::system_program::ID.into(), - is_writable: false, - }, // program id - the program that is executing this instruction AccountMetaRef { pubkey: crate::ID.into(), is_writable: false }, ]; From a035a99e62ab92299c88ccdda23f3eb0978c17ec Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 01:29:17 -0300 Subject: [PATCH 22/24] fixed --- .../my_oapp/src/instructions/lz_receive_types_v2.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index 39b31231f..b9bd23e88 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -45,11 +45,7 @@ impl LzReceiveTypesV2<'_> { // store (writable) AccountMetaRef { pubkey: store_key.into(), is_writable: true }, // peer - AccountMetaRef { pubkey: peer.into(), is_writable: false }, - // event authority account - used for event logging - AccountMetaRef { pubkey: event_authority_account.into(), is_writable: false }, - // program id - the program that is executing this instruction - AccountMetaRef { pubkey: crate::ID.into(), is_writable: false }, + AccountMetaRef { pubkey: peer.into(), is_writable: false } ]; // Add accounts required for LayerZero's clear operation From 283078d6623d7dd0499909df6eba9afca5f8dd2a Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Fri, 28 Nov 2025 10:31:11 -0300 Subject: [PATCH 23/24] update lockfiles --- examples/lzapp-migration/pnpm-lock.yaml | 148 ++++++++++++------------ examples/oft-solana/pnpm-lock.yaml | 136 +++++++++++----------- 2 files changed, 142 insertions(+), 142 deletions(-) diff --git a/examples/lzapp-migration/pnpm-lock.yaml b/examples/lzapp-migration/pnpm-lock.yaml index 8c72ec4f6..5c1c4ae0b 100644 --- a/examples/lzapp-migration/pnpm-lock.yaml +++ b/examples/lzapp-migration/pnpm-lock.yaml @@ -10,14 +10,14 @@ overrides: dependencies: '@layerzerolabs/devtools': - specifier: ^2.0.2 - version: 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + specifier: ^2.0.3 + version: 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) '@layerzerolabs/devtools-evm-hardhat': specifier: ^4.0.0 - version: 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) + version: 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) '@layerzerolabs/devtools-solana': - specifier: ^3.0.3 - version: 3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + specifier: ^3.0.4 + version: 3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/export-deployments': specifier: ^0.0.16 version: 0.0.16 @@ -32,22 +32,22 @@ dependencies: version: 3.0.147(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) '@layerzerolabs/protocol-devtools': specifier: ^3.0.0 - version: 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + version: 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) '@layerzerolabs/solidity-examples': specifier: ^1.1.0 version: 1.1.0(@nomiclabs/hardhat-ethers@2.2.3)(@nomiclabs/hardhat-etherscan@3.1.8)(ethers@5.8.0)(ts-node@10.9.2)(typescript@5.9.3) '@layerzerolabs/ua-devtools': specifier: ^5.0.0 - version: 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + version: 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@layerzerolabs/ua-devtools-evm': specifier: ^7.0.0 - version: 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + version: 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) '@layerzerolabs/ua-devtools-evm-hardhat': specifier: ^9.0.0 - version: 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.7.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0) + version: 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.7.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0) '@layerzerolabs/ua-devtools-solana': specifier: ^8.0.0 - version: 8.0.3(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/oft-v2-solana-sdk@3.0.147)(@layerzerolabs/protocol-devtools-solana@8.0.4)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76) + version: 8.0.3(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/oft-v2-solana-sdk@3.0.147)(@layerzerolabs/protocol-devtools-solana@8.0.4)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76) '@metaplex-foundation/mpl-token-metadata': specifier: ^3.2.1 version: 3.4.0(@metaplex-foundation/umi@0.9.2) @@ -837,7 +837,7 @@ packages: '@ethersproject/abstract-provider': 5.8.0 '@ethersproject/address': 5.8.0 '@ethersproject/bignumber': 5.8.0 - '@ethersproject/bytes': 5.7.0 + '@ethersproject/bytes': 5.8.0 '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/hash': 5.8.0 @@ -1592,7 +1592,7 @@ packages: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - /@layerzerolabs/devtools-evm-hardhat@4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0): + /@layerzerolabs/devtools-evm-hardhat@4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0): resolution: {integrity: sha512-Z0d88OUoD5Xhg0VWn5xxWLiK3Q2PyaXAY8iUxgfsbAenAqBHojKyFSSOJLPazAf7UJ0U6D/nFt/fPeSGU8URRw==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -1612,8 +1612,8 @@ packages: '@ethersproject/abstract-signer': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/providers': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/export-deployments': 0.0.16 '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 @@ -1632,7 +1632,7 @@ packages: - supports-color - utf-8-validate - /@layerzerolabs/devtools-evm@3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76): + /@layerzerolabs/devtools-evm@3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76): resolution: {integrity: sha512-S9StyYxjATQw/myN6FEzPRXUV1Zg2O2Nn3fSNYXYYuBYdSvTIFTNjNA6mMTgrP+0bQbNOU03QLdXVJ14uy1dOw==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -1657,7 +1657,7 @@ packages: '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/providers': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@safe-global/api-kit': 4.0.1(typescript@5.9.3)(zod@3.25.76) @@ -1673,10 +1673,10 @@ packages: - typescript - utf-8-validate - /@layerzerolabs/devtools-solana@3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76): - resolution: {integrity: sha512-yPc2eRmA3CJLtWNIwR7mVBt4/QcyDjqfyjkpqM55tm6/7v330C2xf+ZPO+NkQdAP8QMujHqX/oNa7Elxcgs7DA==} + /@layerzerolabs/devtools-solana@3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76): + resolution: {integrity: sha512-RWZsWgG8u0gf6zon/rm5BE2WreSpHL/Li9EkJpxPIrgEs3bDQXB088NTMUBvhlmWGs4M1gCMiA49tUD2tR9V8Q==} peerDependencies: - '@layerzerolabs/devtools': ~2.0.2 + '@layerzerolabs/devtools': ~2.0.3 '@layerzerolabs/io-devtools': ~0.3.0 '@layerzerolabs/lz-definitions': ^3.0.75 '@solana/web3.js': ^1.95.8 @@ -1684,7 +1684,7 @@ packages: fp-ts: ^2.16.2 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@solana-developers/helpers': 2.8.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) @@ -1701,8 +1701,8 @@ packages: - utf-8-validate dev: false - /@layerzerolabs/devtools@2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76): - resolution: {integrity: sha512-Aaeb6U+tM57mddv+gs6IZ4kBDg5x2b5M6ZLfhY9Y7rlYraUjG0ZMRnY2+6akUo2sOgBIVtJ/bjqOZLebi4h3dA==} + /@layerzerolabs/devtools@2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76): + resolution: {integrity: sha512-kpMQerGyDDQw9B9HdN/yqToZR1oDtFNHmfDQu069hiz8699cu/hUqevHmDPOdEKX+3HsRY3Gn/BZ5JW8WQbFmA==} peerDependencies: '@ethersproject/bytes': ~5.7.0 '@layerzerolabs/io-devtools': ~0.3.1 @@ -1717,8 +1717,8 @@ packages: js-yaml: 4.1.1 zod: 3.25.76 - /@layerzerolabs/devtools@2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76): - resolution: {integrity: sha512-Aaeb6U+tM57mddv+gs6IZ4kBDg5x2b5M6ZLfhY9Y7rlYraUjG0ZMRnY2+6akUo2sOgBIVtJ/bjqOZLebi4h3dA==} + /@layerzerolabs/devtools@2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76): + resolution: {integrity: sha512-kpMQerGyDDQw9B9HdN/yqToZR1oDtFNHmfDQu069hiz8699cu/hUqevHmDPOdEKX+3HsRY3Gn/BZ5JW8WQbFmA==} peerDependencies: '@ethersproject/bytes': ~5.7.0 '@layerzerolabs/io-devtools': ~0.3.1 @@ -2114,7 +2114,7 @@ packages: prettier-plugin-solidity: 1.4.3(prettier@3.6.2) dev: true - /@layerzerolabs/protocol-devtools-evm@5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): + /@layerzerolabs/protocol-devtools-evm@5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): resolution: {integrity: sha512-g2RwxOWJITuEKU/j04UscEc57OcU03+vEsS7i3jyz+AKKq2vjXFMf6s9rbeQmu548/8LppnHg/t5QH5R33TPkQ==} peerDependencies: '@ethersproject/abstract-provider': ^5.7.0 @@ -2136,15 +2136,15 @@ packages: '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/providers': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) p-memoize: 4.0.4 zod: 3.25.76 - /@layerzerolabs/protocol-devtools-solana@8.0.4(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76): + /@layerzerolabs/protocol-devtools-solana@8.0.4(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76): resolution: {integrity: sha512-FCfZ9NDXaqVvTyY+mhFvq8HR1uynMUgfC0ldZgdV+PODVUInKbsaRsu814JSW2boN/NwnscLUGmjGIg4dzqEjQ==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2159,20 +2159,20 @@ packages: fp-ts: ^2.16.2 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-solana': 3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-solana': 3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@layerzerolabs/lz-solana-sdk-v2': 3.0.147(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) '@layerzerolabs/lz-v2-utilities': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@solana/web3.js': 1.95.8 fp-ts: 2.16.11 zod: 3.25.76 dev: false - /@layerzerolabs/protocol-devtools@3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76): + /@layerzerolabs/protocol-devtools@3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76): resolution: {integrity: sha512-5LndY2OD0PdodEv5IuhSP3RzbThxmE2B8twcrMGuPixrD1PjiIYqLvm2wznUMV/2NLiQrDdY1bOpd+5q9weibw==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2180,7 +2180,7 @@ packages: '@layerzerolabs/lz-definitions': ^3.0.75 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 zod: 3.25.76 @@ -2270,20 +2270,20 @@ packages: '@ethersproject/bytes': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/hash': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) - '@layerzerolabs/devtools-evm-hardhat': 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools-evm-hardhat': 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@layerzerolabs/lz-evm-sdk-v1': 3.0.147 '@layerzerolabs/lz-evm-sdk-v2': 3.0.147 '@layerzerolabs/lz-v2-utilities': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@layerzerolabs/test-devtools-evm-hardhat': 0.5.2(hardhat@2.27.0)(solidity-bytes-utils@0.8.4) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm-hardhat': 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm-hardhat': 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0) '@nomicfoundation/hardhat-ethers': 3.1.2(ethers@5.8.0)(hardhat@2.27.0) ethers: 5.8.0 fp-ts: 2.16.11 @@ -2327,7 +2327,7 @@ packages: - typescript - utf-8-validate - /@layerzerolabs/ua-devtools-evm-hardhat@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.7.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0): + /@layerzerolabs/ua-devtools-evm-hardhat@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.7.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0): resolution: {integrity: sha512-Wm/88JToOgFAJO0nKnpGMxQDD8mN37VFhz/ejE0DWbXsukp7IdX4ld4gQKM0MU7Yiajardhlvpa3Mwg+xHi8KQ==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -2351,15 +2351,15 @@ packages: '@ethersproject/bytes': 5.7.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/hash': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) - '@layerzerolabs/devtools-evm-hardhat': 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools-evm-hardhat': 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) ethers: 5.8.0 hardhat: 2.27.0(ts-node@10.9.2)(typescript@5.9.3) hardhat-deploy: 0.12.4 @@ -2367,7 +2367,7 @@ packages: typescript: 5.9.3 dev: false - /@layerzerolabs/ua-devtools-evm-hardhat@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0): + /@layerzerolabs/ua-devtools-evm-hardhat@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.3)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.27.0): resolution: {integrity: sha512-Wm/88JToOgFAJO0nKnpGMxQDD8mN37VFhz/ejE0DWbXsukp7IdX4ld4gQKM0MU7Yiajardhlvpa3Mwg+xHi8KQ==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -2391,15 +2391,15 @@ packages: '@ethersproject/bytes': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/hash': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) - '@layerzerolabs/devtools-evm-hardhat': 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools-evm-hardhat': 4.0.3(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.27.0) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) ethers: 5.8.0 hardhat: 2.27.0(ts-node@10.9.2)(typescript@5.9.3) hardhat-deploy: 0.12.4 @@ -2407,7 +2407,7 @@ packages: typescript: 5.9.3 dev: true - /@layerzerolabs/ua-devtools-evm@7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76): + /@layerzerolabs/ua-devtools-evm@7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76): resolution: {integrity: sha512-FPm6ESqm2SBOJjCbRnkWCMg6o5zlkoeLUavD8v1hlZeiY4i33wIHccQPtxMz8Yz/ZD8leQ8TiKJJJ9sdVGk7tQ==} peerDependencies: '@ethersproject/constants': ^5.7.0 @@ -2424,18 +2424,18 @@ packages: dependencies: '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@layerzerolabs/lz-v2-utilities': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.1)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) p-memoize: 4.0.4 zod: 3.25.76 - /@layerzerolabs/ua-devtools-solana@8.0.3(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/oft-v2-solana-sdk@3.0.147)(@layerzerolabs/protocol-devtools-solana@8.0.4)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76): + /@layerzerolabs/ua-devtools-solana@8.0.3(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/oft-v2-solana-sdk@3.0.147)(@layerzerolabs/protocol-devtools-solana@8.0.4)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76): resolution: {integrity: sha512-9d3MAgGlv3PSy23vlIcw+LODLSe0tsbMkGHIHz1s42yeQ7tWrhvapU3nseKWfUWOUDIy6j8PCdyaAJ2jehNSRQ==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2452,23 +2452,23 @@ packages: fp-ts: ^2.16.2 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/devtools-solana': 3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools-solana': 3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@solana/web3.js@1.95.8)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@layerzerolabs/lz-solana-sdk-v2': 3.0.147(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) '@layerzerolabs/lz-v2-utilities': 3.0.147 '@layerzerolabs/oft-v2-solana-sdk': 3.0.147(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-solana': 8.0.4(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-solana': 8.0.4(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-solana-sdk-v2@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.95.8)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@solana/web3.js': 1.95.8 fp-ts: 2.16.11 p-memoize: 4.0.4 zod: 3.25.76 dev: false - /@layerzerolabs/ua-devtools@5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): + /@layerzerolabs/ua-devtools@5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(@layerzerolabs/lz-v2-utilities@3.0.147)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): resolution: {integrity: sha512-acoxyJAYqF+di2/akGuWLa5Gdt7Z/8LLZD0LqOui34yjPuHYH88L4xxmKxqrs4Ga/uQnRKcF6Cauy9pjlQCj1A==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2478,11 +2478,11 @@ packages: '@layerzerolabs/protocol-devtools': ~3.0.1 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.7.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.147 '@layerzerolabs/lz-v2-utilities': 3.0.147 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.147)(zod@3.25.76) zod: 3.25.76 /@ledgerhq/devices@8.7.0: diff --git a/examples/oft-solana/pnpm-lock.yaml b/examples/oft-solana/pnpm-lock.yaml index 38572c7fb..a6f807a31 100644 --- a/examples/oft-solana/pnpm-lock.yaml +++ b/examples/oft-solana/pnpm-lock.yaml @@ -29,17 +29,17 @@ devDependencies: specifier: ^5.7.0 version: 5.8.0 '@layerzerolabs/devtools': - specifier: ~2.0.2 - version: 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + specifier: ~2.0.3 + version: 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) '@layerzerolabs/devtools-evm': specifier: ~3.0.0 - version: 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) + version: 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) '@layerzerolabs/devtools-evm-hardhat': specifier: ^4.0.0 - version: 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) + version: 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) '@layerzerolabs/devtools-solana': - specifier: ~3.0.3 - version: 3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + specifier: ~3.0.4 + version: 3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/eslint-config-next': specifier: ~2.3.39 version: 2.3.44(typescript@5.9.3) @@ -81,13 +81,13 @@ devDependencies: version: 2.3.44 '@layerzerolabs/protocol-devtools': specifier: ^3.0.0 - version: 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + version: 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) '@layerzerolabs/protocol-devtools-evm': specifier: ~5.0.0 - version: 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + version: 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@layerzerolabs/protocol-devtools-solana': specifier: ^8.0.3 - version: 8.0.3(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76) + version: 8.0.3(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76) '@layerzerolabs/solhint-config': specifier: ^3.0.12 version: 3.0.142(typescript@5.9.3) @@ -105,16 +105,16 @@ devDependencies: version: 0.6.12(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/providers@5.8.0)(@nomicfoundation/hardhat-ethers@3.1.1)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4)(solidity-bytes-utils@0.8.4) '@layerzerolabs/ua-devtools': specifier: ~5.0.0 - version: 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + version: 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@layerzerolabs/ua-devtools-evm': specifier: ~7.0.0 - version: 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + version: 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) '@layerzerolabs/ua-devtools-evm-hardhat': specifier: ~9.0.0 - version: 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.1)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4) + version: 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.1)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4) '@layerzerolabs/ua-devtools-solana': specifier: ~8.0.2 - version: 8.0.2(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/oft-v2-solana-sdk@3.0.142)(@layerzerolabs/protocol-devtools-solana@8.0.3)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76) + version: 8.0.2(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/oft-v2-solana-sdk@3.0.142)(@layerzerolabs/protocol-devtools-solana@8.0.3)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76) '@metaplex-foundation/mpl-token-metadata': specifier: ^3.2.1 version: 3.4.0(@metaplex-foundation/umi@0.9.2) @@ -1973,7 +1973,7 @@ packages: '@jridgewell/sourcemap-codec': 1.5.5 dev: true - /@layerzerolabs/devtools-evm-hardhat@4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4): + /@layerzerolabs/devtools-evm-hardhat@4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4): resolution: {integrity: sha512-RqF6hrVhkJ/O83cYXi744TPOaqBzi4W4+daVHpZsp1W32hDbojYNcXwHi7jldt7BOL0KT/t4A5lBVIcGzCh0YQ==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -1993,8 +1993,8 @@ packages: '@ethersproject/abstract-signer': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/providers': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) '@layerzerolabs/export-deployments': 0.0.16 '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 @@ -2014,7 +2014,7 @@ packages: - utf-8-validate dev: true - /@layerzerolabs/devtools-evm@3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76): + /@layerzerolabs/devtools-evm@3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76): resolution: {integrity: sha512-k3oqoB8f4eQf111WtrFQOhzLaxsjEZn/N3o7Bbyn8HlNPPWCyockAfXZfTiJ5p5YXRBDJVO2RkwxsqE00wHnOw==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -2039,7 +2039,7 @@ packages: '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/providers': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@safe-global/api-kit': 1.3.1 @@ -2055,10 +2055,10 @@ packages: - utf-8-validate dev: true - /@layerzerolabs/devtools-solana@3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76): - resolution: {integrity: sha512-yPc2eRmA3CJLtWNIwR7mVBt4/QcyDjqfyjkpqM55tm6/7v330C2xf+ZPO+NkQdAP8QMujHqX/oNa7Elxcgs7DA==} + /@layerzerolabs/devtools-solana@3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76): + resolution: {integrity: sha512-RWZsWgG8u0gf6zon/rm5BE2WreSpHL/Li9EkJpxPIrgEs3bDQXB088NTMUBvhlmWGs4M1gCMiA49tUD2tR9V8Q==} peerDependencies: - '@layerzerolabs/devtools': ~2.0.2 + '@layerzerolabs/devtools': ~2.0.3 '@layerzerolabs/io-devtools': ~0.3.0 '@layerzerolabs/lz-definitions': ^3.0.75 '@solana/web3.js': ^1.98.0 @@ -2066,7 +2066,7 @@ packages: fp-ts: ^2.16.2 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@solana-developers/helpers': 2.8.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) @@ -2083,8 +2083,8 @@ packages: - utf-8-validate dev: true - /@layerzerolabs/devtools@2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76): - resolution: {integrity: sha512-Aaeb6U+tM57mddv+gs6IZ4kBDg5x2b5M6ZLfhY9Y7rlYraUjG0ZMRnY2+6akUo2sOgBIVtJ/bjqOZLebi4h3dA==} + /@layerzerolabs/devtools@2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76): + resolution: {integrity: sha512-kpMQerGyDDQw9B9HdN/yqToZR1oDtFNHmfDQu069hiz8699cu/hUqevHmDPOdEKX+3HsRY3Gn/BZ5JW8WQbFmA==} peerDependencies: '@ethersproject/bytes': ~5.7.0 '@layerzerolabs/io-devtools': ~0.3.1 @@ -2416,8 +2416,8 @@ packages: '@layerzerolabs/devtools-evm-hardhat': ~4.0.0 '@layerzerolabs/ua-devtools': ~5.0.1 dependencies: - '@layerzerolabs/devtools-evm-hardhat': 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/devtools-evm-hardhat': 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) dev: true /@layerzerolabs/oapp-evm@0.4.0(@layerzerolabs/lz-evm-messagelib-v2@3.0.142)(@layerzerolabs/lz-evm-protocol-v2@3.0.142)(@layerzerolabs/lz-evm-v1-0.7@3.0.142)(@openzeppelin/contracts-upgradeable@5.4.0)(@openzeppelin/contracts@5.4.0): @@ -2495,7 +2495,7 @@ packages: prettier-plugin-solidity: 1.4.3(prettier@3.6.2) dev: true - /@layerzerolabs/protocol-devtools-evm@5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): + /@layerzerolabs/protocol-devtools-evm@5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): resolution: {integrity: sha512-g2RwxOWJITuEKU/j04UscEc57OcU03+vEsS7i3jyz+AKKq2vjXFMf6s9rbeQmu548/8LppnHg/t5QH5R33TPkQ==} peerDependencies: '@ethersproject/abstract-provider': ^5.7.0 @@ -2517,16 +2517,16 @@ packages: '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/providers': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) p-memoize: 4.0.4 zod: 3.25.76 dev: true - /@layerzerolabs/protocol-devtools-solana@8.0.3(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76): + /@layerzerolabs/protocol-devtools-solana@8.0.3(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76): resolution: {integrity: sha512-zeor10qzjlVgmGDmlbb/s2JMo8pPGHmRcsnDgorunGwAop3BfZkSZI8RbpedXSNVPTfDAdC0VXykpHsXHyrCKg==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2541,14 +2541,14 @@ packages: fp-ts: ^2.16.2 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-solana': 3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-solana': 3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@layerzerolabs/lz-solana-sdk-v2': 3.0.142(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) '@layerzerolabs/lz-v2-utilities': 3.0.142 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@safe-global/api-kit': 1.3.1 '@safe-global/protocol-kit': 1.3.0(ethers@5.8.0) '@solana/web3.js': 1.98.4(typescript@5.9.3) @@ -2563,7 +2563,7 @@ packages: - utf-8-validate dev: true - /@layerzerolabs/protocol-devtools@3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76): + /@layerzerolabs/protocol-devtools@3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76): resolution: {integrity: sha512-5LndY2OD0PdodEv5IuhSP3RzbThxmE2B8twcrMGuPixrD1PjiIYqLvm2wznUMV/2NLiQrDdY1bOpd+5q9weibw==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2571,7 +2571,7 @@ packages: '@layerzerolabs/lz-definitions': ^3.0.75 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 zod: 3.25.76 @@ -2632,20 +2632,20 @@ packages: '@ethersproject/bytes': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/hash': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) - '@layerzerolabs/devtools-evm-hardhat': 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/devtools-evm-hardhat': 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@layerzerolabs/lz-evm-sdk-v1': 3.0.142 '@layerzerolabs/lz-evm-sdk-v2': 3.0.142 '@layerzerolabs/lz-v2-utilities': 3.0.142 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@layerzerolabs/test-devtools-evm-hardhat': 0.5.2(hardhat@2.26.4)(solidity-bytes-utils@0.8.4) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm-hardhat': 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.1)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm-hardhat': 9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.1)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4) '@nomicfoundation/hardhat-ethers': 3.1.1(ethers@5.8.0)(hardhat@2.26.4) ethers: 5.8.0 fp-ts: 2.16.11 @@ -2689,7 +2689,7 @@ packages: - utf-8-validate dev: true - /@layerzerolabs/ua-devtools-evm-hardhat@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.1)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4): + /@layerzerolabs/ua-devtools-evm-hardhat@9.0.0(@ethersproject/abi@5.8.0)(@ethersproject/bytes@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/hash@5.8.0)(@layerzerolabs/devtools-evm-hardhat@4.0.1)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools-evm@7.0.0)(@layerzerolabs/ua-devtools@5.0.1)(ethers@5.8.0)(hardhat-deploy@0.12.4)(hardhat@2.26.4): resolution: {integrity: sha512-Wm/88JToOgFAJO0nKnpGMxQDD8mN37VFhz/ejE0DWbXsukp7IdX4ld4gQKM0MU7Yiajardhlvpa3Mwg+xHi8KQ==} peerDependencies: '@ethersproject/abi': ^5.7.0 @@ -2713,15 +2713,15 @@ packages: '@ethersproject/bytes': 5.8.0 '@ethersproject/contracts': 5.8.0 '@ethersproject/hash': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) - '@layerzerolabs/devtools-evm-hardhat': 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/devtools-evm-hardhat': 4.0.1(@ethersproject/abi@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@nomiclabs/hardhat-ethers@2.2.3)(ethers@5.8.0)(fp-ts@2.16.11)(hardhat-deploy@0.12.4)(hardhat@2.26.4) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools-evm': 7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76) ethers: 5.8.0 hardhat: 2.26.4(ts-node@10.9.2)(typescript@5.9.3) hardhat-deploy: 0.12.4 @@ -2729,7 +2729,7 @@ packages: typescript: 5.9.3 dev: true - /@layerzerolabs/ua-devtools-evm@7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76): + /@layerzerolabs/ua-devtools-evm@7.0.0(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools-evm@5.0.1)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(zod@3.25.76): resolution: {integrity: sha512-FPm6ESqm2SBOJjCbRnkWCMg6o5zlkoeLUavD8v1hlZeiY4i33wIHccQPtxMz8Yz/ZD8leQ8TiKJJJ9sdVGk7tQ==} peerDependencies: '@ethersproject/constants': ^5.7.0 @@ -2746,19 +2746,19 @@ packages: dependencies: '@ethersproject/constants': 5.8.0 '@ethersproject/contracts': 5.8.0 - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-evm': 3.0.0(@ethersproject/abi@5.8.0)(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/address@5.7.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(fp-ts@2.16.11)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@layerzerolabs/lz-v2-utilities': 3.0.142 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-evm': 5.0.1(@ethersproject/abstract-provider@5.8.0)(@ethersproject/abstract-signer@5.8.0)(@ethersproject/bignumber@5.8.0)(@ethersproject/constants@5.8.0)(@ethersproject/contracts@5.8.0)(@ethersproject/providers@5.8.0)(@layerzerolabs/devtools-evm@3.0.0)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) p-memoize: 4.0.4 zod: 3.25.76 dev: true - /@layerzerolabs/ua-devtools-solana@8.0.2(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/oft-v2-solana-sdk@3.0.142)(@layerzerolabs/protocol-devtools-solana@8.0.3)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76): + /@layerzerolabs/ua-devtools-solana@8.0.2(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/oft-v2-solana-sdk@3.0.142)(@layerzerolabs/protocol-devtools-solana@8.0.3)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76): resolution: {integrity: sha512-S1uiwLKJZQ87h9V51w1gTDgnMXtq45zHxO5xJ7XUIM7B+NoOX2arZB3cWerwocjAwloKHYBUxmWp8/vhJODkeg==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2775,16 +2775,16 @@ packages: fp-ts: ^2.16.2 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/devtools-solana': 3.0.3(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools-solana': 3.0.4(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@solana/web3.js@1.98.4)(bn.js@5.2.2)(fastestsmallesttextencoderdecoder@1.0.22)(fp-ts@2.16.11)(typescript@5.9.3)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@layerzerolabs/lz-solana-sdk-v2': 3.0.142(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) '@layerzerolabs/lz-v2-utilities': 3.0.142 '@layerzerolabs/oft-v2-solana-sdk': 3.0.142(fastestsmallesttextencoderdecoder@1.0.22)(got@11.8.6)(typescript@5.9.3) - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) - '@layerzerolabs/protocol-devtools-solana': 8.0.3(@layerzerolabs/devtools-solana@3.0.3)(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76) - '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/protocol-devtools-solana': 8.0.3(@layerzerolabs/devtools-solana@3.0.4)(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-solana-sdk-v2@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(@layerzerolabs/ua-devtools@5.0.1)(@solana/web3.js@1.98.4)(fp-ts@2.16.11)(zod@3.25.76) + '@layerzerolabs/ua-devtools': 5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76) '@safe-global/api-kit': 1.3.1 '@safe-global/protocol-kit': 1.3.0(ethers@5.8.0) '@solana/web3.js': 1.98.4(typescript@5.9.3) @@ -2799,7 +2799,7 @@ packages: - utf-8-validate dev: true - /@layerzerolabs/ua-devtools@5.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): + /@layerzerolabs/ua-devtools@5.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(@layerzerolabs/lz-v2-utilities@3.0.142)(@layerzerolabs/protocol-devtools@3.0.1)(zod@3.25.76): resolution: {integrity: sha512-acoxyJAYqF+di2/akGuWLa5Gdt7Z/8LLZD0LqOui34yjPuHYH88L4xxmKxqrs4Ga/uQnRKcF6Cauy9pjlQCj1A==} peerDependencies: '@layerzerolabs/devtools': ~2.0.0 @@ -2809,11 +2809,11 @@ packages: '@layerzerolabs/protocol-devtools': ~3.0.1 zod: ^3.22.4 dependencies: - '@layerzerolabs/devtools': 2.0.2(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/devtools': 2.0.3(@ethersproject/bytes@5.8.0)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) '@layerzerolabs/io-devtools': 0.3.1(ink-gradient@2.0.0)(ink-table@3.1.0)(ink@3.2.0)(react@17.0.2)(yoga-layout-prebuilt@1.10.0)(zod@3.25.76) '@layerzerolabs/lz-definitions': 3.0.142 '@layerzerolabs/lz-v2-utilities': 3.0.142 - '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.2)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) + '@layerzerolabs/protocol-devtools': 3.0.1(@layerzerolabs/devtools@2.0.3)(@layerzerolabs/io-devtools@0.3.1)(@layerzerolabs/lz-definitions@3.0.142)(zod@3.25.76) zod: 3.25.76 dev: true From 815d0a1083b878338052429f2203be73ce89e471 Mon Sep 17 00:00:00 2001 From: nazreen <10964594+nazreen@users.noreply.github.com> Date: Wed, 10 Dec 2025 00:08:05 +0800 Subject: [PATCH 24/24] remove unused --- .../programs/my_oapp/src/instructions/lz_receive_types_v2.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs index b9bd23e88..12faad6aa 100644 --- a/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs +++ b/examples/oapp-solana/programs/my_oapp/src/instructions/lz_receive_types_v2.rs @@ -35,10 +35,6 @@ impl LzReceiveTypesV2<'_> { let peer_seeds = [PEER_SEED, store_key.as_ref(), ¶ms.src_eid.to_be_bytes()]; let (peer, _) = Pubkey::find_program_address(&peer_seeds, ctx.program_id); - // Event authority used for logging - let (event_authority_account, _) = - Pubkey::find_program_address(&[oapp::endpoint_cpi::EVENT_SEED], &ctx.program_id); - let mut accounts = vec![ // payer AccountMetaRef { pubkey: AddressLocator::Payer, is_writable: true },