viem 2.56.8 → 2.56.9

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 (117) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +0 -1
  3. package/_cjs/actions/index.js +5 -3
  4. package/_cjs/actions/index.js.map +1 -1
  5. package/_cjs/actions/public/getStorageValues.js +17 -0
  6. package/_cjs/actions/public/getStorageValues.js.map +1 -0
  7. package/_cjs/actions/public/simulateBlocks.js +2 -0
  8. package/_cjs/actions/public/simulateBlocks.js.map +1 -1
  9. package/_cjs/chains/definitions/rabbitChainTestnet.js +24 -0
  10. package/_cjs/chains/definitions/rabbitChainTestnet.js.map +1 -0
  11. package/_cjs/chains/index.js +7 -5
  12. package/_cjs/chains/index.js.map +1 -1
  13. package/_cjs/clients/decorators/public.js +2 -0
  14. package/_cjs/clients/decorators/public.js.map +1 -1
  15. package/_cjs/errors/version.js +1 -1
  16. package/_cjs/index.js.map +1 -1
  17. package/_cjs/tempo/Abis.js +1211 -32
  18. package/_cjs/tempo/Abis.js.map +1 -1
  19. package/_cjs/tempo/Addresses.js +2 -1
  20. package/_cjs/tempo/Addresses.js.map +1 -1
  21. package/_cjs/tempo/Decorator.js +12 -0
  22. package/_cjs/tempo/Decorator.js.map +1 -1
  23. package/_cjs/tempo/Selectors.js +7 -4
  24. package/_cjs/tempo/Selectors.js.map +1 -1
  25. package/_cjs/tempo/actions/index.js +2 -1
  26. package/_cjs/tempo/actions/index.js.map +1 -1
  27. package/_cjs/tempo/actions/propAmm.js +349 -0
  28. package/_cjs/tempo/actions/propAmm.js.map +1 -0
  29. package/_cjs/tokens/definitions/eurc.js +1 -0
  30. package/_cjs/tokens/definitions/eurc.js.map +1 -1
  31. package/_cjs/tokens/definitions/usdc.js +1 -0
  32. package/_cjs/tokens/definitions/usdc.js.map +1 -1
  33. package/_esm/actions/index.js +1 -0
  34. package/_esm/actions/index.js.map +1 -1
  35. package/_esm/actions/public/getStorageValues.js +39 -0
  36. package/_esm/actions/public/getStorageValues.js.map +1 -0
  37. package/_esm/actions/public/simulateBlocks.js +4 -0
  38. package/_esm/actions/public/simulateBlocks.js.map +1 -1
  39. package/_esm/chains/definitions/rabbitChainTestnet.js +21 -0
  40. package/_esm/chains/definitions/rabbitChainTestnet.js.map +1 -0
  41. package/_esm/chains/index.js +1 -0
  42. package/_esm/chains/index.js.map +1 -1
  43. package/_esm/clients/decorators/public.js +2 -0
  44. package/_esm/clients/decorators/public.js.map +1 -1
  45. package/_esm/errors/version.js +1 -1
  46. package/_esm/index.js.map +1 -1
  47. package/_esm/tempo/Abis.js +1214 -34
  48. package/_esm/tempo/Abis.js.map +1 -1
  49. package/_esm/tempo/Addresses.js +2 -0
  50. package/_esm/tempo/Addresses.js.map +1 -1
  51. package/_esm/tempo/Decorator.js +12 -0
  52. package/_esm/tempo/Decorator.js.map +1 -1
  53. package/_esm/tempo/Selectors.js +6 -3
  54. package/_esm/tempo/Selectors.js.map +1 -1
  55. package/_esm/tempo/actions/index.js +1 -0
  56. package/_esm/tempo/actions/index.js.map +1 -1
  57. package/_esm/tempo/actions/propAmm.js +539 -0
  58. package/_esm/tempo/actions/propAmm.js.map +1 -0
  59. package/_esm/tokens/definitions/eurc.js +1 -0
  60. package/_esm/tokens/definitions/eurc.js.map +1 -1
  61. package/_esm/tokens/definitions/usdc.js +1 -0
  62. package/_esm/tokens/definitions/usdc.js.map +1 -1
  63. package/_types/actions/index.d.ts +1 -0
  64. package/_types/actions/index.d.ts.map +1 -1
  65. package/_types/actions/public/getStorageValues.d.ts +59 -0
  66. package/_types/actions/public/getStorageValues.d.ts.map +1 -0
  67. package/_types/actions/public/simulateBlocks.d.ts +8 -0
  68. package/_types/actions/public/simulateBlocks.d.ts.map +1 -1
  69. package/_types/chains/definitions/rabbitChainTestnet.d.ts +51 -0
  70. package/_types/chains/definitions/rabbitChainTestnet.d.ts.map +1 -0
  71. package/_types/chains/index.d.ts +1 -0
  72. package/_types/chains/index.d.ts.map +1 -1
  73. package/_types/clients/decorators/public.d.ts +11 -0
  74. package/_types/clients/decorators/public.d.ts.map +1 -1
  75. package/_types/errors/version.d.ts +1 -1
  76. package/_types/index.d.ts +1 -0
  77. package/_types/index.d.ts.map +1 -1
  78. package/_types/tempo/Abis.d.ts +14686 -9568
  79. package/_types/tempo/Abis.d.ts.map +1 -1
  80. package/_types/tempo/Addresses.d.ts +2 -0
  81. package/_types/tempo/Addresses.d.ts.map +1 -1
  82. package/_types/tempo/Decorator.d.ts +205 -1
  83. package/_types/tempo/Decorator.d.ts.map +1 -1
  84. package/_types/tempo/Selectors.d.ts +6 -3
  85. package/_types/tempo/Selectors.d.ts.map +1 -1
  86. package/_types/tempo/actions/earn.d.ts +621 -1
  87. package/_types/tempo/actions/earn.d.ts.map +1 -1
  88. package/_types/tempo/actions/index.d.ts +1 -0
  89. package/_types/tempo/actions/index.d.ts.map +1 -1
  90. package/_types/tempo/actions/propAmm.d.ts +2228 -0
  91. package/_types/tempo/actions/propAmm.d.ts.map +1 -0
  92. package/_types/tokens/definitions/eurc.d.ts +1 -0
  93. package/_types/tokens/definitions/eurc.d.ts.map +1 -1
  94. package/_types/tokens/definitions/usdc.d.ts +1 -0
  95. package/_types/tokens/definitions/usdc.d.ts.map +1 -1
  96. package/_types/tokens/sets.d.ts +3 -0
  97. package/_types/tokens/sets.d.ts.map +1 -1
  98. package/_types/types/eip1193.d.ts +20 -0
  99. package/_types/types/eip1193.d.ts.map +1 -1
  100. package/actions/index.ts +6 -0
  101. package/actions/public/getStorageValues.ts +93 -0
  102. package/actions/public/simulateBlocks.ts +13 -0
  103. package/chains/definitions/rabbitChainTestnet.ts +21 -0
  104. package/chains/index.ts +1 -0
  105. package/clients/decorators/public.ts +18 -0
  106. package/errors/version.ts +1 -1
  107. package/index.ts +5 -0
  108. package/package.json +1 -1
  109. package/tempo/Abis.ts +1218 -34
  110. package/tempo/Addresses.ts +2 -0
  111. package/tempo/Decorator.ts +239 -3
  112. package/tempo/Selectors.ts +10 -4
  113. package/tempo/actions/index.ts +1 -0
  114. package/tempo/actions/propAmm.ts +998 -0
  115. package/tokens/definitions/eurc.ts +1 -0
  116. package/tokens/definitions/usdc.ts +1 -0
  117. package/types/eip1193.ts +20 -0
@@ -12,6 +12,8 @@ export const accountImplementation =
12
12
  export const accountKeychain = '0xaAAAaaAA00000000000000000000000000000000'
13
13
  export const accountRegistrar = '0x7702ac0000000000000000000000000000000000'
14
14
  export const addressRegistry = '0xfdc0000000000000000000000000000000000000'
15
+ /** Current consensus committee precompile address, used with `Abis.currentCommittee` to read committee members. */
16
+ export const currentCommittee = '0xC077e00000000000000000000000000000000000'
15
17
  export const feeManager = '0xfeec000000000000000000000000000000000000'
16
18
  export const nativeMultisig = '0xAACC000000000000000000000000000000000000'
17
19
  /** Temporary recovery factory until the production address is finalized. */
@@ -13,6 +13,7 @@ import * as feeActions from './actions/fee.js'
13
13
  import * as multisigActions from './actions/multisig.js'
14
14
  import * as nonceActions from './actions/nonce.js'
15
15
  import * as policyActions from './actions/policy.js'
16
+ import * as propAmmActions from './actions/propAmm.js'
16
17
  import * as receivePolicyActions from './actions/receivePolicy.js'
17
18
  import * as rewardActions from './actions/reward.js'
18
19
  import * as simulateActions from './actions/simulate.js'
