Installation and Setup
This section is a work in progress..
Installation / Importing
Add rentfun
to your project with npm
npm install --save rentfun
Importing
ES6 or Typescript
import { RentFun } from "rentfun";
NodeJS require
import { RentFun } from "rentfun";
Setup
Custom Provider URL
By default, the default provider is automatically used when initiating rentfun.
import { RentFun } from "rentfun";
const rentfun = new RentFun();
A custom provider can be assigned as the following example:
import { ethers } from "ethers";
import { RentFun } from "rentfun";
const provider = new ethers.providers.JsonRpcProvider('https://arb-mainnet.g.alchemy.com/v2/-KEY', 'any');
const rentfun = new RentFun(provider);
If you are using this in a Node environment as a backend service, you can also assign a provider with the PROVIDER_URL environment variable.
# .env
PROVIDER_URL="https://arb-mainnet.g.alchemy.com/v2/-KEY"
Last updated