@@ -217,6 +217,22 @@ type AptosRpcClient interface {
217
217
// client.AccountTransactions(AccountOne, 1, 100) // Returns 100 transactions for 0x1
218
218
AccountTransactions (address AccountAddress , start * uint64 , limit * uint64 ) (data []* api.CommittedTransaction , err error )
219
219
220
+ // EventsByHandle retrieves events by event handle and field name for a given account.
221
+ //
222
+ // Arguments:
223
+ // - account - The account address to get events for
224
+ // - eventHandle - The event handle struct tag
225
+ // - fieldName - The field in the event handle struct
226
+ // - start - The starting sequence number. nil for most recent events
227
+ // - limit - The number of events to return, 100 by default
228
+ EventsByHandle (
229
+ account AccountAddress ,
230
+ eventHandle string ,
231
+ fieldName string ,
232
+ start * uint64 ,
233
+ limit * uint64 ,
234
+ ) ([]* api.Event , error )
235
+
220
236
// SubmitTransaction Submits an already signed transaction to the blockchain
221
237
//
222
238
// sender := NewEd25519Account()
@@ -649,6 +665,16 @@ func (client *Client) AccountTransactions(address AccountAddress, start *uint64,
649
665
return client .nodeClient .AccountTransactions (address , start , limit )
650
666
}
651
667
668
+ // EventsByHandle Get events by handle and field name for an account.
669
+ // Start is a sequence number. Nil for most recent events.
670
+ // Limit is a number of events to return, 100 by default.
671
+ //
672
+ // client.EventsByHandle(AccountOne, "0x2", "transfer", 0, 2) // Returns 2 events
673
+ // client.EventsByHandle(AccountOne, "0x2", "transfer", 1, 100) // Returns 100 events
674
+ func (client * Client ) EventsByHandle (account AccountAddress , eventHandle string , fieldName string , start * uint64 , limit * uint64 ) ([]* api.Event , error ) {
675
+ return client .nodeClient .EventsByHandle (account , eventHandle , fieldName , start , limit )
676
+ }
677
+
652
678
// SubmitTransaction Submits an already signed transaction to the blockchain
653
679
//
654
680
// sender := NewEd25519Account()
0 commit comments