NodeJS + Browser

address.verify(message, signature) ⇒ booleanarrow-up-right

Kind: instance method of Address

Param
Type

message

Uint8Array

signature

Signature

Address.from_private_key(private_key) ⇒ Addressarrow-up-right

Kind: static method of Address

Param
Type

private_key

PrivateKey

Address.from_view_key(view_key) ⇒ Addressarrow-up-right

Kind: static method of Address

Param
Type

view_key

ViewKey

Address.from_string(address) ⇒ Addressarrow-up-right

Kind: static method of Address

Param
Type

address

string

ExecutionResponsearrow-up-right

Webassembly Representation of an Beo function execution response

This object is returned by the execution of an Beo function off-chain. It provides methods for retrieving the outputs of the function execution.

Kind: global class

executionResponse.getOutputs() ⇒ Array.<any>arrow-up-right

Get the outputs of the executed function

Kind: instance method of ExecutionResponse

Kind: global class

  • KeyPair

    • new KeyPair(proving_key, verifying_key)

    • .provingKey() ⇒ ProvingKey

    • .verifyingKey() ⇒ VerifyingKey

new KeyPair(proving_key, verifying_key)arrow-up-right

Create new key pair from proving and verifying keys

Param
Type

proving_key

ProvingKey

verifying_key

VerifyingKey

keyPair.provingKey() ⇒ ProvingKeyarrow-up-right

Get the proving key

Kind: instance method of KeyPair

keyPair.verifyingKey() ⇒ VerifyingKeyarrow-up-right

Get the verifying key

Kind: instance method of KeyPair

Kind: global class

  • PrivateKey

    • new PrivateKey()

    • instance

      • .to_string() ⇒ string

      • .to_view_key() ⇒ ViewKey

      • .to_address() ⇒ Address

      • .sign(message) ⇒ Signature

      • .toCiphertext(secret) ⇒ PrivateKeyCiphertext

    • static

      • .from_seed_unchecked(seed) ⇒ PrivateKey

      • .from_string(private_key) ⇒ PrivateKey

      • .newEncrypted(secret) ⇒ PrivateKeyCiphertext

      • .fromPrivateKeyCiphertext(ciphertext, secret) ⇒ PrivateKey

new PrivateKey()arrow-up-right

Generate a new private key

privateKey.to_string() ⇒ stringarrow-up-right

Get a string representation of the private key

This function should be used very carefully as it exposes the private key plaintext

Kind: instance method of PrivateKey

privateKey.to_view_key() ⇒ ViewKeyarrow-up-right

Get the view key corresponding to the private key

Kind: instance method of PrivateKey

privateKey.to_address() ⇒ Addressarrow-up-right

Get the address corresponding to the private key

Kind: instance method of PrivateKey

privateKey.sign(message) ⇒ Signaturearrow-up-right

Sign a message with the private key

Kind: instance method of PrivateKey

Param
Type

message

Uint8Array

privateKey.toCiphertext(secret) ⇒ PrivateKeyCiphertextarrow-up-right

Encrypt the private key with a secret.

The secret is sensitive and will be needed to decrypt the private key later, so it should be stored securely

Kind: instance method of PrivateKey

Param
Type

secret

string

PrivateKey.from_seed_unchecked(seed) ⇒ PrivateKeyarrow-up-right

Get a private key from a series of unchecked bytes

Kind: static method of PrivateKey

Param
Type

seed

Uint8Array

PrivateKey.from_string(private_key) ⇒ PrivateKeyarrow-up-right

Create a private key from a string representation

This function will fail if the text is not a valid private key

Kind: static method of PrivateKey

Param
Type

private_key

string

PrivateKey.newEncrypted(secret) ⇒ PrivateKeyCiphertextarrow-up-right

Get a private key ciphertext using a secret.

The secret is sensitive and will be needed to decrypt the private key later, so it should be stored securely

Kind: static method of PrivateKey

Param
Type

secret

string

PrivateKey.fromPrivateKeyCiphertext(ciphertext, secret) ⇒ PrivateKeyarrow-up-right

Get private key from a private key ciphertext using a secret.

Kind: static method of PrivateKey

Param
Type

ciphertext

PrivateKeyCiphertext

secret

string

PrivateKeyCiphertextarrow-up-right

Private Key in ciphertext form

Kind: global class

  • PrivateKeyCiphertext

    • instance

      • .decryptToPrivateKey(secret) ⇒ PrivateKey

      • .toString() ⇒ string

    • static

      • .encryptPrivateKey(private_key, secret) ⇒ PrivateKeyCiphertext

      • .fromString(ciphertext) ⇒ PrivateKeyCiphertext

privateKeyCiphertext.decryptToPrivateKey(secret) ⇒ PrivateKeyarrow-up-right

Decrypts a private ciphertext using a secret string.

This must be the same secret used to encrypt the private key

