The wallet and minter programs have a set of accounts and instructions that you
can use to build with Gateway on Solana. The following sections describe the
main Program Derived Account (PDA) structures
and instructions for the Gateway programs.
Mainnet program addresses
Devnet program addresses
Account structures
The following section describes the main Program Derived Account (PDA)
structures for the Gateway programs. You can find the full IDLs for the Gateway
Solana programs at the following links:
GatewayDeposit
A Gateway Wallet data account used to track the balance of a particular
depositor and token.
| Parameter | Type | Description |
|---|
bump | u8 | The bump seed for the GatewayDeposit PDA. |
depositor | Pubkey | The depositor of the GatewayDeposit. |
token_mint | Pubkey | The mint of the token being deposited. |
available_amount | u64 | The available amount of the token. |
withdrawing_amount | u64 | The amount of the token pending withdrawal. |
withdrawal_block | u64 | The block number at which the withdrawal was initiated. |
GatewayDelegate
A Gateway Wallet data account used to store delegates.
| Parameter | Type | Description |
|---|
bump | u8 | The bump seed for the GatewayDelegate PDA. |
status | DelegateStatus | The status of the delegate. |
closeable_at_block | u64 | The block number at which the delegate can be closed. |
token | Pubkey | The mint of the token being delegated. |
depositor | Pubkey | The depositor of the delegate. |
delegate | Pubkey | The delegate address. |
Denylist
A Gateway Wallet data account used to store a single denylisted account. The
address being denylisted is implied in the PDA address, and the account itself
stores no additional data.
UsedTransferSpecHash
A Gateway Wallet data account used to store whether a TransferSpecHash has
been used, to prevent replay. The used TransferSpecHash is implied in the PDA
address, and the account itself stores no additional data.
GatewayMinter
Stores general configuration for the GatewayMinter program.
| Parameter | Type | Description |
|---|
bump | u8 | The bump seed for the GatewayMinter PDA. |
owner | Pubkey | The owner of the GatewayMinter. |
pending_owner | Pubkey | The pending owner of the GatewayMinter. |
pauser | Pubkey | The pauser of the GatewayMinter. |
token_controller | Pubkey | The token controller of the GatewayMinter. |
paused | bool | Whether the GatewayMinter is paused. |
enabled_attesters | Vec<Pubkey> | The enabled attesters of the GatewayMinter. |
local_domain | u32 | The local domain of the GatewayMinter. |
version | u32 | The version of the GatewayMinter. |
supported_tokens | Vec<Pubkey> | The supported tokens of the GatewayMinter. |
custody_token_account_bumps | Vec<u8> | The custody token account bumps of the GatewayMinter. |
GatewayWallet
Stores general configuration for the GatewayWallet program.
| Parameter | Type | Description |
|---|
bump | u8 | The bump seed for the GatewayWallet PDA. |
owner | Pubkey | The owner of the GatewayWallet. |
pending_owner | Pubkey | The pending owner of the GatewayWallet. |
pauser | Pubkey | The pauser of the GatewayWallet. |
denylister | Pubkey | The denylister of the GatewayWallet. |
token_controller | Pubkey | The token controller of the GatewayWallet. |
fee_recipient | Pubkey | The fee recipient of the GatewayWallet. |
local_domain | u32 | The local domain of the GatewayWallet. |
version | u32 | The version of the GatewayWallet. |
withdrawal_delay | u64 | The withdrawal delay of the GatewayWallet. |
paused | bool | Whether the GatewayWallet is paused. |
supported_tokens | Vec<Pubkey> | The supported tokens of the GatewayWallet. |
custody_token_account_bumps | Vec<u8> | The custody token account bumps of the GatewayWallet. |
burn_signers | Vec<Pubkey> | The burn signers of the GatewayWallet. |
Instructions
The following section describes the main instructions for the Gateway programs.
Instruction data uses Anchor-style Borsh encoding.
gatewayMint
Mints tokens to a recipient on Solana based on a signed attestation produced by
the Gateway API. The instruction supports two parameter encodings:
- Full attestation mode: Pass the full ReducedMintAttestation message and
its ECDSA signature as returned by the Transfer API.
- Parameter mode: Pass only the minimal fields that cannot be inferred
onchain; the program reconstructs the attestation and verifies the ECDSA
signature against it.
Account list
The Gateway Mint account list has five fixed accounts and three additional
accounts for each transfer in the attestation.
| Parameter | Type | Description |
|---|
payer | Signer | The payer of the transaction. |
destination_caller | Signer | The destination caller of the transaction. |
gateway_minter | Account<GatewayMinter> | The GatewayMinter account. |
system_program | Program<System> | The System program. |
token_program | Program<Token> | The Token program. |
Three additional ordered accounts are required in the remaining accounts list
for each transfer in the attestation:
| Parameter | Type | Description |
|---|
custody_token_account | Account<TokenAccount> | The custody token account of the token used in the transfer |
destination_recipient | Account<TokenAccount> | The destination recipient token account of the transfer |
transfer_spec_hash_account | Account<UsedTransferSpecHash> | The transfer spec hash account |
Full attestation mode (gateway_mint)
| Parameter | Type | Description |
|---|
attestation | Vec<u8> | The attestation to mint. |
signature | Vec<u8> | The signature of the attestation. |
Parameter mode (gateway_mint_with_params)
Saves transaction space by assuming certain fields or reading them from the
account list.
| Parameter | Type | Description |
|---|
is_default_destination_caller | bool | Whether the destination caller is the default. |
max_block_height | u64 | The maximum block height. |
elements | Vec<MintAttestationParams> | The attestation parameters. |
signature | Vec<u8> | The signature of the attestation. |
The MintAttestationParams type is defined as follows:
| Parameter | Type | Description |
|---|
value | u64 | The amount to mint. |
transfer_spec_hash | [u8; 32] | The transfer spec hash. |
hook_data | Vec<u8> | The hook data. |
deposit
Deposits tokens into the Gateway Wallet system.
- Deposit mode: Deposits tokens on behalf of the signer. The tokens are
transferred from the signer’s token account to the Gateway Wallet custody and
tracked in the signer’s balance.
- Deposit For mode: Deposits tokens on behalf of another depositor. The
tokens are transferred from the signer’s token account to the Gateway Wallet
custody and tracked in the specified depositor’s balance.
Account list
| Parameter | Type | Description |
|---|
payer | Signer | The payer of the transaction. |
owner | Signer | The owner of the transaction. |
gateway_wallet | Account<GatewayWallet> | The GatewayWallet account. |
owner_token_account | Account<TokenAccount> | The owner’s token account. |
custody_token_account | Account<TokenAccount> | The custody token account. |
deposit | Account<GatewayDeposit> | The GatewayDeposit account. |
sender_denylist | Account<Denylist> | The sender’s denylist account. |
depositor_denylist | Account<Denylist> | The depositor’s denylist account. |
system_program | Program<System> | The System program. |
token_program | Program<Token> | The Token program. |
Instruction data
deposit
| Parameter | Type | Description |
|---|
amount | u64 | Amount to deposit |
deposit_for
| Parameter | Type | Description |
|---|
amount | u64 | Amount to deposit |
depositor | Pubkey | Address to credit with the deposit |
initiateWithdrawal
Starts the withdrawal process. After a program-defined withdrawal_delay (in
slots), withdraw may be called to complete the withdrawal. Repeated calls add
to the amount and reset the delay timer.
Account list
| Parameter | Type | Description |
|---|
depositor | Signer | The depositor of the transaction. |
gateway_wallet | Account<GatewayWallet> | The GatewayWallet account. |
deposit | Account<GatewayDeposit> | The GatewayDeposit account. |
Instruction data
| Parameter | Type | Description |
|---|
amount | u64 | Amount to withdraw |
withdraw
Completes a withdrawal that was initiated at least withdrawal_delay earlier.
The full pending amount is withdrawn to the depositor’s token account.
Account list
| Parameter | Type | Description |
|---|
depositor | Signer | The depositor of the transaction. |
gateway_wallet | Account<GatewayWallet> | The GatewayWallet account. |
custody_token_account | Account<TokenAccount> | The custody token account. |
depositor_token_account | Account<TokenAccount> | The depositor’s token account. |
deposit | Account<GatewayDeposit> | The GatewayDeposit account. |
token_program | Program<Token> | The Token program. |
addDelegate
Allows a delegate to transfer the caller’s balance for the specified token.
Account list
| Parameter | Type | Description |
|---|
payer | Signer | The payer of the transaction. |
depositor | Signer | The depositor of the transaction. |
gateway_wallet | Account<GatewayWallet> | The GatewayWallet account. |
token_mint | Account<Mint> | The token mint. |
delegate_account | Account<GatewayDelegate> | The delegate account. |
depositor_denylist | Account<Denylist> | The depositor’s denylist account. |
delegate_denylist | Account<Denylist> | The delegate’s denylist account. |
system_program | Program<System> | The System program. |
Instruction data
| Parameter | Type | Description |
|---|
delegate | PubKey | The delegate of the transaction. |
removeDelegate
Revokes a previously granted delegate for the caller’s balance of the specified
token.
Revocation is respected by the Gateway API, which refuses BurnIntents signed by
a revoked delegate. However, revocation does not prevent a BurnIntent signed by
the delegate from being executed onchain. This design prevents malicious users
from blocking a burn transaction by pre-emptively revoking a signer.
Account list
| Parameter | Type | Description |
|---|
depositor | Signer | The depositor of the transaction. |
gateway_wallet | Account<GatewayWallet> | The GatewayWallet account. |
token_mint | Account<Mint> | The token mint. |
delegate_account | Account<GatewayDelegate> | The delegate account. |
depositor_denylist | Account<Denylist> | The depositor’s denylist account. |
Instruction data
| Parameter | Type | Description |
|---|
delegate | PubKey | The delegate of the transaction. |