@ryanrfox/sdk 0.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +145 -29
  2. package/package.json +84 -8
  3. package/src/_esm/actions/index.d.ts +8 -0
  4. package/src/_esm/actions/index.d.ts.map +1 -0
  5. package/src/_esm/actions/index.js +8 -0
  6. package/src/_esm/actions/index.js.map +1 -0
  7. package/src/_esm/actions/sendTransactionBatch.d.ts +77 -0
  8. package/src/_esm/actions/sendTransactionBatch.d.ts.map +1 -0
  9. package/src/_esm/actions/sendTransactionBatch.js +245 -0
  10. package/src/_esm/actions/sendTransactionBatch.js.map +1 -0
  11. package/src/_esm/chains/chainConfig.d.ts +30 -0
  12. package/src/_esm/chains/chainConfig.d.ts.map +1 -0
  13. package/src/_esm/chains/chainConfig.js +30 -0
  14. package/src/_esm/chains/chainConfig.js.map +1 -0
  15. package/src/_esm/chains/index.d.ts +4 -0
  16. package/src/_esm/chains/index.d.ts.map +1 -0
  17. package/src/_esm/chains/index.js +4 -0
  18. package/src/_esm/chains/index.js.map +1 -0
  19. package/src/_esm/chains/radius.d.ts +64 -0
  20. package/src/_esm/chains/radius.d.ts.map +1 -0
  21. package/src/_esm/chains/radius.js +39 -0
  22. package/src/_esm/chains/radius.js.map +1 -0
  23. package/src/_esm/chains/radiusTestnet.d.ts +61 -0
  24. package/src/_esm/chains/radiusTestnet.d.ts.map +1 -0
  25. package/src/_esm/chains/radiusTestnet.js +45 -0
  26. package/src/_esm/chains/radiusTestnet.js.map +1 -0
  27. package/src/_esm/decorators/index.d.ts +8 -0
  28. package/src/_esm/decorators/index.d.ts.map +1 -0
  29. package/src/_esm/decorators/index.js +8 -0
  30. package/src/_esm/decorators/index.js.map +1 -0
  31. package/src/_esm/decorators/radius.d.ts +66 -0
  32. package/src/_esm/decorators/radius.d.ts.map +1 -0
  33. package/src/_esm/decorators/radius.js +36 -0
  34. package/src/_esm/decorators/radius.js.map +1 -0
  35. package/src/_esm/errors/account.d.ts +78 -0
  36. package/src/_esm/errors/account.d.ts.map +1 -0
  37. package/src/_esm/errors/account.js +97 -0
  38. package/src/_esm/errors/account.js.map +1 -0
  39. package/src/_esm/errors/base.d.ts +56 -0
  40. package/src/_esm/errors/base.d.ts.map +1 -0
  41. package/src/_esm/errors/base.js +51 -0
  42. package/src/_esm/errors/base.js.map +1 -0
  43. package/src/_esm/errors/contract.d.ts +51 -0
  44. package/src/_esm/errors/contract.d.ts.map +1 -0
  45. package/src/_esm/errors/contract.js +65 -0
  46. package/src/_esm/errors/contract.js.map +1 -0
  47. package/src/_esm/errors/index.d.ts +63 -0
  48. package/src/_esm/errors/index.d.ts.map +1 -0
  49. package/src/_esm/errors/index.js +40 -0
  50. package/src/_esm/errors/index.js.map +1 -0
  51. package/src/_esm/errors/transaction.d.ts +132 -0
  52. package/src/_esm/errors/transaction.d.ts.map +1 -0
  53. package/src/_esm/errors/transaction.js +143 -0
  54. package/src/_esm/errors/transaction.js.map +1 -0
  55. package/src/_esm/events/decodeEventLogs.d.ts +136 -0
  56. package/src/_esm/events/decodeEventLogs.d.ts.map +1 -0
  57. package/src/_esm/events/decodeEventLogs.js +93 -0
  58. package/src/_esm/events/decodeEventLogs.js.map +1 -0
  59. package/src/_esm/events/getLogs.d.ts +137 -0
  60. package/src/_esm/events/getLogs.d.ts.map +1 -0
  61. package/src/_esm/events/getLogs.js +171 -0
  62. package/src/_esm/events/getLogs.js.map +1 -0
  63. package/src/_esm/events/index.d.ts +17 -0
  64. package/src/_esm/events/index.d.ts.map +1 -0
  65. package/src/_esm/events/index.js +24 -0
  66. package/src/_esm/events/index.js.map +1 -0
  67. package/src/_esm/events/watchApproval.d.ts +184 -0
  68. package/src/_esm/events/watchApproval.d.ts.map +1 -0
  69. package/src/_esm/events/watchApproval.js +254 -0
  70. package/src/_esm/events/watchApproval.js.map +1 -0
  71. package/src/_esm/events/watchBlock.d.ts +192 -0
  72. package/src/_esm/events/watchBlock.d.ts.map +1 -0
  73. package/src/_esm/events/watchBlock.js +162 -0
  74. package/src/_esm/events/watchBlock.js.map +1 -0
  75. package/src/_esm/events/watchLogs.d.ts +128 -0
  76. package/src/_esm/events/watchLogs.d.ts.map +1 -0
  77. package/src/_esm/events/watchLogs.js +100 -0
  78. package/src/_esm/events/watchLogs.js.map +1 -0
  79. package/src/_esm/events/watchTransfer.d.ts +164 -0
  80. package/src/_esm/events/watchTransfer.d.ts.map +1 -0
  81. package/src/_esm/events/watchTransfer.js +234 -0
  82. package/src/_esm/events/watchTransfer.js.map +1 -0
  83. package/src/_esm/index.d.ts +16 -0
  84. package/src/_esm/index.d.ts.map +1 -0
  85. package/src/_esm/index.js +22 -0
  86. package/src/_esm/index.js.map +1 -0
  87. package/src/_esm/package.json +1 -0
  88. package/src/_esm/transport/index.d.ts +9 -0
  89. package/src/_esm/transport/index.d.ts.map +1 -0
  90. package/src/_esm/transport/index.js +9 -0
  91. package/src/_esm/transport/index.js.map +1 -0
  92. package/src/_esm/transport/interceptor.d.ts +48 -0
  93. package/src/_esm/transport/interceptor.d.ts.map +1 -0
  94. package/src/_esm/transport/interceptor.js +209 -0
  95. package/src/_esm/transport/interceptor.js.map +1 -0
  96. package/src/_esm/transport/types.d.ts +29 -0
  97. package/src/_esm/transport/types.d.ts.map +1 -0
  98. package/src/_esm/transport/types.js +2 -0
  99. package/src/_esm/transport/types.js.map +1 -0
  100. package/src/_esm/transport/websocket.d.ts +51 -0
  101. package/src/_esm/transport/websocket.d.ts.map +1 -0
  102. package/src/_esm/transport/websocket.js +70 -0
  103. package/src/_esm/transport/websocket.js.map +1 -0
  104. package/src/_types/actions/index.d.ts +8 -0
  105. package/src/_types/actions/index.d.ts.map +1 -0
  106. package/src/_types/actions/sendTransactionBatch.d.ts +77 -0
  107. package/src/_types/actions/sendTransactionBatch.d.ts.map +1 -0
  108. package/src/_types/chains/chainConfig.d.ts +30 -0
  109. package/src/_types/chains/chainConfig.d.ts.map +1 -0
  110. package/src/_types/chains/index.d.ts +4 -0
  111. package/src/_types/chains/index.d.ts.map +1 -0
  112. package/src/_types/chains/radius.d.ts +64 -0
  113. package/src/_types/chains/radius.d.ts.map +1 -0
  114. package/src/_types/chains/radiusTestnet.d.ts +61 -0
  115. package/src/_types/chains/radiusTestnet.d.ts.map +1 -0
  116. package/src/_types/decorators/index.d.ts +8 -0
  117. package/src/_types/decorators/index.d.ts.map +1 -0
  118. package/src/_types/decorators/radius.d.ts +66 -0
  119. package/src/_types/decorators/radius.d.ts.map +1 -0
  120. package/src/_types/errors/account.d.ts +78 -0
  121. package/src/_types/errors/account.d.ts.map +1 -0
  122. package/src/_types/errors/base.d.ts +56 -0
  123. package/src/_types/errors/base.d.ts.map +1 -0
  124. package/src/_types/errors/contract.d.ts +51 -0
  125. package/src/_types/errors/contract.d.ts.map +1 -0
  126. package/src/_types/errors/index.d.ts +63 -0
  127. package/src/_types/errors/index.d.ts.map +1 -0
  128. package/src/_types/errors/transaction.d.ts +132 -0
  129. package/src/_types/errors/transaction.d.ts.map +1 -0
  130. package/src/_types/events/decodeEventLogs.d.ts +136 -0
  131. package/src/_types/events/decodeEventLogs.d.ts.map +1 -0
  132. package/src/_types/events/getLogs.d.ts +137 -0
  133. package/src/_types/events/getLogs.d.ts.map +1 -0
  134. package/src/_types/events/index.d.ts +17 -0
  135. package/src/_types/events/index.d.ts.map +1 -0
  136. package/src/_types/events/watchApproval.d.ts +184 -0
  137. package/src/_types/events/watchApproval.d.ts.map +1 -0
  138. package/src/_types/events/watchBlock.d.ts +192 -0
  139. package/src/_types/events/watchBlock.d.ts.map +1 -0
  140. package/src/_types/events/watchLogs.d.ts +128 -0
  141. package/src/_types/events/watchLogs.d.ts.map +1 -0
  142. package/src/_types/events/watchTransfer.d.ts +164 -0
  143. package/src/_types/events/watchTransfer.d.ts.map +1 -0
  144. package/src/_types/index.d.ts +16 -0
  145. package/src/_types/index.d.ts.map +1 -0
  146. package/src/_types/transport/index.d.ts +9 -0
  147. package/src/_types/transport/index.d.ts.map +1 -0
  148. package/src/_types/transport/interceptor.d.ts +48 -0
  149. package/src/_types/transport/interceptor.d.ts.map +1 -0
  150. package/src/_types/transport/types.d.ts +29 -0
  151. package/src/_types/transport/types.d.ts.map +1 -0
  152. package/src/_types/transport/websocket.d.ts +51 -0
  153. package/src/_types/transport/websocket.d.ts.map +1 -0
