Package Exports
- @settlemint/sdk-portal
- @settlemint/sdk-portal/package.json
Readme
SettleMint SDK
✨ https://settlemint.com ✨
Integrate SettleMint into your application with ease.
Table of Contents
About
The SettleMint Smart Contract Portal SDK provides a seamless way to interact with the Smart Contract Portal Middleware API. It enables you to easily interact with your smart contracts using a REST or GraphQL API.
The SDK offers a type-safe interface for all Portal API operations, with comprehensive error handling and validation. It integrates smoothly with modern TypeScript applications while providing a simple and intuitive developer experience.
For detailed information about using the Smart Contract Portal Middleware, check out our official documentation.
Usage
TODO: define default
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.