Crate iop_sdk_wasm

Source
Expand description

This module provides WASM bindings to functionality needed in a client application using the IOP Stack™. Network related asynchronous code is provided in the TypeScript part of the SDK and is not done from these WASM bindings.

Structs§

IStringArray
JsBip32
Entry point to generate extended private keys in a hierarchical deterministic wallet starting from a seed based on the BIP-0032 standard (and the SLIP-0010 for crypto suites other than Secp256k1).
JsBip39
Tool for generating, validating and parsing BIP-0039 phrases in different supported languages.
JsBip44
Entry point to generate a hierarchical deterministic wallet using the BIP-0044 standard. It is a more structured way to use the same seed for multiple coins, each with multiple accounts, each accounts with a new key for each transaction request. The standard is built on BIP-0043 using the purpose code 44. And BIP-0043 itself uses BIP-0032 to derive all nodes from a single master extended private key.
JsBip32Node
In BIP-0032 each extended private key has the same operations, independently from the actual path. This struct represents such an extended private key in a given subtree.
JsBip32PublicNode
In BIP-0032 a neutered extended private key is an extended public key. This object represents such an extended public key in a given subtree. It is able to do normal (public) derivation, signature verification, creating and validating key identifiers
JsBip39Phrase
An intermediate object that represents a BIP39 phrase with a known language
JsBip44Account
Represents the private API of a given account of a given coin in the BIP32 tree.
JsBip44Coin
Represents a given coin in the BIP32 tree.
JsBip44Key
Represents the private API of a key with a given index within a sub-account used on the chain for storing balance or authenticating actions.
JsBip44PublicAccount
Represents the public API of a given account of a given coin in the BIP32 tree.
JsBip44PublicKey
Represents a public key with a given index within a sub-account used on the chain for verifying signatures or validating key identifiers.
JsBip44PublicSubAccount
Public API for a sub-account of a given account on a given coin that is either used for external keys (receiving addresses) or internal keys (change addresses). Some implementations do not distinguish these and just always use receiving addresses.
JsBip44SubAccount
Private API for a sub-account of a given account on a given coin that is either used for external keys (receiving addresses) or internal keys (change addresses). Some implementations do not distinguish these and just always use receiving addresses.
JsCoeusAsset
JsCoeusTxBuilder
JsDid
An object representing a valid DID. This identifier can be used to look up a DID document on multiple blockchains. Without any on-chain SSI transactions, there will be a single key that can update and impersonate the DID, which has the default key identifier.
JsDomainName
JsHydraParameters
Parameters of a Hydra account added to a {@link Vault}
JsHydraPlugin
Represents a Hydra account in a given vault.
JsHydraPrivate
Private keys of a Hydra account in a vault.
JsHydraPublic
Public keys of a Hydra account in a vault.
JsHydraSigner
Thin adapter around {@link SecpPrivateKey} for signing Hydra transactions.
JsHydraTxBuilder
Builder for core Hydra transactions on a given network.
JsJwtBuilder
Builder object for creating and signing a JWT (JSON Web Token) with or without an associated content.
JsJwtParser
Parser for reading a JWT (JSON Web Token) from a string and validate its content and signature.
JsMKeyId
Multicipher key id (fingerprint/digest/hash of a public key)
JsMPrivateKey
Multicipher private key
JsMPublicKey
Multicipher public key
JsMSignature
Multicipher signature
JsMorpheus
Starting point for deriving all Morpheus related keys in a BIP32 hierarchy. Morpheus uses Ed25519 cipher and currently there are no WASM wrappers for Bip32 nodes with that cipher. Still, Bip32 paths are returned by each object so compatible wallets can derive the same extended private keys.
JsMorpheusAssetBuilder
Builder for a {@link IMorpheusAsset}.
JsMorpheusKind
Root node of a specific kind of DIDs. The kind used to derive a DID is indistiguishable outside the wallet.
JsMorpheusOperationBuilder
Builder for operations on a given DID. These operations can be later added to a {@link MorpheusOperationSigner} even for different DIDs, so the operations can be signed by a multicipher {@link PrivateKey} that has update rights on these DIDs.
JsMorpheusOperationSigner
Builder object for collecting SSI operations into a bundle signed by a single multicipher {@link PrivateKey} that has update rights on all DIDs being altered in those operations.
JsMorpheusPlugin
Represents the Morpheus subtree in a given vault.
JsMorpheusPrivate
Private keys of the Morpheus subtree in a vault.
JsMorpheusPrivateKey
The operations on an identifier that require the private key to be available in memory.
JsMorpheusPrivateKind
Private keys for a given DID kind in the Morpheus subtree in a vault.
JsMorpheusPublic
Public keys of the Morpheus subtree in a vault.
JsMorpheusPublicKey
The operations on an identifier that do not require the private key to be available in memory.
JsMorpheusPublicKind
Public keys for a given DID kind in the Morpheus subtree in a vault.
JsMorpheusRoot
Representation of the root node of the Morpheus subtree in the HD wallet.
JsMorpheusSignableOperation
An object representing a single SSI operation on a single DID. This operation is not yet signed by a key with update rights on the DID document, and therefore needs to be added to a {@link MorpheusOperationSigner}
JsMorpheusSignedOperation
A set of SSI operations already signed by a key that had update rights on all DIDs altered by the operations.
JsMorpheusTxBuilder
Builder for SSI Hydra transactions.
JsNoncedBundle
JsNoncedBundleBuilder
JsPrice
JsPrincipal
JsSecpKeyId
Secp256k1 key id (fingerprint/digest/hash of a public key)
JsSecpPrivateKey
Secp256k1 private key
JsSecpPublicKey
Secp256k1 public key
JsSecpSignature
Secp256k1 signature
JsSeed
The seed used for BIP32 derivations. A seed cannot be turned back into a phrase, because there is salted hashing involed in creating it from the BIP39 mnemonic phrase.
JsSignedBundle
JsSignedBytes
Binary data signed by a multicipher key.
JsSignedJson
JSON signed by a multicipher key. Since the signature is done on a digest created by {@link digestJson}, the same signature can be validated against different selectively revealed JSON documents.
JsSubtreePolicies
JsUserOperation
JsValidationIssue
A single issue found while validating against a DID document.
JsValidationResult
All issues found while validating against a DID document.
JsVault
This object provides a safe serialization format for an in-rest encoded vault file for the IOP Stack™.

