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.
Summary: The SDK needs to expose
rpc.Api.TransactionInfo. This is the only way to obtainresultMetaXdr: 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
SorobanEventtype:subql-stellar/packages/types/src/stellar/interfaces.ts
Lines 43 to 47 in b794f8a
The
SorobanEventonly 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_xdrcan only be obtained from a Stellar RPC Transaction object.The only
rpc.Apiexposed in the Subql SDK is theexport 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
resultMetaXdrobject, which is required to understand the results of a specific transaction.