Kind: instance method of PrivateKeyCiphertext

Param
Type

secret

string

privateKeyCiphertext.toString() ⇒ stringarrow-up-right

Returns the ciphertext string

Kind: instance method of PrivateKeyCiphertext

PrivateKeyCiphertext.encryptPrivateKey(private_key, secret) ⇒ PrivateKeyCiphertextarrow-up-right

Encrypt a private key using a secret string.

The secret is sensitive and will be needed to decrypt the private key later, so it should be stored securely.

Kind: static method of PrivateKeyCiphertext

Param
Type

private_key

PrivateKey

secret

string

PrivateKeyCiphertext.fromString(ciphertext) ⇒ PrivateKeyCiphertextarrow-up-right

Creates a PrivateKeyCiphertext from a string

Kind: static method of PrivateKeyCiphertext

Param
Type

ciphertext

string

Webassembly Representation of an Beo program

This object is required to create an Execution or Deployment transaction. It includes several convenience methods for enumerating available functions and each functions' inputs in a javascript object for usage in creation of web forms for input capture.

Kind: global class

  • Program

    • instance

      • .toString() ⇒ string

      • .getFunctions() ⇒ Array.<any>

      • .getFunctionInputs(function_name) ⇒ Array.<any>

      • .getMappings() ⇒ Array | Array.<any>

      • .getRecordMembers(record_name) ⇒ object

      • .getStructMembers(struct_name) ⇒ Array.<any>

      • .id() ⇒ string

      • .isEqual(other) ⇒ boolean

      • .getImports() ⇒ Array.<any>

    • static

      • .fromString(program) ⇒ Program

      • .getCreditsProgram() ⇒ Program

program.toString() ⇒ stringarrow-up-right

Get a string representation of the program

Kind: instance method of Program

program.getFunctions() ⇒ Array.<any>arrow-up-right

Get javascript array of functions names in the program

Kind: instance method of Program

program.getFunctionInputs(function_name) ⇒ Array.<any>arrow-up-right

Get a javascript object representation of the function inputs and types. This can be used to generate a webform to capture user inputs for an execution of a function.

Kind: instance method of Program

Param
Type

function_name

string

program.getMappings() ⇒ Array | Array.<any>arrow-up-right

Get a list of a program's mappings and the names/types of their keys and values.

Kind: instance method of Program Returns: Array - - An array of objects representing the mappings in the programArray.<any> Example

program.getRecordMembers(record_name) ⇒ objectarrow-up-right

Get a javascript object representation of a program record and its types

Kind: instance method of Program

Param
Type

record_name

string

program.getStructMembers(struct_name) ⇒ Array.<any>arrow-up-right

Get a javascript object representation of a program struct and its types

Kind: instance method of Program

Param
Type

struct_name

string

program.id() ⇒ stringarrow-up-right

Get the id of the program

Kind: instance method of Program

program.isEqual(other) ⇒ booleanarrow-up-right

Determine equality with another program

Kind: instance method of Program

Param
Type

other

Program

program.getImports() ⇒ Array.<any>arrow-up-right

Get program_imports

Kind: instance method of Program

Program.fromString(program) ⇒ Programarrow-up-right

Create a program from a program string

Kind: static method of Program

Param
Type

program

string

Program.getCreditsProgram() ⇒ Programarrow-up-right

Get the credits.Beo program

Kind: static method of Program

Kind: global class

  • ProvingKey

    • instance

      • .toBytes() ⇒ Uint8Array

    • static

      • .fromBytes(bytes) ⇒ ProvingKey

provingKey.toBytes() ⇒ Uint8Arrayarrow-up-right

Create a byte array from a proving key

Kind: instance method of ProvingKey

ProvingKey.fromBytes(bytes) ⇒ ProvingKeyarrow-up-right

Construct a new proving key from a byte array

Kind: static method of ProvingKey

Param
Type

bytes

Uint8Array

RecordCiphertextarrow-up-right

Encrypted Beo record

Kind: global class

  • RecordCiphertext

    • instance

      • .toString() ⇒ string

      • .decrypt(view_key) ⇒ RecordPlaintext

      • .isOwner(view_key) ⇒ boolean

    • static

      • .fromString(record) ⇒ RecordCiphertext

recordCiphertext.toString() ⇒ stringarrow-up-right

Return the record ciphertext string.

Kind: instance method of RecordCiphertext

recordCiphertext.decrypt(view_key) ⇒ RecordPlaintextarrow-up-right

Decrypt the record ciphertext into plaintext using the view key.

Kind: instance method of RecordCiphertext

Param
Type

view_key

ViewKey

recordCiphertext.isOwner(view_key) ⇒ booleanarrow-up-right

Returns true if the view key can decrypt the record ciphertext.

Kind: instance method of RecordCiphertext

Param
Type

view_key

ViewKey

