Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BroadcastAPI

Hierarchy

  • BroadcastAPI

Index

Constructors

constructor

Properties

Readonly client

client: Client

expireTime

expireTime: number = 120 * 1000

How many milliseconds in the future to set the expiry time to when broadcasting a transaction, defaults to 1 minute.

Methods

accountCreate

  • Create account. Broadcasted to the blockchain to create a new account.

    Parameters

    • data: AccountCreateOperation[1]

      The account_create payload. See AccountCreateOperation

    • key: PrivateKey

      The Active or Owner private key of the account creator.

    Returns Promise<TransactionConfirmation>

accountUpdate

  • Update account. Updates account information.

    Parameters

    Returns Promise<TransactionConfirmation>

accountWitnessVote

  • Witness vote. Vote from an account to a witness.

    remarks

    Since HF 0.8 the formula VS/N where VP is the Vesting Share of the account and N the number of witnesses upvoted by the account is applied.

    Parameters

    • data: AccountWitnessVoteOperation[1]

      The account_witness_vote payload. See AccountWitnessVoteOperation

    • key: PrivateKey

      The private key of the account, should be the Active key at least.

    Returns Promise<TransactionConfirmation>

call

  • call(method: string, params?: any[]): Promise<any>
  • Convenience for calling condenser_api.

    Parameters

    • method: string
    • Optional params: any[]

    Returns Promise<any>

cancelTransferFromSavings

  • Cancel transfer from saving. Funds withdrawals from the savings can be canceled at any time before it is executed.

    Parameters

    Returns Promise<TransactionConfirmation>

changeRecoveryAccount

  • Change recovery account. Funds withdrawals from the savings can be canceled at any time before it is executed.

    Parameters

    Returns Promise<TransactionConfirmation>

claimAccount

  • Claim account. Requests from users or dApps to get an account creation ticket in order to create new accounts. These operations are issued before the actual creation of the account on the blockchain.

    remarks

    Deactivated Since HF 0.2

    Parameters

    Returns Promise<TransactionConfirmation>

claimRewardBalance

  • Claim reward balance. Author and curator rewards are not automatically transferred to the account’s balances. One has to issue a claim_reward_balance operation to trigger the transfer from the reward pool to its balance.

    Parameters

    Returns Promise<TransactionConfirmation>

comment

  • Comment. Creates a post/comment.

    remarks

    Rules:

    • The “title” must not be longer than 256 bytes
    • The “title” must be UTF-8
    • The “body” must be larger than 0 bytes
    • The “body” much also be UTF-8
    remarks

    json_metadata: There is no blockchain enforced validation on json_metadata, but the community has adopted a particular structure:

    • tags - An array of up to 5 strings. Although the blockchain will accept more than 5, the tags plugin only looks at the first five
    • app - A user agent style application identifier. Typically app_name/version, e.g. beblurt/0.1
    • format - The format of the body, e.g. markdown
    remarks

    In addition to the above keys, application developers are free to add any other keys they want to help manage the content they broadcast.

    remarks

    When a comment is first broadcast, the permlink must be unique for the author. Otherwise, it is interpreted as an update operation. Updating will either replace the entire body with the latest operation or patch the body if using {@link diff-match-patch}.

    Parameters

    • data: CommentOperation[1]

      The comment payload. See CommentOperation

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    • Optional options: CommentOptionsOperation[1]

      The comment_options payload [optional]. See CommentOptionsOperation

    Returns Promise<TransactionConfirmation>

commentOptions

  • Comment options. Authors of posts may not want all of the benefits that come from creating a post. This operation allows authors to update properties associated with their post. Typically, these options will accompany a comment operation in the same transaction.

    Parameters

    Returns Promise<TransactionConfirmation>

createClaimedAccount

  • Create claimed account. When used with claim_account, works identically to account_create See accountCreate.

    remarks

    Deactivated Since HF 0.2

    Parameters

    Returns Promise<TransactionConfirmation>

customJson

  • Broadcast custom JSON. Serves the same purpose as custom but also supports required posting authorities. Unlike custom, this operation is designed to be human readable/developer friendly.

    Parameters

    • data: CustomJsonOperation[1]

      The custom_json operation payload. See CustomJsonOperation

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

