Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Document token accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
gre committed Jun 11, 2019
1 parent a5d0d2f commit 820eced
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/types/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ export type Account = {
// A configuration for the endpoint to use. (usecase: Ripple node)
endpointConfig?: ?string,

// An account can have sub accounts, in that case they are called "token accounts".
// tokenAccounts are tokens among a blockchain of the parent account currency, attached to that same parent account.
// CONVENTION:
// a TokenAccount is living inside an Account but is not an entity on its own,
// therefore, there is no .parentAccount in it, which will means you will need to always have a tuple of (parentAccount, account)
// we will use the naming (parentAccount, account) everywhere because a token account is not enough and you need the full context with this tuple.
// These are two valid examples:
// I'm inside a ZRX token account of Ethereum 1: { parentAccount: Ethereum 1, account: ZRX }
// I'm just inside the Ethereum 1: { account: Ethereum 1, parentAccount: undefined }
// "account" is the primary account that you use/select/view. It is a `Account | TokenAccount`.
// "parentAccount", if available, is the contextual account. It is a `?Account`.
tokenAccounts?: TokenAccount[]
};

Expand Down

0 comments on commit 820eced

Please sign in to comment.