This application shows how you can use the Rarimo SDK to create cross-chain transactions in React applications.
To set up this application locally, follow these steps:
-
Make sure that Node.JS, NPX, and Yarn are installed.
-
Install one of these wallets in your web browser if you don't have one already:
- Coinbase
- Metamask
- NEAR
- Phantom
- Solflare
-
Obtain some UNI or USDC tokens as described in the Instructions for the Rarimo demo application instructions.
-
Clone this folder.
-
In a terminal in this folder, install the dependencies by running this command:
yarn install
-
In the file
src/App.tsx
, set the wallet to use by changing the wallet provider fromMetamaskProvider
to your wallet. For example, to make the application use Coinbase wallets, changeMetamaskProvider
toCoinbaseProvider
, as in this example:import { CoinbaseProvider } from '@rarimo/provider' const NFT_CONTRACT_ADDRESS = "0x77fedfb705c8bac2e03aad2ad8a8fe83e3e20fa1" export const App = () => { // Connect to the user's wallet const { provider, ...rest } = useProvider(CoinbaseProvider) // ...
The SDK supports these wallets:
CoinbaseProvider
: Coinbase walletsMetamaskProvider
: Metamask walletsNearProvider
: NEAR walletsPhantomProvider
: Phantom walletsSolflareProvider
: Solflare wallets
-
In the terminal, run
yarn start
and wait for the application to start. The application opens automatically in your default web browser, or you can open the page in a web browser by going to the URLhttp://localhost:3000
. -
When the application prompts you to connect your wallet, log in to your wallet and allow the connection.
-
Click the "Buy with Rarimo" button and follow the transaction process.
TODO more about what happens here.
This project was bootstrapped with Create React App.