Example TypeScript scripts for interacting with the Flare smart accounts using Viem.
About · Contributing · Security · Changelog
This repository contains example code for interacting with the Flare smart accounts system using the Viem library. All example scripts are located in the src directory.
src
├── abis
├── utils
├── index.ts
├── mint-and-transfer.ts: mint FXRP and transfer it to a Flare account; essentially, this allows you to mint FXRP to an arbitrary Flare address.
├── README.md
├── state-lookup.ts: get personal account of an XRPL address, its FXRP balance, the XRP balance of the address...
└── upshift-mint-and-deposit.ts: mint FXRP and deposit it to an Upshift type vault-
Clone the repository:
git clone <repository-url> cd flare-smart-accounts-viem
-
Create a
.envfile:cp .env.example .env
-
Configure your environment: Edit the
.envfile and add your configuration values (private keys, RPC URLs, etc.). -
Install dependencies:
pnpm install
Note: You can use
npmoryarninstead ofpnpmif you prefer.
Execute any script in the src directory using:
pnpm run script <path-to-file>Example:
pnpm run script src/mint-and-transfer.ts