tempo.ts 0.11.1 → 0.12.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.
- package/CHANGELOG.md +67 -4
- package/README.md +3 -34
- package/dist/server/Handler.d.ts +14 -14
- package/dist/server/Handler.d.ts.map +1 -1
- package/dist/server/Handler.js +16 -17
- package/dist/server/Handler.js.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +51 -51
- package/dist/wagmi/Actions/amm.d.ts.map +1 -1
- package/dist/wagmi/Actions/amm.js +37 -37
- package/dist/wagmi/Actions/amm.js.map +1 -1
- package/dist/wagmi/Actions/dex.d.ts +129 -129
- package/dist/wagmi/Actions/dex.d.ts.map +1 -1
- package/dist/wagmi/Actions/dex.js +73 -73
- package/dist/wagmi/Actions/dex.js.map +1 -1
- package/dist/wagmi/Actions/faucet.d.ts +9 -9
- package/dist/wagmi/Actions/faucet.d.ts.map +1 -1
- package/dist/wagmi/Actions/faucet.js +7 -7
- package/dist/wagmi/Actions/faucet.js.map +1 -1
- package/dist/wagmi/Actions/fee.d.ts +17 -17
- package/dist/wagmi/Actions/fee.d.ts.map +1 -1
- package/dist/wagmi/Actions/fee.js +10 -10
- package/dist/wagmi/Actions/fee.js.map +1 -1
- package/dist/wagmi/Actions/nonce.d.ts +9 -79
- package/dist/wagmi/Actions/nonce.d.ts.map +1 -1
- package/dist/wagmi/Actions/nonce.js +7 -89
- package/dist/wagmi/Actions/nonce.js.map +1 -1
- package/dist/wagmi/Actions/policy.d.ts +69 -70
- package/dist/wagmi/Actions/policy.d.ts.map +1 -1
- package/dist/wagmi/Actions/policy.js +43 -43
- package/dist/wagmi/Actions/policy.js.map +1 -1
- package/dist/wagmi/Actions/reward.d.ts +51 -51
- package/dist/wagmi/Actions/reward.d.ts.map +1 -1
- package/dist/wagmi/Actions/reward.js +31 -31
- package/dist/wagmi/Actions/reward.js.map +1 -1
- package/dist/wagmi/Actions/token.d.ts +238 -238
- package/dist/wagmi/Actions/token.d.ts.map +1 -1
- package/dist/wagmi/Actions/token.js +136 -136
- package/dist/wagmi/Actions/token.js.map +1 -1
- package/dist/wagmi/Connector.d.ts +2 -1
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +83 -22
- package/dist/wagmi/Connector.js.map +1 -1
- package/dist/wagmi/Hooks/nonce.d.ts +1 -52
- package/dist/wagmi/Hooks/nonce.d.ts.map +1 -1
- package/dist/wagmi/Hooks/nonce.js +1 -70
- package/dist/wagmi/Hooks/nonce.js.map +1 -1
- package/dist/wagmi/Hooks/policy.d.ts +0 -1
- package/dist/wagmi/Hooks/policy.d.ts.map +1 -1
- package/dist/wagmi/Hooks/policy.js.map +1 -1
- package/dist/wagmi/KeyManager.d.ts +6 -3
- package/dist/wagmi/KeyManager.d.ts.map +1 -1
- package/dist/wagmi/KeyManager.js +9 -4
- package/dist/wagmi/KeyManager.js.map +1 -1
- package/package.json +3 -13
- package/src/server/Handler.test.ts +2 -2
- package/src/server/Handler.ts +16 -17
- package/src/wagmi/Actions/amm.ts +63 -63
- package/src/wagmi/Actions/dex.test.ts +1 -1
- package/src/wagmi/Actions/dex.ts +153 -153
- package/src/wagmi/Actions/faucet.ts +11 -11
- package/src/wagmi/Actions/fee.ts +20 -20
- package/src/wagmi/Actions/nonce.test.ts +1 -64
- package/src/wagmi/Actions/nonce.ts +10 -142
- package/src/wagmi/Actions/policy.ts +83 -85
- package/src/wagmi/Actions/reward.ts +64 -61
- package/src/wagmi/Actions/token.ts +287 -283
- package/src/wagmi/Connector.ts +105 -31
- package/src/wagmi/Hooks/dex.test.ts +1 -1
- package/src/wagmi/Hooks/fee.test.ts +0 -6
- package/src/wagmi/Hooks/nonce.test.ts +1 -66
- package/src/wagmi/Hooks/nonce.ts +1 -114
- package/src/wagmi/Hooks/policy.ts +0 -2
- package/src/wagmi/KeyManager.ts +18 -5
- package/dist/chains.d.ts +0 -73
- package/dist/chains.d.ts.map +0 -1
- package/dist/chains.js +0 -51
- package/dist/chains.js.map +0 -1
- package/dist/viem/Abis.d.ts +0 -2649
- package/dist/viem/Abis.d.ts.map +0 -1
- package/dist/viem/Abis.js +0 -1677
- package/dist/viem/Abis.js.map +0 -1
- package/dist/viem/Account.d.ts +0 -244
- package/dist/viem/Account.d.ts.map +0 -1
- package/dist/viem/Account.js +0 -382
- package/dist/viem/Account.js.map +0 -1
- package/dist/viem/Actions/account.d.ts +0 -40
- package/dist/viem/Actions/account.d.ts.map +0 -1
- package/dist/viem/Actions/account.js +0 -86
- package/dist/viem/Actions/account.js.map +0 -1
- package/dist/viem/Actions/amm.d.ts +0 -1991
- package/dist/viem/Actions/amm.d.ts.map +0 -1
- package/dist/viem/Actions/amm.js +0 -814
- package/dist/viem/Actions/amm.js.map +0 -1
- package/dist/viem/Actions/dex.d.ts +0 -3900
- package/dist/viem/Actions/dex.d.ts.map +0 -1
- package/dist/viem/Actions/dex.js +0 -1414
- package/dist/viem/Actions/dex.js.map +0 -1
- package/dist/viem/Actions/faucet.d.ts +0 -69
- package/dist/viem/Actions/faucet.d.ts.map +0 -1
- package/dist/viem/Actions/faucet.js +0 -73
- package/dist/viem/Actions/faucet.js.map +0 -1
- package/dist/viem/Actions/fee.d.ts +0 -360
- package/dist/viem/Actions/fee.d.ts.map +0 -1
- package/dist/viem/Actions/fee.js +0 -237
- package/dist/viem/Actions/fee.js.map +0 -1
- package/dist/viem/Actions/index.d.ts +0 -10
- package/dist/viem/Actions/index.d.ts.map +0 -1
- package/dist/viem/Actions/index.js +0 -10
- package/dist/viem/Actions/index.js.map +0 -1
- package/dist/viem/Actions/nonce.d.ts +0 -257
- package/dist/viem/Actions/nonce.d.ts.map +0 -1
- package/dist/viem/Actions/nonce.js +0 -228
- package/dist/viem/Actions/nonce.js.map +0 -1
- package/dist/viem/Actions/policy.d.ts +0 -1680
- package/dist/viem/Actions/policy.d.ts.map +0 -1
- package/dist/viem/Actions/policy.js +0 -875
- package/dist/viem/Actions/policy.js.map +0 -1
- package/dist/viem/Actions/reward.d.ts +0 -2422
- package/dist/viem/Actions/reward.d.ts.map +0 -1
- package/dist/viem/Actions/reward.js +0 -651
- package/dist/viem/Actions/reward.js.map +0 -1
- package/dist/viem/Actions/token.d.ts +0 -16007
- package/dist/viem/Actions/token.d.ts.map +0 -1
- package/dist/viem/Actions/token.js +0 -2936
- package/dist/viem/Actions/token.js.map +0 -1
- package/dist/viem/Addresses.d.ts +0 -9
- package/dist/viem/Addresses.d.ts.map +0 -1
- package/dist/viem/Addresses.js +0 -9
- package/dist/viem/Addresses.js.map +0 -1
- package/dist/viem/Chain.d.ts +0 -451
- package/dist/viem/Chain.d.ts.map +0 -1
- package/dist/viem/Chain.js +0 -96
- package/dist/viem/Chain.js.map +0 -1
- package/dist/viem/Decorator.d.ts +0 -2783
- package/dist/viem/Decorator.d.ts.map +0 -1
- package/dist/viem/Decorator.js +0 -137
- package/dist/viem/Decorator.js.map +0 -1
- package/dist/viem/Formatters.d.ts +0 -10
- package/dist/viem/Formatters.d.ts.map +0 -1
- package/dist/viem/Formatters.js +0 -104
- package/dist/viem/Formatters.js.map +0 -1
- package/dist/viem/P256.d.ts +0 -2
- package/dist/viem/P256.d.ts.map +0 -1
- package/dist/viem/P256.js +0 -2
- package/dist/viem/P256.js.map +0 -1
- package/dist/viem/Secp256k1.d.ts +0 -2
- package/dist/viem/Secp256k1.d.ts.map +0 -1
- package/dist/viem/Secp256k1.js +0 -2
- package/dist/viem/Secp256k1.js.map +0 -1
- package/dist/viem/Storage.d.ts +0 -24
- package/dist/viem/Storage.d.ts.map +0 -1
- package/dist/viem/Storage.js +0 -68
- package/dist/viem/Storage.js.map +0 -1
- package/dist/viem/TokenIds.d.ts +0 -2
- package/dist/viem/TokenIds.d.ts.map +0 -1
- package/dist/viem/TokenIds.js +0 -2
- package/dist/viem/TokenIds.js.map +0 -1
- package/dist/viem/Transaction.d.ts +0 -76
- package/dist/viem/Transaction.d.ts.map +0 -1
- package/dist/viem/Transaction.js +0 -176
- package/dist/viem/Transaction.js.map +0 -1
- package/dist/viem/Transport.d.ts +0 -33
- package/dist/viem/Transport.d.ts.map +0 -1
- package/dist/viem/Transport.js +0 -138
- package/dist/viem/Transport.js.map +0 -1
- package/dist/viem/WebAuthnP256.d.ts +0 -82
- package/dist/viem/WebAuthnP256.d.ts.map +0 -1
- package/dist/viem/WebAuthnP256.js +0 -97
- package/dist/viem/WebAuthnP256.js.map +0 -1
- package/dist/viem/WebCryptoP256.d.ts +0 -2
- package/dist/viem/WebCryptoP256.d.ts.map +0 -1
- package/dist/viem/WebCryptoP256.js +0 -2
- package/dist/viem/WebCryptoP256.js.map +0 -1
- package/dist/viem/index.d.ts +0 -26
- package/dist/viem/index.d.ts.map +0 -1
- package/dist/viem/index.js +0 -17
- package/dist/viem/index.js.map +0 -1
- package/dist/viem/internal/types.d.ts +0 -20
- package/dist/viem/internal/types.d.ts.map +0 -1
- package/dist/viem/internal/types.js +0 -2
- package/dist/viem/internal/types.js.map +0 -1
- package/dist/viem/internal/utils.d.ts +0 -14
- package/dist/viem/internal/utils.d.ts.map +0 -1
- package/dist/viem/internal/utils.js +0 -33
- package/dist/viem/internal/utils.js.map +0 -1
- package/src/chains.ts +0 -54
- package/src/viem/Abis.ts +0 -1688
- package/src/viem/Account.test.ts +0 -444
- package/src/viem/Account.ts +0 -601
- package/src/viem/Actions/account.test.ts +0 -414
- package/src/viem/Actions/account.ts +0 -106
- package/src/viem/Actions/amm.test.ts +0 -381
- package/src/viem/Actions/amm.ts +0 -1227
- package/src/viem/Actions/dex.test.ts +0 -1549
- package/src/viem/Actions/dex.ts +0 -2150
- package/src/viem/Actions/faucet.ts +0 -121
- package/src/viem/Actions/fee.test.ts +0 -259
- package/src/viem/Actions/fee.ts +0 -372
- package/src/viem/Actions/index.ts +0 -9
- package/src/viem/Actions/nonce.test.ts +0 -206
- package/src/viem/Actions/nonce.ts +0 -347
- package/src/viem/Actions/policy.test.ts +0 -534
- package/src/viem/Actions/policy.ts +0 -1335
- package/src/viem/Actions/reward.test.ts +0 -434
- package/src/viem/Actions/reward.ts +0 -944
- package/src/viem/Actions/token.test.ts +0 -3029
- package/src/viem/Actions/token.ts +0 -4458
- package/src/viem/Addresses.ts +0 -9
- package/src/viem/Chain.bench-d.ts +0 -12
- package/src/viem/Chain.test.ts +0 -168
- package/src/viem/Chain.ts +0 -157
- package/src/viem/Decorator.bench-d.ts +0 -11
- package/src/viem/Decorator.test.ts +0 -39
- package/src/viem/Decorator.ts +0 -3179
- package/src/viem/Formatters.ts +0 -164
- package/src/viem/P256.ts +0 -1
- package/src/viem/Secp256k1.ts +0 -1
- package/src/viem/Storage.ts +0 -110
- package/src/viem/TokenIds.ts +0 -1
- package/src/viem/Transaction.ts +0 -382
- package/src/viem/Transport.ts +0 -191
- package/src/viem/WebAuthnP256.ts +0 -146
- package/src/viem/WebCryptoP256.ts +0 -1
- package/src/viem/e2e.test.ts +0 -1602
- package/src/viem/index.ts +0 -30
- package/src/viem/internal/types.ts +0 -69
- package/src/viem/internal/utils.ts +0 -58
- package/src/wagmi/internal/types.ts +0 -16
package/src/viem/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Export types required for inference.
|
|
2
|
-
export type {
|
|
3
|
-
/** @deprecated */
|
|
4
|
-
KeyAuthorization as z_KeyAuthorization,
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
SignatureEnvelope as z_SignatureEnvelope,
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
TokenId as z_TokenId,
|
|
9
|
-
/** @deprecated */
|
|
10
|
-
TxEnvelopeTempo as z_TxEnvelopeTempo,
|
|
11
|
-
} from 'ox/tempo'
|
|
12
|
-
export { Tick } from 'ox/tempo'
|
|
13
|
-
export * as Abis from './Abis.js'
|
|
14
|
-
export * as Account from './Account.js'
|
|
15
|
-
export * as Actions from './Actions/index.js'
|
|
16
|
-
export * as Addresses from './Addresses.js'
|
|
17
|
-
export * as Chain from './Chain.js'
|
|
18
|
-
export {
|
|
19
|
-
type Decorator as TempoActions,
|
|
20
|
-
decorator as tempoActions,
|
|
21
|
-
} from './Decorator.js'
|
|
22
|
-
export * as Formatters from './Formatters.js'
|
|
23
|
-
export * as P256 from './P256.js'
|
|
24
|
-
export * as Secp256k1 from './Secp256k1.js'
|
|
25
|
-
export * as TokenIds from './TokenIds.js'
|
|
26
|
-
export * as Transaction from './Transaction.js'
|
|
27
|
-
export * as Transport from './Transport.js'
|
|
28
|
-
export { withFeePayer } from './Transport.js'
|
|
29
|
-
export * as WebAuthnP256 from './WebAuthnP256.js'
|
|
30
|
-
export * as WebCryptoP256 from './WebCryptoP256.js'
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { TokenId } from 'ox/tempo'
|
|
2
|
-
import type {
|
|
3
|
-
Account,
|
|
4
|
-
Address,
|
|
5
|
-
Chain,
|
|
6
|
-
ReadContractParameters as viem_ReadContractParameters,
|
|
7
|
-
WriteContractSyncParameters as viem_WriteContractSyncParameters,
|
|
8
|
-
} from 'viem'
|
|
9
|
-
import type {
|
|
10
|
-
IsUndefined,
|
|
11
|
-
MaybeRequired,
|
|
12
|
-
UnionPick,
|
|
13
|
-
} from '../../internal/types.js'
|
|
14
|
-
import type { TransactionRequestTempo } from '../Transaction.js'
|
|
15
|
-
|
|
16
|
-
export type GetAccountParameter<
|
|
17
|
-
account extends Account | undefined = Account | undefined,
|
|
18
|
-
accountOverride extends Account | Address | undefined = Account | Address,
|
|
19
|
-
required extends boolean = true,
|
|
20
|
-
nullish extends boolean = false,
|
|
21
|
-
> = MaybeRequired<
|
|
22
|
-
{
|
|
23
|
-
account?:
|
|
24
|
-
| accountOverride
|
|
25
|
-
| Account
|
|
26
|
-
| Address
|
|
27
|
-
| (nullish extends true ? null : never)
|
|
28
|
-
| undefined
|
|
29
|
-
},
|
|
30
|
-
IsUndefined<account> extends true
|
|
31
|
-
? required extends true
|
|
32
|
-
? true
|
|
33
|
-
: false
|
|
34
|
-
: false
|
|
35
|
-
>
|
|
36
|
-
|
|
37
|
-
export type GetFeeTokenParameter<
|
|
38
|
-
chain extends Chain | undefined = Chain | undefined,
|
|
39
|
-
> = chain extends { feeToken: infer feeToken }
|
|
40
|
-
? IsUndefined<feeToken> extends true
|
|
41
|
-
? { feeToken: TokenId.TokenIdOrAddress | null }
|
|
42
|
-
: { feeToken?: TokenId.TokenIdOrAddress | null | undefined }
|
|
43
|
-
: { feeToken: TokenId.TokenIdOrAddress | null }
|
|
44
|
-
|
|
45
|
-
export type ReadParameters = Pick<
|
|
46
|
-
viem_ReadContractParameters<never, never, never>,
|
|
47
|
-
'account' | 'blockNumber' | 'blockOverrides' | 'blockTag' | 'stateOverride'
|
|
48
|
-
>
|
|
49
|
-
|
|
50
|
-
export type TokenIdOrAddress = bigint | Address
|
|
51
|
-
|
|
52
|
-
export type WriteParameters<
|
|
53
|
-
chain extends Chain | undefined = Chain | undefined,
|
|
54
|
-
account extends Account | undefined = Account | undefined,
|
|
55
|
-
> = UnionPick<
|
|
56
|
-
viem_WriteContractSyncParameters<never, never, never, chain, account>,
|
|
57
|
-
| 'account'
|
|
58
|
-
| 'chain'
|
|
59
|
-
| 'gas'
|
|
60
|
-
| 'maxFeePerGas'
|
|
61
|
-
| 'maxPriorityFeePerGas'
|
|
62
|
-
| 'nonce'
|
|
63
|
-
| 'throwOnReceiptRevert'
|
|
64
|
-
> &
|
|
65
|
-
GetFeeTokenParameter<chain> &
|
|
66
|
-
UnionPick<
|
|
67
|
-
TransactionRequestTempo,
|
|
68
|
-
'feePayer' | 'nonceKey' | 'validAfter' | 'validBefore'
|
|
69
|
-
>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Abi,
|
|
3
|
-
type AbiStateMutability,
|
|
4
|
-
type Address,
|
|
5
|
-
type ContractFunctionName,
|
|
6
|
-
type ContractFunctionParameters,
|
|
7
|
-
type ExtractAbiItem,
|
|
8
|
-
encodeFunctionData,
|
|
9
|
-
type Hex,
|
|
10
|
-
} from 'viem'
|
|
11
|
-
|
|
12
|
-
export function defineCall<
|
|
13
|
-
const abi extends Abi,
|
|
14
|
-
const functionName extends ContractFunctionName<abi, AbiStateMutability>,
|
|
15
|
-
call extends ContractFunctionParameters<
|
|
16
|
-
abi,
|
|
17
|
-
AbiStateMutability,
|
|
18
|
-
functionName
|
|
19
|
-
>,
|
|
20
|
-
>(
|
|
21
|
-
call:
|
|
22
|
-
| call
|
|
23
|
-
| ContractFunctionParameters<abi, AbiStateMutability, functionName>,
|
|
24
|
-
): ContractFunctionParameters<
|
|
25
|
-
[ExtractAbiItem<abi, functionName>],
|
|
26
|
-
AbiStateMutability,
|
|
27
|
-
functionName
|
|
28
|
-
> & {
|
|
29
|
-
data: Hex
|
|
30
|
-
to: Address
|
|
31
|
-
} {
|
|
32
|
-
return {
|
|
33
|
-
...(call as any),
|
|
34
|
-
data: encodeFunctionData(call as never),
|
|
35
|
-
to: call.address,
|
|
36
|
-
} as const
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Normalizes a value into a structured-clone compatible format.
|
|
41
|
-
*
|
|
42
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone
|
|
43
|
-
*/
|
|
44
|
-
export function normalizeValue<type>(value: type): type {
|
|
45
|
-
if (Array.isArray(value)) return value.map(normalizeValue) as never
|
|
46
|
-
if (typeof value === 'function') return undefined as never
|
|
47
|
-
if (typeof value !== 'object' || value === null) return value
|
|
48
|
-
if (Object.getPrototypeOf(value) !== Object.prototype)
|
|
49
|
-
try {
|
|
50
|
-
return structuredClone(value)
|
|
51
|
-
} catch {
|
|
52
|
-
return undefined as never
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const normalized: Record<string, unknown> = {}
|
|
56
|
-
for (const [k, v] of Object.entries(value)) normalized[k] = normalizeValue(v)
|
|
57
|
-
return normalized as never
|
|
58
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'wagmi'
|
|
2
|
-
import type { Chain } from '../../viem/Chain.js'
|
|
3
|
-
|
|
4
|
-
export type FeeTokenParameter<
|
|
5
|
-
config extends Config<readonly [Chain, ...Chain[]]>,
|
|
6
|
-
feeToken extends
|
|
7
|
-
| config['chains'][number]['feeToken']
|
|
8
|
-
| undefined = config['chains'][number]['feeToken'],
|
|
9
|
-
> = {
|
|
10
|
-
feeToken?:
|
|
11
|
-
| (feeToken extends config['chains'][number]['feeToken']
|
|
12
|
-
? feeToken
|
|
13
|
-
: undefined)
|
|
14
|
-
| config['chains'][number]['feeToken']
|
|
15
|
-
| undefined
|
|
16
|
-
}
|