Account
Account Management
Account management for Saline SDK.
This module provides comprehensive account management for the Saline protocol, including both individual subaccounts (key pairs) and multi-account management.
- class saline_sdk.account.Account[source]
Bases:
objectHigh-level account management.
Acts as a container for subaccounts and provides a user-friendly interface for managing keys and performing wallet operations.
Initialize an empty account.
- classmethod from_mnemonic(mnemonic, base_path='m/12381/997')[source]
Create an account from a mnemonic phrase.
- Parameters:
- Return type:
- Returns:
Account instance
- Raises:
ValueError – If the mnemonic is invalid or the base_path is invalid
- create_subaccount(label, path=None)[source]
Create a new subaccount.
- Parameters:
- Return type:
- Returns:
Created subaccount
- Raises:
ValueError – If account not initialized or name exists
- get_subaccount(label)[source]
Get a subaccount by label.
- transfer(to, amount, currency='USDC', from_subaccount=None)[source]
Create a transfer transaction.
- Parameters:
- Return type:
- Returns:
Signed transaction
- Raises:
ValueError – If no source subaccount specified or found
- class saline_sdk.account.Subaccount(private_key_bytes, public_key_bytes=None, path=None, label=None)[source]
Bases:
objectIndividual Saline subaccount representing a single key pair. Handles cryptographic operations and always derived from an Account.
Initialize a subaccount with private key bytes.
- Parameters:
- __init__(private_key_bytes, public_key_bytes=None, path=None, label=None)[source]
Initialize a subaccount with private key bytes.