@monerium/sdk
Everything you need to interact with the Monerium API - an electronic money issuer.
This package is in development. Please make sure to check if any future updates contain commits
that may change the behavior of your application before you upgrade.
SDK Documentation
Code coverage
Installing
yarn add @monerium/sdk
Usage
start
: Run Vite in host mode for a local development environment (not included in production build)watch
: Run Vite in watch mode to detect changes to files during developmentbuild
: Run Vite to build a production release distributable
Getting started
If you are new here, we recommend starting in the Developer Portal. There you will more about client_id
's and ways of authenticating.
Import the SDK and initialize a client
import { MoneriumClient } from "@monerium/sdk";
const client = new MoneriumClient();
Authenticate using client credentials
await client.auth({
client_id: "your_client_credentials_uuid"
client_secret: "your_client_secret"
})
await client.getAuthContext()
Authenticate using auth flow
let authFlowUrl = client.getAuthFlowURI({
client_id: "your_client_authflow_uuid"
network: "mumbai",
chain: "polygon",
address: "0xValidAddress72413Fa92980B889A1eCE84dD",
signature: "0xValidSignature0df2b6c9e0fc067ab29bdbf322bec30aad7c46dcd97f62498a91ef7795957397e0f49426e000b0f500c347219ddd98dc5080982563055e918031c"
})
window.location.replace(authFlowUrl)
await client.auth({
client_id: "your_client_authflow_uuid",
code: new URLSearchParams(window.location.search).get('code'),
code_verifier: client.code_verifier,
redirect_url: "http://your-webpage.com/monerium-integration"
})
await client.getAuthContext()
Developing
We are using commitlint to enforce that developers format the commit messages according to the Conventional Commits guidelines.
Publishing
When changes are merged to the main
branch that follows the conventional commits standard, release-please workflow creates a pull request, preparing for the next release. If kept open, the following commits will also be added to the PR. Merging that PR will create a new release, a workflow will publish it on NPM and tag it on Github.