Structuring The Raw Signing request for Vaults
In your vaults, you can sign RAW messages via the Create Transaction API endpoint for a natively supported or unsupported asset.
- To sign RAW messages for a natively supported asset, you need to use
assetId
and source account id under the payload. For your reference, please use the following code:
const res = await signer.createTransaction({
assetId: 'BTC_TEST',
note: 'raw signing test',
source: {
type: PeerType.VAULT_ACCOUNT,
id: "vaultAccountId", //12
},
operation: TransactionOperation.RAW,
extraParameters: {
rawMessageData: {
messages: [
{
content,
bip44AddressIndex: 0, // Optional if non default derivation is required
bip44change: 0, // Optional if non default derivation is required
},
],
},
},
},{ ncw: { walletId } });
- To sign RAW messages for an unsupported asset, you need to use
derivationPath
andalgorithm
under the payload. For your reference, please use the following code:
const res = await signer.createTransaction(
{
note: "raw signing test",
operation: TransactionOperation.RAW,
extraParameters: {
rawMessageData: {
messages: [
{
content: "<your_content_to_sign>",
derivationPath: [44, 0, 0, 0, 0],
},
],
algorithm: "MPC_ECDSA_SECP256K1" / "MPC_EDDSA_ED25519",
},
},
},
{ ncw: { walletId } }
);
Structuring The Raw Signing request for Embedded Wallets
In your embedded wallets, you can sign RAW messages via the Create Transaction API endpoint for a natively supported or unsupported asset.
- To sign RAW messages for a natively supported asset, you need to use
assetId
and source account id under the payload. For your reference, please use the following code:
const res = await signer.createTransaction({
assetId: 'BTC_TEST',
note: 'raw signing test',
source: {
type: PeerType.END_USER_WALLET,
walletId,
id: "walletaccountId",
},
operation: TransactionOperation.RAW,
extraParameters: {
rawMessageData: {
messages: [
{
content
},
],
},
},
},{ ncw: { walletId } });
rawMessageData object:
See here for more details on how to construct the
rawMessageData
object
About messages
You can aggregate a maximum of 127 messages for Raw Signing