delegateVestingShares

  • Delegate vesting shares from one account to the other. The vesting shares are still owned by the original account, but content voting rights and bandwidth allocation are transferred to the receiving account. This sets the delegation to vesting_shares, increasing it or decreasing it as needed. (i.e. a delegation of 0 removes the delegation)

    When a delegation is removed the shares are placed in limbo for a week to prevent a satoshi of VESTS from voting on the same content twice.

    Parameters

    Returns Promise<TransactionConfirmation>

nexusFlagPost

  • Used by guests to suggest a post for the review queue. It’s up to the community to define what constitutes flagging.

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string
    • permlink: string

      The permlink of the post.

    • notes: string

      short notes

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusMutePost

  • Mute a post (Mods or higher). Can be a topic or a comment.

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string

      The author of the post.

    • permlink: string

      The permlink of the post.

    • notes: string

      short notes

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusPinPost

  • Stickies a post to the top of the community homepage (Mods or higher). If multiple posts are stickied, the newest ones are shown first.

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string

      The author of the post.

    • permlink: string

      The permlink of the post.

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusSetRole

  • nexusSetRole(community: string, authority: string, account: string, role: "admin" | "mod" | "member" | "guest" | "muted", key: PrivateKey): Promise<TransactionConfirmation>
  • Stickies a post to the top of the community homepage (Mods or higher). If multiple posts are stickied, the newest ones are shown first.

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string

      The account submitting the custom_json operation.

    • role: "admin" | "mod" | "member" | "guest" | "muted"

      The author of the post.

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusSetUserTitle

  • Stickies a post to the top of the community homepage (Mods or higher). If multiple posts are stickied, the newest ones are shown first.

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string

      The account submitting the custom_json operation.

    • title: string

      title for the account

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusSubscription

  • Un/subscribe to a community (Guest Operations)

    Parameters

    • community: string

      The community account concerned.

    • action: "subscribe" | "unsubscribe"

      Un/subscribe to a community.

    • account: string

      The account submitting the custom_json operation.

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusUnmutePost

  • Unmute a post (Mods or higher).

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string

      The author of the post.

    • permlink: string

      The permlink of the post.

    • notes: string

      short notes

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusUnpinPost

  • Removes a post to the top of the community homepage (Mods or higher).

    Parameters

    • community: string

      The community account concerned.

    • authority: string

      The account submitting the custom_json operation.

    • account: string

      The author of the post.

    • permlink: string

      The permlink of the post.

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

nexusUpdateProps

  • Broadcast Nexus update properties (Admin Operations). Update display settings of a Community.

    Parameters

    • data: NexusUpdateProps

      The custom_json operation payload. See NexusUpdateProps

    • authority: string

      The account submitting the custom_json operation.

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

prepareTransaction

  • Prepare transaction with operations for Sign and broadcast to the network.

    Parameters

    • operations: Operation[]

      List of operations to send.

    Returns Promise<Transaction>

readNotification

  • Broadcast a read notification to the network.

    Parameters

    Returns Promise<TransactionConfirmation>

reblurt

  • Reblurt/Undo Reblurt a post

    Parameters

    • account: string

      The account submitting the custom_json operation.

    • author: string

      The author of the post.

    • permlink: string

      The permlink of the post.

    • Default value undo: boolean = false

      if true Undo Reblurt else Reblurt

    • key: PrivateKey

      The Posting, Active or Owner private key of the account.

    Returns Promise<TransactionConfirmation>

send

sendOperations

  • Sign and broadcast transaction with operations to the network. Throws if the transaction expires.

    Parameters

    Returns Promise<TransactionConfirmation>

sign

transfer

  • Broadcast a transfer.

    Parameters

    • data: TransferOperation[1]

      The transfer operation payload.

    • key: PrivateKey

      Private active key of sender.

    Returns Promise<TransactionConfirmation>

vote

  • Broadcast a vote.

    Parameters

    • vote: VoteOperation[1]

      The vote to send.

    • key: PrivateKey

      Private posting key of the voter.

    Returns Promise<TransactionConfirmation>

Generated using TypeDoc