### Install Cardanoscan JS SDK
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Install the SDK using yarn. For browser usage, include the script via a CDN.
```bash
yarn add @stricahq/cardanoscan-js
```
```html
```
--------------------------------
### GET /block/latest
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about the most recently minted block.
```APIDOC
## GET /block/latest
### Description
Retrieves detailed information about the most recently minted block on the Cardano blockchain.
### Response
#### Success Response (200)
- **hash** (string) - Latest block hash.
- **blockHeight** (number) - Latest block height.
- **timestamp** (string) - ISO timestamp.
### Response Example
{
"hash": "latest-block-hash...",
"blockHeight": 9510234,
"timestamp": "2024-01-20T15:30:00.000Z"
}
```
--------------------------------
### Install via Package Manager
Source: https://github.com/stricahq/cardanoscan-js/blob/master/README.md
Use yarn or npm to add the library to your project dependencies.
```sh
yarn add @stricahq/cardanoscan-js
```
--------------------------------
### Get Assets by Address
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of native assets held by a specific address.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const addressAssets = await api.getAssetsByAddress({
address: "addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3jcu5d8ps7zex2k2xt3uqxgjqnnj83ws8lhrn648jjxtwq2ytjqp",
pageNo: 1,
limit: 100
});
console.log(addressAssets);
```
--------------------------------
### GET /block/details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a specific block using various identifiers.
```APIDOC
## GET /block/details
### Description
Retrieves detailed information about a specific block using block hash, block height, absolute slot, or epoch/slot combination.
### Parameters
#### Request Body
- **blockHash** (string) - Optional - The hash of the block.
- **blockHeight** (number) - Optional - The height of the block.
- **absoluteSlot** (number) - Optional - The absolute slot number.
- **epoch** (number) - Optional - The epoch number.
- **slot** (number) - Optional - The slot number within the epoch.
### Response
#### Success Response (200)
- **hash** (string) - Block hash.
- **blockHeight** (number) - Block height.
- **totalFees** (string) - Total fees in the block.
- **timestamp** (string) - ISO timestamp of the block.
### Response Example
{
"hash": "f4dc96c830785d5823b45cfe9d8e3d32f90f78c5a7ec24a6c76b0f2e6c9d7a5b",
"blockHeight": 9500000,
"totalFees": "15000000",
"timestamp": "2024-01-15T12:00:00.000Z"
}
```
--------------------------------
### Get DReps List
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of registered Delegated Representatives.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const dreps = await api.getDReps({
pageNo: 1,
limit: 50,
search: undefined
});
console.log(dreps);
// {
// pageNo: 1,
// limit: 50,
// count: 500,
// dReps: [
// { dRepId: "drep1...", deposit: "500000000", votes: 30, ... },
// { dRepId: "drep1...", deposit: "500000000", votes: 15, ... }
// ]
// }
```
--------------------------------
### Get Assets by Address
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all native assets held by a specific address with their balances.
```APIDOC
## Get Assets by Address
### Description
Retrieves a paginated list of all native assets held by a specific address with their balances.
### Method
GET
### Endpoint
/api/v1/addresses/{address}/assets
### Parameters
#### Path Parameters
- **address** (string) - Required - The Cardano address to query assets for.
#### Query Parameters
- **pageNo** (integer) - Optional - The page number for pagination. Defaults to 1.
- **limit** (integer) - Optional - The number of assets per page. Defaults to 100.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const addressAssets = await api.getAssetsByAddress({
address: "addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3jcu5d8ps7zex2k2xt3uqxgjqnnj83ws8lhrn648jjxtwq2ytjqp",
pageNo: 1,
limit: 100
});
console.log(addressAssets);
```
### Response
#### Success Response (200)
- **pageNo** (integer) - The current page number.
- **limit** (integer) - The number of items per page.
- **count** (integer) - The total number of assets found.
- **tokens** (array) - An array of asset objects held by the address.
- **policyId** (string) - The policy ID of the asset.
- **assetName** (string) - The name of the asset.
- **fingerprint** (string) - The fingerprint of the asset.
- **balance** (string) - The balance of the asset held by the address.
#### Response Example
```json
{
"pageNo": 1,
"limit": 100,
"count": 15,
"tokens": [
{ "policyId": "...", "assetName": "...", "fingerprint": "asset1...", "balance": "1000" },
{ "policyId": "...", "assetName": "...", "fingerprint": "asset2...", "balance": "500" }
]
}
```
```
--------------------------------
### GET /transaction/details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves complete transaction details including inputs, outputs, and metadata.
```APIDOC
## GET /transaction/details
### Description
Retrieves complete transaction details including inputs, outputs, certificates, withdrawals, metadata, and minting operations.
### Parameters
#### Request Body
- **hash** (string) - Required - The transaction hash.
### Response
#### Success Response (200)
- **hash** (string) - Transaction hash.
- **fees** (string) - Transaction fees.
- **status** (boolean) - Transaction status.
### Response Example
{
"hash": "abc123def456...",
"fees": "200000",
"status": true
}
```
--------------------------------
### Get UTXO List
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of unspent transaction outputs for an address. Requires a PRO plan API key.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-pro-api-key");
// Query by payment address
const utxosByPayment = await api.getUTXOList({
paymentAddress: "addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3jcu5d8ps7zex2k2xt3uqxgjqnnj83ws8lhrn648jjxtwq2ytjqp",
pageNo: 1,
limit: 50
});
// Query by reward address (stake key)
const utxosByStake = await api.getUTXOList({
rewardAddress: "stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7",
pageNo: 1,
limit: 50
});
console.log(utxosByPayment);
```
--------------------------------
### Get Pools List
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of stake pools with filtering and sorting options.
```APIDOC
## GET /api/v1/pools
### Description
Retrieves a paginated list of stake pools with filtering and sorting options.
### Method
GET
### Endpoint
/api/v1/pools
### Parameters
#### Query Parameters
- **pageNo** (integer) - Optional - The page number to retrieve.
- **limit** (integer) - Optional - The number of results per page.
- **search** (string) - Optional - A search term to filter pools by name or ticker.
- **retiredPools** (boolean) - Optional - Whether to include retired pools in the results.
- **sortBy** (string) - Optional - The field to sort the results by (e.g., 'pledge', 'margin').
- **order** (string) - Optional - The order of sorting ('asc' or 'desc').
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const pools = await api.getPools({
pageNo: 1,
limit: 20,
search: "strica",
retiredPools: false,
sortBy: "pledge",
order: "desc"
});
console.log(pools);
```
### Response
#### Success Response (200)
- **pageNo** (integer) - The current page number.
- **limit** (integer) - The number of results per page.
- **count** (integer) - The total number of pools matching the criteria.
- **pools** (array) - A list of pool objects.
- **poolId** (string) - The ID of the stake pool.
- **name** (string) - The name of the stake pool.
- **ticker** (string) - The ticker symbol of the pool.
- **margin** (string) - The margin fee of the pool.
- ... (other pool details)
#### Response Example
```json
{
"pageNo": 1,
"limit": 20,
"count": 3200,
"pools": [
{ "poolId": "pool1...", "name": "Strica Pool", "ticker": "STRC", "margin": "0.02", ... },
{ "poolId": "pool1...", "name": "Another Pool", "ticker": "ANTH", "margin": "0.03", ... }
]
}
```
```
--------------------------------
### Get Assets by Policy ID
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all assets minted under a specific policy ID.
```APIDOC
## Get Assets by Policy ID
### Description
Retrieves a paginated list of all assets minted under a specific policy ID.
### Method
GET
### Endpoint
/api/v1/policies/{policyId}/assets
### Parameters
#### Path Parameters
- **policyId** (string) - Required - The policy ID to query assets for.
#### Query Parameters
- **pageNo** (integer) - Optional - The page number for pagination. Defaults to 1.
- **limit** (integer) - Optional - The number of assets per page. Defaults to 50.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const assets = await api.getAssetsByPolicyId({
policyId: "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c",
pageNo: 1,
limit: 50
});
console.log(assets);
```
### Response
#### Success Response (200)
- **pageNo** (integer) - The current page number.
- **limit** (integer) - The number of items per page.
- **count** (integer) - The total number of assets found.
- **tokens** (array) - An array of asset objects.
- **policyId** (string) - The policy ID of the asset.
- **assetName** (string) - The name of the asset.
- **totalSupply** (string) - The total supply of the asset.
#### Response Example
```json
{
"pageNo": 1,
"limit": 50,
"count": 250,
"tokens": [
{ "policyId": "...", "assetName": "Token1", "totalSupply": "1000000", ... },
{ "policyId": "...", "assetName": "Token2", "totalSupply": "500000", ... }
]
}
```
```
--------------------------------
### Get Assets by Policy ID
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all assets minted under a specific policy ID.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const assets = await api.getAssetsByPolicyId({
policyId: "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c",
pageNo: 1,
limit: 50
});
console.log(assets);
```
--------------------------------
### Get Asset Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a specific native asset by asset ID or fingerprint.
```APIDOC
## Get Asset Details
### Description
Retrieves detailed information about a specific native asset by asset ID or fingerprint.
### Method
GET
### Endpoint
/api/v1/assets
### Parameters
#### Query Parameters
- **assetId** (string) - Optional - The unique identifier for the asset (policyId + assetName).
- **fingerprint** (string) - Optional - The fingerprint of the asset.
*Note: Either `assetId` or `fingerprint` must be provided.*
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
// Query by asset ID (policyId + assetName)
const assetById = await api.getAssetDetails({
assetId: "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c546f6b656e"
});
// Query by fingerprint
const assetByFingerprint = await api.getAssetDetails({
fingerprint: "asset1abc123..."
});
console.log(assetById);
```
### Response
#### Success Response (200)
- **policyId** (string) - The policy ID of the asset.
- **assetName** (string) - The name of the asset.
- **fingerprint** (string) - The fingerprint of the asset.
- **assetId** (string) - The unique asset identifier.
- **totalSupply** (string) - The total supply of the asset.
- **txCount** (integer) - The number of transactions involving this asset.
- **mintedOn** (string) - The ISO 8601 timestamp when the asset was minted.
#### Response Example
```json
{
"policyId": "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c",
"assetName": "Token",
"fingerprint": "asset1abc123...",
"assetId": "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c546f6b656e",
"totalSupply": "1000000000",
"txCount": 5000,
"mintedOn": "2023-05-01T10:00:00.000Z"
}
```
```
--------------------------------
### Get Network Protocol Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves current protocol parameters including fees, deposits, and execution unit prices.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const protocol = await api.getNetworkProtocolDetails();
console.log(protocol);
```
--------------------------------
### Get Network Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves current network state including circulating supply, reserves, and treasury balance.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const network = await api.getNetworkDetails();
console.log(network);
```
--------------------------------
### Get DReps List
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of registered Delegated Representatives with optional search.
```APIDOC
## Get DReps List
### Description
Retrieves a paginated list of registered Delegated Representatives with optional search.
### Method
GET
### Endpoint
/dreps
### Parameters
#### Query Parameters
- **pageNo** (number) - Required - The page number to retrieve.
- **limit** (number) - Required - The number of DReps per page.
- **search** (string) - Optional - Search term for DRep names or IDs.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const dreps = await api.getDReps({
pageNo: 1,
limit: 50,
search: undefined
});
console.log(dreps);
```
### Response
#### Success Response (200)
- **pageNo** (number) - The current page number.
- **limit** (number) - The number of DReps per page.
- **count** (number) - The total number of registered DReps.
- **dReps** (array) - An array of DRep summary objects.
- **dRepId** (string) - The DRep identifier.
- **deposit** (string) - The deposit amount in lovelaces.
- **votes** (number) - Number of votes received.
- ... (other fields may be present)
#### Response Example
```json
{
"pageNo": 1,
"limit": 50,
"count": 500,
"dReps": [
{ "dRepId": "drep1...", "deposit": "500000000", "votes": 30, ... },
{ "dRepId": "drep1...", "deposit": "500000000", "votes": 15, ... }
]
}
```
```
--------------------------------
### Get Addresses by Stake Key
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all payment addresses associated with a stake key.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const addresses = await api.getAddressesByStakeKey({
rewardAddress: "stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7",
pageNo: 1,
limit: 100
});
console.log(addresses);
```
--------------------------------
### Get Committee Information
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves the current Constitutional Committee status, threshold, and constitution details.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const committee = await api.getCommitteeInformation();
console.log(committee);
// {
// status: 1,
// updated: "2024-01-01T00:00:00.000Z",
// threshold: 0.67,
// constitution: {
// script: null,
// scriptHash: null,
// anchor: { url: "https://constitution.cardano.org", hash: "..." }
// }
// }
```
--------------------------------
### Get Expiring Pools
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of stake pools that are scheduled for retirement in upcoming epochs.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const expiringPools = await api.getExpiringPools({
pageNo: 1,
limit: 50
});
console.log(expiringPools);
```
--------------------------------
### Get Governance Action
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a specific governance action including vote tallies.
```APIDOC
## Get Governance Action
### Description
Retrieves detailed information about a specific governance action including vote tallies.
### Method
GET
### Endpoint
/governance/actions/{actionId}
### Parameters
#### Path Parameters
- **actionId** (string) - Required - The unique identifier of the governance action.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const action = await api.getGovernanceAction({
actionId: "gov_action_abc123..."
});
console.log(action);
```
### Response
#### Success Response (200)
- **actionId** (string) - The governance action identifier.
- **txId** (string) - The transaction ID associated with the action.
- **timestamp** (string) - Timestamp of the action.
- **epoch** (number) - The epoch number.
- **blockHeight** (number) - The block height.
- **action** (object) - Details of the governance action.
- **type** (number) - Type of action (e.g., 0 for proposal).
- **action** (object) - Specific action details.
- **prevActionId** (string | null) - Previous action ID if applicable.
- **protocolParamUpdate** (object) - Protocol parameter updates (if any).
- **policyHash** (string | null) - Policy hash (if applicable).
- **deposit** (string) - The deposit amount in lovelaces.
- **rewardAccount** (string) - The reward account associated with the action.
- **anchor** (object) - Anchor information.
- **url** (string) - URL of the anchor.
- **hash** (string) - Hash of the anchor.
- **votes** (object) - Vote tallies.
- **dReps** (object) - DRep votes.
- **yes** (object) - Yes votes.
- **count** (number) - Number of yes votes.
- **stake** (string) - Total stake for yes votes.
- **no** (object) - No votes.
- **count** (number) - Number of no votes.
- **stake** (string) - Total stake for no votes.
- **abstain** (object) - Abstain votes.
- **spos** (object) - Stake Pool Operator votes (structure similar to dReps).
- **committeeMembers** (object) - Constitutional Committee member votes.
- **yes** (object) - Yes votes.
- **count** (number) - Number of yes votes.
- **no** (object) - No votes.
- **count** (number) - Number of no votes.
- **abstain** (object) - Abstain votes.
- **count** (number) - Number of abstain votes.
#### Response Example
```json
{
"actionId": "gov_action_abc123...",
"txId": "tx-hash...",
"timestamp": "2024-01-20T00:00:00.000Z",
"epoch": 450,
"blockHeight": 9500000,
"action": {
"type": 0,
"action": { "prevActionId": null, "protocolParamUpdate": {...}, "policyHash": null }
},
"deposit": "100000000000",
"rewardAccount": "stake1...",
"anchor": { "url": "https://...", "hash": "..." },
"votes": {
"dReps": { "yes": { "count": 100, "stake": "..." }, "no": { "count": 20, "stake": "..." }, "abstain": {...} },
"spos": { "yes": {...}, "no": {...}, "abstain": {...} },
"committeeMembers": { "yes": { "count": 5 }, "no": { "count": 1 }, "abstain": { "count": 1 } }
}
}
```
```
--------------------------------
### Get Governance Action
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a specific governance action, including vote tallies.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const action = await api.getGovernanceAction({
actionId: "gov_action_abc123..."
});
console.log(action);
// {
// actionId: "gov_action_abc123...",
// txId: "tx-hash...",
// timestamp: "2024-01-20T00:00:00.000Z",
// epoch: 450,
// blockHeight: 9500000,
// action: {
// type: 0,
// action: { prevActionId: null, protocolParamUpdate: {...}, policyHash: null }
// },
// deposit: "100000000000",
// rewardAccount: "stake1...",
// anchor: { url: "https://...", hash: "..." },
// votes: {
// dReps: { yes: { count: 100, stake: "..." }, no: { count: 20, stake: "..." }, abstain: {...} },
// spos: { yes: {...}, no: {...}, abstain: {...} },
// committeeMembers: { yes: { count: 5 }, no: { count: 1 }, abstain: { count: 1 } }
// }
// }
```
--------------------------------
### Get Asset Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a native asset using either its asset ID or fingerprint.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
// Query by asset ID (policyId + assetName)
const assetById = await api.getAssetDetails({
assetId: "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c546f6b656e"
});
// Query by fingerprint
const assetByFingerprint = await api.getAssetDetails({
fingerprint: "asset1abc123..."
});
console.log(assetById);
```
--------------------------------
### Get Transaction List by Address
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of transactions for a specific address with optional sorting.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const transactions = await api.getTransactionListByAddress({
address: "addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3jcu5d8ps7zex2k2xt3uqxgjqnnj83ws8lhrn648jjxtwq2ytjqp",
pageNo: 1,
limit: 20,
order: "desc"
});
console.log(transactions);
```
--------------------------------
### Get Expiring Pools
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of stake pools scheduled to retire in upcoming epochs.
```APIDOC
## GET /api/v1/pools/expiring
### Description
Retrieves a paginated list of stake pools scheduled to retire in upcoming epochs.
### Method
GET
### Endpoint
/api/v1/pools/expiring
### Parameters
#### Query Parameters
- **pageNo** (integer) - Optional - The page number to retrieve.
- **limit** (integer) - Optional - The number of results per page.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const expiringPools = await api.getExpiringPools({
pageNo: 1,
limit: 50
});
console.log(expiringPools);
```
### Response
#### Success Response (200)
- **pageNo** (integer) - The current page number.
- **limit** (integer) - The number of results per page.
- **count** (integer) - The total number of expiring pools.
- **pools** (array) - A list of expiring pool objects.
- **poolId** (string) - The ID of the stake pool.
- **epoch** (integer) - The epoch in which the pool is scheduled to retire.
#### Response Example
```json
{
"pageNo": 1,
"limit": 50,
"count": 12,
"pools": [
{ "poolId": "pool1...", "epoch": 455 },
{ "poolId": "pool1...", "epoch": 456 }
]
}
```
```
--------------------------------
### Get Pools List
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of stake pools, supporting filtering by search term, retirement status, and sorting options.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const pools = await api.getPools({
pageNo: 1,
limit: 20,
search: "strica",
retiredPools: false,
sortBy: "pledge",
order: "desc"
});
console.log(pools);
```
--------------------------------
### Get Assets Metadata
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves metadata for multiple assets in a single request, including CIP-25 and CIP-68 metadata. Requires a PRO plan.
```APIDOC
## POST /api/v1/assets/metadata
### Description
Retrieves metadata for multiple assets in a single request, including CIP-25 and CIP-68 metadata.
### Method
POST
### Endpoint
/api/v1/assets/metadata
### Parameters
#### Request Body
- **assetIds** (array of strings) - Required - A list of asset IDs for which to retrieve metadata.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-pro-api-key");
const metadata = await api.getAssetsMetadata({
assetIds: [
"8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c546f6b656e31",
"8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c546f6b656e32"
]
});
console.log(metadata);
```
### Response
#### Success Response (200)
- **metadataList** (array) - A list of metadata objects for the requested assets.
- **assetId** (string) - The ID of the asset.
- **policyId** (string) - The policy ID of the asset.
- **assetName** (string) - The name of the asset.
- **decimals** (integer) - The number of decimal places for the asset.
- **name** (string) - The display name of the asset.
- **description** (string) - A description of the asset.
- **ticker** (string) - The ticker symbol for the asset.
- **image** (object) - Information about the asset's image.
- **src** (string) - The source URL of the image (e.g., IPFS).
- **type** (string) - The MIME type of the image.
#### Response Example
```json
{
"metadataList": [
{
"assetId": "...",
"policyId": "...",
"assetName": "Token1",
"decimals": 6,
"name": "My Token",
"description": "A sample token",
"ticker": "MTK",
"image": { "src": "ipfs://...", "type": "image/png" }
}
]
}
```
```
--------------------------------
### Get Asset Holders by Asset ID
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all addresses holding a specific asset with their balances. Requires a PRO plan.
```APIDOC
## GET /api/v1/assets/{assetId}/holders
### Description
Retrieves a paginated list of all addresses holding a specific asset with their balances.
### Method
GET
### Endpoint
/api/v1/assets/{assetId}/holders
### Parameters
#### Query Parameters
- **pageNo** (integer) - Required - The page number to retrieve.
- **limit** (integer) - Required - The number of results per page.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-pro-api-key");
const holders = await api.getAssetHoldersByAssetId({
assetId: "8f78a4388b1a3e1a1435257e9356fa0c2cc0d3a5e0a6d42e1f3a5e8c546f6b656e",
pageNo: 1,
limit: 100
});
console.log(holders);
```
### Response
#### Success Response (200)
- **pageNo** (integer) - The current page number.
- **limit** (integer) - The number of results per page.
- **count** (integer) - The total number of holders.
- **holders** (array) - A list of holder objects.
- **address** (string) - The address holding the asset.
- **balance** (string) - The balance of the asset held by the address.
#### Response Example
```json
{
"pageNo": 1,
"limit": 100,
"count": 2500,
"holders": [
{ "address": "addr1...", "balance": "1000000" },
{ "address": "addr1...", "balance": "500000" }
]
}
```
```
--------------------------------
### Get Stake Key Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a stake key including delegation status, rewards, and total stake.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const stakeDetails = await api.getStakeKeyDetails({
rewardAddress: "stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7"
});
console.log(stakeDetails);
```
--------------------------------
### Get Pool Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves comprehensive details for a specific stake pool, including its metadata, registration information, and relays.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const pool = await api.getPoolDetails({
poolId: "pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy"
});
console.log(pool);
```
--------------------------------
### Get Pool Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves detailed information about a specific stake pool including metadata, relays, and registration info.
```APIDOC
## GET /api/v1/pools/{poolId}
### Description
Retrieves detailed information about a specific stake pool including metadata, relays, and registration info.
### Method
GET
### Endpoint
/api/v1/pools/{poolId}
### Parameters
#### Path Parameters
- **poolId** (string) - Required - The unique identifier of the stake pool.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const pool = await api.getPoolDetails({
poolId: "pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy"
});
console.log(pool);
```
### Response
#### Success Response (200)
- **poolId** (string) - The ID of the stake pool.
- **vrfKeyHash** (string) - The VRF key hash of the pool.
- **status** (boolean) - The current status of the pool (e.g., active).
- **name** (string) - The name of the stake pool.
- **ticker** (string) - The ticker symbol of the pool.
- **website** (string) - The website URL of the pool.
- **description** (string) - A description of the pool.
- **margin** (string) - The margin fee of the pool.
- **cost** (string) - The cost parameter of the pool.
- **declaredPledge** (string) - The declared pledge amount for the pool.
- **rewardAccount** (string) - The reward account address for the pool.
- **owners** (array of strings) - A list of owner stake addresses.
- **registeredOn** (string) - The date the pool was registered.
- **relays** (array of objects) - Information about the pool's relays.
- **port** (integer) - The port number of the relay.
- **ipv4** (string) - The IPv4 address of the relay.
- **dnsName** (string) - The DNS name of the relay.
#### Response Example
```json
{
"poolId": "pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy",
"vrfKeyHash": "...",
"status": true,
"name": "Strica Pool",
"ticker": "STRC",
"website": "https://strica.io",
"description": "A reliable Cardano stake pool",
"margin": "0.02",
"cost": "340000000",
"declaredPledge": "50000000000",
"rewardAccount": "stake1...",
"owners": ["stake1..."],
"registeredOn": "2021-03-01T00:00:00.000Z",
"relays": [{ "port": 3001, "ipv4": "1.2.3.4", "dnsName": null }]
}
```
```
--------------------------------
### Get Transaction Details
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Fetch comprehensive details for a specific transaction using its hash. Includes inputs, outputs, fees, and associated assets.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const tx = await api.getTransactionDetails({
hash: "abc123def456..."
});
console.log(tx);
// {
// hash: "abc123def456...",
// blockHash: "block-hash...",
// fees: "200000",
// slot: 125000,
// epoch: 451,
// blockHeight: 9510234,
// timestamp: "2024-01-20T15:30:00.000Z",
// inputs: [{
// index: 0,
// txId: "prev-tx-hash...",
// address: "addr1...",
// value: "5000000",
// tokens: [{ policyId: "...", assetName: "...", value: "100" }]
// }],
// outputs: [{
// value: "4800000",
// address: "addr1...",
// tokens: []
// }],
// status: true
// }
```
--------------------------------
### Get Pool Stats
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Fetches performance statistics for a given stake pool, such as lifetime blocks, rewards, and saturation level.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key");
const stats = await api.getPoolStats({
poolId: "pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy"
});
console.log(stats);
```
--------------------------------
### Get Votes by Action (PRO Plan)
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all votes cast on a specific governance action. Requires PRO plan.
```APIDOC
## Get Votes by Action (PRO Plan)
### Description
Retrieves a paginated list of all votes cast on a specific governance action. Requires PRO plan.
### Method
GET
### Endpoint
/governance/actions/{actionId}/votes
### Parameters
#### Path Parameters
- **actionId** (string) - Required - The unique identifier of the governance action.
#### Query Parameters
- **pageNo** (number) - Required - The page number to retrieve.
- **limit** (number) - Required - The number of votes per page.
### Request Example
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-pro-api-key");
const votes = await api.getVotesByAction({
actionId: "gov_action_abc123...",
pageNo: 1,
limit: 100
});
console.log(votes);
```
### Response
#### Success Response (200)
- **pageNo** (number) - The current page number.
- **limit** (number) - The number of votes per page.
- **count** (number) - The total number of votes for the action.
- **votes** (array) - An array of vote objects.
- **actionId** (string) - The governance action identifier.
- **vote** (number) - The vote cast (e.g., 1 for Yes, 0 for No, 2 for Abstain).
- **voter** (string) - The voter's identifier.
- ... (other fields may be present, such as txId, timestamp, epoch, anchor)
#### Response Example
```json
{
"pageNo": 1,
"limit": 100,
"count": 250,
"votes": [
{ "actionId": "gov_action_abc123...", "vote": 1, "voter": "drep1...", ... },
{ "actionId": "gov_action_abc123...", "vote": 0, "voter": "pool1...", ... }
]
}
```
```
--------------------------------
### Get Votes by Action
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves a paginated list of all votes cast on a specific governance action. Requires a PRO Plan API key.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-pro-api-key");
const votes = await api.getVotesByAction({
actionId: "gov_action_abc123...",
pageNo: 1,
limit: 100
});
console.log(votes);
// {
// pageNo: 1,
// limit: 100,
// count: 250,
// votes: [
// { actionId: "gov_action_abc123...", vote: 1, voter: "drep1...", ... },
// { actionId: "gov_action_abc123...", vote: 0, voter: "pool1...", ... }
// ]
// }
```
--------------------------------
### Initialize Cardanoscan API SDK
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Create a CardanoscanAPI instance with your API key to authenticate requests. This is the first step before making any API calls.
```typescript
import { CardanoscanAPI } from "@stricahq/cardanoscan-js";
const api = new CardanoscanAPI("your-api-key-here");
```
--------------------------------
### GET /address/balance
Source: https://context7.com/stricahq/cardanoscan-js/llms.txt
Retrieves the current ADA balance for a specified Cardano address.
```APIDOC
## GET /address/balance
### Description
Retrieves the current ADA balance for a specified Cardano address, returning the address hash and balance in lovelace.
### Parameters
#### Request Body
- **address** (string) - Required - The Cardano address to query.
### Response
#### Success Response (200)
- **hash** (string) - The address hash.
- **balance** (string) - The balance in lovelace.
### Response Example
{
"hash": "addr1qx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzer3jcu5d8ps7zex2k2xt3uqxgjqnnj83ws8lhrn648jjxtwq2ytjqp",
"balance": "1500000000"
}
```
--------------------------------
### Include via Browser Script
Source: https://github.com/stricahq/cardanoscan-js/blob/master/README.md
Load the library directly in the browser to access the cardanoscanJs global variable.
```html
// access cardanoscanJs global variable
```