API Classes

ADOAPI Class

API to interact with Andromeda ADOs.

export default class ADOAPI {
  constructor(
    protected client: AndromedaClient,
    protected address: string = ""
  ) {}

Execute Messages

andromedaReceive

Converts a message object to an Andromeda Execute message.

 protected andromedaReceive(msg: Msg) {
    return { andr_receive: msg };
  }
Name
Type
Description

msg

The message to convert.

Msg

updateOwnerMsg

Returns an update owner message.

Name
Type
Description

newOwner

string

The address to assign as the new owner.

expiration

Optional expiration for the ownership request. Defaults to never.

Expiration

updateOwner

Updates the owner for the given ADO.

Name
Type
Description

newOwner

string

The address of the new owner.

addr

string

The address of the contract we are executing on.

expiration

Optional expiration. Defaults to never.

fee

Optional fee attached.

memo

string

Optional memo to attached.

Fee

Check StdFee.

updateAppContractMsg

Returns an update app contract message.

Name
Type
Description

appContract

string

The new app contract.

updateAppContract

Updates the app contract for a given ADO.

Name
Type
Description

appContract

string

The new app contract.

addr

string

The address of the contract we are executing on.

fee

Optional fee to attach.

memo

string

Optional memo to attach.

registerModuleMsg

Returns a register module message.

Name
Type
Description

module

Module

The module to register.

Module

AndrAddress

Object used to define an address used with the Andromeda ecosystem.

registerModule

Register a module with an ADO.

Name
Type
Description

module

The module to register.

addr

string

The address of the contract we are executing on.

fee

Optional fee to attach.

memo

string

Optional memo to attach.

deregisterModuleMsg

Returns a deregister module message.

Name
Type
Description

id

number

The id number (index) of the module to deregister.

deregisterModule

Deregisters a module with an ADO.

Name
Type
Description

id

number

The id number (index) of the module to deregister.

addr

string

The address of the contract we are executing on.

fee

Optional fee to attach.

memo

string

Optional memo to attach.

alterModuleMsg

Returns am alter module message.

Name
Type
Description

id

number

The id number (index) of the module to alter.

module

The new module to replace the old one.

alterModule

Alters a module within an ADO.

Name
Type
Description

id

number

The id number (index) of the module to alter.

module

The new module to replace the old one.

addr

string

The address of the contract we are executing on.

fee

Optional fee to attach.

memo

string

Optional memo to attach.

Query Messages

ownerQuery

Returns an owner query message.

getOwner

Gets the owner address for a provided ADO.

Name
Type
Description

addr

string

The address of the contract we are querying.

isOwner

Validates if a given address is an owner for the given ADO.

Name
Type
Description

addr

string

The address we are checking.

contractAddr

string

The address of the contract we are querying.

typeQuery

Returns an ADO type query message.

getType

Gets the ADO type for the provided ADO.

Name
Type
Description

addr

string

The address of the contract we are querying.

publisherQuery

Returns a publisher query message.

getPublisher

Gets the original publisher of the given ADO.

Name
Type
Description

addr

string

The address of the contract we are querying.

createdHeightQuery

Returns a block height creation query.

getCreatedHeight

Gets the block height at which the given ADO was created.

Name
Type
Description

addr

string

The address of the contract we are querying.

versionQuery

Returns a version query.

getVersion

Gets the version for a given ADO.

Name
Type
Description

addr

string

The address of the contract we are querying.

moduleQuery

Returns a module query.

Name
Type
Description

id

string or number

The id of the module to query.

getModule

Gets the module of the specified id for a given ADO.

Name
Type
Description

id

string or number

The id of the module to query.

addr

string

The address of the contract we are querying.

moduleIdsQuery

Returns a module IDs query.

getModuleIds

Gets all module IDs for a given ADO.

Name
Type
Description

addr

string

The address of the contract we are querying.

getModules

Gets all modules for a given ADO.

Name
Type
Description

addr

string

The address of the contract we are querying.

Last updated