Broadcast webhooks docs#649
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
0b6ac85 to
3866be9
Compare
|
|
||
| #### Subscribing | ||
|
|
||
| Use the [Create Webhook Endpoint](/api-reference/activities/create-webhook-endpoint) API with the `SEND_TRANSACTION_STATUS_UPDATES` event type to register your endpoint. Create the webhook endpoint on the parent organization. Balance webhook delivery is scoped to wallet-account addresses within your parent organization and its sub-organizations. This includes both addresses generated through Turnkey and addresses imported into your Turnkey organization. |
There was a problem hiding this comment.
Use the Create Webhook Endpoint API with the SEND_TRANSACTION_STATUS_UPDATES event type to register your endpoint. Create the webhook endpoint on the parent organization.
^ my suggestion. In the paragraph right above this we say that subs will cover all txns initiated across the parent org and all of its suborgs. We also say that this will work for all of your turnkey transactions so no need to say again
| | `msg.idempotencyKey` | A stable, unique key for this status event. Use this to safely deduplicate webhook deliveries. | | ||
| | `msg.timestamp` | Unix timestamp (seconds) when the notification was generated. | | ||
| | `msg.txHash` | _(INCLUDED only)_ The on-chain transaction hash or Solana signature. | | ||
| | `msg.error` | _(FAILED only)_ Structured error object. Contains `message`, and either `eth.revertChain` (EVM) or `solana` (Solana) details. | |
There was a problem hiding this comment.
We say failed is the only time you'll get this, but right above we say that error might be present in included with full revert details. Let's just make sure that we're consistent and accurate here
There was a problem hiding this comment.
Yeah its possible it will be present in the "INCLUDED" status. I'm just gonna remove the (FAILED only) tag in the table
| | `type` | Always `"transaction:status"`. | | ||
| | `msg.sendTransactionStatusId` | The ID of the send transaction status record. | | ||
| | `msg.activityId` | The ID of the originating Turnkey activity. | | ||
| | `msg.orgID` | The sub-organization ID that initiated the transaction. | |
There was a problem hiding this comment.
doesn't have to be a suborg right? could be a parent org?
| ## Transaction status and enriched errors | ||
|
|
||
| After you send a transaction, Turnkey monitors its status until it fails or is confirmed on-chain. | ||
| After you send a transaction, Turnkey monitors its status until it fails or is confirmed on-chain. You can [query the transaction status](./broadcasting#querying-via-api) or subscribe to status updates [via webhooks](./broadcasting#webhooks). |
There was a problem hiding this comment.
very small nit but let's just be consistent with "onchain" as opposed to "on-chain"
We have "onchain" later in this doc anyway, let's just make it consistent without the -
|
|
||
| Turnkey Webhooks let you react to transaction status updates in real time, without polling. Instead of repeatedly calling the [Get Send Transaction Status](/api-reference/queries/get-send-transaction-status) API to check for updates, you register an endpoint and Turnkey pushes the data to you; an HTTP POST fires when a transaction status changes (e.g. from `BROADCASTING` to `INCLUDED` or `FAILED`). Webhook payloads deliver rich transaction status updates as soon as they occur, so you can keep your users informed and react to failures immediately. | ||
|
|
||
| You subscribe to webhooks at the parent organization level. Subscriptions cover all transactions initiated across the parent organization and all of its sub-organizations. In other words, once you subscribe you'll receive webhook notifications for all transactions within your entire Turnkey instance. |
There was a problem hiding this comment.
wdyt about:
Subscriptions cover transactions across the parent organization and all of its sub-organizations. In other words, once you subscribe you'll receive webhook notifications for all transactions that are powered by Turnkey's transaction management suite.
reason being is I don't want users who are using us for signing to think they will be able to use this
3866be9 to
a413188
Compare
a413188 to
02d08ec
Compare
Docs for this: https://github.com/tkhq/mono/pull/6240