Skip to content

Transaction meta is not exposed on SorobanEvent #112

@esteblock

Description

@esteblock

Summary: The SDK needs to expose rpc.Api.TransactionInfo. This is the only way to obtain resultMetaXdr: xdr.TransactionMeta;, which is necessary for retrieving the result of a transaction.


When a transaction emits a Soroban Event, the Subql SDK only exposes a SorobanEvent type:

export type SorobanEvent = Omit<SorobanRpcEventResponse, 'ledger'> & {
ledger: StellarBlock | null;
transaction: StellarTransaction | null;
operation: StellarOperation | null;
};

export type StellarTransaction = Omit<
  Horizon.ServerApi.TransactionRecord,
  'effects' | 'ledger' | 'operations' | 'precedes' | 'self' | 'succeeds'
> & {
  effects: StellarEffect[];
  ledger: StellarBlock | null;
  operations: StellarOperation[];
  events: SorobanEvent[];
};

The SorobanEvent only includes a Horizon API, not a Stellar RPC.

From
https://developers.stellar.org/docs/data/horizon/api-reference/resources/transactions/object
we can see that the transaction meta transaction_meta_xdr can only be obtained from a Stellar RPC Transaction object.

The only rpc.Api exposed in the Subql SDK is the export type SorobanRpcEventResponse = rpc.Api.EventResponse;, which is insufficient.

We need to expose rpc.Api.TransactionInfo:

https://github.com/stellar/js-stellar-sdk/blob/38115a16ed3fbc5d868ae8b1ab3042cf8a0c3399/src/rpc/api.ts#L151

This is the only way we can retrieve the resultMetaXdr object, which is required to understand the results of a specific transaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions