tempo.ts 0.0.6 → 0.1.1

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 (195) hide show
  1. package/dist/chains.d.ts +244 -541
  2. package/dist/chains.d.ts.map +1 -1
  3. package/dist/chains.js +10 -23
  4. package/dist/chains.js.map +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/ox/SignatureEnvelope.d.ts +245 -0
  7. package/dist/ox/SignatureEnvelope.d.ts.map +1 -0
  8. package/dist/ox/SignatureEnvelope.js +437 -0
  9. package/dist/ox/SignatureEnvelope.js.map +1 -0
  10. package/dist/ox/Transaction.d.ts +61 -24
  11. package/dist/ox/Transaction.d.ts.map +1 -1
  12. package/dist/ox/Transaction.js +63 -18
  13. package/dist/ox/Transaction.js.map +1 -1
  14. package/dist/ox/TransactionEnvelopeAA.d.ts +461 -0
  15. package/dist/ox/TransactionEnvelopeAA.d.ts.map +1 -0
  16. package/dist/ox/TransactionEnvelopeAA.js +528 -0
  17. package/dist/ox/TransactionEnvelopeAA.js.map +1 -0
  18. package/dist/ox/TransactionRequest.d.ts +7 -5
  19. package/dist/ox/TransactionRequest.d.ts.map +1 -1
  20. package/dist/ox/TransactionRequest.js +21 -12
  21. package/dist/ox/TransactionRequest.js.map +1 -1
  22. package/dist/ox/index.d.ts +5 -4
  23. package/dist/ox/index.d.ts.map +1 -1
  24. package/dist/ox/index.js +5 -4
  25. package/dist/ox/index.js.map +1 -1
  26. package/dist/prool/Instance.d.ts +0 -4
  27. package/dist/prool/Instance.d.ts.map +1 -1
  28. package/dist/prool/Instance.js +7 -7
  29. package/dist/prool/Instance.js.map +1 -1
  30. package/dist/prool/index.d.ts +1 -1
  31. package/dist/prool/index.d.ts.map +1 -1
  32. package/dist/prool/index.js +1 -1
  33. package/dist/prool/index.js.map +1 -1
  34. package/dist/viem/{abis.d.ts → Abis.d.ts} +523 -9
  35. package/dist/viem/Abis.d.ts.map +1 -0
  36. package/dist/viem/{abis.js → Abis.js} +321 -9
  37. package/dist/viem/Abis.js.map +1 -0
  38. package/dist/viem/{actions → Actions}/amm.d.ts +21 -21
  39. package/dist/viem/Actions/amm.d.ts.map +1 -0
  40. package/dist/viem/{actions → Actions}/amm.js +55 -43
  41. package/dist/viem/Actions/amm.js.map +1 -0
  42. package/dist/viem/Actions/dex.d.ts +3263 -0
  43. package/dist/viem/Actions/dex.d.ts.map +1 -0
  44. package/dist/viem/Actions/dex.js +1357 -0
  45. package/dist/viem/Actions/dex.js.map +1 -0
  46. package/dist/viem/{actions → Actions}/fee.d.ts +8 -8
  47. package/dist/viem/Actions/fee.d.ts.map +1 -0
  48. package/dist/viem/{actions → Actions}/fee.js +14 -13
  49. package/dist/viem/Actions/fee.js.map +1 -0
  50. package/dist/viem/Actions/index.d.ts +6 -0
  51. package/dist/viem/Actions/index.d.ts.map +1 -0
  52. package/dist/viem/Actions/index.js +6 -0
  53. package/dist/viem/Actions/index.js.map +1 -0
  54. package/dist/viem/{actions → Actions}/policy.d.ts +19 -19
  55. package/dist/viem/Actions/policy.d.ts.map +1 -0
  56. package/dist/viem/{actions → Actions}/policy.js +59 -46
  57. package/dist/viem/Actions/policy.js.map +1 -0
  58. package/dist/viem/{actions → Actions}/token.d.ts +3275 -698
  59. package/dist/viem/Actions/token.d.ts.map +1 -0
  60. package/dist/viem/{actions → Actions}/token.js +458 -84
  61. package/dist/viem/Actions/token.js.map +1 -0
  62. package/dist/viem/Addresses.d.ts +9 -0
  63. package/dist/viem/Addresses.d.ts.map +1 -0
  64. package/dist/viem/Addresses.js +9 -0
  65. package/dist/viem/Addresses.js.map +1 -0
  66. package/dist/viem/{chain.d.ts → Chain.d.ts} +81 -57
  67. package/dist/viem/Chain.d.ts.map +1 -0
  68. package/dist/viem/{chain.js → Chain.js} +7 -7
  69. package/dist/viem/Chain.js.map +1 -0
  70. package/dist/viem/{client.d.ts → Client.d.ts} +4 -4
  71. package/dist/viem/Client.d.ts.map +1 -0
  72. package/dist/viem/{client.js → Client.js} +3 -3
  73. package/dist/viem/Client.js.map +1 -0
  74. package/dist/viem/{decorator.d.ts → Decorator.d.ts} +507 -5
  75. package/dist/viem/Decorator.d.ts.map +1 -0
  76. package/dist/viem/{decorator.js → Decorator.js} +31 -5
  77. package/dist/viem/Decorator.js.map +1 -0
  78. package/dist/viem/{formatters.d.ts → Formatters.d.ts} +2 -2
  79. package/dist/viem/Formatters.d.ts.map +1 -0
  80. package/dist/viem/{formatters.js → Formatters.js} +24 -17
  81. package/dist/viem/Formatters.js.map +1 -0
  82. package/dist/viem/Tick.d.ts +111 -0
  83. package/dist/viem/Tick.d.ts.map +1 -0
  84. package/dist/viem/Tick.js +127 -0
  85. package/dist/viem/Tick.js.map +1 -0
  86. package/dist/viem/TokenIds.d.ts +3 -0
  87. package/dist/viem/TokenIds.d.ts.map +1 -0
  88. package/dist/viem/TokenIds.js +3 -0
  89. package/dist/viem/TokenIds.js.map +1 -0
  90. package/dist/viem/Transaction.d.ts +57 -0
  91. package/dist/viem/Transaction.d.ts.map +1 -0
  92. package/dist/viem/Transaction.js +137 -0
  93. package/dist/viem/Transaction.js.map +1 -0
  94. package/dist/viem/{transport.d.ts → Transport.d.ts} +3 -3
  95. package/dist/viem/Transport.d.ts.map +1 -0
  96. package/dist/viem/{transport.js → Transport.js} +3 -3
  97. package/dist/viem/Transport.js.map +1 -0
  98. package/dist/viem/index.d.ts +13 -9
  99. package/dist/viem/index.d.ts.map +1 -1
  100. package/dist/viem/index.js +13 -9
  101. package/dist/viem/index.js.map +1 -1
  102. package/dist/viem/{types.d.ts → internal/types.d.ts} +3 -3
  103. package/dist/viem/internal/types.d.ts.map +1 -0
  104. package/dist/viem/{types.js.map → internal/types.js.map} +1 -1
  105. package/dist/viem/internal/utils.d.ts.map +1 -0
  106. package/dist/viem/internal/utils.js.map +1 -0
  107. package/package.json +87 -101
  108. package/src/chains.ts +10 -24
  109. package/src/ox/SignatureEnvelope.test.ts +1252 -0
  110. package/src/ox/SignatureEnvelope.ts +709 -0
  111. package/src/ox/Transaction.test.ts +144 -89
  112. package/src/ox/Transaction.ts +104 -29
  113. package/src/ox/TransactionEnvelopeAA.test.ts +1533 -0
  114. package/src/ox/TransactionEnvelopeAA.ts +858 -0
  115. package/src/ox/TransactionRequest.ts +25 -17
  116. package/src/ox/index.ts +2 -1
  117. package/src/prool/Instance.ts +6 -14
  118. package/src/prool/internal/chain.json +101 -27
  119. package/src/viem/{abis.ts → Abis.ts} +322 -8
  120. package/src/viem/{actions → Actions}/amm.test.ts +65 -68
  121. package/src/viem/{actions → Actions}/amm.ts +72 -60
  122. package/src/viem/Actions/dex.test.ts +1608 -0
  123. package/src/viem/Actions/dex.ts +2026 -0
  124. package/src/viem/{actions → Actions}/fee.test.ts +34 -36
  125. package/src/viem/{actions → Actions}/fee.ts +18 -17
  126. package/src/viem/{actions → Actions}/index.ts +1 -0
  127. package/src/viem/{actions → Actions}/policy.test.ts +2 -2
  128. package/src/viem/{actions → Actions}/policy.ts +77 -64
  129. package/src/viem/{actions → Actions}/token.test.ts +419 -64
  130. package/src/viem/{actions → Actions}/token.ts +751 -145
  131. package/src/viem/Addresses.ts +9 -0
  132. package/src/viem/{chain.ts → Chain.ts} +6 -6
  133. package/src/viem/{client.bench-d.ts → Client.bench-d.ts} +2 -2
  134. package/src/viem/{client.test.ts → Client.test.ts} +31 -6
  135. package/src/viem/{client.ts → Client.ts} +1 -1
  136. package/src/viem/{decorator.bench-d.ts → Decorator.bench-d.ts} +2 -2
  137. package/src/viem/{decorator.test.ts → Decorator.test.ts} +1 -0
  138. package/src/viem/{decorator.ts → Decorator.ts} +586 -4
  139. package/src/viem/{formatters.ts → Formatters.ts} +31 -20
  140. package/src/viem/Tick.test.ts +281 -0
  141. package/src/viem/Tick.ts +176 -0
  142. package/src/viem/TokenIds.ts +2 -0
  143. package/src/viem/Transaction.ts +303 -0
  144. package/src/viem/{transport.ts → Transport.ts} +5 -5
  145. package/src/viem/e2e.test.ts +153 -78
  146. package/src/viem/index.ts +13 -9
  147. package/src/viem/{types.ts → internal/types.ts} +3 -3
  148. package/dist/ox/TransactionEnvelopeFeeToken.d.ts +0 -393
  149. package/dist/ox/TransactionEnvelopeFeeToken.d.ts.map +0 -1
  150. package/dist/ox/TransactionEnvelopeFeeToken.js +0 -452
  151. package/dist/ox/TransactionEnvelopeFeeToken.js.map +0 -1
  152. package/dist/viem/abis.d.ts.map +0 -1
  153. package/dist/viem/abis.js.map +0 -1
  154. package/dist/viem/actions/amm.d.ts.map +0 -1
  155. package/dist/viem/actions/amm.js.map +0 -1
  156. package/dist/viem/actions/fee.d.ts.map +0 -1
  157. package/dist/viem/actions/fee.js.map +0 -1
  158. package/dist/viem/actions/index.d.ts +0 -5
  159. package/dist/viem/actions/index.d.ts.map +0 -1
  160. package/dist/viem/actions/index.js +0 -5
  161. package/dist/viem/actions/index.js.map +0 -1
  162. package/dist/viem/actions/policy.d.ts.map +0 -1
  163. package/dist/viem/actions/policy.js.map +0 -1
  164. package/dist/viem/actions/token.d.ts.map +0 -1
  165. package/dist/viem/actions/token.js.map +0 -1
  166. package/dist/viem/addresses.d.ts +0 -8
  167. package/dist/viem/addresses.d.ts.map +0 -1
  168. package/dist/viem/addresses.js +0 -8
  169. package/dist/viem/addresses.js.map +0 -1
  170. package/dist/viem/chain.d.ts.map +0 -1
  171. package/dist/viem/chain.js.map +0 -1
  172. package/dist/viem/client.d.ts.map +0 -1
  173. package/dist/viem/client.js.map +0 -1
  174. package/dist/viem/decorator.d.ts.map +0 -1
  175. package/dist/viem/decorator.js.map +0 -1
  176. package/dist/viem/formatters.d.ts.map +0 -1
  177. package/dist/viem/formatters.js.map +0 -1
  178. package/dist/viem/transaction.d.ts +0 -54
  179. package/dist/viem/transaction.d.ts.map +0 -1
  180. package/dist/viem/transaction.js +0 -108
  181. package/dist/viem/transaction.js.map +0 -1
  182. package/dist/viem/transport.d.ts.map +0 -1
  183. package/dist/viem/transport.js.map +0 -1
  184. package/dist/viem/types.d.ts.map +0 -1
  185. package/dist/viem/utils.d.ts.map +0 -1
  186. package/dist/viem/utils.js.map +0 -1
  187. package/src/ox/TransactionEnvelopeFeeToken.test.ts +0 -1119
  188. package/src/ox/TransactionEnvelopeFeeToken.ts +0 -717
  189. package/src/prool/internal/consensus.toml +0 -32
  190. package/src/viem/addresses.ts +0 -10
  191. package/src/viem/transaction.ts +0 -253
  192. /package/dist/viem/{types.js → internal/types.js} +0 -0
  193. /package/dist/viem/{utils.d.ts → internal/utils.d.ts} +0 -0
  194. /package/dist/viem/{utils.js → internal/utils.js} +0 -0
  195. /package/src/viem/{utils.ts → internal/utils.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  // Generated with `bun run gen:abis`. Do not modify manually.
2
2
 
3
- export const tip20Abi = [
3
+ export const tip20 = [
4
4
  {
5
5
  name: 'name',
6
6
  type: 'function',
@@ -29,6 +29,20 @@ export const tip20Abi = [
29
29
  inputs: [],
30
30
  outputs: [{ type: 'uint256' }],
31
31
  },
32
+ {
33
+ name: 'quoteToken',
34
+ type: 'function',
35
+ stateMutability: 'view',
36
+ inputs: [],
37
+ outputs: [{ type: 'address' }],
38
+ },
39
+ {
40
+ name: 'nextQuoteToken',
41
+ type: 'function',
42
+ stateMutability: 'view',
43
+ inputs: [],
44
+ outputs: [{ type: 'address' }],
45
+ },
32
46
  {
33
47
  name: 'balanceOf',
34
48
  type: 'function',
@@ -191,7 +205,7 @@ export const tip20Abi = [
191
205
  { type: 'uint256', name: 'amount' },
192
206
  { type: 'bytes32', name: 'memo' },
193
207
  ],
194
- outputs: [],
208
+ outputs: [{ type: 'bool' }],
195
209
  },
196
210
  {
197
211
  name: 'changeTransferPolicyId',
@@ -221,6 +235,20 @@ export const tip20Abi = [
221
235
  inputs: [],
222
236
  outputs: [],
223
237
  },
238
+ {
239
+ name: 'updateQuoteToken',
240
+ type: 'function',
241
+ stateMutability: 'nonpayable',
242
+ inputs: [{ type: 'address', name: 'newQuoteToken' }],
243
+ outputs: [],
244
+ },
245
+ {
246
+ name: 'finalizeQuoteTokenUpdate',
247
+ type: 'function',
248
+ stateMutability: 'nonpayable',
249
+ inputs: [],
250
+ outputs: [],
251
+ },
224
252
  {
225
253
  name: 'permit',
226
254
  type: 'function',
@@ -319,6 +347,22 @@ export const tip20Abi = [
319
347
  { type: 'bool', name: 'isPaused' },
320
348
  ],
321
349
  },
350
+ {
351
+ name: 'UpdateQuoteToken',
352
+ type: 'event',
353
+ inputs: [
354
+ { type: 'address', name: 'updater', indexed: true },
355
+ { type: 'address', name: 'newQuoteToken', indexed: true },
356
+ ],
357
+ },
358
+ {
359
+ name: 'QuoteTokenUpdateFinalized',
360
+ type: 'event',
361
+ inputs: [
362
+ { type: 'address', name: 'updater', indexed: true },
363
+ { type: 'address', name: 'newQuoteToken', indexed: true },
364
+ ],
365
+ },
322
366
  { name: 'InsufficientBalance', type: 'error', inputs: [] },
323
367
  { name: 'InsufficientAllowance', type: 'error', inputs: [] },
324
368
  { name: 'SupplyCapExceeded', type: 'error', inputs: [] },
@@ -332,6 +376,8 @@ export const tip20Abi = [
332
376
  { name: 'SaltAlreadyUsed', type: 'error', inputs: [] },
333
377
  { name: 'ContractPaused', type: 'error', inputs: [] },
334
378
  { name: 'InvalidCurrency', type: 'error', inputs: [] },
379
+ { name: 'InvalidQuoteToken', type: 'error', inputs: [] },
380
+ { name: 'TransfersDisabled', type: 'error', inputs: [] },
335
381
  {
336
382
  name: 'grantRole',
337
383
  type: 'function',
@@ -408,7 +454,7 @@ export const tip20Abi = [
408
454
  { name: 'Unauthorized', type: 'error', inputs: [] },
409
455
  ] as const
410
456
 
411
- export const tip20FactoryAbi = [
457
+ export const tip20Factory = [
412
458
  {
413
459
  name: 'createToken',
414
460
  type: 'function',
@@ -417,6 +463,7 @@ export const tip20FactoryAbi = [
417
463
  { type: 'string', name: 'name' },
418
464
  { type: 'string', name: 'symbol' },
419
465
  { type: 'string', name: 'currency' },
466
+ { type: 'address', name: 'quoteToken' },
420
467
  { type: 'address', name: 'admin' },
421
468
  ],
422
469
  outputs: [{ type: 'uint256' }],
@@ -442,7 +489,7 @@ export const tip20FactoryAbi = [
442
489
  },
443
490
  ] as const
444
491
 
445
- export const tip403RegistryAbi = [
492
+ export const tip403Registry = [
446
493
  {
447
494
  name: 'policyIdCounter',
448
495
  type: 'function',
@@ -566,7 +613,7 @@ export const tip403RegistryAbi = [
566
613
  { name: 'SelfOwnedPolicyMustBeWhitelist', type: 'error', inputs: [] },
567
614
  ] as const
568
615
 
569
- export const tip4217RegistryAbi = [
616
+ export const tip4217Registry = [
570
617
  {
571
618
  name: 'getCurrencyDecimals',
572
619
  type: 'function',
@@ -576,7 +623,27 @@ export const tip4217RegistryAbi = [
576
623
  },
577
624
  ] as const
578
625
 
579
- export const tipAccountRegistrarAbi = [
626
+ export const nonce = [
627
+ {
628
+ name: 'getNonce',
629
+ type: 'function',
630
+ stateMutability: 'view',
631
+ inputs: [
632
+ { type: 'address', name: 'account' },
633
+ { type: 'uint64', name: 'nonceKey' },
634
+ ],
635
+ outputs: [{ type: 'uint64' }],
636
+ },
637
+ {
638
+ name: 'getActiveNonceKeyCount',
639
+ type: 'function',
640
+ stateMutability: 'view',
641
+ inputs: [{ type: 'address', name: 'account' }],
642
+ outputs: [{ type: 'uint256' }],
643
+ },
644
+ ] as const
645
+
646
+ export const tipAccountRegistrar = [
580
647
  {
581
648
  name: 'delegateToDefault',
582
649
  type: 'function',
@@ -599,7 +666,7 @@ export const tipAccountRegistrarAbi = [
599
666
  { name: 'NonceNotZero', type: 'error', inputs: [] },
600
667
  ] as const
601
668
 
602
- export const feeAmmAbi = [
669
+ export const feeAmm = [
603
670
  {
604
671
  name: 'getPoolId',
605
672
  type: 'function',
@@ -779,7 +846,7 @@ export const feeAmmAbi = [
779
846
  { name: 'InternalError', type: 'error', inputs: [] },
780
847
  ] as const
781
848
 
782
- export const feeManagerAbi = [
849
+ export const feeManager = [
783
850
  {
784
851
  name: 'BASIS_POINTS',
785
852
  type: 'function',
@@ -865,3 +932,250 @@ export const feeManagerAbi = [
865
932
  { name: 'CannotChangeWithinBlock', type: 'error', inputs: [] },
866
933
  { name: 'TokenPolicyForbids', type: 'error', inputs: [] },
867
934
  ] as const
935
+
936
+ export const stablecoinExchange = [
937
+ {
938
+ name: 'balanceOf',
939
+ type: 'function',
940
+ stateMutability: 'view',
941
+ inputs: [
942
+ { type: 'address', name: 'user' },
943
+ { type: 'address', name: 'token' },
944
+ ],
945
+ outputs: [{ type: 'uint128' }],
946
+ },
947
+ {
948
+ name: 'quoteSwapExactAmountOut',
949
+ type: 'function',
950
+ stateMutability: 'view',
951
+ inputs: [
952
+ { type: 'address', name: 'tokenIn' },
953
+ { type: 'address', name: 'tokenOut' },
954
+ { type: 'uint128', name: 'amountOut' },
955
+ ],
956
+ outputs: [{ type: 'uint128', name: 'amountIn' }],
957
+ },
958
+ {
959
+ name: 'quoteSwapExactAmountIn',
960
+ type: 'function',
961
+ stateMutability: 'view',
962
+ inputs: [
963
+ { type: 'address', name: 'tokenIn' },
964
+ { type: 'address', name: 'tokenOut' },
965
+ { type: 'uint128', name: 'amountIn' },
966
+ ],
967
+ outputs: [{ type: 'uint128', name: 'amountOut' }],
968
+ },
969
+ {
970
+ name: 'pairKey',
971
+ type: 'function',
972
+ stateMutability: 'pure',
973
+ inputs: [
974
+ { type: 'address', name: 'tokenA' },
975
+ { type: 'address', name: 'tokenB' },
976
+ ],
977
+ outputs: [{ type: 'bytes32', name: 'key' }],
978
+ },
979
+ {
980
+ name: 'getPriceLevel',
981
+ type: 'function',
982
+ stateMutability: 'view',
983
+ inputs: [
984
+ { type: 'address', name: 'base' },
985
+ { type: 'int16', name: 'tick' },
986
+ { type: 'bool', name: 'isBid' },
987
+ ],
988
+ outputs: [
989
+ {
990
+ type: 'tuple',
991
+ name: 'level',
992
+ components: [
993
+ { type: 'uint128', name: 'head' },
994
+ { type: 'uint128', name: 'tail' },
995
+ { type: 'uint128', name: 'totalLiquidity' },
996
+ ],
997
+ },
998
+ ],
999
+ },
1000
+ {
1001
+ name: 'activeOrderId',
1002
+ type: 'function',
1003
+ stateMutability: 'view',
1004
+ inputs: [],
1005
+ outputs: [{ type: 'uint128' }],
1006
+ },
1007
+ {
1008
+ name: 'pendingOrderId',
1009
+ type: 'function',
1010
+ stateMutability: 'view',
1011
+ inputs: [],
1012
+ outputs: [{ type: 'uint128' }],
1013
+ },
1014
+ {
1015
+ name: 'getOrder',
1016
+ type: 'function',
1017
+ stateMutability: 'view',
1018
+ inputs: [{ type: 'uint128', name: 'orderId' }],
1019
+ outputs: [
1020
+ {
1021
+ type: 'tuple',
1022
+ components: [
1023
+ { type: 'address', name: 'maker' },
1024
+ { type: 'bytes32', name: 'bookKey' },
1025
+ { type: 'bool', name: 'isBid' },
1026
+ { type: 'int16', name: 'tick' },
1027
+ { type: 'uint128', name: 'amount' },
1028
+ { type: 'uint128', name: 'remaining' },
1029
+ { type: 'uint128', name: 'prev' },
1030
+ { type: 'uint128', name: 'next' },
1031
+ { type: 'bool', name: 'isFlip' },
1032
+ { type: 'int16', name: 'flipTick' },
1033
+ ],
1034
+ },
1035
+ ],
1036
+ },
1037
+ {
1038
+ name: 'createPair',
1039
+ type: 'function',
1040
+ stateMutability: 'nonpayable',
1041
+ inputs: [{ type: 'address', name: 'base' }],
1042
+ outputs: [{ type: 'bytes32', name: 'key' }],
1043
+ },
1044
+ {
1045
+ name: 'swapExactAmountIn',
1046
+ type: 'function',
1047
+ stateMutability: 'nonpayable',
1048
+ inputs: [
1049
+ { type: 'address', name: 'tokenIn' },
1050
+ { type: 'address', name: 'tokenOut' },
1051
+ { type: 'uint128', name: 'amountIn' },
1052
+ { type: 'uint128', name: 'minAmountOut' },
1053
+ ],
1054
+ outputs: [{ type: 'uint128', name: 'amountOut' }],
1055
+ },
1056
+ {
1057
+ name: 'swapExactAmountOut',
1058
+ type: 'function',
1059
+ stateMutability: 'nonpayable',
1060
+ inputs: [
1061
+ { type: 'address', name: 'tokenIn' },
1062
+ { type: 'address', name: 'tokenOut' },
1063
+ { type: 'uint128', name: 'amountOut' },
1064
+ { type: 'uint128', name: 'maxAmountIn' },
1065
+ ],
1066
+ outputs: [{ type: 'uint128', name: 'amountIn' }],
1067
+ },
1068
+ {
1069
+ name: 'place',
1070
+ type: 'function',
1071
+ stateMutability: 'nonpayable',
1072
+ inputs: [
1073
+ { type: 'address', name: 'token' },
1074
+ { type: 'uint128', name: 'amount' },
1075
+ { type: 'bool', name: 'isBid' },
1076
+ { type: 'int16', name: 'tick' },
1077
+ ],
1078
+ outputs: [{ type: 'uint128', name: 'orderId' }],
1079
+ },
1080
+ {
1081
+ name: 'placeFlip',
1082
+ type: 'function',
1083
+ stateMutability: 'nonpayable',
1084
+ inputs: [
1085
+ { type: 'address', name: 'token' },
1086
+ { type: 'uint128', name: 'amount' },
1087
+ { type: 'bool', name: 'isBid' },
1088
+ { type: 'int16', name: 'tick' },
1089
+ { type: 'int16', name: 'flipTick' },
1090
+ ],
1091
+ outputs: [{ type: 'uint128', name: 'orderId' }],
1092
+ },
1093
+ {
1094
+ name: 'cancel',
1095
+ type: 'function',
1096
+ stateMutability: 'nonpayable',
1097
+ inputs: [{ type: 'uint128', name: 'orderId' }],
1098
+ outputs: [],
1099
+ },
1100
+ {
1101
+ name: 'withdraw',
1102
+ type: 'function',
1103
+ stateMutability: 'nonpayable',
1104
+ inputs: [
1105
+ { type: 'address', name: 'token' },
1106
+ { type: 'uint128', name: 'amount' },
1107
+ ],
1108
+ outputs: [],
1109
+ },
1110
+ {
1111
+ name: 'executeBlock',
1112
+ type: 'function',
1113
+ stateMutability: 'nonpayable',
1114
+ inputs: [],
1115
+ outputs: [],
1116
+ },
1117
+ {
1118
+ name: 'PairCreated',
1119
+ type: 'event',
1120
+ inputs: [
1121
+ { type: 'bytes32', name: 'key', indexed: true },
1122
+ { type: 'address', name: 'base', indexed: true },
1123
+ { type: 'address', name: 'quote', indexed: true },
1124
+ ],
1125
+ },
1126
+ {
1127
+ name: 'OrderPlaced',
1128
+ type: 'event',
1129
+ inputs: [
1130
+ { type: 'uint128', name: 'orderId', indexed: true },
1131
+ { type: 'address', name: 'maker', indexed: true },
1132
+ { type: 'address', name: 'token', indexed: true },
1133
+ { type: 'uint128', name: 'amount' },
1134
+ { type: 'bool', name: 'isBid' },
1135
+ { type: 'int16', name: 'tick' },
1136
+ ],
1137
+ },
1138
+ {
1139
+ name: 'FlipOrderPlaced',
1140
+ type: 'event',
1141
+ inputs: [
1142
+ { type: 'uint128', name: 'orderId', indexed: true },
1143
+ { type: 'address', name: 'maker', indexed: true },
1144
+ { type: 'address', name: 'token', indexed: true },
1145
+ { type: 'uint128', name: 'amount' },
1146
+ { type: 'bool', name: 'isBid' },
1147
+ { type: 'int16', name: 'tick' },
1148
+ { type: 'int16', name: 'flipTick' },
1149
+ ],
1150
+ },
1151
+ {
1152
+ name: 'OrderCancelled',
1153
+ type: 'event',
1154
+ inputs: [{ type: 'uint128', name: 'orderId', indexed: true }],
1155
+ },
1156
+ {
1157
+ name: 'OrderFilled',
1158
+ type: 'event',
1159
+ inputs: [
1160
+ { type: 'uint128', name: 'orderId', indexed: true },
1161
+ { type: 'address', name: 'maker', indexed: true },
1162
+ { type: 'uint128', name: 'amountFilled' },
1163
+ { type: 'bool', name: 'partialFill' },
1164
+ ],
1165
+ },
1166
+ { name: 'OrderDoesNotExist', type: 'error', inputs: [] },
1167
+ { name: 'Unauthorized', type: 'error', inputs: [] },
1168
+ { name: 'FillFailed', type: 'error', inputs: [] },
1169
+ { name: 'InvalidTick', type: 'error', inputs: [] },
1170
+ { name: 'InsufficientBalance', type: 'error', inputs: [] },
1171
+ { name: 'InvalidFlipTick', type: 'error', inputs: [] },
1172
+ {
1173
+ name: 'TickOutOfBounds',
1174
+ type: 'error',
1175
+ inputs: [{ type: 'int16', name: 'tick' }],
1176
+ },
1177
+ { name: 'InsufficientLiquidity', type: 'error', inputs: [] },
1178
+ { name: 'MaxInputExceeded', type: 'error', inputs: [] },
1179
+ { name: 'InsufficientOutput', type: 'error', inputs: [] },
1180
+ { name: 'PairDoesNotExist', type: 'error', inputs: [] },
1181
+ ] as const