tempo.ts 0.10.5 → 0.11.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.
- package/CHANGELOG.md +30 -0
- package/README.md +0 -41
- package/dist/viem/Account.d.ts +8 -3
- package/dist/viem/Account.d.ts.map +1 -1
- package/dist/viem/Account.js +9 -2
- package/dist/viem/Account.js.map +1 -1
- package/dist/viem/Actions/amm.d.ts +1 -1
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +1 -2
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/dex.d.ts +0 -35
- package/dist/viem/Actions/dex.d.ts.map +1 -1
- package/dist/viem/Actions/dex.js +0 -43
- package/dist/viem/Actions/dex.js.map +1 -1
- package/dist/viem/Actions/fee.d.ts +1 -1
- package/dist/viem/Actions/fee.d.ts.map +1 -1
- package/dist/viem/Actions/fee.js +1 -1
- package/dist/viem/Actions/fee.js.map +1 -1
- package/dist/viem/Actions/nonce.d.ts.map +1 -1
- package/dist/viem/Actions/nonce.js +6 -4
- package/dist/viem/Actions/nonce.js.map +1 -1
- package/dist/viem/Actions/token.d.ts +1 -2
- package/dist/viem/Actions/token.d.ts.map +1 -1
- package/dist/viem/Actions/token.js +1 -2
- package/dist/viem/Actions/token.js.map +1 -1
- package/dist/viem/Chain.d.ts +34 -34
- package/dist/viem/Chain.d.ts.map +1 -1
- package/dist/viem/Chain.js +2 -0
- package/dist/viem/Chain.js.map +1 -1
- package/dist/viem/Formatters.d.ts.map +1 -1
- package/dist/viem/Formatters.js +5 -3
- package/dist/viem/Formatters.js.map +1 -1
- package/dist/viem/Transaction.d.ts +8 -5
- package/dist/viem/Transaction.d.ts.map +1 -1
- package/dist/viem/Transaction.js +13 -3
- package/dist/viem/Transaction.js.map +1 -1
- package/dist/viem/internal/types.d.ts +1 -1
- package/dist/viem/internal/types.d.ts.map +1 -1
- package/dist/wagmi/Actions/dex.d.ts +1 -45
- package/dist/wagmi/Actions/dex.d.ts.map +1 -1
- package/dist/wagmi/Actions/dex.js +0 -55
- package/dist/wagmi/Actions/dex.js.map +1 -1
- package/dist/wagmi/Connector.d.ts +1 -1
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +1 -2
- package/dist/wagmi/Connector.js.map +1 -1
- package/dist/wagmi/Hooks/dex.d.ts +3 -46
- package/dist/wagmi/Hooks/dex.d.ts.map +1 -1
- package/dist/wagmi/Hooks/dex.js +2 -54
- package/dist/wagmi/Hooks/dex.js.map +1 -1
- package/dist/wagmi/index.d.ts +1 -1
- package/dist/wagmi/index.d.ts.map +1 -1
- package/dist/wagmi/index.js +1 -1
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +5 -23
- package/src/viem/Account.test.ts +1 -1
- package/src/viem/Account.ts +11 -2
- package/src/viem/Actions/account.ts +1 -1
- package/src/viem/Actions/amm.ts +1 -2
- package/src/viem/Actions/dex.test.ts +1 -195
- package/src/viem/Actions/dex.ts +0 -53
- package/src/viem/Actions/fee.test.ts +2 -2
- package/src/viem/Actions/fee.ts +1 -1
- package/src/viem/Actions/nonce.test.ts +27 -14
- package/src/viem/Actions/nonce.ts +6 -4
- package/src/viem/Actions/token.test.ts +18 -52
- package/src/viem/Actions/token.ts +1 -2
- package/src/viem/Chain.ts +3 -1
- package/src/viem/Decorator.ts +0 -30
- package/src/viem/Formatters.ts +9 -3
- package/src/viem/Transaction.ts +23 -7
- package/src/viem/e2e.test.ts +19 -0
- package/src/viem/index.ts +12 -1
- package/src/viem/internal/types.ts +1 -1
- package/src/wagmi/Actions/dex.test.ts +0 -26
- package/src/wagmi/Actions/dex.ts +1 -111
- package/src/wagmi/Actions/nonce.test.ts +8 -4
- package/src/wagmi/Actions/token.test.ts +2 -2
- package/src/wagmi/Connector.ts +1 -2
- package/src/wagmi/Hooks/dex.test.ts +0 -26
- package/src/wagmi/Hooks/dex.ts +1 -88
- package/src/wagmi/Hooks/nonce.test.ts +3 -3
- package/src/wagmi/index.ts +4 -1
- 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/ox/AuthorizationTempo.d.ts +0 -450
- package/dist/ox/AuthorizationTempo.d.ts.map +0 -1
- package/dist/ox/AuthorizationTempo.js +0 -433
- package/dist/ox/AuthorizationTempo.js.map +0 -1
- package/dist/ox/KeyAuthorization.d.ts +0 -356
- package/dist/ox/KeyAuthorization.d.ts.map +0 -1
- package/dist/ox/KeyAuthorization.js +0 -359
- package/dist/ox/KeyAuthorization.js.map +0 -1
- package/dist/ox/Order.d.ts +0 -92
- package/dist/ox/Order.d.ts.map +0 -1
- package/dist/ox/Order.js +0 -88
- package/dist/ox/Order.js.map +0 -1
- package/dist/ox/OrdersFilters.d.ts +0 -72
- package/dist/ox/OrdersFilters.d.ts.map +0 -1
- package/dist/ox/OrdersFilters.js +0 -100
- package/dist/ox/OrdersFilters.js.map +0 -1
- package/dist/ox/Pagination.d.ts +0 -128
- package/dist/ox/Pagination.d.ts.map +0 -1
- package/dist/ox/Pagination.js +0 -78
- package/dist/ox/Pagination.js.map +0 -1
- package/dist/ox/PoolId.d.ts +0 -18
- package/dist/ox/PoolId.d.ts.map +0 -1
- package/dist/ox/PoolId.js +0 -13
- package/dist/ox/PoolId.js.map +0 -1
- package/dist/ox/RpcSchema.d.ts +0 -32
- package/dist/ox/RpcSchema.d.ts.map +0 -1
- package/dist/ox/RpcSchema.js +0 -2
- package/dist/ox/RpcSchema.js.map +0 -1
- package/dist/ox/SignatureEnvelope.d.ts +0 -260
- package/dist/ox/SignatureEnvelope.d.ts.map +0 -1
- package/dist/ox/SignatureEnvelope.js +0 -477
- package/dist/ox/SignatureEnvelope.js.map +0 -1
- package/dist/ox/Tick.d.ts +0 -115
- package/dist/ox/Tick.d.ts.map +0 -1
- package/dist/ox/Tick.js +0 -127
- package/dist/ox/Tick.js.map +0 -1
- package/dist/ox/TokenId.d.ts +0 -25
- package/dist/ox/TokenId.d.ts.map +0 -1
- package/dist/ox/TokenId.js +0 -41
- package/dist/ox/TokenId.js.map +0 -1
- package/dist/ox/TokenRole.d.ts +0 -11
- package/dist/ox/TokenRole.d.ts.map +0 -1
- package/dist/ox/TokenRole.js +0 -22
- package/dist/ox/TokenRole.js.map +0 -1
- package/dist/ox/Transaction.d.ts +0 -201
- package/dist/ox/Transaction.d.ts.map +0 -1
- package/dist/ox/Transaction.js +0 -167
- package/dist/ox/Transaction.js.map +0 -1
- package/dist/ox/TransactionEnvelopeTempo.d.ts +0 -470
- package/dist/ox/TransactionEnvelopeTempo.d.ts.map +0 -1
- package/dist/ox/TransactionEnvelopeTempo.js +0 -547
- package/dist/ox/TransactionEnvelopeTempo.js.map +0 -1
- package/dist/ox/TransactionReceipt.d.ts +0 -155
- package/dist/ox/TransactionReceipt.d.ts.map +0 -1
- package/dist/ox/TransactionReceipt.js +0 -136
- package/dist/ox/TransactionReceipt.js.map +0 -1
- package/dist/ox/TransactionRequest.d.ts +0 -76
- package/dist/ox/TransactionRequest.d.ts.map +0 -1
- package/dist/ox/TransactionRequest.js +0 -93
- package/dist/ox/TransactionRequest.js.map +0 -1
- package/dist/ox/index.d.ts +0 -14
- package/dist/ox/index.d.ts.map +0 -1
- package/dist/ox/index.js +0 -14
- package/dist/ox/index.js.map +0 -1
- package/dist/prool/Instance.d.ts +0 -101
- package/dist/prool/Instance.d.ts.map +0 -1
- package/dist/prool/Instance.js +0 -136
- package/dist/prool/Instance.js.map +0 -1
- package/dist/prool/chain.json +0 -238
- package/dist/prool/index.d.ts +0 -2
- package/dist/prool/index.d.ts.map +0 -1
- package/dist/prool/index.js +0 -2
- package/dist/prool/index.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/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/Decorator.d.ts +0 -2810
- package/dist/viem/Decorator.d.ts.map +0 -1
- package/dist/viem/Decorator.js +0 -138
- package/dist/viem/Decorator.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/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/index.d.ts +0 -17
- 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/src/ox/AuthorizationTempo.test.ts +0 -1256
- package/src/ox/AuthorizationTempo.ts +0 -648
- package/src/ox/KeyAuthorization.test.ts +0 -1332
- package/src/ox/KeyAuthorization.ts +0 -540
- package/src/ox/Order.test.ts +0 -78
- package/src/ox/Order.ts +0 -125
- package/src/ox/OrdersFilters.test.ts +0 -182
- package/src/ox/OrdersFilters.ts +0 -125
- package/src/ox/Pagination.test.ts +0 -162
- package/src/ox/Pagination.ts +0 -164
- package/src/ox/PoolId.test.ts +0 -33
- package/src/ox/PoolId.ts +0 -27
- package/src/ox/RpcSchema.ts +0 -35
- package/src/ox/SignatureEnvelope.test.ts +0 -1876
- package/src/ox/SignatureEnvelope.ts +0 -791
- package/src/ox/Tick.test.ts +0 -281
- package/src/ox/Tick.ts +0 -181
- package/src/ox/TokenId.test.ts +0 -40
- package/src/ox/TokenId.ts +0 -50
- package/src/ox/TokenRole.test.ts +0 -16
- package/src/ox/TokenRole.ts +0 -27
- package/src/ox/Transaction.test.ts +0 -523
- package/src/ox/Transaction.ts +0 -332
- package/src/ox/TransactionEnvelopeTempo.test.ts +0 -1352
- package/src/ox/TransactionEnvelopeTempo.ts +0 -905
- package/src/ox/TransactionReceipt.ts +0 -190
- package/src/ox/TransactionRequest.ts +0 -147
- package/src/ox/e2e.test.ts +0 -1393
- package/src/ox/index.ts +0 -13
- package/src/prool/Instance.test.ts +0 -43
- package/src/prool/Instance.ts +0 -247
- package/src/prool/chain.json +0 -238
- package/src/prool/index.ts +0 -1
- package/src/viem/Actions/__snapshots__/dex.test.ts.snap +0 -850
- package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +0 -310
- package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +0 -457
package/src/ox/Pagination.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import type * as Hex from 'ox/Hex'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Filter range for numeric values.
|
|
5
|
-
*/
|
|
6
|
-
export type FilterRange<type> = {
|
|
7
|
-
/** Maximum value (inclusive). */
|
|
8
|
-
max?: type | null | undefined
|
|
9
|
-
/** Minimum value (inclusive). */
|
|
10
|
-
min?: type | null | undefined
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Sort order direction.
|
|
15
|
-
*/
|
|
16
|
-
export type SortOrder = 'asc' | 'desc'
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Sort configuration.
|
|
20
|
-
*/
|
|
21
|
-
export type Sort<on extends string = string> = {
|
|
22
|
-
/** A field the items are compared with. */
|
|
23
|
-
on: on
|
|
24
|
-
/** An ordering direction. */
|
|
25
|
-
order: SortOrder
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Pagination parameters.
|
|
30
|
-
*/
|
|
31
|
-
export type Params<
|
|
32
|
-
filters extends Record<string, unknown> = Record<string, unknown>,
|
|
33
|
-
cursor = Hex.Hex,
|
|
34
|
-
sortOn extends string = string,
|
|
35
|
-
> = {
|
|
36
|
-
/**
|
|
37
|
-
* Cursor for pagination.
|
|
38
|
-
*
|
|
39
|
-
* Defaults to first entry based on the sort and filter configuration.
|
|
40
|
-
* Use the `nextCursor` in response to get the next set of results.
|
|
41
|
-
*/
|
|
42
|
-
cursor?: cursor | undefined
|
|
43
|
-
/** Determines which items should be yielded in the response. */
|
|
44
|
-
filters?: filters | undefined
|
|
45
|
-
/**
|
|
46
|
-
* Maximum number of items to return.
|
|
47
|
-
*
|
|
48
|
-
* Defaults to 10.
|
|
49
|
-
* Maximum is 100.
|
|
50
|
-
*/
|
|
51
|
-
limit?: number | undefined
|
|
52
|
-
/** Determines the order of the items yielded in the response. */
|
|
53
|
-
sort?: Sort<sortOn> | undefined
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Pagination response.
|
|
58
|
-
*/
|
|
59
|
-
export type Response<key extends string, type, cursor = Hex.Hex> = {
|
|
60
|
-
/** Cursor for next page, null if no more results. */
|
|
61
|
-
nextCursor: cursor | null
|
|
62
|
-
} & {
|
|
63
|
-
[K in key]: readonly type[]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Converts internal pagination parameters to RPC format.
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```ts twoslash
|
|
71
|
-
* import { OrdersFilters, Pagination } from 'tempo.ts/ox'
|
|
72
|
-
*
|
|
73
|
-
* const rpcParameters = Pagination.toRpcParameters({
|
|
74
|
-
* cursor: '0x123',
|
|
75
|
-
* limit: 50,
|
|
76
|
-
* filters: {
|
|
77
|
-
* baseToken: '0x20c0000000000000000000000000000000000001',
|
|
78
|
-
* remaining: {
|
|
79
|
-
* min: 100n,
|
|
80
|
-
* max: 1000n,
|
|
81
|
-
* },
|
|
82
|
-
* },
|
|
83
|
-
* }, {
|
|
84
|
-
* toRpcFilters: OrdersFilters.toRpc,
|
|
85
|
-
* })
|
|
86
|
-
* // @log: { cursor: '0x123', limit: 50, filters: { baseToken: '0x20c0...', remaining: { min: '0x64', max: '0x3e8' } } }
|
|
87
|
-
* ```
|
|
88
|
-
*
|
|
89
|
-
* @param request - Internal request representation.
|
|
90
|
-
* @returns RPC-formatted request.
|
|
91
|
-
*/
|
|
92
|
-
export function toRpcParameters<toRpcFilters extends (args: any) => any>(
|
|
93
|
-
request: Params<Parameters<toRpcFilters>[0]>,
|
|
94
|
-
options: toRpcParameters.Options<toRpcFilters>,
|
|
95
|
-
): Params<ReturnType<toRpcFilters>> {
|
|
96
|
-
const result: Params<ReturnType<toRpcFilters>> = {}
|
|
97
|
-
|
|
98
|
-
if (request.cursor !== undefined) result.cursor = request.cursor
|
|
99
|
-
if (request.limit !== undefined) result.limit = request.limit
|
|
100
|
-
if (request.sort !== undefined) result.sort = request.sort
|
|
101
|
-
if (request.filters !== undefined)
|
|
102
|
-
result.filters = options.toRpcFilters(request.filters)
|
|
103
|
-
|
|
104
|
-
return result
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export declare namespace toRpcParameters {
|
|
108
|
-
type Options<toRpcFilters extends (args: any) => any> = {
|
|
109
|
-
toRpcFilters: toRpcFilters
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Converts RPC-formatted pagination response to internal representation.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```ts twoslash
|
|
118
|
-
* import { Order, Pagination } from 'tempo.ts/ox'
|
|
119
|
-
*
|
|
120
|
-
* const response = Pagination.fromRpcResponse({
|
|
121
|
-
* nextCursor: '0x123',
|
|
122
|
-
* items: [{
|
|
123
|
-
* amount: '0x64',
|
|
124
|
-
* baseToken: '0x20c0000000000000000000000000000000000001',
|
|
125
|
-
* flipTick: 0,
|
|
126
|
-
* isBid: true,
|
|
127
|
-
* isFlip: false,
|
|
128
|
-
* maker: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
|
|
129
|
-
* next: '0x0',
|
|
130
|
-
* orderId: '0x1',
|
|
131
|
-
* quoteToken: '0x20c0000000000000000000000000000000000002',
|
|
132
|
-
* prev: '0x0',
|
|
133
|
-
* remaining: '0x64',
|
|
134
|
-
* tick: 100,
|
|
135
|
-
* }],
|
|
136
|
-
* }, {
|
|
137
|
-
* fromRpc: Order.fromRpc,
|
|
138
|
-
* })
|
|
139
|
-
* // @log: { nextCursor: '0x123', items: [{ amount: 100n, orderId: 1n, ... }] }
|
|
140
|
-
* ```
|
|
141
|
-
*
|
|
142
|
-
* @param response - RPC-formatted response.
|
|
143
|
-
* @param options - Conversion options.
|
|
144
|
-
* @returns Internal response representation.
|
|
145
|
-
*/
|
|
146
|
-
export function fromRpcResponse<
|
|
147
|
-
key extends string,
|
|
148
|
-
fromRpc extends (args: any) => any,
|
|
149
|
-
>(
|
|
150
|
-
response: Response<key, Parameters<fromRpc>[0]>,
|
|
151
|
-
options: fromRpcResponse.Options<key, fromRpc>,
|
|
152
|
-
): Response<key, ReturnType<fromRpc>> {
|
|
153
|
-
return {
|
|
154
|
-
nextCursor: response.nextCursor,
|
|
155
|
-
[options.key]: response[options.key].map(options.fromRpc),
|
|
156
|
-
} as never
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export declare namespace fromRpcResponse {
|
|
160
|
-
type Options<key extends string, fromRpc extends (args: any) => any> = {
|
|
161
|
-
key: key
|
|
162
|
-
fromRpc: fromRpc
|
|
163
|
-
}
|
|
164
|
-
}
|
package/src/ox/PoolId.test.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PoolId } from 'tempo.ts/ox'
|
|
2
|
-
import { expect, test } from 'vitest'
|
|
3
|
-
|
|
4
|
-
test('from', () => {
|
|
5
|
-
// Test with bigint token IDs
|
|
6
|
-
const poolId1 = PoolId.from({
|
|
7
|
-
userToken: 0n,
|
|
8
|
-
validatorToken: 1n,
|
|
9
|
-
})
|
|
10
|
-
expect(poolId1).toMatchInlineSnapshot(
|
|
11
|
-
`"0x24fc92718dfd933b7f831893444e0dc6072ce0fff68198eaf48e86cb1f2ee2dc"`,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
// Test with address token IDs
|
|
15
|
-
const poolId2 = PoolId.from({
|
|
16
|
-
userToken: '0x20c0000000000000000000000000000000000000',
|
|
17
|
-
validatorToken: '0x20c0000000000000000000000000000000000001',
|
|
18
|
-
})
|
|
19
|
-
expect(poolId2).toBe(poolId1)
|
|
20
|
-
|
|
21
|
-
// Test with mixed types
|
|
22
|
-
const poolId3 = PoolId.from({
|
|
23
|
-
userToken: 0n,
|
|
24
|
-
validatorToken: '0x20c0000000000000000000000000000000000001',
|
|
25
|
-
})
|
|
26
|
-
expect(poolId3).toBe(poolId1)
|
|
27
|
-
|
|
28
|
-
const poolId4 = PoolId.from({
|
|
29
|
-
userToken: '0x20c0000000000000000000000000000000000000',
|
|
30
|
-
validatorToken: 1n,
|
|
31
|
-
})
|
|
32
|
-
expect(poolId4).toBe(poolId1)
|
|
33
|
-
})
|
package/src/ox/PoolId.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as Hash from 'ox/Hash'
|
|
2
|
-
import * as Hex from 'ox/Hex'
|
|
3
|
-
import * as TokenId from './TokenId.js'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Converts a user token and validator token to a pool ID.
|
|
7
|
-
*
|
|
8
|
-
* @param value - User token and validator token.
|
|
9
|
-
* @returns The pool ID.
|
|
10
|
-
*/
|
|
11
|
-
export function from(value: from.Value): Hex.Hex {
|
|
12
|
-
return Hash.keccak256(
|
|
13
|
-
Hex.concat(
|
|
14
|
-
Hex.padLeft(TokenId.toAddress(value.userToken), 32),
|
|
15
|
-
Hex.padLeft(TokenId.toAddress(value.validatorToken), 32),
|
|
16
|
-
),
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export declare namespace from {
|
|
21
|
-
export type Value = {
|
|
22
|
-
/** User token. */
|
|
23
|
-
userToken: TokenId.TokenIdOrAddress
|
|
24
|
-
/** Validator token. */
|
|
25
|
-
validatorToken: TokenId.TokenIdOrAddress
|
|
26
|
-
}
|
|
27
|
-
}
|
package/src/ox/RpcSchema.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type * as RpcSchema from 'ox/RpcSchema'
|
|
2
|
-
import type { UnionToTuple } from '../internal/types.js'
|
|
3
|
-
import type * as Order from './Order.js'
|
|
4
|
-
import type * as OrdersFilters from './OrdersFilters.js'
|
|
5
|
-
import type * as Pagination from './Pagination.js'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Union of all JSON-RPC Methods for the `dex_` namespace.
|
|
9
|
-
*/
|
|
10
|
-
export type Dex = RpcSchema.From<{
|
|
11
|
-
Request: {
|
|
12
|
-
method: 'dex_getOrders'
|
|
13
|
-
params: Pagination.Params<OrdersFilters.Rpc>
|
|
14
|
-
}
|
|
15
|
-
ReturnType: Pagination.Response<'orders', Order.Rpc>
|
|
16
|
-
}>
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Viem-compatible RPC schema for the `dex_` namespace.
|
|
20
|
-
*/
|
|
21
|
-
export type DexViem = ToViem<Dex>
|
|
22
|
-
|
|
23
|
-
type ToViem<schema extends RpcSchema.Generic> = UnionToTuple<schema> extends [
|
|
24
|
-
infer head extends RpcSchema.Generic,
|
|
25
|
-
...infer tail extends RpcSchema.Generic[],
|
|
26
|
-
]
|
|
27
|
-
? [
|
|
28
|
-
{
|
|
29
|
-
Method: head['Request']['method']
|
|
30
|
-
Parameters: head['Request']['params']
|
|
31
|
-
ReturnType: head['ReturnType']
|
|
32
|
-
},
|
|
33
|
-
...ToViem<tail[number]>,
|
|
34
|
-
]
|
|
35
|
-
: []
|