viem 2.57.5 → 2.57.7
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.
- package/CHANGELOG.md +14 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js +10 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/tempo/Abis.js +297 -1
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Addresses.js +2 -1
- package/_cjs/tempo/Addresses.js.map +1 -1
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/ExecutionError.js +94 -3
- package/_cjs/tempo/ExecutionError.js.map +1 -1
- package/_cjs/tempo/actions/accessKey.js +382 -10
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/accounts.js +3 -2
- package/_cjs/tempo/actions/accounts.js.map +1 -1
- package/_cjs/tempo/actions/amm.js +90 -4
- package/_cjs/tempo/actions/amm.js.map +1 -1
- package/_cjs/tempo/actions/channel.js +183 -7
- package/_cjs/tempo/actions/channel.js.map +1 -1
- package/_cjs/tempo/actions/dex.js +507 -14
- package/_cjs/tempo/actions/dex.js.map +1 -1
- package/_cjs/tempo/actions/earn/deployment.js +4 -3
- package/_cjs/tempo/actions/earn/deployment.js.map +1 -1
- package/_cjs/tempo/actions/earn.js +22 -21
- package/_cjs/tempo/actions/earn.js.map +1 -1
- package/_cjs/tempo/actions/fee.js +85 -5
- package/_cjs/tempo/actions/fee.js.map +1 -1
- package/_cjs/tempo/actions/nonce.js +54 -1
- package/_cjs/tempo/actions/nonce.js.map +1 -1
- package/_cjs/tempo/actions/policy.js +35 -6
- package/_cjs/tempo/actions/policy.js.map +1 -1
- package/_cjs/tempo/actions/propAmm.js +18 -8
- package/_cjs/tempo/actions/propAmm.js.map +1 -1
- package/_cjs/tempo/actions/receivePolicy.js +7 -6
- package/_cjs/tempo/actions/receivePolicy.js.map +1 -1
- package/_cjs/tempo/actions/reward.js +7 -6
- package/_cjs/tempo/actions/reward.js.map +1 -1
- package/_cjs/tempo/actions/token.js +433 -22
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/actions/validator.js +12 -11
- package/_cjs/tempo/actions/validator.js.map +1 -1
- package/_cjs/tempo/actions/virtualAddress.js +3 -2
- package/_cjs/tempo/actions/virtualAddress.js.map +1 -1
- package/_cjs/tempo/actions/zone.js +12 -11
- package/_cjs/tempo/actions/zone.js.map +1 -1
- package/_cjs/tempo/errors.js +57 -1
- package/_cjs/tempo/errors.js.map +1 -1
- package/_cjs/tempo/internal/errors.js +46 -0
- package/_cjs/tempo/internal/errors.js.map +1 -0
- package/_cjs/tempo/internal/resolveError.js +128 -0
- package/_cjs/tempo/internal/resolveError.js.map +1 -0
- package/_cjs/tempo/internal/utils.js +1 -0
- package/_cjs/tempo/internal/utils.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +11 -0
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/tempo/Abis.js +297 -0
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Addresses.js +1 -0
- package/_esm/tempo/Addresses.js.map +1 -1
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/ExecutionError.js +95 -2
- package/_esm/tempo/ExecutionError.js.map +1 -1
- package/_esm/tempo/actions/accessKey.js +406 -10
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/accounts.js +3 -2
- package/_esm/tempo/actions/accounts.js.map +1 -1
- package/_esm/tempo/actions/amm.js +95 -4
- package/_esm/tempo/actions/amm.js.map +1 -1
- package/_esm/tempo/actions/channel.js +191 -7
- package/_esm/tempo/actions/channel.js.map +1 -1
- package/_esm/tempo/actions/dex.js +537 -14
- package/_esm/tempo/actions/dex.js.map +1 -1
- package/_esm/tempo/actions/earn/deployment.js +4 -3
- package/_esm/tempo/actions/earn/deployment.js.map +1 -1
- package/_esm/tempo/actions/earn.js +22 -21
- package/_esm/tempo/actions/earn.js.map +1 -1
- package/_esm/tempo/actions/fee.js +90 -6
- package/_esm/tempo/actions/fee.js.map +1 -1
- package/_esm/tempo/actions/nonce.js +57 -1
- package/_esm/tempo/actions/nonce.js.map +1 -1
- package/_esm/tempo/actions/policy.js +36 -6
- package/_esm/tempo/actions/policy.js.map +1 -1
- package/_esm/tempo/actions/propAmm.js +18 -8
- package/_esm/tempo/actions/propAmm.js.map +1 -1
- package/_esm/tempo/actions/receivePolicy.js +7 -6
- package/_esm/tempo/actions/receivePolicy.js.map +1 -1
- package/_esm/tempo/actions/reward.js +7 -6
- package/_esm/tempo/actions/reward.js.map +1 -1
- package/_esm/tempo/actions/token.js +461 -22
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/actions/validator.js +12 -11
- package/_esm/tempo/actions/validator.js.map +1 -1
- package/_esm/tempo/actions/virtualAddress.js +3 -2
- package/_esm/tempo/actions/virtualAddress.js.map +1 -1
- package/_esm/tempo/actions/zone.js +12 -11
- package/_esm/tempo/actions/zone.js.map +1 -1
- package/_esm/tempo/errors.js +63 -0
- package/_esm/tempo/errors.js.map +1 -1
- package/_esm/tempo/internal/errors.js +51 -0
- package/_esm/tempo/internal/errors.js.map +1 -0
- package/_esm/tempo/internal/resolveError.js +130 -0
- package/_esm/tempo/internal/resolveError.js.map +1 -0
- package/_esm/tempo/internal/utils.js +2 -0
- package/_esm/tempo/internal/utils.js.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/tempo/Abis.d.ts +807 -0
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Addresses.d.ts +1 -0
- package/_types/tempo/Addresses.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +1 -1
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/ExecutionError.d.ts +3 -1
- package/_types/tempo/ExecutionError.d.ts.map +1 -1
- package/_types/tempo/actions/accessKey.d.ts +155 -8
- package/_types/tempo/actions/accessKey.d.ts.map +1 -1
- package/_types/tempo/actions/accounts.d.ts +3 -1
- package/_types/tempo/actions/accounts.d.ts.map +1 -1
- package/_types/tempo/actions/amm.d.ts +39 -0
- package/_types/tempo/actions/amm.d.ts.map +1 -1
- package/_types/tempo/actions/channel.d.ts +77 -7
- package/_types/tempo/actions/channel.d.ts.map +1 -1
- package/_types/tempo/actions/dex.d.ts +222 -16
- package/_types/tempo/actions/dex.d.ts.map +1 -1
- package/_types/tempo/actions/earn/deployment.d.ts +7 -6
- package/_types/tempo/actions/earn/deployment.d.ts.map +1 -1
- package/_types/tempo/actions/earn.d.ts +15 -14
- package/_types/tempo/actions/earn.d.ts.map +1 -1
- package/_types/tempo/actions/fee.d.ts +32 -6
- package/_types/tempo/actions/fee.d.ts.map +1 -1
- package/_types/tempo/actions/nonce.d.ts +35 -0
- package/_types/tempo/actions/nonce.d.ts.map +1 -1
- package/_types/tempo/actions/policy.d.ts +29 -8
- package/_types/tempo/actions/policy.d.ts.map +1 -1
- package/_types/tempo/actions/propAmm.d.ts +9 -1
- package/_types/tempo/actions/propAmm.d.ts.map +1 -1
- package/_types/tempo/actions/receivePolicy.d.ts +10 -6
- package/_types/tempo/actions/receivePolicy.d.ts.map +1 -1
- package/_types/tempo/actions/reward.d.ts +7 -3
- package/_types/tempo/actions/reward.d.ts.map +1 -1
- package/_types/tempo/actions/token.d.ts +200 -32
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/actions/validator.d.ts +17 -5
- package/_types/tempo/actions/validator.d.ts.map +1 -1
- package/_types/tempo/actions/virtualAddress.d.ts +4 -3
- package/_types/tempo/actions/virtualAddress.d.ts.map +1 -1
- package/_types/tempo/actions/zone.d.ts +10 -9
- package/_types/tempo/actions/zone.d.ts.map +1 -1
- package/_types/tempo/errors.d.ts +63 -1
- package/_types/tempo/errors.d.ts.map +1 -1
- package/_types/tempo/internal/errors.d.ts +59 -0
- package/_types/tempo/internal/errors.d.ts.map +1 -0
- package/_types/tempo/internal/relay/utils.d.ts +16 -16
- package/_types/tempo/internal/resolveError.d.ts +8 -0
- package/_types/tempo/internal/resolveError.d.ts.map +1 -0
- package/_types/tempo/internal/utils.d.ts.map +1 -1
- package/actions/wallet/prepareTransactionRequest.ts +11 -0
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/tempo/Abis.ts +298 -0
- package/tempo/Addresses.ts +1 -0
- package/tempo/Decorator.ts +5 -3
- package/tempo/ExecutionError.ts +101 -3
- package/tempo/actions/accessKey.ts +496 -25
- package/tempo/actions/accounts.ts +7 -3
- package/tempo/actions/amm.ts +126 -4
- package/tempo/actions/channel.ts +248 -14
- package/tempo/actions/dex.ts +599 -33
- package/tempo/actions/earn/deployment.ts +11 -9
- package/tempo/actions/earn.ts +40 -35
- package/tempo/actions/fee.ts +111 -9
- package/tempo/actions/nonce.ts +86 -1
- package/tempo/actions/policy.ts +66 -14
- package/tempo/actions/propAmm.ts +36 -9
- package/tempo/actions/receivePolicy.ts +26 -15
- package/tempo/actions/reward.ts +17 -9
- package/tempo/actions/token.ts +519 -54
- package/tempo/actions/validator.ts +40 -16
- package/tempo/actions/virtualAddress.ts +7 -5
- package/tempo/actions/zone.ts +25 -20
- package/tempo/errors.ts +114 -1
- package/tempo/internal/errors.ts +110 -0
- package/tempo/internal/resolveError.ts +169 -0
- package/tempo/internal/utils.ts +2 -0
package/tempo/actions/reward.ts
CHANGED
|
@@ -19,6 +19,8 @@ import type { Log, Log as viem_Log } from '../../types/log.js'
|
|
|
19
19
|
import type { UnionOmit } from '../../types/utils.js'
|
|
20
20
|
import { parseEventLogs } from '../../utils/abi/parseEventLogs.js'
|
|
21
21
|
import * as Abis from '../Abis.js'
|
|
22
|
+
import type * as Errors from '../errors.js'
|
|
23
|
+
import { withExecutionError } from '../internal/errors.js'
|
|
22
24
|
import type { ReadParameters, WriteParameters } from '../internal/types.js'
|
|
23
25
|
import { defineCall } from '../internal/utils.js'
|
|
24
26
|
import type { TransactionReceipt } from '../Transaction.js'
|
|
@@ -86,7 +88,7 @@ export namespace claim {
|
|
|
86
88
|
export type ReturnValue = WriteContractReturnType
|
|
87
89
|
|
|
88
90
|
// TODO: exhaustive error type
|
|
89
|
-
export type ErrorType = BaseErrorType
|
|
91
|
+
export type ErrorType = Errors.ExecutionErrorType | BaseErrorType
|
|
90
92
|
|
|
91
93
|
/** @internal */
|
|
92
94
|
export async function inner<
|
|
@@ -100,7 +102,7 @@ export namespace claim {
|
|
|
100
102
|
): Promise<ReturnType<action>> {
|
|
101
103
|
const { token, ...rest } = parameters
|
|
102
104
|
const call = claim.call({ token })
|
|
103
|
-
return (await action(client, {
|
|
105
|
+
return (await withExecutionError(action)(client, {
|
|
104
106
|
...rest,
|
|
105
107
|
...call,
|
|
106
108
|
} as never)) as never
|
|
@@ -331,7 +333,7 @@ export namespace distribute {
|
|
|
331
333
|
export type ReturnValue = WriteContractReturnType
|
|
332
334
|
|
|
333
335
|
// TODO: exhaustive error type
|
|
334
|
-
export type ErrorType = BaseErrorType
|
|
336
|
+
export type ErrorType = Errors.ExecutionErrorType | BaseErrorType
|
|
335
337
|
|
|
336
338
|
/** @internal */
|
|
337
339
|
export async function inner<
|
|
@@ -345,7 +347,7 @@ export namespace distribute {
|
|
|
345
347
|
): Promise<ReturnType<action>> {
|
|
346
348
|
const { amount, token, ...rest } = parameters
|
|
347
349
|
const call = distribute.call({ amount, token })
|
|
348
|
-
return (await action(client, {
|
|
350
|
+
return (await withExecutionError(action)(client, {
|
|
349
351
|
...rest,
|
|
350
352
|
...call,
|
|
351
353
|
} as never)) as never
|
|
@@ -457,7 +459,7 @@ export async function getGlobalRewardPerToken<chain extends Chain | undefined>(
|
|
|
457
459
|
client: Client<Transport, chain>,
|
|
458
460
|
parameters: getGlobalRewardPerToken.Parameters,
|
|
459
461
|
): Promise<getGlobalRewardPerToken.ReturnValue> {
|
|
460
|
-
return readContract(client, {
|
|
462
|
+
return withExecutionError(readContract)(client, {
|
|
461
463
|
...parameters,
|
|
462
464
|
...getGlobalRewardPerToken.call(parameters),
|
|
463
465
|
})
|
|
@@ -492,6 +494,8 @@ export namespace getGlobalRewardPerToken {
|
|
|
492
494
|
functionName: 'globalRewardPerToken',
|
|
493
495
|
})
|
|
494
496
|
}
|
|
497
|
+
|
|
498
|
+
export type ErrorType = Errors.ExecutionErrorType | BaseErrorType
|
|
495
499
|
}
|
|
496
500
|
|
|
497
501
|
/**
|
|
@@ -524,7 +528,7 @@ export async function getPendingRewards<chain extends Chain | undefined>(
|
|
|
524
528
|
client: Client<Transport, chain>,
|
|
525
529
|
parameters: getPendingRewards.Parameters,
|
|
526
530
|
): Promise<getPendingRewards.ReturnValue> {
|
|
527
|
-
return readContract(client, {
|
|
531
|
+
return withExecutionError(readContract)(client, {
|
|
528
532
|
...parameters,
|
|
529
533
|
...getPendingRewards.call(parameters),
|
|
530
534
|
})
|
|
@@ -561,6 +565,8 @@ export namespace getPendingRewards {
|
|
|
561
565
|
functionName: 'getPendingRewards',
|
|
562
566
|
})
|
|
563
567
|
}
|
|
568
|
+
|
|
569
|
+
export type ErrorType = Errors.ExecutionErrorType | BaseErrorType
|
|
564
570
|
}
|
|
565
571
|
|
|
566
572
|
/**
|
|
@@ -597,7 +603,7 @@ export async function getUserRewardInfo<chain extends Chain | undefined>(
|
|
|
597
603
|
client: Client<Transport, chain>,
|
|
598
604
|
parameters: getUserRewardInfo.Parameters,
|
|
599
605
|
): Promise<getUserRewardInfo.ReturnValue> {
|
|
600
|
-
return readContract(client, {
|
|
606
|
+
return withExecutionError(readContract)(client, {
|
|
601
607
|
...parameters,
|
|
602
608
|
...getUserRewardInfo.call(parameters),
|
|
603
609
|
})
|
|
@@ -634,6 +640,8 @@ export namespace getUserRewardInfo {
|
|
|
634
640
|
functionName: 'userRewardInfo',
|
|
635
641
|
})
|
|
636
642
|
}
|
|
643
|
+
|
|
644
|
+
export type ErrorType = Errors.ExecutionErrorType | BaseErrorType
|
|
637
645
|
}
|
|
638
646
|
|
|
639
647
|
/**
|
|
@@ -753,7 +761,7 @@ export namespace setRecipient {
|
|
|
753
761
|
export type ReturnValue = WriteContractReturnType
|
|
754
762
|
|
|
755
763
|
// TODO: exhaustive error type
|
|
756
|
-
export type ErrorType = BaseErrorType
|
|
764
|
+
export type ErrorType = Errors.ExecutionErrorType | BaseErrorType
|
|
757
765
|
|
|
758
766
|
/** @internal */
|
|
759
767
|
export async function inner<
|
|
@@ -767,7 +775,7 @@ export namespace setRecipient {
|
|
|
767
775
|
): Promise<ReturnType<action>> {
|
|
768
776
|
const { recipient, token, ...rest } = parameters
|
|
769
777
|
const call = setRecipient.call({ recipient, token })
|
|
770
|
-
return (await action(client, {
|
|
778
|
+
return (await withExecutionError(action)(client, {
|
|
771
779
|
...rest,
|
|
772
780
|
...call,
|
|
773
781
|
} as never)) as never
|