Stake for Free Gas

Stake for free gas

UI
Ethers
Step2: Click on GAS STAKE button, enter the address and amount to stake
import { getDefaultProvider, Wallet } from "ethers";
import { Fee__factory } from "@rei-network/contracts";
const provider = getDefaultProvider("https://rpc-mainnet.rei.network");
const wallet = new Wallet("yourPrivateKey", provider);
const fee = Fee__factory.connect(
"0x0000000000000000000000000000000000001005",
wallet
);
fee
.deposit("yourAddress", {
value: "depositAmount",
})
.then(() => {
// ...
})
.catch(() => {
// ...
});

Withdraw Gas Stakes

UI
Ethers
The staked $REI cannot be withdrawn within 3 days. After 3 days, WITHDRAW will be enabled.
import { getDefaultProvider, Wallet } from "ethers";
import { Fee__factory } from "@rei-network/contracts";
const provider = getDefaultProvider("https://rpc-mainnet.rei.network");
const wallet = new Wallet("yourPrivateKey", provider);
const fee = Fee__factory.connect(
"0x0000000000000000000000000000000000001005",
wallet
);
fee
.withdraw("yourAddress", "withdrawAmount")
.then(() => {
// ...
})
.catch(() => {
// ...
});
Last modified 4mo ago