Provided in the callback to orchestrate().

interface Orchestrator {
    asAmount: ((amount) => NatAmount);
    getBrandInfo: (<HoldingChain, IssuingChain>(denom) => {
        base: Chain<IssuingChain>;
        baseDenom: string;
        brand?: Brand;
        chain: Chain<HoldingChain>;
    });
    getChain: (<C>(chainName) => Promise<Chain<C>>);
    makeLocalAccount: (() => Promise<Guarded<{
        deposit(payment, optAmountShape?): Promise<Amount>;
        executeTx<MT>(messages): Promise<{
            [K in string | number | symbol]: JsonSafe<ResponseTo<MT[K<K>]>>
        }>;
        getAddress(): Promise<string>;
        getBalance(brand): Promise<NatAmount>;
        withdraw(amount): Promise<Payment<"nat">>;
    }>>);
}

Properties

asAmount: ((amount) => NatAmount)

Convert an amount described in native data to a local, structured Amount.

Type declaration

    • (amount): NatAmount
    • Parameters

      Returns NatAmount

Returns

the Amount in local structuerd format

getBrandInfo: (<HoldingChain, IssuingChain>(denom) => {
    base: Chain<IssuingChain>;
    baseDenom: string;
    brand?: Brand;
    chain: Chain<HoldingChain>;
})

For a denom, return information about a denom including the equivalent local Brand, the Chain on which the denom is held, and the Chain that issues the corresponding asset.

Type declaration

getChain: (<C>(chainName) => Promise<Chain<C>>)

Type declaration

makeLocalAccount: (() => Promise<Guarded<{
    deposit(payment, optAmountShape?): Promise<Amount>;
    executeTx<MT>(messages): Promise<{
        [K in string | number | symbol]: JsonSafe<ResponseTo<MT[K<K>]>>
    }>;
    getAddress(): Promise<string>;
    getBalance(brand): Promise<NatAmount>;
    withdraw(amount): Promise<Payment<"nat">>;
}>>)

Type declaration

    • (): Promise<Guarded<{
          deposit(payment, optAmountShape?): Promise<Amount>;
          executeTx<MT>(messages): Promise<{
              [K in string | number | symbol]: JsonSafe<ResponseTo<MT[K<K>]>>
          }>;
          getAddress(): Promise<string>;
          getBalance(brand): Promise<NatAmount>;
          withdraw(amount): Promise<Payment<"nat">>;
      }>>
    • Returns Promise<Guarded<{
          deposit(payment, optAmountShape?): Promise<Amount>;
          executeTx<MT>(messages): Promise<{
              [K in string | number | symbol]: JsonSafe<ResponseTo<MT[K<K>]>>
          }>;
          getAddress(): Promise<string>;
          getBalance(brand): Promise<NatAmount>;
          withdraw(amount): Promise<Payment<"nat">>;
      }>>