Method Set Data
Methods for setting object-provided data in SSS
setTransaction
- Arguments
- transaction : Transaction
- Return value void
Register the transaction created by the web application with SSS.
// window.SSS
const tx = ...;
window.SSS.setTransaction(tx)
// sss-module
import { setTransaction } from "sss-module";
const tx = ...;
setTransaction(tx)
setTransactionByPayload
- argument
- serializedTx: string
- Return value void
Register the transaction with the SSS from the serialized transaction payload.
Usage example
- When performing co-signing offline
- If it doesn't match the type of the setTransaction argument, e.g. new symbol-sdk
// window.SSS
const tx = ...;
const serializedTx = tx.serialize()
window.SSS.setTransactionByPayload(serializedTx)
// sss-module
import { setTransaction } from "sss-module";
const tx = ...;
const serializedTx = tx.serialize()
setTransactionByPayload(serializedTx)
setMessage
- argument
- message: string
- pubkey: string
- Return value void
Register the message to be encrypted and the recipient's public key in SSS.
// window.SSS
const message = "暗号化したいメッセージ";
const pubkey = "===== RECIPIENT PUBLIC KEY =====";
window.SSS.setMessage(message, pubkey);
// sss-module
import { setMessage } from "sss-module";
const message = "暗号化したいメッセージ";
const pubkey = "===== RECIPIENT PUBLIC KEY =====";
setMessage(message, pubkey);