Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

transaction-react

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Rarimo sample application: Running transactions in a React application

This application shows how you can use the Rarimo SDK to create cross-chain transactions in React applications.

Running the application

To set up this application locally, follow these steps:

  1. Make sure that Node.JS, NPX, and Yarn are installed.

  2. Install one of these wallets in your web browser if you don't have one already:

    • Coinbase
    • Metamask
    • NEAR
    • Phantom
    • Solflare
  3. Obtain some UNI or USDC tokens as described in the Instructions for the Rarimo demo application instructions.

  4. Clone this folder.

  5. In a terminal in this folder, install the dependencies by running this command:

    yarn install
  6. In the file src/App.tsx, set the wallet to use by changing the wallet provider from MetamaskProvider to your wallet. For example, to make the application use Coinbase wallets, change MetamaskProvider to CoinbaseProvider, 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:

  7. 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 URL http://localhost:3000.

  8. When the application prompts you to connect your wallet, log in to your wallet and allow the connection.

  9. Click the "Buy with Rarimo" button and follow the transaction process.

TODO more about what happens here.

References

This project was bootstrapped with Create React App.