ADOSchemaAPI

Schema base URL:

'https://api.andromedaprotocol.io/v1/schema'

Class

export default class ADOSchemaAPI extends ADOAPI {
  constructor(client: AndromedaClient, public address: string = "") {
    super(client, address);
  }

getSchemaFromVersion

Gets the schema for the key in the schemadb

 private async getSchemaFromVersion<T = ContractSchema>(adoVersion: string, subSchema = 'default') {
    const [adoType, version] = adoVersion.split('@');
    const subPath = subSchema === 'default' ? adoType : subSchema;
    const schema: T = await axios.get(`${ADOSchemaAPI.SCHEMA_BASE_URL}/raw/${adoType}/${version}/${subPath}`).then(res => res.data);
    return {
      schema,
      adoVersion: adoVersion
    }
  }
Name
Type
Description

adoVersion

string

The version of the ADO.

getSchemaFromCodeId

Gets the schema for the provided code Id

Name
Type
Description

codeId

number

The code Id of the ADO to fetch the schema for.

getSubSchemaFromCodeId

Gets the sub schema, like receive schema, from the codeId. Similar to getSchemaFromCodeId

Name
Type
Description

codeId

number

The code Id of the ADO to fetch the schema for.

subKey

string

The subkey for the subschema.

Last updated