Traits§

Wraps
Most WASM types are wrapping a Rust type one-on-one. This trait helps to enforce a convention so that WASM types can easily peek under the hood of other such wrapped WASM types.
WrapsMut
Most WASM types are wrapping a Rust type one-on-one. This trait helps to enforce a convention so that WASM types can easily peek under the hood of other such wrapped WASM types.

Functions§

all_network_names
The list of all network names accepted by {@link validateNetworkName}
decrypt
Decrypts the ciphertext with a password. The format of the ciphertext is defined by the {@link encrypt} function. Only the matching password will decrypt the ciphertext.
digest
Calculates the digest of a JSON document. Since this digest is calculated by recursively replacing sub-objects with their digest, it is possible to selectively reveal parts of the document using {@link selectiveDigestJson}
encrypt
Encrypts the plaintext with a password. Make sure the password is not weak. A random nonce is generated for each call so each time the same plaintext is encrypted with the same password, the result is a different ciphertext. The ciphertext returned will be 40 bytes longer than the plaintext.
selective_digest
Returns a canonical string representation of a JSON document, in which any sub-objects not explicitly listed in the second argument are collapsed to their digest. The format of the second argument is inspired by JQ basic filters and these are some examples:
stringify
This function provides a canonical string for any JSON document. Order of the keys in objects, whitespace and unicode normalization are all taken care of, so document that belongs to a single digest is not malleable.
validate_network_name
Free function that checks if a string is a valid network name usable as a parameter in some other calls.
wrap_with_nonce
You should protect scalar values and easy-to-guess lists by replacing them with an object that has an extra “nonce” property, which has enough entropy. List of all countries, cities in a country, streets in a city are all easy to enumerate for a brute-fore attack.