/** * @file RIFI * @desc These methods facilitate interactions with the RIFI token smart * contract. */ import { BigNumber } from 'ethers'; import { CallOptions, TrxResponse, Signature, Provider } from './types'; /** * Get the balance of RIFI tokens held by an address. * * @param {string} _address The address in which to find the RIFI balance. * @param {Provider | string} [_provider] An Ethers.js provider or valid network * name string. * * @returns {string} Returns a string of the numeric balance of RIFI. The value * is scaled up by 18 decimal places. * * @example * * ``` * (async function () { * const bal = await Rifi.comp.getRifiBalance('0x2775b1c75658Be0F640272CCb8c72ac986009e38'); * console.log('Balance', bal); * })().catch(console.error); * ``` */ export declare function getRifiBalance(_address: string, _provider?: Provider | string): Promise; interface RifiBalanceMetadataExt { balance: BigNumber; votes: BigNumber; delegate: string; allocated: BigNumber; } /** * Get the amount of RIFI tokens accrued but not yet claimed by an address. * * @param {string} _address The address in which to find the RIFI accrued. * @param {Provider | string} [_provider] An Ethers.js provider or valid network * name string. * * @returns {string} Returns a string of the numeric accruement of RIFI. The * value is scaled up by 18 decimal places. * * @example * * ``` * (async function () { * const acc = await Rifi.comp.getRifiAccrued('0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5'); * console.log('Accrued', acc); * })().catch(console.error); * ``` */ export declare function getRifiAccrued(_address: string, _provider?: Provider | string): Promise; /** * Create a transaction to claim accrued RIFI tokens for the user. * * @param {CallOptions} [options] Options to set for a transaction and Ethers.js * method overrides. * * @returns {object} Returns an Ethers.js transaction object of the vote * transaction. * * @example * * ``` * const rifi = new Rifi(window.ethereum); * * (async function() { * * console.log('Claiming RIFI...'); * const trx = await rifi.claimRifi(); * console.log('Ethers.js transaction object', trx); * * })().catch(console.error); * ``` */ export declare function claimRifi(options?: CallOptions): Promise; /** * Create a transaction to delegate Rifi Governance voting rights to an * address. * * @param {string} _address The address in which to delegate voting rights to. * @param {CallOptions} [options] Options to set for `eth_call`, optional ABI * (as JSON object), and Ethers.js method overrides. The ABI can be a string * of the single intended method, an array of many methods, or a JSON object * of the ABI generated by a Solidity compiler. * * @returns {object} Returns an Ethers.js transaction object of the vote * transaction. * * @example * * ``` * const rifi = new Rifi(window.ethereum); * * (async function() { * const delegateTx = await rifi.delegate('0xa0df350d2637096571F7A701CBc1C5fdE30dF76A'); * console.log('Ethers.js transaction object', delegateTx); * })().catch(console.error); * ``` */ export declare function delegate(_address: string, options?: CallOptions): Promise; /** * Delegate voting rights in Rifi Governance using an EIP-712 signature. * * @param {string} _address The address to delegate the user's voting rights to. * @param {number} nonce The contract state required to match the signature. * This can be retrieved from the RIFI contract's public nonces mapping. * @param {number} expiry The time at which to expire the signature. A block * timestamp as seconds since the unix epoch. * @param {object} signature An object that contains the v, r, and, s values of * an EIP-712 signature. * @param {CallOptions} [options] Options to set for `eth_call`, optional ABI * (as JSON object), and Ethers.js method overrides. The ABI can be a string * of the single intended method, an array of many methods, or a JSON object * of the ABI generated by a Solidity compiler. * * @returns {object} Returns an Ethers.js transaction object of the vote * transaction. * * @example * * ``` * const rifi = new Rifi(window.ethereum); * * (async function() { * const delegateTx = await rifi.delegateBySig( * '0xa0df350d2637096571F7A701CBc1C5fdE30dF76A', * 42, * 9999999999, * { * v: '0x1b', * r: '0x130dbca2fafa07424c033b4479687cc1deeb65f08809e3ab397988cc4c6f2e78', * s: '0x1debeb8250262f23906b1177161f0c7c9aa3641e8bff5b6f5c88a6bb78d5d8cd' * } * ); * console.log('Ethers.js transaction object', delegateTx); * })().catch(console.error); * ``` */ export declare function delegateBySig(_address: string, nonce: number, expiry: number, signature?: Signature, options?: CallOptions): Promise; /** * Create a delegate signature for Rifi Governance using EIP-712. The * signature can be created without burning gas. Anyone can post it to the * blockchain using the `delegateBySig` method, which does have gas costs. * * @param {string} delegatee The address to delegate the user's voting rights * to. * @param {number} [expiry] The time at which to expire the signature. A block * timestamp as seconds since the unix epoch. Defaults to `10e9`. * * @returns {object} Returns an object that contains the `v`, `r`, and `s` * components of an Ethereum signature as hexadecimal strings. * * @example * * ``` * const rifi = new Rifi(window.ethereum); * * (async () => { * * const delegateSignature = await rifi.createDelegateSignature('0xa0df350d2637096571F7A701CBc1C5fdE30dF76A'); * console.log('delegateSignature', delegateSignature); * * })().catch(console.error); * ``` */ export declare function createDelegateSignature(delegatee: string, expiry?: number): Promise; export {};