Rarimo is a multichain protocol developed to solve the problems of liquidity, access, and interoperability across non-fungible and fungible use-cases. This suite of tools in this SDK makes it easy to build ground-breaking integrations on top of our technology.
For a complete running example, see @rarimo/nft-checkout.
For example applications, see rarimo/js-sdk-examples on GitHub.
For the change log, see CHANGELOG.md.
The full API documentation is hosted at rarimo.github.io/js-sdk. This is Typedoc-generated documentation. It is helpful if you want to look up details for advanced use cases. This documentation is auto-generated based on the current main branch and can diverge from the latest release.
The Rarimo SDK is a library that consists of many smaller NPM packages within the @rarimo namespace.
Package | Description | Latest |
---|---|---|
@rarimo/shared | Utility functions, types, and constants shared across Rarimo packages. | |
@rarimo/bridge | Internal tools that other Rarimo packages use to bridge tokens. | |
@rarimo/swap | Internal tools that other Rarimo packages use to swap tokens. | |
@rarimo/provider | A common interface for access to wallets (EVM and non-EVM) in the Rarimo SDK, used by packages that provide access to wallets on specific chains. | |
@rarimo/providers-evm | Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on EVM-compatible blockchains. | |
@rarimo/providers-solana | Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on the Solana blockchain. | |
@rarimo/providers-near | Features of the Rarimo SDK that provide access to wallets and the ability to interact with them on the NEAR blockchain. | |
@rarimo/nft-checkout | Features of the Rarimo SDK that create cross-chain transactions based on the Rarimo protocol. | |
@rarimo/react-provider | Tools to connect to wallets in React applications through the Rarimo SDK. | |
@rarimo/react-nft-checkout | Features of the Rarimo SDK that provide React components to manage cross-train transactions with the Rarimo protocol. |
Package | Description | Latest |
---|---|---|
@rarimo/client | The Rarimo Core client |
To use such packages as @rarimo/provider
and @rarimo/nft-checkout
in React project, created with create-react-app you need to add craco package and config to resolve the ESM version:
yarn add -D @craco/craco
Next, in the root of your project (where package.json
is located) create a file named craco.config.js
with the following content:
module.exports = {
webpack: {
configure: {
module: {
rules: [
{
test: /\.m?js$/,
resolve: {
fullySpecified: false,
},
},
],
},
},
},
}
This config disables the breaking change that causes this error.
Then change the start
/build
/test
commands in package.json
replacing react-scripts to craco
:
{
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test"
}
}
To get ESLint and Prettier working in VSCode, install ESLint extension and add the following to your settings.json:
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"typescript"
],
"eslint.alwaysShowStatus": true,
"eslint.packageManager": "yarn",
"eslint.workingDirectories": [{ "mode": "auto" }]
}
To get ESLint and Prettier working in WebStorm, go to Preferences > Languages & Frameworks > JavaScript > Code Quality Tools > ESLint
and check the following:
Run eslint --fix on save
enabledAutomatic ESLint configuration
enabled{**/*,*}.{js,ts}
inRun for files
field
To install all dependencies, run:
yarn install
If you are implementing a new package which needs to depend on the local package, you can use the following command to install it:
yarn workspace @rarimo/target-package add @distributedlab/package-to-add
To install a dependency to all packages, use the following command:
yarn workspaces foreach -pt run add @rarimo/package-to-add
To test the packages, you need:
-
Build the packages:
yarn build
-
Switch yarn to version berry in the project where you want to test package, to yarn be able to resolve workspace dependencies:
yarn set version berry
-
Add this to the
.yarnrc.yml
file:nodeLinker: node-modules
-
Link the packages to the project:
yarn link -p -A /path/to/js-sdk/root/directory
-
Add dependencies to the package.json file:
{ "dependencies": { "@rarimo/provider": "*" } }
-
Install the dependencies:
yarn install
yarn build
yarn test
yarn lint
yarn rsc 0.1.0
yarn apply-version 0.1.0