An object that supports high-level operations for an account on a remote chain.

interface BaseOrchestrationAccount {
    delegate: ((validator, amount) => Promise<void>);
    deposit: ((payment) => Promise<void>);
    getAddress: (() => ChainAddress);
    getBalance: ((denom) => Promise<ChainAmount>);
    getBalances: (() => Promise<ChainAmount[]>);
    getChainAcccount: (() => Promise<ChainAccount>);
    getDelegation: ((validator) => Promise<Delegation>);
    getDelegations: (() => Promise<Delegation[]>);
    getDenomTrace: ((denom) => Promise<{
        base_denom: string;
        path: string;
    }>);
    getRedelegation: ((srcValidator, dstValidator?) => Promise<Redelegation>);
    getRedelegations: (() => Promise<Redelegation[]>);
    getReward: ((validator) => Promise<ChainAmount[]>);
    getRewards: (() => Promise<ChainAmount[]>);
    getUnbondingDelegation: ((validator) => Promise<UnbondingDelegation>);
    getUnbondingDelegations: (() => Promise<UnbondingDelegation[]>);
    redelegate: ((srcValidator, dstValidator, amount) => Promise<void>);
    send: ((toAccount, amount) => Promise<void>);
    transfer: ((amount, destination, memo?) => Promise<void>);
    transferSteps: ((amount, msg) => Promise<void>);
    undelegate: ((delegation) => Promise<void>);
    undelegateAll: ((delegations) => Promise<void>);
    withdrawReward: ((validator) => Promise<ChainAmount[]>);
    withdrawRewards: (() => Promise<ChainAmount[]>);
}

Properties

delegate: ((validator, amount) => Promise<void>)

Delegate an amount to a validator. The promise settles when the delegation is complete.

Type declaration

    • (validator, amount): Promise<void>
    • Parameters

      • validator: ValidatorAddress

        the validator to delegate to

      • amount: any

        the amount to delegate

      Returns Promise<void>

Returns

void

deposit: ((payment) => Promise<void>)

deposit payment from zoe to the account. For remote accounts, an IBC Transfer will be executed to transfer funds there.

Type declaration

    • (payment): Promise<void>
    • Parameters

      • payment: Payment

      Returns Promise<void>

getAddress: (() => ChainAddress)

Type declaration

Returns

the address of the account on the remote chain

getBalance: ((denom) => Promise<ChainAmount>)

Type declaration

Returns

the balance of a specific denom for the account.

getBalances: (() => Promise<ChainAmount[]>)

Type declaration

Returns

an array of amounts for every balance in the account.

getChainAcccount: (() => Promise<ChainAccount>)

Type declaration

Returns

the underlying low-level operation object.

getDelegation: ((validator) => Promise<Delegation>)

Type declaration

Returns

the active delegation from the account to a specific validator. Return an empty Delegation if there is no delegation.

TODO what does it return if there's no delegation?

getDelegations: (() => Promise<Delegation[]>)

Type declaration

Returns

all active delegations from the account to any validator (or [] if none)

getDenomTrace: ((denom) => Promise<{
    base_denom: string;
    path: string;
}>)

Type declaration

    • (denom): Promise<{
          base_denom: string;
          path: string;
      }>
    • Parameters

      • denom: string

      Returns Promise<{
          base_denom: string;
          path: string;
      }>

getRedelegation: ((srcValidator, dstValidator?) => Promise<Redelegation>)

Type declaration

getRedelegations: (() => Promise<Redelegation[]>)

Type declaration

getReward: ((validator) => Promise<ChainAmount[]>)

Get the rewards pending with a specific validator.

Type declaration

Returns

the amount of the account's rewards pending from a specific validator

getRewards: (() => Promise<ChainAmount[]>)

Get the pending rewards for the account.

Type declaration

Returns

the amounts of the account's rewards pending from all validators

getUnbondingDelegation: ((validator) => Promise<UnbondingDelegation>)

Type declaration

Returns

the unbonding delegations from the account to a specific validator (or [] if none)

getUnbondingDelegations: (() => Promise<UnbondingDelegation[]>)

Type declaration

Returns

the unbonding delegations from the account to any validator (or [] if none)

redelegate: ((srcValidator, dstValidator, amount) => Promise<void>)

Redelegate from one delegator to another. Settles when teh redelegation is established, not 21 days later.

Type declaration

    • (srcValidator, dstValidator, amount): Promise<void>
    • Parameters

      • srcValidator: ValidatorAddress

        the current validator for the delegation.

      • dstValidator: ValidatorAddress

        the validator that will receive the delegation.

      • amount: any

        how much to redelegate.

      Returns Promise<void>

Returns

send: ((toAccount, amount) => Promise<void>)

Transfer amount to another account on the same chain. The promise settles when the transfer is complete.

Type declaration

    • (toAccount, amount): Promise<void>
    • Parameters

      • toAccount: ChainAddress

        the account to send the amount to. MUST be on the same chain

      • amount: any

        the amount to send

      Returns Promise<void>

Returns

void

transfer: ((amount, destination, memo?) => Promise<void>)

Transfer an amount to another account, typically on another chain. The promise settles when the transfer is complete.

Type declaration

    • (amount, destination, memo?): Promise<void>
    • Parameters

      • amount: any

        the amount to transfer.

      • destination: ChainAddress

        the account to transfer the amount to.

      • Optional memo: string

        an optional memo to include with the transfer, which could drive custom PFM behavior

      Returns Promise<void>

Returns

void

TODO document the mapping from the address to the destination chain.

transferSteps: ((amount, msg) => Promise<void>)

Transfer an amount to another account in multiple steps. The promise settles when the entire path of the transfer is complete.

Type declaration

    • (amount, msg): Promise<void>
    • Parameters

      • amount: any

        the amount to transfer

      • msg: TransferMsg

        the transfer message, including follow-up steps

      Returns Promise<void>

Returns

void

undelegate: ((delegation) => Promise<void>)

Undelegate a delegation. The promise settles when the undelegation is complete.

Type declaration

    • (delegation): Promise<void>
    • Parameters

      • delegation: Delegation

        the delegation to undelegate

      Returns Promise<void>

Returns

void

undelegateAll: ((delegations) => Promise<void>)

Undelegate multiple delegations (concurrently). The promise settles when all the delegations are undelegated.

TODO: document error behavior in case some unbondings fail

Type declaration

    • (delegations): Promise<void>
    • Parameters

      Returns Promise<void>

Returns

withdrawReward: ((validator) => Promise<ChainAmount[]>)

Withdraw rewards from a specific validator. The promise settles when the rewards are withdrawn.

Type declaration

Returns

withdrawRewards: (() => Promise<ChainAmount[]>)

Withdraw rewards from all validators. The promise settles when the rewards are withdrawn.

Type declaration

Returns

The total amounts of rewards withdrawn