Skip to main content

Sending Serialized Transactions (Shadow Signer)

note

This guide is for sending serialized transactions that are signed by the user's shadow signer; this is usually done on the server side. If you want to send transactions signed by the user's wallet (usually from the client side), refer to the Sending Serialized Transactions guide.

What is a shadow signer?

A shadow signer can be used to perform Honeycomb actions on behalf of a user. This is useful in instances where you need to automate certain aspects of your game.

For example, a user might have characters staked on a staking pool that pays out rewards every week. Normally, the user would have to manually visit your website and sign a transaction every week to claim their rewards.

With a shadow signer, our Edge Client will sign the transaction on behalf of the user (using the shadow signer) and the rewards will be sent to the user.

Before using this query, you'll need to make sure you're authenticated using the user's wallet address. Refer to the authentication guide to learn to do so.

Query

To sign and send bulk transactions with a shadow signer, you'll need to make the following query to the Edge Client:


query SignWithShadowSignerAndSendBulkTransactions($options: SendBulkTransactionsOptions, $lastValidBlockHeight: Int!, $blockhash: String!, $txs: [Bytes!]!) {
signWithShadowSignerAndSendBulkTransactions(options: $options, lastValidBlockHeight: $lastValidBlockHeight, blockhash: $blockhash, txs: $txs) {
error
signature
status
}
}

Provide the serialized transactions, the blockhash, the last valid block height, and any options like this:


{
"txs": [ // Array of serialized transactions in string format
"<serialized transaction 1>",
"<serialized transaction 2>"
],
"blockhash": "<blockhash>", // Blockhash in string format
"lastValidBlockHeight": <last valid block height>, // Last valid block height in integer format
"options": {
"commitment": "string", // Commitment level in string format, e.g. "processed"
"skipPreflight": boolean // Whether to skip preflight checks, e.g. true
}
}