@layerzerolabs/lz-sui-sdk-v2
Version:
1,165 lines (1,148 loc) • 279 kB
text/typescript
import { SuiClient, SuiObjectResponse, SuiTransactionBlockResponse, ObjectOwner } from '@mysten/sui/client';
import { TransactionArgument, Transaction, TransactionResult } from '@mysten/sui/transactions';
import { Chain, Stage, EndpointId } from '@layerzerolabs/lz-definitions';
import { Keypair } from '@mysten/sui/cryptography';
import * as _mysten_sui_dist_cjs_bcs from '@mysten/sui/dist/cjs/bcs';
import * as _store__mysten_bcs_npm_1_6_3_20c656f643_package from '.store/@mysten-bcs-npm-1.6.3-20c656f643/package';
/**
* Type representing the options for packages.
*/
interface PackageOptions {
/**
* The endpoint V2 address.
*/
endpointV2: string;
/**
* The zro address.
*/
zro: string;
/**
* The utils address.
*/
utils: string;
/**
* The call address.
*/
call: string;
/**
* The simple message library address.
*/
simpleMessageLib: string;
/**
* The ULN-302 address.
*/
uln302: string;
/**
* The treasury address.
*/
treasury: string;
/**
* The common DVN address.
*/
dvn: string;
/**
* The DVN fee lib address.
*/
dvnFeeLib: string;
/**
* The common executor address.
*/
executor: string;
/**
* The executor fee lib address.
*/
executorFeeLib: string;
/**
* The price feed address.
*/
priceFeed: string;
/**
* The common oapp address.
*/
oapp: string;
/**
* The LayerZero Views address.
*/
layerzeroViews: string;
/**
* The dvn layerzero address.
*/
dvnLayerzero: string;
/**
* The executor layerzero address.
*/
executorLayerzero: string;
/**
* The counter V2 address.
*/
counterV2: string;
/**
* The ptb move call address.
*/
ptbMoveCall: string;
/**
* The endpoint PTB builder address.
*/
endpointPtbBuilder: string;
/**
* The simple message lib PTB builder address.
*/
simpleMessageLibPtbBuilder: string;
/**
* The ULN-302 PTB builder address.
*/
uln302PtbBuilder: string;
/**
* The DVN PTB builder address.
*/
dvnPtbBuilder: string;
/**
* The executor PTB builder address.
*/
executorPtbBuilder: string;
/**
* The package whitelist validator address.
*/
packageWhitelistValidator: string;
/**
* The blocked message library object address.
*/
blockedMessageLib: string;
/**
* The blocked message library PTB builder object address.
*/
blockedMessageLibPtbBuilder: string;
/**
* The worker registry address.
*/
workerRegistry: string;
/**
* The worker common address.
*/
workerCommon: string;
/**
* Allow additional properties beyond the explicitly defined ones
*/
[key: string]: any;
}
/**
* Type representing the options for objects.
*/
interface ObjectOptions {
/**
* The endpoint V2 object address.
*/
endpointV2: string;
/**
* The simple message library object address.
*/
simpleMessageLib: string;
/**
* The simple message library cap object address.
*/
simpleMessageLibAdminCap: string;
/**
* The simple message library PTB builder object address.
*/
simpleMessageLibPtbBuilder: string;
/**
* The ULN-302 message library object address.
*/
uln302: string;
/**
* The ULN-302 admin cap object address.
*/
uln302AdminCap: string;
/**
* The ULN-302 verification object address.
*/
uln302Verification: string;
/**
* The ULN-302 PTB builder object address.
*/
uln302PtbBuilder: string;
/**
* The treasury object address.
*/
treasury: string;
/**
* The treasury admin cap object address.
*/
treasuryAdminCap: string;
/**
* The blocked message library object address.
*/
blockedMessageLib: string;
/**
* The blocked message library PTB builder object address.
*/
blockedMessageLibPtbBuilder: string;
/**
* The counter admin cap object address.
*/
counterAdminCap: string;
/**
* The endpoint admin cap object address.
*/
endpointAdminCap: string;
/**
* The endpoint PTB builder object address.
*/
endpointPtbBuilder: string;
/**
* The endpoint PTB builder admin cap object address.
*/
endpointPtbBuilderAdminCap: string;
/**
* The default DVN object address.
*/
dvn: string;
/**
* The default DVN callCap object address, used in init_dvn move call
*/
dvnCap: string;
/**
* The default DVN fee lib object address.
*/
dvnFeeLib: string;
/**
* The default executor object address.
*/
executor: string;
/**
* The default executor callCap object address, used in init_executor move call
*/
executorCap: string;
/**
* The default executor owner cap object address.
*/
executorOwnerCap: string;
/**
* The default executor fee lib object address.
*/
executorFeeLib: string;
/**
* The default price feed object address.
*/
priceFeed: string;
/**
* The default price feed owner cap object address.
*/
priceFeedOwnerCap: string;
/**
* The counter OApp object address.
*/
counter: string;
/**
* The OApp core object address.
*/
counterOapp: string;
/**
* The default package whitelist validator object address.
*/
packageWhitelistValidator: string;
/**
* The worker registry object address.
*/
workerRegistry: string;
/**
* Allow additional properties beyond the explicitly defined ones
*/
[key: string]: any;
}
/**
* Module options for customizing module creation
*/
interface ModuleOptions {
/** Custom package ID to use instead of default */
packageId: string;
/** Custom objects configuration to use instead of default */
objects: Partial<ObjectOptions>;
}
/**
* Options for initializing the SDK.
*/
interface SdkOptions {
/** The chain for the SDK (default: Chain.SUI) */
chain?: Chain;
/** The Sui client for the SDK */
client: SuiClient;
/** The stage of the SDK (default: Stage.MAINNET) */
stage?: Stage;
/** Custom package addresses to override defaults */
packages?: Partial<PackageOptions>;
/** Custom object addresses to override defaults */
objects?: Partial<ObjectOptions>;
}
/**
* Enum containing all available SDK modules
* Keys are capitalized, values match the actual module names used in the system
*/
declare enum Modules {
Endpoint = "endpoint",
SimpleMessageLib = "simpleMessageLib",
BlockedMessageLib = "blockedMessageLib",
Uln302 = "uln302",
Utils = "utils",
Zro = "zro",
Call = "call",
Treasury = "treasury",
LayerZeroViews = "layerZeroViews",
PtbBuilder = "ptbBuilder",
EndpointPtbBuilder = "endpointPtbBuilder",
SimpleMessageLibPtbBuilder = "simpleMessageLibPtbBuilder",
BlockedMessageLibPtbBuilder = "blockedMessageLibPtbBuilder",
Uln302PtbBuilder = "uln302PtbBuilder",
Oapp = "oapp",
Dvn = "dvn",
DvnFeeLib = "dvnFeeLib",
DvnLayerZero = "dvnLayerZero",
Executor = "executor",
ExecutorFeeLib = "executorFeeLib",
ExecutorLayerZero = "executorLayerZero",
PackageWhitelistValidator = "packageWhitelistValidator",
PriceFeed = "priceFeed",
Counter = "counter",
DvnPtbBuilder = "dvnPtbBuilder",
ExecutorPtbBuilder = "executorPtbBuilder",
WorkerRegistry = "workerRegistry"
}
/**
* Simulation-related type definitions
*/
interface SimulateResult {
value: Uint8Array;
type: string;
}
interface DvnDstConfig {
gas: bigint;
multiplierBps: number;
floorMarginUsd: bigint;
}
interface VerifierFeePaid {
dvn: string;
fee: bigint;
}
interface SetDstConfigEvent {
dvn: string;
dstEid: number;
gas: bigint;
multiplierBps: number;
floorMarginUsd: bigint;
}
declare class MoveAbortError extends Error {
readonly abortCode: number;
constructor(abortCode: number, rawMsg: string);
}
declare class UnclassifiedError extends Error {
}
interface DstConfig {
lzReceiveBaseGas: bigint;
lzComposeBaseGas: bigint;
multiplierBps: number;
floorMarginUsd: bigint;
nativeCap: bigint;
}
interface NativeDropParams {
receiver: string;
amount: bigint;
}
declare const ExecutorOptionType: {
readonly LZRECEIVE: 1;
readonly NATIVE_DROP: 2;
readonly LZCOMPOSE: 3;
readonly ORDERED_EXECUTION: 4;
};
declare const ALL_EXECUTOR_OPTION_TYPES: (1 | 2 | 3 | 4)[];
interface MoveCall {
function: Function;
arguments: Argument[];
type_arguments: string[];
result_ids: Uint8Array[];
is_builder_call: boolean;
}
interface Function {
package: string;
module_name: string;
name: string;
}
type Argument = {
ID: Uint8Array;
} | {
Object: string;
} | {
Pure: Uint8Array;
} | {
NestedResult: [number, number];
};
declare const MAX_BATCH_SIZE = 50;
declare const DEFAULT_SIMULATION_TIMES = 5;
interface BuilderPlaceholderInfo {
index: number;
moveCallCount: number;
}
declare enum ModelType {
DEFAULT = 0,
ARB_STACK = 1,
OP_STACK = 2
}
interface Price {
priceRatio: bigint;
gasPriceInUnit: bigint;
gasPerByte: number;
}
interface ArbitrumPriceExt {
gasPerL2Tx: bigint;
gasPerL1CallDataByte: number;
}
declare enum MessageLibType {
Send = 0,
Receive = 1,
SendAndReceive = 2
}
declare const CONFIG_TYPE: {
readonly EXECUTOR: 1;
readonly SEND_ULN: 2;
readonly RECEIVE_ULN: 3;
};
interface ExecutorConfig {
maxMessageSize: number;
executor: string;
}
interface UlnConfig {
confirmations: bigint;
requiredDvns: string[];
optionalDvns: string[];
optionalDvnThreshold: number;
}
interface OAppUlnConfig {
useDefaultConfirmations: boolean;
useDefaultRequiredDvns: boolean;
useDefaultOptionalDvns: boolean;
ulnConfig: UlnConfig;
}
interface VersionInfo {
major: bigint;
minor: number;
endpointVersion: number;
}
declare enum LzTypeName {
EndpointQuoteParam = "EndpointQuoteParam",
EndpointSendParam = "EndpointSendParam",
MessageLibQuoteParam = "MessageLibQuoteParam",
MessageLibSendParam = "MessageLibSendParam",
MessageLibSetConfigParam = "MessageLibSetConfigParam",
MessagingFee = "MessagingFee",
MessagingReceipt = "MessagingReceipt",
MoveCall = "MoveCall",
EndpointLzReceiveParam = "EndpointLzReceiveParam",
EndpointLzComposeParam = "EndpointLzComposeParam",
CallVoid = "CallVoid",
MessageLibSendResult = "MessageLibSendResult"
}
declare enum CallTypeName {
EndpointQuoteCall = "EndpointQuoteCall",
EndpointSendCall = "EndpointSendCall",
MessageLibSendCall = "MessageLibSendCall",
MessageLibQuoteCall = "MessageLibQuoteCall",
MessageLibSetConfigCall = "MessageLibSetConfigCall",
EndpointLzReceiveCall = "EndpointLzReceiveCall",
EndpointLzComposeCall = "EndpointLzComposeCall"
}
declare const EndpointExecutionState: {
readonly STATE_NOT_EXECUTABLE: 0;
readonly STATE_VERIFIED_BUT_NOT_EXECUTABLE: 1;
readonly STATE_EXECUTABLE: 2;
readonly STATE_EXECUTED: 3;
};
declare const UlnVerificationState: {
readonly STATE_VERIFYING: 0;
readonly STATE_VERIFIABLE: 1;
readonly STATE_VERIFIED: 2;
readonly STATE_NOT_INITIALIZABLE: 3;
};
type EndpointExecutionStateType = (typeof EndpointExecutionState)[keyof typeof EndpointExecutionState];
type UlnVerificationStateType = (typeof UlnVerificationState)[keyof typeof UlnVerificationState];
/**
* Parameters for checking message executability
*/
interface ExecutableParams {
messagingChannel: string | TransactionArgument;
srcEid: number | TransactionArgument;
sender: Uint8Array | TransactionArgument;
nonce: bigint | TransactionArgument;
}
/**
* Parameters for checking message initializability
*/
interface InitializableParams {
messagingChannel: string | TransactionArgument;
srcEid: number | TransactionArgument;
sender: Uint8Array | TransactionArgument;
}
/**
* Parameters for checking message verifiability by endpoint
*/
interface VerifiableParams {
messagingChannel: string | TransactionArgument;
srcEid: number | TransactionArgument;
sender: Uint8Array | TransactionArgument;
nonce: bigint | TransactionArgument;
}
/**
* Parameters for checking ULN verification state
*/
interface UlnVerifiableParams {
verification: string | TransactionArgument;
messagingChannel: string | TransactionArgument;
packetHeaderBytes: Uint8Array | TransactionArgument;
payloadHash: Uint8Array | TransactionArgument;
}
interface MessagingFee {
nativeFee: bigint;
zroFee: bigint;
}
interface Timeout {
expiry: bigint;
fallbackLib: string;
}
/**
* LayerZero protocol version constants
*/
declare const OAppInfoVersion: {
readonly VERSION_1: 1;
readonly VERSION_2: 2;
};
declare const LzReceiveVersion: {
readonly VERSION_1: 1;
};
declare const LzComposeVersion: {
readonly VERSION_1: 1;
};
/**
* Module Manager - Centralized management for all SDK modules
* Uses unified storage for both core modules and cached modules with options
*/
declare class ModuleManager {
packages: PackageOptions;
objects: ObjectOptions;
private storage;
constructor(packages: PackageOptions, objects: ObjectOptions);
/**
* Generate a cache key using hash for modules with options
*/
private generateCacheKey;
private setCoreModules;
/**
* Get module instance (with options), throws error if not found
*/
getModule<T>(moduleName: string, options?: ModuleOptions): T;
/**
* Store module instance (with options)
*/
setModule<T>(moduleName: string, options: ModuleOptions | undefined, instance: T): void;
/**
* Check if module (with options) exists
*/
hasModule(moduleName: string, options?: ModuleOptions): boolean;
/**
* Get module instance or create new one using factory function
*/
getOrCreateModule<T>(moduleName: string, options: ModuleOptions | undefined, factory: () => T): T;
/**
* Get all core modules as an object
*/
getAllCoreModules(): {
[key: string]: unknown;
};
/**
* Clear all modules and cache
*/
clear(): void;
/**
* Remove a module with specific options
*/
removeModule(moduleName: string, options?: ModuleOptions): boolean;
/**
* Initialize all standard LayerZero modules
* @param packages - Package addresses configuration
* @param objects - Object addresses configuration
* @param client - Sui client instance
* @param context - Context object to be populated with module references
*/
initializeCoreModules(packages: PackageOptions, objects: ObjectOptions, client: SuiClient): void;
getEndpoint(): Endpoint;
getSimpleMessageLib(): SimpleMessageLib;
getBlockedMessageLib(): BlockedMessageLib;
getUln302(): Uln302;
getUtils(): Utils;
getZro(): Zro;
getCall(): Call;
getTreasury(): Treasury;
getLayerZeroViews(): LayerZeroViews;
getPtbBuilder(): PtbBuilder;
getOApp(client: SuiClient, callCapId: string, options?: ModuleOptions): OApp;
getCounter(client: SuiClient, options?: ModuleOptions): Counter;
getExecutor(client: SuiClient, options?: ModuleOptions): Executor;
getDvn(client: SuiClient, options?: ModuleOptions): DVN;
getDvnFeeLib(client: SuiClient, options?: ModuleOptions): DVNFeeLib;
getExecutorFeeLib(client: SuiClient, options?: ModuleOptions): ExecutorFeeLib;
getPriceFeed(client: SuiClient, options?: ModuleOptions): PriceFeed;
getDvnLayerZero(client: SuiClient, options?: ModuleOptions): DvnLayerZero;
getExecutorLayerZero(client: SuiClient, options?: ModuleOptions): ExecutorLayerZero;
getDvnPtbBuilder(client: SuiClient, options?: ModuleOptions): DvnPtbBuilder;
getExecutorPtbBuilder(client: SuiClient, options?: ModuleOptions): ExecutorPtbBuilder;
getPackageWhitelistValidator(client: SuiClient, options?: ModuleOptions): PackageWhitelistValidator;
getUln302PtbBuilder(client: SuiClient, options?: ModuleOptions): Uln302PtbBuilder;
getEndpointPtbBuilder(client: SuiClient, options?: ModuleOptions): EndpointPtbBuilder;
getSimpleMessageLibPtbBuilder(client: SuiClient, options?: ModuleOptions): SimpleMessageLibPtbBuilder;
getBlockedMessageLibPtbBuilder(client: SuiClient, options?: ModuleOptions): BlockedMessageLibPtbBuilder;
getWorkerRegistry(client: SuiClient, options?: ModuleOptions): WorkerRegistry;
/**
* Merge objects configuration with options, avoiding unnecessary object spreading
*/
private mergeObjectsOptions;
}
/**
* Represents a move call with its associated object details
*/
interface MoveCallWithObjectDetails {
moveCall: MoveCall;
objectDetails: Map<string, SuiObjectResponse>;
}
interface ObjectFetchOptions {
showOwner?: boolean;
showType?: boolean;
showContent?: boolean;
showBcs?: boolean;
showDisplay?: boolean;
showStorageRebate?: boolean;
}
interface IPTBValidator {
validate(moveCallsWithDetails: MoveCallWithObjectDetails[], sender?: string): void | Promise<void>;
}
declare const EndpointErrorCode: {
readonly MessageLibManager_EAlreadyRegistered: 1;
readonly MessageLibManager_EDefaultReceiveLibUnavailable: 2;
readonly MessageLibManager_EDefaultSendLibUnavailable: 3;
readonly MessageLibManager_EInvalidAddress: 4;
readonly MessageLibManager_EInvalidBounds: 5;
readonly MessageLibManager_EInvalidExpiry: 6;
readonly MessageLibManager_EInvalidReceiveLib: 7;
readonly MessageLibManager_EOnlyNonDefaultLib: 8;
readonly MessageLibManager_EOnlyReceiveLib: 9;
readonly MessageLibManager_EOnlyRegisteredLib: 10;
readonly MessageLibManager_EOnlySendLib: 11;
readonly MessageLibManager_ESameValue: 12;
readonly MessagingChannel_EAlreadyInitialized: 1;
readonly MessagingChannel_EInsufficientNativeFee: 2;
readonly MessagingChannel_EInsufficientZroFee: 3;
readonly MessagingChannel_EInvalidNonce: 4;
readonly MessagingChannel_EInvalidOApp: 5;
readonly MessagingChannel_EInvalidPayloadHash: 6;
readonly MessagingChannel_ENotSending: 7;
readonly MessagingChannel_EPathNotVerifiable: 8;
readonly MessagingChannel_EPayloadHashNotFound: 9;
readonly MessagingChannel_ESendReentrancy: 10;
readonly MessagingChannel_EUninitializedChannel: 11;
readonly MessagingComposer_EComposeExists: 1;
readonly MessagingComposer_EComposeMessageMismatch: 2;
readonly MessagingComposer_EComposeNotFound: 3;
readonly MessagingComposer_EComposerNotRegistered: 4;
readonly MessagingComposer_EComposerRegistered: 5;
readonly OAppRegistry_EOAppNotRegistered: 1;
readonly OAppRegistry_EOAppRegistered: 2;
readonly Endpoint_EAlreadyInitialized: 1;
readonly Endpoint_EInvalidEid: 2;
readonly Endpoint_ENotInitialized: 3;
readonly Endpoint_ERefundAddressNotFound: 4;
readonly Endpoint_EUnauthorizedOApp: 5;
readonly Endpoint_EUnauthorizedSendLibrary: 6;
};
declare class Endpoint {
#private;
private readonly moduleManager;
packageId: string;
readonly client: SuiClient;
private readonly objects;
constructor(packageId: string, client: SuiClient, objects: ObjectOptions, moduleManager: ModuleManager);
/**
* Initialize the endpoint with an Endpoint ID (EID)
* @param tx - The transaction to add the move call to
* @param eid - The endpoint ID to initialize or transaction argument
*/
initEidMoveCall(tx: Transaction, eid: number | TransactionArgument): void;
/**
* Register an OApp with the endpoint
* @param tx - The transaction to add the move call to
* @param oappCap - The OApp capability object ID or transaction argument
* @param oappInfo - OApp information including lz_receive execution information
* @returns Transaction result containing the messaging channel address
*/
registerOAppMoveCall(tx: Transaction, oappCap: string | TransactionArgument, oappInfo: Uint8Array | TransactionArgument): TransactionResult;
/**
* Set a delegate for an OApp
* @param tx - The transaction to add the move call to
* @param oappCap - The OApp capability object ID or transaction argument
* @param newDelegate - The new delegate address or transaction argument
*/
setDelegateMoveCall(tx: Transaction, oappCap: string | TransactionArgument, newDelegate: string | TransactionArgument): void;
/**
* Set OApp information for an OApp
* @param tx - The transaction to add the move call to
* @param callerCap - The caller capability object ID or transaction argument
* @param oapp - The OApp address or transaction argument
* @param oappInfo - The OApp information including lz_receive execution information as bytes or transaction argument
*/
setOappInfoMoveCall(tx: Transaction, callerCap: string | TransactionArgument, oapp: string | TransactionArgument, oappInfo: Uint8Array | TransactionArgument): void;
/**
* Initialize a messaging channel between local and remote OApps
* @param tx - The transaction to add the move call to
* @param callerCap - The caller capability object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param remoteEid - The remote endpoint ID or transaction argument
* @param remoteOapp - The remote OApp address as bytes or transaction argument
*/
initChannelMoveCall(tx: Transaction, callerCap: string | TransactionArgument, messagingChannel: string | TransactionArgument, remoteEid: number | TransactionArgument, remoteOapp: Uint8Array | TransactionArgument): void;
/**
* Quote the messaging fee for sending a message
* @param tx - The transaction to add the move call to
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param call - The call transaction result
* @returns Transaction result containing the quote
*/
quoteMoveCall(tx: Transaction, messagingChannel: string | TransactionArgument, call: TransactionArgument): TransactionResult;
/**
* Confirm quote operation with message library
* @param tx - The transaction to add the move call to
* @param endpointCall - The endpoint call transaction result or transaction argument
* @param messageLibCall - The message library call transaction result or transaction argument
*/
confirmQuoteMoveCall(tx: Transaction, endpointCall: TransactionArgument, messageLibCall: TransactionArgument): void;
/**
* Send a message through the messaging channel
* @param tx - The transaction to add the move call to
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param call - The call transaction result
* @returns Transaction result containing the send operation
*/
sendMoveCall(tx: Transaction, messagingChannel: string | TransactionArgument, call: TransactionArgument): TransactionResult;
/**
* Confirm send operation with send library
* @param tx - The transaction to add the move call to
* @param sendLibrary - The send library object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param endpointCall - The endpoint call transaction result
* @param sendLibraryCall - The send library call transaction result
* @returns Transaction result containing the confirmed send operation
*/
confirmSendMoveCall(tx: Transaction, sendLibrary: string | TransactionArgument, messagingChannel: string | TransactionArgument, endpointCall: TransactionArgument, sendLibraryCall: TransactionArgument): TransactionResult;
/**
* Refund fees from a send operation
* @param tx - The transaction to add the move call to
* @param sendCall - The send call transaction result or transaction argument
* @returns Transaction result containing the refund operation
*/
refundMoveCall(tx: Transaction, sendCall: TransactionArgument): void;
/**
* Verify a message from another chain
* @param tx - The transaction to add the move call to
* @param receiveLibrary - The receive library object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param srcEid - The source endpoint ID or transaction argument
* @param sender - The sender address as bytes or transaction argument
* @param nonce - The message nonce or transaction argument
* @param payloadHash - The payload hash as bytes or transaction argument
*/
verifyMoveCall(tx: Transaction, receiveLibrary: string | TransactionArgument, messagingChannel: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument, payloadHash: Uint8Array | TransactionArgument): void;
/**
* Clear a verified message by executing it
* @param tx - The transaction to add the move call to
* @param caller - The caller object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param srcEid - Source endpoint ID or transaction argument
* @param sender - Sender address as bytes or transaction argument
* @param nonce - Message nonce or transaction argument
* @param guid - Globally unique identifier as bytes or transaction argument
* @param message - Message payload as bytes or transaction argument
*/
clearMoveCall(tx: Transaction, caller: string | TransactionArgument, messagingChannel: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument, guid: Uint8Array | TransactionArgument, message: Uint8Array | TransactionArgument): void;
/**
* Skip a message (mark as processed without execution)
* @param tx - The transaction to add the move call to
* @param caller - The caller object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param srcEid - Source endpoint ID or transaction argument
* @param sender - Sender address as bytes or transaction argument
* @param nonce - Message nonce or transaction argument
*/
skipMoveCall(tx: Transaction, caller: string | TransactionArgument, messagingChannel: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument): void;
/**
* Nilify a message (clear without execution)
* @param tx - The transaction to add the move call to
* @param caller - The caller object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param srcEid - Source endpoint ID or transaction argument
* @param sender - Sender address as bytes or transaction argument
* @param nonce - Message nonce or transaction argument
* @param payloadHash - Message payload hash as bytes or transaction argument
*/
nilifyMoveCall(tx: Transaction, caller: string | TransactionArgument, messagingChannel: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument, payloadHash: Uint8Array | TransactionArgument): void;
/**
* Burn a message (permanently remove)
* @param tx - The transaction to add the move call to
* @param caller - The caller object ID or transaction argument
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param srcEid - Source endpoint ID or transaction argument
* @param sender - Sender address as bytes or transaction argument
* @param nonce - Message nonce or transaction argument
* @param payloadHash - Message payload hash as bytes or transaction argument
*/
burnMoveCall(tx: Transaction, caller: string | TransactionArgument, messagingChannel: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument, payloadHash: Uint8Array | TransactionArgument): void;
/**
* Execute a LayerZero receive operation
* @param tx - The transaction to add the move call to
* @param executorCallCap - The executor call capability
* @param messagingChannel - The messaging channel object ID or transaction argument
* @param srcEid - The source endpoint ID or transaction argument
* @param sender - The sender address as bytes or transaction argument
* @param nonce - The message nonce or transaction argument
* @param guid - The globally unique identifier as bytes or transaction argument
* @param message - The message payload as bytes or transaction argument
* @param extraData - Additional data as bytes or transaction argument (optional)
* @param value - The native token value to transfer or transaction argument
* @returns Transaction result containing the receive operation
*/
lzReceiveMoveCall(tx: Transaction, executorCallCap: TransactionArgument, messagingChannel: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument, guid: Uint8Array | TransactionArgument, message: Uint8Array | TransactionArgument, extraData: Uint8Array | TransactionArgument | undefined, value: bigint | number | string | TransactionArgument): TransactionResult;
/**
* Send alert for failed LayerZero receive operation
* @param tx - The transaction to add the move call to
* @param executor - The executor object ID or transaction argument
* @param srcEid - Source endpoint ID or transaction argument
* @param sender - Sender address as bytes or transaction argument
* @param nonce - Message nonce or transaction argument
* @param receiver - Receiver address or transaction argument
* @param guid - Globally unique identifier as bytes or transaction argument
* @param gas - Gas amount for execution or transaction argument
* @param value - Native token value or transaction argument
* @param message - Message payload as bytes or transaction argument
* @param extraData - Additional execution data as bytes or transaction argument
* @param reason - Failure reason or transaction argument
*/
lzReceiveAlertMoveCall(tx: Transaction, executor: string | TransactionArgument, srcEid: number | TransactionArgument, sender: Uint8Array | TransactionArgument, nonce: bigint | number | string | TransactionArgument, receiver: string | TransactionArgument, guid: Uint8Array | TransactionArgument, gas: bigint | number | string | TransactionArgument, value: bigint | number | string | TransactionArgument, message: Uint8Array | TransactionArgument, extraData: Uint8Array | TransactionArgument, reason: string | TransactionArgument): void;
/**
* Register a composer with the endpoint
* @param tx - The transaction to add the move call to
* @param composerCap - The composer capability object ID or transaction argument
* @param composerInfo - Composer information including lz_compose execution information as bytes
* @returns Transaction result containing the compose queue address
*/
registerComposerMoveCall(tx: Transaction, composerCap: string | TransactionArgument, composerInfo: Uint8Array | TransactionArgument): TransactionResult;
/**
* Set composer information for a composer
* @param tx - The transaction to add the move call to
* @param composerCap - The composer capability object ID or transaction argument
* @param composerInfo - Composer information including lz_compose execution information as bytes or transaction argument
*/
setComposerInfoMoveCall(tx: Transaction, composerCap: string | TransactionArgument, composerInfo: Uint8Array | TransactionArgument): void;
/**
* Send compose message to queue
* @param tx - The transaction to add the move call to
* @param from - The sender object ID or transaction argument
* @param composeQueue - The compose queue object ID or transaction argument
* @param guid - Globally unique identifier as bytes or transaction argument
* @param index - Compose message index or transaction argument
* @param message - Message payload as bytes or transaction argument
*/
sendComposeMoveCall(tx: Transaction, from: string | TransactionArgument, composeQueue: string | TransactionArgument, guid: Uint8Array | TransactionArgument, index: number | TransactionArgument, message: Uint8Array | TransactionArgument): void;
/**
* Execute LayerZero compose operation
* @param tx - The transaction to add the move call to
* @param executorCallCap - The executor call capability
* @param composeQueue - The compose queue object ID or transaction argument
* @param from - Source address or transaction argument
* @param guid - Globally unique identifier as bytes or transaction argument
* @param index - Compose message index or transaction argument
* @param message - Message payload as bytes or transaction argument
* @param extraData - Additional execution data as bytes or transaction argument (optional)
* @param value - Native token value to transfer or transaction argument
* @returns Transaction result containing the compose operation
*/
lzComposeMoveCall(tx: Transaction, executorCallCap: TransactionArgument, composeQueue: string | TransactionArgument, from: string | TransactionArgument, guid: Uint8Array | TransactionArgument, index: number | TransactionArgument, message: Uint8Array | TransactionArgument, extraData: Uint8Array | TransactionArgument | undefined, value: bigint | number | string | TransactionArgument): TransactionResult;
/**
* Send alert for failed LayerZero compose operation
* @param tx - The transaction to add the move call to
* @param executor - The executor object ID or transaction argument
* @param from - Source address or transaction argument
* @param to - Destination address or transaction argument
* @param guid - Globally unique identifier as bytes or transaction argument
* @param index - Compose message index or transaction argument
* @param gas - Gas amount for execution or transaction argument
* @param value - Native token value or transaction argument
* @param message - Message payload as bytes or transaction argument
* @param extraData - Additional execution data as bytes or transaction argument
* @param reason - Failure reason or transaction argument
*/
lzComposeAlertMoveCall(tx: Transaction, executor: string | TransactionArgument, from: string | TransactionArgument, to: string | TransactionArgument, guid: Uint8Array | TransactionArgument, index: number | TransactionArgument, gas: bigint | number | string | TransactionArgument, value: bigint | number | string | TransactionArgument, message: Uint8Array | TransactionArgument, extraData: Uint8Array | TransactionArgument, reason: string | TransactionArgument): void;
/**
* Set the send library for an OApp to a specific destination
* @param tx - The transaction to add the move call to
* @param caller - The caller capability object ID or transaction argument
* @param sender - The sender OApp address or transaction argument
* @param dstEid - The destination endpoint ID or transaction argument
* @param newLib - The new send library address or transaction argument
*/
setSendLibraryMoveCall(tx: Transaction, caller: string | TransactionArgument, sender: string | TransactionArgument, dstEid: number | TransactionArgument, newLib: string | TransactionArgument): void;
/**
* Set the receive library for an OApp from a specific source
* @param tx - The transaction to add the move call to
* @param caller - The caller capability object ID or transaction argument
* @param receiver - The receiver OApp address or transaction argument
* @param srcEid - The source endpoint ID or transaction argument
* @param newLib - The new receive library address or transaction argument
* @param gracePeriod - The grace period in seconds or transaction argument
*/
setReceiveLibraryMoveCall(tx: Transaction, caller: string | TransactionArgument, receiver: string | TransactionArgument, srcEid: number | TransactionArgument, newLib: string | TransactionArgument, gracePeriod: number | string | bigint | TransactionArgument): void;
/**
* Set timeout for receive library transition
* @param tx - The transaction to add the move call to
* @param caller - The caller capability object ID or transaction argument
* @param receiver - The receiver OApp address or transaction argument
* @param srcEid - Source endpoint ID or transaction argument
* @param lib - The library address or transaction argument
* @param expiry - Timeout expiry timestamp or transaction argument
*/
setReceiveLibraryTimeoutMoveCall(tx: Transaction, caller: string | TransactionArgument, receiver: string | TransactionArgument, srcEid: number | TransactionArgument, lib: string | TransactionArgument, expiry: number | string | bigint | TransactionArgument): void;
/**
* Set configuration for an OApp's message library
* @param tx - The transaction to add the move call to
* @param caller - The caller object ID or transaction argument
* @param oapp - The OApp address or transaction argument
* @param lib - The message library address or transaction argument
* @param eid - Endpoint ID or transaction argument
* @param config_type - Configuration type identifier or transaction argument
* @param config - Configuration data as bytes or transaction argument
* @returns Transaction result containing the configuration operation
*/
setConfigMoveCall(tx: Transaction, caller: string | TransactionArgument, oapp: string | TransactionArgument, lib: string | TransactionArgument, eid: number | TransactionArgument, config_type: number | TransactionArgument, config: Uint8Array | TransactionArgument): TransactionResult;
/**
* Register a message library with the endpoint (admin only)
* @param tx - The transaction to add the move call to
* @param messageLibCap - The message library capability address or transaction argument
* @param messageLibType - The type of message library (Send, Receive, or SendAndReceive)
*/
registerLibraryMoveCall(tx: Transaction, messageLibCap: string | TransactionArgument, messageLibType: MessageLibType): void;
/**
* Set default send library for a destination EID (admin only)
* @param tx - The transaction to add the move call to
* @param dstEid - Destination endpoint ID
* @param newLib - The new default send library address
*/
setDefaultSendLibraryMoveCall(tx: Transaction, dstEid: number | TransactionArgument, newLib: string | TransactionArgument): void;
/**
* Set default receive library for a source EID (admin only)
* @param tx - The transaction to add the move call to
* @param srcEid - Source endpoint ID
* @param newLib - The new default receive library address
* @param gracePeriod - Grace period in seconds for library transition
*/
setDefaultReceiveLibraryMoveCall(tx: Transaction, srcEid: number | TransactionArgument, newLib: string | TransactionArgument, gracePeriod: number | string | bigint | TransactionArgument): void;
/**
* Set timeout for default receive library transition (admin only)
* @param tx - The transaction to add the move call to
* @param srcEid - Source endpoint ID
* @param lib - The library address
* @param expiry - Timeout expiry timestamp
*/
setDefaultReceiveLibraryTimeoutMoveCall(tx: Transaction, srcEid: number | TransactionArgument, lib: string | TransactionArgument, expiry: number | string | bigint | TransactionArgument): void;
/**
* Create message library type move call
* @param tx - The transaction to add the move call to
* @param messageLibType - The message library type enum value
* @returns Transaction result containing the library type
*/
messageLibTypeMoveCall(tx: Transaction, messageLibType: MessageLibType): TransactionResult;
/**
* Get the Endpoint ID (EID) of the current chain
* @param tx - The transaction to add the move call to
* @returns Transaction result containing the EID
*/
eidMoveCall(tx: Transaction): TransactionResult;
/**
* Get the Endpoint ID (EID) of the current chain
* @returns The endpoint ID, or 0 if not initialized
*/
eid(): Promise<number>;
/**
* Check if an OApp is registered with the endpoint
* @param tx - The transaction to add the move call to
* @param oapp - The OApp address to check or transaction argument
* @returns Transaction result containing the registration status
*/
isOappRegisteredMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult;
/**
* Check if an OApp is registered with the endpoint
* @param oapp - The OApp address to check
* @returns True if the OApp is registered, false otherwise
*/
isOappRegistered(oapp: string): Promise<boolean>;
/**
* Get messaging channel for an OApp
* @param tx - The transaction to add the move call to
* @param oapp - The OApp address or transaction argument
* @returns Transaction result containing the messaging channel address
*/
getMessagingChannelMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult;
/**
* Get the messaging channel for an OApp
* @param oapp - The OApp address
* @returns The messaging channel address
*/
getMessagingChannel(oapp: string): Promise<string>;
/**
* Get OApp information for an OApp
* @param tx - The transaction to add the move call to
* @param oapp - The OApp address or transaction argument
* @returns Transaction result containing the OApp information including lz_receive execution information
*/
getOappInfoMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult;
/**
* Get OApp information for an OApp
* @param oapp - The OApp address
* @returns Promise<Uint8Array> - The OApp information including lz_receive execution information as bytes
*/
getOappInfo(oapp: string): Promise<Uint8Array>;
/**
* Get delegate address for an OApp
* @param tx - The transaction to add the move call to
* @param oapp - The OApp address or transaction argument
* @returns Transaction result containing the delegate address
*/
getDelegateMoveCall(tx: Transaction, oapp: string | TransactionArgument): TransactionResult;
/**
* Get delegate address for an OApp
* @param oapp - The OApp address
* @returns Promise<string> - The delegate address
*/
getDelegate(oapp: string): Promise<string>;
/**
* Check if a composer is registered with the endpoint
* @param tx - The transaction to add the move call to
* @param composer - The composer address or transaction argument
* @returns Transaction result containing the registration status
*/
isComposerRegisteredMoveCall(tx: Transaction, composer: string | TransactionArgument): TransactionResult;
/**
* Check if a composer is registered with the endpoint
* @param composer - The composer address
* @returns Promise<boolean> - True if the composer is registered
*/
isComposerRegistered(composer: string): Promise<boolean>;
/**
* Get compose queue address for a composer
* @param tx - The transaction to add the move call to
* @param composer - The composer address or transaction argument
* @returns Transaction result containing the compose queue address
*/
getComposeQueueMoveCall(tx: Transaction, composer: string | TransactionArgument): TransactionResult;
/**
* Get compose queue address for a composer
* @param composer - The composer address
* @returns Promise<string> - The compose queue address
*/
getComposeQueue(composer: string): Promise<string>;
/**
* Get composer information for a registered composer
* @param tx - The transaction to add the move call to
* @param composer - The composer address or transaction argument
* @returns Transaction result containing the composer information
*/
getComposerInfoMoveCall(tx: Transaction, composer: string | TransactionArgument): TransactionResult;
/**
* Get composer information for a registered composer
* @param composer - The composer address
* @returns Promise<Uint8Array> - The composer information as bytes
*/
getComposerInfo(composer: string): Promise<Uint8Array>;
/**
* Get composer address from compose queue
* @param tx - The transaction to add the move call to
* @param composeQueue - The compose queue object ID or transaction argument
* @returns Transaction result containing the composer address
*/
getComposerMoveCall(tx: Transaction, composeQueue: string | TransactionArgument): TransactionResult;
/**
* Get composer address from compose queue
* @param composeQueue - The compose queue object ID
* @returns Promise<string> - The composer address
*/
getComposer(composeQueue: string): Promise<string>;
/**
* Check if compose message hash exists
* @param tx - The transaction to add the move call to
* @param composeQueue - The compose queue object ID
* @param from - Sender address
* @param guid - Globally unique identifier as bytes
* @param index - Compose message index
* @returns Transaction result containing the message hash existence status
*/
hasComposeMessageHashMoveCall(tx: Transaction, composeQueue: string | TransactionArgument, from: string | TransactionArgument, guid: Uint8Array | TransactionArgument, index: number | TransactionArgument): TransactionResult;
/**
* Check if compose message hash exists
* @param composeQueue - The compose queue object ID
* @param from - Sender address
* @param guid - Globally unique identifier as bytes
* @param index - Compose message index
* @returns Promise<boolean> - True if message hash exists
*/
hasComposeMessageHash(composeQueue: string, from: string, guid: Uint8Array, index: number): Promise<boolean>;
/**
* Get compose message hash
* @param tx - The transaction to add the move call to
* @param composeQueue - The compose queue object ID
* @param from - Sender address
* @param guid - Globally unique identifier as bytes
* @param index - Compose message index
* @returns Transaction result containing the message hash
*/
getComposeMessageHashMoveCall(tx: Transaction, composeQueue: string | TransactionArgument, from: string | TransactionArgument, guid: Uint8Array | TransactionArgument, index: number | TransactionArgument): TransactionResult;
/**
* Get compose message hash
* @param composeQueue - The compose queue object ID
* @param from - Sender address
* @param guid - Globally unique identifier as bytes
* @param index - Compose message index
* @returns Promise<Uint8Array> - The message hash as bytes
*/
getComposeMessageHash(composeQueue: string, from: string, guid: Uint8Array, index: number): Promise<Uint8Array>;
/**
* Get count of registered message libraries
* @param tx - The transaction to add the move call to
* @returns Transaction result containing the count of registered libraries
*/
registeredLibrariesCountMoveCall(tx: Transaction): TransactionResult;
/**
* Get count of registered message libraries
* @returns Promise<bigint> - The number of registered libraries
*/
registeredLibrariesCount(): Promise<bigint>;
/**
* Get list of registered message libraries with pagination
* @param tx - The transaction to add the move call to
* @param start - Start index for pagination or transaction argument
* @param maxCount - Maximum count to return or transaction argument
* @returns Transaction result containing array of library addresses
*/
registeredLibrariesMoveCall(tx: Transaction, start: bigint | TransactionArgument, maxCount: bigint | TransactionArgument): TransactionResult;
/**
* Get list of registered message libraries with pagination
* @param start - Start index for pagination
* @param maxCount - Maximum count to return
* @returns Promise<string[]> - Array of registered library addresses
*/
registeredLibraries(start: bigint, maxCount: bigint): Promise<string[]>;
/**
* Check if a message library is registered
* @param tx - The transaction to add the move call to
* @param messageLib - The message library address or transaction argument
* @returns Transaction result containing the registr