Skip to content

Accounts Calls

Calls on the blink_accounts module, submitted Borsh-encoded to the single Submit Transaction endpoint. Fields are listed in Borsh serialization order; see Encoding and Data Structures & Constants.

Add Delegation

blink_accounts.add_delegation

Add a delegation to a subaccount

FieldTypeRequiredDescription
subaccount_idSubAccountIdyesThe subaccount to add delegation to
delegateEthereumAddressyesThe address to delegate to
permissionsuint32yesPermissions to grant (raw u32 bitflags)
expiryOption<uint64>noOptional expiry timestamp (Unix ms)
nameOption<SizedSafeString_for_12>noOptional user-defined name (max 12 chars, printable ASCII)

Update Delegation

blink_accounts.update_delegation

Update an existing delegation

FieldTypeRequiredDescription
subaccount_idSubAccountIdyesThe subaccount the delegation belongs to
delegateEthereumAddressyesThe delegate address to update
permissionsuint32yesNew permissions (raw u32 bitflags)
expiryOption<uint64>noNew expiry (replaces old)
nameOption<SizedSafeString_for_12>noNew name (replaces old)

Remove Delegation

blink_accounts.remove_delegation

Remove a delegation from a subaccount

FieldTypeRequiredDescription
subaccount_idSubAccountIdyesThe subaccount to remove delegation from
delegateEthereumAddressyesThe delegate address to remove

Deposit

blink_accounts.deposit

Deposit tokens to a subaccount's spot balance

FieldTypeRequiredDescription
subaccount_idSubAccountIdyesThe subaccount to deposit to
token_idTokenIdyesThe token to deposit
amountuint64yesAmount to deposit (in atoms)
addressOption<EthereumAddress>noOptional address to credit. Defaults to the transaction sender.

Withdraw

blink_accounts.withdraw

Withdraw tokens from a subaccount's spot balance

FieldTypeRequiredDescription
subaccount_idSubAccountIdyesThe subaccount to withdraw from
token_idTokenIdyesThe token to withdraw
amountuint64yesAmount to withdraw (in atoms)

Internal Transfer

blink_accounts.internal_transfer

Transfer tokens between subaccounts of the same owner

FieldTypeRequiredDescription
ownerOption<EthereumAddress>noOptional owner when signed by a delegate
from_subaccount_idSubAccountIdyesSource subaccount
to_subaccount_idSubAccountIdyesDestination subaccount
token_idTokenIdyesToken to transfer
amountuint64yesAmount to transfer (in atoms)

External Transfer

blink_accounts.external_transfer

Transfer tokens to another user's subaccount

FieldTypeRequiredDescription
from_ownerOption<EthereumAddress>noOptional owner address when signed by a delegate
from_subaccount_idSubAccountIdyesSource subaccount (caller must be owner or delegate with EXTERNAL_TRANSFER)
to_ownerEthereumAddressyesDestination owner address
to_subaccount_idSubAccountIdyesDestination subaccount
token_idTokenIdyesToken to transfer
amountuint64yesAmount to transfer (in atoms)

Set Limits

blink_accounts.set_limits

Update account limits (admin only)

Protocol / admin operation.

FieldTypeRequiredDescription
max_subaccounts_per_owneruint16yesMaximum subaccounts per owner
max_delegations_per_subaccountuint8yesMaximum delegations per subaccount
max_spot_open_ordersuint16yesMaximum spot open orders per subaccount

Create Spot Asset

blink_accounts.create_spot_asset

Register a new spot asset (admin only)

Protocol / admin operation.

FieldTypeRequiredDescription
token_idTokenIdyesThe token id to register