Expand description
Multisig Solana wallet with Timelock capabilities.
This program can be used to allow a smart wallet to govern anything a regular Pubkey can govern. One can use the smart wallet as a BPF program upgrade authority, a mint authority, etc.
To use, one must first create a SmartWallet account, specifying two important parameters:
- Owners - the set of addresses that sign transactions for the smart wallet.
- Threshold - the number of signers required to execute a transaction.
- Minimum Delay - the minimum amount of time that must pass before a Transaction can be executed. If 0, this is ignored.
Once the SmartWallet account is created, one can create a Transaction account, specifying the parameters for a normal Solana instruction.
To sign, owners should invoke the smart_wallet::approve instruction, and finally, smart_wallet::execute_transaction, once enough (i.e. SmartWallet::threshold) of the owners have signed.
Modules§
- accounts
- An Anchor generated module, providing a set of structs
mirroring the structs deriving
Accounts
, where each field is aPubkey
. This is useful for specifying accounts for a client. - approve
- Instruction handler for smart_wallet::approve.
- instruction
- An Anchor generated module containing the program’s set of
instructions, where each method handler in the
#[program]
mod is associated with a struct defining the input arguments to the method. These should be used directly, when one wants to serialize Anchor instruction data, for example, when speciying instructions on a client. - program
- Module representing the program.
- smart_
wallet - Goki smart wallet program.
- unapprove
- Instruction handler for smart_wallet::unapprove.
Structs§
- Approve
- Accounts for smart_wallet::approve.
- Auth
- Accounts for smart_wallet::set_owners and smart_wallet::change_threshold.
- Create
Smart Wallet - Accounts for smart_wallet::create_smart_wallet.
- Create
Subaccount Info - Accounts for smart_wallet::create_subaccount_info.
- Create
Transaction - Accounts for smart_wallet::create_transaction.
- Execute
Transaction - Accounts for smart_wallet::execute_transaction.
- Owner
Invoke Instruction - Accounts for smart_wallet::owner_invoke_instruction.
- Smart
Wallet - A SmartWallet is a multisig wallet with Timelock capabilities.
- Subaccount
Info - Mapping of a Subaccount to its SmartWallet.
- TXAccount
Meta - Account metadata used to define TXInstructions
- TXInstruction
- Instruction.
- Transaction
- A Transaction is a series of instructions that may be executed by a SmartWallet.
- Transaction
Approve Event - Emitted when a Transaction is approved.
- Transaction
Create Event - Emitted when a Transaction is proposed.
- Transaction
Execute Event - Emitted when a Transaction is executed.
- Transaction
Unapprove Event - Emitted when a Transaction is unapproved.
- Wallet
Change Threshold Event - Emitted when the threshold of a SmartWallet is changed.
- Wallet
Create Event - Emitted when a SmartWallet is created.
- Wallet
SetOwners Event - Emitted when the owners of a SmartWallet are changed.
Enums§
- Error
Code - Program errors.
- Subaccount
Type - Type of Subaccount.
Constants§
- DEFAULT_
GRACE_ PERIOD - Default number of seconds until a transaction expires.
- MAX_
DELAY_ SECONDS - Maximum timelock delay.
- NO_ETA
- Constant declaring that there is no ETA of the transaction.
- SECONDS_
PER_ DAY - Number of seconds in a day.
Statics§
- ID
- The static program ID
Functions§
- check_
id - Confirms that a given pubkey is equivalent to the program ID
- entry
- The Anchor codegen exposes a programming model where a user defines
a set of methods inside of a
#[program]
module in a way similar to writing RPC request handlers. The macro then generates a bunch of code wrapping these user defined methods into something that can be executed on Solana. - entrypoint⚠
- Safety
- handler
- Instruction handler for smart_wallet::approve.
- handler
- Instruction handler for smart_wallet::unapprove.
- id
- Returns the program ID