getInscriptions

List inscriptions of current account.

Method

async function getInscriptions(cursor: number, size: number): InscriptionResponse

Params

  • cursoroptional number Initial index, Default is 0

  • sizeoptional number Query quantity, Default is 20

Response

export type InscriptionResponse = {
  total: number;
  list: InscriptionInfo[];
};

export type InscriptionInfo = {
  inscriptionId: string;
  inscriptionNumber: number;
  address: string;
  outputValue: number;
  preview: string;
  content: string;
  contentLength: number;
  contentType: string;
  timestamp: number;
  genesisTransaction: string;
  location: string;
  output: string;
  offset: number;
};

Example

const provider = (window.$onekey && window.$onekey.btc) || window.unisat;

const inscriptions = async provider.getInscriptions();

Demo

Last updated