@@ -3015,6 +3016,228 @@ type DecoratorBase<
3015
3016
  parameters: policyActions.watchBlacklistUpdated.Parameters,
3016
3017
  ) => () => void
3017
3018
  }
3019
+ propAmm: {
3020
+ /**
3021
+ * Reads the base token of a propAMM pool.
3022
+ *
3023
+ * @example
3024
+ * ```ts
3025
+ * import { createClient, http } from 'viem'
3026
+ * import { tempo } from 'viem/chains'
3027
+ * import { tempoActions } from 'viem/tempo'
3028
+ *
3029
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3030
+ *
3031
+ * const base = await client.propAmm.baseToken({ pool: '0x...' })
3032
+ * ```
3033
+ *
3034
+ * @param parameters - Pool and read options.
3035
+ * @returns The base token address.
3036
+ */
3037
+ baseToken: (
3038
+ parameters: propAmmActions.baseToken.Parameters,
3039
+ ) => Promise<propAmmActions.baseToken.ReturnValue>
3040
+ /**
3041
+ * Quotes an exact input or output for a caller, recipient, and customer route.
3042
+ *
3043
+ * @example
3044
+ * ```ts
3045
+ * import { createClient, http } from 'viem'
3046
+ * import { tempo } from 'viem/chains'
3047
+ * import { tempoActions } from 'viem/tempo'
3048
+ *
3049
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3050
+ *
3051
+ * const { amountOut, price, updatedAt } = await client.propAmm.getSwapQuote({
3052
+ * amountIn: 1_000_000n,
3053
+ * mode: 'exactInput',
3054
+ * pool: '0x...',
3055
+ * recipient: '0x...',
3056
+ * taker: '0x...',
3057
+ * })
3058
+ * ```
3059
+ *
3060
+ * @param parameters - Route, swap mode, amount, and read options.
3061
+ * @returns Quoted amount, oracle observation, rounding credit, and swap request.
3062
+ */
3063
+ getSwapQuote: <
3064
+ const parameters extends propAmmActions.getSwapQuote.Parameters,
3065
+ >(
3066
+ parameters: parameters,
3067
+ ) => Promise<propAmmActions.getSwapQuote.ReturnValue<parameters>>
3068
+ /**
3069
+ * Reads whether a propAMM pool is paused.
3070
+ *
3071
+ * @example
3072
+ * ```ts
3073
+ * import { createClient, http } from 'viem'
3074
+ * import { tempo } from 'viem/chains'
3075
+ * import { tempoActions } from 'viem/tempo'
3076
+ *
3077
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3078
+ *
3079
+ * const paused = await client.propAmm.paused({ pool: '0x...' })
3080
+ * ```
3081
+ *
3082
+ * @param parameters - Pool and read options.
3083
+ * @returns Whether swaps are paused.
3084
+ */
3085
+ paused: (
3086
+ parameters: propAmmActions.paused.Parameters,
3087
+ ) => Promise<propAmmActions.paused.ReturnValue>
3088
+ /**
3089
+ * Reads whether a resolved address may receive swap output.
3090
+ *
3091
+ * @example
3092
+ * ```ts
3093
+ * import { createClient, http } from 'viem'
3094
+ * import { tempo } from 'viem/chains'
3095
+ * import { tempoActions } from 'viem/tempo'
3096
+ *
3097
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3098
+ *
3099
+ * const allowed = await client.propAmm.recipientAllowed({
3100
+ * pool: '0x...',
3101
+ * recipient: '0x...',
3102
+ * })
3103
+ * ```
3104
+ *
3105
+ * @param parameters - Pool, resolved recipient, and read options.
3106
+ * @returns Whether the recipient is allowed.
3107
+ */
3108
+ recipientAllowed: (
3109
+ parameters: propAmmActions.recipientAllowed.Parameters,
3110
+ ) => Promise<propAmmActions.recipientAllowed.ReturnValue>
3111
+ /**
3112
+ * Resolves a Tempo recipient to the address checked by the pool's allowlist.
3113
+ *
3114
+ * @example
3115
+ * ```ts
3116
+ * import { createClient, http } from 'viem'
3117
+ * import { tempo } from 'viem/chains'
3118
+ * import { tempoActions } from 'viem/tempo'
3119
+ *
3120
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3121
+ *
3122
+ * const resolved = await client.propAmm.resolveRecipient({
3123
+ * pool: '0x...',
3124
+ * recipient: '0x...',
3125
+ * })
3126
+ * ```
3127
+ *
3128
+ * @param parameters - Pool, recipient, and read options.
3129
+ * @returns The resolved recipient address.
3130
+ */
3131
+ resolveRecipient: (
3132
+ parameters: propAmmActions.resolveRecipient.Parameters,
3133
+ ) => Promise<propAmmActions.resolveRecipient.ReturnValue>
3134
+ /**
3135
+ * Reads the quote token of a propAMM pool.
3136
+ *
3137
+ * @example
3138
+ * ```ts
3139
+ * import { createClient, http } from 'viem'
3140
+ * import { tempo } from 'viem/chains'
3141
+ * import { tempoActions } from 'viem/tempo'
3142
+ *
3143
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3144
+ *
3145
+ * const quote = await client.propAmm.quoteToken({ pool: '0x...' })
3146
+ * ```
3147
+ *
3148
+ * @param parameters - Pool and read options.
3149
+ * @returns The quote token address.
3150
+ */
3151
+ quoteToken: (
3152
+ parameters: propAmmActions.quoteToken.Parameters,
3153
+ ) => Promise<propAmmActions.quoteToken.ReturnValue>
3154
+ /**
3155
+ * Approves the input token and swaps an exact input or output in one transaction.
3156
+ *
3157
+ * @example
3158
+ * ```ts
3159
+ * import { createClient, http } from 'viem'
3160
+ * import { privateKeyToAccount } from 'viem/accounts'
3161
+ * import { tempo } from 'viem/chains'
3162
+ * import { tempoActions } from 'viem/tempo'
3163
+ *
3164
+ * const client = createClient({
3165
+ * account: privateKeyToAccount('0x...'),
3166
+ * chain: tempo,
3167
+ * transport: http(),
3168
+ * }).extend(tempoActions())
3169
+ * const hash = await client.propAmm.swap({
3170
+ * amountIn: 1_000_000n,
3171
+ * expectedOraclePrice: 1_000_000_000_000_000_000n,
3172
+ * minAmountOut: 1_000_000n,
3173
+ * minimumOracleUpdatedAt: 1_799_999_000n,
3174
+ * mode: 'exactInput',
3175
+ * pool: '0x...',
3176
+ * })
3177
+ * ```
3178
+ *
3179
+ * @param parameters - Swap and transaction options.
3180
+ * @returns The transaction hash.
3181
+ */
3182
+ swap: (
3183
+ parameters: propAmmActions.swap.Parameters<chain, account>,
3184
+ ) => Promise<propAmmActions.swap.ReturnValue>
3185
+ /**
3186
+ * Approves the input token, swaps, and returns the confirmed trade and receipt.
3187
+ *
3188
+ * @example
3189
+ * ```ts
3190
+ * import { createClient, http } from 'viem'
3191
+ * import { privateKeyToAccount } from 'viem/accounts'
3192
+ * import { tempo } from 'viem/chains'
3193
+ * import { tempoActions } from 'viem/tempo'
3194
+ *
3195
+ * const client = createClient({
3196
+ * account: privateKeyToAccount('0x...'),
3197
+ * chain: tempo,
3198
+ * transport: http(),
3199
+ * }).extend(tempoActions())
3200
+ * const trade = await client.propAmm.swapSync({
3201
+ * amountOut: 1_000_000n,
3202
+ * baseToQuote: false,
3203
+ * expectedOraclePrice: 1_000_000_000_000_000_000n,
3204
+ * maxAmountIn: 1_010_000n,
3205
+ * minimumOracleUpdatedAt: 1_799_999_000n,
3206
+ * mode: 'exactOutput',
3207
+ * pool: '0x...',
3208
+ * })
3209
+ * ```
3210
+ *
3211
+ * @param parameters - Swap and transaction options.
3212
+ * @returns Confirmed trade data and receipt.
3213
+ */
3214
+ swapSync: (
3215
+ parameters: propAmmActions.swapSync.Parameters<chain, account>,
3216
+ ) => Promise<propAmmActions.swapSync.ReturnValue>
3217
+ /**
3218
+ * Reads whether an address may call swaps on a propAMM pool.
3219
+ *
3220
+ * @example
3221
+ * ```ts
3222
+ * import { createClient, http } from 'viem'
3223
+ * import { tempo } from 'viem/chains'
3224
+ * import { tempoActions } from 'viem/tempo'
3225
+ *
3226
+ * const client = createClient({ chain: tempo, transport: http() }).extend(tempoActions())
3227
+ *
3228
+ * const allowed = await client.propAmm.takerAllowed({
3229
+ * pool: '0x...',
3230
+ * taker: '0x...',
3231
+ * })
3232
+ * ```
3233
+ *
3234
+ * @param parameters - Pool, taker, and read options.
3235
+ * @returns Whether the taker is allowed.
3236
+ */
3237
+ takerAllowed: (
3238
+ parameters: propAmmActions.takerAllowed.Parameters,
3239
+ ) => Promise<propAmmActions.takerAllowed.ReturnValue>
3240
+ }
3018
3241
  receivePolicy: {
3019
3242
  /**
3020
3243
  * Burns the funds backing a blocked receipt.
@@ -5774,9 +5997,7 @@ type BoundHelper<helper> = helper extends (
5774
5997
  ? (args: args) => returnType
5775
5998
  : parameters extends [Client<any, any, any>]
5776
5999
  ? () => returnType
5777
- : parameters extends [infer args, ...unknown[]]
5778
- ? (args: args) => returnType
5779
- : () => returnType
6000
+ : helper
5780
6001
  : never
5781
6002
 
5782
6003
  type BoundActionHelpers<action> = (action extends { call: infer helper }
@@ -5879,6 +6100,10 @@ export type Decorator<
5879
6100
  DecoratorBase<chain, account>['policy'],
5880
6101
  typeof policyActions
5881
6102
  >
6103
+ propAmm: DecorateNamespace<
6104
+ DecoratorBase<chain, account>['propAmm'],
6105
+ typeof propAmmActions
6106
+ >
5882
6107
  receivePolicy: DecorateNamespace<
5883
6108
  DecoratorBase<chain, account>['receivePolicy'],
5884
6109
  typeof receivePolicyActions
@@ -6075,6 +6300,17 @@ export function decorator() {
6075
6300
  'watchWhitelistUpdated',
6076
6301
  'watchBlacklistUpdated',
6077
6302
  ]),
6303
+ propAmm: bindActions(client, propAmmActions, [
6304
+ 'baseToken',
6305
+ 'paused',
6306
+ 'getSwapQuote',
6307
+ 'quoteToken',
6308
+ 'recipientAllowed',
6309
+ 'resolveRecipient',
6310
+ 'swap',
6311
+ 'swapSync',
6312
+ 'takerAllowed',
6313
+ ]),
6078
6314
  receivePolicy: bindActions(client, receivePolicyActions, [
6079
6315
  'burn',
6080
6316
  'burnSync',
@@ -301,6 +301,16 @@ export const zoneFactory = {
301
301
  } as const satisfies FunctionSelectors<typeof Abis.zoneFactory, 'createZone'> &
302
302
  OverloadedFunctionSelectors<'createZone'>
303
303
 
304
+ export const zoneVerifier = {
305
+ verify: {
306
+ 'verify(uint32,uint64,uint64,bytes32,uint64,(bytes32,bytes32),(bytes32,bytes32,uint64,uint64),bytes32,bytes,bytes)':
307
+ '0x7106a43e',
308
+ 'verify(uint32,uint64,uint64,bytes32,uint64,uint256,(bytes32,bytes32),(bytes32,bytes32,uint64,uint64),(uint64,uint64),bytes32,bytes,bytes)':
309
+ '0xebb2ddc9',
310
+ },
311
+ } as const satisfies FunctionSelectors<typeof Abis.zoneVerifier, 'verify'> &
312
+ OverloadedFunctionSelectors<'verify'>
313
+
304
314
  export const zonePortal = {
305
315
  FIXED_DEPOSIT_GAS: '0xf706cfbf',
306
316
  MAX_DEPOSITS_PER_TEMPO_BLOCK: '0x1bf00ca8',
@@ -415,7 +425,3 @@ export const zoneOutbox = {
415
425
  export const zoneMessenger = {
416
426
  relayMessage: '0x11da5261',
417
427
  } as const satisfies FunctionSelectors<typeof Abis.zoneMessenger>
418
-
419
- export const zoneVerifier = {
420
- verify: '0x7106a43e',
421
- } as const satisfies FunctionSelectors<typeof Abis.zoneVerifier>
@@ -9,6 +9,7 @@ export * as fee from './fee.js'
9
9
  export * as multisig from './multisig.js'
10
10
  export * as nonce from './nonce.js'
11
11
  export * as policy from './policy.js'
12
+ export * as propAmm from './propAmm.js'
12
13
  export * as receivePolicy from './receivePolicy.js'
13
14
  export * as reward from './reward.js'
14
15
  export * as simulate from './simulate.js'