Options
All
  • Public
  • Public/Protected
  • All
Menu

Module api/src

Index

Type aliases

FollowTxnResponse

FollowTxnResponse: BaseTxnSubmissionResponse<{ FollowedPublicKey: string; IsUnfollow: boolean }>

LikeTxnResponse

LikeTxnResponse: BaseTxnSubmissionResponse<{ IsUnlike: boolean; LikedPostHash: number[] }>

PostEntryResponse

PostEntryResponse: Partial<PostEntryResponseFull>

PostTxnResponse

PostTxnResponse: BaseTxnSubmissionResponse<TxnMetaSubmitPost> & { PostEntryResponse: PostEntryResponse }

SendBitcloutTxnResponse

SendBitcloutTxnResponse: BaseTxnSubmissionResponse

SendDiamondsTxnResponse

SendDiamondsTxnResponse: BaseTxnSubmissionResponse<{ CreatorCoinToTransferNanos: number; ProfilePublicKey: string; ReceiverPublicKey: string }, { DiamondLevel: string; DiamondPostHash: string }>

TransferCreatorCoinTxnResponse

TransferCreatorCoinTxnResponse: BaseTxnSubmissionResponse<{ CreatorCoinToTransferNanos: number; ProfilePublicKey: string; ReceiverPublicKey: string }>

UpdateProfileTxnResponse

Functions

Const bitcoinToSatoshis

  • bitcoinToSatoshis(n: number): number
  • Convert an amount of bitcoin to satoshis by multiplying by 1e8

    Parameters

    • n: number

    Returns number

Const cloutToNanos

  • cloutToNanos(n: number): number
  • Convert an amount of bitclout (or creator coins) to nanos by multiplying by 1e9

    Parameters

    • n: number

    Returns number

Const nanosToClout

  • nanosToClout(n: number): number
  • Convert an amount of nanos to bitclout (or creator coins) by dividing by 1e9

    Parameters

    • n: number

    Returns number

Const satoshisToBitcoin

  • satoshisToBitcoin(n: number): number
  • Convert an amount of satoshis to bitcoin by dividing by 1e8

    Parameters

    • n: number

    Returns number

validateJWT

  • validateJWT(jwt: string, publicKey: string): jsonwebtoken.JwtPayload
  • Parses a JWT and verifies that it was signed by owner of a public key. Throws an error if there is an error decoding

    Parameters

    • jwt: string

      The JWT string

    • publicKey: string

      A BitClout public to validate the JWT against

    Returns jsonwebtoken.JwtPayload

    The JWT payload, if verification was succesful.

Generated using TypeDoc