TokenBridgeRelayer: {
    accounts: [{
        docs: ["Foreign emitter account data."];
        name: "foreignContract";
        type: {
            fields: [{
                docs: ["Emitter chain. Cannot equal `1` (Solana's Chain ID)."];
                name: "chain";
                type: "u16";
            }, {
                docs: ["Emitter address. Cannot be zero address."];
                name: "address";
                type: {
                    array: ["u8", 32];
                };
            }, {
                docs: ["Token Bridge program's foreign endpoint account key."];
                name: "tokenBridgeForeignEndpoint";
                type: "publicKey";
            }, {
                docs: ["The fee that is paid to the `fee_recipient` upon redeeming a transfer.", "This value is set in terms of USD and scaled by the `relayer_fee_precision`.", "For example, if the `relayer_fee_precision` is `100000000` and the intended", "fee is $5, then the `fee` value should be `500000000`."];
                name: "fee";
                type: "u64";
            }];
            kind: "struct";
        };
    }, {
        docs: ["Owner account data."];
        name: "ownerConfig";
        type: {
            fields: [{
                docs: ["Program's owner."];
                name: "owner";
                type: "publicKey";
            }, {
                docs: ["Program's assistant. Can be used to update the relayer fee and swap rate."];
                name: "assistant";
                type: "publicKey";
            }, {
                docs: ["Intermediate storage for the pending owner. Is used to transfer ownership."];
                name: "pendingOwner";
                type: {
                    option: "publicKey";
                };
            }];
            kind: "struct";
        };
    }, {
        name: "redeemerConfig";
        type: {
            fields: [{
                docs: ["Program's owner."];
                name: "owner";
                type: "publicKey";
            }, {
                docs: ["PDA bump."];
                name: "bump";
                type: "u8";
            }, {
                docs: ["Relayer fee and swap rate precision."];
                name: "relayerFeePrecision";
                type: "u32";
            }, {
                docs: ["Recipient of all relayer fees and swap proceeds."];
                name: "feeRecipient";
                type: "publicKey";
            }];
            kind: "struct";
        };
    }, {
        docs: ["Registered token account data."];
        name: "registeredToken";
        type: {
            fields: [{
                docs: ["Token swap rate. The swap rate is the USD conversion rate of the token."];
                name: "swapRate";
                type: "u64";
            }, {
                docs: ["Maximum amount of native SOL the contract will swap for each transfer."];
                name: "maxNativeSwapAmount";
                type: "u64";
            }];
            kind: "struct";
        };
    }, {
        name: "senderConfig";
        type: {
            fields: [{
                docs: ["Program's owner."];
                name: "owner";
                type: "publicKey";
            }, {
                docs: ["PDA bump."];
                name: "bump";
                type: "u8";
            }, {
                docs: ["Token Bridge program's relevant addresses."];
                name: "tokenBridge";
                type: {
                    defined: "OutboundTokenBridgeAddresses";
                };
            }, {
                docs: ["Relayer fee and swap rate precision."];
                name: "relayerFeePrecision";
                type: "u32";
            }, {
                docs: ["Boolean indicating whether outbound transfers are paused."];
                name: "paused";
                type: "bool";
            }];
            kind: "struct";
        };
    }, {
        name: "signerSequence";
        type: {
            fields: [{
                name: "value";
                type: "u64";
            }];
            kind: "struct";
        };
    }];
    constants: [{
        name: "SEED_PREFIX_BRIDGED";
        type: "bytes";
        value: "[98, 114, 105, 100, 103, 101, 100]";
    }, {
        name: "SEED_PREFIX_TMP";
        type: "bytes";
        value: "[116, 109, 112]";
    }, {
        name: "SWAP_RATE_PRECISION";
        type: "u32";
        value: "100_000_000";
    }];
    errors: [{
        code: 6000;
        msg: "InvalidWormholeBridge";
        name: "InvalidWormholeBridge";
    }, {
        code: 6001;
        msg: "InvalidWormholeFeeCollector";
        name: "InvalidWormholeFeeCollector";
    }, {
        code: 6002;
        msg: "OwnerOnly";
        name: "OwnerOnly";
    }, {
        code: 6003;
        msg: "OutboundTransfersPaused";
        name: "OutboundTransfersPaused";
    }, {
        code: 6004;
        msg: "OwnerOrAssistantOnly";
        name: "OwnerOrAssistantOnly";
    }, {
        code: 6005;
        msg: "NotPendingOwner";
        name: "NotPendingOwner";
    }, {
        code: 6006;
        msg: "AlreadyTheOwner";
        name: "AlreadyTheOwner";
    }, {
        code: 6007;
        msg: "AlreadyTheAssistant";
        name: "AlreadyTheAssistant";
    }, {
        code: 6008;
        msg: "AlreadyTheFeeRecipient";
        name: "AlreadyTheFeeRecipient";
    }, {
        code: 6009;
        msg: "BumpNotFound";
        name: "BumpNotFound";
    }, {
        code: 6010;
        msg: "FailedToMakeImmutable";
        name: "FailedToMakeImmutable";
    }, {
        code: 6011;
        msg: "InvalidForeignContract";
        name: "InvalidForeignContract";
    }, {
        code: 6012;
        msg: "ZeroBridgeAmount";
        name: "ZeroBridgeAmount";
    }, {
        code: 6013;
        msg: "InvalidToNativeAmount";
        name: "InvalidToNativeAmount";
    }, {
        code: 6014;
        msg: "NativeMintRequired";
        name: "NativeMintRequired";
    }, {
        code: 6015;
        msg: "SwapsNotAllowedForNativeMint";
        name: "SwapsNotAllowedForNativeMint";
    }, {
        code: 6016;
        msg: "InvalidTokenBridgeConfig";
        name: "InvalidTokenBridgeConfig";
    }, {
        code: 6017;
        msg: "InvalidTokenBridgeAuthoritySigner";
        name: "InvalidTokenBridgeAuthoritySigner";
    }, {
        code: 6018;
        msg: "InvalidTokenBridgeCustodySigner";
        name: "InvalidTokenBridgeCustodySigner";
    }, {
        code: 6019;
        msg: "InvalidTokenBridgeEmitter";
        name: "InvalidTokenBridgeEmitter";
    }, {
        code: 6020;
        msg: "InvalidTokenBridgeSequence";
        name: "InvalidTokenBridgeSequence";
    }, {
        code: 6021;
        msg: "InvalidRecipient";
        name: "InvalidRecipient";
    }, {
        code: 6022;
        msg: "InvalidTransferToChain";
        name: "InvalidTransferToChain";
    }, {
        code: 6023;
        msg: "InvalidTransferTokenChain";
        name: "InvalidTransferTokenChain";
    }, {
        code: 6024;
        msg: "InvalidPrecision";
        name: "InvalidPrecision";
    }, {
        code: 6025;
        msg: "InvalidTransferToAddress";
        name: "InvalidTransferToAddress";
    }, {
        code: 6026;
        msg: "AlreadyRedeemed";
        name: "AlreadyRedeemed";
    }, {
        code: 6027;
        msg: "InvalidTokenBridgeForeignEndpoint";
        name: "InvalidTokenBridgeForeignEndpoint";
    }, {
        code: 6028;
        msg: "InvalidTokenBridgeMintAuthority";
        name: "InvalidTokenBridgeMintAuthority";
    }, {
        code: 6029;
        msg: "InvalidPublicKey";
        name: "InvalidPublicKey";
    }, {
        code: 6030;
        msg: "ZeroSwapRate";
        name: "ZeroSwapRate";
    }, {
        code: 6031;
        msg: "TokenNotRegistered";
        name: "TokenNotRegistered";
    }, {
        code: 6032;
        msg: "ChainNotRegistered";
        name: "ChainNotRegistered";
    }, {
        code: 6033;
        msg: "TokenAlreadyRegistered";
        name: "TokenAlreadyRegistered";
    }, {
        code: 6034;
        msg: "TokenFeeCalculationError";
        name: "FeeCalculationError";
    }, {
        code: 6035;
        msg: "InvalidSwapCalculation";
        name: "InvalidSwapCalculation";
    }, {
        code: 6036;
        msg: "InsufficientFunds";
        name: "InsufficientFunds";
    }];
    instructions: [{
        accounts: [{
            docs: ["Deployer of the program."];
            isMut: true;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account, which saves program data useful for other", "instructions, specifically for outbound transfers. Also saves the payer", "of the [`initialize`](crate::initialize) instruction as the program's", "owner."];
            isMut: true;
            isSigner: false;
            name: "senderConfig";
        }, {
            docs: ["Redeemer Config account, which saves program data useful for other", "instructions, specifically for inbound transfers. Also saves the payer", "of the [`initialize`](crate::initialize) instruction as the program's", "owner."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }, {
            docs: ["Owner config account, which saves the owner, assistant and", "pending owner keys. This account is used to manage the ownership of the", "program."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["that holds data; it is purely just a signer for posting Wormhole", "messages on behalf of the Token Bridge program."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeEmitter";
        }, {
            docs: ["Token Bridge emitter's sequence account. Like with all Wormhole", "emitters, this account keeps track of the sequence number of the last", "posted message."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeSequence";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            docs: ["upgrade authority. We check this PDA address just in case there is another program that this", "deployer has deployed.", "", "NOTE: Set upgrade authority is scary because any public key can be used to set as the", "authority."];
            isMut: true;
            isSigner: false;
            name: "programData";
        }, {
            isMut: false;
            isSigner: false;
            name: "bpfLoaderUpgradeableProgram";
        }];
        args: [{
            name: "feeRecipient";
            type: "publicKey";
        }, {
            name: "assistant";
            type: "publicKey";
        }];
        docs: ["This instruction is be used to generate your program's config.", "And for convenience, we will store Wormhole-related PDAs in the", "config so we can verify these accounts with a simple == constraint.", "# Arguments", "", "* `ctx` - `Initialize` context", "* `fee_recipient` - Recipient of all relayer fees and swap proceeds", "* `assistant` - Privileged key to manage certain accounts"];
        name: "initialize";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "creating [`ForeignContract`] account."];
            isMut: true;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Foreign Contract account. Create this account if an emitter has not been", "registered yet for this Wormhole chain ID. If there already is a", "contract address saved in this account, overwrite it."];
            isMut: true;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Token Bridge foreign endpoint. This account should really be one", "endpoint per chain, but Token Bridge's PDA allows for multiple", "endpoints for each chain. We store the proper endpoint for the", "emitter chain."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeForeignEndpoint";
        }, {
            docs: ["Token Bridge program."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }];
        args: [{
            name: "chain";
            type: "u16";
        }, {
            name: "address";
            type: {
                array: ["u8", 32];
            };
        }, {
            name: "relayerFee";
            type: "u64";
        }];
        docs: ["This instruction registers a new foreign contract (from another", "network) and saves the emitter information in a ForeignEmitter account.", "This instruction is owner-only, meaning that only the owner of the", "program (defined in the [Config] account) can add and update foreign", "contracts.", "", "# Arguments", "", "* `ctx` - `RegisterForeignContract` context", "* `chain` - Wormhole Chain ID", "* `address` - Wormhole Emitter Address", "* `relayer_fee` - Relayer fee scaled by the `relayer_fee_precision`"];
        name: "registerForeignContract";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "creating [`ForeignContract`] account."];
            isMut: true;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. Create this", "account if the mint has not been registered yet. Mutable."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }];
        args: [{
            name: "swapRate";
            type: "u64";
        }, {
            name: "maxNativeSwapAmount";
            type: "u64";
        }];
        docs: ["This instruction registers a new token and saves the initial `swap_rate`", "and `max_native_token_amount` in a RegisteredToken account.", "This instruction is owner-only, meaning that only the owner of the", "program (defined in the [Config] account) can register a token.", "", "# Arguments", "", "* `ctx` - `RegisterToken` context", "* `swap_rate`:", "- USD conversion rate scaled by the `swap_rate_precision`. For example,", "- if the conversion rate is $15 and the `swap_rate_precision` is", "- 1000000, the `swap_rate` should be set to 15000000.", "* `max_native_swap_amount`:", "- Maximum amount of native tokens that can be swapped for this token", "- on this chain."];
        name: "registerToken";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "closing [`RegisteredToken`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. This account", "also determines if a mint is registered or not."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }];
        args: [];
        docs: ["This instruction deregisters a token by closing the existing", "`RegisteredToken` account for a particular mint. This instruction is", "owner-only, meaning that only the owner of the program (defined in the", "[Config] account) can deregister a token."];
        name: "deregisterToken";
    }, {
        accounts: [{
            docs: ["Signer of the transaction. Must be the owner or assistant."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["The owner_config is used when updating the swap rate", "so that the assistant key can be used in addition to the", "owner key."];
            isMut: false;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["This account holds the USD denominated relayer fee for the specified", "`chain`. This account is used to determine the cost of relaying", "a transfer to a target chain. If there already is a relayer fee", "saved in this account, overwrite it."];
            isMut: true;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }];
        args: [{
            name: "chain";
            type: "u16";
        }, {
            name: "fee";
            type: "u64";
        }];
        docs: ["This instruction updates the `relayer_fee` in the `ForeignContract` account.", "The `relayer_fee` is scaled by the `relayer_fee_precision`. For example,", "if the `relayer_fee` is $15 and the `relayer_fee_precision` is 1000000,", "the `relayer_fee` should be set to 15000000. This instruction can", "only be called by the owner or assistant, which are defined in the", "[OwnerConfig] account.", "", "# Arguments", "", "* `ctx` - `UpdateRelayerFee` context", "* `chain` - Wormhole Chain ID", "* `fee` - Relayer fee scaled by the `relayer_fee_precision`"];
        name: "updateRelayerFee";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`RedeemerConfig`] and [`SenderConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Redeemer Config account. This program requires that the `owner`", "specified in the context equals the pubkey specified in this account.", "Mutable."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }, {
            docs: ["Sender Config account. This program requires that the `owner`", "specified in the context equals the pubkey specified in this account.", "Mutable. The `owner` check is redundant here, but we keep it as an", "extra protection for future changes to the context. Mutable."];
            isMut: true;
            isSigner: false;
            name: "senderConfig";
        }];
        args: [{
            name: "relayerFeePrecision";
            type: "u32";
        }];
        docs: ["This instruction updates the `relayer_fee_precision` in the", "`SenderConfig` and `RedeemerConfig` accounts. The `relayer_fee_precision`", "is used to scale the `relayer_fee`. This instruction is owner-only,", "meaning that only the owner of the program (defined in the [Config]", "account) can register a token.", "", "# Arguments", "", "* `ctx` - `UpdatePrecision` context", "* `relayer_fee_precision` - Precision used to scale the relayer fee."];
        name: "updateRelayerFeePrecision";
    }, {
        accounts: [{
            docs: ["The signer of the transaction. Must be the owner or assistant."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["The owner_config is used when updating the swap rate so that the", "assistant key can be used in additional to the owner key."];
            isMut: false;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. The program", "will modify this account to update the swap rate. Mutable."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }];
        args: [{
            name: "swapRate";
            type: "u64";
        }];
        docs: ["This instruction updates the `swap_rate` in the `RegisteredToken`", "account. This instruction can only be called by the owner or", "assistant, which are defined in the [OwnerConfig] account.", "", "# Arguments", "", "* `ctx` - `UpdateSwapRate` context", "* `swap_rate` - USD conversion rate for the specified token."];
        name: "updateSwapRate";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "creating [`ForeignContract`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. The program", "will modify this account when the swap rate or max native swap amount", "changes. Mutable."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }];
        args: [{
            name: "maxNativeSwapAmount";
            type: "u64";
        }];
        docs: ["This instruction updates the `max_native_swap_amount` in the", "`RegisteredToken` account. This instruction is owner-only,", "meaning that only the owner of the program (defined in the [Config]", "account) can register a token.", "", "# Arguments", "", "* `ctx` - `UpdateMaxNativeSwapAmount` context", "* `max_native_swap_amount`:", "- Maximum amount of native tokens that can be swapped for this token", "- on this chain."];
        name: "updateMaxNativeSwapAmount";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "config";
        }];
        args: [{
            name: "paused";
            type: "bool";
        }];
        docs: ["This instruction updates the `paused` boolean in the `SenderConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can pause outbound", "transfers.", "", "# Arguments", "", "* `ctx` - `PauseOutboundTransfers` context", "* `paused` - Boolean indicating whether outbound transfers are paused."];
        name: "setPauseForTransfers";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`OwnerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Owner Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }];
        args: [{
            name: "newOwner";
            type: "publicKey";
        }];
        docs: ["This instruction sets the `pending_owner` field in the `OwnerConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can submit an", "ownership transfer request.", "", "# Arguments", "", "* `ctx` - `ManageOwnership` context", "* `new_owner` - Pubkey of the pending owner."];
        name: "submitOwnershipTransferRequest";
    }, {
        accounts: [{
            docs: ["Must be the pending owner of the program set in the [`OwnerConfig`]", "account."];
            isMut: false;
            isSigner: true;
            name: "pendingOwner";
        }, {
            docs: ["Owner Config account. This program requires that the `pending_owner`", "specified in the context equals the pubkey specified in this account."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["Sender Config account. This instruction will update the `owner`", "specified in this account to the `pending_owner` specified in the", "[`OwnerConfig`] account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "senderConfig";
        }, {
            docs: ["Redeemer Config account. This instruction will update the `owner`", "specified in this account to the `pending_owner` specified in the", "[`OwnerConfig`] account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }];
        args: [];
        docs: ["This instruction confirms that the `pending_owner` is the signer of", "the transaction and updates the `owner` field in the `SenderConfig`,", "`RedeemerConfig`, and `OwnerConfig` accounts."];
        name: "confirmOwnershipTransferRequest";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`OwnerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Owner Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }];
        args: [];
        docs: ["This instruction cancels the ownership transfer request by setting", "the `pending_owner` field in the `OwnerConfig` account to `None`.", "This instruction is owner-only, meaning that only the owner of the", "program (defined in the [Config] account) can cancel an ownership", "transfer request."];
        name: "cancelOwnershipTransferRequest";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`OwnerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Owner Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }];
        args: [{
            name: "newAssistant";
            type: "publicKey";
        }];
        docs: ["This instruction updates the `assistant` field in the `OwnerConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can update the", "assistant.", "", "# Arguments", "", "* `ctx` - `ManageOwnership` context", "* `new_assistant` - Pubkey of the new assistant."];
        name: "updateAssistant";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`RedeemerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Redeemer Config account, which saves program data useful for other", "instructions, specifically for inbound transfers. Also saves the payer", "of the [`initialize`](crate::initialize) instruction as the program's", "owner."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }];
        args: [{
            name: "newFeeRecipient";
            type: "publicKey";
        }];
        docs: ["This instruction updates the `fee_recipient` field in the `RedeemerConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can update the", "fee recipient.", "", "# Arguments", "", "* `ctx` - `UpdateFeeRecipient` context", "* `new_fee_recipient` - Pubkey of the new fee recipient."];
        name: "updateFeeRecipient";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens and create temporary", "token account."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Used to keep track of payer's Wormhole sequence number."];
            isMut: true;
            isSigner: false;
            name: "payerSequence";
        }, {
            docs: ["Sender Config account. Acts as the signer for the Token Bridge token", "transfer. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Foreign Contract account. Send tokens to the contract specified in this", "account. Funnily enough, the Token Bridge program does not have any", "requirements for outbound transfers for the recipient chain to be", "registered. This account provides extra protection against sending", "tokens to an unregistered Wormhole chain ID. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract. Mutable."];
            isMut: true;
            isSigner: false;
            name: "mint";
        }, {
            docs: ["Payer's associated token account. We may want to make this a generic", "token account in the future."];
            isMut: true;
            isSigner: false;
            name: "fromTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged out, the token account", "will have zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            docs: ["account that holds this mint's balance. This account needs to be", "unchecked because a token account may not have been created for this", "mint yet. Mutable."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeCustody";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeAuthoritySigner";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeCustodySigner";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeBridge";
        }, {
            docs: ["tokens transferred in this account for our program. Mutable."];
            isMut: true;
            isSigner: false;
            name: "wormholeMessage";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeEmitter";
        }, {
            isMut: true;
            isSigner: false;
            name: "tokenBridgeSequence";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeFeeCollector";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "clock";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "amount";
            type: "u64";
        }, {
            name: "toNativeTokenAmount";
            type: "u64";
        }, {
            name: "recipientChain";
            type: "u16";
        }, {
            name: "recipientAddress";
            type: {
                array: ["u8", 32];
            };
        }, {
            name: "batchId";
            type: "u32";
        }, {
            name: "wrapNative";
            type: "bool";
        }];
        docs: ["This instruction is used to transfer native tokens from Solana to a", "foreign blockchain. The user can optionally specify a", "`to_native_token_amount` to swap some of the tokens for the native", "asset on the target chain. For a fee, an off-chain relayer will redeem", "the transfer on the target chain. If the user is transferring native", "SOL, the contract will automatically wrap the lamports into a WSOL.", "", "# Arguments", "", "* `ctx` - `TransferNativeWithRelay` context", "* `amount` - Amount of tokens to send", "* `to_native_token_amount`:", "- Amount of tokens to swap for native assets on the target chain", "* `recipient_chain` - Chain ID of the target chain", "* `recipient_address` - Address of the target wallet on the target chain", "* `batch_id` - Nonce of Wormhole message", "* `wrap_native` - Whether to wrap native SOL"];
        name: "transferNativeTokensWithRelay";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Used to keep track of payer's Wormhole sequence number."];
            isMut: true;
            isSigner: false;
            name: "payerSequence";
        }, {
            docs: ["Sender Config account. Acts as the Token Bridge sender PDA. Mutable."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Foreign Contract account. Send tokens to the contract specified in this", "account. Funnily enough, the Token Bridge program does not have any", "requirements for outbound transfers for the recipient chain to be", "registered. This account provides extra protection against sending", "tokens to an unregistered Wormhole chain ID. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Token Bridge wrapped mint info. This is the SPL token that will be", "bridged to the foreign contract. The wrapped mint PDA must agree", "with the native token's metadata. Mutable."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeWrappedMint";
        }, {
            docs: ["Payer's associated token account. We may want to make this a generic", "token account in the future."];
            isMut: true;
            isSigner: false;
            name: "fromTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged out, the token account", "will have zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            docs: ["about the token from its native chain:", "* Wormhole Chain ID", "* Token's native contract address", "* Token's native decimals"];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeWrappedMeta";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeAuthoritySigner";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeBridge";
        }, {
            docs: ["tokens transferred in this account."];
            isMut: true;
            isSigner: false;
            name: "wormholeMessage";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeEmitter";
        }, {
            isMut: true;
            isSigner: false;
            name: "tokenBridgeSequence";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeFeeCollector";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "clock";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "amount";
            type: "u64";
        }, {
            name: "toNativeTokenAmount";
            type: "u64";
        }, {
            name: "recipientChain";
            type: "u16";
        }, {
            name: "recipientAddress";
            type: {
                array: ["u8", 32];
            };
        }, {
            name: "batchId";
            type: "u32";
        }];
        docs: ["This instruction is used to transfer wrapped tokens from Solana to a", "foreign blockchain. The user can optionally specify a", "`to_native_token_amount` to swap some of the tokens for the native", "assets on the target chain. For a fee, an off-chain relayer will redeem", "the transfer on the target chain. This instruction should only be called", "when the user is transferring a wrapped token.", "", "# Arguments", "", "* `ctx` - `TransferWrappedWithRelay` context", "* `amount` - Amount of tokens to send", "* `to_native_token_amount`:", "- Amount of tokens to swap for native assets on the target chain", "* `recipient_chain` - Chain ID of the target chain", "* `recipient_address` - Address of the target wallet on the target chain", "* `batch_id` - Nonce of Wormhole message"];
        name: "transferWrappedTokensWithRelay";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens and create temporary", "token account."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Redeemer Config account. Acts as the Token Bridge redeemer, which signs", "for the complete transfer instruction. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Fee recipient's token account. Must be an associated token account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "feeRecipientTokenAccount";
        }, {
            docs: ["Foreign Contract account. The registered contract specified in this", "account must agree with the target address for the Token Bridge's token", "transfer. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over from the", "foreign contract. This must match the token address specified in the", "signed Wormhole message. Read-only."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }, {
            docs: ["Recipient associated token account. The recipient authority check", "is necessary to ensure that the recipient is the intended recipient", "of the bridged tokens. Mutable."];
            isMut: true;
            isSigner: false;
            name: "recipientTokenAccount";
        }, {
            docs: ["transaction. This instruction verifies that the recipient key", "passed in this context matches the intended recipient in the vaa."];
            isMut: true;
            isSigner: false;
            name: "recipient";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            isMut: false;
            isSigner: false;
            name: "nativeRegisteredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged in, the tokens will be", "transferred to the destination token accounts. This account will have", "zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            docs: ["Verified Wormhole message account. The Wormhole program verified", "signatures and posted the account data here. Read-only."];
            isMut: false;
            isSigner: false;
            name: "vaa";
        }, {
            docs: ["is true if the bridged assets have been claimed. If the transfer has", "not been redeemed, this account will not exist yet.", "", "NOTE: The Token Bridge program's claim account is only initialized when", "a transfer is redeemed (and the boolean value `true` is written as", "its data).", "", "The Token Bridge program will automatically fail if this transfer", "is redeemed again. But we choose to short-circuit the failure as the", "first evaluation of this instruction."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeClaim";
        }, {
            docs: ["endpoint per chain, but the PDA allows for multiple endpoints for each", "chain! We store the proper endpoint for the emitter chain."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeForeignEndpoint";
        }, {
            docs: ["account that holds this mint's balance."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeCustody";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeCustodySigner";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "vaaHash";
            type: {
                array: ["u8", 32];
            };
        }];
        docs: ["This instruction is used to redeem token transfers from foreign emitters.", "It takes custody of the released native tokens and sends the tokens to the", "encoded `recipient`. It pays the `fee_recipient` in the token", "denomination. If requested by the user, it will perform a swap with the", "off-chain relayer to provide the user with lamports. If the token", "being transferred is WSOL, the contract will unwrap the WSOL and send", "the lamports to the recipient and pay the relayer in lamports.", "", "# Arguments", "", "* `ctx` - `CompleteNativeWithRelay` context", "* `vaa_hash` - Hash of the VAA that triggered the transfer"];
        name: "completeNativeTransferWithRelay";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens and create temporary", "token account."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Redeemer Config account. Acts as the Token Bridge redeemer, which signs", "for the complete transfer instruction. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Fee recipient's token account. Must be an associated token account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "feeRecipientTokenAccount";
        }, {
            docs: ["Foreign Contract account. The registered contract specified in this", "account must agree with the target address for the Token Bridge's token", "transfer. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Token Bridge wrapped mint info. This is the SPL token that will be", "bridged from the foreign contract. The wrapped mint PDA must agree", "with the native token's metadata in the wormhole message. Mutable."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeWrappedMint";
        }, {
            docs: ["Recipient associated token account. The recipient authority check", "is necessary to ensure that the recipient is the intended recipient", "of the bridged tokens. Mutable."];
            isMut: true;
            isSigner: false;
            name: "recipientTokenAccount";
        }, {
            docs: ["transaction. This instruction verifies that the recipient key", "passed in this context matches the intended recipient in the vaa."];
            isMut: true;
            isSigner: false;
            name: "recipient";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            isMut: false;
            isSigner: false;
            name: "nativeRegisteredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged in, the tokens will be", "transferred to the destination token accounts. This account will have", "zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            docs: ["about the token from its native chain:", "* Wormhole Chain ID", "* Token's native contract address", "* Token's native decimals"];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeWrappedMeta";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            docs: ["Verified Wormhole message account. The Wormhole program verified", "signatures and posted the account data here. Read-only."];
            isMut: false;
            isSigner: false;
            name: "vaa";
        }, {
            docs: ["is true if the bridged assets have been claimed. If the transfer has", "not been redeemed, this account will not exist yet.", "", "NOTE: The Token Bridge program's claim account is only initialized when", "a transfer is redeemed (and the boolean value `true` is written as", "its data).", "", "The Token Bridge program will automatically fail if this transfer", "is redeemed again. But we choose to short-circuit the failure as the", "first evaluation of this instruction."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeClaim";
        }, {
            docs: ["endpoint per chain, but the PDA allows for multiple endpoints for each", "chain! We store the proper endpoint for the emitter chain."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeForeignEndpoint";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeMintAuthority";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "vaaHash";
            type: {
                array: ["u8", 32];
            };
        }];
        docs: ["This instruction is used to redeem token transfers from foreign emitters.", "It takes custody of the minted wrapped tokens and sends the tokens to the", "encoded `recipient`. It pays the `fee_recipient` in the wrapped-token", "denomination. If requested by the user, it will perform a swap with the", "off-chain relayer to provide the user with lamports.", "", "# Arguments", "", "* `ctx` - `CompleteWrappedWithRelay` context", "* `vaa_hash` - Hash of the VAA that triggered the transfer"];
        name: "completeWrappedTransferWithRelay";
    }];
    name: "token_bridge_relayer";
    types: [{
        name: "OutboundTokenBridgeAddresses";
        type: {
            fields: [{
                name: "sequence";
                type: "publicKey";
            }];
            kind: "struct";
        };
    }, {
        docs: ["Expected message types for this program. Only valid payloads are:", "* `TransferWithRelay`: Payload ID == 1.", "", "Payload IDs are encoded as u8."];
        name: "TokenBridgeRelayerMessage";
        type: {
            kind: "enum";
            variants: [{
                fields: [{
                    name: "target_relayer_fee";
                    type: "u64";
                }, {
                    name: "to_native_token_amount";
                    type: "u64";
                }, {
                    name: "recipient";
                    type: {
                        array: ["u8", 32];
                    };
                }];
                name: "TransferWithRelay";
            }];
        };
    }];
    version: "0.1.0";
}

Type declaration

  • accounts: [{
        docs: ["Foreign emitter account data."];
        name: "foreignContract";
        type: {
            fields: [{
                docs: ["Emitter chain. Cannot equal `1` (Solana's Chain ID)."];
                name: "chain";
                type: "u16";
            }, {
                docs: ["Emitter address. Cannot be zero address."];
                name: "address";
                type: {
                    array: ["u8", 32];
                };
            }, {
                docs: ["Token Bridge program's foreign endpoint account key."];
                name: "tokenBridgeForeignEndpoint";
                type: "publicKey";
            }, {
                docs: ["The fee that is paid to the `fee_recipient` upon redeeming a transfer.", "This value is set in terms of USD and scaled by the `relayer_fee_precision`.", "For example, if the `relayer_fee_precision` is `100000000` and the intended", "fee is $5, then the `fee` value should be `500000000`."];
                name: "fee";
                type: "u64";
            }];
            kind: "struct";
        };
    }, {
        docs: ["Owner account data."];
        name: "ownerConfig";
        type: {
            fields: [{
                docs: ["Program's owner."];
                name: "owner";
                type: "publicKey";
            }, {
                docs: ["Program's assistant. Can be used to update the relayer fee and swap rate."];
                name: "assistant";
                type: "publicKey";
            }, {
                docs: ["Intermediate storage for the pending owner. Is used to transfer ownership."];
                name: "pendingOwner";
                type: {
                    option: "publicKey";
                };
            }];
            kind: "struct";
        };
    }, {
        name: "redeemerConfig";
        type: {
            fields: [{
                docs: ["Program's owner."];
                name: "owner";
                type: "publicKey";
            }, {
                docs: ["PDA bump."];
                name: "bump";
                type: "u8";
            }, {
                docs: ["Relayer fee and swap rate precision."];
                name: "relayerFeePrecision";
                type: "u32";
            }, {
                docs: ["Recipient of all relayer fees and swap proceeds."];
                name: "feeRecipient";
                type: "publicKey";
            }];
            kind: "struct";
        };
    }, {
        docs: ["Registered token account data."];
        name: "registeredToken";
        type: {
            fields: [{
                docs: ["Token swap rate. The swap rate is the USD conversion rate of the token."];
                name: "swapRate";
                type: "u64";
            }, {
                docs: ["Maximum amount of native SOL the contract will swap for each transfer."];
                name: "maxNativeSwapAmount";
                type: "u64";
            }];
            kind: "struct";
        };
    }, {
        name: "senderConfig";
        type: {
            fields: [{
                docs: ["Program's owner."];
                name: "owner";
                type: "publicKey";
            }, {
                docs: ["PDA bump."];
                name: "bump";
                type: "u8";
            }, {
                docs: ["Token Bridge program's relevant addresses."];
                name: "tokenBridge";
                type: {
                    defined: "OutboundTokenBridgeAddresses";
                };
            }, {
                docs: ["Relayer fee and swap rate precision."];
                name: "relayerFeePrecision";
                type: "u32";
            }, {
                docs: ["Boolean indicating whether outbound transfers are paused."];
                name: "paused";
                type: "bool";
            }];
            kind: "struct";
        };
    }, {
        name: "signerSequence";
        type: {
            fields: [{
                name: "value";
                type: "u64";
            }];
            kind: "struct";
        };
    }]
  • constants: [{
        name: "SEED_PREFIX_BRIDGED";
        type: "bytes";
        value: "[98, 114, 105, 100, 103, 101, 100]";
    }, {
        name: "SEED_PREFIX_TMP";
        type: "bytes";
        value: "[116, 109, 112]";
    }, {
        name: "SWAP_RATE_PRECISION";
        type: "u32";
        value: "100_000_000";
    }]
  • errors: [{
        code: 6000;
        msg: "InvalidWormholeBridge";
        name: "InvalidWormholeBridge";
    }, {
        code: 6001;
        msg: "InvalidWormholeFeeCollector";
        name: "InvalidWormholeFeeCollector";
    }, {
        code: 6002;
        msg: "OwnerOnly";
        name: "OwnerOnly";
    }, {
        code: 6003;
        msg: "OutboundTransfersPaused";
        name: "OutboundTransfersPaused";
    }, {
        code: 6004;
        msg: "OwnerOrAssistantOnly";
        name: "OwnerOrAssistantOnly";
    }, {
        code: 6005;
        msg: "NotPendingOwner";
        name: "NotPendingOwner";
    }, {
        code: 6006;
        msg: "AlreadyTheOwner";
        name: "AlreadyTheOwner";
    }, {
        code: 6007;
        msg: "AlreadyTheAssistant";
        name: "AlreadyTheAssistant";
    }, {
        code: 6008;
        msg: "AlreadyTheFeeRecipient";
        name: "AlreadyTheFeeRecipient";
    }, {
        code: 6009;
        msg: "BumpNotFound";
        name: "BumpNotFound";
    }, {
        code: 6010;
        msg: "FailedToMakeImmutable";
        name: "FailedToMakeImmutable";
    }, {
        code: 6011;
        msg: "InvalidForeignContract";
        name: "InvalidForeignContract";
    }, {
        code: 6012;
        msg: "ZeroBridgeAmount";
        name: "ZeroBridgeAmount";
    }, {
        code: 6013;
        msg: "InvalidToNativeAmount";
        name: "InvalidToNativeAmount";
    }, {
        code: 6014;
        msg: "NativeMintRequired";
        name: "NativeMintRequired";
    }, {
        code: 6015;
        msg: "SwapsNotAllowedForNativeMint";
        name: "SwapsNotAllowedForNativeMint";
    }, {
        code: 6016;
        msg: "InvalidTokenBridgeConfig";
        name: "InvalidTokenBridgeConfig";
    }, {
        code: 6017;
        msg: "InvalidTokenBridgeAuthoritySigner";
        name: "InvalidTokenBridgeAuthoritySigner";
    }, {
        code: 6018;
        msg: "InvalidTokenBridgeCustodySigner";
        name: "InvalidTokenBridgeCustodySigner";
    }, {
        code: 6019;
        msg: "InvalidTokenBridgeEmitter";
        name: "InvalidTokenBridgeEmitter";
    }, {
        code: 6020;
        msg: "InvalidTokenBridgeSequence";
        name: "InvalidTokenBridgeSequence";
    }, {
        code: 6021;
        msg: "InvalidRecipient";
        name: "InvalidRecipient";
    }, {
        code: 6022;
        msg: "InvalidTransferToChain";
        name: "InvalidTransferToChain";
    }, {
        code: 6023;
        msg: "InvalidTransferTokenChain";
        name: "InvalidTransferTokenChain";
    }, {
        code: 6024;
        msg: "InvalidPrecision";
        name: "InvalidPrecision";
    }, {
        code: 6025;
        msg: "InvalidTransferToAddress";
        name: "InvalidTransferToAddress";
    }, {
        code: 6026;
        msg: "AlreadyRedeemed";
        name: "AlreadyRedeemed";
    }, {
        code: 6027;
        msg: "InvalidTokenBridgeForeignEndpoint";
        name: "InvalidTokenBridgeForeignEndpoint";
    }, {
        code: 6028;
        msg: "InvalidTokenBridgeMintAuthority";
        name: "InvalidTokenBridgeMintAuthority";
    }, {
        code: 6029;
        msg: "InvalidPublicKey";
        name: "InvalidPublicKey";
    }, {
        code: 6030;
        msg: "ZeroSwapRate";
        name: "ZeroSwapRate";
    }, {
        code: 6031;
        msg: "TokenNotRegistered";
        name: "TokenNotRegistered";
    }, {
        code: 6032;
        msg: "ChainNotRegistered";
        name: "ChainNotRegistered";
    }, {
        code: 6033;
        msg: "TokenAlreadyRegistered";
        name: "TokenAlreadyRegistered";
    }, {
        code: 6034;
        msg: "TokenFeeCalculationError";
        name: "FeeCalculationError";
    }, {
        code: 6035;
        msg: "InvalidSwapCalculation";
        name: "InvalidSwapCalculation";
    }, {
        code: 6036;
        msg: "InsufficientFunds";
        name: "InsufficientFunds";
    }]
  • instructions: [{
        accounts: [{
            docs: ["Deployer of the program."];
            isMut: true;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account, which saves program data useful for other", "instructions, specifically for outbound transfers. Also saves the payer", "of the [`initialize`](crate::initialize) instruction as the program's", "owner."];
            isMut: true;
            isSigner: false;
            name: "senderConfig";
        }, {
            docs: ["Redeemer Config account, which saves program data useful for other", "instructions, specifically for inbound transfers. Also saves the payer", "of the [`initialize`](crate::initialize) instruction as the program's", "owner."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }, {
            docs: ["Owner config account, which saves the owner, assistant and", "pending owner keys. This account is used to manage the ownership of the", "program."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["that holds data; it is purely just a signer for posting Wormhole", "messages on behalf of the Token Bridge program."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeEmitter";
        }, {
            docs: ["Token Bridge emitter's sequence account. Like with all Wormhole", "emitters, this account keeps track of the sequence number of the last", "posted message."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeSequence";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            docs: ["upgrade authority. We check this PDA address just in case there is another program that this", "deployer has deployed.", "", "NOTE: Set upgrade authority is scary because any public key can be used to set as the", "authority."];
            isMut: true;
            isSigner: false;
            name: "programData";
        }, {
            isMut: false;
            isSigner: false;
            name: "bpfLoaderUpgradeableProgram";
        }];
        args: [{
            name: "feeRecipient";
            type: "publicKey";
        }, {
            name: "assistant";
            type: "publicKey";
        }];
        docs: ["This instruction is be used to generate your program's config.", "And for convenience, we will store Wormhole-related PDAs in the", "config so we can verify these accounts with a simple == constraint.", "# Arguments", "", "* `ctx` - `Initialize` context", "* `fee_recipient` - Recipient of all relayer fees and swap proceeds", "* `assistant` - Privileged key to manage certain accounts"];
        name: "initialize";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "creating [`ForeignContract`] account."];
            isMut: true;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Foreign Contract account. Create this account if an emitter has not been", "registered yet for this Wormhole chain ID. If there already is a", "contract address saved in this account, overwrite it."];
            isMut: true;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Token Bridge foreign endpoint. This account should really be one", "endpoint per chain, but Token Bridge's PDA allows for multiple", "endpoints for each chain. We store the proper endpoint for the", "emitter chain."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeForeignEndpoint";
        }, {
            docs: ["Token Bridge program."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }];
        args: [{
            name: "chain";
            type: "u16";
        }, {
            name: "address";
            type: {
                array: ["u8", 32];
            };
        }, {
            name: "relayerFee";
            type: "u64";
        }];
        docs: ["This instruction registers a new foreign contract (from another", "network) and saves the emitter information in a ForeignEmitter account.", "This instruction is owner-only, meaning that only the owner of the", "program (defined in the [Config] account) can add and update foreign", "contracts.", "", "# Arguments", "", "* `ctx` - `RegisterForeignContract` context", "* `chain` - Wormhole Chain ID", "* `address` - Wormhole Emitter Address", "* `relayer_fee` - Relayer fee scaled by the `relayer_fee_precision`"];
        name: "registerForeignContract";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "creating [`ForeignContract`] account."];
            isMut: true;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. Create this", "account if the mint has not been registered yet. Mutable."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }];
        args: [{
            name: "swapRate";
            type: "u64";
        }, {
            name: "maxNativeSwapAmount";
            type: "u64";
        }];
        docs: ["This instruction registers a new token and saves the initial `swap_rate`", "and `max_native_token_amount` in a RegisteredToken account.", "This instruction is owner-only, meaning that only the owner of the", "program (defined in the [Config] account) can register a token.", "", "# Arguments", "", "* `ctx` - `RegisterToken` context", "* `swap_rate`:", "- USD conversion rate scaled by the `swap_rate_precision`. For example,", "- if the conversion rate is $15 and the `swap_rate_precision` is", "- 1000000, the `swap_rate` should be set to 15000000.", "* `max_native_swap_amount`:", "- Maximum amount of native tokens that can be swapped for this token", "- on this chain."];
        name: "registerToken";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "closing [`RegisteredToken`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. This account", "also determines if a mint is registered or not."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }];
        args: [];
        docs: ["This instruction deregisters a token by closing the existing", "`RegisteredToken` account for a particular mint. This instruction is", "owner-only, meaning that only the owner of the program (defined in the", "[Config] account) can deregister a token."];
        name: "deregisterToken";
    }, {
        accounts: [{
            docs: ["Signer of the transaction. Must be the owner or assistant."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["The owner_config is used when updating the swap rate", "so that the assistant key can be used in addition to the", "owner key."];
            isMut: false;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["This account holds the USD denominated relayer fee for the specified", "`chain`. This account is used to determine the cost of relaying", "a transfer to a target chain. If there already is a relayer fee", "saved in this account, overwrite it."];
            isMut: true;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["System program."];
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }];
        args: [{
            name: "chain";
            type: "u16";
        }, {
            name: "fee";
            type: "u64";
        }];
        docs: ["This instruction updates the `relayer_fee` in the `ForeignContract` account.", "The `relayer_fee` is scaled by the `relayer_fee_precision`. For example,", "if the `relayer_fee` is $15 and the `relayer_fee_precision` is 1000000,", "the `relayer_fee` should be set to 15000000. This instruction can", "only be called by the owner or assistant, which are defined in the", "[OwnerConfig] account.", "", "# Arguments", "", "* `ctx` - `UpdateRelayerFee` context", "* `chain` - Wormhole Chain ID", "* `fee` - Relayer fee scaled by the `relayer_fee_precision`"];
        name: "updateRelayerFee";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`RedeemerConfig`] and [`SenderConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Redeemer Config account. This program requires that the `owner`", "specified in the context equals the pubkey specified in this account.", "Mutable."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }, {
            docs: ["Sender Config account. This program requires that the `owner`", "specified in the context equals the pubkey specified in this account.", "Mutable. The `owner` check is redundant here, but we keep it as an", "extra protection for future changes to the context. Mutable."];
            isMut: true;
            isSigner: false;
            name: "senderConfig";
        }];
        args: [{
            name: "relayerFeePrecision";
            type: "u32";
        }];
        docs: ["This instruction updates the `relayer_fee_precision` in the", "`SenderConfig` and `RedeemerConfig` accounts. The `relayer_fee_precision`", "is used to scale the `relayer_fee`. This instruction is owner-only,", "meaning that only the owner of the program (defined in the [Config]", "account) can register a token.", "", "# Arguments", "", "* `ctx` - `UpdatePrecision` context", "* `relayer_fee_precision` - Precision used to scale the relayer fee."];
        name: "updateRelayerFeePrecision";
    }, {
        accounts: [{
            docs: ["The signer of the transaction. Must be the owner or assistant."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["The owner_config is used when updating the swap rate so that the", "assistant key can be used in additional to the owner key."];
            isMut: false;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. The program", "will modify this account to update the swap rate. Mutable."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }];
        args: [{
            name: "swapRate";
            type: "u64";
        }];
        docs: ["This instruction updates the `swap_rate` in the `RegisteredToken`", "account. This instruction can only be called by the owner or", "assistant, which are defined in the [OwnerConfig] account.", "", "# Arguments", "", "* `ctx` - `UpdateSwapRate` context", "* `swap_rate` - USD conversion rate for the specified token."];
        name: "updateSwapRate";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account. Signer for", "creating [`ForeignContract`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Registered Token account. This account stores information about the", "token, including the swap rate and max native swap amount. The program", "will modify this account when the swap rate or max native swap amount", "changes. Mutable."];
            isMut: true;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }];
        args: [{
            name: "maxNativeSwapAmount";
            type: "u64";
        }];
        docs: ["This instruction updates the `max_native_swap_amount` in the", "`RegisteredToken` account. This instruction is owner-only,", "meaning that only the owner of the program (defined in the [Config]", "account) can register a token.", "", "# Arguments", "", "* `ctx` - `UpdateMaxNativeSwapAmount` context", "* `max_native_swap_amount`:", "- Maximum amount of native tokens that can be swapped for this token", "- on this chain."];
        name: "updateMaxNativeSwapAmount";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`SenderConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Sender Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "config";
        }];
        args: [{
            name: "paused";
            type: "bool";
        }];
        docs: ["This instruction updates the `paused` boolean in the `SenderConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can pause outbound", "transfers.", "", "# Arguments", "", "* `ctx` - `PauseOutboundTransfers` context", "* `paused` - Boolean indicating whether outbound transfers are paused."];
        name: "setPauseForTransfers";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`OwnerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Owner Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }];
        args: [{
            name: "newOwner";
            type: "publicKey";
        }];
        docs: ["This instruction sets the `pending_owner` field in the `OwnerConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can submit an", "ownership transfer request.", "", "# Arguments", "", "* `ctx` - `ManageOwnership` context", "* `new_owner` - Pubkey of the pending owner."];
        name: "submitOwnershipTransferRequest";
    }, {
        accounts: [{
            docs: ["Must be the pending owner of the program set in the [`OwnerConfig`]", "account."];
            isMut: false;
            isSigner: true;
            name: "pendingOwner";
        }, {
            docs: ["Owner Config account. This program requires that the `pending_owner`", "specified in the context equals the pubkey specified in this account."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }, {
            docs: ["Sender Config account. This instruction will update the `owner`", "specified in this account to the `pending_owner` specified in the", "[`OwnerConfig`] account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "senderConfig";
        }, {
            docs: ["Redeemer Config account. This instruction will update the `owner`", "specified in this account to the `pending_owner` specified in the", "[`OwnerConfig`] account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }];
        args: [];
        docs: ["This instruction confirms that the `pending_owner` is the signer of", "the transaction and updates the `owner` field in the `SenderConfig`,", "`RedeemerConfig`, and `OwnerConfig` accounts."];
        name: "confirmOwnershipTransferRequest";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`OwnerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Owner Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }];
        args: [];
        docs: ["This instruction cancels the ownership transfer request by setting", "the `pending_owner` field in the `OwnerConfig` account to `None`.", "This instruction is owner-only, meaning that only the owner of the", "program (defined in the [Config] account) can cancel an ownership", "transfer request."];
        name: "cancelOwnershipTransferRequest";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`OwnerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Owner Config account. This program requires that the `owner` specified", "in the context equals the pubkey specified in this account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "ownerConfig";
        }];
        args: [{
            name: "newAssistant";
            type: "publicKey";
        }];
        docs: ["This instruction updates the `assistant` field in the `OwnerConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can update the", "assistant.", "", "# Arguments", "", "* `ctx` - `ManageOwnership` context", "* `new_assistant` - Pubkey of the new assistant."];
        name: "updateAssistant";
    }, {
        accounts: [{
            docs: ["Owner of the program set in the [`RedeemerConfig`] account."];
            isMut: false;
            isSigner: true;
            name: "owner";
        }, {
            docs: ["Redeemer Config account, which saves program data useful for other", "instructions, specifically for inbound transfers. Also saves the payer", "of the [`initialize`](crate::initialize) instruction as the program's", "owner."];
            isMut: true;
            isSigner: false;
            name: "redeemerConfig";
        }];
        args: [{
            name: "newFeeRecipient";
            type: "publicKey";
        }];
        docs: ["This instruction updates the `fee_recipient` field in the `RedeemerConfig`", "account. This instruction is owner-only, meaning that only the owner", "of the program (defined in the [Config] account) can update the", "fee recipient.", "", "# Arguments", "", "* `ctx` - `UpdateFeeRecipient` context", "* `new_fee_recipient` - Pubkey of the new fee recipient."];
        name: "updateFeeRecipient";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens and create temporary", "token account."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Used to keep track of payer's Wormhole sequence number."];
            isMut: true;
            isSigner: false;
            name: "payerSequence";
        }, {
            docs: ["Sender Config account. Acts as the signer for the Token Bridge token", "transfer. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Foreign Contract account. Send tokens to the contract specified in this", "account. Funnily enough, the Token Bridge program does not have any", "requirements for outbound transfers for the recipient chain to be", "registered. This account provides extra protection against sending", "tokens to an unregistered Wormhole chain ID. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over to the", "foreign contract. Mutable."];
            isMut: true;
            isSigner: false;
            name: "mint";
        }, {
            docs: ["Payer's associated token account. We may want to make this a generic", "token account in the future."];
            isMut: true;
            isSigner: false;
            name: "fromTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged out, the token account", "will have zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            docs: ["account that holds this mint's balance. This account needs to be", "unchecked because a token account may not have been created for this", "mint yet. Mutable."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeCustody";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeAuthoritySigner";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeCustodySigner";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeBridge";
        }, {
            docs: ["tokens transferred in this account for our program. Mutable."];
            isMut: true;
            isSigner: false;
            name: "wormholeMessage";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeEmitter";
        }, {
            isMut: true;
            isSigner: false;
            name: "tokenBridgeSequence";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeFeeCollector";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "clock";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "amount";
            type: "u64";
        }, {
            name: "toNativeTokenAmount";
            type: "u64";
        }, {
            name: "recipientChain";
            type: "u16";
        }, {
            name: "recipientAddress";
            type: {
                array: ["u8", 32];
            };
        }, {
            name: "batchId";
            type: "u32";
        }, {
            name: "wrapNative";
            type: "bool";
        }];
        docs: ["This instruction is used to transfer native tokens from Solana to a", "foreign blockchain. The user can optionally specify a", "`to_native_token_amount` to swap some of the tokens for the native", "asset on the target chain. For a fee, an off-chain relayer will redeem", "the transfer on the target chain. If the user is transferring native", "SOL, the contract will automatically wrap the lamports into a WSOL.", "", "# Arguments", "", "* `ctx` - `TransferNativeWithRelay` context", "* `amount` - Amount of tokens to send", "* `to_native_token_amount`:", "- Amount of tokens to swap for native assets on the target chain", "* `recipient_chain` - Chain ID of the target chain", "* `recipient_address` - Address of the target wallet on the target chain", "* `batch_id` - Nonce of Wormhole message", "* `wrap_native` - Whether to wrap native SOL"];
        name: "transferNativeTokensWithRelay";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Used to keep track of payer's Wormhole sequence number."];
            isMut: true;
            isSigner: false;
            name: "payerSequence";
        }, {
            docs: ["Sender Config account. Acts as the Token Bridge sender PDA. Mutable."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Foreign Contract account. Send tokens to the contract specified in this", "account. Funnily enough, the Token Bridge program does not have any", "requirements for outbound transfers for the recipient chain to be", "registered. This account provides extra protection against sending", "tokens to an unregistered Wormhole chain ID. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Token Bridge wrapped mint info. This is the SPL token that will be", "bridged to the foreign contract. The wrapped mint PDA must agree", "with the native token's metadata. Mutable."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeWrappedMint";
        }, {
            docs: ["Payer's associated token account. We may want to make this a generic", "token account in the future."];
            isMut: true;
            isSigner: false;
            name: "fromTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged out, the token account", "will have zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            docs: ["about the token from its native chain:", "* Wormhole Chain ID", "* Token's native contract address", "* Token's native decimals"];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeWrappedMeta";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeAuthoritySigner";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeBridge";
        }, {
            docs: ["tokens transferred in this account."];
            isMut: true;
            isSigner: false;
            name: "wormholeMessage";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeEmitter";
        }, {
            isMut: true;
            isSigner: false;
            name: "tokenBridgeSequence";
        }, {
            isMut: true;
            isSigner: false;
            name: "wormholeFeeCollector";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "clock";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "amount";
            type: "u64";
        }, {
            name: "toNativeTokenAmount";
            type: "u64";
        }, {
            name: "recipientChain";
            type: "u16";
        }, {
            name: "recipientAddress";
            type: {
                array: ["u8", 32];
            };
        }, {
            name: "batchId";
            type: "u32";
        }];
        docs: ["This instruction is used to transfer wrapped tokens from Solana to a", "foreign blockchain. The user can optionally specify a", "`to_native_token_amount` to swap some of the tokens for the native", "assets on the target chain. For a fee, an off-chain relayer will redeem", "the transfer on the target chain. This instruction should only be called", "when the user is transferring a wrapped token.", "", "# Arguments", "", "* `ctx` - `TransferWrappedWithRelay` context", "* `amount` - Amount of tokens to send", "* `to_native_token_amount`:", "- Amount of tokens to swap for native assets on the target chain", "* `recipient_chain` - Chain ID of the target chain", "* `recipient_address` - Address of the target wallet on the target chain", "* `batch_id` - Nonce of Wormhole message"];
        name: "transferWrappedTokensWithRelay";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens and create temporary", "token account."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Redeemer Config account. Acts as the Token Bridge redeemer, which signs", "for the complete transfer instruction. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Fee recipient's token account. Must be an associated token account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "feeRecipientTokenAccount";
        }, {
            docs: ["Foreign Contract account. The registered contract specified in this", "account must agree with the target address for the Token Bridge's token", "transfer. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Mint info. This is the SPL token that will be bridged over from the", "foreign contract. This must match the token address specified in the", "signed Wormhole message. Read-only."];
            isMut: false;
            isSigner: false;
            name: "mint";
        }, {
            docs: ["Recipient associated token account. The recipient authority check", "is necessary to ensure that the recipient is the intended recipient", "of the bridged tokens. Mutable."];
            isMut: true;
            isSigner: false;
            name: "recipientTokenAccount";
        }, {
            docs: ["transaction. This instruction verifies that the recipient key", "passed in this context matches the intended recipient in the vaa."];
            isMut: true;
            isSigner: false;
            name: "recipient";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            isMut: false;
            isSigner: false;
            name: "nativeRegisteredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged in, the tokens will be", "transferred to the destination token accounts. This account will have", "zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            docs: ["Verified Wormhole message account. The Wormhole program verified", "signatures and posted the account data here. Read-only."];
            isMut: false;
            isSigner: false;
            name: "vaa";
        }, {
            docs: ["is true if the bridged assets have been claimed. If the transfer has", "not been redeemed, this account will not exist yet.", "", "NOTE: The Token Bridge program's claim account is only initialized when", "a transfer is redeemed (and the boolean value `true` is written as", "its data).", "", "The Token Bridge program will automatically fail if this transfer", "is redeemed again. But we choose to short-circuit the failure as the", "first evaluation of this instruction."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeClaim";
        }, {
            docs: ["endpoint per chain, but the PDA allows for multiple endpoints for each", "chain! We store the proper endpoint for the emitter chain."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeForeignEndpoint";
        }, {
            docs: ["account that holds this mint's balance."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeCustody";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeCustodySigner";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "vaaHash";
            type: {
                array: ["u8", 32];
            };
        }];
        docs: ["This instruction is used to redeem token transfers from foreign emitters.", "It takes custody of the released native tokens and sends the tokens to the", "encoded `recipient`. It pays the `fee_recipient` in the token", "denomination. If requested by the user, it will perform a swap with the", "off-chain relayer to provide the user with lamports. If the token", "being transferred is WSOL, the contract will unwrap the WSOL and send", "the lamports to the recipient and pay the relayer in lamports.", "", "# Arguments", "", "* `ctx` - `CompleteNativeWithRelay` context", "* `vaa_hash` - Hash of the VAA that triggered the transfer"];
        name: "completeNativeTransferWithRelay";
    }, {
        accounts: [{
            docs: ["Payer will pay Wormhole fee to transfer tokens and create temporary", "token account."];
            isMut: true;
            isSigner: true;
            name: "payer";
        }, {
            docs: ["Redeemer Config account. Acts as the Token Bridge redeemer, which signs", "for the complete transfer instruction. Read-only."];
            isMut: false;
            isSigner: false;
            name: "config";
        }, {
            docs: ["Fee recipient's token account. Must be an associated token account. Mutable."];
            isMut: true;
            isSigner: false;
            name: "feeRecipientTokenAccount";
        }, {
            docs: ["Foreign Contract account. The registered contract specified in this", "account must agree with the target address for the Token Bridge's token", "transfer. Read-only."];
            isMut: false;
            isSigner: false;
            name: "foreignContract";
        }, {
            docs: ["Token Bridge wrapped mint info. This is the SPL token that will be", "bridged from the foreign contract. The wrapped mint PDA must agree", "with the native token's metadata in the wormhole message. Mutable."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeWrappedMint";
        }, {
            docs: ["Recipient associated token account. The recipient authority check", "is necessary to ensure that the recipient is the intended recipient", "of the bridged tokens. Mutable."];
            isMut: true;
            isSigner: false;
            name: "recipientTokenAccount";
        }, {
            docs: ["transaction. This instruction verifies that the recipient key", "passed in this context matches the intended recipient in the vaa."];
            isMut: true;
            isSigner: false;
            name: "recipient";
        }, {
            isMut: false;
            isSigner: false;
            name: "registeredToken";
        }, {
            isMut: false;
            isSigner: false;
            name: "nativeRegisteredToken";
        }, {
            docs: ["Program's temporary token account. This account is created before the", "instruction is invoked to temporarily take custody of the payer's", "tokens. When the tokens are finally bridged in, the tokens will be", "transferred to the destination token accounts. This account will have", "zero balance and can be closed."];
            isMut: true;
            isSigner: false;
            name: "tmpTokenAccount";
        }, {
            docs: ["about the token from its native chain:", "* Wormhole Chain ID", "* Token's native contract address", "* Token's native decimals"];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeWrappedMeta";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeConfig";
        }, {
            docs: ["Verified Wormhole message account. The Wormhole program verified", "signatures and posted the account data here. Read-only."];
            isMut: false;
            isSigner: false;
            name: "vaa";
        }, {
            docs: ["is true if the bridged assets have been claimed. If the transfer has", "not been redeemed, this account will not exist yet.", "", "NOTE: The Token Bridge program's claim account is only initialized when", "a transfer is redeemed (and the boolean value `true` is written as", "its data).", "", "The Token Bridge program will automatically fail if this transfer", "is redeemed again. But we choose to short-circuit the failure as the", "first evaluation of this instruction."];
            isMut: true;
            isSigner: false;
            name: "tokenBridgeClaim";
        }, {
            docs: ["endpoint per chain, but the PDA allows for multiple endpoints for each", "chain! We store the proper endpoint for the emitter chain."];
            isMut: false;
            isSigner: false;
            name: "tokenBridgeForeignEndpoint";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeMintAuthority";
        }, {
            isMut: false;
            isSigner: false;
            name: "wormholeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenBridgeProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "systemProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "tokenProgram";
        }, {
            isMut: false;
            isSigner: false;
            name: "rent";
        }];
        args: [{
            name: "vaaHash";
            type: {
                array: ["u8", 32];
            };
        }];
        docs: ["This instruction is used to redeem token transfers from foreign emitters.", "It takes custody of the minted wrapped tokens and sends the tokens to the", "encoded `recipient`. It pays the `fee_recipient` in the wrapped-token", "denomination. If requested by the user, it will perform a swap with the", "off-chain relayer to provide the user with lamports.", "", "# Arguments", "", "* `ctx` - `CompleteWrappedWithRelay` context", "* `vaa_hash` - Hash of the VAA that triggered the transfer"];
        name: "completeWrappedTransferWithRelay";
    }]
  • name: "token_bridge_relayer"
  • types: [{
        name: "OutboundTokenBridgeAddresses";
        type: {
            fields: [{
                name: "sequence";
                type: "publicKey";
            }];
            kind: "struct";
        };
    }, {
        docs: ["Expected message types for this program. Only valid payloads are:", "* `TransferWithRelay`: Payload ID == 1.", "", "Payload IDs are encoded as u8."];
        name: "TokenBridgeRelayerMessage";
        type: {
            kind: "enum";
            variants: [{
                fields: [{
                    name: "target_relayer_fee";
                    type: "u64";
                }, {
                    name: "to_native_token_amount";
                    type: "u64";
                }, {
                    name: "recipient";
                    type: {
                        array: ["u8", 32];
                    };
                }];
                name: "TransferWithRelay";
            }];
        };
    }]
  • version: "0.1.0"

Generated using TypeDoc