コンテンツにスキップ

NemFacade⚓︎

NemFacade
Facade used to interact with NEM blockchain.

Constructors⚓︎

new NemFacade()⚓︎

new NemFacade(network): NemFacade

Creates a NEM facade.

Parameters⚓︎

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

Returns⚓︎

NemFacade

Properties⚓︎

Property Modifier Type Description
network public Network Underlying network.
transactionFactory public TransactionFactory 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 NemFacade
NemFacade.static
Gets class type.
Returns⚓︎

typeof NemFacade

Class type.

Methods⚓︎

bip32Path()⚓︎

bip32Path(accountId): number[]
NemFacade.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.


createAccount()⚓︎

createAccount(privateKey): NemAccount
NemFacade.createAccount
Creates a NEM account from a private key.

Parameters⚓︎

Parameter Type Description
privateKey PrivateKey Account private key.

Returns⚓︎

NemAccount

NEM account.


createPublicAccount()⚓︎

createPublicAccount(publicKey): NemPublicAccount
NemFacade.createPublicAccount
Creates a NEM public account from a public key.

Parameters⚓︎

Parameter Type Description
publicKey PublicKey Account public key.

Returns⚓︎

NemPublicAccount

NEM public account.


createTransactionFromTypedDescriptor()⚓︎

createTransactionFromTypedDescriptor(
   typedDescriptor, 
   signerPublicKey, 
   fee, 
   deadlineSeconds): Transaction
NemFacade.createTransactionFromTypedDescriptor
Creates a transaction from a (typed) transaction descriptor.

Parameters⚓︎

Parameter Type Description
typedDescriptor object Transaction (typed) descriptor.
signerPublicKey PublicKey Signer public key.
fee bigint Transaction fee.
deadlineSeconds number Approximate seconds from now for deadline.

Returns⚓︎

Transaction

Created transaction.


extractSigningPayload()⚓︎

extractSigningPayload(transaction): Uint8Array
NemFacade.extractSigningPayload
Gets the payload to sign given a NEM transaction.

Parameters⚓︎

Parameter Type Description
transaction Transaction Transaction object.

Returns⚓︎

Uint8Array

Verifiable data to sign.


hashTransaction()⚓︎

hashTransaction(transaction): Hash256
NemFacade.hashTransaction
Hashes a NEM transaction.

Parameters⚓︎

Parameter Type Description
transaction Transaction Transaction object.

Returns⚓︎

Hash256

Transaction hash.


now()⚓︎

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

Returns⚓︎

NetworkTimestamp

Network timestamp representing the current time.


signTransaction()⚓︎

signTransaction(keyPair, transaction): Signature
NemFacade.signTransaction
Signs a NEM transaction.

Parameters⚓︎

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

Returns⚓︎

Signature

Transaction signature.


verifyTransaction()⚓︎

verifyTransaction(transaction, signature): boolean
NemFacade.verifyTransaction
Verifies a NEM transaction.

Parameters⚓︎

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

Returns⚓︎

boolean

true if transaction signature is verified.


bip32NodeToKeyPair()⚓︎

static bip32NodeToKeyPair(bip32Node): KeyPair
NemFacade.bip32NodeToKeyPair
Derives a NEM KeyPair from a BIP32 node.

Parameters⚓︎

Parameter Type Description
bip32Node Bip32Node BIP32 node.

Returns⚓︎

KeyPair

Derived key pair.