UNPKG

@debridge-finance/solana-contracts-client

Version:
1,255 lines 61.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IDL = void 0; exports.IDL = { accounts: [ { discriminator: [112, 19, 68, 142, 48, 200, 150, 116], name: "claimMarker", }, { discriminator: [52, 154, 212, 31, 208, 203, 151, 253], name: "externalCallMeta", }, { discriminator: [198, 198, 189, 121, 154, 196, 141, 248], name: "externalCallStorage", }, { discriminator: [197, 101, 66, 57, 79, 93, 78, 181], name: "nonceMaster", }, { discriminator: [254, 14, 34, 50, 170, 36, 60, 191], name: "submissionAccount" }, ], address: "DEbrdGj3HsRsAzx6uH4MKyREKxVAfBydijLUF3ygsFfh", constants: [], errors: [ { code: 20096, name: "AmountTooBig" }, { code: 20097, name: "BadNonce" }, { code: 20098, name: "CantCreateNonceMasterAccount", }, { code: 20099, name: "ChainNotSupported" }, { code: 20100, name: "ConfirmationStorageNotEmpty", }, { code: 20101, name: "ExecuteExpensesError" }, { code: 20102, name: "ExternalCallDataTooBig", }, { code: 20103, name: "ExternalCallMetaAlreadyInitialized" }, { code: 20104, name: "ExternalCallMetaNotInitialized", }, { code: 20105, name: "ExternalCallStorageNotInitialized" }, { code: 20106, name: "ExternalInstructionCorrupted", }, { code: 20107, name: "ExternalCallToBig" }, { code: 20108, name: "FeeTooHigh" }, { code: 20109, name: "InvalidExecutor", }, { code: 20110, name: "InvalidClaimToWallet" }, { code: 20111, name: "InvalidFallbackWallet", }, { code: 20112, name: "InvalidNonceMasterKey" }, { code: 20113, name: "InvalidPayerToWallet", }, { code: 20114, name: "InvalidReceiver" }, { code: 20115, name: "InvalidRewardBeneficiaryWallet", }, { code: 20116, name: "InvalidSubmissionId" }, { code: 20117, name: "InvalidSubmissionWallet", }, { code: 20118, name: "NotEnoughAmountForReward" }, { code: 20119, name: "SubmissionCalculationError", }, { code: 20120, name: "SubmissionConfirmed" }, { code: 20121, name: "WrongAmount" }, { code: 20122, name: "WrongBridgeFeeInfo", }, { code: 20123, name: "WrongChainSupportAccount" }, { code: 20124, name: "WrongExecutionFee", }, { code: 20125, name: "WrongExternalCallMeta" }, { code: 20126, name: "WrongExternalCallStorage", }, { code: 20137, name: "WrongExternalCallUpdate" }, { code: 20127, name: "WrongReceiverAddress", }, { code: 20128, name: "WrongFallbackAddress" }, { code: 20129, name: "WrongFeeBeneficiaryWallet", }, { code: 20130, name: "WrongMintAuthority" }, { code: 20131, name: "WrongNativeSenderLen" }, { code: 20132, name: "WrongSentEvent", }, { code: 20133, name: "WrongStakingWallet" }, { code: 20134, name: "WrongTargetChainId" }, { code: 20135, name: "WrongTokenMintBridge", }, { code: 20136, name: "SendHashedDataNeededForShortcut" }, { code: 20138, name: "SubstitutionError", }, { code: 20139, name: "MandatoryBlockError" }, { code: 20140, name: "WrongAccountForExternalCall" }, ], events: [ { discriminator: [221, 78, 32, 86, 187, 209, 93, 104], name: "Log", }, { discriminator: [21, 132, 239, 64, 146, 239, 166, 68], name: "Transferred", }, { discriminator: [250, 106, 162, 85, 133, 184, 176, 118], name: "Bridged", }, { discriminator: [231, 114, 125, 58, 137, 248, 148, 201], name: "BalanceChanged", }, { discriminator: [25, 26, 52, 216, 177, 97, 212, 213], name: "ExternalCallExecuted", }, { discriminator: [77, 119, 141, 22, 4, 79, 135, 252], name: "ExternalCallFinished", }, { discriminator: [41, 96, 203, 229, 203, 101, 234, 182], name: "ExternalCallFailed" }, ], instructions: [ { accounts: [ { docs: ["The task of this account is to store the Nonce, which is necessary for the uniqueness of each Send"], name: "nonceStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: [], name: "payer", optional: false, relations: [], signer: true, writable: true, }, { docs: [], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [], discriminator: [110, 247, 159, 129, 1, 49, 69, 65], name: "initNonceMaster", }, { accounts: [ { accounts: [ { docs: [ "The account contains all the information about the operation of the bridge", "", "There are the address of the token with which the bridge works,", "the amount of liquidity stored, the collected fee amount and", "the settings for the operation of the bridge", ], name: "bridge", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The mint account of the token with which the bridge works"], name: "tokenMint", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The account stores the user's staking tokens and the fee collected by the bridge in tokens", "", "Verification of account takes place in [`Sending::send_token`] and [`Claiming::process_token`]", ], name: "stakingWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The PDA that is the authorization for the transfer of tokens to the user", "", "It's wrapper token mint authority account for mint bridge,", "staking token account owner for send bridge and changing", "balance in bridge_data", ], name: "mintAuthority", optional: false, relations: [], signer: false, writable: false, }, { docs: ["The account that stores support and fee information for a specific chain"], name: "chainSupportInfo", optional: false, relations: [], signer: false, writable: false, }, { docs: ["Debridge settings program"], name: "settingsProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: ["System spl token program"], name: "splTokenProgram", optional: false, relations: [], signer: false, writable: false, }, ], name: "bridgeCtx", }, { accounts: [ { docs: [ "State account with service information", "", "This account from settings program is also a unique state for debridge program.", ], name: "state", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "Beneficiary of the commission in the system", "", "The unique value of this account is stored in the state account", "Implied that this will be an account belonging to another program (FeeProxy),", "which will be responsible for the distribution of commissions", ], name: "feeBeneficiary", optional: false, relations: [], signer: false, writable: true, }, ], name: "stateCtx", }, { docs: ["The task of this account is to store the Nonce, which is necessary for the uniqueness of each Send"], name: "nonceStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 User token account from which money is sent"], name: "sendFromWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: [ "Storage for external call instructions", "", "The key is checked after calculating the Submission id", "It has [`ExternalCallMeta'] structure and is initialized when `submission_params` is not None.", "If `submission_params` is None this account is ignored", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The account that stores information about external call current state.", "", "It has [`ExternalCallMeta'] structure and is initialized when `submission_params` is not None.", "If `submission_params` is None this account is ignored", ], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 User Authority"], name: "sendFrom", optional: false, relations: [], signer: true, writable: true, }, { docs: ["The account allows the user to get a discount when using the bridge"], name: "discount", optional: false, relations: [], signer: false, writable: false, }, { docs: [ "The account determines whether it is possible to take fix fee from sending tokens", "and the percentage of these tokens. Otherwise fix fee in SOL is taken", ], name: "bridgeFee", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "targetChainId", type: { array: ["u8", 32] } }, { name: "receiver", type: "bytes", }, { name: "isUseAssetFee", type: "bool" }, { name: "amount", type: "u64" }, { name: "submissionParams", type: { option: { defined: { generics: [], name: "SendSubmissionParamsInput" } } }, }, { name: "referralCode", type: { option: "u32" } }, ], discriminator: [102, 251, 20, 187, 65, 75, 12, 69], name: "send", }, { accounts: [ { docs: [ "The account determines whether tokens have been claimed based on the received submission", "", "If this account based on the submission ID exists, then the claim was performed earlier", "seeds of this account is `[SUBMISSION_SEED, &submission_id]`. We check them during the creation", "of the `submission`, since at that stage we already have a calculated submission id", ], name: "submission", optional: false, relations: [], signer: false, writable: true, }, { accounts: [ { docs: [ "The account contains all the information about the operation of the bridge", "", "There are the address of the token with which the bridge works,", "the amount of liquidity stored, the collected fee amount and", "the settings for the operation of the bridge", ], name: "bridge", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The mint account of the token with which the bridge works"], name: "tokenMint", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The account stores the user's staking tokens and the fee collected by the bridge in tokens", "", "Verification of account takes place in [`Sending::send_token`] and [`Claiming::process_token`]", ], name: "stakingWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The PDA that is the authorization for the transfer of tokens to the user", "", "It's wrapper token mint authority account for mint bridge,", "staking token account owner for send bridge and changing", "balance in bridge_data", ], name: "mintAuthority", optional: false, relations: [], signer: false, writable: false, }, { docs: ["The account that stores support and fee information for a specific chain"], name: "chainSupportInfo", optional: false, relations: [], signer: false, writable: false, }, { docs: ["Debridge settings program"], name: "settingsProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: ["System spl token program"], name: "splTokenProgram", optional: false, relations: [], signer: false, writable: false, }, ], name: "bridgeCtx", }, { accounts: [ { docs: [ "State account with service information", "", "This account from settings program is also a unique state for debridge program.", ], name: "state", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "Beneficiary of the commission in the system", "", "The unique value of this account is stored in the state account", "Implied that this will be an account belonging to another program (FeeProxy),", "which will be responsible for the distribution of commissions", ], name: "feeBeneficiary", optional: false, relations: [], signer: false, writable: true, }, ], name: "state", }, { docs: [ "On this account the claimed tokens will be transferred.", "", "If claim with external call this account is associated with submission auth account wallet", "If claim without external call this account is associated with claim_to_wallet account wallet or", "if claim_to is Token account itself this account is same as claim_to", ], name: "claimToWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["It's account that marked in Submission structure as receiver"], name: "claimTo", optional: false, relations: [], signer: false, writable: false, }, { docs: [], name: "fallbackAddress", optional: false, relations: [], signer: false, writable: false, }, { docs: [ "The account that stores information about signatures confirming the existence of a submission", "After use, signatures are removed from the storage", ], name: "confirmationStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: [], name: "confirmationStorageCreator", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 Claimer"], name: "payer", optional: false, relations: [], signer: true, writable: true, }, { docs: ["The wallet owned by payer account. On this account the executor fee will be transferred"], name: "payerWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: [ "Storage for external call instructions", "", "The key is checked after calculating the Submission id", "It has [`ExternalCallMeta'] structure and is initialized when `submission_params` is not None.", "If `submission_params` is None this account is ignored", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The account that stores information about external call current state.", "", "It has [`ExternalCallMeta'] structure and is initialized when `submission_params` is not None.", "If `submission_params` is None this account is ignored", ], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: [], name: "claimMarker", optional: false, relations: [], signer: false, writable: false }, ], args: [ { name: "sourceChainId", type: { array: ["u8", 32] } }, { name: "rawAmount", type: { array: ["u8", 32] }, }, { name: "nonce", type: { array: ["u8", 32] } }, { name: "submissionsParam", type: { option: { defined: { generics: [], name: "ClaimSubmissionParamsInput" } } }, }, ], discriminator: [62, 198, 214, 193, 213, 159, 108, 210], name: "claim", }, { accounts: [ { accounts: [ { docs: [ "State account with service information", "", "This account from settings program is also a unique state for debridge program.", ], name: "state", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "Beneficiary of the commission in the system", "", "The unique value of this account is stored in the state account", "Implied that this will be an account belonging to another program (FeeProxy),", "which will be responsible for the distribution of commissions", ], name: "feeBeneficiary", optional: false, relations: [], signer: false, writable: true, }, ], name: "stateCtx", }, { docs: ["The mint account of the token with which the bridge works"], name: "tokenMint", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The account contains all the information about the operation of the bridge", "", "There are the address of the token with which the bridge works,", "the amount of liquidity stored, the collected fee amount and", "the settings for the operation of the bridge", ], name: "bridgeData", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The account stores the user's staking tokens and the fee collected by the bridge in tokens"], name: "stakingWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "The PDA that is the authorization for the transfer of tokens to the user", "", "It's wrapper token mint authority account for mint bridge,", "staking token account owner for send bridge and changing", "balance in bridge_data", ], name: "mintAuthority", optional: false, relations: [], signer: false, writable: false, }, { docs: ["The token account owned by fee beneficiary. Fee is sent to this wallet"], name: "feeBeneficiarWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["System spl token program"], name: "tokenProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: ["Debridge settings program"], name: "settingsProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [], discriminator: [165, 87, 224, 83, 183, 65, 97, 155], name: "withdrawBridgeFee", }, { accounts: [ { docs: [ "Storage for external call instructions", "", "The key is checked after calculating the Submission id", "", "Due to the restrictions on the size of the transaction, we allocate storage for the entire external call in [`claim`] or [`send`] action", "Each storage owner creates his own repository, since validation of this storage is possible only when it is completely full", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The account that stores information about external call current state"], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 Claimer"], name: "storageOwner", optional: false, relations: [], signer: true, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "externalCallLen", type: "u32" }, { name: "chainId", type: { array: ["u8", 32] }, }, { name: "storageKey", type: { array: ["u8", 32] } }, { name: "rawInstructions", type: "bytes" }, ], discriminator: [82, 77, 58, 138, 145, 157, 41, 253], name: "initExternalCallStorage", }, { accounts: [ { docs: [ "Storage for external call instructions", "", "The key is checked after calculating the Submission id", "The account that stores information about external call current state.", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: [], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 Executor"], name: "claimer", optional: false, relations: [], signer: true, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "chainId", type: { array: ["u8", 32] } }, { name: "submissionId", type: { array: ["u8", 32] }, }, { name: "externalInstructionsOffset", type: "u64" }, { name: "rawInstructions", type: "bytes" }, ], discriminator: [38, 234, 80, 194, 91, 237, 107, 143], name: "updateExternalCallStorage", }, { accounts: [ { docs: ["Storage for external call instructions", "", "The key is checked after calculating the Submission id"], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The account that stores information about external call current state"], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 Claimer"], name: "storageOwner", optional: false, relations: [], signer: true, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "externalCallLen", type: "u32" }, { name: "chainId", type: "u64" }, { name: "storageKey", type: { array: ["u8", 32] }, }, { name: "externalInstructionsOffset", type: "u32" }, { name: "rawInstructions", type: "bytes" }, ], discriminator: [51, 59, 197, 101, 19, 200, 113, 6], name: "initOrUpdateExternalCallStorage", }, { accounts: [ { docs: [ "Storage for external call instructions", "", "The key is checked after calculating the Submission id", "The account that stores information about external call current state.", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: [], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["👤 Executor"], name: "claimer", optional: false, relations: [], signer: true, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "chainId", type: { array: ["u8", 32] } }, { name: "submissionId", type: { array: ["u8", 32] }, }, ], discriminator: [86, 133, 188, 0, 81, 191, 155, 134], name: "closeExternalCallStorage", }, { accounts: [ { docs: [ "State account with service information", "", "This account from settings program is also a unique state for debridge program.", ], name: "state", optional: false, relations: [], signer: false, writable: false, }, { docs: [ "External call storage", "", "This account stored all external_data for `submission_id` and verified by [`claim`] method", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The account that stores information about external call current state"], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Bridge for this submission", "", "Use here for check wallet"], name: "bridge", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Claimer who has successfully call [`claim`].", "Here this account is used to verify `external_call_storage`"], name: "originalClaimer", optional: false, relations: [], signer: false, writable: true, }, { docs: ["An account proving that the transfer was made and with information", "about `original_claimer` account"], name: "submission", optional: false, relations: [], signer: false, writable: false, }, { docs: ["Submission wallet owner"], name: "submissionAuth", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Temporary wallet for storing funds during an external call"], name: "submissionWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The wallet of the executor that will receive the reward"], name: "rewardBeneficiaryWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ['- "👤 Executor"'], name: "executor", optional: false, relations: [], signer: true, writable: false, }, { docs: [], name: "fallbackAddress", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "In case of unsuccessful execution of one of the instructions for any reason,", "the remaining tokens and the remaining rewards should come to this address", "The wallet of `fallback_address` account", ], name: "fallbackAddressWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The mint account of the token with which the bridge works"], name: "tokenMint", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: ["System spl token program"], name: "splTokenProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "submissionId", type: { array: ["u8", 32] } }, { name: "count", type: "u8", }, { name: "reversedSubsitutionBumps", type: "bytes" }, ], discriminator: [160, 89, 229, 51, 157, 62, 217, 174], name: "executeExternalCall", }, { accounts: [ { docs: [ "State account with service information", "", "This account from settings program is also a unique state for debridge program.", ], name: "state", optional: false, relations: [], signer: false, writable: false, }, { docs: [ "External call storage", "", "This account stored all external_data for `submission_id` and verified by [`claim`] method", ], name: "externalCallStorage", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The account that stores information about external call current state"], name: "externalCallMeta", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Bridge for this submission", "", "Use here for check wallet"], name: "bridge", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Claimer who has successfully call [`claim`].", "Here this account is used to verify `external_call_storage`"], name: "originalClaimer", optional: false, relations: [], signer: false, writable: true, }, { docs: ["An account proving that the transfer was made and with information", "about `original_claimer` account"], name: "submission", optional: false, relations: [], signer: false, writable: false, }, { docs: ["Submission wallet owner"], name: "submissionAuth", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Temporary wallet for storing funds during an external call"], name: "submissionWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The wallet of the executor that will receive the reward"], name: "rewardBeneficiaryWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ['- "👤 Executor"'], name: "executor", optional: false, relations: [], signer: true, writable: false, }, { docs: [], name: "fallbackAddress", optional: false, relations: [], signer: false, writable: true, }, { docs: [ "In case of unsuccessful execution of one of the instructions for any reason,", "the remaining tokens and the remaining rewards should come to this address", "The wallet of `fallback_address` account", ], name: "fallbackAddressWallet", optional: false, relations: [], signer: false, writable: true, }, { docs: ["The mint account of the token with which the bridge works"], name: "tokenMint", optional: false, relations: [], signer: false, writable: true, }, { docs: ["Solana system program"], name: "systemProgram", optional: false, relations: [], signer: false, writable: false, }, { docs: ["System spl token program"], name: "splTokenProgram", optional: false, relations: [], signer: false, writable: false, }, ], args: [ { name: "submissionId", type: { array: ["u8", 32] } }, { name: "submissionAuthBump", type: "u8" }, ], discriminator: [160, 222, 34, 244, 54, 80, 15, 165], name: "makeFallbackForExternalCall", }, { accounts: [ { docs: ["Claimer who has successfully call [`claim`].", "Here this account is used to verify `external_call_storage`"], name: "originalClaimer", optional: false, relations: [], signer: false, writable: true, }, { docs: ["An account proving that the transfer was made and with information", "about `original_claimer` account"], name: "submission", optional: false, relations: [], signer: false, writable: false, }, { docs: ["Submission wallet owner"], name: "submissionAuth", optional: false