dposlib.ark.builders.v3

upVote

def upVote(*usernames)

Build an upvote transaction.

Arguments:

  • usernames iterable - delegate usernames as str iterable.

Returns:

  • dposlib.ark.tx.Transaction - orphan transaction.

downVote

def downVote(*usernames)

Build a downvote transaction.

Arguments:

  • usernames iterable - delegate usernames as str iterable.

Returns:

  • dposlib.ark.tx.Transaction - orphan transaction.

switchVote

def switchVote(tx, identifier=None)

Transform a dposlib.ark.builders.upVote transaction into a multivote one. It makes the transaction downvote former delegate if any and then apply new vote.

Arguments:

  • tx dposlib.ark.tx.Transaction - upVote transaction.
  • identifier dposlib.ark.tx.Transaction - any identifier accepted by /api/wallets API endpoint. it could be a username, a wallet address or a publicKey.

Returns:

  • dposlib.ark.tx.Transaction - orphan transaction.

htlcSecret

def htlcSecret(secret, hash_type=0)

Compute an HTLC secret from passphrase.

Arguments:

  • secret str - passphrase.
  • hash_type int - hash method used.

Returns:

  • bytes - HTLC secret.

htlcLock

def htlcLock(amount,
             address,
             secret,
             expiration=24,
             vendorField=None,
             hash_type=0)

Build an HTLC lock transaction. Emoji can be included in transaction vendorField using unicode formating.

>>> vendorField = u"message with sparkles \u2728"

Arguments:

  • amount float - transaction amount in ark.
  • address str - valid recipient address.
  • secret str - lock passphrase.
  • expiration float - transaction validity in hour.
  • vendorField str - vendor field message.
  • hash_type int - hash method used.

Returns:

  • dposlib.ark.tx.Transaction - orphan transaction.

htlcClaim

def htlcClaim(txid, secret, hash_type=0)

Build an HTLC claim transaction.

Arguments:

  • txid str - htlc lock transaction id.
  • secret str - passphrase used by htlc lock transaction.
  • hash_type int - hash method used.

Returns:

  • dposlib.ark.tx.Transaction - orphan transaction.

burn

def burn(amount, vendorField=None)

Build a burn transaction. ```

Args: amount (float): transaction amount as human value.

Returns: dposlib.ark.tx.Transaction: orphan transaction.