tempo.ts 0.1.4 → 0.2.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/README.md +33 -2
- package/dist/chains.d.ts +509 -115
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +18 -9
- package/dist/chains.js.map +1 -1
- package/dist/ox/Order.d.ts +92 -0
- package/dist/ox/Order.d.ts.map +1 -0
- package/dist/ox/Order.js +88 -0
- package/dist/ox/Order.js.map +1 -0
- package/dist/ox/OrdersFilters.d.ts +72 -0
- package/dist/ox/OrdersFilters.d.ts.map +1 -0
- package/dist/ox/OrdersFilters.js +100 -0
- package/dist/ox/OrdersFilters.js.map +1 -0
- package/dist/ox/Pagination.d.ts +128 -0
- package/dist/ox/Pagination.d.ts.map +1 -0
- package/dist/ox/Pagination.js +78 -0
- package/dist/ox/Pagination.js.map +1 -0
- package/dist/ox/PoolId.d.ts +18 -0
- package/dist/ox/PoolId.d.ts.map +1 -0
- package/dist/ox/PoolId.js +13 -0
- package/dist/ox/PoolId.js.map +1 -0
- package/dist/ox/RpcSchema.d.ts +32 -0
- package/dist/ox/RpcSchema.d.ts.map +1 -0
- package/dist/ox/RpcSchema.js +2 -0
- package/dist/ox/RpcSchema.js.map +1 -0
- package/dist/ox/SignatureEnvelope.d.ts +1 -1
- package/dist/ox/SignatureEnvelope.d.ts.map +1 -1
- package/dist/ox/SignatureEnvelope.js.map +1 -1
- package/dist/{viem → ox}/Tick.d.ts +4 -0
- package/dist/ox/Tick.d.ts.map +1 -0
- package/dist/ox/Tick.js.map +1 -0
- package/dist/ox/Transaction.d.ts.map +1 -1
- package/dist/ox/Transaction.js +2 -1
- package/dist/ox/Transaction.js.map +1 -1
- package/dist/ox/TransactionEnvelopeAA.d.ts +6 -6
- package/dist/ox/TransactionEnvelopeAA.d.ts.map +1 -1
- package/dist/ox/TransactionEnvelopeAA.js +4 -2
- package/dist/ox/TransactionEnvelopeAA.js.map +1 -1
- package/dist/ox/TransactionRequest.d.ts +4 -0
- package/dist/ox/TransactionRequest.d.ts.map +1 -1
- package/dist/ox/TransactionRequest.js.map +1 -1
- package/dist/ox/index.d.ts +6 -0
- package/dist/ox/index.d.ts.map +1 -1
- package/dist/ox/index.js +6 -0
- package/dist/ox/index.js.map +1 -1
- package/dist/prool/Instance.d.ts +5 -0
- package/dist/prool/Instance.d.ts.map +1 -1
- package/dist/prool/Instance.js +32 -8
- package/dist/prool/Instance.js.map +1 -1
- package/dist/viem/Abis.d.ts +1469 -1082
- package/dist/viem/Abis.d.ts.map +1 -1
- package/dist/viem/Abis.js +932 -671
- package/dist/viem/Abis.js.map +1 -1
- package/dist/viem/Account.d.ts +150 -0
- package/dist/viem/Account.d.ts.map +1 -0
- package/dist/viem/Account.js +221 -0
- package/dist/viem/Account.js.map +1 -0
- package/dist/viem/Actions/amm.d.ts +80 -118
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +47 -116
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/dex.d.ts +889 -633
- package/dist/viem/Actions/dex.d.ts.map +1 -1
- package/dist/viem/Actions/dex.js +99 -0
- package/dist/viem/Actions/dex.js.map +1 -1
- package/dist/viem/Actions/fee.d.ts +3 -17
- package/dist/viem/Actions/fee.d.ts.map +1 -1
- package/dist/viem/Actions/fee.js.map +1 -1
- package/dist/viem/Actions/index.d.ts +1 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +1 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/reward.d.ts +3236 -0
- package/dist/viem/Actions/reward.d.ts.map +1 -0
- package/dist/viem/Actions/reward.js +725 -0
- package/dist/viem/Actions/reward.js.map +1 -0
- package/dist/viem/Actions/token.d.ts +4295 -2646
- package/dist/viem/Actions/token.d.ts.map +1 -1
- package/dist/viem/Actions/token.js +214 -335
- package/dist/viem/Actions/token.js.map +1 -1
- package/dist/viem/Addresses.d.ts +1 -2
- package/dist/viem/Addresses.d.ts.map +1 -1
- package/dist/viem/Addresses.js +1 -2
- package/dist/viem/Addresses.js.map +1 -1
- package/dist/viem/Chain.d.ts +38 -12
- package/dist/viem/Chain.d.ts.map +1 -1
- package/dist/viem/Chain.js +27 -18
- package/dist/viem/Chain.js.map +1 -1
- package/dist/viem/Decorator.d.ts +959 -405
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +13 -5
- package/dist/viem/Decorator.js.map +1 -1
- package/dist/viem/Formatters.d.ts +8 -1
- package/dist/viem/Formatters.d.ts.map +1 -1
- package/dist/viem/Formatters.js +17 -0
- package/dist/viem/Formatters.js.map +1 -1
- package/dist/viem/P256.d.ts +2 -0
- package/dist/viem/P256.d.ts.map +1 -0
- package/dist/viem/P256.js +2 -0
- package/dist/viem/P256.js.map +1 -0
- package/dist/viem/Secp256k1.d.ts +2 -0
- package/dist/viem/Secp256k1.d.ts.map +1 -0
- package/dist/viem/Secp256k1.js +2 -0
- package/dist/viem/Secp256k1.js.map +1 -0
- package/dist/viem/TokenIds.d.ts +1 -2
- package/dist/viem/TokenIds.d.ts.map +1 -1
- package/dist/viem/TokenIds.js +1 -2
- package/dist/viem/TokenIds.js.map +1 -1
- package/dist/viem/Transaction.d.ts +1 -1
- package/dist/viem/Transaction.d.ts.map +1 -1
- package/dist/viem/Transaction.js +46 -5
- package/dist/viem/Transaction.js.map +1 -1
- package/dist/viem/WebAuthnP256.d.ts +79 -0
- package/dist/viem/WebAuthnP256.d.ts.map +1 -0
- package/dist/viem/WebAuthnP256.js +95 -0
- package/dist/viem/WebAuthnP256.js.map +1 -0
- package/dist/viem/WebCryptoP256.d.ts +2 -0
- package/dist/viem/WebCryptoP256.d.ts.map +1 -0
- package/dist/viem/WebCryptoP256.js +2 -0
- package/dist/viem/WebCryptoP256.js.map +1 -0
- package/dist/viem/index.d.ts +6 -3
- package/dist/viem/index.d.ts.map +1 -1
- package/dist/viem/index.js +6 -3
- package/dist/viem/index.js.map +1 -1
- package/dist/viem/internal/account.d.ts +24 -0
- package/dist/viem/internal/account.d.ts.map +1 -0
- package/dist/viem/internal/account.js +68 -0
- package/dist/viem/internal/account.js.map +1 -0
- package/dist/viem/internal/types.d.ts +10 -0
- package/dist/viem/internal/types.d.ts.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +428 -0
- package/dist/wagmi/Actions/amm.d.ts.map +1 -0
- package/dist/wagmi/Actions/amm.js +472 -0
- package/dist/wagmi/Actions/amm.js.map +1 -0
- package/dist/wagmi/Actions/dex.d.ts +908 -0
- package/dist/wagmi/Actions/dex.d.ts.map +1 -0
- package/dist/wagmi/Actions/dex.js +1023 -0
- package/dist/wagmi/Actions/dex.js.map +1 -0
- package/dist/wagmi/Actions/fee.d.ts +111 -0
- package/dist/wagmi/Actions/fee.d.ts.map +1 -0
- package/dist/wagmi/Actions/fee.js +126 -0
- package/dist/wagmi/Actions/fee.js.map +1 -0
- package/dist/wagmi/Actions/index.d.ts +6 -0
- package/dist/wagmi/Actions/index.d.ts.map +1 -0
- package/dist/wagmi/Actions/index.js +6 -0
- package/dist/wagmi/Actions/index.js.map +1 -0
- package/dist/wagmi/Actions/reward.d.ts +348 -0
- package/dist/wagmi/Actions/reward.d.ts.map +1 -0
- package/dist/wagmi/Actions/reward.js +388 -0
- package/dist/wagmi/Actions/reward.js.map +1 -0
- package/dist/wagmi/Actions/token.d.ts +1546 -0
- package/dist/wagmi/Actions/token.d.ts.map +1 -0
- package/dist/wagmi/Actions/token.js +1712 -0
- package/dist/wagmi/Actions/token.js.map +1 -0
- package/dist/wagmi/Connector.d.ts +73 -0
- package/dist/wagmi/Connector.d.ts.map +1 -0
- package/dist/wagmi/Connector.js +249 -0
- package/dist/wagmi/Connector.js.map +1 -0
- package/dist/wagmi/Hooks/amm.d.ts +421 -0
- package/dist/wagmi/Hooks/amm.d.ts.map +1 -0
- package/dist/wagmi/Hooks/amm.js +504 -0
- package/dist/wagmi/Hooks/amm.js.map +1 -0
- package/dist/wagmi/Hooks/dex.d.ts +816 -0
- package/dist/wagmi/Hooks/dex.d.ts.map +1 -0
- package/dist/wagmi/Hooks/dex.js +973 -0
- package/dist/wagmi/Hooks/dex.js.map +1 -0
- package/dist/wagmi/Hooks/fee.d.ts +97 -0
- package/dist/wagmi/Hooks/fee.d.ts.map +1 -0
- package/dist/wagmi/Hooks/fee.js +109 -0
- package/dist/wagmi/Hooks/fee.js.map +1 -0
- package/dist/wagmi/Hooks/index.d.ts +6 -0
- package/dist/wagmi/Hooks/index.d.ts.map +1 -0
- package/dist/wagmi/Hooks/index.js +6 -0
- package/dist/wagmi/Hooks/index.js.map +1 -0
- package/dist/wagmi/Hooks/reward.d.ts +307 -0
- package/dist/wagmi/Hooks/reward.d.ts.map +1 -0
- package/dist/wagmi/Hooks/reward.js +349 -0
- package/dist/wagmi/Hooks/reward.js.map +1 -0
- package/dist/wagmi/Hooks/token.d.ts +1388 -0
- package/dist/wagmi/Hooks/token.d.ts.map +1 -0
- package/dist/wagmi/Hooks/token.js +1657 -0
- package/dist/wagmi/Hooks/token.js.map +1 -0
- package/dist/wagmi/index.d.ts +4 -0
- package/dist/wagmi/index.d.ts.map +1 -0
- package/dist/wagmi/index.js +4 -0
- package/dist/wagmi/index.js.map +1 -0
- package/package.json +54 -10
- package/src/chains.ts +19 -9
- package/src/ox/Order.test.ts +78 -0
- package/src/ox/Order.ts +125 -0
- package/src/ox/OrdersFilters.test.ts +182 -0
- package/src/ox/OrdersFilters.ts +125 -0
- package/src/ox/Pagination.test.ts +162 -0
- package/src/ox/Pagination.ts +164 -0
- package/src/ox/PoolId.test.ts +33 -0
- package/src/ox/PoolId.ts +27 -0
- package/src/ox/RpcSchema.ts +35 -0
- package/src/ox/SignatureEnvelope.ts +3 -1
- package/src/{viem → ox}/Tick.test.ts +1 -1
- package/src/{viem → ox}/Tick.ts +5 -0
- package/src/ox/Transaction.test.ts +1 -1
- package/src/ox/Transaction.ts +2 -1
- package/src/ox/TransactionEnvelopeAA.test.ts +239 -96
- package/src/ox/TransactionEnvelopeAA.ts +9 -7
- package/src/ox/TransactionRequest.ts +4 -0
- package/src/ox/index.ts +6 -0
- package/src/prool/Instance.ts +75 -38
- package/src/prool/internal/chain.json +104 -52
- package/src/tsconfig.json +9 -0
- package/src/viem/Abis.ts +972 -710
- package/src/viem/Account.ts +279 -0
- package/src/viem/Actions/__snapshots__/dex.test.ts.snap +850 -0
- package/src/viem/Actions/amm.test.ts +98 -169
- package/src/viem/Actions/amm.ts +68 -155
- package/src/viem/Actions/dex.test.ts +563 -484
- package/src/viem/Actions/dex.ts +173 -0
- package/src/viem/Actions/fee.test.ts +23 -34
- package/src/viem/Actions/fee.ts +7 -0
- package/src/viem/Actions/index.ts +1 -0
- package/src/viem/Actions/policy.test.ts +19 -33
- package/src/viem/Actions/reward.test.ts +457 -0
- package/src/viem/Actions/reward.ts +999 -0
- package/src/viem/Actions/token.test.ts +453 -287
- package/src/viem/Actions/token.ts +452 -540
- package/src/viem/Addresses.ts +1 -2
- package/src/viem/Chain.ts +70 -20
- package/src/viem/Decorator.test.ts +2 -1
- package/src/viem/Decorator.ts +996 -421
- package/src/viem/Formatters.ts +31 -5
- package/src/viem/P256.ts +1 -0
- package/src/viem/Secp256k1.ts +1 -0
- package/src/viem/TokenIds.ts +1 -2
- package/src/viem/Transaction.ts +53 -7
- package/src/viem/WebAuthnP256.ts +140 -0
- package/src/viem/WebCryptoP256.ts +1 -0
- package/src/viem/e2e.test.ts +1126 -297
- package/src/viem/index.ts +6 -3
- package/src/viem/internal/account.ts +107 -0
- package/src/viem/internal/types.ts +9 -0
- package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +310 -0
- package/src/wagmi/Actions/amm.test.ts +198 -0
- package/src/wagmi/Actions/amm.ts +691 -0
- package/src/wagmi/Actions/dex.test.ts +1507 -0
- package/src/wagmi/Actions/dex.ts +1640 -0
- package/src/wagmi/Actions/fee.test.ts +63 -0
- package/src/wagmi/Actions/fee.ts +208 -0
- package/src/wagmi/Actions/index.ts +5 -0
- package/src/wagmi/Actions/reward.test.ts +210 -0
- package/src/wagmi/Actions/reward.ts +632 -0
- package/src/wagmi/Actions/token.test.ts +1308 -0
- package/src/wagmi/Actions/token.ts +2613 -0
- package/src/wagmi/Connector.test.ts +53 -0
- package/src/wagmi/Connector.ts +367 -0
- package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +457 -0
- package/src/wagmi/Hooks/amm.test.ts +424 -0
- package/src/wagmi/Hooks/amm.ts +806 -0
- package/src/wagmi/Hooks/dex.test.ts +1017 -0
- package/src/wagmi/Hooks/dex.ts +1685 -0
- package/src/wagmi/Hooks/fee.test.ts +166 -0
- package/src/wagmi/Hooks/fee.ts +206 -0
- package/src/wagmi/Hooks/index.ts +5 -0
- package/src/wagmi/Hooks/reward.test.ts +219 -0
- package/src/wagmi/Hooks/reward.ts +672 -0
- package/src/wagmi/Hooks/token.test.ts +1670 -0
- package/src/wagmi/Hooks/token.ts +2906 -0
- package/src/wagmi/index.ts +3 -0
- package/src/wagmi/internal/types.ts +16 -0
- package/dist/viem/Client.d.ts +0 -27
- package/dist/viem/Client.d.ts.map +0 -1
- package/dist/viem/Client.js +0 -28
- package/dist/viem/Client.js.map +0 -1
- package/dist/viem/Tick.d.ts.map +0 -1
- package/dist/viem/Tick.js.map +0 -1
- package/src/viem/Client.bench-d.ts +0 -8
- package/src/viem/Client.test.ts +0 -178
- package/src/viem/Client.ts +0 -91
- /package/dist/{viem → ox}/Tick.js +0 -0
package/src/viem/Decorator.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as ammActions from './Actions/amm.js'
|
|
|
3
3
|
import * as dexActions from './Actions/dex.js'
|
|
4
4
|
import * as feeActions from './Actions/fee.js'
|
|
5
5
|
import * as policyActions from './Actions/policy.js'
|
|
6
|
+
import * as rewardActions from './Actions/reward.js'
|
|
6
7
|
import * as tokenActions from './Actions/token.js'
|
|
7
8
|
|
|
8
9
|
export type Decorator<
|
|
@@ -10,35 +11,19 @@ export type Decorator<
|
|
|
10
11
|
account extends Account | undefined = Account | undefined,
|
|
11
12
|
> = {
|
|
12
13
|
amm: {
|
|
13
|
-
/**
|
|
14
|
-
* Gets the pool ID for a token pair.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
19
|
-
*
|
|
20
|
-
* const client = createTempoClient()
|
|
21
|
-
*
|
|
22
|
-
* const poolId = await client.amm.getPoolId({
|
|
23
|
-
* userToken: '0x...',
|
|
24
|
-
* validatorToken: '0x...',
|
|
25
|
-
* })
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @param parameters - Parameters.
|
|
29
|
-
* @returns The pool ID.
|
|
30
|
-
*/
|
|
31
|
-
getPoolId: (
|
|
32
|
-
parameters: ammActions.getPoolId.Parameters,
|
|
33
|
-
) => Promise<ammActions.getPoolId.ReturnValue>
|
|
34
14
|
/**
|
|
35
15
|
* Gets the reserves for a liquidity pool.
|
|
36
16
|
*
|
|
37
17
|
* @example
|
|
38
18
|
* ```ts
|
|
39
|
-
* import {
|
|
19
|
+
* import { createClient, http } from 'viem'
|
|
20
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
21
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
40
22
|
*
|
|
41
|
-
* const client =
|
|
23
|
+
* const client = createClient({
|
|
24
|
+
* chain: tempo({ feeToken: '0x20c...001' }),
|
|
25
|
+
* transport: http(),
|
|
26
|
+
* }).extend(tempoActions())
|
|
42
27
|
*
|
|
43
28
|
* const pool = await client.amm.getPool({
|
|
44
29
|
* userToken: '0x...',
|
|
@@ -52,37 +37,19 @@ export type Decorator<
|
|
|
52
37
|
getPool: (
|
|
53
38
|
parameters: ammActions.getPool.Parameters,
|
|
54
39
|
) => Promise<ammActions.getPool.ReturnValue>
|
|
55
|
-
/**
|
|
56
|
-
* Gets the total supply of LP tokens for a pool.
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```ts
|
|
60
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
61
|
-
*
|
|
62
|
-
* const client = createTempoClient()
|
|
63
|
-
*
|
|
64
|
-
* const poolId = await client.amm.getPoolId({
|
|
65
|
-
* userToken: '0x...',
|
|
66
|
-
* validatorToken: '0x...',
|
|
67
|
-
* })
|
|
68
|
-
*
|
|
69
|
-
* const totalSupply = await client.amm.getTotalSupply({ poolId })
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* @param parameters - Parameters.
|
|
73
|
-
* @returns The total supply of LP tokens.
|
|
74
|
-
*/
|
|
75
|
-
getTotalSupply: (
|
|
76
|
-
parameters: ammActions.getTotalSupply.Parameters,
|
|
77
|
-
) => Promise<ammActions.getTotalSupply.ReturnValue>
|
|
78
40
|
/**
|
|
79
41
|
* Gets the LP token balance for an account in a specific pool.
|
|
80
42
|
*
|
|
81
43
|
* @example
|
|
82
44
|
* ```ts
|
|
83
|
-
* import {
|
|
45
|
+
* import { createClient, http } from 'viem'
|
|
46
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
47
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
84
48
|
*
|
|
85
|
-
* const client =
|
|
49
|
+
* const client = createClient({
|
|
50
|
+
* chain: tempo,
|
|
51
|
+
* transport: http(),
|
|
52
|
+
* }).extend(tempoActions())
|
|
86
53
|
*
|
|
87
54
|
* const poolId = await client.amm.getPoolId({
|
|
88
55
|
* userToken: '0x...',
|
|
@@ -106,12 +73,16 @@ export type Decorator<
|
|
|
106
73
|
*
|
|
107
74
|
* @example
|
|
108
75
|
* ```ts
|
|
109
|
-
* import {
|
|
76
|
+
* import { createClient, http } from 'viem'
|
|
110
77
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
78
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
79
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
111
80
|
*
|
|
112
|
-
* const client =
|
|
113
|
-
* account: privateKeyToAccount('0x...')
|
|
114
|
-
*
|
|
81
|
+
* const client = createClient({
|
|
82
|
+
* account: privateKeyToAccount('0x...'),
|
|
83
|
+
* chain: tempo,
|
|
84
|
+
* transport: http(),
|
|
85
|
+
* }).extend(tempoActions())
|
|
115
86
|
*
|
|
116
87
|
* const hash = await client.amm.rebalanceSwap({
|
|
117
88
|
* userToken: '0x...',
|
|
@@ -132,12 +103,16 @@ export type Decorator<
|
|
|
132
103
|
*
|
|
133
104
|
* @example
|
|
134
105
|
* ```ts
|
|
135
|
-
* import {
|
|
106
|
+
* import { createClient, http } from 'viem'
|
|
136
107
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
108
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
109
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
137
110
|
*
|
|
138
|
-
* const client =
|
|
139
|
-
* account: privateKeyToAccount('0x...')
|
|
140
|
-
*
|
|
111
|
+
* const client = createClient({
|
|
112
|
+
* account: privateKeyToAccount('0x...'),
|
|
113
|
+
* chain: tempo,
|
|
114
|
+
* transport: http(),
|
|
115
|
+
* }).extend(tempoActions())
|
|
141
116
|
*
|
|
142
117
|
* const result = await client.amm.rebalanceSwapSync({
|
|
143
118
|
* userToken: '0x...',
|
|
@@ -158,12 +133,16 @@ export type Decorator<
|
|
|
158
133
|
*
|
|
159
134
|
* @example
|
|
160
135
|
* ```ts
|
|
161
|
-
* import {
|
|
136
|
+
* import { createClient, http } from 'viem'
|
|
162
137
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
138
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
139
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
163
140
|
*
|
|
164
|
-
* const client =
|
|
165
|
-
* account: privateKeyToAccount('0x...')
|
|
166
|
-
*
|
|
141
|
+
* const client = createClient({
|
|
142
|
+
* account: privateKeyToAccount('0x...'),
|
|
143
|
+
* chain: tempo,
|
|
144
|
+
* transport: http(),
|
|
145
|
+
* }).extend(tempoActions())
|
|
167
146
|
*
|
|
168
147
|
* const hash = await client.amm.mint({
|
|
169
148
|
* userToken: {
|
|
@@ -189,12 +168,16 @@ export type Decorator<
|
|
|
189
168
|
*
|
|
190
169
|
* @example
|
|
191
170
|
* ```ts
|
|
192
|
-
* import {
|
|
171
|
+
* import { createClient, http } from 'viem'
|
|
193
172
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
173
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
174
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
194
175
|
*
|
|
195
|
-
* const client =
|
|
196
|
-
* account: privateKeyToAccount('0x...')
|
|
197
|
-
*
|
|
176
|
+
* const client = createClient({
|
|
177
|
+
* account: privateKeyToAccount('0x...'),
|
|
178
|
+
* chain: tempo,
|
|
179
|
+
* transport: http(),
|
|
180
|
+
* }).extend(tempoActions())
|
|
198
181
|
*
|
|
199
182
|
* const result = await client.amm.mintSync({
|
|
200
183
|
* userToken: {
|
|
@@ -220,12 +203,16 @@ export type Decorator<
|
|
|
220
203
|
*
|
|
221
204
|
* @example
|
|
222
205
|
* ```ts
|
|
223
|
-
* import {
|
|
206
|
+
* import { createClient, http } from 'viem'
|
|
224
207
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
208
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
209
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
225
210
|
*
|
|
226
|
-
* const client =
|
|
227
|
-
* account: privateKeyToAccount('0x...')
|
|
228
|
-
*
|
|
211
|
+
* const client = createClient({
|
|
212
|
+
* account: privateKeyToAccount('0x...'),
|
|
213
|
+
* chain: tempo,
|
|
214
|
+
* transport: http(),
|
|
215
|
+
* }).extend(tempoActions())
|
|
229
216
|
*
|
|
230
217
|
* const hash = await client.amm.burn({
|
|
231
218
|
* userToken: '0x...',
|
|
@@ -246,12 +233,16 @@ export type Decorator<
|
|
|
246
233
|
*
|
|
247
234
|
* @example
|
|
248
235
|
* ```ts
|
|
249
|
-
* import {
|
|
236
|
+
* import { createClient, http } from 'viem'
|
|
250
237
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
238
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
239
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
251
240
|
*
|
|
252
|
-
* const client =
|
|
253
|
-
* account: privateKeyToAccount('0x...')
|
|
254
|
-
*
|
|
241
|
+
* const client = createClient({
|
|
242
|
+
* account: privateKeyToAccount('0x...'),
|
|
243
|
+
* chain: tempo,
|
|
244
|
+
* transport: http(),
|
|
245
|
+
* }).extend(tempoActions())
|
|
255
246
|
*
|
|
256
247
|
* const result = await client.amm.burnSync({
|
|
257
248
|
* userToken: '0x...',
|
|
@@ -272,9 +263,14 @@ export type Decorator<
|
|
|
272
263
|
*
|
|
273
264
|
* @example
|
|
274
265
|
* ```ts
|
|
275
|
-
* import {
|
|
266
|
+
* import { createClient, http } from 'viem'
|
|
267
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
268
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
276
269
|
*
|
|
277
|
-
* const client =
|
|
270
|
+
* const client = createClient({
|
|
271
|
+
* chain: tempo,
|
|
272
|
+
* transport: http(),
|
|
273
|
+
* }).extend(tempoActions())
|
|
278
274
|
*
|
|
279
275
|
* const unwatch = client.amm.watchRebalanceSwap({
|
|
280
276
|
* onRebalanceSwap: (args, log) => {
|
|
@@ -294,9 +290,14 @@ export type Decorator<
|
|
|
294
290
|
*
|
|
295
291
|
* @example
|
|
296
292
|
* ```ts
|
|
297
|
-
* import {
|
|
293
|
+
* import { createClient, http } from 'viem'
|
|
294
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
295
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
298
296
|
*
|
|
299
|
-
* const client =
|
|
297
|
+
* const client = createClient({
|
|
298
|
+
* chain: tempo,
|
|
299
|
+
* transport: http(),
|
|
300
|
+
* }).extend(tempoActions())
|
|
300
301
|
*
|
|
301
302
|
* const unwatch = client.amm.watchFeeSwap({
|
|
302
303
|
* onFeeSwap: (args, log) => {
|
|
@@ -314,9 +315,14 @@ export type Decorator<
|
|
|
314
315
|
*
|
|
315
316
|
* @example
|
|
316
317
|
* ```ts
|
|
317
|
-
* import {
|
|
318
|
+
* import { createClient, http } from 'viem'
|
|
319
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
320
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
318
321
|
*
|
|
319
|
-
* const client =
|
|
322
|
+
* const client = createClient({
|
|
323
|
+
* chain: tempo,
|
|
324
|
+
* transport: http(),
|
|
325
|
+
* }).extend(tempoActions())
|
|
320
326
|
*
|
|
321
327
|
* const unwatch = client.amm.watchMint({
|
|
322
328
|
* onMint: (args, log) => {
|
|
@@ -334,9 +340,14 @@ export type Decorator<
|
|
|
334
340
|
*
|
|
335
341
|
* @example
|
|
336
342
|
* ```ts
|
|
337
|
-
* import {
|
|
343
|
+
* import { createClient, http } from 'viem'
|
|
344
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
345
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
338
346
|
*
|
|
339
|
-
* const client =
|
|
347
|
+
* const client = createClient({
|
|
348
|
+
* chain: tempo,
|
|
349
|
+
* transport: http(),
|
|
350
|
+
* }).extend(tempoActions())
|
|
340
351
|
*
|
|
341
352
|
* const unwatch = client.amm.watchBurn({
|
|
342
353
|
* onBurn: (args, log) => {
|
|
@@ -356,12 +367,16 @@ export type Decorator<
|
|
|
356
367
|
*
|
|
357
368
|
* @example
|
|
358
369
|
* ```ts
|
|
359
|
-
* import {
|
|
370
|
+
* import { createClient, http } from 'viem'
|
|
360
371
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
372
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
373
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
361
374
|
*
|
|
362
|
-
* const client =
|
|
363
|
-
* account: privateKeyToAccount('0x...')
|
|
364
|
-
*
|
|
375
|
+
* const client = createClient({
|
|
376
|
+
* account: privateKeyToAccount('0x...'),
|
|
377
|
+
* chain: tempo,
|
|
378
|
+
* transport: http(),
|
|
379
|
+
* }).extend(tempoActions())
|
|
365
380
|
*
|
|
366
381
|
* const hash = await client.dex.buy({
|
|
367
382
|
* tokenIn: '0x20c...11',
|
|
@@ -382,12 +397,16 @@ export type Decorator<
|
|
|
382
397
|
*
|
|
383
398
|
* @example
|
|
384
399
|
* ```ts
|
|
385
|
-
* import {
|
|
400
|
+
* import { createClient, http } from 'viem'
|
|
386
401
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
402
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
403
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
387
404
|
*
|
|
388
|
-
* const client =
|
|
389
|
-
* account: privateKeyToAccount('0x...')
|
|
390
|
-
*
|
|
405
|
+
* const client = createClient({
|
|
406
|
+
* account: privateKeyToAccount('0x...'),
|
|
407
|
+
* chain: tempo,
|
|
408
|
+
* transport: http(),
|
|
409
|
+
* }).extend(tempoActions())
|
|
391
410
|
*
|
|
392
411
|
* const result = await client.dex.buySync({
|
|
393
412
|
* tokenIn: '0x20c...11',
|
|
@@ -408,12 +427,16 @@ export type Decorator<
|
|
|
408
427
|
*
|
|
409
428
|
* @example
|
|
410
429
|
* ```ts
|
|
411
|
-
* import {
|
|
430
|
+
* import { createClient, http } from 'viem'
|
|
412
431
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
432
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
433
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
413
434
|
*
|
|
414
|
-
* const client =
|
|
415
|
-
* account: privateKeyToAccount('0x...')
|
|
416
|
-
*
|
|
435
|
+
* const client = createClient({
|
|
436
|
+
* account: privateKeyToAccount('0x...'),
|
|
437
|
+
* chain: tempo,
|
|
438
|
+
* transport: http(),
|
|
439
|
+
* }).extend(tempoActions())
|
|
417
440
|
*
|
|
418
441
|
* const hash = await client.dex.cancel({
|
|
419
442
|
* orderId: 123n,
|
|
@@ -431,12 +454,16 @@ export type Decorator<
|
|
|
431
454
|
*
|
|
432
455
|
* @example
|
|
433
456
|
* ```ts
|
|
434
|
-
* import {
|
|
457
|
+
* import { createClient, http } from 'viem'
|
|
435
458
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
459
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
460
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
436
461
|
*
|
|
437
|
-
* const client =
|
|
438
|
-
* account: privateKeyToAccount('0x...')
|
|
439
|
-
*
|
|
462
|
+
* const client = createClient({
|
|
463
|
+
* account: privateKeyToAccount('0x...'),
|
|
464
|
+
* chain: tempo,
|
|
465
|
+
* transport: http(),
|
|
466
|
+
* }).extend(tempoActions())
|
|
440
467
|
*
|
|
441
468
|
* const result = await client.dex.cancelSync({
|
|
442
469
|
* orderId: 123n,
|
|
@@ -454,12 +481,16 @@ export type Decorator<
|
|
|
454
481
|
*
|
|
455
482
|
* @example
|
|
456
483
|
* ```ts
|
|
457
|
-
* import {
|
|
484
|
+
* import { createClient, http } from 'viem'
|
|
458
485
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
486
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
487
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
459
488
|
*
|
|
460
|
-
* const client =
|
|
461
|
-
* account: privateKeyToAccount('0x...')
|
|
462
|
-
*
|
|
489
|
+
* const client = createClient({
|
|
490
|
+
* account: privateKeyToAccount('0x...'),
|
|
491
|
+
* chain: tempo,
|
|
492
|
+
* transport: http(),
|
|
493
|
+
* }).extend(tempoActions())
|
|
463
494
|
*
|
|
464
495
|
* const hash = await client.dex.createPair({
|
|
465
496
|
* base: '0x20c...11',
|
|
@@ -477,12 +508,16 @@ export type Decorator<
|
|
|
477
508
|
*
|
|
478
509
|
* @example
|
|
479
510
|
* ```ts
|
|
480
|
-
* import {
|
|
511
|
+
* import { createClient, http } from 'viem'
|
|
481
512
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
513
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
514
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
482
515
|
*
|
|
483
|
-
* const client =
|
|
484
|
-
* account: privateKeyToAccount('0x...')
|
|
485
|
-
*
|
|
516
|
+
* const client = createClient({
|
|
517
|
+
* account: privateKeyToAccount('0x...'),
|
|
518
|
+
* chain: tempo,
|
|
519
|
+
* transport: http(),
|
|
520
|
+
* }).extend(tempoActions())
|
|
486
521
|
*
|
|
487
522
|
* const result = await client.dex.createPairSync({
|
|
488
523
|
* base: '0x20c...11',
|
|
@@ -500,9 +535,14 @@ export type Decorator<
|
|
|
500
535
|
*
|
|
501
536
|
* @example
|
|
502
537
|
* ```ts
|
|
503
|
-
* import {
|
|
538
|
+
* import { createClient, http } from 'viem'
|
|
539
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
540
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
504
541
|
*
|
|
505
|
-
* const client =
|
|
542
|
+
* const client = createClient({
|
|
543
|
+
* chain: tempo,
|
|
544
|
+
* transport: http(),
|
|
545
|
+
* }).extend(tempoActions())
|
|
506
546
|
*
|
|
507
547
|
* const balance = await client.dex.getBalance({
|
|
508
548
|
* account: '0x...',
|
|
@@ -521,9 +561,14 @@ export type Decorator<
|
|
|
521
561
|
*
|
|
522
562
|
* @example
|
|
523
563
|
* ```ts
|
|
524
|
-
* import {
|
|
564
|
+
* import { createClient, http } from 'viem'
|
|
565
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
566
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
525
567
|
*
|
|
526
|
-
* const client =
|
|
568
|
+
* const client = createClient({
|
|
569
|
+
* chain: tempo,
|
|
570
|
+
* transport: http(),
|
|
571
|
+
* }).extend(tempoActions())
|
|
527
572
|
*
|
|
528
573
|
* const amountIn = await client.dex.getBuyQuote({
|
|
529
574
|
* tokenIn: '0x20c...11',
|
|
@@ -543,9 +588,14 @@ export type Decorator<
|
|
|
543
588
|
*
|
|
544
589
|
* @example
|
|
545
590
|
* ```ts
|
|
546
|
-
* import {
|
|
591
|
+
* import { createClient, http } from 'viem'
|
|
592
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
593
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
547
594
|
*
|
|
548
|
-
* const client =
|
|
595
|
+
* const client = createClient({
|
|
596
|
+
* chain: tempo,
|
|
597
|
+
* transport: http(),
|
|
598
|
+
* }).extend(tempoActions())
|
|
549
599
|
*
|
|
550
600
|
* const order = await client.dex.getOrder({
|
|
551
601
|
* orderId: 123n,
|
|
@@ -558,14 +608,48 @@ export type Decorator<
|
|
|
558
608
|
getOrder: (
|
|
559
609
|
parameters: dexActions.getOrder.Parameters,
|
|
560
610
|
) => Promise<dexActions.getOrder.ReturnValue>
|
|
611
|
+
/**
|
|
612
|
+
* Gets paginated orders from the orderbook.
|
|
613
|
+
*
|
|
614
|
+
* @example
|
|
615
|
+
* ```ts
|
|
616
|
+
* import { createClient, http } from 'viem'
|
|
617
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
618
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
619
|
+
*
|
|
620
|
+
* const client = createClient({
|
|
621
|
+
* chain: tempo,
|
|
622
|
+
* transport: http(),
|
|
623
|
+
* }).extend(tempoActions())
|
|
624
|
+
*
|
|
625
|
+
* const { orders, nextCursor } = await client.dex.getOrders({
|
|
626
|
+
* limit: 100,
|
|
627
|
+
* filters: {
|
|
628
|
+
* baseToken: '0x20c0...',
|
|
629
|
+
* isBid: true,
|
|
630
|
+
* }
|
|
631
|
+
* })
|
|
632
|
+
* ```
|
|
633
|
+
*
|
|
634
|
+
* @param parameters - Parameters.
|
|
635
|
+
* @returns Paginated orders and next cursor.
|
|
636
|
+
*/
|
|
637
|
+
getOrders: (
|
|
638
|
+
parameters?: dexActions.getOrders.Parameters,
|
|
639
|
+
) => Promise<dexActions.getOrders.ReturnValue>
|
|
561
640
|
/**
|
|
562
641
|
* Gets the price level information at a specific tick.
|
|
563
642
|
*
|
|
564
643
|
* @example
|
|
565
644
|
* ```ts
|
|
566
|
-
* import {
|
|
645
|
+
* import { createClient, http } from 'viem'
|
|
646
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
647
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
567
648
|
*
|
|
568
|
-
* const client =
|
|
649
|
+
* const client = createClient({
|
|
650
|
+
* chain: tempo,
|
|
651
|
+
* transport: http(),
|
|
652
|
+
* }).extend(tempoActions())
|
|
569
653
|
*
|
|
570
654
|
* const level = await client.dex.getPriceLevel({
|
|
571
655
|
* base: '0x20c...11',
|
|
@@ -585,9 +669,14 @@ export type Decorator<
|
|
|
585
669
|
*
|
|
586
670
|
* @example
|
|
587
671
|
* ```ts
|
|
588
|
-
* import {
|
|
672
|
+
* import { createClient, http } from 'viem'
|
|
673
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
674
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
589
675
|
*
|
|
590
|
-
* const client =
|
|
676
|
+
* const client = createClient({
|
|
677
|
+
* chain: tempo,
|
|
678
|
+
* transport: http(),
|
|
679
|
+
* }).extend(tempoActions())
|
|
591
680
|
*
|
|
592
681
|
* const amountOut = await client.dex.getSellQuote({
|
|
593
682
|
* tokenIn: '0x20c...11',
|
|
@@ -607,12 +696,16 @@ export type Decorator<
|
|
|
607
696
|
*
|
|
608
697
|
* @example
|
|
609
698
|
* ```ts
|
|
610
|
-
* import {
|
|
699
|
+
* import { createClient, http } from 'viem'
|
|
611
700
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
701
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
702
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
612
703
|
*
|
|
613
|
-
* const client =
|
|
614
|
-
* account: privateKeyToAccount('0x...')
|
|
615
|
-
*
|
|
704
|
+
* const client = createClient({
|
|
705
|
+
* account: privateKeyToAccount('0x...'),
|
|
706
|
+
* chain: tempo,
|
|
707
|
+
* transport: http(),
|
|
708
|
+
* }).extend(tempoActions())
|
|
616
709
|
*
|
|
617
710
|
* const hash = await client.dex.place({
|
|
618
711
|
* token: '0x20c...11',
|
|
@@ -633,12 +726,16 @@ export type Decorator<
|
|
|
633
726
|
*
|
|
634
727
|
* @example
|
|
635
728
|
* ```ts
|
|
636
|
-
* import {
|
|
729
|
+
* import { createClient, http } from 'viem'
|
|
637
730
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
731
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
732
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
638
733
|
*
|
|
639
|
-
* const client =
|
|
640
|
-
* account: privateKeyToAccount('0x...')
|
|
641
|
-
*
|
|
734
|
+
* const client = createClient({
|
|
735
|
+
* account: privateKeyToAccount('0x...'),
|
|
736
|
+
* chain: tempo,
|
|
737
|
+
* transport: http(),
|
|
738
|
+
* }).extend(tempoActions())
|
|
642
739
|
*
|
|
643
740
|
* const result = await client.dex.placeSync({
|
|
644
741
|
* token: '0x20c...11',
|
|
@@ -659,12 +756,16 @@ export type Decorator<
|
|
|
659
756
|
*
|
|
660
757
|
* @example
|
|
661
758
|
* ```ts
|
|
662
|
-
* import {
|
|
759
|
+
* import { createClient, http } from 'viem'
|
|
663
760
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
761
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
762
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
664
763
|
*
|
|
665
|
-
* const client =
|
|
666
|
-
* account: privateKeyToAccount('0x...')
|
|
667
|
-
*
|
|
764
|
+
* const client = createClient({
|
|
765
|
+
* account: privateKeyToAccount('0x...'),
|
|
766
|
+
* chain: tempo,
|
|
767
|
+
* transport: http(),
|
|
768
|
+
* }).extend(tempoActions())
|
|
668
769
|
*
|
|
669
770
|
* const hash = await client.dex.placeFlip({
|
|
670
771
|
* token: '0x20c...11',
|
|
@@ -686,12 +787,16 @@ export type Decorator<
|
|
|
686
787
|
*
|
|
687
788
|
* @example
|
|
688
789
|
* ```ts
|
|
689
|
-
* import {
|
|
790
|
+
* import { createClient, http } from 'viem'
|
|
690
791
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
792
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
793
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
691
794
|
*
|
|
692
|
-
* const client =
|
|
693
|
-
* account: privateKeyToAccount('0x...')
|
|
694
|
-
*
|
|
795
|
+
* const client = createClient({
|
|
796
|
+
* account: privateKeyToAccount('0x...'),
|
|
797
|
+
* chain: tempo,
|
|
798
|
+
* transport: http(),
|
|
799
|
+
* }).extend(tempoActions())
|
|
695
800
|
*
|
|
696
801
|
* const result = await client.dex.placeFlipSync({
|
|
697
802
|
* token: '0x20c...11',
|
|
@@ -713,12 +818,16 @@ export type Decorator<
|
|
|
713
818
|
*
|
|
714
819
|
* @example
|
|
715
820
|
* ```ts
|
|
716
|
-
* import {
|
|
821
|
+
* import { createClient, http } from 'viem'
|
|
717
822
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
823
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
824
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
718
825
|
*
|
|
719
|
-
* const client =
|
|
720
|
-
* account: privateKeyToAccount('0x...')
|
|
721
|
-
*
|
|
826
|
+
* const client = createClient({
|
|
827
|
+
* account: privateKeyToAccount('0x...'),
|
|
828
|
+
* chain: tempo,
|
|
829
|
+
* transport: http(),
|
|
830
|
+
* }).extend(tempoActions())
|
|
722
831
|
*
|
|
723
832
|
* const hash = await client.dex.sell({
|
|
724
833
|
* tokenIn: '0x20c...11',
|
|
@@ -739,12 +848,16 @@ export type Decorator<
|
|
|
739
848
|
*
|
|
740
849
|
* @example
|
|
741
850
|
* ```ts
|
|
742
|
-
* import {
|
|
851
|
+
* import { createClient, http } from 'viem'
|
|
743
852
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
853
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
854
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
744
855
|
*
|
|
745
|
-
* const client =
|
|
746
|
-
* account: privateKeyToAccount('0x...')
|
|
747
|
-
*
|
|
856
|
+
* const client = createClient({
|
|
857
|
+
* account: privateKeyToAccount('0x...'),
|
|
858
|
+
* chain: tempo,
|
|
859
|
+
* transport: http(),
|
|
860
|
+
* }).extend(tempoActions())
|
|
748
861
|
*
|
|
749
862
|
* const result = await client.dex.sellSync({
|
|
750
863
|
* tokenIn: '0x20c...11',
|
|
@@ -765,12 +878,16 @@ export type Decorator<
|
|
|
765
878
|
*
|
|
766
879
|
* @example
|
|
767
880
|
* ```ts
|
|
768
|
-
* import {
|
|
881
|
+
* import { createClient, http } from 'viem'
|
|
769
882
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
883
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
884
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
770
885
|
*
|
|
771
|
-
* const client =
|
|
772
|
-
* account: privateKeyToAccount('0x...')
|
|
773
|
-
*
|
|
886
|
+
* const client = createClient({
|
|
887
|
+
* account: privateKeyToAccount('0x...'),
|
|
888
|
+
* chain: tempo,
|
|
889
|
+
* transport: http(),
|
|
890
|
+
* }).extend(tempoActions())
|
|
774
891
|
*
|
|
775
892
|
* const hash = await client.dex.withdraw({
|
|
776
893
|
* token: '0x20c...11',
|
|
@@ -789,12 +906,16 @@ export type Decorator<
|
|
|
789
906
|
*
|
|
790
907
|
* @example
|
|
791
908
|
* ```ts
|
|
792
|
-
* import {
|
|
909
|
+
* import { createClient, http } from 'viem'
|
|
793
910
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
911
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
912
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
794
913
|
*
|
|
795
|
-
* const client =
|
|
796
|
-
* account: privateKeyToAccount('0x...')
|
|
797
|
-
*
|
|
914
|
+
* const client = createClient({
|
|
915
|
+
* account: privateKeyToAccount('0x...'),
|
|
916
|
+
* chain: tempo,
|
|
917
|
+
* transport: http(),
|
|
918
|
+
* }).extend(tempoActions())
|
|
798
919
|
*
|
|
799
920
|
* const result = await client.dex.withdrawSync({
|
|
800
921
|
* token: '0x20c...11',
|
|
@@ -813,9 +934,14 @@ export type Decorator<
|
|
|
813
934
|
*
|
|
814
935
|
* @example
|
|
815
936
|
* ```ts
|
|
816
|
-
* import {
|
|
937
|
+
* import { createClient, http } from 'viem'
|
|
938
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
939
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
817
940
|
*
|
|
818
|
-
* const client =
|
|
941
|
+
* const client = createClient({
|
|
942
|
+
* chain: tempo,
|
|
943
|
+
* transport: http(),
|
|
944
|
+
* }).extend(tempoActions())
|
|
819
945
|
*
|
|
820
946
|
* const unwatch = client.dex.watchFlipOrderPlaced({
|
|
821
947
|
* onFlipOrderPlaced: (args, log) => {
|
|
@@ -835,9 +961,14 @@ export type Decorator<
|
|
|
835
961
|
*
|
|
836
962
|
* @example
|
|
837
963
|
* ```ts
|
|
838
|
-
* import {
|
|
964
|
+
* import { createClient, http } from 'viem'
|
|
965
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
966
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
839
967
|
*
|
|
840
|
-
* const client =
|
|
968
|
+
* const client = createClient({
|
|
969
|
+
* chain: tempo,
|
|
970
|
+
* transport: http(),
|
|
971
|
+
* }).extend(tempoActions())
|
|
841
972
|
*
|
|
842
973
|
* const unwatch = client.dex.watchOrderCancelled({
|
|
843
974
|
* onOrderCancelled: (args, log) => {
|
|
@@ -857,9 +988,14 @@ export type Decorator<
|
|
|
857
988
|
*
|
|
858
989
|
* @example
|
|
859
990
|
* ```ts
|
|
860
|
-
* import {
|
|
991
|
+
* import { createClient, http } from 'viem'
|
|
992
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
993
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
861
994
|
*
|
|
862
|
-
* const client =
|
|
995
|
+
* const client = createClient({
|
|
996
|
+
* chain: tempo,
|
|
997
|
+
* transport: http(),
|
|
998
|
+
* }).extend(tempoActions())
|
|
863
999
|
*
|
|
864
1000
|
* const unwatch = client.dex.watchOrderFilled({
|
|
865
1001
|
* onOrderFilled: (args, log) => {
|
|
@@ -879,9 +1015,14 @@ export type Decorator<
|
|
|
879
1015
|
*
|
|
880
1016
|
* @example
|
|
881
1017
|
* ```ts
|
|
882
|
-
* import {
|
|
1018
|
+
* import { createClient, http } from 'viem'
|
|
1019
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1020
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
883
1021
|
*
|
|
884
|
-
* const client =
|
|
1022
|
+
* const client = createClient({
|
|
1023
|
+
* chain: tempo,
|
|
1024
|
+
* transport: http(),
|
|
1025
|
+
* }).extend(tempoActions())
|
|
885
1026
|
*
|
|
886
1027
|
* const unwatch = client.dex.watchOrderPlaced({
|
|
887
1028
|
* onOrderPlaced: (args, log) => {
|
|
@@ -903,12 +1044,16 @@ export type Decorator<
|
|
|
903
1044
|
*
|
|
904
1045
|
* @example
|
|
905
1046
|
* ```ts
|
|
906
|
-
* import {
|
|
1047
|
+
* import { createClient, http } from 'viem'
|
|
907
1048
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1049
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1050
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
908
1051
|
*
|
|
909
|
-
* const client =
|
|
910
|
-
* account: privateKeyToAccount('0x...')
|
|
911
|
-
*
|
|
1052
|
+
* const client = createClient({
|
|
1053
|
+
* account: privateKeyToAccount('0x...'),
|
|
1054
|
+
* chain: tempo,
|
|
1055
|
+
* transport: http(),
|
|
1056
|
+
* }).extend(tempoActions())
|
|
912
1057
|
*
|
|
913
1058
|
* const { address, id } = await client.token.getUserToken()
|
|
914
1059
|
* ```
|
|
@@ -927,12 +1072,16 @@ export type Decorator<
|
|
|
927
1072
|
*
|
|
928
1073
|
* @example
|
|
929
1074
|
* ```ts
|
|
930
|
-
* import {
|
|
1075
|
+
* import { createClient, http } from 'viem'
|
|
931
1076
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1077
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1078
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
932
1079
|
*
|
|
933
|
-
* const client =
|
|
934
|
-
* account: privateKeyToAccount('0x...')
|
|
935
|
-
*
|
|
1080
|
+
* const client = createClient({
|
|
1081
|
+
* account: privateKeyToAccount('0x...'),
|
|
1082
|
+
* chain: tempo,
|
|
1083
|
+
* transport: http(),
|
|
1084
|
+
* }).extend(tempoActions())
|
|
936
1085
|
*
|
|
937
1086
|
* const hash = await client.token.setUserToken({
|
|
938
1087
|
* token: '0x...',
|
|
@@ -951,12 +1100,16 @@ export type Decorator<
|
|
|
951
1100
|
*
|
|
952
1101
|
* @example
|
|
953
1102
|
* ```ts
|
|
954
|
-
* import {
|
|
1103
|
+
* import { createClient, http } from 'viem'
|
|
955
1104
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1105
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1106
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
956
1107
|
*
|
|
957
|
-
* const client =
|
|
958
|
-
* account: privateKeyToAccount('0x...')
|
|
959
|
-
*
|
|
1108
|
+
* const client = createClient({
|
|
1109
|
+
* account: privateKeyToAccount('0x...'),
|
|
1110
|
+
* chain: tempo,
|
|
1111
|
+
* transport: http(),
|
|
1112
|
+
* }).extend(tempoActions())
|
|
960
1113
|
*
|
|
961
1114
|
* const result = await client.fee.setUserTokenSync({
|
|
962
1115
|
* token: '0x...',
|
|
@@ -974,9 +1127,14 @@ export type Decorator<
|
|
|
974
1127
|
*
|
|
975
1128
|
* @example
|
|
976
1129
|
* ```ts
|
|
977
|
-
* import {
|
|
1130
|
+
* import { createClient, http } from 'viem'
|
|
1131
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1132
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
978
1133
|
*
|
|
979
|
-
* const client =
|
|
1134
|
+
* const client = createClient({
|
|
1135
|
+
* chain: tempo,
|
|
1136
|
+
* transport: http(),
|
|
1137
|
+
* }).extend(tempoActions())
|
|
980
1138
|
*
|
|
981
1139
|
* const unwatch = client.token.watchSetUserToken({
|
|
982
1140
|
* onUserTokenSet: (args, log) => {
|
|
@@ -999,12 +1157,16 @@ export type Decorator<
|
|
|
999
1157
|
*
|
|
1000
1158
|
* @example
|
|
1001
1159
|
* ```ts
|
|
1002
|
-
* import {
|
|
1160
|
+
* import { createClient, http } from 'viem'
|
|
1003
1161
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1162
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1163
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1004
1164
|
*
|
|
1005
|
-
* const client =
|
|
1006
|
-
* account: privateKeyToAccount('0x...')
|
|
1007
|
-
*
|
|
1165
|
+
* const client = createClient({
|
|
1166
|
+
* account: privateKeyToAccount('0x...'),
|
|
1167
|
+
* chain: tempo,
|
|
1168
|
+
* transport: http(),
|
|
1169
|
+
* }).extend(tempoActions())
|
|
1008
1170
|
*
|
|
1009
1171
|
* const hash = await client.policy.create({
|
|
1010
1172
|
* admin: '0x...',
|
|
@@ -1023,12 +1185,16 @@ export type Decorator<
|
|
|
1023
1185
|
*
|
|
1024
1186
|
* @example
|
|
1025
1187
|
* ```ts
|
|
1026
|
-
* import {
|
|
1188
|
+
* import { createClient, http } from 'viem'
|
|
1027
1189
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1190
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1191
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1028
1192
|
*
|
|
1029
|
-
* const client =
|
|
1030
|
-
* account: privateKeyToAccount('0x...')
|
|
1031
|
-
*
|
|
1193
|
+
* const client = createClient({
|
|
1194
|
+
* account: privateKeyToAccount('0x...'),
|
|
1195
|
+
* chain: tempo,
|
|
1196
|
+
* transport: http(),
|
|
1197
|
+
* }).extend(tempoActions())
|
|
1032
1198
|
*
|
|
1033
1199
|
* const result = await client.policy.createSync({
|
|
1034
1200
|
* admin: '0x...',
|
|
@@ -1047,12 +1213,16 @@ export type Decorator<
|
|
|
1047
1213
|
*
|
|
1048
1214
|
* @example
|
|
1049
1215
|
* ```ts
|
|
1050
|
-
* import {
|
|
1216
|
+
* import { createClient, http } from 'viem'
|
|
1051
1217
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1218
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1219
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1052
1220
|
*
|
|
1053
|
-
* const client =
|
|
1054
|
-
* account: privateKeyToAccount('0x...')
|
|
1055
|
-
*
|
|
1221
|
+
* const client = createClient({
|
|
1222
|
+
* account: privateKeyToAccount('0x...'),
|
|
1223
|
+
* chain: tempo,
|
|
1224
|
+
* transport: http(),
|
|
1225
|
+
* }).extend(tempoActions())
|
|
1056
1226
|
*
|
|
1057
1227
|
* const hash = await client.policy.setAdmin({
|
|
1058
1228
|
* policyId: 2n,
|
|
@@ -1071,12 +1241,16 @@ export type Decorator<
|
|
|
1071
1241
|
*
|
|
1072
1242
|
* @example
|
|
1073
1243
|
* ```ts
|
|
1074
|
-
* import {
|
|
1244
|
+
* import { createClient, http } from 'viem'
|
|
1075
1245
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1246
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1247
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1076
1248
|
*
|
|
1077
|
-
* const client =
|
|
1078
|
-
* account: privateKeyToAccount('0x...')
|
|
1079
|
-
*
|
|
1249
|
+
* const client = createClient({
|
|
1250
|
+
* account: privateKeyToAccount('0x...'),
|
|
1251
|
+
* chain: tempo,
|
|
1252
|
+
* transport: http(),
|
|
1253
|
+
* }).extend(tempoActions())
|
|
1080
1254
|
*
|
|
1081
1255
|
* const result = await client.policy.setAdminSync({
|
|
1082
1256
|
* policyId: 2n,
|
|
@@ -1095,12 +1269,16 @@ export type Decorator<
|
|
|
1095
1269
|
*
|
|
1096
1270
|
* @example
|
|
1097
1271
|
* ```ts
|
|
1098
|
-
* import {
|
|
1272
|
+
* import { createClient, http } from 'viem'
|
|
1099
1273
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1274
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1275
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1100
1276
|
*
|
|
1101
|
-
* const client =
|
|
1102
|
-
* account: privateKeyToAccount('0x...')
|
|
1103
|
-
*
|
|
1277
|
+
* const client = createClient({
|
|
1278
|
+
* account: privateKeyToAccount('0x...'),
|
|
1279
|
+
* chain: tempo,
|
|
1280
|
+
* transport: http(),
|
|
1281
|
+
* }).extend(tempoActions())
|
|
1104
1282
|
*
|
|
1105
1283
|
* const hash = await client.policy.modifyWhitelist({
|
|
1106
1284
|
* policyId: 2n,
|
|
@@ -1120,12 +1298,16 @@ export type Decorator<
|
|
|
1120
1298
|
*
|
|
1121
1299
|
* @example
|
|
1122
1300
|
* ```ts
|
|
1123
|
-
* import {
|
|
1301
|
+
* import { createClient, http } from 'viem'
|
|
1124
1302
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1303
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1304
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1125
1305
|
*
|
|
1126
|
-
* const client =
|
|
1127
|
-
* account: privateKeyToAccount('0x...')
|
|
1128
|
-
*
|
|
1306
|
+
* const client = createClient({
|
|
1307
|
+
* account: privateKeyToAccount('0x...'),
|
|
1308
|
+
* chain: tempo,
|
|
1309
|
+
* transport: http(),
|
|
1310
|
+
* }).extend(tempoActions())
|
|
1129
1311
|
*
|
|
1130
1312
|
* const result = await client.policy.modifyWhitelistSync({
|
|
1131
1313
|
* policyId: 2n,
|
|
@@ -1145,12 +1327,16 @@ export type Decorator<
|
|
|
1145
1327
|
*
|
|
1146
1328
|
* @example
|
|
1147
1329
|
* ```ts
|
|
1148
|
-
* import {
|
|
1330
|
+
* import { createClient, http } from 'viem'
|
|
1149
1331
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1332
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1333
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1150
1334
|
*
|
|
1151
|
-
* const client =
|
|
1152
|
-
* account: privateKeyToAccount('0x...')
|
|
1153
|
-
*
|
|
1335
|
+
* const client = createClient({
|
|
1336
|
+
* account: privateKeyToAccount('0x...'),
|
|
1337
|
+
* chain: tempo,
|
|
1338
|
+
* transport: http(),
|
|
1339
|
+
* }).extend(tempoActions())
|
|
1154
1340
|
*
|
|
1155
1341
|
* const hash = await client.policy.modifyBlacklist({
|
|
1156
1342
|
* policyId: 2n,
|
|
@@ -1170,12 +1356,16 @@ export type Decorator<
|
|
|
1170
1356
|
*
|
|
1171
1357
|
* @example
|
|
1172
1358
|
* ```ts
|
|
1173
|
-
* import {
|
|
1359
|
+
* import { createClient, http } from 'viem'
|
|
1174
1360
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1361
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1362
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1175
1363
|
*
|
|
1176
|
-
* const client =
|
|
1177
|
-
* account: privateKeyToAccount('0x...')
|
|
1178
|
-
*
|
|
1364
|
+
* const client = createClient({
|
|
1365
|
+
* account: privateKeyToAccount('0x...'),
|
|
1366
|
+
* chain: tempo,
|
|
1367
|
+
* transport: http(),
|
|
1368
|
+
* }).extend(tempoActions())
|
|
1179
1369
|
*
|
|
1180
1370
|
* const result = await client.policy.modifyBlacklistSync({
|
|
1181
1371
|
* policyId: 2n,
|
|
@@ -1195,9 +1385,14 @@ export type Decorator<
|
|
|
1195
1385
|
*
|
|
1196
1386
|
* @example
|
|
1197
1387
|
* ```ts
|
|
1198
|
-
* import {
|
|
1388
|
+
* import { createClient, http } from 'viem'
|
|
1389
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1390
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1199
1391
|
*
|
|
1200
|
-
* const client =
|
|
1392
|
+
* const client = createClient({
|
|
1393
|
+
* chain: tempo,
|
|
1394
|
+
* transport: http(),
|
|
1395
|
+
* }).extend(tempoActions())
|
|
1201
1396
|
*
|
|
1202
1397
|
* const data = await client.policy.getData({
|
|
1203
1398
|
* policyId: 2n,
|
|
@@ -1215,9 +1410,14 @@ export type Decorator<
|
|
|
1215
1410
|
*
|
|
1216
1411
|
* @example
|
|
1217
1412
|
* ```ts
|
|
1218
|
-
* import {
|
|
1413
|
+
* import { createClient, http } from 'viem'
|
|
1414
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1415
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1219
1416
|
*
|
|
1220
|
-
* const client =
|
|
1417
|
+
* const client = createClient({
|
|
1418
|
+
* chain: tempo,
|
|
1419
|
+
* transport: http(),
|
|
1420
|
+
* }).extend(tempoActions())
|
|
1221
1421
|
*
|
|
1222
1422
|
* const authorized = await client.policy.isAuthorized({
|
|
1223
1423
|
* policyId: 2n,
|
|
@@ -1236,9 +1436,14 @@ export type Decorator<
|
|
|
1236
1436
|
*
|
|
1237
1437
|
* @example
|
|
1238
1438
|
* ```ts
|
|
1239
|
-
* import {
|
|
1439
|
+
* import { createClient, http } from 'viem'
|
|
1440
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1441
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1240
1442
|
*
|
|
1241
|
-
* const client =
|
|
1443
|
+
* const client = createClient({
|
|
1444
|
+
* chain: tempo,
|
|
1445
|
+
* transport: http(),
|
|
1446
|
+
* }).extend(tempoActions())
|
|
1242
1447
|
*
|
|
1243
1448
|
* const unwatch = client.policy.watchCreate({
|
|
1244
1449
|
* onPolicyCreated: (args, log) => {
|
|
@@ -1258,9 +1463,14 @@ export type Decorator<
|
|
|
1258
1463
|
*
|
|
1259
1464
|
* @example
|
|
1260
1465
|
* ```ts
|
|
1261
|
-
* import {
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1466
|
+
* import { createClient, http } from 'viem'
|
|
1467
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1468
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1469
|
+
*
|
|
1470
|
+
* const client = createClient({
|
|
1471
|
+
* chain: tempo,
|
|
1472
|
+
* transport: http(),
|
|
1473
|
+
* }).extend(tempoActions())
|
|
1264
1474
|
*
|
|
1265
1475
|
* const unwatch = client.policy.watchAdminUpdated({
|
|
1266
1476
|
* onAdminUpdated: (args, log) => {
|
|
@@ -1280,9 +1490,14 @@ export type Decorator<
|
|
|
1280
1490
|
*
|
|
1281
1491
|
* @example
|
|
1282
1492
|
* ```ts
|
|
1283
|
-
* import {
|
|
1493
|
+
* import { createClient, http } from 'viem'
|
|
1494
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1495
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1284
1496
|
*
|
|
1285
|
-
* const client =
|
|
1497
|
+
* const client = createClient({
|
|
1498
|
+
* chain: tempo,
|
|
1499
|
+
* transport: http(),
|
|
1500
|
+
* }).extend(tempoActions())
|
|
1286
1501
|
*
|
|
1287
1502
|
* const unwatch = client.policy.watchWhitelistUpdated({
|
|
1288
1503
|
* onWhitelistUpdated: (args, log) => {
|
|
@@ -1302,9 +1517,14 @@ export type Decorator<
|
|
|
1302
1517
|
*
|
|
1303
1518
|
* @example
|
|
1304
1519
|
* ```ts
|
|
1305
|
-
* import {
|
|
1520
|
+
* import { createClient, http } from 'viem'
|
|
1521
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1522
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1306
1523
|
*
|
|
1307
|
-
* const client =
|
|
1524
|
+
* const client = createClient({
|
|
1525
|
+
* chain: tempo,
|
|
1526
|
+
* transport: http(),
|
|
1527
|
+
* }).extend(tempoActions())
|
|
1308
1528
|
*
|
|
1309
1529
|
* const unwatch = client.policy.watchBlacklistUpdated({
|
|
1310
1530
|
* onBlacklistUpdated: (args, log) => {
|
|
@@ -1320,18 +1540,245 @@ export type Decorator<
|
|
|
1320
1540
|
parameters: policyActions.watchBlacklistUpdated.Parameters,
|
|
1321
1541
|
) => () => void
|
|
1322
1542
|
}
|
|
1543
|
+
reward: {
|
|
1544
|
+
/**
|
|
1545
|
+
* Cancels an active reward stream and refunds remaining tokens.
|
|
1546
|
+
*
|
|
1547
|
+
* @example
|
|
1548
|
+
* ```ts
|
|
1549
|
+
* import { createClient, http } from 'viem'
|
|
1550
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1551
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1552
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1553
|
+
*
|
|
1554
|
+
* const client = createClient({
|
|
1555
|
+
* account: privateKeyToAccount('0x...'),
|
|
1556
|
+
* chain: tempo,
|
|
1557
|
+
* transport: http(),
|
|
1558
|
+
* }).extend(tempoActions())
|
|
1559
|
+
*
|
|
1560
|
+
* const hash = await client.reward.cancel({
|
|
1561
|
+
* id: 1n,
|
|
1562
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1563
|
+
* })
|
|
1564
|
+
* ```
|
|
1565
|
+
*
|
|
1566
|
+
* @param parameters - Parameters.
|
|
1567
|
+
* @returns The transaction hash.
|
|
1568
|
+
*/
|
|
1569
|
+
cancel: (
|
|
1570
|
+
parameters: rewardActions.cancel.Parameters<chain, account>,
|
|
1571
|
+
) => Promise<rewardActions.cancel.ReturnValue>
|
|
1572
|
+
/**
|
|
1573
|
+
* Cancels an active reward stream and waits for confirmation.
|
|
1574
|
+
*
|
|
1575
|
+
* @example
|
|
1576
|
+
* ```ts
|
|
1577
|
+
* import { createClient, http } from 'viem'
|
|
1578
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1579
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1580
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1581
|
+
*
|
|
1582
|
+
* const client = createClient({
|
|
1583
|
+
* account: privateKeyToAccount('0x...'),
|
|
1584
|
+
* chain: tempo,
|
|
1585
|
+
* transport: http(),
|
|
1586
|
+
* }).extend(tempoActions())
|
|
1587
|
+
*
|
|
1588
|
+
* const result = await client.reward.cancelSync({
|
|
1589
|
+
* id: 1n,
|
|
1590
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1591
|
+
* })
|
|
1592
|
+
* ```
|
|
1593
|
+
*
|
|
1594
|
+
* @param parameters - Parameters.
|
|
1595
|
+
* @returns The transaction receipt and event data.
|
|
1596
|
+
*/
|
|
1597
|
+
cancelSync: (
|
|
1598
|
+
parameters: rewardActions.cancelSync.Parameters<chain, account>,
|
|
1599
|
+
) => Promise<rewardActions.cancelSync.ReturnValue>
|
|
1600
|
+
/**
|
|
1601
|
+
* Gets a reward stream by its ID.
|
|
1602
|
+
*
|
|
1603
|
+
* @example
|
|
1604
|
+
* ```ts
|
|
1605
|
+
* import { createClient, http } from 'viem'
|
|
1606
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1607
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1608
|
+
*
|
|
1609
|
+
* const client = createClient({
|
|
1610
|
+
* chain: tempo,
|
|
1611
|
+
* transport: http(),
|
|
1612
|
+
* }).extend(tempoActions())
|
|
1613
|
+
*
|
|
1614
|
+
* const stream = await client.reward.getStream({
|
|
1615
|
+
* id: 1n,
|
|
1616
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1617
|
+
* })
|
|
1618
|
+
* ```
|
|
1619
|
+
*
|
|
1620
|
+
* @param parameters - Parameters.
|
|
1621
|
+
* @returns The reward stream details.
|
|
1622
|
+
*/
|
|
1623
|
+
getStream: (
|
|
1624
|
+
parameters: rewardActions.getStream.Parameters,
|
|
1625
|
+
) => Promise<rewardActions.getStream.ReturnValue>
|
|
1626
|
+
/**
|
|
1627
|
+
* Gets the total reward per second rate for all active streams.
|
|
1628
|
+
*
|
|
1629
|
+
* @example
|
|
1630
|
+
* ```ts
|
|
1631
|
+
* import { createClient, http } from 'viem'
|
|
1632
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1633
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1634
|
+
*
|
|
1635
|
+
* const client = createClient({
|
|
1636
|
+
* chain: tempo,
|
|
1637
|
+
* transport: http(),
|
|
1638
|
+
* }).extend(tempoActions())
|
|
1639
|
+
*
|
|
1640
|
+
* const rate = await client.reward.getTotalPerSecond({
|
|
1641
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1642
|
+
* })
|
|
1643
|
+
* ```
|
|
1644
|
+
*
|
|
1645
|
+
* @param parameters - Parameters.
|
|
1646
|
+
* @returns The total reward per second (scaled by 1e18).
|
|
1647
|
+
*/
|
|
1648
|
+
getTotalPerSecond: (
|
|
1649
|
+
parameters: rewardActions.getTotalPerSecond.Parameters,
|
|
1650
|
+
) => Promise<rewardActions.getTotalPerSecond.ReturnValue>
|
|
1651
|
+
/**
|
|
1652
|
+
* Sets or changes the reward recipient for a token holder.
|
|
1653
|
+
*
|
|
1654
|
+
* @example
|
|
1655
|
+
* ```ts
|
|
1656
|
+
* import { createClient, http } from 'viem'
|
|
1657
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1658
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1659
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1660
|
+
*
|
|
1661
|
+
* const client = createClient({
|
|
1662
|
+
* account: privateKeyToAccount('0x...'),
|
|
1663
|
+
* chain: tempo,
|
|
1664
|
+
* transport: http(),
|
|
1665
|
+
* }).extend(tempoActions())
|
|
1666
|
+
*
|
|
1667
|
+
* const hash = await client.reward.setRecipient({
|
|
1668
|
+
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1669
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1670
|
+
* })
|
|
1671
|
+
* ```
|
|
1672
|
+
*
|
|
1673
|
+
* @param parameters - Parameters.
|
|
1674
|
+
* @returns The transaction hash.
|
|
1675
|
+
*/
|
|
1676
|
+
setRecipient: (
|
|
1677
|
+
parameters: rewardActions.setRecipient.Parameters<chain, account>,
|
|
1678
|
+
) => Promise<rewardActions.setRecipient.ReturnValue>
|
|
1679
|
+
/**
|
|
1680
|
+
* Sets or changes the reward recipient for a token holder and waits for confirmation.
|
|
1681
|
+
*
|
|
1682
|
+
* @example
|
|
1683
|
+
* ```ts
|
|
1684
|
+
* import { createClient, http } from 'viem'
|
|
1685
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1686
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1687
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1688
|
+
*
|
|
1689
|
+
* const client = createClient({
|
|
1690
|
+
* account: privateKeyToAccount('0x...'),
|
|
1691
|
+
* chain: tempo,
|
|
1692
|
+
* transport: http(),
|
|
1693
|
+
* }).extend(tempoActions())
|
|
1694
|
+
*
|
|
1695
|
+
* const result = await client.reward.setRecipientSync({
|
|
1696
|
+
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1697
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1698
|
+
* })
|
|
1699
|
+
* ```
|
|
1700
|
+
*
|
|
1701
|
+
* @param parameters - Parameters.
|
|
1702
|
+
* @returns The transaction receipt and event data.
|
|
1703
|
+
*/
|
|
1704
|
+
setRecipientSync: (
|
|
1705
|
+
parameters: rewardActions.setRecipientSync.Parameters<chain, account>,
|
|
1706
|
+
) => Promise<rewardActions.setRecipientSync.ReturnValue>
|
|
1707
|
+
/**
|
|
1708
|
+
* Starts a new reward stream that distributes tokens to opted-in holders.
|
|
1709
|
+
*
|
|
1710
|
+
* @example
|
|
1711
|
+
* ```ts
|
|
1712
|
+
* import { createClient, http } from 'viem'
|
|
1713
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1714
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1715
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1716
|
+
*
|
|
1717
|
+
* const client = createClient({
|
|
1718
|
+
* account: privateKeyToAccount('0x...'),
|
|
1719
|
+
* chain: tempo,
|
|
1720
|
+
* transport: http(),
|
|
1721
|
+
* }).extend(tempoActions())
|
|
1722
|
+
*
|
|
1723
|
+
* const hash = await client.reward.start({
|
|
1724
|
+
* amount: 100000000000000000000n,
|
|
1725
|
+
* seconds: 86400,
|
|
1726
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1727
|
+
* })
|
|
1728
|
+
* ```
|
|
1729
|
+
*
|
|
1730
|
+
* @param parameters - Parameters.
|
|
1731
|
+
* @returns The transaction hash.
|
|
1732
|
+
*/
|
|
1733
|
+
start: (
|
|
1734
|
+
parameters: rewardActions.start.Parameters<chain, account>,
|
|
1735
|
+
) => Promise<rewardActions.start.ReturnValue>
|
|
1736
|
+
/**
|
|
1737
|
+
* Starts a new reward stream that distributes tokens to opted-in holders and waits for confirmation.
|
|
1738
|
+
*
|
|
1739
|
+
* @example
|
|
1740
|
+
* ```ts
|
|
1741
|
+
* import { createClient, http } from 'viem'
|
|
1742
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1743
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1744
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1745
|
+
*
|
|
1746
|
+
* const client = createClient({
|
|
1747
|
+
* account: privateKeyToAccount('0x...'),
|
|
1748
|
+
* chain: tempo,
|
|
1749
|
+
* transport: http(),
|
|
1750
|
+
* }).extend(tempoActions())
|
|
1751
|
+
*
|
|
1752
|
+
* const result = await client.reward.startSync({
|
|
1753
|
+
* amount: 100000000000000000000n,
|
|
1754
|
+
* seconds: 86400,
|
|
1755
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1756
|
+
* })
|
|
1757
|
+
* ```
|
|
1758
|
+
*
|
|
1759
|
+
* @param parameters - Parameters.
|
|
1760
|
+
* @returns The transaction receipt and event data.
|
|
1761
|
+
*/
|
|
1762
|
+
startSync: (
|
|
1763
|
+
parameters: rewardActions.startSync.Parameters<chain, account>,
|
|
1764
|
+
) => Promise<rewardActions.startSync.ReturnValue>
|
|
1765
|
+
}
|
|
1323
1766
|
token: {
|
|
1324
1767
|
/**
|
|
1325
1768
|
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
1326
1769
|
*
|
|
1327
1770
|
* @example
|
|
1328
1771
|
* ```ts
|
|
1329
|
-
* import {
|
|
1772
|
+
* import { createClient, http } from 'viem'
|
|
1330
1773
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1774
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1775
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1331
1776
|
*
|
|
1332
|
-
* const client =
|
|
1333
|
-
* account: privateKeyToAccount('0x...')
|
|
1334
|
-
*
|
|
1777
|
+
* const client = createClient({
|
|
1778
|
+
* account: privateKeyToAccount('0x...'),
|
|
1779
|
+
* chain: tempo,
|
|
1780
|
+
* transport: http(),
|
|
1781
|
+
* }).extend(tempoActions())
|
|
1335
1782
|
*
|
|
1336
1783
|
* const hash = await client.token.approve({
|
|
1337
1784
|
* spender: '0x...',
|
|
@@ -1351,12 +1798,16 @@ export type Decorator<
|
|
|
1351
1798
|
*
|
|
1352
1799
|
* @example
|
|
1353
1800
|
* ```ts
|
|
1354
|
-
* import {
|
|
1801
|
+
* import { createClient, http } from 'viem'
|
|
1355
1802
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1803
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1804
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1356
1805
|
*
|
|
1357
|
-
* const client =
|
|
1358
|
-
* account: privateKeyToAccount('0x...')
|
|
1359
|
-
*
|
|
1806
|
+
* const client = createClient({
|
|
1807
|
+
* account: privateKeyToAccount('0x...'),
|
|
1808
|
+
* chain: tempo,
|
|
1809
|
+
* transport: http(),
|
|
1810
|
+
* }).extend(tempoActions())
|
|
1360
1811
|
*
|
|
1361
1812
|
* const result = await client.token.approveSync({
|
|
1362
1813
|
* spender: '0x...',
|
|
@@ -1376,12 +1827,16 @@ export type Decorator<
|
|
|
1376
1827
|
*
|
|
1377
1828
|
* @example
|
|
1378
1829
|
* ```ts
|
|
1379
|
-
* import {
|
|
1830
|
+
* import { createClient, http } from 'viem'
|
|
1380
1831
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1832
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1833
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1381
1834
|
*
|
|
1382
|
-
* const client =
|
|
1383
|
-
* account: privateKeyToAccount('0x...')
|
|
1384
|
-
*
|
|
1835
|
+
* const client = createClient({
|
|
1836
|
+
* account: privateKeyToAccount('0x...'),
|
|
1837
|
+
* chain: tempo,
|
|
1838
|
+
* transport: http(),
|
|
1839
|
+
* }).extend(tempoActions())
|
|
1385
1840
|
*
|
|
1386
1841
|
* const hash = await client.token.burnBlocked({
|
|
1387
1842
|
* from: '0x...',
|
|
@@ -1402,12 +1857,16 @@ export type Decorator<
|
|
|
1402
1857
|
*
|
|
1403
1858
|
* @example
|
|
1404
1859
|
* ```ts
|
|
1405
|
-
* import {
|
|
1860
|
+
* import { createClient, http } from 'viem'
|
|
1406
1861
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1862
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1863
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1407
1864
|
*
|
|
1408
|
-
* const client =
|
|
1409
|
-
* account: privateKeyToAccount('0x...')
|
|
1410
|
-
*
|
|
1865
|
+
* const client = createClient({
|
|
1866
|
+
* account: privateKeyToAccount('0x...'),
|
|
1867
|
+
* chain: tempo,
|
|
1868
|
+
* transport: http(),
|
|
1869
|
+
* }).extend(tempoActions())
|
|
1411
1870
|
*
|
|
1412
1871
|
* const result = await client.token.burnBlockedSync({
|
|
1413
1872
|
* from: '0x...',
|
|
@@ -1428,12 +1887,16 @@ export type Decorator<
|
|
|
1428
1887
|
*
|
|
1429
1888
|
* @example
|
|
1430
1889
|
* ```ts
|
|
1431
|
-
* import {
|
|
1890
|
+
* import { createClient, http } from 'viem'
|
|
1432
1891
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1892
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1893
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1433
1894
|
*
|
|
1434
|
-
* const client =
|
|
1435
|
-
* account: privateKeyToAccount('0x...')
|
|
1436
|
-
*
|
|
1895
|
+
* const client = createClient({
|
|
1896
|
+
* account: privateKeyToAccount('0x...'),
|
|
1897
|
+
* chain: tempo,
|
|
1898
|
+
* transport: http(),
|
|
1899
|
+
* }).extend(tempoActions())
|
|
1437
1900
|
*
|
|
1438
1901
|
* const hash = await client.token.burn({
|
|
1439
1902
|
* amount: 100n,
|
|
@@ -1453,12 +1916,16 @@ export type Decorator<
|
|
|
1453
1916
|
*
|
|
1454
1917
|
* @example
|
|
1455
1918
|
* ```ts
|
|
1456
|
-
* import {
|
|
1919
|
+
* import { createClient, http } from 'viem'
|
|
1457
1920
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1921
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1922
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1458
1923
|
*
|
|
1459
|
-
* const client =
|
|
1460
|
-
* account: privateKeyToAccount('0x...')
|
|
1461
|
-
*
|
|
1924
|
+
* const client = createClient({
|
|
1925
|
+
* account: privateKeyToAccount('0x...'),
|
|
1926
|
+
* chain: tempo,
|
|
1927
|
+
* transport: http(),
|
|
1928
|
+
* }).extend(tempoActions())
|
|
1462
1929
|
*
|
|
1463
1930
|
* const result = await client.token.burnSync({
|
|
1464
1931
|
* amount: 100n,
|
|
@@ -1478,12 +1945,16 @@ export type Decorator<
|
|
|
1478
1945
|
*
|
|
1479
1946
|
* @example
|
|
1480
1947
|
* ```ts
|
|
1481
|
-
* import {
|
|
1948
|
+
* import { createClient, http } from 'viem'
|
|
1482
1949
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1950
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1951
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1483
1952
|
*
|
|
1484
|
-
* const client =
|
|
1485
|
-
* account: privateKeyToAccount('0x...')
|
|
1486
|
-
*
|
|
1953
|
+
* const client = createClient({
|
|
1954
|
+
* account: privateKeyToAccount('0x...'),
|
|
1955
|
+
* chain: tempo,
|
|
1956
|
+
* transport: http(),
|
|
1957
|
+
* }).extend(tempoActions())
|
|
1487
1958
|
*
|
|
1488
1959
|
* const hash = await client.token.changeTransferPolicy({
|
|
1489
1960
|
* token: '0x...',
|
|
@@ -1503,12 +1974,16 @@ export type Decorator<
|
|
|
1503
1974
|
*
|
|
1504
1975
|
* @example
|
|
1505
1976
|
* ```ts
|
|
1506
|
-
* import {
|
|
1977
|
+
* import { createClient, http } from 'viem'
|
|
1507
1978
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1979
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1980
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1508
1981
|
*
|
|
1509
|
-
* const client =
|
|
1510
|
-
* account: privateKeyToAccount('0x...')
|
|
1511
|
-
*
|
|
1982
|
+
* const client = createClient({
|
|
1983
|
+
* account: privateKeyToAccount('0x...'),
|
|
1984
|
+
* chain: tempo,
|
|
1985
|
+
* transport: http(),
|
|
1986
|
+
* }).extend(tempoActions())
|
|
1512
1987
|
*
|
|
1513
1988
|
* const result = await client.token.changeTransferPolicySync({
|
|
1514
1989
|
* token: '0x...',
|
|
@@ -1531,12 +2006,16 @@ export type Decorator<
|
|
|
1531
2006
|
*
|
|
1532
2007
|
* @example
|
|
1533
2008
|
* ```ts
|
|
1534
|
-
* import {
|
|
2009
|
+
* import { createClient, http } from 'viem'
|
|
1535
2010
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2011
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2012
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1536
2013
|
*
|
|
1537
|
-
* const client =
|
|
1538
|
-
* account: privateKeyToAccount('0x...')
|
|
1539
|
-
*
|
|
2014
|
+
* const client = createClient({
|
|
2015
|
+
* account: privateKeyToAccount('0x...'),
|
|
2016
|
+
* chain: tempo,
|
|
2017
|
+
* transport: http(),
|
|
2018
|
+
* }).extend(tempoActions())
|
|
1540
2019
|
*
|
|
1541
2020
|
* const { hash, id, address } = await client.token.create({
|
|
1542
2021
|
* name: 'My Token',
|
|
@@ -1557,12 +2036,16 @@ export type Decorator<
|
|
|
1557
2036
|
*
|
|
1558
2037
|
* @example
|
|
1559
2038
|
* ```ts
|
|
1560
|
-
* import {
|
|
2039
|
+
* import { createClient, http } from 'viem'
|
|
1561
2040
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2041
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2042
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1562
2043
|
*
|
|
1563
|
-
* const client =
|
|
1564
|
-
* account: privateKeyToAccount('0x...')
|
|
1565
|
-
*
|
|
2044
|
+
* const client = createClient({
|
|
2045
|
+
* account: privateKeyToAccount('0x...'),
|
|
2046
|
+
* chain: tempo,
|
|
2047
|
+
* transport: http(),
|
|
2048
|
+
* }).extend(tempoActions())
|
|
1566
2049
|
*
|
|
1567
2050
|
* const result = await client.token.createSync({
|
|
1568
2051
|
* name: 'My Token',
|
|
@@ -1583,12 +2066,16 @@ export type Decorator<
|
|
|
1583
2066
|
*
|
|
1584
2067
|
* @example
|
|
1585
2068
|
* ```ts
|
|
1586
|
-
* import {
|
|
2069
|
+
* import { createClient, http } from 'viem'
|
|
1587
2070
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2071
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2072
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1588
2073
|
*
|
|
1589
|
-
* const client =
|
|
1590
|
-
* account: privateKeyToAccount('0x...')
|
|
1591
|
-
*
|
|
2074
|
+
* const client = createClient({
|
|
2075
|
+
* account: privateKeyToAccount('0x...'),
|
|
2076
|
+
* chain: tempo,
|
|
2077
|
+
* transport: http(),
|
|
2078
|
+
* }).extend(tempoActions())
|
|
1592
2079
|
*
|
|
1593
2080
|
* const allowance = await client.token.getAllowance({
|
|
1594
2081
|
* spender: '0x...',
|
|
@@ -1607,12 +2094,16 @@ export type Decorator<
|
|
|
1607
2094
|
*
|
|
1608
2095
|
* @example
|
|
1609
2096
|
* ```ts
|
|
1610
|
-
* import {
|
|
2097
|
+
* import { createClient, http } from 'viem'
|
|
1611
2098
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2099
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2100
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1612
2101
|
*
|
|
1613
|
-
* const client =
|
|
1614
|
-
* account: privateKeyToAccount('0x...')
|
|
1615
|
-
*
|
|
2102
|
+
* const client = createClient({
|
|
2103
|
+
* account: privateKeyToAccount('0x...'),
|
|
2104
|
+
* chain: tempo,
|
|
2105
|
+
* transport: http(),
|
|
2106
|
+
* }).extend(tempoActions())
|
|
1616
2107
|
*
|
|
1617
2108
|
* const balance = await client.token.getBalance()
|
|
1618
2109
|
* ```
|
|
@@ -1622,18 +2113,21 @@ export type Decorator<
|
|
|
1622
2113
|
* @returns The token balance.
|
|
1623
2114
|
*/
|
|
1624
2115
|
getBalance: (
|
|
1625
|
-
|
|
1626
|
-
? [tokenActions.getBalance.Parameters<account>] | []
|
|
1627
|
-
: [tokenActions.getBalance.Parameters<account>]
|
|
2116
|
+
parameters: tokenActions.getBalance.Parameters<account>,
|
|
1628
2117
|
) => Promise<tokenActions.getBalance.ReturnValue>
|
|
1629
2118
|
/**
|
|
1630
2119
|
* Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
|
|
1631
2120
|
*
|
|
1632
2121
|
* @example
|
|
1633
2122
|
* ```ts
|
|
1634
|
-
* import {
|
|
2123
|
+
* import { createClient, http } from 'viem'
|
|
2124
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2125
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1635
2126
|
*
|
|
1636
|
-
* const client =
|
|
2127
|
+
* const client = createClient({
|
|
2128
|
+
* chain: tempo,
|
|
2129
|
+
* transport: http(),
|
|
2130
|
+
* }).extend(tempoActions())
|
|
1637
2131
|
*
|
|
1638
2132
|
* const metadata = await client.token.getMetadata({
|
|
1639
2133
|
* token: '0x...',
|
|
@@ -1647,17 +2141,48 @@ export type Decorator<
|
|
|
1647
2141
|
getMetadata: (
|
|
1648
2142
|
parameters: tokenActions.getMetadata.Parameters,
|
|
1649
2143
|
) => Promise<tokenActions.getMetadata.ReturnValue>
|
|
2144
|
+
/**
|
|
2145
|
+
* Gets the admin role for a specific role in a TIP20 token.
|
|
2146
|
+
*
|
|
2147
|
+
* @example
|
|
2148
|
+
* ```ts
|
|
2149
|
+
* import { createClient, http } from 'viem'
|
|
2150
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2151
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2152
|
+
*
|
|
2153
|
+
* const client = createClient({
|
|
2154
|
+
* chain: tempo,
|
|
2155
|
+
* transport: http(),
|
|
2156
|
+
* }).extend(tempoActions())
|
|
2157
|
+
*
|
|
2158
|
+
* const adminRole = await client.token.getRoleAdmin({
|
|
2159
|
+
* role: 'minter',
|
|
2160
|
+
* token: '0x...',
|
|
2161
|
+
* })
|
|
2162
|
+
* ```
|
|
2163
|
+
*
|
|
2164
|
+
* @param client - Client.
|
|
2165
|
+
* @param parameters - Parameters.
|
|
2166
|
+
* @returns The admin role hash.
|
|
2167
|
+
*/
|
|
2168
|
+
getRoleAdmin: (
|
|
2169
|
+
parameters: tokenActions.getRoleAdmin.Parameters,
|
|
2170
|
+
) => Promise<tokenActions.getRoleAdmin.ReturnValue>
|
|
1650
2171
|
/**
|
|
1651
2172
|
* Checks if an account has a specific role for a TIP20 token.
|
|
1652
2173
|
*
|
|
1653
2174
|
* @example
|
|
1654
2175
|
* ```ts
|
|
1655
|
-
* import {
|
|
2176
|
+
* import { createClient, http } from 'viem'
|
|
1656
2177
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2178
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2179
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1657
2180
|
*
|
|
1658
|
-
* const client =
|
|
1659
|
-
* account: privateKeyToAccount('0x...')
|
|
1660
|
-
*
|
|
2181
|
+
* const client = createClient({
|
|
2182
|
+
* account: privateKeyToAccount('0x...'),
|
|
2183
|
+
* chain: tempo,
|
|
2184
|
+
* transport: http(),
|
|
2185
|
+
* }).extend(tempoActions())
|
|
1661
2186
|
*
|
|
1662
2187
|
* const hasRole = await client.token.hasRole({
|
|
1663
2188
|
* token: '0x...',
|
|
@@ -1677,12 +2202,16 @@ export type Decorator<
|
|
|
1677
2202
|
*
|
|
1678
2203
|
* @example
|
|
1679
2204
|
* ```ts
|
|
1680
|
-
* import {
|
|
2205
|
+
* import { createClient, http } from 'viem'
|
|
1681
2206
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2207
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2208
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1682
2209
|
*
|
|
1683
|
-
* const client =
|
|
1684
|
-
* account: privateKeyToAccount('0x...')
|
|
1685
|
-
*
|
|
2210
|
+
* const client = createClient({
|
|
2211
|
+
* account: privateKeyToAccount('0x...'),
|
|
2212
|
+
* chain: tempo,
|
|
2213
|
+
* transport: http(),
|
|
2214
|
+
* }).extend(tempoActions())
|
|
1686
2215
|
*
|
|
1687
2216
|
* const hash = await client.token.grantRoles({
|
|
1688
2217
|
* token: '0x...',
|
|
@@ -1703,16 +2232,16 @@ export type Decorator<
|
|
|
1703
2232
|
*
|
|
1704
2233
|
* @example
|
|
1705
2234
|
* ```ts
|
|
1706
|
-
* import {
|
|
1707
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1708
|
-
* import { http } from 'viem'
|
|
2235
|
+
* import { createClient, http } from 'viem'
|
|
1709
2236
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2237
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2238
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1710
2239
|
*
|
|
1711
|
-
* const client =
|
|
2240
|
+
* const client = createClient({
|
|
1712
2241
|
* account: privateKeyToAccount('0x...'),
|
|
1713
2242
|
* chain: tempo,
|
|
1714
2243
|
* transport: http(),
|
|
1715
|
-
* })
|
|
2244
|
+
* }).extend(tempoActions())
|
|
1716
2245
|
*
|
|
1717
2246
|
* const result = await client.token.grantRolesSync({
|
|
1718
2247
|
* token: '0x...',
|
|
@@ -1732,12 +2261,16 @@ export type Decorator<
|
|
|
1732
2261
|
*
|
|
1733
2262
|
* @example
|
|
1734
2263
|
* ```ts
|
|
1735
|
-
* import {
|
|
2264
|
+
* import { createClient, http } from 'viem'
|
|
1736
2265
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2266
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2267
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1737
2268
|
*
|
|
1738
|
-
* const client =
|
|
1739
|
-
* account: privateKeyToAccount('0x...')
|
|
1740
|
-
*
|
|
2269
|
+
* const client = createClient({
|
|
2270
|
+
* account: privateKeyToAccount('0x...'),
|
|
2271
|
+
* chain: tempo,
|
|
2272
|
+
* transport: http(),
|
|
2273
|
+
* }).extend(tempoActions())
|
|
1741
2274
|
*
|
|
1742
2275
|
* const hash = await client.token.mint({
|
|
1743
2276
|
* to: '0x...',
|
|
@@ -1758,12 +2291,16 @@ export type Decorator<
|
|
|
1758
2291
|
*
|
|
1759
2292
|
* @example
|
|
1760
2293
|
* ```ts
|
|
1761
|
-
* import {
|
|
2294
|
+
* import { createClient, http } from 'viem'
|
|
1762
2295
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2296
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2297
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1763
2298
|
*
|
|
1764
|
-
* const client =
|
|
1765
|
-
* account: privateKeyToAccount('0x...')
|
|
1766
|
-
*
|
|
2299
|
+
* const client = createClient({
|
|
2300
|
+
* account: privateKeyToAccount('0x...'),
|
|
2301
|
+
* chain: tempo,
|
|
2302
|
+
* transport: http(),
|
|
2303
|
+
* }).extend(tempoActions())
|
|
1767
2304
|
*
|
|
1768
2305
|
* const result = await client.token.mintSync({
|
|
1769
2306
|
* to: '0x...',
|
|
@@ -1784,12 +2321,16 @@ export type Decorator<
|
|
|
1784
2321
|
*
|
|
1785
2322
|
* @example
|
|
1786
2323
|
* ```ts
|
|
1787
|
-
* import {
|
|
2324
|
+
* import { createClient, http } from 'viem'
|
|
1788
2325
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2326
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2327
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1789
2328
|
*
|
|
1790
|
-
* const client =
|
|
1791
|
-
* account: privateKeyToAccount('0x...')
|
|
1792
|
-
*
|
|
2329
|
+
* const client = createClient({
|
|
2330
|
+
* account: privateKeyToAccount('0x...'),
|
|
2331
|
+
* chain: tempo,
|
|
2332
|
+
* transport: http(),
|
|
2333
|
+
* }).extend(tempoActions())
|
|
1793
2334
|
*
|
|
1794
2335
|
* const hash = await client.token.pause({
|
|
1795
2336
|
* token: '0x...',
|
|
@@ -1808,12 +2349,16 @@ export type Decorator<
|
|
|
1808
2349
|
*
|
|
1809
2350
|
* @example
|
|
1810
2351
|
* ```ts
|
|
1811
|
-
* import {
|
|
2352
|
+
* import { createClient, http } from 'viem'
|
|
1812
2353
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2354
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2355
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1813
2356
|
*
|
|
1814
|
-
* const client =
|
|
1815
|
-
* account: privateKeyToAccount('0x...')
|
|
1816
|
-
*
|
|
2357
|
+
* const client = createClient({
|
|
2358
|
+
* account: privateKeyToAccount('0x...'),
|
|
2359
|
+
* chain: tempo,
|
|
2360
|
+
* transport: http(),
|
|
2361
|
+
* }).extend(tempoActions())
|
|
1817
2362
|
*
|
|
1818
2363
|
* const result = await client.token.pauseSync({
|
|
1819
2364
|
* token: '0x...',
|
|
@@ -1827,73 +2372,21 @@ export type Decorator<
|
|
|
1827
2372
|
pauseSync: (
|
|
1828
2373
|
parameters: tokenActions.pauseSync.Parameters<chain, account>,
|
|
1829
2374
|
) => Promise<tokenActions.pauseSync.ReturnValue>
|
|
1830
|
-
/**
|
|
1831
|
-
* Approves a spender using a signed permit.
|
|
1832
|
-
*
|
|
1833
|
-
* @example
|
|
1834
|
-
* ```ts
|
|
1835
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
1836
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1837
|
-
*
|
|
1838
|
-
* const client = createTempoClient({
|
|
1839
|
-
* account: privateKeyToAccount('0x...')
|
|
1840
|
-
* })
|
|
1841
|
-
*
|
|
1842
|
-
* const hash = await client.token.permit({
|
|
1843
|
-
* owner: '0x...',
|
|
1844
|
-
* spender: '0x...',
|
|
1845
|
-
* value: 100n,
|
|
1846
|
-
* deadline: 1234567890n,
|
|
1847
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
1848
|
-
* })
|
|
1849
|
-
* ```
|
|
1850
|
-
*
|
|
1851
|
-
* @param client - Client.
|
|
1852
|
-
* @param parameters - Parameters.
|
|
1853
|
-
* @returns The transaction hash.
|
|
1854
|
-
*/
|
|
1855
|
-
permit: (
|
|
1856
|
-
parameters: tokenActions.permit.Parameters<chain, account>,
|
|
1857
|
-
) => Promise<tokenActions.permit.ReturnValue>
|
|
1858
|
-
/**
|
|
1859
|
-
* Approves a spender using a signed permit.
|
|
1860
|
-
*
|
|
1861
|
-
* @example
|
|
1862
|
-
* ```ts
|
|
1863
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
1864
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1865
|
-
*
|
|
1866
|
-
* const client = createTempoClient({
|
|
1867
|
-
* account: privateKeyToAccount('0x...')
|
|
1868
|
-
* })
|
|
1869
|
-
*
|
|
1870
|
-
* const result = await client.token.permitSync({
|
|
1871
|
-
* owner: '0x...',
|
|
1872
|
-
* spender: '0x...',
|
|
1873
|
-
* value: 100n,
|
|
1874
|
-
* deadline: 1234567890n,
|
|
1875
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
1876
|
-
* })
|
|
1877
|
-
* ```
|
|
1878
|
-
*
|
|
1879
|
-
* @param client - Client.
|
|
1880
|
-
* @param parameters - Parameters.
|
|
1881
|
-
* @returns The transaction receipt and event data.
|
|
1882
|
-
*/
|
|
1883
|
-
permitSync: (
|
|
1884
|
-
parameters: tokenActions.permitSync.Parameters<chain, account>,
|
|
1885
|
-
) => Promise<tokenActions.permitSync.ReturnValue>
|
|
1886
2375
|
/**
|
|
1887
2376
|
* Renounces a role for a TIP20 token.
|
|
1888
2377
|
*
|
|
1889
2378
|
* @example
|
|
1890
2379
|
* ```ts
|
|
1891
|
-
* import {
|
|
2380
|
+
* import { createClient, http } from 'viem'
|
|
1892
2381
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2382
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2383
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1893
2384
|
*
|
|
1894
|
-
* const client =
|
|
1895
|
-
* account: privateKeyToAccount('0x...')
|
|
1896
|
-
*
|
|
2385
|
+
* const client = createClient({
|
|
2386
|
+
* account: privateKeyToAccount('0x...'),
|
|
2387
|
+
* chain: tempo,
|
|
2388
|
+
* transport: http(),
|
|
2389
|
+
* }).extend(tempoActions())
|
|
1897
2390
|
*
|
|
1898
2391
|
* const hash = await client.token.renounceRoles({
|
|
1899
2392
|
* token: '0x...',
|
|
@@ -1913,16 +2406,16 @@ export type Decorator<
|
|
|
1913
2406
|
*
|
|
1914
2407
|
* @example
|
|
1915
2408
|
* ```ts
|
|
1916
|
-
* import {
|
|
1917
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1918
|
-
* import { http } from 'viem'
|
|
2409
|
+
* import { createClient, http } from 'viem'
|
|
1919
2410
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2411
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2412
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1920
2413
|
*
|
|
1921
|
-
* const client =
|
|
2414
|
+
* const client = createClient({
|
|
1922
2415
|
* account: privateKeyToAccount('0x...'),
|
|
1923
2416
|
* chain: tempo,
|
|
1924
2417
|
* transport: http(),
|
|
1925
|
-
* })
|
|
2418
|
+
* }).extend(tempoActions())
|
|
1926
2419
|
*
|
|
1927
2420
|
* const result = await client.token.renounceRolesSync({
|
|
1928
2421
|
* token: '0x...',
|
|
@@ -1941,12 +2434,16 @@ export type Decorator<
|
|
|
1941
2434
|
*
|
|
1942
2435
|
* @example
|
|
1943
2436
|
* ```ts
|
|
1944
|
-
* import {
|
|
2437
|
+
* import { createClient, http } from 'viem'
|
|
1945
2438
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2439
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2440
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1946
2441
|
*
|
|
1947
|
-
* const client =
|
|
1948
|
-
* account: privateKeyToAccount('0x...')
|
|
1949
|
-
*
|
|
2442
|
+
* const client = createClient({
|
|
2443
|
+
* account: privateKeyToAccount('0x...'),
|
|
2444
|
+
* chain: tempo,
|
|
2445
|
+
* transport: http(),
|
|
2446
|
+
* }).extend(tempoActions())
|
|
1950
2447
|
*
|
|
1951
2448
|
* const hash = await client.token.revokeRoles({
|
|
1952
2449
|
* token: '0x...',
|
|
@@ -1967,16 +2464,16 @@ export type Decorator<
|
|
|
1967
2464
|
*
|
|
1968
2465
|
* @example
|
|
1969
2466
|
* ```ts
|
|
1970
|
-
* import {
|
|
1971
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1972
|
-
* import { http } from 'viem'
|
|
2467
|
+
* import { createClient, http } from 'viem'
|
|
1973
2468
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2469
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2470
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1974
2471
|
*
|
|
1975
|
-
* const client =
|
|
2472
|
+
* const client = createClient({
|
|
1976
2473
|
* account: privateKeyToAccount('0x...'),
|
|
1977
2474
|
* chain: tempo,
|
|
1978
2475
|
* transport: http(),
|
|
1979
|
-
* })
|
|
2476
|
+
* }).extend(tempoActions())
|
|
1980
2477
|
*
|
|
1981
2478
|
* const result = await client.token.revokeRolesSync({
|
|
1982
2479
|
* token: '0x...',
|
|
@@ -1996,12 +2493,16 @@ export type Decorator<
|
|
|
1996
2493
|
*
|
|
1997
2494
|
* @example
|
|
1998
2495
|
* ```ts
|
|
1999
|
-
* import {
|
|
2496
|
+
* import { createClient, http } from 'viem'
|
|
2000
2497
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2498
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2499
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2001
2500
|
*
|
|
2002
|
-
* const client =
|
|
2003
|
-
* account: privateKeyToAccount('0x...')
|
|
2004
|
-
*
|
|
2501
|
+
* const client = createClient({
|
|
2502
|
+
* account: privateKeyToAccount('0x...'),
|
|
2503
|
+
* chain: tempo,
|
|
2504
|
+
* transport: http(),
|
|
2505
|
+
* }).extend(tempoActions())
|
|
2005
2506
|
*
|
|
2006
2507
|
* const hash = await client.token.setSupplyCap({
|
|
2007
2508
|
* token: '0x...',
|
|
@@ -2021,12 +2522,16 @@ export type Decorator<
|
|
|
2021
2522
|
*
|
|
2022
2523
|
* @example
|
|
2023
2524
|
* ```ts
|
|
2024
|
-
* import {
|
|
2525
|
+
* import { createClient, http } from 'viem'
|
|
2025
2526
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2527
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2528
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2026
2529
|
*
|
|
2027
|
-
* const client =
|
|
2028
|
-
* account: privateKeyToAccount('0x...')
|
|
2029
|
-
*
|
|
2530
|
+
* const client = createClient({
|
|
2531
|
+
* account: privateKeyToAccount('0x...'),
|
|
2532
|
+
* chain: tempo,
|
|
2533
|
+
* transport: http(),
|
|
2534
|
+
* }).extend(tempoActions())
|
|
2030
2535
|
*
|
|
2031
2536
|
* const result = await client.token.setSupplyCapSync({
|
|
2032
2537
|
* token: '0x...',
|
|
@@ -2046,12 +2551,16 @@ export type Decorator<
|
|
|
2046
2551
|
*
|
|
2047
2552
|
* @example
|
|
2048
2553
|
* ```ts
|
|
2049
|
-
* import {
|
|
2554
|
+
* import { createClient, http } from 'viem'
|
|
2050
2555
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2556
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2557
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2051
2558
|
*
|
|
2052
|
-
* const client =
|
|
2053
|
-
* account: privateKeyToAccount('0x...')
|
|
2054
|
-
*
|
|
2559
|
+
* const client = createClient({
|
|
2560
|
+
* account: privateKeyToAccount('0x...'),
|
|
2561
|
+
* chain: tempo,
|
|
2562
|
+
* transport: http(),
|
|
2563
|
+
* }).extend(tempoActions())
|
|
2055
2564
|
*
|
|
2056
2565
|
* const hash = await client.token.setRoleAdmin({
|
|
2057
2566
|
* token: '0x...',
|
|
@@ -2072,12 +2581,16 @@ export type Decorator<
|
|
|
2072
2581
|
*
|
|
2073
2582
|
* @example
|
|
2074
2583
|
* ```ts
|
|
2075
|
-
* import {
|
|
2584
|
+
* import { createClient, http } from 'viem'
|
|
2076
2585
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2586
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2587
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2077
2588
|
*
|
|
2078
|
-
* const client =
|
|
2079
|
-
* account: privateKeyToAccount('0x...')
|
|
2080
|
-
*
|
|
2589
|
+
* const client = createClient({
|
|
2590
|
+
* account: privateKeyToAccount('0x...'),
|
|
2591
|
+
* chain: tempo,
|
|
2592
|
+
* transport: http(),
|
|
2593
|
+
* }).extend(tempoActions())
|
|
2081
2594
|
*
|
|
2082
2595
|
* const result = await client.token.setRoleAdminSync({
|
|
2083
2596
|
* token: '0x...',
|
|
@@ -2098,12 +2611,16 @@ export type Decorator<
|
|
|
2098
2611
|
*
|
|
2099
2612
|
* @example
|
|
2100
2613
|
* ```ts
|
|
2101
|
-
* import {
|
|
2614
|
+
* import { createClient, http } from 'viem'
|
|
2102
2615
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2616
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2617
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2103
2618
|
*
|
|
2104
|
-
* const client =
|
|
2105
|
-
* account: privateKeyToAccount('0x...')
|
|
2106
|
-
*
|
|
2619
|
+
* const client = createClient({
|
|
2620
|
+
* account: privateKeyToAccount('0x...'),
|
|
2621
|
+
* chain: tempo,
|
|
2622
|
+
* transport: http(),
|
|
2623
|
+
* }).extend(tempoActions())
|
|
2107
2624
|
*
|
|
2108
2625
|
* const hash = await client.token.transfer({
|
|
2109
2626
|
* to: '0x...',
|
|
@@ -2123,12 +2640,16 @@ export type Decorator<
|
|
|
2123
2640
|
*
|
|
2124
2641
|
* @example
|
|
2125
2642
|
* ```ts
|
|
2126
|
-
* import {
|
|
2643
|
+
* import { createClient, http } from 'viem'
|
|
2127
2644
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2645
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2646
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2128
2647
|
*
|
|
2129
|
-
* const client =
|
|
2130
|
-
* account: privateKeyToAccount('0x...')
|
|
2131
|
-
*
|
|
2648
|
+
* const client = createClient({
|
|
2649
|
+
* account: privateKeyToAccount('0x...'),
|
|
2650
|
+
* chain: tempo,
|
|
2651
|
+
* transport: http(),
|
|
2652
|
+
* }).extend(tempoActions())
|
|
2132
2653
|
*
|
|
2133
2654
|
* const result = await client.token.transferSync({
|
|
2134
2655
|
* to: '0x...',
|
|
@@ -2148,12 +2669,16 @@ export type Decorator<
|
|
|
2148
2669
|
*
|
|
2149
2670
|
* @example
|
|
2150
2671
|
* ```ts
|
|
2151
|
-
* import {
|
|
2672
|
+
* import { createClient, http } from 'viem'
|
|
2152
2673
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2674
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2675
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2153
2676
|
*
|
|
2154
|
-
* const client =
|
|
2155
|
-
* account: privateKeyToAccount('0x...')
|
|
2156
|
-
*
|
|
2677
|
+
* const client = createClient({
|
|
2678
|
+
* account: privateKeyToAccount('0x...'),
|
|
2679
|
+
* chain: tempo,
|
|
2680
|
+
* transport: http(),
|
|
2681
|
+
* }).extend(tempoActions())
|
|
2157
2682
|
*
|
|
2158
2683
|
* const hash = await client.token.unpause({
|
|
2159
2684
|
* token: '0x...',
|
|
@@ -2172,12 +2697,16 @@ export type Decorator<
|
|
|
2172
2697
|
*
|
|
2173
2698
|
* @example
|
|
2174
2699
|
* ```ts
|
|
2175
|
-
* import {
|
|
2700
|
+
* import { createClient, http } from 'viem'
|
|
2176
2701
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2702
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2703
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2177
2704
|
*
|
|
2178
|
-
* const client =
|
|
2179
|
-
* account: privateKeyToAccount('0x...')
|
|
2180
|
-
*
|
|
2705
|
+
* const client = createClient({
|
|
2706
|
+
* account: privateKeyToAccount('0x...'),
|
|
2707
|
+
* chain: tempo,
|
|
2708
|
+
* transport: http(),
|
|
2709
|
+
* }).extend(tempoActions())
|
|
2181
2710
|
*
|
|
2182
2711
|
* const result = await client.token.unpauseSync({
|
|
2183
2712
|
* token: '0x...',
|
|
@@ -2196,9 +2725,14 @@ export type Decorator<
|
|
|
2196
2725
|
*
|
|
2197
2726
|
* @example
|
|
2198
2727
|
* ```ts
|
|
2199
|
-
* import {
|
|
2728
|
+
* import { createClient, http } from 'viem'
|
|
2729
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2730
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2200
2731
|
*
|
|
2201
|
-
* const client =
|
|
2732
|
+
* const client = createClient({
|
|
2733
|
+
* chain: tempo,
|
|
2734
|
+
* transport: http(),
|
|
2735
|
+
* }).extend(tempoActions())
|
|
2202
2736
|
*
|
|
2203
2737
|
* const unwatch = client.token.watchApprove({
|
|
2204
2738
|
* onApproval: (args, log) => {
|
|
@@ -2219,9 +2753,14 @@ export type Decorator<
|
|
|
2219
2753
|
*
|
|
2220
2754
|
* @example
|
|
2221
2755
|
* ```ts
|
|
2222
|
-
* import {
|
|
2756
|
+
* import { createClient, http } from 'viem'
|
|
2757
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2758
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2223
2759
|
*
|
|
2224
|
-
* const client =
|
|
2760
|
+
* const client = createClient({
|
|
2761
|
+
* chain: tempo,
|
|
2762
|
+
* transport: http(),
|
|
2763
|
+
* }).extend(tempoActions())
|
|
2225
2764
|
*
|
|
2226
2765
|
* const unwatch = client.token.watchBurn({
|
|
2227
2766
|
* onBurn: (args, log) => {
|
|
@@ -2240,9 +2779,14 @@ export type Decorator<
|
|
|
2240
2779
|
*
|
|
2241
2780
|
* @example
|
|
2242
2781
|
* ```ts
|
|
2243
|
-
* import {
|
|
2782
|
+
* import { createClient, http } from 'viem'
|
|
2783
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2784
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2244
2785
|
*
|
|
2245
|
-
* const client =
|
|
2786
|
+
* const client = createClient({
|
|
2787
|
+
* chain: tempo,
|
|
2788
|
+
* transport: http(),
|
|
2789
|
+
* }).extend(tempoActions())
|
|
2246
2790
|
*
|
|
2247
2791
|
* const unwatch = client.token.watchCreate({
|
|
2248
2792
|
* onTokenCreated: (args, log) => {
|
|
@@ -2261,9 +2805,14 @@ export type Decorator<
|
|
|
2261
2805
|
*
|
|
2262
2806
|
* @example
|
|
2263
2807
|
* ```ts
|
|
2264
|
-
* import {
|
|
2808
|
+
* import { createClient, http } from 'viem'
|
|
2809
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2810
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2265
2811
|
*
|
|
2266
|
-
* const client =
|
|
2812
|
+
* const client = createClient({
|
|
2813
|
+
* chain: tempo,
|
|
2814
|
+
* transport: http(),
|
|
2815
|
+
* }).extend(tempoActions())
|
|
2267
2816
|
*
|
|
2268
2817
|
* const unwatch = client.token.watchMint({
|
|
2269
2818
|
* onMint: (args, log) => {
|
|
@@ -2282,9 +2831,14 @@ export type Decorator<
|
|
|
2282
2831
|
*
|
|
2283
2832
|
* @example
|
|
2284
2833
|
* ```ts
|
|
2285
|
-
* import {
|
|
2834
|
+
* import { createClient, http } from 'viem'
|
|
2835
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2836
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2286
2837
|
*
|
|
2287
|
-
* const client =
|
|
2838
|
+
* const client = createClient({
|
|
2839
|
+
* chain: tempo,
|
|
2840
|
+
* transport: http(),
|
|
2841
|
+
* }).extend(tempoActions())
|
|
2288
2842
|
*
|
|
2289
2843
|
* const unwatch = client.token.watchAdminRole({
|
|
2290
2844
|
* onRoleAdminUpdated: (args, log) => {
|
|
@@ -2305,9 +2859,14 @@ export type Decorator<
|
|
|
2305
2859
|
*
|
|
2306
2860
|
* @example
|
|
2307
2861
|
* ```ts
|
|
2308
|
-
* import {
|
|
2862
|
+
* import { createClient, http } from 'viem'
|
|
2863
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2864
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2309
2865
|
*
|
|
2310
|
-
* const client =
|
|
2866
|
+
* const client = createClient({
|
|
2867
|
+
* chain: tempo,
|
|
2868
|
+
* transport: http(),
|
|
2869
|
+
* }).extend(tempoActions())
|
|
2311
2870
|
*
|
|
2312
2871
|
* const unwatch = client.token.watchRole({
|
|
2313
2872
|
* onRoleUpdated: (args, log) => {
|
|
@@ -2326,9 +2885,14 @@ export type Decorator<
|
|
|
2326
2885
|
*
|
|
2327
2886
|
* @example
|
|
2328
2887
|
* ```ts
|
|
2329
|
-
* import {
|
|
2888
|
+
* import { createClient, http } from 'viem'
|
|
2889
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2890
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2330
2891
|
*
|
|
2331
|
-
* const client =
|
|
2892
|
+
* const client = createClient({
|
|
2893
|
+
* chain: tempo,
|
|
2894
|
+
* transport: http(),
|
|
2895
|
+
* }).extend(tempoActions())
|
|
2332
2896
|
*
|
|
2333
2897
|
* const unwatch = client.token.watchTransfer({
|
|
2334
2898
|
* onTransfer: (args, log) => {
|
|
@@ -2357,10 +2921,7 @@ export function decorator() {
|
|
|
2357
2921
|
): Decorator<chain, account> => {
|
|
2358
2922
|
return {
|
|
2359
2923
|
amm: {
|
|
2360
|
-
getPoolId: (parameters) => ammActions.getPoolId(client, parameters),
|
|
2361
2924
|
getPool: (parameters) => ammActions.getPool(client, parameters),
|
|
2362
|
-
getTotalSupply: (parameters) =>
|
|
2363
|
-
ammActions.getTotalSupply(client, parameters),
|
|
2364
2925
|
getLiquidityBalance: (parameters) =>
|
|
2365
2926
|
ammActions.getLiquidityBalance(client, parameters),
|
|
2366
2927
|
rebalanceSwap: (parameters) =>
|
|
@@ -2389,6 +2950,7 @@ export function decorator() {
|
|
|
2389
2950
|
getBalance: (parameters) => dexActions.getBalance(client, parameters),
|
|
2390
2951
|
getBuyQuote: (parameters) => dexActions.getBuyQuote(client, parameters),
|
|
2391
2952
|
getOrder: (parameters) => dexActions.getOrder(client, parameters),
|
|
2953
|
+
getOrders: (parameters) => dexActions.getOrders(client, parameters),
|
|
2392
2954
|
getPriceLevel: (parameters) =>
|
|
2393
2955
|
dexActions.getPriceLevel(client, parameters),
|
|
2394
2956
|
getSellQuote: (parameters) =>
|
|
@@ -2451,6 +3013,20 @@ export function decorator() {
|
|
|
2451
3013
|
watchBlacklistUpdated: (parameters) =>
|
|
2452
3014
|
policyActions.watchBlacklistUpdated(client, parameters),
|
|
2453
3015
|
},
|
|
3016
|
+
reward: {
|
|
3017
|
+
cancel: (parameters) => rewardActions.cancel(client, parameters),
|
|
3018
|
+
cancelSync: (parameters) =>
|
|
3019
|
+
rewardActions.cancelSync(client, parameters),
|
|
3020
|
+
getStream: (parameters) => rewardActions.getStream(client, parameters),
|
|
3021
|
+
getTotalPerSecond: (parameters) =>
|
|
3022
|
+
rewardActions.getTotalPerSecond(client, parameters),
|
|
3023
|
+
setRecipient: (parameters) =>
|
|
3024
|
+
rewardActions.setRecipient(client, parameters),
|
|
3025
|
+
setRecipientSync: (parameters) =>
|
|
3026
|
+
rewardActions.setRecipientSync(client, parameters),
|
|
3027
|
+
start: (parameters) => rewardActions.start(client, parameters),
|
|
3028
|
+
startSync: (parameters) => rewardActions.startSync(client, parameters),
|
|
3029
|
+
},
|
|
2454
3030
|
token: {
|
|
2455
3031
|
approve: (parameters) => tokenActions.approve(client, parameters),
|
|
2456
3032
|
approveSync: (parameters) =>
|
|
@@ -2469,10 +3045,11 @@ export function decorator() {
|
|
|
2469
3045
|
createSync: (parameters) => tokenActions.createSync(client, parameters),
|
|
2470
3046
|
getAllowance: (parameters) =>
|
|
2471
3047
|
tokenActions.getAllowance(client, parameters),
|
|
2472
|
-
// @ts-expect-error
|
|
2473
3048
|
getBalance: (parameters) => tokenActions.getBalance(client, parameters),
|
|
2474
3049
|
getMetadata: (parameters) =>
|
|
2475
3050
|
tokenActions.getMetadata(client, parameters),
|
|
3051
|
+
getRoleAdmin: (parameters) =>
|
|
3052
|
+
tokenActions.getRoleAdmin(client, parameters),
|
|
2476
3053
|
hasRole: (parameters) => tokenActions.hasRole(client, parameters),
|
|
2477
3054
|
grantRoles: (parameters) => tokenActions.grantRoles(client, parameters),
|
|
2478
3055
|
grantRolesSync: (parameters) =>
|
|
@@ -2481,8 +3058,6 @@ export function decorator() {
|
|
|
2481
3058
|
mintSync: (parameters) => tokenActions.mintSync(client, parameters),
|
|
2482
3059
|
pause: (parameters) => tokenActions.pause(client, parameters),
|
|
2483
3060
|
pauseSync: (parameters) => tokenActions.pauseSync(client, parameters),
|
|
2484
|
-
permit: (parameters) => tokenActions.permit(client, parameters),
|
|
2485
|
-
permitSync: (parameters) => tokenActions.permitSync(client, parameters),
|
|
2486
3061
|
renounceRoles: (parameters) =>
|
|
2487
3062
|
tokenActions.renounceRoles(client, parameters),
|
|
2488
3063
|
renounceRolesSync: (parameters) =>
|