UNPKG

@ardier16/q-js-sdk

Version:

Typescript Library to interact with Q System Contracts

63 lines (62 loc) 2.84 kB
import Web3 from 'web3'; import { Vesting } from '../../web3-contracts/Vesting'; import { TransactionReceipt } from 'web3-eth'; import { VotingLockInfo, QNonPayableTx, TimeLockEntry, QPayableTx } from '../../types'; import { SystemContractInstance } from '../SystemContractInstance'; import BN from 'bn.js'; /** * Vesting instance to interact with Vesting contract. * See [onchain documentation](@system-contracts-repo/@network/Vesting/) for more details. * An instance of this class for a deployed network can be obtained via {@link ContractRegistryInstance.vesting} */ export declare class VestingInstance extends SystemContractInstance<Vesting> { static readonly registryKey = "tokeneconomics.vesting"; private c; static readonly abi = "Vesting.json"; private timeLockHelper; constructor(web3: Web3, address: string); /** * [External documentation](@system-contracts-repo/@network/Vesting/#lock) */ lock(amount: string, txOptions?: QNonPayableTx): Promise<TransactionReceipt>; /** * [External documentation](@system-contracts-repo/@network/Vesting/#announceunlock) */ announceUnlock(amount: string, txOptions?: QNonPayableTx): Promise<TransactionReceipt>; /** * [External documentation](@system-contracts-repo/@network/Vesting/#unlock) */ unlock(amount: string, txOptions?: QNonPayableTx): Promise<TransactionReceipt>; /** * [External documentation](@system-contracts-repo/@network/Vesting/#withdraw) */ withdraw(amount: string, txOptions?: QNonPayableTx): Promise<TransactionReceipt>; /** * [External documentation](@system-contracts-repo/@network/Vesting/#balanceof) */ balanceOf(userAddress: string): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/Vesting/#withdrawablebalanceof) */ withdrawableBalanceOf(account: string): Promise<string>; /** * [External documentation](@system-contracts-repo/@network/Vesting/#getlockinfo) */ getLockInfo(user: string): Promise<VotingLockInfo>; /** * {@link TimeLockHelperInstance.depositOnBehalfOf | Internal documentation} */ depositOnBehalfOf(account: string, start: number | string | BN, end: number | string | BN, txOptions?: QPayableTx): Promise<TransactionReceipt>; /** * {@link TimeLockHelperInstance.getTimeLocks | Internal documentation} */ getTimeLocks(account: string): Promise<TimeLockEntry[]>; /** * {@link TimeLockHelperInstance.getMinimumBalance | Internal documentation} */ getMinimumBalance(account: string, timestamp: number | BN | string): Promise<string>; /** * {@link TimeLockHelperInstance.purgeTimeLocks | Internal documentation} */ purgeTimeLocks(account: string, txOptions?: QNonPayableTx): Promise<TransactionReceipt>; }