Spend wallet-held asset using spender authorization and stored allowance.
Auth:
Effects:
Notes:
spend_asset validates allowance, reduces it correctly,
and transfers from wallet-controlled balance.fn spend(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
spender: soroban_sdk::Address,
amount: i128,
to: soroban_sdk::Address,
) -> Result<(), WalletError>
Approve a spender to use wallet-held asset up to a given amount.
Auth:
Effects:
Notes:
fn approve(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
spender: soroban_sdk::Address,
amount: i128,
tx_signature: Option>,
) -> Result<(), WalletError>
Deposit asset into the wallet.
Auth:
Effects:
Notes:
take_asset transfers funds into the current contract context.fn deposit(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
) -> Result<(), WalletError>
Upgrade the current contract wasm.
Auth:
Effects:
Notes:
fn upgrade(
env: soroban_sdk::Env,
wasm: soroban_sdk::BytesN<32>,
tx_signature: Option>,
) -> Result<(), WalletError>
Withdraw asset from the wallet to a recipient.
Auth:
Effects:
Notes:
fn withdraw(
env: soroban_sdk::Env,
to: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
tx_signature: Option>,
) -> Result<(), WalletError>
Return the current authorization nonce.
Effects:
Notes:
fn get_nonce(env: soroban_sdk::Env) -> u64
Return the linked external owner wallet, if set.
Effects:
Notes:
fn get_owner(env: soroban_sdk::Env) -> Option
Set a asset-specific spend limit. Auth:
Effects:
Notes:
fn set_limit(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
limit: i128,
tx_signature: Option>,
) -> Result<(), WalletError>
Return wallet balance for the specified asset.
Effects:
Notes:
fn get_balance(env: soroban_sdk::Env, asset: soroban_sdk::Address) -> i128
Return the configured factory contract address, if set.
Effects:
Notes:
fn get_factory(env: soroban_sdk::Env) -> Option
Return the stored passkey, if configured.
Effects:
Notes:
fn get_passkey(env: soroban_sdk::Env) -> Option>
Invoke an external contract/dapp through the wallet.
Auth:
Effects:
Notes:
fn dapp_invoker(
env: soroban_sdk::Env,
contract_id: soroban_sdk::Address,
func: soroban_sdk::Symbol,
args: Option>,
auth_vec: Option<
soroban_sdk::Vec>,
>,
tx_signature: Option>,
) -> Result<(), WalletError>
Return the configured registry contract address, if set.
Effects:
Notes:
fn get_registry(env: soroban_sdk::Env) -> Option
Initialize wallet state and linked contract addresses.
Auth:
Effects:
Notes:
fn __constructor(
env: soroban_sdk::Env,
passkey: soroban_sdk::BytesN<77>,
bls_keys: soroban_sdk::Vec>,
registry: soroban_sdk::Address,
fee_manager: soroban_sdk::Address,
social_router: soroban_sdk::Address,
factory: soroban_sdk::Address,
) -> Result<(), WalletError>
Return current allowance for a spender on a asset.
Effects:
Notes:
fn get_allowance(
env: soroban_sdk::Env,
asset: soroban_sdk::Address,
spender: soroban_sdk::Address,
) -> i128
Compute the authorization payload hash for a function call.
Effects:
Notes:
fn get_tx_payload(
env: soroban_sdk::Env,
func: soroban_sdk::String,
args: soroban_sdk::Vec,
) -> soroban_sdk::BytesN<32>
Return the configured fee manager contract address, if set.
Effects:
Notes:
fn get_fee_manager(env: soroban_sdk::Env) -> Option
Return the configured social router contract address, if set.
Effects:
Notes:
fn get_social_router(env: soroban_sdk::Env) -> Option
Set or replace the linked external owner wallet.
Auth:
Effects:
Notes:
fn set_external_wallet(
env: soroban_sdk::Env,
external_wallet: soroban_sdk::Address,
tx_signature: Option>,
) -> Result<(), WalletError>
Update the default spend limit used by asset operations.
Auth:
Effects:
Notes:
fn update_default_limit(
env: soroban_sdk::Env,
limit: i128,
tx_signature: Option>,
) -> Result<(), WalletError>
Return wallet access settings.
Effects:
Notes:
fn get_account_parameters(env: soroban_sdk::Env) -> AccessSettings