๐ŸšงAPI Reference

!This page is under maintenance

Keep in mind our global object/provider is accessible from window.vectis

Enable connection

In order to allow a website to read user account information and prepare transaction is necessary call to enable method. This will create a popup asking for user authorization, in case the extension is locked, it will open the unlock popup in first instance.

window.vectis.cosmos.enable(chainIds: string | string[]): Promise<void>;

Note: it will expose the account selected in account section.

Get account information

After an user give permission for reading account information, calling to getKey method will return the account information.

window.vectis.cosmos.getKey(chainId: string): Promise<Key>
interface Key {
  algo: Algo;
  name: string;
  pubKey: Uint8Array // Vectis accounts use controller pub key
  address: string;
  isNanoLedger: boolean;
  isVectisAccount: boolean;

Note: In case of calling getKey before enable, it will follow enable flow before getKey.

Sign Amino

This methods allow to sign transaction with amino encoding.

window.vectis.cosmos.signAmino(signerAddress: string, doc: StdSignDoc): Promise<AminoSignResponse>
interface StdSignDoc {
  readonly chain_id: string;
  readonly account_number: string;
  readonly sequence: string;
  readonly fee: StdFee;
  readonly msgs: readonly AminoMsg[];
  readonly memo: string;
export interface AminoSignResponse {
   * The sign doc that was signed.
   * This may be different from the input signDoc when the signer modifies
   * it as part of the signing process.
  readonly signed: StdSignDoc;
  readonly signature: StdSignature;

Note: It's necessary to enable a connection, before using this method.

Sign Direct

This methods allow to sign transaction with protobuf encoding.

window.vectis.cosmos.signDirect(signerAddress: string, doc: SignDoc): Promise<DirectSignResponse>
interface SignDoc {
   * body_bytes is protobuf serialization of a TxBody that matches the
   * representation in TxRaw.
  bodyBytes: Uint8Array;
   * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
   * representation in TxRaw.
  authInfoBytes: Uint8Array;
   * chain_id is the unique identifier of the chain this transaction targets.
   * It prevents signed transactions from being used on another chain by an
   * attacker
  chainId: string;
  /** account_number is the account number of the account in state */
  accountNumber: Long;
export interface DirectSignResponse {
  * The sign doc that was signed.
  * This may be different from the input signDoc when the signer modifies
  * it as part of the signing process.
  readonly signed: SignDoc;
  readonly signature: StdSignature;

Get Signer

In this field we could find different kind of signer and we are explain the difference among them. As we saw previously there are different kind of encoding, there are direct or amino, so depending on what method is used will be possible to sign one kind of txs or another.

Get Accounts

When any of these methods are invoked, they return an object structure with two or three properties. All of them has one property in common which is getAccounts.

getAccounts(): Promise<readonly AccountData[]>;
interface AccountData {
  /** A printable address (typically bech32 encoded) */
  readonly address: string;
  readonly algo: Algo;
  readonly pubkey: Uint8Array;

Amino Signer

window.vectis.cosmos.getOfflineSignerAmino(chainId: string): OfflineAminoSigner;
interface OfflineAminoSigner {
  readonly getAccounts: () => Promise<readonly AccountData[]>;
  readonly signAmino: (signerAddress: string, signDoc: StdSignDoc) => Promise<AminoSignResponse>;

Note: This signer only can sign amino encoding txs.

Direct Signer

window.vectis.cosmos.getOfflineSignerDirect(chainId: string): OfflineDirectSigner;
interface OfflineDirectSigner {
  readonly getAccounts: () => Promise<readonly AccountData[]>;
  readonly signDirect: (signerAddress: string, signDoc: SignDoc) => Promise<DirectSignResponse>;

Note: This signer only can sign protobuf encoding txs.

Amino & Direct Signer

window.vectis.cosmos.getOfflineSigner(chainId: string): OfflineSigner;
type OfflineSigner = OfflineAminoSigner & OfflineDirectSigner;

Note: This signer return three properties: signDirect, signAmino and getAccounts. Allowing to dApp or third party libraries select their preference in the signature.

Auto Signer

This method is a little bit different to the others because before to return a signer, the method evaluate what should return base on some internals parameters.

Ledger users only can use amino encoding, since the cosmos app doesn't support protobuf

window.vectis.cosmos.getOfflineSignerAuto(chainId: string): Promise<OfflineAminoSigner | OfflineDirectSigner>;


This method is usually use for sign a message to prove ownership of an account.

window.vectis.cosmos.signArbitrary(chainId: string, signerAddress: string, message: string | Uint8Array): Promise<AminoSignResponse>;


This method is used to verify a message signed with sign arbitrary, the signature result from signArbitrary method should provided as last parameter.

window.vectis.cosmos.verifyArbitrary(chainId: string, signerAddress: string, message: string | Uint8Array, signature: StdSignature): Promise<boolean>;

Get supported chains

window.vectis.cosmos.getSupportedChains(): Promise<ChainInfo[]>;

Add custom chains

window.vectis.cosmos.suggestChains(chainsInfo: ChainInfo[]): Promise<void>;

Note: You can find chain interface in the page below.

Last updated