RecordCiphertext.fromString(record) ⇒ RecordCiphertextarrow-up-right

Return a record ciphertext from a string.

Kind: static method of RecordCiphertext

Param
Type

record

string

RecordPlaintextarrow-up-right

Beo record plaintext

Kind: global class

  • RecordPlaintext

    • instance

      • .toString() ⇒ string

      • .microcredits() ⇒ bigint

      • .serialNumberString(private_key, program_id, record_name) ⇒ string

    • static

      • .fromString(record) ⇒ RecordPlaintext

recordPlaintext.toString() ⇒ stringarrow-up-right

Returns the record plaintext string

Kind: instance method of RecordPlaintext

recordPlaintext.microcredits() ⇒ bigintarrow-up-right

Returns the amount of microcredits in the record

Kind: instance method of RecordPlaintext

recordPlaintext.serialNumberString(private_key, program_id, record_name) ⇒ stringarrow-up-right

Attempt to get the serial number of a record to determine whether or not it has been spent

Kind: instance method of RecordPlaintext

Param
Type

private_key

PrivateKey

program_id

string

record_name

string

RecordPlaintext.fromString(record) ⇒ RecordPlaintextarrow-up-right

Return a record plaintext from a string.

Kind: static method of RecordPlaintext

Param
Type

record

string

Kind: global class

  • Signature

    • instance

      • .verify(address, message) ⇒ boolean

      • .to_string() ⇒ string

    • static

      • .sign(private_key, message) ⇒ Signature

      • .from_string(signature) ⇒ Signature

signature.verify(address, message) ⇒ booleanarrow-up-right

Kind: instance method of Signature

Param
Type

address

Address

message

Uint8Array

signature.to_string() ⇒ stringarrow-up-right

Kind: instance method of Signature

Signature.sign(private_key, message) ⇒ Signaturearrow-up-right

Kind: static method of Signature

Param
Type

private_key

PrivateKey

message

Uint8Array

Signature.from_string(signature) ⇒ Signaturearrow-up-right

Kind: static method of Signature

Param
Type

signature

string

Webassembly Representation of an Beo transaction

This object is created when generating an on-chain function deployment or execution and is the object that should be submitted to the Beo Network in order to deploy or execute a function.

Kind: global class

  • Transaction

    • instance

      • .toString() ⇒ string

      • .transactionId() ⇒ string

      • .transactionType() ⇒ string

    • static

      • .fromString(transaction) ⇒ Transaction

transaction.toString() ⇒ stringarrow-up-right

Get the transaction as a string. If you want to submit this transaction to the Beo Network this function will create the string that should be submitted in the POST data.

Kind: instance method of Transaction

transaction.transactionId() ⇒ stringarrow-up-right

Get the id of the transaction. This is the merkle root of the transaction's inclusion proof.

This value can be used to query the status of the transaction on the Beo Network to see if it was successful. If successful, the transaction will be included in a block and this value can be used to lookup the transaction data on-chain.

Kind: instance method of Transaction

transaction.transactionType() ⇒ stringarrow-up-right

Get the type of the transaction (will return "deploy" or "execute")

Kind: instance method of Transaction

Transaction.fromString(transaction) ⇒ Transactionarrow-up-right

Create a transaction from a string

Kind: static method of Transaction

Param
Type

transaction

string

VerifyingKeyarrow-up-right

Kind: global class

  • VerifyingKey

    • instance

      • .toBytes() ⇒ Uint8Array

    • static

      • .fromBytes(bytes) ⇒ VerifyingKey

verifyingKey.toBytes() ⇒ Uint8Arrayarrow-up-right

Create a byte array from a verifying key

Kind: instance method of VerifyingKey

VerifyingKey.fromBytes(bytes) ⇒ VerifyingKeyarrow-up-right

Construct a new verifying key from a byte array

Kind: static method of VerifyingKey

Param
Type

bytes

Uint8Array

Kind: global class

  • ViewKey

    • instance

      • .to_string() ⇒ string

      • .to_address() ⇒ Address

      • .decrypt(ciphertext) ⇒ string

    • static

      • .from_private_key(private_key) ⇒ ViewKey

      • .from_string(view_key) ⇒ ViewKey

viewKey.to_string() ⇒ stringarrow-up-right

Kind: instance method of ViewKey

viewKey.to_address() ⇒ Addressarrow-up-right

Kind: instance method of ViewKey

viewKey.decrypt(ciphertext) ⇒ stringarrow-up-right

Kind: instance method of ViewKey

Param
Type

ciphertext

string

ViewKey.from_private_key(private_key) ⇒ ViewKeyarrow-up-right

Kind: static method of ViewKey

Param
Type

private_key

PrivateKey

ViewKey.from_string(view_key) ⇒ ViewKeyarrow-up-right

Kind: static method of ViewKey

Param
Type

view_key

string

Last updated