///
///
///
import { Buffer } from "buffer";
import { Program, BN, IdlTypes, Idl } from "@coral-xyz/anchor";
import { PublicKey, AccountMeta, Transaction } from "@solana/web3.js";
import { MethodsBuilder } from "@coral-xyz/anchor/dist/cjs/program/namespace/methods";
import { DebridgeProgram } from "./idl/debridge_program_v31";
import { DebridgeSettingsProgram } from "./idl/debridge_settings_program_v31";
import { DecodeType, IdlField } from "./interfaces";
type IxByName = I["instructions"][number] & {
name: IxName;
};
type ArgsData> = {
[K in IxArgs[number] as K["name"]]: K extends IdlField ? DecodeType : unknown;
};
type ArgsDataObject = ArgsData["args"]>;
type ArgsDataInput = CustomArgsTuple["args"], IdlTypes>;
type CustomArgsTuple = {
[K in keyof A]: [A[K]["name"], A[K] extends IdlField ? DecodeType : unknown];
} & unknown[];
type MethodBuilder = MethodsBuilder;
export declare class InstructionBuilder {
private context;
private data;
readonly remainingAccounts?: AccountMeta[] | undefined;
private builder;
private creationFees;
constructor(builderMethod: Program["methods"][IxName], context: Parameters["accountsStrict"]>[0], data: ArgsDataInput, remainingAccounts?: AccountMeta[] | undefined);
get accounts(): import("@coral-xyz/anchor").Accounts<(I["instructions"][number] & {
name: IxName;
})["accounts"][number]>;
get args(): ArgsDataObject;
instruction(): Promise;
set accountsCreationFees(lamports: bigint);
get accountsCreationFees(): bigint;
}
export declare class TransactionBuilder {
readonly instructions: InstructionBuilder[];
constructor(instructions?: InstructionBuilder[]);
add(instruction: InstructionBuilder): void;
transaction(): Promise;
}
export declare function initNonceMasterInstruction(program: Program, context: {
nonceStorage: PublicKey;
payer: PublicKey;
}): InstructionBuilder;
export interface ExecExternalCallContextType {
state: PublicKey;
externalCallStorage: PublicKey;
externalCallMeta: PublicKey;
bridge: PublicKey;
originalClaimer: PublicKey;
submission: PublicKey;
submissionAuth: PublicKey;
submissionWallet: PublicKey;
rewardBeneficiaryWallet: PublicKey;
executor: PublicKey;
fallbackAddress: PublicKey;
fallbackAddressWallet: PublicKey;
tokenMint: PublicKey;
}
export interface ExecExternalCallParamsType {
submissionId: Buffer;
count: number;
subsitutionBumps: Buffer;
}
export declare function executeExternalCallInstruction(program: Program, context: ExecExternalCallContextType, params: ExecExternalCallParamsType, remainingAccounts?: AccountMeta[]): InstructionBuilder;
export interface InitSendBridgeContextType {
bridgeData: PublicKey;
bridgeIdMap: PublicKey;
state: PublicKey;
stakingWallet: PublicKey;
tokenMint: PublicKey;
tokenMetadata: PublicKey;
mintAuthority: PublicKey;
payer: PublicKey;
}
export declare function initializeSendBridgeInstruction(settingsProgram: Program, context: InitSendBridgeContextType): InstructionBuilder;
export interface InitializeMintBridgeContextType {
bridgeData: PublicKey;
state: PublicKey;
feeBeneficiary: PublicKey;
payer: PublicKey;
tokenMint: PublicKey;
mintAuthority: PublicKey;
confirmationStorage: PublicKey;
confirmationStorageCreator: PublicKey;
tokenMetadata: PublicKey;
tokenMetadataMaster: PublicKey;
}
export interface InitializeMintBridgeParamsType {
chainId: Buffer;
nativeTokenAddress: Buffer;
tokenName: string;
tokenSymbol: string;
decimals: number;
}
export declare function initializeMintBridgeInstruction(settingsProgram: Program, context: InitializeMintBridgeContextType, params: InitializeMintBridgeParamsType): InstructionBuilder;
export interface UpdateFeeBridgeInfoParamsType {
targetChainId: Buffer;
chainFee: BN;
}
export interface UpdateFeeBridgeInfoContextType {
bridgeData: PublicKey;
tokenMint: PublicKey;
state: PublicKey;
bridgeFee: PublicKey;
payer: PublicKey;
}
export declare function updateFeeBridgeInfoInstruction(settingsProgram: Program, context: UpdateFeeBridgeInfoContextType, params: UpdateFeeBridgeInfoParamsType): InstructionBuilder;
export interface InitChainSupportInfoParamsType {
targetChainId: Buffer;
isSupported: boolean;
fixedFee?: BN;
transferFee?: BN;
chainAddressLen: number;
}
export interface InitChainSupportInfoContextType {
state: PublicKey;
protocolAuthority: PublicKey;
payer: PublicKey;
chainSupportInfo: PublicKey;
}
export declare function initChainSupportInfoInstruction(settingsProgram: Program, context: InitChainSupportInfoContextType, params: InitChainSupportInfoParamsType): import("@solana/web3.js").TransactionInstruction;
export interface SendParamsType {
chainIdBuffer: Buffer;
amount: BN;
receiver: Buffer;
useAssetFee: boolean;
referralCode?: number;
submissionParams?: {
externalCallShortcut: Buffer;
reservedFlag: Buffer;
executionFee: BN;
fallbackAddress: Buffer;
};
}
export interface SendContextType {
bridge: PublicKey;
tokenMint: PublicKey;
stakingWallet: PublicKey;
mintAuthority: PublicKey;
chainSupportInfo: PublicKey;
bridgeFee: PublicKey;
discount: PublicKey;
sendFromWallet: PublicKey;
nonceStorage: PublicKey;
state: PublicKey;
feeBeneficiary: PublicKey;
sendFrom: PublicKey;
externalCallStorage: PublicKey;
externalCallMeta: PublicKey;
settingsProgram: PublicKey;
}
export declare function sendInstruction(program: Program, context: SendContextType, params: SendParamsType): InstructionBuilder;
export interface ClaimContextType {
bridgeData: PublicKey;
submissionAddr: PublicKey;
tokenMint: PublicKey;
mintAuthority: PublicKey;
stakingWallet: PublicKey;
chainSupportInfo: PublicKey;
claimToWallet: PublicKey;
fallbackAddress: PublicKey;
receiver: PublicKey;
confirmationStorage: PublicKey;
confirmationStorageCreator: PublicKey;
executor: PublicKey;
payerWallet: PublicKey;
externalCallStorage: PublicKey;
externalCallMeta: PublicKey;
claimMarker: PublicKey;
state: PublicKey;
feeBeneficiary: PublicKey;
settingsProgram: PublicKey;
}
export interface ClaimSubmissionParamsInputType {
executionFee: Buffer;
reservedFlag: Buffer;
nativeSender: Buffer;
externalCallShortcut: Buffer;
}
export interface ClaimParamsType {
sourceChainId: Buffer;
amount: Buffer;
nonce: Buffer;
submissionParams?: ClaimSubmissionParamsInputType;
}
export declare function claimInstrution(program: Program, context: ClaimContextType, params: ClaimParamsType): InstructionBuilder;
export interface DataChunk {
data: Buffer;
offset: number;
}
export interface ExtCallStorageContextType {
externalCallStorage: PublicKey;
externalCallMeta: PublicKey;
claimer: PublicKey;
}
export interface InitExtCallStorageParamsType {
externalCallLen: number;
sourceChainId: Buffer;
storageKey: Buffer;
rawInstructions: Buffer;
}
export interface InitOrUpdateExtCallStorageParamsType extends InitExtCallStorageParamsType {
externalInstructionsOffset: number;
}
export declare function initExternalCallStorageInstruction(program: Program, context: ExtCallStorageContextType, params: InitExtCallStorageParamsType): InstructionBuilder;
export declare function initOrUpdateExternalCallStorage(program: Program, context: ExtCallStorageContextType, params: InitOrUpdateExtCallStorageParamsType): InstructionBuilder;
export interface ExtendExtCallStorageParamsType {
sourceChainId: Buffer;
submissionId: Buffer;
rawInstructions: DataChunk;
}
export declare function updateExternalCallStorageInstruction(program: Program, context: ExtCallStorageContextType, params: ExtendExtCallStorageParamsType): InstructionBuilder;
export interface StoreSignaturesContextType {
state: PublicKey;
confirmationStorage: PublicKey;
payer: PublicKey;
}
export interface StoreSignaturesParamsType {
message: Buffer;
}
export declare function storeConfirmationsInstruction(settingsProgram: Program, context: StoreSignaturesContextType, params: StoreSignaturesParamsType): InstructionBuilder;
export interface ResetFreezeAuthorityBatchRemainingAccountsContext {
tokenMint: PublicKey;
bridgeData: PublicKey;
}
export declare function resetFreezeAuthorityBatch(settingsProgram: Program, remainingAccounts: ResetFreezeAuthorityBatchRemainingAccountsContext): InstructionBuilder;
interface FallbackParamsType {
submissionId: Buffer;
submissionAuthBump: number;
}
interface FallbackContextType {
submission: PublicKey;
submissionAuth: PublicKey;
originalClaimer: PublicKey;
externalCallStorage: PublicKey;
externalCallMeta: PublicKey;
fallbackAddressWallet: PublicKey;
tokenMint: PublicKey;
}
interface SendToFallbackContextType extends FallbackContextType {
submissionAuthLostWallet: PublicKey;
}
export declare function buildCloseSubmissionAuthWalletInstruction(program: Program, context: SendToFallbackContextType, params: FallbackParamsType): InstructionBuilder;
interface MakeFallbackForExternalCallContextType extends FallbackContextType {
state: PublicKey;
bridge: PublicKey;
submissionWallet: PublicKey;
rewardBeneficiaryWallet: PublicKey;
executor: PublicKey;
fallbackAddress: PublicKey;
}
export declare function buildMakeFallbackForExternalCallInstruction(program: Program, context: MakeFallbackForExternalCallContextType, params: FallbackParamsType): InstructionBuilder;
type CloseExtCallStorageType = {
chainId: Buffer;
submissionId: Buffer;
};
type CloseExtCallStorageContextType = {
claimer: PublicKey;
externalCallMeta: PublicKey;
externalCallStorage: PublicKey;
};
export declare function buildCloseExternalCallStorageInstruction(program: Program, context: CloseExtCallStorageContextType, params: CloseExtCallStorageType): InstructionBuilder;
export {};
//# sourceMappingURL=instructions.d.ts.map