@settlemint/sdk-js
Advanced tools
Comparing version 0.4.34 to 0.5.0-pr01c66e2
{ | ||
"name": "@settlemint/sdk-js", | ||
"description": "SettleMint SDK, integrate SettleMint into your application with ease.", | ||
"version": "0.4.34", | ||
"version": "0.5.0-pr01c66e2", | ||
"type": "module", | ||
@@ -24,11 +24,15 @@ "private": false, | ||
"files": ["dist"], | ||
"main": "./dist/settlemint.cjs", | ||
"module": "./dist/settlemint.mjs", | ||
"types": "./dist/settlemint.d.ts", | ||
"exports": { | ||
"./*": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"import": { | ||
"types": "./dist/*.d.ts", | ||
"default": "./dist/*.mjs" | ||
"types": "./dist/settlemint.d.ts", | ||
"default": "./dist/settlemint.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/*.d.cts", | ||
"default": "./dist/*.cjs" | ||
"types": "./dist/settlemint.d.cts", | ||
"default": "./dist/settlemint.cjs" | ||
} | ||
@@ -38,2 +42,3 @@ } | ||
"scripts": { | ||
"codegen": "gql-tada generate-schema ${CONSOLE_GRAPHQL:-https://console.settlemint.com/api/graphql}", | ||
"build": "tsup-node", | ||
@@ -47,5 +52,10 @@ "dev": "tsup-node --watch", | ||
}, | ||
"devDependencies": {}, | ||
"devDependencies": { | ||
"@0no-co/graphqlsp": "1.12.16" | ||
}, | ||
"dependencies": { | ||
"zod": "^3.23.8" | ||
"gql.tada": "^1", | ||
"graphql-request": "^7", | ||
"zod": "^3", | ||
"@settlemint/sdk-utils": "0.5.0-pr01c66e2" | ||
}, | ||
@@ -52,0 +62,0 @@ "peerDependencies": {}, |
153
README.md
@@ -10,7 +10,7 @@ <p align="center"> | ||
</p> | ||
<br/> | ||
<p align="center"> | ||
<a href="https://github.com/settlemint/sdk/actions?query=branch%3Amain"><img src="https://github.com/settlemint/sdk/actions/workflows/build.yml/badge.svg?event=push&branch=main" alt="CI status" /></a> | ||
<a href="https://fsl.software" rel="nofollow"><img src="https://img.shields.io/npm/l/@settlemint/sdk" alt="License"></a> | ||
<a href="https://www.npmjs.com/package/@settlemint/sdk" rel="nofollow"><img src="https://img.shields.io/npm/dw/@settlemint/sdk" alt="npm"></a> | ||
<a href="https://fsl.software" rel="nofollow"><img src="https://img.shields.io/npm/l/@settlemint/sdk-js" alt="License"></a> | ||
<a href="https://www.npmjs.com/package/@settlemint/sdk-js" rel="nofollow"><img src="https://img.shields.io/npm/dw/@settlemint/sdk-js" alt="npm"></a> | ||
<a href="https://github.com/settlemint/sdk" rel="nofollow"><img src="https://img.shields.io/github/stars/settlemint/sdk" alt="stars"></a> | ||
@@ -24,3 +24,3 @@ </p> | ||
<span> • </span> | ||
<a href="https://www.npmjs.com/package/@settlemint/sdk">NPM</a> | ||
<a href="https://www.npmjs.com/package/@settlemint/sdk-js">NPM</a> | ||
<span> • </span> | ||
@@ -31,2 +31,145 @@ <a href="https://github.com/settlemint/sdk/issues">Issues</a> | ||
## Getting started | ||
## Table of Contents | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [API Reference](#api-reference) | ||
- [Examples](#examples) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
## Installation | ||
To install the SettleMint SDK, you can use one of the following package managers: | ||
```bash | ||
# Using npm | ||
npm install @settlemint/sdk | ||
# Using yarn | ||
yarn add @settlemint/sdk | ||
# Using pnpm | ||
pnpm add @settlemint/sdk | ||
# Using Bun | ||
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: | ||
1. Import the SDK: | ||
```javascript | ||
import { createSettleMintClient } from '@settlemint/sdk'; | ||
``` | ||
2. Create a client instance: | ||
```javascript | ||
const client = createSettleMintClient({ | ||
accessToken: 'your_access_token', | ||
instance: 'https://console.settlemint.com' | ||
}); | ||
``` | ||
3. Use the client to interact with SettleMint resources: | ||
```javascript | ||
// Example: List workspaces | ||
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 applications | ||
- `workspace.read(workspaceId)`: Read a specific workspace and its applications | ||
### Blockchain Network | ||
- `blockchainNetwork.list(applicationId)`: List blockchain networks for a given application | ||
- `blockchainNetwork.read(blockchainNetworkId)`: Read a specific blockchain network | ||
### Blockchain Node | ||
- `blockchainNode.list(applicationId)`: List blockchain nodes for a given application | ||
- `blockchainNode.read(blockchainNodeId)`: Read a specific blockchain node | ||
### Middleware | ||
- `middleware.list(applicationId)`: List middlewares for a given application | ||
- `middleware.read(middlewareId)`: Read a specific middleware | ||
### Integration Tool | ||
- `integrationTool.list(applicationId)`: List integration tools for a given application | ||
- `integrationTool.read(integrationId)`: Read a specific integration tool | ||
### Storage | ||
- `storage.list(applicationId)`: List storage items for a given application | ||
- `storage.read(storageId)`: Read a specific storage item | ||
### Private Key | ||
- `privateKey.list(applicationId)`: List private keys for a given application | ||
- `privateKey.read(privateKeyId)`: Read a specific private key | ||
### Insights | ||
- `insights.list(applicationId)`: List insights for a given application | ||
- `insights.read(insightsId)`: Read a specific insight | ||
## Examples | ||
Here are some examples of how to use the SettleMint SDK: | ||
### List Workspaces | ||
```javascript | ||
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 | ||
```javascript | ||
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: | ||
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](https://fsl.software). See the [LICENSE](LICENSE) file for more details. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
2511164
6294
172
0
1
4
1
9
+ Addedgql.tada@^1
+ Addedgraphql-request@^7
+ Added@0no-co/graphql.web@1.1.1(transitive)
+ Added@0no-co/graphqlsp@1.12.16(transitive)
+ Added@antfu/ni@0.23.2(transitive)
+ Added@dotenvx/dotenvx@1.37.0(transitive)
+ Added@ecies/ciphers@0.2.2(transitive)
+ Added@gql.tada/cli-utils@1.6.3(transitive)
+ Added@gql.tada/internal@1.0.8(transitive)
+ Added@graphql-typed-document-node/core@3.2.0(transitive)
+ Added@noble/ciphers@1.2.1(transitive)
+ Added@noble/curves@1.8.1(transitive)
+ Added@noble/hashes@1.7.1(transitive)
+ Added@settlemint/sdk-utils@0.5.0-pr01c66e2(transitive)
+ Addedcommander@11.1.0(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddeepmerge-ts@7.1.5(transitive)
+ Addeddotenv@16.4.7(transitive)
+ Addedeciesjs@0.4.14(transitive)
+ Addedenvironment@1.1.0(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedfdir@6.4.3(transitive)
+ Addedfind-up@7.0.0(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedgql.tada@1.8.10(transitive)
+ Addedgraphql@16.10.0(transitive)
+ Addedgraphql-request@7.1.2(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedisexe@2.0.03.1.1(transitive)
+ Addedlocate-path@7.2.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednano-spawn@0.1.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedobject-treeify@1.1.33(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-limit@4.0.0(transitive)
+ Addedp-locate@6.0.0(transitive)
+ Addedpath-exists@5.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpicomatch@4.0.2(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedtypescript@5.7.3(transitive)
+ Addedunicorn-magic@0.1.0(transitive)
+ Addedwhich@2.0.24.0.0(transitive)
+ Addedyocto-queue@1.1.1(transitive)
+ Addedyocto-spinner@0.1.2(transitive)
+ Addedyoctocolors@2.1.1(transitive)
Updatedzod@^3