New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@monerium/sdk

Package Overview
Dependencies
Maintainers
2
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monerium/sdk

Everything you need to interact with the Monerium API - an electronic money issuer.

  • 2.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
632
increased by40.76%
Maintainers
2
Weekly downloads
 
Created
Source

@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

# Node
yarn add @monerium/sdk

Usage

  • watch: Run Vite in watch mode to detect changes to files during development
  • build: Run Vite to build a production release distributable

Environments

Sandbox:

chains: ethereum, polygon, gnosis.

networks: goerli, mumbai, chiado.

Production:

chains: ethereum, polygon, gnosis.

networks: mainnet, mainnet, mainnet.

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';

// By default, the client will use the sandbox environment.
// To change to production, pass "production" as the first argument.
const client = new MoneriumClient('sandbox');

Authenticate using client credentials

await client.auth({
 client_id: "your_client_credentials_uuid"
 client_secret: "your_client_secret"
})

// User is now authenticated, get authentication data
await client.getAuthContext()

Authenticate using auth flow

// Construct the authFlowUrl for your application and redirect your customer.
let authFlowUrl = client.getAuthFlowURI({
  client_id: "your_client_authflow_uuid"
  // optional automatic wallet selection:
  network: "mumbai",
  chain: "polygon",
  address: "0xValidAddress72413Fa92980B889A1eCE84dD",
  signature: "0xValidSignature0df2b6c9e0fc067ab29bdbf322bec30aad7c46dcd97f62498a91ef7795957397e0f49426e000b0f500c347219ddd98dc5080982563055e918031c"

})
// Store the code verifier in localStorage
window.localStorage.setItem("myCodeVerifier", client.codeVerifier);
// Redirecting to the Monerium onboarding / Authentication flow.
window.location.replace(authFlowUrl)
// As the final step of the flow, the customer will be routed back to the `redirect_uri` with a `code` parameter attached to it.
// i.e. http://your-webpage.com/monerium-integration?code=1234abcd

await client.auth({
  client_id: 'your_client_authflow_uuid',
  code: new URLSearchParams(window.location.search).get('code'),
  code_verifier: window.localStorage.getItem('myCodeVerifier'),
  redirect_url: 'http://your-webpage.com/monerium-integration',
});

// User is now authenticated, get authentication data
await client.getAuthContext();

Contributing

We are using commitlint to enforce that developers format the commit messages according to the Conventional Commits guidelines.

We are using Yarn as a package manager.

yarn
yarn build

Smart IDEs (such as VSCode) require special configuration for TypeScript to work when using Yarn Plug'n'Play installs.

yarn dlx @yarnpkg/sdks vscode

For development, a package can be linked into another project. This is often useful to test out new features or when trying to debug an issue in a package that manifests itself in another project. run yarn link inside of the sdk project.

YARN_IGNORE_PATH=1 yarn link

Use yarn link "@monerium/sdk" to link and test into your current project.

cd ../your-project
yarn link "@monerium/sdk"

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.

FAQs

Package last updated on 11 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc