Class

AuthenticatedAssetRecord

AuthenticatedAssetRecord()

Object representing an authenticable asset record. Clients can validate authentication proofs against a ledger state commitment.

Constructor

# new AuthenticatedAssetRecord()

View Source pkg/wasm.js, line 978

Methods

# static from_json_record(val) → {AuthenticatedAssetRecord}

Builds an AuthenticatedAssetRecord from a JSON-encoded asset record returned from the ledger server.

Parameters:
Name Type Description
val JsValue

JSON-encoded asset record fetched from ledger server.

See:
  • Network.getUtxo for information about how to fetch an asset record from the ledger server.

View Source pkg/wasm.js, line 1018

# is_valid(state_commitment) → {boolean}

Given a serialized state commitment, returns true if the authenticated UTXO proofs validate correctly and false otherwise. If the proofs validate, the asset record contained in this structure exists on the ledger and is unspent.

Parameters:
Name Type Description
state_commitment string

String representing the state commitment.

See:

View Source pkg/wasm.js, line 1003

Will throw an error if the state commitment fails to deserialize.

boolean