-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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:
subql-stellar/packages/types/src/stellar/interfaces.ts
Lines 43 to 47 in b794f8a
| 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:
This is the only way we can retrieve the resultMetaXdr object, which is required to understand the results of a specific transaction.