Low level object that supports queries and operations for an account on a remote chain.

interface IcaAccount {
    deactivate: (() => Promise<void>);
    executeEncodedTx: ((msgs: JsonSafe<Any>[], opts?: Partial<Omit<TxBody, "messages">>) => Promise<string>);
    executeTx: ((msgs: {
        @type: string;
    }[]) => Promise<string>);
    getAddress: (() => ChainAddress);
    getLocalAddress: (() => `/ibc-port/${string}`);
    getPort: (() => Port);
    getRemoteAddress: (() => `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`);
    reactivate: (() => Promise<void>);
}

Properties

deactivate: (() => Promise<void>)

Deactivates the ICA account by closing the ICA channel. The Port is persisted so holders can always call .reactivate() to re-establish a new channel with the same chain address. CAVEAT: Does not retrieve assets so they may be lost if left.

if connection is not available or already deactivated

executeEncodedTx: ((msgs: JsonSafe<Any>[], opts?: Partial<Omit<TxBody, "messages">>) => Promise<string>)

Submit a transaction on behalf of the remote account for execution on the remote chain.

Type declaration

    • (msgs, opts?): Promise<string>
    • Parameters

      • msgs: JsonSafe<Any>[]

        records for the transaction

      • Optionalopts: Partial<Omit<TxBody, "messages">>

        optional parameters for the Tx, like timeoutHeight and memo

      Returns Promise<string>

      acknowledgement string

executeTx: ((msgs: {
    @type: string;
}[]) => Promise<string>)

Submit a transaction on behalf of the remote account for execution on the remote chain.

Type declaration

    • (msgs): Promise<string>
    • Parameters

      • msgs: {
            @type: string;
        }[]

        records for the transaction

      Returns Promise<string>

      acknowledgement string

getAddress: (() => ChainAddress)

Type declaration

getLocalAddress: (() => `/ibc-port/${string}`)

Type declaration

    • (): `/ibc-port/${string}`
    • Returns `/ibc-port/${string}`

      the address of the local channel

getPort: (() => Port)

Type declaration

    • (): Port
    • Returns Port

      the port the ICA channel is bound to

getRemoteAddress: (() => `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`)

Type declaration

    • (): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`
    • Returns `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`

      the address of the remote channel

reactivate: (() => Promise<void>)

Reactivates the ICA account by re-establishing a new channel with the original Port and requested address. If a channel is closed for an unexpected reason, such as a packet timeout, an automatic attempt to re will be made and the holder should not need to call .reactivate().

if connection is currently active