Skip to content

SymbolFacade⚓︎

SymbolFacade
Facade used to interact with Symbol blockchain.

Constructors⚓︎

new SymbolFacade()⚓︎

new SymbolFacade(network): SymbolFacade

Creates a Symbol facade.

Parameters⚓︎

Parameter Type Description
network string | Network Symbol network or network name.

Returns⚓︎

SymbolFacade

Properties⚓︎

Property Modifier Type Description
network public Network Underlying network.
transactionFactory public SymbolTransactionFactory Underlying transaction factory.
Address static typeof Address Network address class type.
BIP32_CURVE_NAME static string BIP32 curve name.
deriveSharedKey static (keyPair: KeyPair, otherPublicKey: PublicKey) => SharedKey256 Derives shared key from key pair and other party's public key.
KeyPair static typeof KeyPair Network key pair class type.
Verifier static typeof Verifier Network verifier class type.

Accessors⚓︎

static⚓︎

Get Signature⚓︎

get static(): typeof SymbolFacade
SymbolFacade.static
Gets class type.
Returns⚓︎

typeof SymbolFacade

Class type.

Methods⚓︎

bip32Path()⚓︎

bip32Path(accountId): number[]
SymbolFacade.bip32Path
Creates a network compatible BIP32 path for the specified account.

Parameters⚓︎

Parameter Type Description
accountId number Id of the account for which to generate a BIP32 path.

Returns⚓︎

number[]

BIP32 path for the specified account.


cosignTransaction()⚓︎

cosignTransaction(
   keyPair, 
   transaction, 
   detached?): 
  | Cosignature
  | DetachedCosignature
SymbolFacade.cosignTransaction
Cosigns a Symbol transaction.

Parameters⚓︎

Parameter Type Description
keyPair KeyPair Key pair of the cosignatory.
transaction Transaction Transaction object.
detached? boolean \c true if resulting cosignature is appropriate for network propagation. \c false if resulting cosignature is appropriate for attaching to an aggregate.

Returns⚓︎

| Cosignature | DetachedCosignature

Signed cosignature.


createAccount()⚓︎

createAccount(privateKey): SymbolAccount
SymbolFacade.createAccount
Creates a Symbol account from a private key.

Parameters⚓︎

Parameter Type Description
privateKey PrivateKey Account private key.

Returns⚓︎

SymbolAccount

Symbol account.


createEmbeddedTransactionFromTypedDescriptor()⚓︎

createEmbeddedTransactionFromTypedDescriptor(typedDescriptor, signerPublicKey): EmbeddedTransaction
SymbolFacade.createEmbeddedTransactionFromTypedDescriptor
Creates an embedded transaction from a (typed) transaction descriptor.

Parameters⚓︎

Parameter Type Description
typedDescriptor object Transaction (typed) descriptor.
signerPublicKey PublicKey Signer public key.

Returns⚓︎

EmbeddedTransaction

Created embedded transaction.


createPublicAccount()⚓︎

createPublicAccount(publicKey): SymbolPublicAccount
SymbolFacade.createPublicAccount
Creates a Symbol public account from a public key.

Parameters⚓︎

Parameter Type Description
publicKey PublicKey Account public key.

Returns⚓︎

SymbolPublicAccount

Symbol public account.


createTransactionFromTypedDescriptor()⚓︎

createTransactionFromTypedDescriptor(
   typedDescriptor, 
   signerPublicKey, 
   feeMultiplier, 
   deadlineSeconds, 
   cosignatureCount?): Transaction
SymbolFacade.createTransactionFromTypedDescriptor
Creates a transaction from a (typed) transaction descriptor.

Parameters⚓︎

Parameter Type Description
typedDescriptor object Transaction (typed) descriptor.
signerPublicKey PublicKey Signer public key.
feeMultiplier number Fee multiplier.
deadlineSeconds number Approximate seconds from now for deadline.
cosignatureCount? number Number of cosignature spaces to reserve.

Returns⚓︎

Transaction

Created transaction.


extractSigningPayload()⚓︎

extractSigningPayload(transaction): Uint8Array
SymbolFacade.extractSigningPayload
Gets the payload to sign given a Symbol transaction.

Parameters⚓︎

Parameter Type Description
transaction Transaction Transaction object.

Returns⚓︎

Uint8Array

Verifiable data to sign.


hashTransaction()⚓︎

hashTransaction(transaction): Hash256
SymbolFacade.hashTransaction
Hashes a Symbol transaction.

Parameters⚓︎

Parameter Type Description
transaction Transaction Transaction object.

Returns⚓︎

Hash256

Transaction hash.


now()⚓︎

now(): NetworkTimestamp
SymbolFacade.now
Creates a network timestamp representing the current time.

Returns⚓︎

NetworkTimestamp

Network timestamp representing the current time.


signTransaction()⚓︎

signTransaction(keyPair, transaction): Signature
SymbolFacade.signTransaction
Signs a Symbol transaction.

Parameters⚓︎

Parameter Type Description
keyPair KeyPair Key pair.
transaction Transaction Transaction object.

Returns⚓︎

Signature

Transaction signature.


verifyTransaction()⚓︎

verifyTransaction(transaction, signature): boolean
SymbolFacade.verifyTransaction
Verifies a Symbol transaction.

Parameters⚓︎

Parameter Type Description
transaction Transaction Transaction object.
signature Signature Signature to verify.

Returns⚓︎

boolean

\c true if transaction signature is verified.


bip32NodeToKeyPair()⚓︎

static bip32NodeToKeyPair(bip32Node): KeyPair
SymbolFacade.bip32NodeToKeyPair
Derives a Symbol KeyPair from a BIP32 node.

Parameters⚓︎

Parameter Type Description
bip32Node Bip32Node BIP32 node.

Returns⚓︎

KeyPair

Derived key pair.


cosignTransactionHash()⚓︎

static cosignTransactionHash(
   keyPair, 
   transactionHash, 
   detached?): 
  | Cosignature
  | DetachedCosignature
SymbolFacade.cosignTransactionHash
Cosigns a Symbol transaction hash.

Parameters⚓︎

Parameter Type Description
keyPair KeyPair Key pair of the cosignatory.
transactionHash Hash256 Transaction hash.
detached? boolean \c true if resulting cosignature is appropriate for network propagation. \c false if resulting cosignature is appropriate for attaching to an aggregate.

Returns⚓︎

| Cosignature | DetachedCosignature

Signed cosignature.


hashEmbeddedTransactions()⚓︎

static hashEmbeddedTransactions(embeddedTransactions): Hash256
SymbolFacade.hashEmbeddedTransactions
Hashes embedded transactions of an aggregate transaction.

Parameters⚓︎

Parameter Type Description
embeddedTransactions EmbeddedTransaction[] Embedded transactions to hash.

Returns⚓︎

Hash256

Aggregate transactions hash.