Internal Transaction Ok
This event is used to communicate the successful transference of tokens between pubkeys in the Ledger module.
Event Signature
An Internal Transaction Ok event has the following form:
{
"id": "{eventId}",
"pubkey": "{ledgerPubkey}",
"created_at": timestamp,
"kind": 1112,
"tags": [
["p", "{senderPubkey}"],
["p", "{receiverPubkey}"],
["e", "{internalTransactionEventId}"],
["t", "internal-transaction-ok"],
...,
],
"content": "{internalTransactionOkContent}",
"sig": "{signature}"
}
Note:
- the
.pubkey
is the Ledger module's pubkey, - the
.kind
field is1112
(ie. a regular event), - the first
"p"
tag points to the sender client's pubkey, - the second
"p"
tag points to the receiver client's pubkey, - the
"t"
tag sub-kind isinternal-transaction-ok
.
The content itself is the JSON serialization of an object of the following form:
{
"tokens": {
"{tokenName}": tokenAmount,
...,
},
"memo": "{memoString}"
}
An example TypeScript type
definition for this event's content is:
type InternalTransactionOkContent = {
tokens: Record<string, bigint>,
memo?: string,
};
Not that both of these are equal to those for Internal Transaction Start events.
Emitters
This event is emitted by:
- The Ledger module, when an internal transaction event is successfully completed.
Targets
This event is targeted towards:
- The sender client.
Listeners
This event is listened for by:
- The sender client.
- The receiver client.
- Any other agent listening for this event will learn about successfully completed transfers between pubkeys.