Transactions

Send Token

Currently, Ramper SDK supports sendToken which is a simple way to send a token to another address from the current logged in wallet.

const sendToken = async (params: Partial<{
  from: string
  to: string
  value: string
  decimal: number
  symbol: string
  network: string
  theme: string
}>) => Promise<boolean>

Example Usage:

import { sendToken } from '@ramper/ethereum'

await sendToken({
  to: '0xa419dfa199Df8651c3f4476546AF5E4CC4E0F73F',
  value: '0.00001',
  network: 'mainnet'
})

RamperSigner

Ramper SDK allows you to request a signed transaction from the user for subsequent broadcasting to the network. Ramper SDK is built around Ether.js and Alchemy but if you'd like to see Ramper SDK support other use cases, let us know on Discord, or email us at [email protected]. In order to broadcast a transaction, you must first set up an Alchemy Provider.

After the user is logged in through Ramper SDK, you can set up a RamperSigner object with the alchemy provider that will eventually collect the user's authorization to sign the requested transaction.

Sign Transaction

Example usage:

Send Transaction

Example usage:

Sign Message

Example usage:

Sign TypedData

Example usage:

eip712.ts

Error Handling

Use a try/catch block to detect if the user canceled the transaction or the transaction failed to be broadcasted successfully.

Last updated