ProtectedclientReadonlycurrentCurrent account data.
Protectedeip712ProtectedlistenersGet the account balance of the current account. This method returns the account balance of the current user, including settled, credit, debit, and unclaimed earnings amounts.
Deposit tokens from wallet to account
account password
amount to transfer
blockchain provider, 'base' or 'etherlink' defaults to 'base'
ProtectedemitCreate Ethers.js Wallet instance from username and password. This method is used internally to create a wallet for the user. You can use this method to create a wallet if you need to sign transactions.
Sogni account username
Sogni account password
Login with username and password. WebSocket connection is established after successful login.
Whether to establish a long-lived session. Default is false. Only applicable for cookie-based authentication.
Refresh the balance of the current account.
Usually, you don't need to call this method manually. Balance is updated automatically through WebSocket events. But you can call this method to force a balance refresh. Note that will also trigger updated event on the current account.
Switch between fast and relaxed networks. This will change default network used to process projects. After switching, client will receive list of AI models available for on selected network.
Network type to switch to
Get the transaction history of the current account.
Transaction history query parameters
Transaction history entries and next query parameters
Get the balance of the wallet address.
This method is used to get the balance of the wallet address. It returns $SOGNI and ETH balance.
blockchain provider, 'base' or 'etherlink' defaults to 'base'
Withdraw funds from the current account to wallet.
account password
amount of tokens to withdraw from account to wallet
blockchain provider, 'base' or 'etherlink' defaults to 'base'
Account API methods that let you interact with the user's account. Can be accessed via
sogni.account. Look for more samples below.Example: Retrieve the current account balance