create_accounts
Create one or more Account
s.
Event
The account to create. See Account
for constraints.
Result
Results are listed in this section in order of descending precedence — that is, if more than one error is applicable to the account being created, only the result listed first is returned.
ok
The account was successfully created; it did not previously exist.
Note that ok
is generated by the client implementation; the network protocol does not include a
result when the account was successfully created.
linked_event_failed
The account was not created. One or more of the accounts in the linked chain is invalid, so the whole chain failed.
linked_event_chain_open
The account was not created.
The Account.flags.linked
flag was set on the last event in the
batch, which is not legal. (flags.linked
indicates that the chain continues to the next
operation).
timestamp_must_be_zero
The account was not created.
The Account.timestamp
is nonzero, but must be zero.
The cluster is responsible for setting this field.
reserved_field
The account was not created.
Account.reserved
is nonzero, but must be zero.
reserved_flag
The account was not created.
Account.flags.reserved
is nonzero, but must be zero.
id_must_not_be_zero
The account was not created.
Account.id
is zero, which is a reserved value.
id_must_not_be_int_max
The account was not created.
Account.id
is 2^128 - 1
, which is a reserved value.
flags_are_mutually_exclusive
The account was not created.
An account cannot be created with the specified combination of
Account.flags
.
The following flags are mutually exclusive:
debits_pending_must_be_zero
The account was not created.
Account.debits_pending
is nonzero, but must be zero.
An account's debits and credits are only modified by transfers.
debits_posted_must_be_zero
The account was not created.
Account.debits_posted
is nonzero, but must be zero.
An account's debits and credits are only modified by transfers.
credits_pending_must_be_zero
The account was not created.
Account.credits_pending
is nonzero, but must be zero.
An account's debits and credits are only modified by transfers.
credits_posted_must_be_zero
The account was not created.
Account.credits_posted
is nonzero, but must be zero.
An account's debits and credits are only modified by transfers.
ledger_must_not_be_zero
The account was not created.
Account.ledger
is zero, but must be nonzero.
code_must_not_be_zero
The account was not created.
Account.code
is zero, but must be nonzero.
exists_with_different_flags
An account with the same id
already exists, but with different flags
.
exists_with_different_user_data_128
An account with the same id
already exists, but with different
user_data_128
.
exists_with_different_user_data_64
An account with the same id
already exists, but with different
user_data_64
.
exists_with_different_user_data_32
An account with the same id
already exists, but with different
user_data_32
.
exists_with_different_ledger
An account with the same id
already exists, but with different ledger
.
exists_with_different_code
An account with the same id
already exists, but with different code
.
exists
An account with the same id
already exists.
With the possible exception of the following fields, the existing account is identical to the account in the request:
debits_pending
debits_posted
credits_pending
credits_posted
To correctly recover from application crashes
many applications should handle
exists
exactly as ok
.
Client libraries
For language-specific docs see:
Internals
If you're curious and want to learn more, you can find the source code
for creating an account in
src/state_machine.zig. Search
for fn create_account(
and fn execute(
.