@bloom-trade/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.1-alpha • Public • Published

Bloom SDK

Is a package entended to be used within your storefront to interact with the Bloom Trade API.

Installation 🧵

npm install @bloom-trade/sdk

Get Started

This package uses wagmi to interact with the blockchain alongside walletconnect to connect to your wallet.

Please refer to the WalletConnect instalation and then comeback here.

Inject BloomSDK to your app 🪡

import { BloomSDK } from '@bloom-trade/sdk'

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <WagmiConfig client={wagmiClient}>
        <BloomSdk testnet={true} apiKey='YOUR_BLOOM_API_KEY' apiSecret='YOUR_BLOOM_API_SECRET'>
          <Component {...pageProps} />;
        </BloomSdk>
      </WagmiConfig>
      <Web3Modal projectId={projectId} ethereumClient={ethereumClient} />
    </>
  )
}

Usage 📒

import type { NextPage } from 'next'
import { Collector } from '@bloom-trade/sdk'
const SandboxPage: NextPage = () => {
  return (
    <Collector
      order={{
        id: '123',
        orderId: '123',
        date: 12313123,
        total: {
          amount: 100,
        },
      }}
      onSuccess={(receipt) => {
        console.log('success', receipt)
      }}
      onError={() => {
        console.log('error')
      }}
    />
  )
}

export default SandboxPage

/@bloom-trade/sdk/

    Package Sidebar

    Install

    npm i @bloom-trade/sdk

    Weekly Downloads

    2

    Version

    0.1.1-alpha

    License

    MIT

    Unpacked Size

    147 kB

    Total Files

    8

    Last publish

    Collaborators

    • alex_fiorenza
    • leonardo.bloom.trade