Options
All
  • Public
  • Public/Protected
  • All
Menu

near-lockup-helper

Index

Type aliases

AccountLockup: { calculatedAtBlockHeight: number; liquidAmount: BN; lockedAmount: BN; lockupAccountId: string; lockupReleaseStartDate: Date; lockupState: LockupState & { vestedInfo: string }; ownerAccountBalance: BN; totalAmount: BN }

Type declaration

  • Readonly calculatedAtBlockHeight: number
  • Readonly liquidAmount: BN
  • Readonly lockedAmount: BN
  • Readonly lockupAccountId: string
  • Readonly lockupReleaseStartDate: Date
  • Readonly lockupState: LockupState & { vestedInfo: string }
  • Readonly ownerAccountBalance: BN
  • Readonly totalAmount: BN
BlockReference: { block_id: string | number } | { finality: "optimistic" | "near-final" | "final" } | { sync_checkpoint: "genesis" | "earliest_available" }
ConnectOptions: Omit<ConnectConfig, "networkId" | "keyStore" | "headers"> & { headers?: {}; keyStore?: KeyStore; networkId?: string }
LockupState: { blockTimestamp: BN; hasBrokenTimestamp: boolean; lockupAmount: BN; lockupDuration: BN; lockupTimestamp?: BN; owner: string; releaseDuration?: BN; terminationWithdrawnTokens: BN; transferInformation: TransferInformation; vestingInformation?: VestingInformation }

Type declaration

  • Readonly blockTimestamp: BN
  • Readonly hasBrokenTimestamp: boolean
  • Readonly lockupAmount: BN
  • Readonly lockupDuration: BN
  • Optional Readonly lockupTimestamp?: BN
  • Readonly owner: string
  • Optional Readonly releaseDuration?: BN
  • Readonly terminationWithdrawnTokens: BN
  • Readonly transferInformation: TransferInformation
  • Optional Readonly vestingInformation?: VestingInformation
TransferInformation: { transfer_poll_account_id?: string; transfers_timestamp?: BN }

Type declaration

  • Optional Readonly transfer_poll_account_id?: string
  • Optional Readonly transfers_timestamp?: BN
VestingInformation: { cliff?: BN; end?: BN; start?: BN; terminationStatus?: number; unvestedAmount?: BN; vestingHash?: readonly unknown[] }

Type declaration

  • Optional Readonly cliff?: BN
  • Optional Readonly end?: BN
  • Optional Readonly start?: BN
  • Optional Readonly terminationStatus?: number
  • Optional Readonly unvestedAmount?: BN
  • Optional Readonly vestingHash?: readonly unknown[]
ViewAccount: { amount: BN; blockHeight: number; codeHash: string }

Type declaration

  • Readonly amount: BN
  • Readonly blockHeight: number
  • Readonly codeHash: string
ViewAccountQuery: QueryResponseKind & { amount: string; code_hash: string; locked: string; storage_paid_at: number; storage_usage: number }
ViewStateResult: QueryResponseKind & { proof: readonly string[]; values: readonly StateItem[] }

Functions

  • formatReleaseDuration(releaseDuration: BN): BN
  • View lockup account balance including the tokens delegated for staking.

    Parameters

    • contractId: string

      near lockup accountId used to interact with the network.

    • Optional nearConfig: ConnectOptions

      specify custom connection to NEAR network.

    • blockReference: BlockReference = ...

      specify block of calculated data.

    Returns Promise<BN>

    yoctoNEAR amount of tokens

  • getStartLockupTimestamp(lockupDuration: BN, lockupTimestamp: BN, hasBrokenTimestamp: boolean): BN
  • Parameters

    • lockupDuration: BN
    • lockupTimestamp: BN
    • hasBrokenTimestamp: boolean

    Returns BN

    timestamp.

  • Connect to NEAR rpc.

    Parameters

    • Optional config: ConnectOptions

      connection options {@link ConnectConfig}.

    Returns Promise<Near>

    connection to Near network.

  • readOption(reader: BinaryReader): string
  • saturatingSub(a: BN, b: BN): BN
  • View balance and state of lockup account.

    Parameters

    • accountId: string

      near lockup account owner id used to interact with the network.

    • Optional nearConfig: ConnectOptions

      specify custom connection to NEAR network.

    • blockReference: BlockReference = ...

      specify block of calculated data.

    Returns Promise<ViewAccount>

    account codeHash and balance calculated at particular block ViewAccount.

  • View all information about lockup account.

    Parameters

    • lockupAccountId: string

      near lockup accountId used to interact with the network.

    • Optional nearConfig: ConnectOptions

      specify custom connection to NEAR network.

    • Optional blockReference: BlockReference

      specify block of calculated data.

    Returns Promise<AccountLockup>

    lockup account information AccountLockup.

  • View state of lockup account

    Parameters

    • contractId: string

      near lockup accountId used to interact with the network.

    • Optional nearConfig: ConnectOptions

      specify custom connection to NEAR network.

    • blockReference: BlockReference = ...

      specify block BlockReference of calculated data. Default is { finality: "final" }.

    Returns Promise<LockupState>

    state of lockup account LockupState.

Generated using TypeDoc