0.1.1-alpha โข Published 12 months ago
@bloom-trade/sdk v0.1.1-alpha
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
0.1.1-alpha
12 months ago
0.1.0
1 year ago
0.0.11
1 year ago
0.0.11-alpha
1 year ago
0.0.10
1 year ago
0.0.10-alpha
1 year ago
0.0.9
1 year ago
0.0.9-alpha
1 year ago
0.0.8
1 year ago
0.0.7
1 year ago
0.0.7-alpha
1 year ago
0.0.6
1 year ago
0.0.6-alpha
1 year ago
0.0.5
1 year ago
0.0.5-alpha
1 year ago
0.0.4
1 year ago
0.0.3
1 year ago
0.0.2
1 year ago
0.0.1
1 year ago
0.0.1-alpha
1 year ago