pushkey
This module allows you to create and manage push keys. It can be accessed from the global variable pk
.
register
Send a transaction to register a public key as a push key.
Parameters
txObject
-Object
: The transaction objectpubKey
-String
: (optional) A base58 encoded public key to be registered.scopes
-Array<String>
: (optional) A list of repositories or namespaces where the push key can be used.feeCap
-String
: (optional) The maximum amount of fee the key can spend from its creator's account.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key that will be used to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.address
-String
: A bech32 encoded push key address.
Example
Create a transaction to register a public key on the network.
update
Send a transaction to update a previously registered public key.
Parameters
txObject
-Object
: The transaction objectid
-String
: The push key address.addScopes
-Array<String>
: (optional) A list of repositories or namespaces where the push key can be used.removeScopes
-Array<Number>
: (optional) Index of scopes to be removed.feeCap
-String
: (optional) The maximum amount of fee the key can spend from its creator's account.delete
-Boolean
: Indicates that the public key should be deleted.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction to update a push key.
unregister
Send a transaction to delete a public key.
Parameters
txObject
-Object
: The transaction objectid
-String
: The push key address.nonce
-Number|String
: The signing account’s next nonce.fee
-String
: The network fee to be paid by the signing account.timestamp
-String
: (optional) The unix timestamp of the transaction.sig
-String
: (optional) The transaction signature. If not provided, the transaction will be signed using thesigningKey
.
signingKey
-String
: (optional) The private key to use to sign the transaction.payloadOnly
-Boolean
: (optional) When true, the transaction payload is returned instead of being sent to the network.
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
Create a transaction to unregister a push key from the network.
get
Get a push key by its address.
Parameters
address
-String
: The push key address.height
-Number|String
: (optional) The block height to query (Default: latest).
Returns
Object
- The result object
hash
-String
: A 32 bytes transaction hash.
Example
getByAddress
Get a list of push keys belonging to an address.
Parameters
address
-String
: The push key address.
Returns
Array<Object>
- The list of objects
address
-String
: The address of the push key owner.feeCap
-String
: The maximum fee the push key is allowed to spend from the owner’s account.feeUsed
-String
: The amount of Latinum spent on fees.pubKey
-Array<Number>
- The public key
Example
getAccountOfOwner
Get the account that owns the given push key.
Parameters
address
-String
: The push key address.height
-Number|String
: (optional) The block height to query (Default: latest).
Returns
Account
Example
Last updated