Expand description
C bindings for ergo-lib
Macros§
- make_
collection ergo-lib
uses a number of collection types that are simple wrappers aroundVec
. We have a generic type for such a collection inergo-lib-c-core::collections::Collection
. A limitation ofcbindgen
is that it cannot process generic functions. This macro generates a C-compatible interface for such a collection for any desired type T.- make_
ffi_ eq - Generates an equality function for FFI
Structs§
- Address
- Address wrapper
- Return
Bool - Convenience type to allow us to pass Rust bools (with possible error) through FFI to the C side.
- Return
Num - Convenience type to allow us to pass Rust enums with
u8
representation through FFI to the C side. - Return
Option - Convenience type to allow us to pass Rust
Option<_>
types through FFI to C side. - Return
String - Convenience type to allow us to pass Rust CStrings through FFI to C side (as pointers). Note it is the responsibility of the caller to free the Rust CString. For an example, see MnemonicGenerator in the Swift bindings.
Enums§
- Address
Type Prefix - Error
- Network
Prefix - Network type
Traits§
Functions§
- delete_
ptr ⚠ - ergo_
lib_ ⚠address_ delete - ergo_
lib_ ⚠address_ from_ base58 - ergo_
lib_ ⚠address_ from_ ergo_ tree - ergo_
lib_ ⚠address_ from_ mainnet - ergo_
lib_ ⚠address_ from_ public_ key - ergo_
lib_ ⚠address_ from_ testnet - ergo_
lib_ ⚠address_ to_ base58 - ergo_
lib_ ⚠address_ to_ ergo_ tree - ergo_
lib_ ⚠address_ type_ prefix - ergo_
lib_ ⚠batch_ merkle_ proof_ delete - ergo_
lib_ ⚠batch_ merkle_ proof_ from_ json - ergo_
lib_ ⚠batch_ merkle_ proof_ to_ json - Serializes a BatchMerkleProof to json representation
- ergo_
lib_ ⚠batch_ merkle_ proof_ valid - ergo_
lib_ ⚠block_ header_ delete - Delete
BlockHeader
- ergo_
lib_ ⚠block_ header_ eq - ergo_
lib_ ⚠block_ header_ from_ json - Parse BlockHeader array from JSON (Node API)
- ergo_
lib_ ⚠block_ header_ id - Get
BlockHeader
s id - ergo_
lib_ ⚠block_ header_ transactions_ root - Copy the contents of
transactions_root
field tooutput
. Key assumption: exactly 32 bytes of memory have been allocated at the address pointed-to byoutput
. - ergo_
lib_ ⚠block_ headers_ add - Add an element to collection
- ergo_
lib_ ⚠block_ headers_ delete - Delete an existing collection
- ergo_
lib_ ⚠block_ headers_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠block_ headers_ len - Returns length of an existing collection
- ergo_
lib_ ⚠block_ headers_ new - Create a new empty collection
- ergo_
lib_ ⚠block_ id_ delete - Delete
BlockId
- ergo_
lib_ ⚠block_ id_ eq - ergo_
lib_ ⚠block_ id_ from_ str - Convert a hex string into a BlockId
- ergo_
lib_ ⚠block_ ids_ add - Add an element to collection
- ergo_
lib_ ⚠block_ ids_ delete - Delete an existing collection
- ergo_
lib_ ⚠block_ ids_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠block_ ids_ len - Returns length of an existing collection
- ergo_
lib_ ⚠block_ ids_ new - Create a new empty collection
- ergo_
lib_ ⚠box_ id_ delete - Drop
BoxId
- ergo_
lib_ ⚠box_ id_ eq - ergo_
lib_ ⚠box_ id_ from_ str - Parse box id (32 byte digest) from base16-encoded string
- ergo_
lib_ ⚠box_ id_ to_ bytes - Returns byte array (32 bytes) Note: it’s imperative that
output
points to a valid block of memory of 32 bytes. - ergo_
lib_ ⚠box_ id_ to_ str - Base16 encoded string
- ergo_
lib_ ⚠box_ selection_ boxes - Selected boxes to spend as transaction inputs
- ergo_
lib_ ⚠box_ selection_ change - Selected boxes to use as change
- ergo_
lib_ ⚠box_ selection_ delete - Drop
BoxSelection
- ergo_
lib_ ⚠box_ selection_ eq - ergo_
lib_ ⚠box_ selection_ new - Create a selection to easily inject custom selection algorithms
- ergo_
lib_ ⚠box_ value_ as_ i64 - Get value as signed 64-bit long
- ergo_
lib_ ⚠box_ value_ delete - Drop
BoxValue
- ergo_
lib_ ⚠box_ value_ eq - ergo_
lib_ ⚠box_ value_ from_ i64 - Create from i64 with bounds check
- ergo_
lib_ ⚠box_ value_ safe_ user_ min - Recommended (safe) minimal box value to use in case box size estimation is unavailable. Allows box size upto 2777 bytes with current min box value per byte of 360 nanoERGs
- ergo_
lib_ ⚠box_ value_ sum_ of - Create a new box value which is the sum of the arguments, with bounds check.
- ergo_
lib_ box_ value_ units_ per_ ergo - Number of units inside one ERGO (i.e. one ERG using nano ERG representation)
- ergo_
lib_ ⚠byte_ array_ delete - ergo_
lib_ ⚠byte_ array_ from_ raw_ parts - ergo_
lib_ ⚠byte_ arrays_ add - Add an element to collection
- ergo_
lib_ ⚠byte_ arrays_ delete - Delete an existing collection
- ergo_
lib_ ⚠byte_ arrays_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠byte_ arrays_ len - Returns length of an existing collection
- ergo_
lib_ ⚠byte_ arrays_ new - Create a new empty collection
- ergo_
lib_ ⚠commitment_ hint_ delete - Drop
CommitmentHint
- ergo_
lib_ ⚠context_ extension_ delete - Drop
ContextExtension
- ergo_
lib_ ⚠context_ extension_ empty - Create new empty ContextExtension instance
- ergo_
lib_ ⚠context_ extension_ get - Returns constant with given key or None if key doesn’t exist or error if constants parsing were failed
- ergo_
lib_ ⚠context_ extension_ keys - Returns all keys (represented as u8 values) in the map
- ergo_
lib_ ⚠context_ extension_ len - Returns the number of elements in the collection
- ergo_
lib_ ⚠context_ extension_ set_ pair - Set the supplied pair in the ContextExtension
- ergo_
lib_ ⚠contract_ compile - Compiles a contract from ErgoScript source code
- ergo_
lib_ ⚠contract_ delete - Drop
Contract
- ergo_
lib_ ⚠contract_ eq - ergo_
lib_ ⚠contract_ ergo_ tree - Get the ErgoTree of the contract
- ergo_
lib_ ⚠contract_ new - Create new contract from ErgoTree
- ergo_
lib_ ⚠contract_ pay_ to_ address - Create new contract that allow spending of the guarded box by a given recipient
- ergo_
lib_ ⚠data_ input_ box_ id - Get box id
- ergo_
lib_ ⚠data_ input_ delete - Drop
DataInput
- ergo_
lib_ ⚠data_ input_ new - Parse box id (32 byte digest)
- ergo_
lib_ ⚠data_ inputs_ add - Add an element to collection
- ergo_
lib_ ⚠data_ inputs_ delete - Delete an existing collection
- ergo_
lib_ ⚠data_ inputs_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠data_ inputs_ len - Returns length of an existing collection
- ergo_
lib_ ⚠data_ inputs_ new - Create a new empty collection
- ergo_
lib_ ⚠delete_ error - ergo_
lib_ ⚠delete_ string - ergo_
lib_ ⚠ergo_ box_ assets_ data_ delete - Drop
ErgoBoxAssetsData
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ eq - ergo_
lib_ ⚠ergo_ box_ assets_ data_ list_ add - Add an element to collection
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ list_ delete - Delete an existing collection
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ list_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠ergo_ box_ assets_ data_ list_ len - Returns length of an existing collection
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ list_ new - Create a new empty collection
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ new - Create new instance
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ tokens - Tokens part of the box
- ergo_
lib_ ⚠ergo_ box_ assets_ data_ value - Value part of the box
- ergo_
lib_ ⚠ergo_ box_ bytes_ size - Calculate serialized box size(in bytes)
- ergo_
lib_ ⚠ergo_ box_ candidate_ box_ value - Get box value in nanoERGs
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ add_ token - Add given token id and token amount
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ build - Build the box candidate
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ calc_ box_ size_ bytes - Calculate serialized box size(in bytes)
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ delete - Drop
ErgoBoxCandidateBuilder
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ delete_ register_ value - Delete register value(make register empty) for the given register id (R4-R9)
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ min_ box_ value_ per_ byte - Get minimal value (per byte of the serialized box size)
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ mint_ token - Mint token, as defined in https://github.com/ergoplatform/eips/blob/master/eip-0004.md
token
- token id(box id of the first input box in transaction) and token amount,token_name
- token name (will be encoded in R4),token_desc
- token description (will be encoded in R5),num_decimals
- number of decimals (will be encoded in R6) - ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ new - Create builder with required box parameters:
value
- amount of money associated with the boxcontract
- guarding contract, which should be evaluated to true in order to open(spend) this boxcreation_height
- height when a transaction containing the box is created. It should not exceed height of the block, containing the transaction with this box. - ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ register_ value - Returns register value for the given register id (R4-R9), or None if the register is empty
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ set_ min_ box_ value_ per_ byte - Set minimal value (per byte of the serialized box size)
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ set_ register_ value - Set register with a given id (R4-R9) to the given value
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ set_ value - Set new box value
- ergo_
lib_ ⚠ergo_ box_ candidate_ builder_ value - Get box value
- ergo_
lib_ ⚠ergo_ box_ candidate_ calc_ min_ box_ value - Calculate minimal box value for the current box serialized size(in bytes)
- ergo_
lib_ ⚠ergo_ box_ candidate_ creation_ height - Get box creation height
- ergo_
lib_ ⚠ergo_ box_ candidate_ delete - Drop
ErgoBoxCandidate
- ergo_
lib_ ⚠ergo_ box_ candidate_ eq - ergo_
lib_ ⚠ergo_ box_ candidate_ ergo_ tree - Get ergo tree for box
- ergo_
lib_ ⚠ergo_ box_ candidate_ register_ value - Returns value (ErgoTree constant) stored in the register or None if the register is empty
- ergo_
lib_ ⚠ergo_ box_ candidate_ tokens - Get tokens for box
- ergo_
lib_ ⚠ergo_ box_ candidates_ add - Add an element to collection
- ergo_
lib_ ⚠ergo_ box_ candidates_ delete - Delete an existing collection
- ergo_
lib_ ⚠ergo_ box_ candidates_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠ergo_ box_ candidates_ len - Returns length of an existing collection
- ergo_
lib_ ⚠ergo_ box_ candidates_ new - Create a new empty collection
- ergo_
lib_ ⚠ergo_ box_ creation_ height - Get box creation height
- ergo_
lib_ ⚠ergo_ box_ delete - Drop
ErgoBox
- ergo_
lib_ ⚠ergo_ box_ eq - ergo_
lib_ ⚠ergo_ box_ ergo_ tree - Get ergo tree for box
- ergo_
lib_ ⚠ergo_ box_ from_ json - Parse from JSON. Supports Ergo Node/Explorer API and box values and token amount encoded as strings
- ergo_
lib_ ⚠ergo_ box_ id - Get box id
- ergo_
lib_ ⚠ergo_ box_ new - Make a new box with:
value
- amount of money associated with the boxcontract
- guarding contract, which should be evaluated to true in order to open(spend) this boxcreation_height
- height when a transaction containing the box is created.tx_id
- transaction id in which this box was “created” (participated in outputs)index
- index (in outputs) in the transaction - ergo_
lib_ ⚠ergo_ box_ register_ value - Returns value (ErgoTree constant) stored in the register or None if the register is empty
- ergo_
lib_ ⚠ergo_ box_ to_ json - JSON representation as text (compatible with Ergo Node/Explorer API, numbers are encoded as numbers)
- ergo_
lib_ ⚠ergo_ box_ to_ json_ eip12 - JSON representation according to EIP-12 https://github.com/ergoplatform/eips/pull/23
- ergo_
lib_ ⚠ergo_ box_ tokens - Get tokens for box
- ergo_
lib_ ⚠ergo_ box_ value - Get box value in nanoERGs
- ergo_
lib_ ⚠ergo_ boxes_ add - Add an element to collection
- ergo_
lib_ ⚠ergo_ boxes_ delete - Delete an existing collection
- ergo_
lib_ ⚠ergo_ boxes_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠ergo_ boxes_ len - Returns length of an existing collection
- ergo_
lib_ ⚠ergo_ boxes_ new - Create a new empty collection
- ergo_
lib_ ⚠ergo_ state_ context_ delete - ergo_
lib_ ⚠ergo_ state_ context_ eq - ergo_
lib_ ⚠ergo_ state_ context_ new - Create new context from pre-header
- ergo_
lib_ ⚠ergo_ tree_ bytes_ len - Determine number of bytes of the serialized ErgoTree
- ergo_
lib_ ⚠ergo_ tree_ constants_ len - Get constants number as stored in serialized ErgoTree or error if the parsing of constants is failed
- ergo_
lib_ ⚠ergo_ tree_ delete - Drop
ErgoTree
- ergo_
lib_ ⚠ergo_ tree_ eq - ergo_
lib_ ⚠ergo_ tree_ from_ base16_ bytes - Decode from base16 encoded serialized ErgoTree
- ergo_
lib_ ⚠ergo_ tree_ from_ bytes - Decode from encoded serialized ErgoTree
- ergo_
lib_ ⚠ergo_ tree_ get_ constant - Returns constant with given index (as stored in serialized ErgoTree) or None if index is out of bounds or error if constants parsing were failed
- ergo_
lib_ ⚠ergo_ tree_ template_ bytes - Serialized proposition expression of SigmaProp type with ConstantPlaceholder nodes instead of
Constant nodes. Key assumption: enough memory has been allocated at the address pointed-to by
output
. Useergo_lib_ergo_tree_template_bytes_len
to determine the length of the byte array. - ergo_
lib_ ⚠ergo_ tree_ template_ bytes_ len - Returns the number of bytes of the Serialized proposition expression of SigmaProp type with ConstantPlaceholder nodes instead of Constant nodes.
- ergo_
lib_ ⚠ergo_ tree_ to_ base16_ bytes - Get Base16-encoded serialized bytes
- ergo_
lib_ ⚠ergo_ tree_ to_ bytes - Convert to serialized bytes. Key assumption: enough memory has been allocated at the address
pointed-to by
output
. Useergo_lib_ergo_tree_bytes_len
to determine the length of the byte array. - ergo_
lib_ ⚠ergo_ tree_ with_ constant - Returns new ErgoTree instance with a new constant value for a given index in constants list (as
stored in serialized ErgoTree), or an error. Note that the original ErgoTree instance
pointed-at by
ergo_tree_ptr
is untouched. - ergo_
lib_ ⚠error_ to_ string - ergo_
lib_ ⚠hints_ bag_ add_ commitment - Add commitment hint to the bag
- ergo_
lib_ ⚠hints_ bag_ delete - Drop
HintsBag
- ergo_
lib_ ⚠hints_ bag_ empty - Empty HintsBag
- ergo_
lib_ ⚠hints_ bag_ get - Get commitment
- ergo_
lib_ ⚠hints_ bag_ len - Length of HintsBag
- ergo_
lib_ ⚠input_ box_ id - Get box id
- ergo_
lib_ ⚠input_ delete - Drop
Input
- ergo_
lib_ ⚠input_ spending_ proof - Get spending proof
- ergo_
lib_ ⚠inputs_ add - Add an element to collection
- ergo_
lib_ ⚠inputs_ delete - Delete an existing collection
- ergo_
lib_ ⚠inputs_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠inputs_ len - Returns length of an existing collection
- ergo_
lib_ ⚠inputs_ new - Create a new empty collection
- ergo_
lib_ ⚠mnemonic_ generator - Create new MnemonicGenerator instance
- ergo_
lib_ ⚠mnemonic_ generator_ free_ mnemonic - Free a previously-created CString. Intended to be paired with one of the mnemonic generation functions. Called by the client.
- ergo_
lib_ ⚠mnemonic_ generator_ generate - Generate mnemonic sentence using random entropy
- ergo_
lib_ ⚠mnemonic_ generator_ generate_ from_ entropy - Generate mnemonic sentence using provided entropy
- ergo_
lib_ ⚠nipopow_ proof_ delete - Delete
NipopowProof
- ergo_
lib_ ⚠nipopow_ proof_ from_ json - Parse from JSON.
- ergo_
lib_ ⚠nipopow_ proof_ is_ better_ than - Implementation of the ≥ algorithm from
KMZ17
, see Algorithm 4 - ergo_
lib_ ⚠nipopow_ proof_ suffix_ head - Get suffix head
- ergo_
lib_ ⚠nipopow_ proof_ to_ json - JSON representation as text
- ergo_
lib_ ⚠nipopow_ verifier_ best_ chain - Returns chain of
BlockHeader
s from the best proof. - ergo_
lib_ ⚠nipopow_ verifier_ best_ proof - Returns the best proof.
- ergo_
lib_ ⚠nipopow_ verifier_ delete - Delete
NipopowVerifier
- ergo_
lib_ ⚠nipopow_ verifier_ new - Create new
NipopowVerifier
instance - ergo_
lib_ ⚠nipopow_ verifier_ process - Process given proof
- ergo_
lib_ ⚠parameters_ default - Return default blockchain parameters that were set at genesis
- ergo_
lib_ ⚠parameters_ delete - ergo_
lib_ ⚠parameters_ from_ json - Parse parameters from JSON. Supports Ergo Node API/Explorer API
- ergo_
lib_ ⚠parameters_ new - Create new parameters from provided blockchain parameters
- ergo_
lib_ ⚠po_ pow_ header_ eq - ergo_
lib_ ⚠popow_ header_ check_ interlinks_ proof - ergo_
lib_ ⚠popow_ header_ delete - ergo_
lib_ ⚠popow_ header_ from_ json - ergo_
lib_ ⚠popow_ header_ get_ header - ergo_
lib_ ⚠popow_ header_ get_ interlinks - ergo_
lib_ ⚠popow_ header_ get_ interlinks_ proof - ergo_
lib_ ⚠popow_ header_ to_ json - ergo_
lib_ ⚠pre_ header_ eq - ergo_
lib_ ⚠preheader_ delete - Drop
PreHeader
- ergo_
lib_ ⚠preheader_ from_ block_ header - Create instance using data from block header
- ergo_
lib_ ⚠propositions_ add_ proposition_ from_ bytes - Adding new proposition
- ergo_
lib_ ⚠propositions_ delete - Drop
Propositions
- ergo_
lib_ ⚠propositions_ new - Create empty proposition holder
- ergo_
lib_ ⚠prover_ result_ context_ extension - Get extension
- ergo_
lib_ ⚠prover_ result_ delete - Drop
ProverResult
- ergo_
lib_ ⚠prover_ result_ proof - Get proof. Key assumption: enough memory has been allocated at the address pointed-to by
output
. Useergo_lib_prover_result_proof_len
to determine the length of the byte array. - ergo_
lib_ ⚠prover_ result_ proof_ len - Return the number of bytes that make up the proof.
- ergo_
lib_ ⚠prover_ result_ to_ json - JSON representation as text (compatible with Ergo Node/Explorer API, numbers are encoded as numbers)
- ergo_
lib_ ⚠reduced_ tx_ delete - Drop
ReducedTransaction
- ergo_
lib_ ⚠reduced_ tx_ from_ unsigned_ tx - Returns
reduced
transaction, i.e. unsigned transaction where each unsigned input is augmented with ReducedInput which contains a script reduction result. - ergo_
lib_ ⚠reduced_ tx_ unsigned_ tx - Returns the unsigned transation
- ergo_
lib_ ⚠secret_ key_ delete - Drop
SecretKey
- ergo_
lib_ ⚠secret_ key_ from_ bytes - Parse dlog secret key from bytes (SEC-1-encoded scalar)
- ergo_
lib_ ⚠secret_ key_ generate_ random - Generate random key
- ergo_
lib_ ⚠secret_ key_ get_ address - Address (encoded public image)
- ergo_
lib_ ⚠secret_ key_ to_ bytes - Encode from a serialized key. Key assumption: 32 bytes must be allocated at the address
pointed-to by
output
. - ergo_
lib_ ⚠secret_ keys_ add - Add an element to collection
- ergo_
lib_ ⚠secret_ keys_ delete - Delete an existing collection
- ergo_
lib_ ⚠secret_ keys_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠secret_ keys_ len - Returns length of an existing collection
- ergo_
lib_ ⚠secret_ keys_ new - Create a new empty collection
- ergo_
lib_ ⚠signed_ message_ delete - Drop
SignedMessage
- ergo_
lib_ ⚠simple_ box_ selector_ delete - Drop
SimpleBoxSelector
- ergo_
lib_ ⚠simple_ box_ selector_ new - Naive box selector, collects inputs until target balance is reached
- ergo_
lib_ ⚠simple_ box_ selector_ select - Selects inputs to satisfy target balance and tokens.
inputs
- available inputs (returns an error, if empty),target_balance
- coins (in nanoERGs) needed,target_tokens
- amount of tokens needed. Returns selected inputs and box assets(value+tokens) with change. - ergo_
lib_ ⚠token_ amount_ as_ i64 - Get value as signed 64-bit long
- ergo_
lib_ ⚠token_ amount_ delete - Drop
TokenAmount
- ergo_
lib_ ⚠token_ amount_ eq - ergo_
lib_ ⚠token_ amount_ from_ i64 - Create from i64 with bounds check
- ergo_
lib_ ⚠token_ delete - Drop
Token
- ergo_
lib_ ⚠token_ eq - ergo_
lib_ ⚠token_ get_ amount - Get token amount
- ergo_
lib_ ⚠token_ get_ id - Get token id
- ergo_
lib_ ⚠token_ id_ delete - Drop
TokenId
- ergo_
lib_ ⚠token_ id_ eq - ergo_
lib_ ⚠token_ id_ from_ box_ id - Create token id from ergo box id (32 byte digest)
- ergo_
lib_ ⚠token_ id_ from_ str - Parse token id (32 byte digest) from base16-encoded string
- ergo_
lib_ ⚠token_ id_ to_ str - Base16 encoded string
- ergo_
lib_ ⚠token_ new - Create a token with given token id and amount
- ergo_
lib_ ⚠token_ to_ json_ eip12 - JSON representation according to EIP-12 https://github.com/ergoplatform/eips/pull/23
- ergo_
lib_ ⚠tokens_ add - Add an element to collection
- ergo_
lib_ ⚠tokens_ delete - Delete an existing collection
- ergo_
lib_ ⚠tokens_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠tokens_ len - Returns length of an existing collection
- ergo_
lib_ ⚠tokens_ new - Create a new empty collection
- ergo_
lib_ ⚠transaction_ extract_ hints - Extract hints from signed transaction
- ergo_
lib_ ⚠transaction_ hints_ bag_ add_ hints_ for_ input - Adding hints for input
- ergo_
lib_ ⚠transaction_ hints_ bag_ all_ hints_ for_ input - Get HintsBag corresponding to input index
- ergo_
lib_ ⚠transaction_ hints_ bag_ delete - Drop
TransactionHintsBag
- ergo_
lib_ ⚠transaction_ hints_ bag_ empty - Empty TransactionHintsBag
- ergo_
lib_ ⚠tx_ builder_ box_ selection - Get box selection
- ergo_
lib_ ⚠tx_ builder_ build - Build the unsigned transaction
- ergo_
lib_ ⚠tx_ builder_ change_ address - Get change address
- ergo_
lib_ ⚠tx_ builder_ current_ height - Get current height
- ergo_
lib_ ⚠tx_ builder_ data_ inputs - Get data inputs
- ergo_
lib_ ⚠tx_ builder_ delete - Drop
TxBuilder
- ergo_
lib_ ⚠tx_ builder_ fee_ amount - Get fee amount
- ergo_
lib_ ⚠tx_ builder_ new - Creates new TxBuilder
box_selection
- selected input boxesoutput_candidates
- output boxes to be “created” in this transaction,current_height
- chain height that will be used in additionally created boxes (change, miner’s fee, etc.),fee_amount
- miner’s fee,change_address
- change (inputs - outputs) will be sent to this address, will be given to miners, - ergo_
lib_ ⚠tx_ builder_ output_ candidates - Get outputs EXCLUDING fee and change
- ergo_
lib_ ⚠tx_ builder_ set_ context_ extension - Set context extension for a given input
- ergo_
lib_ ⚠tx_ builder_ set_ data_ inputs - Set transaction’s data inputs
- ergo_
lib_ ⚠tx_ builder_ set_ token_ burn_ permit - Permits the burn of the given token amount, i.e. allows this token amount to be omitted in the outputs
- ergo_
lib_ ⚠tx_ builder_ suggested_ tx_ fee - Suggested transaction fee (semi-default value used across wallets and dApps as of Oct 2020)
- ergo_
lib_ ⚠tx_ data_ inputs - ergo_
lib_ ⚠tx_ delete - Drop
Transaction
- ergo_
lib_ ⚠tx_ from_ json - Parse from JSON. Supports Ergo Node/Explorer API and box values and token amount encoded as strings
- ergo_
lib_ ⚠tx_ from_ unsigned_ tx - Create Transaction from UnsignedTransaction and an array of proofs in the same order as UnsignedTransaction.inputs with empty proof indicated with empty byte array
- ergo_
lib_ ⚠tx_ id - Get id for transaction
- ergo_
lib_ ⚠tx_ id_ delete - Drop
TxId
- ergo_
lib_ ⚠tx_ id_ eq - ergo_
lib_ ⚠tx_ id_ from_ str - Convert a hex string into a TxId
- ergo_
lib_ ⚠tx_ id_ to_ str - Get the tx id as bytes
- ergo_
lib_ ⚠tx_ inputs - ergo_
lib_ ⚠tx_ output_ candidates - ergo_
lib_ ⚠tx_ outputs - ergo_
lib_ ⚠tx_ to_ json - JSON representation as text (compatible with Ergo Node/Explorer API, numbers are encoded as numbers)
- ergo_
lib_ ⚠tx_ to_ json_ eip12 - JSON representation according to EIP-12 https://github.com/ergoplatform/eips/pull/23
- ergo_
lib_ ⚠tx_ validate - ergo_
lib_ ⚠unsigned_ input_ box_ id - Get box id
- ergo_
lib_ ⚠unsigned_ input_ context_ extension - Get extension
- ergo_
lib_ ⚠unsigned_ input_ delete - Drop
UnsignedInput
- ergo_
lib_ ⚠unsigned_ inputs_ add - Add an element to collection
- ergo_
lib_ ⚠unsigned_ inputs_ delete - Delete an existing collection
- ergo_
lib_ ⚠unsigned_ inputs_ get - Returns element at position
index
of an existing collection - ergo_
lib_ ⚠unsigned_ inputs_ len - Returns length of an existing collection
- ergo_
lib_ ⚠unsigned_ inputs_ new - Create a new empty collection
- ergo_
lib_ ⚠unsigned_ tx_ data_ inputs - Data inputs for transaction
- ergo_
lib_ ⚠unsigned_ tx_ delete - Drop
UnsignedTransaction
- ergo_
lib_ ⚠unsigned_ tx_ from_ json - Parse from JSON. Supports Ergo Node/Explorer API and box values and token amount encoded as strings
- ergo_
lib_ ⚠unsigned_ tx_ id - Get id for transaction
- ergo_
lib_ ⚠unsigned_ tx_ inputs - Inputs for transaction
- ergo_
lib_ ⚠unsigned_ tx_ output_ candidates - Output candidates for transaction
- ergo_
lib_ ⚠unsigned_ tx_ to_ json - JSON representation as text (compatible with Ergo Node/Explorer API, numbers are encoded as numbers)
- ergo_
lib_ ⚠unsigned_ tx_ to_ json_ eip12 - JSON representation according to EIP-12 https://github.com/ergoplatform/eips/pull/23
- ergo_
lib_ ⚠verify_ signature - Verify that the signature is presented to satisfy SigmaProp conditions.
- ergo_
lib_ ⚠wallet_ add_ secret - ergo_
lib_ ⚠wallet_ delete - Drop
Wallet
- ergo_
lib_ ⚠wallet_ from_ mnemonic - Create
Wallet
instance loading secret key from mnemonic Returns Err if a DlogSecretKey cannot be parsed from the provided phrase - ergo_
lib_ ⚠wallet_ from_ secrets - Create
Wallet
from secrets - ergo_
lib_ ⚠wallet_ generate_ commitments - Generate Commitments for unsigned tx
- ergo_
lib_ ⚠wallet_ generate_ commitments_ for_ reduced_ transaction - Generate Commitments for reduced transaction
- ergo_
lib_ ⚠wallet_ sign_ message_ using_ p2pk - Sign an arbitrary message using a P2PK address
- ergo_
lib_ ⚠wallet_ sign_ reduced_ transaction - Signs a reduced transaction (generating proofs for inputs)
- ergo_
lib_ ⚠wallet_ sign_ reduced_ transaction_ multi - Signs a multi signature reduced transaction
- ergo_
lib_ ⚠wallet_ sign_ transaction - Signs a transaction
- ergo_
lib_ ⚠wallet_ sign_ transaction_ multi - Signs a multi signature transaction
- ergo_
merkle_ ⚠proof_ add_ node - Adds a new node (above the current level). Hash must be exactly 32 bytes. side represents the side node is on in the tree, 0 = Left, 1 = Right
- ergo_
merkle_ ⚠proof_ delete - ergo_
merkle_ ⚠proof_ from_ json - Deserializes a MerkleProof from its json representation (see /blocks/{headerId}/proofFor/{txId} node api)
- ergo_
merkle_ ⚠proof_ new - Creates a new MerkleProof with given leaf data. Use ergo_merkle_proof_add_node to add levelnodes to the proof. leaf_data must be 32 bytes
- ergo_
merkle_ ⚠proof_ to_ json - Serializes a MerkleProof to json representation
- ergo_
merkle_ ⚠proof_ valid - Checks the merkleproof against the expected root_hash
- ergo_
merkle_ ⚠proof_ valid_ base16 - Checks the merkleproof against a base16 root_hash
Type Aliases§
- Block
Headers Ptr - Block
IdsPtr - Byte
Arrays Ptr - Const
Block Headers Ptr - Const
Block IdsPtr - Const
Byte Arrays Ptr - Const
Data Inputs Ptr - Const
Ergo BoxAssets Data List Ptr - Const
Ergo BoxCandidates Ptr - Const
Ergo Boxes Ptr - Const
Inputs Ptr - Const
Secret Keys Ptr - Const
Tokens Ptr - Const
Unsigned Inputs Ptr - Data
Inputs Ptr - Ergo
BoxAssets Data List Ptr - Ergo
BoxCandidates Ptr - Ergo
Boxes Ptr - Error
Ptr - Inputs
Ptr - Secret
Keys Ptr - Tokens
Ptr - Unsigned
Inputs Ptr