Sandbox

Beaker provides helper methods to work with a local sandbox.

Sandbox Accounts

class beaker.sandbox.SandboxAccount[source]

SandboxAccount is a simple dataclass to hold a sandbox account details

__init__(*, address: str, private_key: str) None
address: str

The address of a sandbox account

private_key: str

The base64 encoded private key of the account

sandbox.get_accounts(kmd_token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', wallet_name: str = 'unencrypted-default-wallet', wallet_password: str = '') list[beaker.sandbox.kmd.SandboxAccount]

gets all the accounts in the sandbox kmd, defaults to the unencrypted-default-wallet created on private networks automatically

sandbox.add_account(kmd_address: str = 'http://localhost:4002', kmd_token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', wallet_name: str = 'unencrypted-default-wallet', wallet_password: str = '') str

Adds a new account to the sandbox kmd

Algod Client

sandbox.get_algod_client(token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') AlgodClient

creates a new algod client using the default sandbox parameters

Indexer Client

sandbox.get_indexer_client(token: str = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') IndexerClient

creates a new indexer client using the default sandbox parameters