Skip to content

Commit

Permalink
Add transaction hash field to each item in the getEvents response (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Apr 26, 2024
1 parent 87db95b commit 34ccf20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CHANGELOG.md
Expand Up @@ -7,15 +7,12 @@ A breaking change will get clearly marked in this log.
## Unreleased

### Fixed

* Each item in the `GetEventsResponse.events` list will now have a `txHash` item corresponding to the transaction hash that triggered a particular event ([#939](https://github.com/stellar/js-stellar-sdk/pull/939)).
* ContractClient now properly handles methods that take no arguments. While most methods take two arguments (arguments for the function, `args`, as well as various `MethodOptions`), if there are no arguments for the functions, then we can omit the first. This brings the ContractClient inline with the types generated by Soroban CLI's `soroban contract bindings typescript`. Full details: [#940](https://github.com/stellar/js-stellar-sdk/pull/940)
* `ContractClient` new allows `publicKey` to be undefined, returning functionality that had been in the bindings previously generated by `soroban contract bindings typescript`. More details: [#941](https://github.com/stellar/js-stellar-sdk/pull/941)

## [v11.3.0](https://github.com/stellar/js-stellar-sdk/compare/v11.2.2...v11.3.0)

### Fixed

* `ContractClient` new allows `publicKey` to be undefined, returning functionality that had been in the bindings previously generated by `soroban contract bindings typescript`. More details: [#941](https://github.com/stellar/js-stellar-sdk/pull/941)

### Added
* Introduces an entire suite of helpers to assist with interacting with smart contracts ([#929](https://github.com/stellar/js-stellar-sdk/pull/929)):
- `ContractClient`: generate a class from the contract specification where each Rust contract method gets a matching method in this class. Each method returns an `AssembledTransaction` that can be used to modify, simulate, decode results, and possibly sign, & submit the transaction.
Expand Down
1 change: 1 addition & 0 deletions src/soroban/api.ts
Expand Up @@ -166,6 +166,7 @@ export namespace Api {
ledgerClosedAt: string;
pagingToken: string;
inSuccessfulContractCall: boolean;
txHash: string;
}

export interface RawEventResponse extends BaseEventResponse {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/server/soroban/get_events_test.js
Expand Up @@ -246,6 +246,7 @@ let getEventsResponseFixture = [
inSuccessfulContractCall: true,
topic: topicVals.slice(0, 2),
value: eventVal,
txHash: "d7d09af2ca4f2929ee701cf86d05e4ca5f849a726d0db344785a8f9894e79e6c"
},
{
type: "contract",
Expand All @@ -257,6 +258,7 @@ let getEventsResponseFixture = [
inSuccessfulContractCall: true,
topic: topicVals.slice(0, 2),
value: eventVal,
txHash: "d7d09af2ca4f2929ee701cf86d05e4ca5f849a726d0db344785a8f9894e79e6c"
},
{
type: "diagnostic",
Expand All @@ -268,6 +270,7 @@ let getEventsResponseFixture = [
inSuccessfulContractCall: true,
topic: [topicVals[0]],
value: eventVal,
txHash: "d7d09af2ca4f2929ee701cf86d05e4ca5f849a726d0db344785a8f9894e79e6c"
},
{
type: "contract",
Expand All @@ -279,5 +282,6 @@ let getEventsResponseFixture = [
inSuccessfulContractCall: true,
topic: topicVals,
value: eventVal,
txHash: "d7d09af2ca4f2929ee701cf86d05e4ca5f849a726d0db344785a8f9894e79e6c"
},
];

0 comments on commit 34ccf20

Please sign in to comment.