@rarimo/provider
TypeScript icon, indicating that this package has built-in type declarations

2.4.0 • Public • Published

@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 such as @rarimo/providers-evm, @rarimo/providers-solana, and @rarimo/providers-near.

To connect to wallets, use both this package and the specific implementation of a wallet provider from one of these packages:

  • @rarimo/providers-evm: access to Metamask and Coinbase wallets on EVM-compatible chains
  • @rarimo/providers-near: access to NEAR wallets on the NEAR chain
  • @rarimo/providers-solana: access to Phantom and Solflare wallets on the Solana chain

version (scoped package) types tree-shaking checks

Example

For example applications, see rarimo/js-sdk-examples on GitHub.

Here is an example that creates a MetamaskProvider object from @rarimo/providers-evm to represent a MetaMask wallet and prints its address:

import { createProvider } from '@rarimo/provider'
import { MetamaskProvider } from '@rarimo/providers-evm'

const getMetamaskWalletAddress = async () => {
  // Connect to the Metamask wallet in the browser, using the MetamaskProvider interface to limit bundle size.
  const provider = await createProvider(MetamaskProvider)
  await provider.connect()

  // Get the address of the wallet
  console.log(provider.address)
}

Changelog

For the change log, see CHANGELOG.md.

Package Sidebar

Install

npm i @rarimo/provider

Weekly Downloads

475

Version

2.4.0

License

MIT

Unpacked Size

182 kB

Total Files

88

Last publish

Collaborators

  • lukachi
  • ihor.diachenko
  • electr1xx
  • arvolear
  • volendi
  • semen_rarify