9.9 KiB
Table of Contents
- Ed25519Keypair
- makeEd25519Condition
- makeSha256Condition
- makeThresholdCondition
- makeCreateTransaction
- makeOutput
- makeTransferTransaction
- serializeTransactionIntoCanonicalString
- signTransaction
- ccJsonLoad
- ccJsonify
- getBlock
- getTransaction
- getStatus
- listBlocks
- listOutputs
- listTransactions
- listVotes
- pollStatusAndFetchTransaction
- postTransaction
Ed25519Keypair
Parameters
secret
number? A seed that will be used as a key derivation function
Properties
makeEd25519Condition
Parameters
publicKey
string base58 encoded Ed25519 public key for the recipient of the Transactionjson
boolean If true returns a json object otherwise a crypto-condition type (optional, defaulttrue
)
Returns object Ed25519 Condition (that will need to wrapped in an Output)
makeSha256Condition
Parameters
preimage
string Preimage to be hashed and wrapped in a crypto-conditionjson
boolean If true returns a json object otherwise a crypto-condition type (optional, defaulttrue
)
Returns object Preimage-Sha256 Condition (that will need to wrapped in an Output)
makeThresholdCondition
Parameters
threshold
numbersubconditions
Array (optional, default[]
)json
boolean If true returns a json object otherwise a crypto-condition type (optional, defaulttrue
)
Returns object Sha256 Threshold Condition (that will need to wrapped in an Output)
makeCreateTransaction
Parameters
asset
object Created asset's datametadata
object Metadata for the Transactionoutputs
Array<object> Array of Output objects to add to the Transaction. Think of these as the recipients of the asset after the transaction. ForCREATE
Transactions, this should usually just be a list of Outputs wrapping Ed25519 Conditions generated from the issuers' public keys (so that the issuers are the recipients of the created asset).issuers
...Array<string> Public key of one or more issuers to the asset being created by this Transaction. Note: Each of the private keys corresponding to the given public keys MUST be used later (and in the same order) when signing the Transaction (signTransaction()
).
Returns object Unsigned transaction -- make sure to call signTransaction() on it before sending it off!
makeOutput
Parameters
condition
object Condition (e.g. a Ed25519 Condition frommakeEd25519Condition()
)amount
number Amount of the output (optional, default1
)
Returns object An Output usable in a Transaction
makeTransferTransaction
Parameters
unspentTransaction
object Previous Transaction you have control over (i.e. can fulfill its Output Condition)metadata
object Metadata for the Transactionoutputs
Array<object> Array of Output objects to add to the Transaction. Think of these as the recipients of the asset after the transaction. ForTRANSFER
Transactions, this should usually just be a list of Outputs wrapping Ed25519 Conditions generated from the public keys of the recipients.fulfilledOutputs
...number Indices of the Outputs inunspentTransaction
that this Transaction fulfills. Note that the public keys listed in the fulfilled Outputs must be used (and in the same order) to sign the Transaction (signTransaction()
).
Returns object Unsigned transaction -- make sure to call signTransaction() on it before sending it off!
serializeTransactionIntoCanonicalString
Parameters
transaction
null
object (transaction)
Returns string a canonically serialized Transaction
signTransaction
Parameters
transaction
object Transaction to sign.transaction
is not modified.privateKeys
...string Private keys associated with the issuers of thetransaction
. Looped through to iteratively sign any Input Fulfillments found in thetransaction
.
Returns object The signed version of transaction
.
ccJsonLoad
Parameters
conditionJson
object
Returns cc.Condition Ed25519 Condition (that will need to wrapped in an Output)
ccJsonify
Parameters
fulfillment
cc.Fulfillment base58 encoded Ed25519 public key for the recipient of the Transaction
Returns object Ed25519 Condition (that will need to wrapped in an Output)
Connection
getBlock
Parameters
blockId
getTransaction
Parameters
txId
getStatus
Parameters
tx_id
listBlocks
Parameters
$0
Object$0.tx_id
$0.status
tx_id
status
listOutputs
Parameters
$0
Object$0.public_key
$0.unspent
onlyJsonResponse
public_key
unspent
listTransactions
Parameters
$0
Object$0.asset_id
$0.operation
asset_id
operation
listVotes
Parameters
block_id
pollStatusAndFetchTransaction
Parameters
tx_id
Returns Promise
postTransaction
Parameters
transaction