vechain / vechain-sdk-js

The official JavaScript SDK for VeChain.
24 stars 9 forks source link

774 request add fragment support for filtereventlogs #878

Closed Valazan closed 4 months ago

Valazan commented 4 months ago

this PR adds support for decoding event logs. Decoding can be apply to single events filters as well as filters with multiple contract events and criteria.

e.g.


    const events = await thorSoloClient.logs.filterEventLogs({
            criteriaSet: [transferCriteria, valueCriteria]
        });

        expect(events.map((x) => x.decodedData)).toEqual([
            [
                [
                    '0xF02f557c753edf5fcdCbfE4c1c3a448B3cC84D54',
                    '0x9E7911de289c3c856ce7f421034F66b6Cde49C39',
                    5000n
                ],
                ['0xF02f557c753edf5fcdCbfE4c1c3a448B3cC84D54', 3000n]
            ]
        ]);
github-actions[bot] commented 4 months ago

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 99%
99.81% (3267/3273) 99.33% (748/753) 99.7% (675/677)
Title Tests Skipped Failures Errors Time
core 473 0 :zzz: 0 :x: 0 :fire: 1m 10s :stopwatch:
network 641 0 :zzz: 0 :x: 0 :fire: 4m 5s :stopwatch:
errors 48 0 :zzz: 0 :x: 0 :fire: 14.891s :stopwatch: