tempo.ts 0.11.1 → 0.12.0

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 (228) hide show
  1. package/CHANGELOG.md +61 -4
  2. package/README.md +3 -34
  3. package/dist/server/Handler.d.ts +14 -14
  4. package/dist/server/Handler.d.ts.map +1 -1
  5. package/dist/server/Handler.js +16 -17
  6. package/dist/server/Handler.js.map +1 -1
  7. package/dist/wagmi/Actions/amm.d.ts +51 -51
  8. package/dist/wagmi/Actions/amm.d.ts.map +1 -1
  9. package/dist/wagmi/Actions/amm.js +37 -37
  10. package/dist/wagmi/Actions/amm.js.map +1 -1
  11. package/dist/wagmi/Actions/dex.d.ts +129 -129
  12. package/dist/wagmi/Actions/dex.d.ts.map +1 -1
  13. package/dist/wagmi/Actions/dex.js +73 -73
  14. package/dist/wagmi/Actions/dex.js.map +1 -1
  15. package/dist/wagmi/Actions/faucet.d.ts +9 -9
  16. package/dist/wagmi/Actions/faucet.d.ts.map +1 -1
  17. package/dist/wagmi/Actions/faucet.js +7 -7
  18. package/dist/wagmi/Actions/faucet.js.map +1 -1
  19. package/dist/wagmi/Actions/fee.d.ts +17 -17
  20. package/dist/wagmi/Actions/fee.d.ts.map +1 -1
  21. package/dist/wagmi/Actions/fee.js +10 -10
  22. package/dist/wagmi/Actions/fee.js.map +1 -1
  23. package/dist/wagmi/Actions/nonce.d.ts +9 -79
  24. package/dist/wagmi/Actions/nonce.d.ts.map +1 -1
  25. package/dist/wagmi/Actions/nonce.js +7 -89
  26. package/dist/wagmi/Actions/nonce.js.map +1 -1
  27. package/dist/wagmi/Actions/policy.d.ts +69 -70
  28. package/dist/wagmi/Actions/policy.d.ts.map +1 -1
  29. package/dist/wagmi/Actions/policy.js +43 -43
  30. package/dist/wagmi/Actions/policy.js.map +1 -1
  31. package/dist/wagmi/Actions/reward.d.ts +51 -51
  32. package/dist/wagmi/Actions/reward.d.ts.map +1 -1
  33. package/dist/wagmi/Actions/reward.js +31 -31
  34. package/dist/wagmi/Actions/reward.js.map +1 -1
  35. package/dist/wagmi/Actions/token.d.ts +238 -238
  36. package/dist/wagmi/Actions/token.d.ts.map +1 -1
  37. package/dist/wagmi/Actions/token.js +136 -136
  38. package/dist/wagmi/Actions/token.js.map +1 -1
  39. package/dist/wagmi/Connector.d.ts +2 -1
  40. package/dist/wagmi/Connector.d.ts.map +1 -1
  41. package/dist/wagmi/Connector.js +83 -22
  42. package/dist/wagmi/Connector.js.map +1 -1
  43. package/dist/wagmi/Hooks/nonce.d.ts +1 -52
  44. package/dist/wagmi/Hooks/nonce.d.ts.map +1 -1
  45. package/dist/wagmi/Hooks/nonce.js +1 -70
  46. package/dist/wagmi/Hooks/nonce.js.map +1 -1
  47. package/dist/wagmi/Hooks/policy.d.ts +0 -1
  48. package/dist/wagmi/Hooks/policy.d.ts.map +1 -1
  49. package/dist/wagmi/Hooks/policy.js.map +1 -1
  50. package/dist/wagmi/KeyManager.d.ts +6 -3
  51. package/dist/wagmi/KeyManager.d.ts.map +1 -1
  52. package/dist/wagmi/KeyManager.js +9 -4
  53. package/dist/wagmi/KeyManager.js.map +1 -1
  54. package/package.json +2 -12
  55. package/src/server/Handler.test.ts +2 -2
  56. package/src/server/Handler.ts +16 -17
  57. package/src/wagmi/Actions/amm.ts +63 -63
  58. package/src/wagmi/Actions/dex.test.ts +1 -1
  59. package/src/wagmi/Actions/dex.ts +153 -153
  60. package/src/wagmi/Actions/faucet.ts +11 -11
  61. package/src/wagmi/Actions/fee.ts +20 -20
  62. package/src/wagmi/Actions/nonce.test.ts +1 -64
  63. package/src/wagmi/Actions/nonce.ts +10 -142
  64. package/src/wagmi/Actions/policy.ts +83 -85
  65. package/src/wagmi/Actions/reward.ts +64 -61
  66. package/src/wagmi/Actions/token.ts +287 -283
  67. package/src/wagmi/Connector.ts +105 -31
  68. package/src/wagmi/Hooks/dex.test.ts +1 -1
  69. package/src/wagmi/Hooks/fee.test.ts +0 -6
  70. package/src/wagmi/Hooks/nonce.test.ts +1 -66
  71. package/src/wagmi/Hooks/nonce.ts +1 -114
  72. package/src/wagmi/Hooks/policy.ts +0 -2
  73. package/src/wagmi/KeyManager.ts +18 -5
  74. package/dist/chains.d.ts +0 -73
  75. package/dist/chains.d.ts.map +0 -1
  76. package/dist/chains.js +0 -51
  77. package/dist/chains.js.map +0 -1
  78. package/dist/viem/Abis.d.ts +0 -2649
  79. package/dist/viem/Abis.d.ts.map +0 -1
  80. package/dist/viem/Abis.js +0 -1677
  81. package/dist/viem/Abis.js.map +0 -1
  82. package/dist/viem/Account.d.ts +0 -244
  83. package/dist/viem/Account.d.ts.map +0 -1
  84. package/dist/viem/Account.js +0 -382
  85. package/dist/viem/Account.js.map +0 -1
  86. package/dist/viem/Actions/account.d.ts +0 -40
  87. package/dist/viem/Actions/account.d.ts.map +0 -1
  88. package/dist/viem/Actions/account.js +0 -86
  89. package/dist/viem/Actions/account.js.map +0 -1
  90. package/dist/viem/Actions/amm.d.ts +0 -1991
  91. package/dist/viem/Actions/amm.d.ts.map +0 -1
  92. package/dist/viem/Actions/amm.js +0 -814
  93. package/dist/viem/Actions/amm.js.map +0 -1
  94. package/dist/viem/Actions/dex.d.ts +0 -3900
  95. package/dist/viem/Actions/dex.d.ts.map +0 -1
  96. package/dist/viem/Actions/dex.js +0 -1414
  97. package/dist/viem/Actions/dex.js.map +0 -1
  98. package/dist/viem/Actions/faucet.d.ts +0 -69
  99. package/dist/viem/Actions/faucet.d.ts.map +0 -1
  100. package/dist/viem/Actions/faucet.js +0 -73
  101. package/dist/viem/Actions/faucet.js.map +0 -1
  102. package/dist/viem/Actions/fee.d.ts +0 -360
  103. package/dist/viem/Actions/fee.d.ts.map +0 -1
  104. package/dist/viem/Actions/fee.js +0 -237
  105. package/dist/viem/Actions/fee.js.map +0 -1
  106. package/dist/viem/Actions/index.d.ts +0 -10
  107. package/dist/viem/Actions/index.d.ts.map +0 -1
  108. package/dist/viem/Actions/index.js +0 -10
  109. package/dist/viem/Actions/index.js.map +0 -1
  110. package/dist/viem/Actions/nonce.d.ts +0 -257
  111. package/dist/viem/Actions/nonce.d.ts.map +0 -1
  112. package/dist/viem/Actions/nonce.js +0 -228
  113. package/dist/viem/Actions/nonce.js.map +0 -1
  114. package/dist/viem/Actions/policy.d.ts +0 -1680
  115. package/dist/viem/Actions/policy.d.ts.map +0 -1
  116. package/dist/viem/Actions/policy.js +0 -875
  117. package/dist/viem/Actions/policy.js.map +0 -1
  118. package/dist/viem/Actions/reward.d.ts +0 -2422
  119. package/dist/viem/Actions/reward.d.ts.map +0 -1
  120. package/dist/viem/Actions/reward.js +0 -651
  121. package/dist/viem/Actions/reward.js.map +0 -1
  122. package/dist/viem/Actions/token.d.ts +0 -16007
  123. package/dist/viem/Actions/token.d.ts.map +0 -1
  124. package/dist/viem/Actions/token.js +0 -2936
  125. package/dist/viem/Actions/token.js.map +0 -1
  126. package/dist/viem/Addresses.d.ts +0 -9
  127. package/dist/viem/Addresses.d.ts.map +0 -1
  128. package/dist/viem/Addresses.js +0 -9
  129. package/dist/viem/Addresses.js.map +0 -1
  130. package/dist/viem/Chain.d.ts +0 -451
  131. package/dist/viem/Chain.d.ts.map +0 -1
  132. package/dist/viem/Chain.js +0 -96
  133. package/dist/viem/Chain.js.map +0 -1
  134. package/dist/viem/Decorator.d.ts +0 -2783
  135. package/dist/viem/Decorator.d.ts.map +0 -1
  136. package/dist/viem/Decorator.js +0 -137
  137. package/dist/viem/Decorator.js.map +0 -1
  138. package/dist/viem/Formatters.d.ts +0 -10
  139. package/dist/viem/Formatters.d.ts.map +0 -1
  140. package/dist/viem/Formatters.js +0 -104
  141. package/dist/viem/Formatters.js.map +0 -1
  142. package/dist/viem/P256.d.ts +0 -2
  143. package/dist/viem/P256.d.ts.map +0 -1
  144. package/dist/viem/P256.js +0 -2
  145. package/dist/viem/P256.js.map +0 -1
  146. package/dist/viem/Secp256k1.d.ts +0 -2
  147. package/dist/viem/Secp256k1.d.ts.map +0 -1
  148. package/dist/viem/Secp256k1.js +0 -2
  149. package/dist/viem/Secp256k1.js.map +0 -1
  150. package/dist/viem/Storage.d.ts +0 -24
  151. package/dist/viem/Storage.d.ts.map +0 -1
  152. package/dist/viem/Storage.js +0 -68
  153. package/dist/viem/Storage.js.map +0 -1
  154. package/dist/viem/TokenIds.d.ts +0 -2
  155. package/dist/viem/TokenIds.d.ts.map +0 -1
  156. package/dist/viem/TokenIds.js +0 -2
  157. package/dist/viem/TokenIds.js.map +0 -1
  158. package/dist/viem/Transaction.d.ts +0 -76
  159. package/dist/viem/Transaction.d.ts.map +0 -1
  160. package/dist/viem/Transaction.js +0 -176
  161. package/dist/viem/Transaction.js.map +0 -1
  162. package/dist/viem/Transport.d.ts +0 -33
  163. package/dist/viem/Transport.d.ts.map +0 -1
  164. package/dist/viem/Transport.js +0 -138
  165. package/dist/viem/Transport.js.map +0 -1
  166. package/dist/viem/WebAuthnP256.d.ts +0 -82
  167. package/dist/viem/WebAuthnP256.d.ts.map +0 -1
  168. package/dist/viem/WebAuthnP256.js +0 -97
  169. package/dist/viem/WebAuthnP256.js.map +0 -1
  170. package/dist/viem/WebCryptoP256.d.ts +0 -2
  171. package/dist/viem/WebCryptoP256.d.ts.map +0 -1
  172. package/dist/viem/WebCryptoP256.js +0 -2
  173. package/dist/viem/WebCryptoP256.js.map +0 -1
  174. package/dist/viem/index.d.ts +0 -26
  175. package/dist/viem/index.d.ts.map +0 -1
  176. package/dist/viem/index.js +0 -17
  177. package/dist/viem/index.js.map +0 -1
  178. package/dist/viem/internal/types.d.ts +0 -20
  179. package/dist/viem/internal/types.d.ts.map +0 -1
  180. package/dist/viem/internal/types.js +0 -2
  181. package/dist/viem/internal/types.js.map +0 -1
  182. package/dist/viem/internal/utils.d.ts +0 -14
  183. package/dist/viem/internal/utils.d.ts.map +0 -1
  184. package/dist/viem/internal/utils.js +0 -33
  185. package/dist/viem/internal/utils.js.map +0 -1
  186. package/src/chains.ts +0 -54
  187. package/src/viem/Abis.ts +0 -1688
  188. package/src/viem/Account.test.ts +0 -444
  189. package/src/viem/Account.ts +0 -601
  190. package/src/viem/Actions/account.test.ts +0 -414
  191. package/src/viem/Actions/account.ts +0 -106
  192. package/src/viem/Actions/amm.test.ts +0 -381
  193. package/src/viem/Actions/amm.ts +0 -1227
  194. package/src/viem/Actions/dex.test.ts +0 -1549
  195. package/src/viem/Actions/dex.ts +0 -2150
  196. package/src/viem/Actions/faucet.ts +0 -121
  197. package/src/viem/Actions/fee.test.ts +0 -259
  198. package/src/viem/Actions/fee.ts +0 -372
  199. package/src/viem/Actions/index.ts +0 -9
  200. package/src/viem/Actions/nonce.test.ts +0 -206
  201. package/src/viem/Actions/nonce.ts +0 -347
  202. package/src/viem/Actions/policy.test.ts +0 -534
  203. package/src/viem/Actions/policy.ts +0 -1335
  204. package/src/viem/Actions/reward.test.ts +0 -434
  205. package/src/viem/Actions/reward.ts +0 -944
  206. package/src/viem/Actions/token.test.ts +0 -3029
  207. package/src/viem/Actions/token.ts +0 -4458
  208. package/src/viem/Addresses.ts +0 -9
  209. package/src/viem/Chain.bench-d.ts +0 -12
  210. package/src/viem/Chain.test.ts +0 -168
  211. package/src/viem/Chain.ts +0 -157
  212. package/src/viem/Decorator.bench-d.ts +0 -11
  213. package/src/viem/Decorator.test.ts +0 -39
  214. package/src/viem/Decorator.ts +0 -3179
  215. package/src/viem/Formatters.ts +0 -164
  216. package/src/viem/P256.ts +0 -1
  217. package/src/viem/Secp256k1.ts +0 -1
  218. package/src/viem/Storage.ts +0 -110
  219. package/src/viem/TokenIds.ts +0 -1
  220. package/src/viem/Transaction.ts +0 -382
  221. package/src/viem/Transport.ts +0 -191
  222. package/src/viem/WebAuthnP256.ts +0 -146
  223. package/src/viem/WebCryptoP256.ts +0 -1
  224. package/src/viem/e2e.test.ts +0 -1602
  225. package/src/viem/index.ts +0 -30
  226. package/src/viem/internal/types.ts +0 -69
  227. package/src/viem/internal/utils.ts +0 -58
  228. package/src/wagmi/internal/types.ts +0 -16
