Package Exports
- @settlemint/sdk-blockscout
- @settlemint/sdk-blockscout/package.json
Readme
SettleMint SDK
✨ https://settlemint.com ✨
Integrate SettleMint into your application with ease.
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:
- Fork the repository
- Create a new branch for your feature or bug fix
- Make your changes and commit them with a clear commit message
- Push your changes to your fork
- 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.