Interface: OrdinalsClient
ordinal-api.OrdinalsClient
Implemented by
Methods
getInscriptionFromId
▸ getInscriptionFromId(id
): Promise
\<InscriptionJson
\<InscriptionId
, SatPoint
>>
Retrieves an inscription based on its ID.
Parameters
Name | Type | Description |
---|---|---|
id | InscriptionId | The ID of the inscription to retrieve. |
Returns
Promise
\<InscriptionJson
\<InscriptionId
, SatPoint
>>
A Promise that resolves to the inscription data.
Example
const client = new DefaultOrdinalsClient("regtest");
let inscriptionId = InscriptionId.fromString("enter_your_inscription_id_here");
const inscription = await client.getInscriptionFromId(inscriptionId);
console.log("Inscription:", inscription);
Defined in
ordinal-api/index.ts:334
getInscriptions
▸ getInscriptions(): Promise
\<InscriptionsJson
\<InscriptionId
>>
Retrieves a list of inscriptions.
Returns
Promise
\<InscriptionsJson
\<InscriptionId
>>
A Promise that resolves to a inscriptions data.
Example
const client = new DefaultOrdinalsClient("regtest");
const inscriptions = await client.getInscriptions();
console.log("Inscriptions:", inscriptions);
Defined in
ordinal-api/index.ts:347
getInscriptionsFromBlock
▸ getInscriptionsFromBlock(height
): Promise
\<InscriptionsJson
\<InscriptionId
>>
Retrieves an inscription based on its block height.
Parameters
Name | Type | Description |
---|---|---|
height | number | The block height of the inscription to retrieve. |
Returns
Promise
\<InscriptionsJson
\<InscriptionId
>>
A Promise that resolves to the inscription data.
Example
const client = new DefaultOrdinalsClient("regtest");
let block: number = "enter_your_block_number_here";
const inscriptions = await client.getInscriptionsFromBlock(block);
console.log("Inscriptions:", inscriptions);
Defined in
ordinal-api/index.ts:362
getInscriptionsFromOutPoint
▸ getInscriptionsFromOutPoint(outPoint
): Promise
\<OutputJson
>
Retrieves inscriptions based on the UTXO (Unspent Transaction Output).
Parameters
Name | Type | Description |
---|---|---|
outPoint | OutPoint | The ID and output index of the UTXO. |
Returns
Promise
\<OutputJson
>
A Promise that resolves to the inscription data.
Example
const client = new DefaultOrdinalsClient("regtest");
let txid: string = "enter_your_utxo_txid_here";
let vout = 0; // enter the UTXO index here
const output = await client.getInscriptionsFromOutPoint({ txid, vout });
console.log("Output:", output);
Defined in
ordinal-api/index.ts:378
getInscriptionsFromSat
▸ getInscriptionsFromSat(sat
): Promise
\<SatJson
\<InscriptionId
>>
Retrieves an inscription based on its sat (something specific to your use case).
Parameters
Name | Type | Description |
---|---|---|
sat | number | The sat of the inscription to retrieve. |
Returns
Promise
\<SatJson
\<InscriptionId
>>
A Promise that resolves to the SatJson data type.
Example
const client = new DefaultOrdinalsClient("regtest");
let sat: number = 0 // enter the sat number here
const inscriptions = await client.getInscriptionsFromSat(sat);
console.log("Inscriptions:", inscriptions);
Defined in
ordinal-api/index.ts:393
getInscriptionsFromStartBlock
▸ getInscriptionsFromStartBlock(startHeight
): Promise
\<InscriptionsJson
\<InscriptionId
>>
Retrieves a list of inscriptions starting from a specified block and moving forward.
Parameters
Name | Type | Description |
---|---|---|
startHeight | number | The start block height. |
Returns
Promise
\<InscriptionsJson
\<InscriptionId
>>
A Promise that resolves to the inscription data.
Example
const client = new DefaultOrdinalsClient("regtest");
let startBlock: number = "enter_your_block_number_here";
const inscriptions = await client.getInscriptionsFromStartBlock(block);
console.log("Inscriptions:", inscriptions);
Defined in
ordinal-api/index.ts:408