package/src/viem/Abis.ts DELETED
@@ -1,1688 +0,0 @@
1
- // Generated with `pnpm gen:abis`. Do not modify manually.
2
-
3
- export const accountKeychain = [
4
- {
5
- name: 'authorizeKey',
6
- type: 'function',
7
- stateMutability: 'nonpayable',
8
- inputs: [
9
- { type: 'address', name: 'keyId' },
10
- { type: 'uint8', name: 'signatureType' },
11
- { type: 'uint64', name: 'expiry' },
12
- { type: 'bool', name: 'enforceLimits' },
13
- {
14
- type: 'tuple[]',
15
- name: 'limits',
16
- components: [
17
- { type: 'address', name: 'token' },
18
- { type: 'uint256', name: 'amount' },
19
- ],
20
- },
21
- ],
22
- outputs: [],
23
- },
24
- {
25
- name: 'revokeKey',
26
- type: 'function',
27
- stateMutability: 'nonpayable',
28
- inputs: [{ type: 'address', name: 'keyId' }],
29
- outputs: [],
30
- },
31
- {
32
- name: 'updateSpendingLimit',
33
- type: 'function',
34
- stateMutability: 'nonpayable',
35
- inputs: [
36
- { type: 'address', name: 'keyId' },
37
- { type: 'address', name: 'token' },
38
- { type: 'uint256', name: 'newLimit' },
39
- ],
40
- outputs: [],
41
- },
42
- {
43
- name: 'getKey',
44
- type: 'function',
45
- stateMutability: 'view',
46
- inputs: [
47
- { type: 'address', name: 'account' },
48
- { type: 'address', name: 'keyId' },
49
- ],
50
- outputs: [
51
- {
52
- type: 'tuple',
53
- components: [
54
- { type: 'uint8', name: 'signatureType' },
55
- { type: 'address', name: 'keyId' },
56
- { type: 'uint64', name: 'expiry' },
57
- { type: 'bool', name: 'enforceLimits' },
58
- { type: 'bool', name: 'isRevoked' },
59
- ],
60
- },
61
- ],
62
- },
63
- {
64
- name: 'getRemainingLimit',
65
- type: 'function',
66
- stateMutability: 'view',
67
- inputs: [
68
- { type: 'address', name: 'account' },
69
- { type: 'address', name: 'keyId' },
70
- { type: 'address', name: 'token' },
71
- ],
72
- outputs: [{ type: 'uint256' }],
73
- },
74
- {
75
- name: 'getTransactionKey',
76
- type: 'function',
77
- stateMutability: 'view',
78
- inputs: [],
79
- outputs: [{ type: 'address' }],
80
- },
81
- {
82
- name: 'KeyAuthorized',
83
- type: 'event',
84
- inputs: [
85
- { type: 'address', name: 'account', indexed: true },
86
- { type: 'bytes32', name: 'publicKey', indexed: true },
87
- { type: 'uint8', name: 'signatureType' },
88
- { type: 'uint64', name: 'expiry' },
89
- ],
90
- },
91
- {
92
- name: 'KeyRevoked',
93
- type: 'event',
94
- inputs: [
95
- { type: 'address', name: 'account', indexed: true },
96
- { type: 'bytes32', name: 'publicKey', indexed: true },
97
- ],
98
- },
99
- {
100
- name: 'SpendingLimitUpdated',
101
- type: 'event',
102
- inputs: [
103
- { type: 'address', name: 'account', indexed: true },
104
- { type: 'bytes32', name: 'publicKey', indexed: true },
105
- { type: 'address', name: 'token', indexed: true },
106
- { type: 'uint256', name: 'newLimit' },
107
- ],
108
- },
109
- { name: 'UnauthorizedCaller', type: 'error', inputs: [] },
110
- { name: 'KeyAlreadyExists', type: 'error', inputs: [] },
111
- { name: 'KeyNotFound', type: 'error', inputs: [] },
112
- { name: 'KeyExpired', type: 'error', inputs: [] },
113
- { name: 'SpendingLimitExceeded', type: 'error', inputs: [] },
114
- { name: 'InvalidSignatureType', type: 'error', inputs: [] },
115
- { name: 'ZeroPublicKey', type: 'error', inputs: [] },
116
- { name: 'ExpiryInPast', type: 'error', inputs: [] },
117
- { name: 'KeyAlreadyRevoked', type: 'error', inputs: [] },
118
- ] as const
119
-
120
- export const nonce = [
121
- {
122
- name: 'getNonce',
123
- type: 'function',
124
- stateMutability: 'view',
125
- inputs: [
126
- { type: 'address', name: 'account' },
127
- { type: 'uint256', name: 'nonceKey' },
128
- ],
129
- outputs: [{ type: 'uint64', name: 'nonce' }],
130
- },
131
- {
132
- name: 'getActiveNonceKeyCount',
133
- type: 'function',
134
- stateMutability: 'view',
135
- inputs: [{ type: 'address', name: 'account' }],
136
- outputs: [{ type: 'uint256', name: 'count' }],
137
- },
138
- {
139
- name: 'NonceIncremented',
140
- type: 'event',
141
- inputs: [
142
- { type: 'address', name: 'account', indexed: true },
143
- { type: 'uint256', name: 'nonceKey', indexed: true },
144
- { type: 'uint64', name: 'newNonce' },
145
- ],
146
- },
147
- {
148
- name: 'ActiveKeyCountChanged',
149
- type: 'event',
150
- inputs: [
151
- { type: 'address', name: 'account', indexed: true },
152
- { type: 'uint256', name: 'newCount' },
153
- ],
154
- },
155
- { name: 'ProtocolNonceNotSupported', type: 'error', inputs: [] },
156
- { name: 'InvalidNonceKey', type: 'error', inputs: [] },
157
- { name: 'NonceOverflow', type: 'error', inputs: [] },
158
- ] as const
159
-
160
- export const pathUsd = [
161
- {
162
- name: 'TRANSFER_ROLE',
163
- type: 'function',
164
- stateMutability: 'view',
165
- inputs: [],
166
- outputs: [{ type: 'bytes32' }],
167
- },
168
- {
169
- name: 'RECEIVE_WITH_MEMO_ROLE',
170
- type: 'function',
171
- stateMutability: 'view',
172
- inputs: [],
173
- outputs: [{ type: 'bytes32' }],
174
- },
175
- ] as const
176
-
177
- export const stablecoinExchange = [
178
- {
179
- name: 'createPair',
180
- type: 'function',
181
- stateMutability: 'nonpayable',
182
- inputs: [{ type: 'address', name: 'base' }],
183
- outputs: [{ type: 'bytes32', name: 'key' }],
184
- },
185
- {
186
- name: 'place',
187
- type: 'function',
188
- stateMutability: 'nonpayable',
189
- inputs: [
190
- { type: 'address', name: 'token' },
191
- { type: 'uint128', name: 'amount' },
192
- { type: 'bool', name: 'isBid' },
193
- { type: 'int16', name: 'tick' },
194
- ],
195
- outputs: [{ type: 'uint128', name: 'orderId' }],
196
- },
197
- {
198
- name: 'placeFlip',
199
- type: 'function',
200
- stateMutability: 'nonpayable',
201
- inputs: [
202
- { type: 'address', name: 'token' },
203
- { type: 'uint128', name: 'amount' },
204
- { type: 'bool', name: 'isBid' },
205
- { type: 'int16', name: 'tick' },
206
- { type: 'int16', name: 'flipTick' },
207
- ],
208
- outputs: [{ type: 'uint128', name: 'orderId' }],
209
- },
210
- {
211
- name: 'cancel',
212
- type: 'function',
213
- stateMutability: 'nonpayable',
214
- inputs: [{ type: 'uint128', name: 'orderId' }],
215
- outputs: [],
216
- },
217
- {
218
- name: 'executeBlock',
219
- type: 'function',
220
- stateMutability: 'nonpayable',
221
- inputs: [],
222
- outputs: [],
223
- },
224
- {
225
- name: 'swapExactAmountIn',
226
- type: 'function',
227
- stateMutability: 'nonpayable',
228
- inputs: [
229
- { type: 'address', name: 'tokenIn' },
230
- { type: 'address', name: 'tokenOut' },
231
- { type: 'uint128', name: 'amountIn' },
232
- { type: 'uint128', name: 'minAmountOut' },
233
- ],
234
- outputs: [{ type: 'uint128', name: 'amountOut' }],
235
- },
236
- {
237
- name: 'swapExactAmountOut',
238
- type: 'function',
239
- stateMutability: 'nonpayable',
240
- inputs: [
241
- { type: 'address', name: 'tokenIn' },
242
- { type: 'address', name: 'tokenOut' },
243
- { type: 'uint128', name: 'amountOut' },
244
- { type: 'uint128', name: 'maxAmountIn' },
245
- ],
246
- outputs: [{ type: 'uint128', name: 'amountIn' }],
247
- },
248
- {
249
- name: 'quoteSwapExactAmountIn',
250
- type: 'function',
251
- stateMutability: 'view',
252
- inputs: [
253
- { type: 'address', name: 'tokenIn' },
254
- { type: 'address', name: 'tokenOut' },
255
- { type: 'uint128', name: 'amountIn' },
256
- ],
257
- outputs: [{ type: 'uint128', name: 'amountOut' }],
258
- },
259
- {
260
- name: 'quoteSwapExactAmountOut',
261
- type: 'function',
262
- stateMutability: 'view',
263
- inputs: [
264
- { type: 'address', name: 'tokenIn' },
265
- { type: 'address', name: 'tokenOut' },
266
- { type: 'uint128', name: 'amountOut' },
267
- ],
268
- outputs: [{ type: 'uint128', name: 'amountIn' }],
269
- },
270
- {
271
- name: 'balanceOf',
272
- type: 'function',
273
- stateMutability: 'view',
274
- inputs: [
275
- { type: 'address', name: 'user' },
276
- { type: 'address', name: 'token' },
277
- ],
278
- outputs: [{ type: 'uint128' }],
279
- },
280
- {
281
- name: 'withdraw',
282
- type: 'function',
283
- stateMutability: 'nonpayable',
284
- inputs: [
285
- { type: 'address', name: 'token' },
286
- { type: 'uint128', name: 'amount' },
287
- ],
288
- outputs: [],
289
- },
290
- {
291
- name: 'getOrder',
292
- type: 'function',
293
- stateMutability: 'view',
294
- inputs: [{ type: 'uint128', name: 'orderId' }],
295
- outputs: [
296
- {
297
- type: 'tuple',
298
- components: [
299
- { type: 'uint128', name: 'orderId' },
300
- { type: 'address', name: 'maker' },
301
- { type: 'bytes32', name: 'bookKey' },
302
- { type: 'bool', name: 'isBid' },
303
- { type: 'int16', name: 'tick' },
304
- { type: 'uint128', name: 'amount' },
305
- { type: 'uint128', name: 'remaining' },
306
- { type: 'uint128', name: 'prev' },
307
- { type: 'uint128', name: 'next' },
308
- { type: 'bool', name: 'isFlip' },
309
- { type: 'int16', name: 'flipTick' },
310
- ],
311
- },
312
- ],
313
- },
314
- {
315
- name: 'getTickLevel',
316
- type: 'function',
317
- stateMutability: 'view',
318
- inputs: [
319
- { type: 'address', name: 'base' },
320
- { type: 'int16', name: 'tick' },
321
- { type: 'bool', name: 'isBid' },
322
- ],
323
- outputs: [
324
- { type: 'uint128', name: 'head' },
325
- { type: 'uint128', name: 'tail' },
326
- { type: 'uint128', name: 'totalLiquidity' },
327
- ],
328
- },
329
- {
330
- name: 'pairKey',
331
- type: 'function',
332
- stateMutability: 'pure',
333
- inputs: [
334
- { type: 'address', name: 'tokenA' },
335
- { type: 'address', name: 'tokenB' },
336
- ],
337
- outputs: [{ type: 'bytes32' }],
338
- },
339
- {
340
- name: 'activeOrderId',
341
- type: 'function',
342
- stateMutability: 'view',
343
- inputs: [],
344
- outputs: [{ type: 'uint128' }],
345
- },
346
- {
347
- name: 'pendingOrderId',
348
- type: 'function',
349
- stateMutability: 'view',
350
- inputs: [],
351
- outputs: [{ type: 'uint128' }],
352
- },
353
- {
354
- name: 'books',
355
- type: 'function',
356
- stateMutability: 'view',
357
- inputs: [{ type: 'bytes32', name: 'pairKey' }],
358
- outputs: [
359
- {
360
- type: 'tuple',
361
- components: [
362
- { type: 'address', name: 'base' },
363
- { type: 'address', name: 'quote' },
364
- { type: 'int16', name: 'bestBidTick' },
365
- { type: 'int16', name: 'bestAskTick' },
366
- ],
367
- },
368
- ],
369
- },
370
- {
371
- name: 'MIN_TICK',
372
- type: 'function',
373
- stateMutability: 'pure',
374
- inputs: [],
375
- outputs: [{ type: 'int16' }],
376
- },
377
- {
378
- name: 'MAX_TICK',
379
- type: 'function',
380
- stateMutability: 'pure',
381
- inputs: [],
382
- outputs: [{ type: 'int16' }],
383
- },
384
- {
385
- name: 'TICK_SPACING',
386
- type: 'function',
387
- stateMutability: 'pure',
388
- inputs: [],
389
- outputs: [{ type: 'int16' }],
390
- },
391
- {
392
- name: 'PRICE_SCALE',
393
- type: 'function',
394
- stateMutability: 'pure',
395
- inputs: [],
396
- outputs: [{ type: 'uint32' }],
397
- },
398
- {
399
- name: 'MIN_PRICE',
400
- type: 'function',
401
- stateMutability: 'pure',
402
- inputs: [],
403
- outputs: [{ type: 'uint32' }],
404
- },
405
- {
406
- name: 'MAX_PRICE',
407
- type: 'function',
408
- stateMutability: 'pure',
409
- inputs: [],
410
- outputs: [{ type: 'uint32' }],
411
- },
412
- {
413
- name: 'tickToPrice',
414
- type: 'function',
415
- stateMutability: 'pure',
416
- inputs: [{ type: 'int16', name: 'tick' }],
417
- outputs: [{ type: 'uint32', name: 'price' }],
418
- },
419
- {
420
- name: 'priceToTick',
421
- type: 'function',
422
- stateMutability: 'pure',
423
- inputs: [{ type: 'uint32', name: 'price' }],
424
- outputs: [{ type: 'int16', name: 'tick' }],
425
- },
426
- {
427
- name: 'PairCreated',
428
- type: 'event',
429
- inputs: [
430
- { type: 'bytes32', name: 'key', indexed: true },
431
- { type: 'address', name: 'base', indexed: true },
432
- { type: 'address', name: 'quote', indexed: true },
433
- ],
434
- },
435
- {
436
- name: 'OrderPlaced',
437
- type: 'event',
438
- inputs: [
439
- { type: 'uint128', name: 'orderId', indexed: true },
440
- { type: 'address', name: 'maker', indexed: true },
441
- { type: 'address', name: 'token', indexed: true },
442
- { type: 'uint128', name: 'amount' },
443
- { type: 'bool', name: 'isBid' },
444
- { type: 'int16', name: 'tick' },
445
- ],
446
- },
447
- {
448
- name: 'FlipOrderPlaced',
449
- type: 'event',
450
- inputs: [
451
- { type: 'uint128', name: 'orderId', indexed: true },
452
- { type: 'address', name: 'maker', indexed: true },
453
- { type: 'address', name: 'token', indexed: true },
454
- { type: 'uint128', name: 'amount' },
455
- { type: 'bool', name: 'isBid' },
456
- { type: 'int16', name: 'tick' },
457
- { type: 'int16', name: 'flipTick' },
458
- ],
459
- },
460
- {
461
- name: 'OrderFilled',
462
- type: 'event',
463
- inputs: [
464
- { type: 'uint128', name: 'orderId', indexed: true },
465
- { type: 'address', name: 'maker', indexed: true },
466
- { type: 'uint128', name: 'amountFilled' },
467
- { type: 'bool', name: 'partialFill' },
468
- ],
469
- },
470
- {
471
- name: 'OrderFilled',
472
- type: 'event',
473
- inputs: [
474
- { type: 'uint128', name: 'orderId', indexed: true },
475
- { type: 'address', name: 'maker', indexed: true },
476
- { type: 'address', name: 'taker', indexed: true },
477
- { type: 'uint128', name: 'amountFilled' },
478
- { type: 'bool', name: 'partialFill' },
479
- ],
480
- },
481
- {
482
- name: 'OrderCancelled',
483
- type: 'event',
484
- inputs: [{ type: 'uint128', name: 'orderId', indexed: true }],
485
- },
486
- { name: 'Unauthorized', type: 'error', inputs: [] },
487
- { name: 'PairDoesNotExist', type: 'error', inputs: [] },
488
- { name: 'PairAlreadyExists', type: 'error', inputs: [] },
489
- { name: 'OrderDoesNotExist', type: 'error', inputs: [] },
490
- { name: 'IdenticalTokens', type: 'error', inputs: [] },
491
- { name: 'InvalidToken', type: 'error', inputs: [] },
492
- {
493
- name: 'TickOutOfBounds',
494
- type: 'error',
495
- inputs: [{ type: 'int16', name: 'tick' }],
496
- },
497
- { name: 'InvalidTick', type: 'error', inputs: [] },
498
- { name: 'InvalidFlipTick', type: 'error', inputs: [] },
499
- { name: 'InsufficientBalance', type: 'error', inputs: [] },
500
- { name: 'InsufficientLiquidity', type: 'error', inputs: [] },
501
- { name: 'InsufficientOutput', type: 'error', inputs: [] },
502
- { name: 'MaxInputExceeded', type: 'error', inputs: [] },
503
- {
504
- name: 'BelowMinimumOrderSize',
505
- type: 'error',
506
- inputs: [{ type: 'uint128', name: 'amount' }],
507
- },
508
- { name: 'InvalidBaseToken', type: 'error', inputs: [] },
509
- ] as const
510
-
511
- export const tip20 = [
512
- {
513
- name: 'name',
514
- type: 'function',
515
- stateMutability: 'view',
516
- inputs: [],
517
- outputs: [{ type: 'string' }],
518
- },
519
- {
520
- name: 'symbol',
521
- type: 'function',
522
- stateMutability: 'view',
523
- inputs: [],
524
- outputs: [{ type: 'string' }],
525
- },
526
- {
527
- name: 'decimals',
528
- type: 'function',
529
- stateMutability: 'view',
530
- inputs: [],
531
- outputs: [{ type: 'uint8' }],
532
- },
533
- {
534
- name: 'totalSupply',
535
- type: 'function',
536
- stateMutability: 'view',
537
- inputs: [],
538
- outputs: [{ type: 'uint256' }],
539
- },
540
- {
541
- name: 'quoteToken',
542
- type: 'function',
543
- stateMutability: 'view',
544
- inputs: [],
545
- outputs: [{ type: 'address' }],
546
- },
547
- {
548
- name: 'nextQuoteToken',
549
- type: 'function',
550
- stateMutability: 'view',
551
- inputs: [],
552
- outputs: [{ type: 'address' }],
553
- },
554
- {
555
- name: 'balanceOf',
556
- type: 'function',
557
- stateMutability: 'view',
558
- inputs: [{ type: 'address', name: 'account' }],
559
- outputs: [{ type: 'uint256' }],
560
- },
561
- {
562
- name: 'transfer',
563
- type: 'function',
564
- stateMutability: 'nonpayable',
565
- inputs: [
566
- { type: 'address', name: 'to' },
567
- { type: 'uint256', name: 'amount' },
568
- ],
569
- outputs: [{ type: 'bool' }],
570
- },
571
- {
572
- name: 'approve',
573
- type: 'function',
574
- stateMutability: 'nonpayable',
575
- inputs: [
576
- { type: 'address', name: 'spender' },
577
- { type: 'uint256', name: 'amount' },
578
- ],
579
- outputs: [{ type: 'bool' }],
580
- },
581
- {
582
- name: 'allowance',
583
- type: 'function',
584
- stateMutability: 'view',
585
- inputs: [
586
- { type: 'address', name: 'owner' },
587
- { type: 'address', name: 'spender' },
588
- ],
589
- outputs: [{ type: 'uint256' }],
590
- },
591
- {
592
- name: 'transferFrom',
593
- type: 'function',
594
- stateMutability: 'nonpayable',
595
- inputs: [
596
- { type: 'address', name: 'from' },
597
- { type: 'address', name: 'to' },
598
- { type: 'uint256', name: 'amount' },
599
- ],
600
- outputs: [{ type: 'bool' }],
601
- },
602
- {
603
- name: 'mint',
604
- type: 'function',
605
- stateMutability: 'nonpayable',
606
- inputs: [
607
- { type: 'address', name: 'to' },
608
- { type: 'uint256', name: 'amount' },
609
- ],
610
- outputs: [],
611
- },
612
- {
613
- name: 'burn',
614
- type: 'function',
615
- stateMutability: 'nonpayable',
616
- inputs: [{ type: 'uint256', name: 'amount' }],
617
- outputs: [],
618
- },
619
- {
620
- name: 'currency',
621
- type: 'function',
622
- stateMutability: 'view',
623
- inputs: [],
624
- outputs: [{ type: 'string' }],
625
- },
626
- {
627
- name: 'supplyCap',
628
- type: 'function',
629
- stateMutability: 'view',
630
- inputs: [],
631
- outputs: [{ type: 'uint256' }],
632
- },
633
- {
634
- name: 'paused',
635
- type: 'function',
636
- stateMutability: 'view',
637
- inputs: [],
638
- outputs: [{ type: 'bool' }],
639
- },
640
- {
641
- name: 'transferPolicyId',
642
- type: 'function',
643
- stateMutability: 'view',
644
- inputs: [],
645
- outputs: [{ type: 'uint64' }],
646
- },
647
- {
648
- name: 'burnBlocked',
649
- type: 'function',
650
- stateMutability: 'nonpayable',
651
- inputs: [
652
- { type: 'address', name: 'from' },
653
- { type: 'uint256', name: 'amount' },
654
- ],
655
- outputs: [],
656
- },
657
- {
658
- name: 'mintWithMemo',
659
- type: 'function',
660
- stateMutability: 'nonpayable',
661
- inputs: [
662
- { type: 'address', name: 'to' },
663
- { type: 'uint256', name: 'amount' },
664
- { type: 'bytes32', name: 'memo' },
665
- ],
666
- outputs: [],
667
- },
668
- {
669
- name: 'burnWithMemo',
670
- type: 'function',
671
- stateMutability: 'nonpayable',
672
- inputs: [
673
- { type: 'uint256', name: 'amount' },
674
- { type: 'bytes32', name: 'memo' },
675
- ],
676
- outputs: [],
677
- },
678
- {
679
- name: 'transferWithMemo',
680
- type: 'function',
681
- stateMutability: 'nonpayable',
682
- inputs: [
683
- { type: 'address', name: 'to' },
684
- { type: 'uint256', name: 'amount' },
685
- { type: 'bytes32', name: 'memo' },
686
- ],
687
- outputs: [],
688
- },
689
- {
690
- name: 'transferFromWithMemo',
691
- type: 'function',
692
- stateMutability: 'nonpayable',
693
- inputs: [
694
- { type: 'address', name: 'from' },
695
- { type: 'address', name: 'to' },
696
- { type: 'uint256', name: 'amount' },
697
- { type: 'bytes32', name: 'memo' },
698
- ],
699
- outputs: [{ type: 'bool' }],
700
- },
701
- {
702
- name: 'feeRecipient',
703
- type: 'function',
704
- stateMutability: 'view',
705
- inputs: [],
706
- outputs: [{ type: 'address' }],
707
- },
708
- {
709
- name: 'setFeeRecipient',
710
- type: 'function',
711
- stateMutability: 'view',
712
- inputs: [{ type: 'address', name: 'newRecipient' }],
713
- outputs: [{ type: 'address' }],
714
- },
715
- {
716
- name: 'changeTransferPolicyId',
717
- type: 'function',
718
- stateMutability: 'nonpayable',
719
- inputs: [{ type: 'uint64', name: 'newPolicyId' }],
720
- outputs: [],
721
- },
722
- {
723
- name: 'setSupplyCap',
724
- type: 'function',
725
- stateMutability: 'nonpayable',
726
- inputs: [{ type: 'uint256', name: 'newSupplyCap' }],
727
- outputs: [],
728
- },
729
- {
730
- name: 'pause',
731
- type: 'function',
732
- stateMutability: 'nonpayable',
733
- inputs: [],
734
- outputs: [],
735
- },
736
- {
737
- name: 'unpause',
738
- type: 'function',
739
- stateMutability: 'nonpayable',
740
- inputs: [],
741
- outputs: [],
742
- },
743
- {
744
- name: 'setNextQuoteToken',
745
- type: 'function',
746
- stateMutability: 'nonpayable',
747
- inputs: [{ type: 'address', name: 'newQuoteToken' }],
748
- outputs: [],
749
- },
750
- {
751
- name: 'completeQuoteTokenUpdate',
752
- type: 'function',
753
- stateMutability: 'nonpayable',
754
- inputs: [],
755
- outputs: [],
756
- },
757
- {
758
- name: 'PAUSE_ROLE',
759
- type: 'function',
760
- stateMutability: 'view',
761
- inputs: [],
762
- outputs: [{ type: 'bytes32' }],
763
- },
764
- {
765
- name: 'UNPAUSE_ROLE',
766
- type: 'function',
767
- stateMutability: 'view',
768
- inputs: [],
769
- outputs: [{ type: 'bytes32' }],
770
- },
771
- {
772
- name: 'ISSUER_ROLE',
773
- type: 'function',
774
- stateMutability: 'view',
775
- inputs: [],
776
- outputs: [{ type: 'bytes32' }],
777
- },
778
- {
779
- name: 'BURN_BLOCKED_ROLE',
780
- type: 'function',
781
- stateMutability: 'view',
782
- inputs: [],
783
- outputs: [{ type: 'bytes32' }],
784
- },
785
- {
786
- name: 'startReward',
787
- type: 'function',
788
- stateMutability: 'nonpayable',
789
- inputs: [
790
- { type: 'uint256', name: 'amount' },
791
- { type: 'uint32', name: 'secs' },
792
- ],
793
- outputs: [{ type: 'uint64' }],
794
- },
795
- {
796
- name: 'setRewardRecipient',
797
- type: 'function',
798
- stateMutability: 'nonpayable',
799
- inputs: [{ type: 'address', name: 'recipient' }],
800
- outputs: [],
801
- },
802
- {
803
- name: 'cancelReward',
804
- type: 'function',
805
- stateMutability: 'nonpayable',
806
- inputs: [{ type: 'uint64', name: 'id' }],
807
- outputs: [{ type: 'uint256' }],
808
- },
809
- {
810
- name: 'claimRewards',
811
- type: 'function',
812
- stateMutability: 'nonpayable',
813
- inputs: [],
814
- outputs: [{ type: 'uint256' }],
815
- },
816
- {
817
- name: 'finalizeStreams',
818
- type: 'function',
819
- stateMutability: 'nonpayable',
820
- inputs: [{ type: 'uint64', name: 'timestamp' }],
821
- outputs: [],
822
- },
823
- {
824
- name: 'getStream',
825
- type: 'function',
826
- stateMutability: 'view',
827
- inputs: [{ type: 'uint64', name: 'id' }],
828
- outputs: [
829
- {
830
- type: 'tuple',
831
- components: [
832
- { type: 'address', name: 'funder' },
833
- { type: 'uint64', name: 'startTime' },
834
- { type: 'uint64', name: 'endTime' },
835
- { type: 'uint256', name: 'ratePerSecondScaled' },
836
- { type: 'uint256', name: 'amountTotal' },
837
- ],
838
- },
839
- ],
840
- },
841
- {
842
- name: 'totalRewardPerSecond',
843
- type: 'function',
844
- stateMutability: 'view',
845
- inputs: [],
846
- outputs: [{ type: 'uint256' }],
847
- },
848
- {
849
- name: 'optedInSupply',
850
- type: 'function',
851
- stateMutability: 'view',
852
- inputs: [],
853
- outputs: [{ type: 'uint128' }],
854
- },
855
- {
856
- name: 'nextStreamId',
857
- type: 'function',
858
- stateMutability: 'view',
859
- inputs: [],
860
- outputs: [{ type: 'uint64' }],
861
- },
862
- {
863
- name: 'userRewardInfo',
864
- type: 'function',
865
- stateMutability: 'view',
866
- inputs: [{ type: 'address', name: 'account' }],
867
- outputs: [
868
- {
869
- type: 'tuple',
870
- components: [
871
- { type: 'address', name: 'rewardRecipient' },
872
- { type: 'uint256', name: 'rewardPerToken' },
873
- { type: 'uint256', name: 'rewardBalance' },
874
- ],
875
- },
876
- ],
877
- },
878
- {
879
- name: 'Transfer',
880
- type: 'event',
881
- inputs: [
882
- { type: 'address', name: 'from', indexed: true },
883
- { type: 'address', name: 'to', indexed: true },
884
- { type: 'uint256', name: 'amount' },
885
- ],
886
- },
887
- {
888
- name: 'Approval',
889
- type: 'event',
890
- inputs: [
891
- { type: 'address', name: 'owner', indexed: true },
892
- { type: 'address', name: 'spender', indexed: true },
893
- { type: 'uint256', name: 'amount' },
894
- ],
895
- },
896
- {
897
- name: 'Mint',
898
- type: 'event',
899
- inputs: [
900
- { type: 'address', name: 'to', indexed: true },
901
- { type: 'uint256', name: 'amount' },
902
- ],
903
- },
904
- {
905
- name: 'Burn',
906
- type: 'event',
907
- inputs: [
908
- { type: 'address', name: 'from', indexed: true },
909
- { type: 'uint256', name: 'amount' },
910
- ],
911
- },
912
- {
913
- name: 'BurnBlocked',
914
- type: 'event',
915
- inputs: [
916
- { type: 'address', name: 'from', indexed: true },
917
- { type: 'uint256', name: 'amount' },
918
- ],
919
- },
920
- {
921
- name: 'TransferWithMemo',
922
- type: 'event',
923
- inputs: [
924
- { type: 'address', name: 'from', indexed: true },
925
- { type: 'address', name: 'to', indexed: true },
926
- { type: 'uint256', name: 'amount' },
927
- { type: 'bytes32', name: 'memo', indexed: true },
928
- ],
929
- },
930
- {
931
- name: 'TransferPolicyUpdate',
932
- type: 'event',
933
- inputs: [
934
- { type: 'address', name: 'updater', indexed: true },
935
- { type: 'uint64', name: 'newPolicyId', indexed: true },
936
- ],
937
- },
938
- {
939
- name: 'SupplyCapUpdate',
940
- type: 'event',
941
- inputs: [
942
- { type: 'address', name: 'updater', indexed: true },
943
- { type: 'uint256', name: 'newSupplyCap', indexed: true },
944
- ],
945
- },
946
- {
947
- name: 'PauseStateUpdate',
948
- type: 'event',
949
- inputs: [
950
- { type: 'address', name: 'updater', indexed: true },
951
- { type: 'bool', name: 'isPaused' },
952
- ],
953
- },
954
- {
955
- name: 'NextQuoteTokenSet',
956
- type: 'event',
957
- inputs: [
958
- { type: 'address', name: 'updater', indexed: true },
959
- { type: 'address', name: 'nextQuoteToken', indexed: true },
960
- ],
961
- },
962
- {
963
- name: 'QuoteTokenUpdate',
964
- type: 'event',
965
- inputs: [
966
- { type: 'address', name: 'updater', indexed: true },
967
- { type: 'address', name: 'newQuoteToken', indexed: true },
968
- ],
969
- },
970
- {
971
- name: 'RewardScheduled',
972
- type: 'event',
973
- inputs: [
974
- { type: 'address', name: 'funder', indexed: true },
975
- { type: 'uint64', name: 'id', indexed: true },
976
- { type: 'uint256', name: 'amount' },
977
- { type: 'uint32', name: 'durationSeconds' },
978
- ],
979
- },
980
- {
981
- name: 'RewardCanceled',
982
- type: 'event',
983
- inputs: [
984
- { type: 'address', name: 'funder', indexed: true },
985
- { type: 'uint64', name: 'id', indexed: true },
986
- { type: 'uint256', name: 'refund' },
987
- ],
988
- },
989
- {
990
- name: 'RewardRecipientSet',
991
- type: 'event',
992
- inputs: [
993
- { type: 'address', name: 'holder', indexed: true },
994
- { type: 'address', name: 'recipient', indexed: true },
995
- ],
996
- },
997
- {
998
- name: 'FeeRecipientUpdated',
999
- type: 'event',
1000
- inputs: [
1001
- { type: 'address', name: 'updater', indexed: true },
1002
- { type: 'address', name: 'newRecipient', indexed: true },
1003
- ],
1004
- },
1005
- {
1006
- name: 'InsufficientBalance',
1007
- type: 'error',
1008
- inputs: [
1009
- { type: 'uint256', name: 'available' },
1010
- { type: 'uint256', name: 'required' },
1011
- { type: 'address', name: 'token' },
1012
- ],
1013
- },
1014
- { name: 'InsufficientAllowance', type: 'error', inputs: [] },
1015
- { name: 'SupplyCapExceeded', type: 'error', inputs: [] },
1016
- { name: 'InvalidSupplyCap', type: 'error', inputs: [] },
1017
- { name: 'InvalidPayload', type: 'error', inputs: [] },
1018
- { name: 'StringTooLong', type: 'error', inputs: [] },
1019
- { name: 'PolicyForbids', type: 'error', inputs: [] },
1020
- { name: 'InvalidRecipient', type: 'error', inputs: [] },
1021
- { name: 'ContractPaused', type: 'error', inputs: [] },
1022
- { name: 'InvalidCurrency', type: 'error', inputs: [] },
1023
- { name: 'InvalidQuoteToken', type: 'error', inputs: [] },
1024
- { name: 'TransfersDisabled', type: 'error', inputs: [] },
1025
- { name: 'InvalidAmount', type: 'error', inputs: [] },
1026
- { name: 'NotStreamFunder', type: 'error', inputs: [] },
1027
- { name: 'StreamInactive', type: 'error', inputs: [] },
1028
- { name: 'NoOptedInSupply', type: 'error', inputs: [] },
1029
- { name: 'Unauthorized', type: 'error', inputs: [] },
1030
- { name: 'RewardsDisabled', type: 'error', inputs: [] },
1031
- { name: 'ScheduledRewardsDisabled', type: 'error', inputs: [] },
1032
- { name: 'ProtectedAddress', type: 'error', inputs: [] },
1033
- {
1034
- name: 'hasRole',
1035
- type: 'function',
1036
- stateMutability: 'view',
1037
- inputs: [
1038
- { type: 'address', name: 'account' },
1039
- { type: 'bytes32', name: 'role' },
1040
- ],
1041
- outputs: [{ type: 'bool' }],
1042
- },
1043
- {
1044
- name: 'getRoleAdmin',
1045
- type: 'function',
1046
- stateMutability: 'view',
1047
- inputs: [{ type: 'bytes32', name: 'role' }],
1048
- outputs: [{ type: 'bytes32' }],
1049
- },
1050
- {
1051
- name: 'grantRole',
1052
- type: 'function',
1053
- stateMutability: 'nonpayable',
1054
- inputs: [
1055
- { type: 'bytes32', name: 'role' },
1056
- { type: 'address', name: 'account' },
1057
- ],
1058
- outputs: [],
1059
- },
1060
- {
1061
- name: 'revokeRole',
1062
- type: 'function',
1063
- stateMutability: 'nonpayable',
1064
- inputs: [
1065
- { type: 'bytes32', name: 'role' },
1066
- { type: 'address', name: 'account' },
1067
- ],
1068
- outputs: [],
1069
- },
1070
- {
1071
- name: 'renounceRole',
1072
- type: 'function',
1073
- stateMutability: 'nonpayable',
1074
- inputs: [{ type: 'bytes32', name: 'role' }],
1075
- outputs: [],
1076
- },
1077
- {
1078
- name: 'setRoleAdmin',
1079
- type: 'function',
1080
- stateMutability: 'nonpayable',
1081
- inputs: [
1082
- { type: 'bytes32', name: 'role' },
1083
- { type: 'bytes32', name: 'adminRole' },
1084
- ],
1085
- outputs: [],
1086
- },
1087
- {
1088
- name: 'RoleMembershipUpdated',
1089
- type: 'event',
1090
- inputs: [
1091
- { type: 'bytes32', name: 'role', indexed: true },
1092
- { type: 'address', name: 'account', indexed: true },
1093
- { type: 'address', name: 'sender', indexed: true },
1094
- { type: 'bool', name: 'hasRole' },
1095
- ],
1096
- },
1097
- {
1098
- name: 'RoleAdminUpdated',
1099
- type: 'event',
1100
- inputs: [
1101
- { type: 'bytes32', name: 'role', indexed: true },
1102
- { type: 'bytes32', name: 'newAdminRole', indexed: true },
1103
- { type: 'address', name: 'sender', indexed: true },
1104
- ],
1105
- },
1106
- { name: 'Unauthorized', type: 'error', inputs: [] },
1107
- ] as const
1108
-
1109
- export const tip20Factory = [
1110
- {
1111
- name: 'createToken',
1112
- type: 'function',
1113
- stateMutability: 'nonpayable',
1114
- inputs: [
1115
- { type: 'string', name: 'name' },
1116
- { type: 'string', name: 'symbol' },
1117
- { type: 'string', name: 'currency' },
1118
- { type: 'address', name: 'quoteToken' },
1119
- { type: 'address', name: 'admin' },
1120
- ],
1121
- outputs: [{ type: 'address' }],
1122
- },
1123
- {
1124
- name: 'tokenIdCounter',
1125
- type: 'function',
1126
- stateMutability: 'view',
1127
- inputs: [],
1128
- outputs: [{ type: 'uint256' }],
1129
- },
1130
- {
1131
- name: 'isTIP20',
1132
- type: 'function',
1133
- stateMutability: 'view',
1134
- inputs: [{ type: 'address', name: 'token' }],
1135
- outputs: [{ type: 'bool' }],
1136
- },
1137
- {
1138
- name: 'TokenCreated',
1139
- type: 'event',
1140
- inputs: [
1141
- { type: 'address', name: 'token', indexed: true },
1142
- { type: 'uint256', name: 'tokenId', indexed: true },
1143
- { type: 'string', name: 'name' },
1144
- { type: 'string', name: 'symbol' },
1145
- { type: 'string', name: 'currency' },
1146
- { type: 'address', name: 'quoteToken' },
1147
- { type: 'address', name: 'admin' },
1148
- ],
1149
- },
1150
- ] as const
1151
-
1152
- export const tip20RewardsRegistry = [
1153
- {
1154
- name: 'finalizeStreams',
1155
- type: 'function',
1156
- stateMutability: 'nonpayable',
1157
- inputs: [],
1158
- outputs: [],
1159
- },
1160
- { name: 'Unauthorized', type: 'error', inputs: [] },
1161
- { name: 'StreamsAlreadyFinalized', type: 'error', inputs: [] },
1162
- ] as const
1163
-
1164
- export const tip403Registry = [
1165
- {
1166
- name: 'policyIdCounter',
1167
- type: 'function',
1168
- stateMutability: 'view',
1169
- inputs: [],
1170
- outputs: [{ type: 'uint64' }],
1171
- },
1172
- {
1173
- name: 'policyData',
1174
- type: 'function',
1175
- stateMutability: 'view',
1176
- inputs: [{ type: 'uint64', name: 'policyId' }],
1177
- outputs: [
1178
- { type: 'uint8', name: 'policyType' },
1179
- { type: 'address', name: 'admin' },
1180
- ],
1181
- },
1182
- {
1183
- name: 'isAuthorized',
1184
- type: 'function',
1185
- stateMutability: 'view',
1186
- inputs: [
1187
- { type: 'uint64', name: 'policyId' },
1188
- { type: 'address', name: 'user' },
1189
- ],
1190
- outputs: [{ type: 'bool' }],
1191
- },
1192
- {
1193
- name: 'createPolicy',
1194
- type: 'function',
1195
- stateMutability: 'nonpayable',
1196
- inputs: [
1197
- { type: 'address', name: 'admin' },
1198
- { type: 'uint8', name: 'policyType' },
1199
- ],
1200
- outputs: [{ type: 'uint64' }],
1201
- },
1202
- {
1203
- name: 'createPolicyWithAccounts',
1204
- type: 'function',
1205
- stateMutability: 'nonpayable',
1206
- inputs: [
1207
- { type: 'address', name: 'admin' },
1208
- { type: 'uint8', name: 'policyType' },
1209
- { type: 'address[]', name: 'accounts' },
1210
- ],
1211
- outputs: [{ type: 'uint64' }],
1212
- },
1213
- {
1214
- name: 'setPolicyAdmin',
1215
- type: 'function',
1216
- stateMutability: 'nonpayable',
1217
- inputs: [
1218
- { type: 'uint64', name: 'policyId' },
1219
- { type: 'address', name: 'admin' },
1220
- ],
1221
- outputs: [],
1222
- },
1223
- {
1224
- name: 'modifyPolicyWhitelist',
1225
- type: 'function',
1226
- stateMutability: 'nonpayable',
1227
- inputs: [
1228
- { type: 'uint64', name: 'policyId' },
1229
- { type: 'address', name: 'account' },
1230
- { type: 'bool', name: 'allowed' },
1231
- ],
1232
- outputs: [],
1233
- },
1234
- {
1235
- name: 'modifyPolicyBlacklist',
1236
- type: 'function',
1237
- stateMutability: 'nonpayable',
1238
- inputs: [
1239
- { type: 'uint64', name: 'policyId' },
1240
- { type: 'address', name: 'account' },
1241
- { type: 'bool', name: 'restricted' },
1242
- ],
1243
- outputs: [],
1244
- },
1245
- {
1246
- name: 'PolicyAdminUpdated',
1247
- type: 'event',
1248
- inputs: [
1249
- { type: 'uint64', name: 'policyId', indexed: true },
1250
- { type: 'address', name: 'updater', indexed: true },
1251
- { type: 'address', name: 'admin', indexed: true },
1252
- ],
1253
- },
1254
- {
1255
- name: 'PolicyCreated',
1256
- type: 'event',
1257
- inputs: [
1258
- { type: 'uint64', name: 'policyId', indexed: true },
1259
- { type: 'address', name: 'updater', indexed: true },
1260
- { type: 'uint8', name: 'policyType' },
1261
- ],
1262
- },
1263
- {
1264
- name: 'WhitelistUpdated',
1265
- type: 'event',
1266
- inputs: [
1267
- { type: 'uint64', name: 'policyId', indexed: true },
1268
- { type: 'address', name: 'updater', indexed: true },
1269
- { type: 'address', name: 'account', indexed: true },
1270
- { type: 'bool', name: 'allowed' },
1271
- ],
1272
- },
1273
- {
1274
- name: 'BlacklistUpdated',
1275
- type: 'event',
1276
- inputs: [
1277
- { type: 'uint64', name: 'policyId', indexed: true },
1278
- { type: 'address', name: 'updater', indexed: true },
1279
- { type: 'address', name: 'account', indexed: true },
1280
- { type: 'bool', name: 'restricted' },
1281
- ],
1282
- },
1283
- { name: 'Unauthorized', type: 'error', inputs: [] },
1284
- { name: 'IncompatiblePolicyType', type: 'error', inputs: [] },
1285
- { name: 'SelfOwnedPolicyMustBeWhitelist', type: 'error', inputs: [] },
1286
- ] as const
1287
-
1288
- export const tipAccountRegistrar = [
1289
- {
1290
- name: 'delegateToDefault',
1291
- type: 'function',
1292
- stateMutability: 'nonpayable',
1293
- inputs: [
1294
- { type: 'bytes32', name: 'hash' },
1295
- { type: 'bytes', name: 'signature' },
1296
- ],
1297
- outputs: [{ type: 'address', name: 'authority' }],
1298
- },
1299
- {
1300
- name: 'delegateToDefault',
1301
- type: 'function',
1302
- stateMutability: 'nonpayable',
1303
- inputs: [
1304
- { type: 'bytes', name: 'message' },
1305
- { type: 'bytes', name: 'signature' },
1306
- ],
1307
- outputs: [{ type: 'address', name: 'authority' }],
1308
- },
1309
- { name: 'InvalidSignature', type: 'error', inputs: [] },
1310
- { name: 'CodeNotEmpty', type: 'error', inputs: [] },
1311
- { name: 'NonceNotZero', type: 'error', inputs: [] },
1312
- ] as const
1313
-
1314
- export const feeManager = [
1315
- {
1316
- name: 'userTokens',
1317
- type: 'function',
1318
- stateMutability: 'view',
1319
- inputs: [{ type: 'address', name: 'user' }],
1320
- outputs: [{ type: 'address' }],
1321
- },
1322
- {
1323
- name: 'validatorTokens',
1324
- type: 'function',
1325
- stateMutability: 'view',
1326
- inputs: [{ type: 'address', name: 'validator' }],
1327
- outputs: [{ type: 'address' }],
1328
- },
1329
- {
1330
- name: 'setUserToken',
1331
- type: 'function',
1332
- stateMutability: 'nonpayable',
1333
- inputs: [{ type: 'address', name: 'token' }],
1334
- outputs: [],
1335
- },
1336
- {
1337
- name: 'setValidatorToken',
1338
- type: 'function',
1339
- stateMutability: 'nonpayable',
1340
- inputs: [{ type: 'address', name: 'token' }],
1341
- outputs: [],
1342
- },
1343
- {
1344
- name: 'getFeeTokenBalance',
1345
- type: 'function',
1346
- stateMutability: 'view',
1347
- inputs: [
1348
- { type: 'address', name: 'sender' },
1349
- { type: 'address', name: 'validator' },
1350
- ],
1351
- outputs: [{ type: 'address' }, { type: 'uint256' }],
1352
- },
1353
- {
1354
- name: 'executeBlock',
1355
- type: 'function',
1356
- stateMutability: 'nonpayable',
1357
- inputs: [],
1358
- outputs: [],
1359
- },
1360
- {
1361
- name: 'UserTokenSet',
1362
- type: 'event',
1363
- inputs: [
1364
- { type: 'address', name: 'user', indexed: true },
1365
- { type: 'address', name: 'token', indexed: true },
1366
- ],
1367
- },
1368
- {
1369
- name: 'ValidatorTokenSet',
1370
- type: 'event',
1371
- inputs: [
1372
- { type: 'address', name: 'validator', indexed: true },
1373
- { type: 'address', name: 'token', indexed: true },
1374
- ],
1375
- },
1376
- { name: 'OnlyValidator', type: 'error', inputs: [] },
1377
- { name: 'OnlySystemContract', type: 'error', inputs: [] },
1378
- { name: 'InvalidToken', type: 'error', inputs: [] },
1379
- { name: 'PoolDoesNotExist', type: 'error', inputs: [] },
1380
- { name: 'InsufficientFeeTokenBalance', type: 'error', inputs: [] },
1381
- { name: 'InternalError', type: 'error', inputs: [] },
1382
- { name: 'CannotChangeWithinBlock', type: 'error', inputs: [] },
1383
- { name: 'CannotChangeWithPendingFees', type: 'error', inputs: [] },
1384
- { name: 'TokenPolicyForbids', type: 'error', inputs: [] },
1385
- ] as const
1386
-
1387
- export const feeAmm = [
1388
- {
1389
- name: 'M',
1390
- type: 'function',
1391
- stateMutability: 'view',
1392
- inputs: [],
1393
- outputs: [{ type: 'uint256' }],
1394
- },
1395
- {
1396
- name: 'N',
1397
- type: 'function',
1398
- stateMutability: 'view',
1399
- inputs: [],
1400
- outputs: [{ type: 'uint256' }],
1401
- },
1402
- {
1403
- name: 'SCALE',
1404
- type: 'function',
1405
- stateMutability: 'view',
1406
- inputs: [],
1407
- outputs: [{ type: 'uint256' }],
1408
- },
1409
- {
1410
- name: 'MIN_LIQUIDITY',
1411
- type: 'function',
1412
- stateMutability: 'view',
1413
- inputs: [],
1414
- outputs: [{ type: 'uint256' }],
1415
- },
1416
- {
1417
- name: 'getPoolId',
1418
- type: 'function',
1419
- stateMutability: 'pure',
1420
- inputs: [
1421
- { type: 'address', name: 'userToken' },
1422
- { type: 'address', name: 'validatorToken' },
1423
- ],
1424
- outputs: [{ type: 'bytes32' }],
1425
- },
1426
- {
1427
- name: 'getPool',
1428
- type: 'function',
1429
- stateMutability: 'view',
1430
- inputs: [
1431
- { type: 'address', name: 'userToken' },
1432
- { type: 'address', name: 'validatorToken' },
1433
- ],
1434
- outputs: [
1435
- {
1436
- type: 'tuple',
1437
- components: [
1438
- { type: 'uint128', name: 'reserveUserToken' },
1439
- { type: 'uint128', name: 'reserveValidatorToken' },
1440
- ],
1441
- },
1442
- ],
1443
- },
1444
- {
1445
- name: 'pools',
1446
- type: 'function',
1447
- stateMutability: 'view',
1448
- inputs: [{ type: 'bytes32', name: 'poolId' }],
1449
- outputs: [
1450
- {
1451
- type: 'tuple',
1452
- components: [
1453
- { type: 'uint128', name: 'reserveUserToken' },
1454
- { type: 'uint128', name: 'reserveValidatorToken' },
1455
- ],
1456
- },
1457
- ],
1458
- },
1459
- {
1460
- name: 'mint',
1461
- type: 'function',
1462
- stateMutability: 'nonpayable',
1463
- inputs: [
1464
- { type: 'address', name: 'userToken' },
1465
- { type: 'address', name: 'validatorToken' },
1466
- { type: 'uint256', name: 'amountUserToken' },
1467
- { type: 'uint256', name: 'amountValidatorToken' },
1468
- { type: 'address', name: 'to' },
1469
- ],
1470
- outputs: [{ type: 'uint256', name: 'liquidity' }],
1471
- },
1472
- {
1473
- name: 'mintWithValidatorToken',
1474
- type: 'function',
1475
- stateMutability: 'nonpayable',
1476
- inputs: [
1477
- { type: 'address', name: 'userToken' },
1478
- { type: 'address', name: 'validatorToken' },
1479
- { type: 'uint256', name: 'amountValidatorToken' },
1480
- { type: 'address', name: 'to' },
1481
- ],
1482
- outputs: [{ type: 'uint256', name: 'liquidity' }],
1483
- },
1484
- {
1485
- name: 'burn',
1486
- type: 'function',
1487
- stateMutability: 'nonpayable',
1488
- inputs: [
1489
- { type: 'address', name: 'userToken' },
1490
- { type: 'address', name: 'validatorToken' },
1491
- { type: 'uint256', name: 'liquidity' },
1492
- { type: 'address', name: 'to' },
1493
- ],
1494
- outputs: [
1495
- { type: 'uint256', name: 'amountUserToken' },
1496
- { type: 'uint256', name: 'amountValidatorToken' },
1497
- ],
1498
- },
1499
- {
1500
- name: 'totalSupply',
1501
- type: 'function',
1502
- stateMutability: 'view',
1503
- inputs: [{ type: 'bytes32', name: 'poolId' }],
1504
- outputs: [{ type: 'uint256' }],
1505
- },
1506
- {
1507
- name: 'liquidityBalances',
1508
- type: 'function',
1509
- stateMutability: 'view',
1510
- inputs: [
1511
- { type: 'bytes32', name: 'poolId' },
1512
- { type: 'address', name: 'user' },
1513
- ],
1514
- outputs: [{ type: 'uint256' }],
1515
- },
1516
- {
1517
- name: 'rebalanceSwap',
1518
- type: 'function',
1519
- stateMutability: 'nonpayable',
1520
- inputs: [
1521
- { type: 'address', name: 'userToken' },
1522
- { type: 'address', name: 'validatorToken' },
1523
- { type: 'uint256', name: 'amountOut' },
1524
- { type: 'address', name: 'to' },
1525
- ],
1526
- outputs: [{ type: 'uint256', name: 'amountIn' }],
1527
- },
1528
- {
1529
- name: 'Mint',
1530
- type: 'event',
1531
- inputs: [
1532
- { type: 'address', name: 'sender', indexed: true },
1533
- { type: 'address', name: 'userToken', indexed: true },
1534
- { type: 'address', name: 'validatorToken', indexed: true },
1535
- { type: 'uint256', name: 'amountUserToken' },
1536
- { type: 'uint256', name: 'amountValidatorToken' },
1537
- { type: 'uint256', name: 'liquidity' },
1538
- ],
1539
- },
1540
- {
1541
- name: 'Burn',
1542
- type: 'event',
1543
- inputs: [
1544
- { type: 'address', name: 'sender', indexed: true },
1545
- { type: 'address', name: 'userToken', indexed: true },
1546
- { type: 'address', name: 'validatorToken', indexed: true },
1547
- { type: 'uint256', name: 'amountUserToken' },
1548
- { type: 'uint256', name: 'amountValidatorToken' },
1549
- { type: 'uint256', name: 'liquidity' },
1550
- { type: 'address', name: 'to' },
1551
- ],
1552
- },
1553
- {
1554
- name: 'RebalanceSwap',
1555
- type: 'event',
1556
- inputs: [
1557
- { type: 'address', name: 'userToken', indexed: true },
1558
- { type: 'address', name: 'validatorToken', indexed: true },
1559
- { type: 'address', name: 'swapper', indexed: true },
1560
- { type: 'uint256', name: 'amountIn' },
1561
- { type: 'uint256', name: 'amountOut' },
1562
- ],
1563
- },
1564
- {
1565
- name: 'FeeSwap',
1566
- type: 'event',
1567
- inputs: [
1568
- { type: 'address', name: 'userToken', indexed: true },
1569
- { type: 'address', name: 'validatorToken', indexed: true },
1570
- { type: 'uint256', name: 'amountIn' },
1571
- { type: 'uint256', name: 'amountOut' },
1572
- ],
1573
- },
1574
- { name: 'IdenticalAddresses', type: 'error', inputs: [] },
1575
- { name: 'ZeroAddress', type: 'error', inputs: [] },
1576
- { name: 'PoolExists', type: 'error', inputs: [] },
1577
- { name: 'PoolDoesNotExist', type: 'error', inputs: [] },
1578
- { name: 'InvalidToken', type: 'error', inputs: [] },
1579
- { name: 'InsufficientLiquidity', type: 'error', inputs: [] },
1580
- { name: 'OnlyProtocol', type: 'error', inputs: [] },
1581
- { name: 'InsufficientPoolBalance', type: 'error', inputs: [] },
1582
- { name: 'InsufficientReserves', type: 'error', inputs: [] },
1583
- { name: 'InsufficientLiquidityBalance', type: 'error', inputs: [] },
1584
- { name: 'MustDepositLowerBalanceToken', type: 'error', inputs: [] },
1585
- { name: 'InvalidAmount', type: 'error', inputs: [] },
1586
- { name: 'InvalidRebalanceState', type: 'error', inputs: [] },
1587
- { name: 'InvalidRebalanceDirection', type: 'error', inputs: [] },
1588
- { name: 'InvalidNewReserves', type: 'error', inputs: [] },
1589
- { name: 'CannotSupportPendingSwaps', type: 'error', inputs: [] },
1590
- { name: 'DivisionByZero', type: 'error', inputs: [] },
1591
- { name: 'InvalidSwapCalculation', type: 'error', inputs: [] },
1592
- { name: 'InsufficientLiquidityForPending', type: 'error', inputs: [] },
1593
- { name: 'TokenTransferFailed', type: 'error', inputs: [] },
1594
- { name: 'InternalError', type: 'error', inputs: [] },
1595
- ] as const
1596
-
1597
- export const validatorConfig = [
1598
- {
1599
- name: 'getValidators',
1600
- type: 'function',
1601
- stateMutability: 'view',
1602
- inputs: [],
1603
- outputs: [
1604
- {
1605
- type: 'tuple[]',
1606
- name: 'validators',
1607
- components: [
1608
- { type: 'bytes32', name: 'publicKey' },
1609
- { type: 'bool', name: 'active' },
1610
- { type: 'uint64', name: 'index' },
1611
- { type: 'address', name: 'validatorAddress' },
1612
- { type: 'string', name: 'inboundAddress' },
1613
- { type: 'string', name: 'outboundAddress' },
1614
- ],
1615
- },
1616
- ],
1617
- },
1618
- {
1619
- name: 'addValidator',
1620
- type: 'function',
1621
- stateMutability: 'nonpayable',
1622
- inputs: [
1623
- { type: 'address', name: 'newValidatorAddress' },
1624
- { type: 'bytes32', name: 'publicKey' },
1625
- { type: 'bool', name: 'active' },
1626
- { type: 'string', name: 'inboundAddress' },
1627
- { type: 'string', name: 'outboundAddress' },
1628
- ],
1629
- outputs: [],
1630
- },
1631
- {
1632
- name: 'updateValidator',
1633
- type: 'function',
1634
- stateMutability: 'nonpayable',
1635
- inputs: [
1636
- { type: 'address', name: 'newValidatorAddress' },
1637
- { type: 'bytes32', name: 'publicKey' },
1638
- { type: 'string', name: 'inboundAddress' },
1639
- { type: 'string', name: 'outboundAddress' },
1640
- ],
1641
- outputs: [],
1642
- },
1643
- {
1644
- name: 'changeValidatorStatus',
1645
- type: 'function',
1646
- stateMutability: 'nonpayable',
1647
- inputs: [
1648
- { type: 'address', name: 'validator' },
1649
- { type: 'bool', name: 'active' },
1650
- ],
1651
- outputs: [],
1652
- },
1653
- {
1654
- name: 'owner',
1655
- type: 'function',
1656
- stateMutability: 'view',
1657
- inputs: [],
1658
- outputs: [{ type: 'address' }],
1659
- },
1660
- {
1661
- name: 'changeOwner',
1662
- type: 'function',
1663
- stateMutability: 'nonpayable',
1664
- inputs: [{ type: 'address', name: 'newOwner' }],
1665
- outputs: [],
1666
- },
1667
- { name: 'Unauthorized', type: 'error', inputs: [] },
1668
- { name: 'ValidatorAlreadyExists', type: 'error', inputs: [] },
1669
- { name: 'ValidatorNotFound', type: 'error', inputs: [] },
1670
- {
1671
- name: 'NotHostPort',
1672
- type: 'error',
1673
- inputs: [
1674
- { type: 'string', name: 'field' },
1675
- { type: 'string', name: 'input' },
1676
- { type: 'string', name: 'backtrace' },
1677
- ],
1678
- },
1679
- {
1680
- name: 'NotIpPort',
1681
- type: 'error',
1682
- inputs: [
1683
- { type: 'string', name: 'field' },
1684
- { type: 'string', name: 'input' },
1685
- { type: 'string', name: 'backtrace' },
1686
- ],
1687
- },
1688
- ] as const