-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS SDK - Event Queries #4503
Merged
Merged
TS SDK - Event Queries #4503
Changes from 116 commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
375e989
add subscribeEvent stub
c46292a
add onMessage callback to subscribeEvent
6ad6655
add json rpc version of subscribeEvent
5cbe7fc
add subscribeEvent to void provider
13cd12f
refine types for event sub, add websocket client instance
fdd1491
support insecure websocket
db9daf5
rename subscribeEvent parameter
98ccb96
update generated type guards
43fada4
add debug logs to getWebsocketUrl
b8430d3
add SuiEventEnvelope typescript type
131c057
remove unused import, update type guards
a3c94b2
{} to void return for subscribeevent
1fd4a34
add basic event subscription test box
d77f785
TEMPORARILY add eventsubscription to home page
067ec69
remove broken checkbox select
940d14a
add basic Event Filter Type element
5d36cb5
lint changes
007030d
working objectId filter
c338f77
lint changes
11be84b
remove select form from event tester
f47c243
remove jayson WebsocketClient
9a6c314
remove excess whitespace
add156f
add Subscription tracking
0ddeeea
Update index.guard.ts
b9ccd23
add unsubscribeEvent
7077204
remove console logs, add comments
2c89e05
style / organization changes in ts sdk
3e1f33a
don't re-create websocket client
513115f
only create one default rpc client per network
1581667
lint changes
66bf813
add on socket error
62682fa
fix message subscription
4b2d3b3
add unsubscribe rpc call
59e5002
allow timestamp as number in SuiEventEnvelope
18ed01d
remove LossLessJSON from event parsing
4d22654
Update index.guard.ts
037c1da
move socket event setup to method
78e80d7
add check for method id
5af06ba
remove explorer eventSubscription
b27cda0
make websocket rpc client not auto connection
3686c6e
bring back explorer test page for event sub
84405fc
remove heartbeat
0d2929f
improve comment for socket type cast
484b3fa
improve timeout handling for websocket connection
c72c9ea
add FilterSubHandler type
e1f428a
delete from active subs on remove
52a4e00
shorten lazy connect comment
732f537
use one single map to track subscription data
75b3804
use .values() instead of entries() in sub refresh
77df956
improve comment about subscription refresh
6035584
Delete yarn.lock
a071c94
remove explorer home changes for testing
17d4ebf
Merge branch 'main' into tx-subscribe
9a1cc51
use shorter console error
a4b6c7a
fix provider subscribe return value
adb4730
fix doc comment on unsubscribe event
173a95e
remove console.log
c930f25
use jsdoc comment style
d283c66
change EventType discriminator enum
ddb4eea
make timestamp only a number
039ab01
replace string manipulation with url object
c126061
update onMessage return types
b1d2209
change to doing socket setup in connect
264ea32
add timeout error
3c869b4
shorten usage of reject
8ad806d
const instead of let for two vars
5698806
if spacing change
51ae889
remove calbackwithType
136ac7f
Update client.ts
9b587d8
Update client.ts
dafd8bd
move websocket client into its own class
ad1f441
Revert "remove explorer home changes for testing"
7d2d48e
rename most websocket client symbols
cce81e3
Revert "Revert "remove explorer home changes for testing""
79954c2
validate minimum data with validation off
9bd75ae
Update websocket-client.ts
33e1d94
add else if in socket message handler
8fe8fdd
activeSubs -> eventSubs
bcf1347
wsProvider -> wsClient
82ca988
move websocket client into rpc folder
58a34d2
better styling for default websocket options
766c48a
add maxReconnects option to websockets
d828f19
Revert "Revert "Revert "remove explorer home changes for testing"""
4acf1cd
remove old todo
b8f5f78
Update sdk/typescript/src/providers/void-provider.ts
007f5be
add better usage comments for event subscription
b48ad38
Revert "Revert "Revert "Revert "remove explorer home changes for test…
feba665
minor formatting change in provider
9334a31
Merge branch 'main' into tx-subscribe
2ffccec
fix type guard import
4980844
Update pnpm-lock.yaml
dd16350
fix capitalization on event filters
bac0794
Update sdk/typescript/src/rpc/websocket-client.ts
ab6738e
add websocket config jsdoc
02b07ee
add jsdoc for websocket client
97df83f
update type guard
be5b614
add event query api to TS sdk
e114868
fix package variable naming format
be48bc8
use SuiEvents type, add JSDoc for event queries
55785c6
add JSDoc for getEventsByTransaction
ea5592e
add JSDoc for options nested params
7d42761
add missing JSDoc for events options
1e4ac68
remove extra whitespace
fb5b9dc
add comment for TimeRangeQueryOptions
4988d0c
refactor to remove options struct in ts event queries
2933492
remove TimeRangeQueryOptions
3f09e50
update JSDoc for Provider
36aef1d
add defaults to count, startTime, endtime
ed6034f
remove console.log
e46990f
fix jsdoc comment for getEventsBySender
9fcb1cb
remove last options.startTime
e88ecaf
Merge branch 'main' into event-query
5fbd4bf
make MoveEvent.fields optional
29a366a
Merge branch 'main' into event-query
c8000bd
update eventdisplay to allow for undefined event fields
95936c5
unwrap connection promise
16462f4
change to getEventsByModule
aca2b05
Update sdk/typescript/src/types/events.ts
6f3f011
Update sdk/typescript/src/providers/provider.ts
fdabfa3
Update sdk/typescript/src/providers/provider.ts
dc98c2a
DEFAULT_RESULT_COUNT -> EVENT_QUERY_MAX_LIMIT
e3178b3
add two event query examples to ts sdk readme
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ export type MoveEvent = { | |
transactionModule: string; | ||
sender: SuiAddress; | ||
type: string; | ||
fields: { [key: string]: any; }; | ||
fields?: { [key: string]: any; }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
bcs: string; | ||
}; | ||
|
||
|
@@ -89,6 +89,12 @@ export type SuiEventEnvelope = { | |
event: SuiEvent | ||
} | ||
|
||
export type SuiEvents = SuiEventEnvelope[]; | ||
|
||
export type SubscriptionId = number; | ||
|
||
export type SubscriptionEvent = { subscription: SubscriptionId, result: SuiEventEnvelope }; | ||
export type SubscriptionEvent = { subscription: SubscriptionId, result: SuiEventEnvelope }; | ||
|
||
export const DEFAULT_RESULT_COUNT = 1000; | ||
stella3d marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export const DEFAULT_START_TIME = 0; | ||
export const DEFAULT_END_TIME = Number.MAX_SAFE_INTEGER; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is related to my other comment about making
MoveEvent.fields
optional.