JSPM

@settlemint/sdk-blockscout

0.7.4-prfdb42d2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6101
  • Score
    100M100P100Q137641F
  • License FSL-1.1-MIT

SettleMint SDK, integrate SettleMint into your application with ease.

Package Exports

  • @settlemint/sdk-blockscout
  • @settlemint/sdk-blockscout/package.json

Readme

SettleMint logo

SettleMint SDK

https://settlemint.com
Integrate SettleMint into your application with ease.

CI status License npm stars

Documentation   •   Discord   •   NPM   •   Issues

Table of Contents

About

The SettleMint Blockscout SDK provides a seamless way to interact with Blockscout APIs for blockchain data exploration and analysis. It enables you to easily query transaction data, blocks, addresses, smart contracts and more from your SettleMint-powered blockchain networks.

For detailed information about using Blockscout with the SettleMint platform, check out our official documentation.

API Reference

Creating a Blockscout Client

Server-side Usage

import { createBlockscoutClient } from '@settlemint/sdk-blockscout';

const { client } = createBlockscoutClient({
  instance: 'https://your-blockscout-instance.com',
  accessToken: 'your-access-token',
});

Browser-side Usage

import { createBlockscoutClient } from '@settlemint/sdk-blockscout';

const { client } = createBlockscoutClient({});

Making GraphQL Queries

import { createBlockscoutClient } from '@settlemint/sdk-blockscout';

const { client, graphql } = createBlockscoutClient({
  instance: 'https://your-blockscout-instance.com',
  accessToken: 'your-access-token',
});

// Define your query using the type-safe graphql template literal
const query = graphql(`
  query GetTransaction($hash: String!) {
    transaction(hash: $hash) {
      hash
      blockNumber
      value
      gasUsed
    }
  }
`);

// Execute the query
const result = await client.request(query, {
  hash: "0x123abc..."
});

Contributing

We welcome contributions to the SettleMint SDK! If you'd like to contribute, please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Make your changes and commit them with a clear commit message
  4. Push your changes to your fork
  5. Create a pull request to the main repository

Please ensure that your code follows the existing style and includes appropriate tests and documentation.

License

The SettleMint SDK is released under the FSL Software License. See the LICENSE file for more details.