SettleMint SDK
✨ https://settlemint.com ✨
Integrate SettleMint into your application with ease.
Table of Contents
Installation
To install the SettleMint SDK, you can use one of the following package managers:
npm install @settlemint/sdk
yarn add @settlemint/sdk
pnpm add @settlemint/sdk
bun add @settlemint/sdk
We recommend using Bun for faster installation and better performance.
Usage
To use the SettleMint SDK in your Node.js application, follow these steps:
- Import the SDK:
import { createSettleMintClient } from '@settlemint/sdk';
- Create a client instance:
const client = createSettleMintClient({
accessToken: 'your_access_token',
instance: 'https://console.settlemint.com'
});
- Use the client to interact with SettleMint resources:
const workspaces = await client.workspace.list();
console.log(workspaces);
API Reference
The SettleMint SDK provides access to various resources. Here's an overview of the available methods:
Workspace
workspace.list()
: List all workspaces and their applicationsworkspace.read(workspaceId)
: Read a specific workspace and its applications
Blockchain Network
blockchainNetwork.list(applicationId)
: List blockchain networks for a given applicationblockchainNetwork.read(blockchainNetworkId)
: Read a specific blockchain network
Blockchain Node
blockchainNode.list(applicationId)
: List blockchain nodes for a given applicationblockchainNode.read(blockchainNodeId)
: Read a specific blockchain node
Middleware
middleware.list(applicationId)
: List middlewares for a given applicationmiddleware.read(middlewareId)
: Read a specific middleware
Integration Tool
integrationTool.list(applicationId)
: List integration tools for a given applicationintegrationTool.read(integrationId)
: Read a specific integration tool
Storage
storage.list(applicationId)
: List storage items for a given applicationstorage.read(storageId)
: Read a specific storage item
Private Key
privateKey.list(applicationId)
: List private keys for a given applicationprivateKey.read(privateKeyId)
: Read a specific private key
Insights
insights.list(applicationId)
: List insights for a given applicationinsights.read(insightsId)
: Read a specific insight
Examples
Here are some examples of how to use the SettleMint SDK:
List Workspaces
const client = createSettleMintClient({
accessToken: 'your_access_token',
instance: 'https://console.settlemint.com'
});
const workspaces = await client.workspace.list();
console.log(workspaces);
Read a Specific Blockchain Network
const client = createSettleMintClient({
accessToken: 'your_access_token',
instance: 'https://console.settlemint.com'
});
const networkId = 'your_network_id';
const network = await client.blockchainNetwork.read(networkId);
console.log(network);
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.