JSPM

@settlemint/sdk-portal

0.8.6-predc2ddfc
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4358
  • Score
    100M100P100Q126460F
  • License FSL-1.1-MIT

SettleMint SDK, integrate SettleMint into your application with ease.

Package Exports

  • @settlemint/sdk-portal
  • @settlemint/sdk-portal/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 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:

  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.