Scintilla's Client - Provide Wallet, Signer and API for interfacing with Scintilla
import{Client}from"@scintilla-network/client";// Create a wallet from a phraseconstphrase='test test test test test test test test test test test junk';constclient=newClient();constwallet=client.createWallet(phrase);constaccount=wallet.getAccount();constpersona=account.getPersona('sct.test');constpersona=account.getPersona('sct.test');constsigner=persona.getSigner();constaddress=signer.toAddress();// Will sign the message with the identity `sct.test` making it verifiable on chainconstmessage='Hello, world!';// import { SignableMessage } from "@scintilla-network/keys";constsignable=SignableMessage.fromString(message);const[signature,publicKey]=signable.sign(signer);constverified=signable.verify(signature,publicKey);console.log(verified);// trueThe following exports are available purely for convenience (as they are dependencies of the client):
mnemonic- The mnemonic module (@scintilla-network/mnemonic)Mnemonic- The Mnemonic classmnemonicToSeedSync- The mnemonicToSeedSync functionmnemonicToSeed- The mnemonicToSeed functionmnemonicToEntropy- The mnemonicToEntropy functionentropyToMnemonic- The entropyToMnemonic functiongenerateMnemonic- The generateMnemonic functionvalidateMnemonic- The validateMnemonic functionsetDefaultWordlist- The setDefaultWordlist functiongetDefaultWordlist- The getDefaultWordlist functionwordlists- The wordlists object
keys- The keys module (@scintilla-network/keys)Signer- The Signer classSignableMessage- The SignableMessage classAccountKeyring- The AccountKeyring classAddressKeyring- The AddressKeyring classChainKeyring- The ChainKeyring classPersonaKeyring- The PersonaKeyring classSharedPersonaKeyring- The SharedPersonaKeyring classKeyring- The Keyring classPrivateKey- The PrivateKey classPublicKey- The PublicKey classAddress- The Address classChainCode- The ChainCode classExtendedKey- The ExtendedKey classExtendedPrivateKey- The ExtendedPrivateKey classExtendedPublicKey- The ExtendedPublicKey classutils- The utils object
sdk- The sdk module (@scintilla-network/sdk)Asset- The Asset classChainBlock- The ChainBlock classChainBlockHeader- The ChainBlockHeader classChainBlockPayload- The ChainBlockPayload classClusterBlock- The ClusterBlock classDriveData- The DriveData classFIFOLookupMap- The FIFOLookupMap classGovernanceProposal- The GovernanceProposal classGovernanceVote- The GovernanceVote classHashProof- The HashProof classIdentity- The Identity classNET_KINDS- Network kinds constantsNetMessage- The NetMessage classPeerInfoMessage- The PeerInfoMessage classQueue- The Queue classRelayBlock- The RelayBlock classRelayBlockHeader- The RelayBlockHeader classRelayBlockPayload- The RelayBlockPayload classTimeQueue- The TimeQueue classTransaction- The Transaction classTransfer- The Transfer classTransition- The Transition classVoucher- The Voucher classbase64ToHex- Convert base64 to hexbech32- Bech32 encoding/decodingescapeHTML- Escape HTML special charactersexportDoc- Export documentgetTargetHash- Get target hashhash- Hash functionimportDoc- Import documentjsonStringify- JSON stringifymakeADR36Doc- Make ADR-36 documentmakeDoc- Make documentmessages- Message constantssha256- SHA256 hash functionsignDoc- Sign documentsortObjectByKey- Sort object by keysortedJsonByKeyStringify- Stringify sorted JSONstringifiedJsonBufferize- Convert stringified JSON to bufferuInt8ArrayToHex- Convert Uint8Array to hexuint8ArrayToBase64- Convert Uint8Array to base64unescapeHTML- Unescape HTML special charactersvarint- Variable integer encoding/decodingverifyDoc- Verify documentwait- Wait utility function
wallet- The wallet module (@scintilla-network/wallet)Account- The Account classWallet- The Wallet classutils- The utils objectdeterministicMonikerUUID- The deterministicMonikerUUID function