@@ -0,0 +1,184 @@
1
+ /**
2
+ * ERC-20 Approval event watching utilities for Radius SDK.
3
+ * Provides convenient wrappers for watching Approval events in real-time.
4
+ */
5
+ import type { Address, Log, PublicClient, WatchContractEventReturnType } from 'viem';
6
+ /**
7
+ * Decoded Approval event data.
8
+ */
9
+ export interface ApprovalEvent {
10
+ /** The address that owns the tokens */
11
+ owner: Address;
12
+ /** The address that is approved to spend the tokens */
13
+ spender: Address;
14
+ /** The amount of tokens approved (in smallest unit) */
15
+ value: bigint;
16
+ /** The raw log data */
17
+ log: Log;
18
+ }
19
+ /**
20
+ * Parameters for watching Approval events.
21
+ */
22
+ export interface WatchApprovalParameters {
23
+ /** The ERC-20 token contract address to watch */
24
+ address: Address;
25
+ /** Optional: Filter by owner address */
26
+ owner?: Address;
27
+ /** Optional: Filter by spender address */
28
+ spender?: Address;
29
+ /** Callback function invoked when Approval events are received */
30
+ onApproval: (events: ApprovalEvent[]) => void;
31
+ /** Callback function invoked when an error occurs */
32
+ onError?: (error: Error) => void;
33
+ /** Whether to emit logs from the latest block on subscription start */
34
+ sync?: boolean;
35
+ /** Polling interval in milliseconds (for HTTP transport fallback) */
36
+ pollingInterval?: number;
37
+ }
38
+ /**
39
+ * Watches for ERC-20 Approval events in real-time.
40
+ * Automatically decodes Approval events and provides type-safe callbacks.
41
+ *
42
+ * @param client - The PublicClient to use (WebSocket transport recommended)
43
+ * @param params - Approval event watching parameters
44
+ * @returns An unwatch function to stop the subscription
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * import { createPublicClient } from 'viem';
49
+ * import { createWebSocketTransport, watchApproval } from '@radiustechsystems/sdk/events';
50
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
51
+ *
52
+ * const client = createPublicClient({
53
+ * chain: radiusTestnet,
54
+ * transport: createWebSocketTransport(radiusTestnet),
55
+ * });
56
+ *
57
+ * // Watch all approvals for a token
58
+ * const unwatch = watchApproval(client, {
59
+ * address: '0x...', // Token address
60
+ * onApproval: (events) => {
61
+ * events.forEach(event => {
62
+ * console.log(`Approval: ${event.owner} approved ${event.spender} for ${event.value}`);
63
+ * });
64
+ * },
65
+ * });
66
+ *
67
+ * // Watch approvals from a specific owner
68
+ * const unwatchOwner = watchApproval(client, {
69
+ * address: '0x...', // Token address
70
+ * owner: '0x...', // Owner address
71
+ * onApproval: (events) => {
72
+ * console.log(`Owner granted ${events.length} approvals`);
73
+ * },
74
+ * });
75
+ *
76
+ * // Watch approvals for a specific spender
77
+ * const unwatchSpender = watchApproval(client, {
78
+ * address: '0x...', // Token address
79
+ * spender: '0x...', // Spender address
80
+ * onApproval: (events) => {
81
+ * console.log(`Spender received ${events.length} approvals`);
82
+ * },
83
+ * });
84
+ *
85
+ * // Stop watching
86
+ * unwatch();
87
+ * ```
88
+ *
89
+ * @remarks
90
+ * - Requires WebSocket transport for real-time subscriptions
91
+ * - Automatically decodes Approval events using ERC-20 ABI
92
+ * - Filters by owner/spender addresses if provided
93
+ * - Event signature: Approval(address indexed owner, address indexed spender, uint256 value)
94
+ * - Subscriptions consume gas from your RPC key on Radius (10 GAS/sec)
95
+ * - An approval value of 0 revokes the approval
96
+ */
97
+ export declare function watchApproval(client: PublicClient, params: WatchApprovalParameters): WatchContractEventReturnType;
98
+ /**
99
+ * Parameters for watching Approval events for a specific address (as owner or spender).
100
+ */
101
+ export interface WatchApprovalForAddressParameters {
102
+ /** The ERC-20 token contract address to watch */
103
+ tokenAddress: Address;
104
+ /** The address to watch (as owner or spender) */
105
+ watchAddress: Address;
106
+ /** Whether to watch as owner only (default: false, watches both owner and spender) */
107
+ ownerOnly?: boolean;
108
+ /** Whether to watch as spender only (default: false, watches both owner and spender) */
109
+ spenderOnly?: boolean;
110
+ /** Callback function invoked when Approval events are received */
111
+ onApproval: (events: ApprovalEvent[]) => void;
112
+ /** Callback function invoked when an error occurs */
113
+ onError?: (error: Error) => void;
114
+ /** Whether to emit logs from the latest block on subscription start */
115
+ sync?: boolean;
116
+ /** Polling interval in milliseconds (for HTTP transport fallback) */
117
+ pollingInterval?: number;
118
+ }
119
+ /**
120
+ * Watches for Approval events involving a specific address (as owner or spender).
121
+ * Convenience wrapper around watchApproval for monitoring a single address.
122
+ *
123
+ * @param client - The PublicClient to use (WebSocket transport recommended)
124
+ * @param params - Approval watching parameters for specific address
125
+ * @returns An unwatch function to stop the subscription
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * import { createPublicClient } from 'viem';
130
+ * import { createWebSocketTransport, watchApprovalForAddress } from '@radiustechsystems/sdk/events';
131
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
132
+ *
133
+ * const client = createPublicClient({
134
+ * chain: radiusTestnet,
135
+ * transport: createWebSocketTransport(radiusTestnet),
136
+ * });
137
+ *
138
+ * // Watch all approvals involving an address (as owner or spender)
139
+ * const unwatch = watchApprovalForAddress(client, {
140
+ * tokenAddress: '0x...', // Token address
141
+ * watchAddress: '0x...', // Address to monitor
142
+ * onApproval: (events) => {
143
+ * events.forEach(event => {
144
+ * if (event.owner === watchAddress) {
145
+ * console.log(`Approved ${event.spender} for ${event.value}`);
146
+ * } else {
147
+ * console.log(`Received approval from ${event.owner} for ${event.value}`);
148
+ * }
149
+ * });
150
+ * },
151
+ * });
152
+ *
153
+ * // Watch only approvals granted by an address (as owner)
154
+ * const unwatchAsOwner = watchApprovalForAddress(client, {
155
+ * tokenAddress: '0x...',
156
+ * watchAddress: '0x...',
157
+ * ownerOnly: true,
158
+ * onApproval: (events) => {
159
+ * console.log(`Granted ${events.length} approvals`);
160
+ * },
161
+ * });
162
+ *
163
+ * // Watch only approvals received by an address (as spender)
164
+ * const unwatchAsSpender = watchApprovalForAddress(client, {
165
+ * tokenAddress: '0x...',
166
+ * watchAddress: '0x...',
167
+ * spenderOnly: true,
168
+ * onApproval: (events) => {
169
+ * console.log(`Received ${events.length} approvals`);
170
+ * },
171
+ * });
172
+ *
173
+ * // Stop watching
174
+ * unwatch();
175
+ * ```
176
+ *
177
+ * @remarks
178
+ * - If neither ownerOnly nor spenderOnly is set, watches both roles
179
+ * - Cannot set both ownerOnly and spenderOnly to true
180
+ * - More efficient than watching all approvals and filtering client-side
181
+ * - Server-side filtering reduces network traffic and processing
182
+ */
183
+ export declare function watchApprovalForAddress(client: PublicClient, params: WatchApprovalForAddressParameters): WatchContractEventReturnType;
184
+ //# sourceMappingURL=watchApproval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watchApproval.d.ts","sourceRoot":"","sources":["../../events/watchApproval.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,4BAA4B,EAAE,MAAM,MAAM,CAAC;AAGrF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,uCAAuC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,GAAG,EAAE,GAAG,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC9C,qDAAqD;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,uBAAuB,GAC7B,4BAA4B,CA+C9B;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IACjD,iDAAiD;IACjD,YAAY,EAAE,OAAO,CAAC;IACtB,iDAAiD;IACjD,YAAY,EAAE,OAAO,CAAC;IACtB,sFAAsF;IACtF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kEAAkE;IAClE,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IAC9C,qDAAqD;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,iCAAiC,GACvC,4BAA4B,CAyF9B"}
@@ -0,0 +1,254 @@
1
+ import { decodeEventLog, erc20Abi } from 'viem';
2
+ /**
3
+ * Watches for ERC-20 Approval events in real-time.
4
+ * Automatically decodes Approval events and provides type-safe callbacks.
5
+ *
6
+ * @param client - The PublicClient to use (WebSocket transport recommended)
7
+ * @param params - Approval event watching parameters
8
+ * @returns An unwatch function to stop the subscription
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createPublicClient } from 'viem';
13
+ * import { createWebSocketTransport, watchApproval } from '@radiustechsystems/sdk/events';
14
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
15
+ *
16
+ * const client = createPublicClient({
17
+ * chain: radiusTestnet,
18
+ * transport: createWebSocketTransport(radiusTestnet),
19
+ * });
20
+ *
21
+ * // Watch all approvals for a token
22
+ * const unwatch = watchApproval(client, {
23
+ * address: '0x...', // Token address
24
+ * onApproval: (events) => {
25
+ * events.forEach(event => {
26
+ * console.log(`Approval: ${event.owner} approved ${event.spender} for ${event.value}`);
27
+ * });
28
+ * },
29
+ * });
30
+ *
31
+ * // Watch approvals from a specific owner
32
+ * const unwatchOwner = watchApproval(client, {
33
+ * address: '0x...', // Token address
34
+ * owner: '0x...', // Owner address
35
+ * onApproval: (events) => {
36
+ * console.log(`Owner granted ${events.length} approvals`);
37
+ * },
38
+ * });
39
+ *
40
+ * // Watch approvals for a specific spender
41
+ * const unwatchSpender = watchApproval(client, {
42
+ * address: '0x...', // Token address
43
+ * spender: '0x...', // Spender address
44
+ * onApproval: (events) => {
45
+ * console.log(`Spender received ${events.length} approvals`);
46
+ * },
47
+ * });
48
+ *
49
+ * // Stop watching
50
+ * unwatch();
51
+ * ```
52
+ *
53
+ * @remarks
54
+ * - Requires WebSocket transport for real-time subscriptions
55
+ * - Automatically decodes Approval events using ERC-20 ABI
56
+ * - Filters by owner/spender addresses if provided
57
+ * - Event signature: Approval(address indexed owner, address indexed spender, uint256 value)
58
+ * - Subscriptions consume gas from your RPC key on Radius (10 GAS/sec)
59
+ * - An approval value of 0 revokes the approval
60
+ */
61
+ export function watchApproval(client, params) {
62
+ // Build event filter args based on owner/spender parameters
63
+ const args = {};
64
+ if (params.owner)
65
+ args.owner = params.owner;
66
+ if (params.spender)
67
+ args.spender = params.spender;
68
+ return client.watchContractEvent({
69
+ address: params.address,
70
+ abi: erc20Abi,
71
+ eventName: 'Approval',
72
+ args: Object.keys(args).length > 0 ? args : undefined,
73
+ onLogs: (logs) => {
74
+ // Decode and transform logs to ApprovalEvent format
75
+ const events = logs
76
+ .map((log) => {
77
+ try {
78
+ const decoded = decodeEventLog({
79
+ abi: erc20Abi,
80
+ data: log.data,
81
+ topics: log.topics,
82
+ });
83
+ return {
84
+ owner: decoded.args.owner,
85
+ spender: decoded.args.spender,
86
+ value: decoded.args.value,
87
+ log: log,
88
+ };
89
+ }
90
+ catch (error) {
91
+ // Skip logs that can't be decoded
92
+ if (params.onError) {
93
+ params.onError(error instanceof Error ? error : new Error('Failed to decode Approval event'));
94
+ }
95
+ return null;
96
+ }
97
+ })
98
+ .filter((event) => event !== null);
99
+ if (events.length > 0) {
100
+ params.onApproval(events);
101
+ }
102
+ },
103
+ onError: params.onError,
104
+ pollingInterval: params.pollingInterval,
105
+ });
106
+ }
107
+ /**
108
+ * Watches for Approval events involving a specific address (as owner or spender).
109
+ * Convenience wrapper around watchApproval for monitoring a single address.
110
+ *
111
+ * @param client - The PublicClient to use (WebSocket transport recommended)
112
+ * @param params - Approval watching parameters for specific address
113
+ * @returns An unwatch function to stop the subscription
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * import { createPublicClient } from 'viem';
118
+ * import { createWebSocketTransport, watchApprovalForAddress } from '@radiustechsystems/sdk/events';
119
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
120
+ *
121
+ * const client = createPublicClient({
122
+ * chain: radiusTestnet,
123
+ * transport: createWebSocketTransport(radiusTestnet),
124
+ * });
125
+ *
126
+ * // Watch all approvals involving an address (as owner or spender)
127
+ * const unwatch = watchApprovalForAddress(client, {
128
+ * tokenAddress: '0x...', // Token address
129
+ * watchAddress: '0x...', // Address to monitor
130
+ * onApproval: (events) => {
131
+ * events.forEach(event => {
132
+ * if (event.owner === watchAddress) {
133
+ * console.log(`Approved ${event.spender} for ${event.value}`);
134
+ * } else {
135
+ * console.log(`Received approval from ${event.owner} for ${event.value}`);
136
+ * }
137
+ * });
138
+ * },
139
+ * });
140
+ *
141
+ * // Watch only approvals granted by an address (as owner)
142
+ * const unwatchAsOwner = watchApprovalForAddress(client, {
143
+ * tokenAddress: '0x...',
144
+ * watchAddress: '0x...',
145
+ * ownerOnly: true,
146
+ * onApproval: (events) => {
147
+ * console.log(`Granted ${events.length} approvals`);
148
+ * },
149
+ * });
150
+ *
151
+ * // Watch only approvals received by an address (as spender)
152
+ * const unwatchAsSpender = watchApprovalForAddress(client, {
153
+ * tokenAddress: '0x...',
154
+ * watchAddress: '0x...',
155
+ * spenderOnly: true,
156
+ * onApproval: (events) => {
157
+ * console.log(`Received ${events.length} approvals`);
158
+ * },
159
+ * });
160
+ *
161
+ * // Stop watching
162
+ * unwatch();
163
+ * ```
164
+ *
165
+ * @remarks
166
+ * - If neither ownerOnly nor spenderOnly is set, watches both roles
167
+ * - Cannot set both ownerOnly and spenderOnly to true
168
+ * - More efficient than watching all approvals and filtering client-side
169
+ * - Server-side filtering reduces network traffic and processing
170
+ */
171
+ export function watchApprovalForAddress(client, params) {
172
+ // Validate parameters
173
+ if (params.ownerOnly && params.spenderOnly) {
174
+ throw new Error('Cannot set both ownerOnly and spenderOnly to true');
175
+ }
176
+ // Determine filter parameters
177
+ let owner;
178
+ let spender;
179
+ if (params.ownerOnly) {
180
+ owner = params.watchAddress;
181
+ }
182
+ else if (params.spenderOnly) {
183
+ spender = params.watchAddress;
184
+ }
185
+ else {
186
+ // Watch both: need to create two separate subscriptions
187
+ // This is a limitation of eth_subscribe - can't do OR filters
188
+ // Use deduplication to prevent duplicate callbacks for the same event
189
+ const seenEvents = new Set();
190
+ const MAX_SEEN_EVENTS = 10000;
191
+ // Create a unique key for each event (using tx hash + log index)
192
+ const getEventKey = (event) => {
193
+ const txHash = event.log.transactionHash ?? 'pending';
194
+ const logIndex = event.log.logIndex ?? 0;
195
+ return `${txHash}-${logIndex}`;
196
+ };
197
+ // Wrapper that deduplicates events before calling the callback
198
+ const deduplicatedCallback = (events) => {
199
+ const newEvents = events.filter((event) => {
200
+ const key = getEventKey(event);
201
+ if (seenEvents.has(key)) {
202
+ return false;
203
+ }
204
+ seenEvents.add(key);
205
+ return true;
206
+ });
207
+ // Bound the cache size to prevent memory leaks for long-running subscriptions
208
+ if (seenEvents.size > MAX_SEEN_EVENTS) {
209
+ // Remove oldest half of entries
210
+ const iterator = seenEvents.values();
211
+ for (let i = 0; i < MAX_SEEN_EVENTS / 2; i++) {
212
+ const next = iterator.next();
213
+ if (next.done)
214
+ break;
215
+ seenEvents.delete(next.value);
216
+ }
217
+ }
218
+ if (newEvents.length > 0) {
219
+ params.onApproval(newEvents);
220
+ }
221
+ };
222
+ const unwatchOwner = watchApproval(client, {
223
+ address: params.tokenAddress,
224
+ owner: params.watchAddress,
225
+ onApproval: deduplicatedCallback,
226
+ onError: params.onError,
227
+ sync: params.sync,
228
+ pollingInterval: params.pollingInterval,
229
+ });
230
+ const unwatchSpender = watchApproval(client, {
231
+ address: params.tokenAddress,
232
+ spender: params.watchAddress,
233
+ onApproval: deduplicatedCallback,
234
+ onError: params.onError,
235
+ sync: params.sync,
236
+ pollingInterval: params.pollingInterval,
237
+ });
238
+ // Return combined unwatch function
239
+ return () => {
240
+ unwatchOwner();
241
+ unwatchSpender();
242
+ };
243
+ }
244
+ return watchApproval(client, {
245
+ address: params.tokenAddress,
246
+ owner,
247
+ spender,
248
+ onApproval: params.onApproval,
249
+ onError: params.onError,
250
+ sync: params.sync,
251
+ pollingInterval: params.pollingInterval,
252
+ });
253
+ }
254
+ //# sourceMappingURL=watchApproval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watchApproval.js","sourceRoot":"","sources":["../../events/watchApproval.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,cAAc,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAoC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAM,UAAU,aAAa,CAC5B,MAAoB,EACpB,MAA+B;IAE/B,4DAA4D;IAC5D,MAAM,IAAI,GAA2C,EAAE,CAAC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B,eAAe,EAAE,MAAM,CAAC,eAAe;SACvC,CAAC,CAAC;QAEH,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,EAAE;YAC5C,OAAO,EAAE,MAAM,CAAC,YAAY;YAC5B,OAAO,EAAE,MAAM,CAAC,YAAY;YAC5B,UAAU,EAAE,oBAAoB;YAChC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,eAAe,EAAE,MAAM,CAAC,eAAe;SACvC,CAAC,CAAC;QAEH,mCAAmC;QACnC,OAAO,GAAG,EAAE;YACX,YAAY,EAAE,CAAC;YACf,cAAc,EAAE,CAAC;QAClB,CAAC,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC,MAAM,EAAE;QAC5B,OAAO,EAAE,MAAM,CAAC,YAAY;QAC5B,KAAK;QACL,OAAO;QACP,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,eAAe,EAAE,MAAM,CAAC,eAAe;KACvC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Block watching utilities for Radius SDK.
3
+ * Provides wrappers for watching new blocks in real-time.
4
+ *
5
+ * @remarks Radius-Specific Limitations
6
+ *
7
+ * **HTTP Polling (Current Implementation)**:
8
+ * - Radius does NOT support `newHeads` WebSocket subscriptions
9
+ * - `eth_subscribe` only supports "logs" type subscriptions (not newHeads, not newPendingTransactions)
10
+ * - WebSocket is NOT currently enabled on Radius testnet
11
+ * - Default polling interval: 1000ms (1 second)
12
+ * - Uses HTTP-based polling to detect new blocks as a fallback mechanism
13
+ *
14
+ * **Future Considerations**:
15
+ * - When WebSocket is enabled on Radius, this module can be updated to use native subscriptions
16
+ * - Review implementation in watchLogs.ts as a reference for WebSocket usage patterns
17
+ */
18
+ import type { Block, PublicClient } from 'viem';
19
+ /**
20
+ * Default polling interval for block watching in milliseconds.
21
+ * Used when polling is required (e.g., HTTP transport fallback).
22
+ * Can be overridden per watch call via pollingInterval parameter.
23
+ */
24
+ export declare const DEFAULT_POLLING_INTERVAL_MS = 1000;
25
+ /**
26
+ * Parameters for watching new block numbers.
27
+ */
28
+ export interface WatchBlockNumberParams {
29
+ /** Callback function invoked when a new block number is detected */
30
+ onBlockNumber: (blockNumber: bigint) => void;
31
+ /** Callback function invoked when an error occurs */
32
+ onError?: (error: Error) => void;
33
+ /** Whether to emit the current block number on subscription start */
34
+ emitOnBegin?: boolean;
35
+ /** Polling interval in milliseconds (default: 1000ms for HTTP, real-time for WebSocket) */
36
+ pollingInterval?: number;
37
+ }
38
+ /**
39
+ * Watches for new block numbers.
40
+ * Uses WebSocket subscriptions when available, falls back to polling for HTTP transport.
41
+ *
42
+ * @param client - The PublicClient to use
43
+ * @param params - Block number watching parameters
44
+ * @returns An unwatch function to stop watching
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * import { createPublicClient } from 'viem';
49
+ * import { createWebSocketTransport, watchBlockNumber } from '@radiustechsystems/sdk/events';
50
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
51
+ *
52
+ * const client = createPublicClient({
53
+ * chain: radiusTestnet,
54
+ * transport: createWebSocketTransport(radiusTestnet),
55
+ * });
56
+ *
57
+ * // Watch for new blocks
58
+ * const unwatch = watchBlockNumber(client, {
59
+ * onBlockNumber: (blockNumber) => {
60
+ * console.log('New block:', blockNumber);
61
+ * },
62
+ * onError: (error) => {
63
+ * console.error('Error:', error);
64
+ * },
65
+ * });
66
+ *
67
+ * // Stop watching
68
+ * unwatch();
69
+ * ```
70
+ *
71
+ * @remarks
72
+ * - WebSocket transport provides real-time block notifications
73
+ * - HTTP transport falls back to polling (default 1s interval)
74
+ * - Radius does not support eth_newBlockFilter (traditional filter API)
75
+ * - WebSocket subscriptions are more efficient than polling
76
+ * - For HTTP clients, consider increasing pollingInterval to reduce load
77
+ */
78
+ export declare function watchBlockNumber(client: PublicClient, params: WatchBlockNumberParams): () => void;
79
+ /**
80
+ * Parameters for watching new blocks (full block data).
81
+ */
82
+ export interface WatchBlocksParams {
83
+ /** Callback function invoked when a new block is detected */
84
+ onBlock: (block: Block) => void;
85
+ /** Callback function invoked when an error occurs */
86
+ onError?: (error: Error) => void;
87
+ /** Whether to emit the current block on subscription start */
88
+ emitOnBegin?: boolean;
89
+ /** Whether to include transactions in the block (default: false) */
90
+ includeTransactions?: boolean;
91
+ /** Polling interval in milliseconds (default: 1000ms for HTTP, real-time for WebSocket) */
92
+ pollingInterval?: number;
93
+ }
94
+ /**
95
+ * Watches for new blocks with full block data.
96
+ * Uses WebSocket subscriptions when available, falls back to polling for HTTP transport.
97
+ *
98
+ * @param client - The PublicClient to use
99
+ * @param params - Block watching parameters
100
+ * @returns An unwatch function to stop watching
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * import { createPublicClient } from 'viem';
105
+ * import { createWebSocketTransport, watchBlocks } from '@radiustechsystems/sdk/events';
106
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
107
+ *
108
+ * const client = createPublicClient({
109
+ * chain: radiusTestnet,
110
+ * transport: createWebSocketTransport(radiusTestnet),
111
+ * });
112
+ *
113
+ * // Watch for new blocks
114
+ * const unwatch = watchBlocks(client, {
115
+ * onBlock: (block) => {
116
+ * console.log('New block:', block.number);
117
+ * console.log('Timestamp:', block.timestamp);
118
+ * console.log('Transactions:', block.transactions.length);
119
+ * },
120
+ * });
121
+ *
122
+ * // Watch blocks with full transaction data
123
+ * const unwatchWithTxs = watchBlocks(client, {
124
+ * includeTransactions: true,
125
+ * onBlock: (block) => {
126
+ * console.log('New block with', block.transactions.length, 'transactions');
127
+ * // block.transactions contains full transaction objects
128
+ * },
129
+ * });
130
+ *
131
+ * // Stop watching
132
+ * unwatch();
133
+ * ```
134
+ *
135
+ * @remarks
136
+ * - WebSocket transport provides real-time block notifications
137
+ * - HTTP transport falls back to polling (default 1s interval)
138
+ * - includeTransactions=true fetches full transaction data (slower)
139
+ * - includeTransactions=false only includes transaction hashes (faster, default)
140
+ * - WebSocket is recommended for real-time block monitoring
141
+ * - Polling with includeTransactions=true can be expensive
142
+ */
143
+ export declare function watchBlocks(client: PublicClient, params: WatchBlocksParams): () => void;
144
+ /**
145
+ * Parameters for watching pending transactions.
146
+ */
147
+ export interface WatchPendingTransactionsParams {
148
+ /** Callback function invoked when new pending transactions are detected */
149
+ onTransactions: (hashes: `0x${string}`[]) => void;
150
+ /** Callback function invoked when an error occurs */
151
+ onError?: (error: Error) => void;
152
+ /** Polling interval in milliseconds (required for HTTP transport) */
153
+ pollingInterval?: number;
154
+ }
155
+ /**
156
+ * Watches for pending transactions in the mempool.
157
+ *
158
+ * @param client - The PublicClient to use
159
+ * @param params - Pending transaction watching parameters
160
+ * @returns An unwatch function to stop watching
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * import { createPublicClient } from 'viem';
165
+ * import { createWebSocketTransport, watchPendingTransactions } from '@radiustechsystems/sdk/events';
166
+ * import { radiusTestnet } from '@radiustechsystems/sdk/chains';
167
+ *
168
+ * const client = createPublicClient({
169
+ * chain: radiusTestnet,
170
+ * transport: createWebSocketTransport(radiusTestnet),
171
+ * });
172
+ *
173
+ * // Watch for pending transactions
174
+ * const unwatch = watchPendingTransactions(client, {
175
+ * onTransactions: (hashes) => {
176
+ * console.log('New pending transactions:', hashes);
177
+ * },
178
+ * });
179
+ *
180
+ * // Stop watching
181
+ * unwatch();
182
+ * ```
183
+ *
184
+ * @remarks
185
+ * - LIMITATION: Radius does not support eth_newPendingTransactionFilter
186
+ * - This function may not work as expected on Radius
187
+ * - WebSocket transport with "pendingTransactions" subscription is not supported
188
+ * - Consider using block watching and filtering confirmed transactions instead
189
+ * - This is provided for API completeness but may have limited functionality
190
+ */
191
+ export declare function watchPendingTransactions(client: PublicClient, params: WatchPendingTransactionsParams): () => void;
192
+ //# sourceMappingURL=watchBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wat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