tempo.ts 0.1.5 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -2
- package/dist/chains.d.ts +509 -115
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +20 -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.map +1 -1
- package/dist/prool/Instance.js +20 -4
- 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 +144 -161
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +109 -163
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/dex.d.ts +920 -664
- package/dist/viem/Actions/dex.d.ts.map +1 -1
- package/dist/viem/Actions/dex.js +129 -30
- package/dist/viem/Actions/dex.js.map +1 -1
- package/dist/viem/Actions/faucet.d.ts +34 -0
- package/dist/viem/Actions/faucet.d.ts.map +1 -0
- package/dist/viem/Actions/faucet.js +33 -0
- package/dist/viem/Actions/faucet.js.map +1 -0
- package/dist/viem/Actions/fee.d.ts +16 -30
- package/dist/viem/Actions/fee.d.ts.map +1 -1
- package/dist/viem/Actions/fee.js +13 -13
- package/dist/viem/Actions/fee.js.map +1 -1
- package/dist/viem/Actions/index.d.ts +2 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +2 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/policy.d.ts +46 -46
- package/dist/viem/Actions/policy.js +46 -46
- 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 +4399 -2750
- package/dist/viem/Actions/token.d.ts.map +1 -1
- package/dist/viem/Actions/token.js +361 -482
- 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 +1009 -428
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +17 -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/faucet.d.ts +35 -0
- package/dist/wagmi/Actions/faucet.d.ts.map +1 -0
- package/dist/wagmi/Actions/faucet.js +33 -0
- package/dist/wagmi/Actions/faucet.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 +7 -0
- package/dist/wagmi/Actions/index.d.ts.map +1 -0
- package/dist/wagmi/Actions/index.js +7 -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 +81 -0
- package/dist/wagmi/Connector.d.ts.map +1 -0
- package/dist/wagmi/Connector.js +261 -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/faucet.d.ts +39 -0
- package/dist/wagmi/Hooks/faucet.d.ts.map +1 -0
- package/dist/wagmi/Hooks/faucet.js +40 -0
- package/dist/wagmi/Hooks/faucet.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 +7 -0
- package/dist/wagmi/Hooks/index.d.ts.map +1 -0
- package/dist/wagmi/Hooks/index.js +7 -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 +21 -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 +51 -37
- 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 +173 -169
- package/src/viem/Actions/amm.ts +131 -203
- package/src/viem/Actions/dex.test.ts +563 -484
- package/src/viem/Actions/dex.ts +203 -30
- package/src/viem/Actions/faucet.ts +50 -0
- package/src/viem/Actions/fee.test.ts +23 -34
- package/src/viem/Actions/fee.ts +20 -13
- package/src/viem/Actions/index.ts +2 -0
- package/src/viem/Actions/policy.test.ts +19 -33
- package/src/viem/Actions/policy.ts +46 -46
- 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 +605 -693
- package/src/viem/Addresses.ts +1 -2
- package/src/viem/Chain.bench-d.ts +12 -0
- package/src/viem/Chain.ts +70 -20
- package/src/viem/Decorator.bench-d.ts +1 -1
- package/src/viem/Decorator.test.ts +3 -1
- package/src/viem/Decorator.ts +1049 -442
- 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/faucet.ts +46 -0
- package/src/wagmi/Actions/fee.test.ts +63 -0
- package/src/wagmi/Actions/fee.ts +208 -0
- package/src/wagmi/Actions/index.ts +6 -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 +390 -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/faucet.ts +76 -0
- package/src/wagmi/Hooks/fee.test.ts +166 -0
- package/src/wagmi/Hooks/fee.ts +206 -0
- package/src/wagmi/Hooks/index.ts +6 -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/dist/viem/Decorator.d.ts
CHANGED
|
@@ -1,38 +1,26 @@
|
|
|
1
1
|
import type { Account, Chain, Client, Transport } from 'viem';
|
|
2
2
|
import * as ammActions from './Actions/amm.js';
|
|
3
3
|
import * as dexActions from './Actions/dex.js';
|
|
4
|
+
import * as faucetActions from './Actions/faucet.js';
|
|
4
5
|
import * as feeActions from './Actions/fee.js';
|
|
5
6
|
import * as policyActions from './Actions/policy.js';
|
|
7
|
+
import * as rewardActions from './Actions/reward.js';
|
|
6
8
|
import * as tokenActions from './Actions/token.js';
|
|
7
9
|
export type Decorator<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
|
|
8
10
|
amm: {
|
|
9
|
-
/**
|
|
10
|
-
* Gets the pool ID for a token pair.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
15
|
-
*
|
|
16
|
-
* const client = createTempoClient()
|
|
17
|
-
*
|
|
18
|
-
* const poolId = await client.amm.getPoolId({
|
|
19
|
-
* userToken: '0x...',
|
|
20
|
-
* validatorToken: '0x...',
|
|
21
|
-
* })
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @param parameters - Parameters.
|
|
25
|
-
* @returns The pool ID.
|
|
26
|
-
*/
|
|
27
|
-
getPoolId: (parameters: ammActions.getPoolId.Parameters) => Promise<ammActions.getPoolId.ReturnValue>;
|
|
28
11
|
/**
|
|
29
12
|
* Gets the reserves for a liquidity pool.
|
|
30
13
|
*
|
|
31
14
|
* @example
|
|
32
15
|
* ```ts
|
|
33
|
-
* import {
|
|
16
|
+
* import { createClient, http } from 'viem'
|
|
17
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
18
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
34
19
|
*
|
|
35
|
-
* const client =
|
|
20
|
+
* const client = createClient({
|
|
21
|
+
* chain: tempo({ feeToken: '0x20c...001' }),
|
|
22
|
+
* transport: http(),
|
|
23
|
+
* }).extend(tempoActions())
|
|
36
24
|
*
|
|
37
25
|
* const pool = await client.amm.getPool({
|
|
38
26
|
* userToken: '0x...',
|
|
@@ -44,35 +32,19 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
44
32
|
* @returns The pool reserves.
|
|
45
33
|
*/
|
|
46
34
|
getPool: (parameters: ammActions.getPool.Parameters) => Promise<ammActions.getPool.ReturnValue>;
|
|
47
|
-
/**
|
|
48
|
-
* Gets the total supply of LP tokens for a pool.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
53
|
-
*
|
|
54
|
-
* const client = createTempoClient()
|
|
55
|
-
*
|
|
56
|
-
* const poolId = await client.amm.getPoolId({
|
|
57
|
-
* userToken: '0x...',
|
|
58
|
-
* validatorToken: '0x...',
|
|
59
|
-
* })
|
|
60
|
-
*
|
|
61
|
-
* const totalSupply = await client.amm.getTotalSupply({ poolId })
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* @param parameters - Parameters.
|
|
65
|
-
* @returns The total supply of LP tokens.
|
|
66
|
-
*/
|
|
67
|
-
getTotalSupply: (parameters: ammActions.getTotalSupply.Parameters) => Promise<ammActions.getTotalSupply.ReturnValue>;
|
|
68
35
|
/**
|
|
69
36
|
* Gets the LP token balance for an account in a specific pool.
|
|
70
37
|
*
|
|
71
38
|
* @example
|
|
72
39
|
* ```ts
|
|
73
|
-
* import {
|
|
40
|
+
* import { createClient, http } from 'viem'
|
|
41
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
42
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
74
43
|
*
|
|
75
|
-
* const client =
|
|
44
|
+
* const client = createClient({
|
|
45
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
46
|
+
* transport: http(),
|
|
47
|
+
* }).extend(tempoActions())
|
|
76
48
|
*
|
|
77
49
|
* const poolId = await client.amm.getPoolId({
|
|
78
50
|
* userToken: '0x...',
|
|
@@ -94,12 +66,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
94
66
|
*
|
|
95
67
|
* @example
|
|
96
68
|
* ```ts
|
|
97
|
-
* import {
|
|
69
|
+
* import { createClient, http } from 'viem'
|
|
98
70
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
71
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
72
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
99
73
|
*
|
|
100
|
-
* const client =
|
|
101
|
-
* account: privateKeyToAccount('0x...')
|
|
102
|
-
* })
|
|
74
|
+
* const client = createClient({
|
|
75
|
+
* account: privateKeyToAccount('0x...'),
|
|
76
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
77
|
+
* transport: http(),
|
|
78
|
+
* }).extend(tempoActions())
|
|
103
79
|
*
|
|
104
80
|
* const hash = await client.amm.rebalanceSwap({
|
|
105
81
|
* userToken: '0x...',
|
|
@@ -118,12 +94,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
118
94
|
*
|
|
119
95
|
* @example
|
|
120
96
|
* ```ts
|
|
121
|
-
* import {
|
|
97
|
+
* import { createClient, http } from 'viem'
|
|
122
98
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
99
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
100
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
123
101
|
*
|
|
124
|
-
* const client =
|
|
125
|
-
* account: privateKeyToAccount('0x...')
|
|
126
|
-
* })
|
|
102
|
+
* const client = createClient({
|
|
103
|
+
* account: privateKeyToAccount('0x...'),
|
|
104
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
105
|
+
* transport: http(),
|
|
106
|
+
* }).extend(tempoActions())
|
|
127
107
|
*
|
|
128
108
|
* const result = await client.amm.rebalanceSwapSync({
|
|
129
109
|
* userToken: '0x...',
|
|
@@ -142,12 +122,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
142
122
|
*
|
|
143
123
|
* @example
|
|
144
124
|
* ```ts
|
|
145
|
-
* import {
|
|
125
|
+
* import { createClient, http } from 'viem'
|
|
146
126
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
127
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
128
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
147
129
|
*
|
|
148
|
-
* const client =
|
|
149
|
-
* account: privateKeyToAccount('0x...')
|
|
150
|
-
* })
|
|
130
|
+
* const client = createClient({
|
|
131
|
+
* account: privateKeyToAccount('0x...'),
|
|
132
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
133
|
+
* transport: http(),
|
|
134
|
+
* }).extend(tempoActions())
|
|
151
135
|
*
|
|
152
136
|
* const hash = await client.amm.mint({
|
|
153
137
|
* userToken: {
|
|
@@ -171,12 +155,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
171
155
|
*
|
|
172
156
|
* @example
|
|
173
157
|
* ```ts
|
|
174
|
-
* import {
|
|
158
|
+
* import { createClient, http } from 'viem'
|
|
175
159
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
160
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
161
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
176
162
|
*
|
|
177
|
-
* const client =
|
|
178
|
-
* account: privateKeyToAccount('0x...')
|
|
179
|
-
* })
|
|
163
|
+
* const client = createClient({
|
|
164
|
+
* account: privateKeyToAccount('0x...'),
|
|
165
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
166
|
+
* transport: http(),
|
|
167
|
+
* }).extend(tempoActions())
|
|
180
168
|
*
|
|
181
169
|
* const result = await client.amm.mintSync({
|
|
182
170
|
* userToken: {
|
|
@@ -200,12 +188,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
200
188
|
*
|
|
201
189
|
* @example
|
|
202
190
|
* ```ts
|
|
203
|
-
* import {
|
|
191
|
+
* import { createClient, http } from 'viem'
|
|
204
192
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
193
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
194
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
205
195
|
*
|
|
206
|
-
* const client =
|
|
207
|
-
* account: privateKeyToAccount('0x...')
|
|
208
|
-
* })
|
|
196
|
+
* const client = createClient({
|
|
197
|
+
* account: privateKeyToAccount('0x...'),
|
|
198
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
199
|
+
* transport: http(),
|
|
200
|
+
* }).extend(tempoActions())
|
|
209
201
|
*
|
|
210
202
|
* const hash = await client.amm.burn({
|
|
211
203
|
* userToken: '0x...',
|
|
@@ -224,12 +216,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
224
216
|
*
|
|
225
217
|
* @example
|
|
226
218
|
* ```ts
|
|
227
|
-
* import {
|
|
219
|
+
* import { createClient, http } from 'viem'
|
|
228
220
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
221
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
222
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
229
223
|
*
|
|
230
|
-
* const client =
|
|
231
|
-
* account: privateKeyToAccount('0x...')
|
|
232
|
-
* })
|
|
224
|
+
* const client = createClient({
|
|
225
|
+
* account: privateKeyToAccount('0x...'),
|
|
226
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
227
|
+
* transport: http(),
|
|
228
|
+
* }).extend(tempoActions())
|
|
233
229
|
*
|
|
234
230
|
* const result = await client.amm.burnSync({
|
|
235
231
|
* userToken: '0x...',
|
|
@@ -248,9 +244,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
248
244
|
*
|
|
249
245
|
* @example
|
|
250
246
|
* ```ts
|
|
251
|
-
* import {
|
|
247
|
+
* import { createClient, http } from 'viem'
|
|
248
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
249
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
252
250
|
*
|
|
253
|
-
* const client =
|
|
251
|
+
* const client = createClient({
|
|
252
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
253
|
+
* transport: http(),
|
|
254
|
+
* }).extend(tempoActions())
|
|
254
255
|
*
|
|
255
256
|
* const unwatch = client.amm.watchRebalanceSwap({
|
|
256
257
|
* onRebalanceSwap: (args, log) => {
|
|
@@ -268,9 +269,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
268
269
|
*
|
|
269
270
|
* @example
|
|
270
271
|
* ```ts
|
|
271
|
-
* import {
|
|
272
|
+
* import { createClient, http } from 'viem'
|
|
273
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
274
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
272
275
|
*
|
|
273
|
-
* const client =
|
|
276
|
+
* const client = createClient({
|
|
277
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
278
|
+
* transport: http(),
|
|
279
|
+
* }).extend(tempoActions())
|
|
274
280
|
*
|
|
275
281
|
* const unwatch = client.amm.watchFeeSwap({
|
|
276
282
|
* onFeeSwap: (args, log) => {
|
|
@@ -288,9 +294,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
288
294
|
*
|
|
289
295
|
* @example
|
|
290
296
|
* ```ts
|
|
291
|
-
* import {
|
|
297
|
+
* import { createClient, http } from 'viem'
|
|
298
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
299
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
292
300
|
*
|
|
293
|
-
* const client =
|
|
301
|
+
* const client = createClient({
|
|
302
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
303
|
+
* transport: http(),
|
|
304
|
+
* }).extend(tempoActions())
|
|
294
305
|
*
|
|
295
306
|
* const unwatch = client.amm.watchMint({
|
|
296
307
|
* onMint: (args, log) => {
|
|
@@ -308,9 +319,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
308
319
|
*
|
|
309
320
|
* @example
|
|
310
321
|
* ```ts
|
|
311
|
-
* import {
|
|
322
|
+
* import { createClient, http } from 'viem'
|
|
323
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
324
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
312
325
|
*
|
|
313
|
-
* const client =
|
|
326
|
+
* const client = createClient({
|
|
327
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
328
|
+
* transport: http(),
|
|
329
|
+
* }).extend(tempoActions())
|
|
314
330
|
*
|
|
315
331
|
* const unwatch = client.amm.watchBurn({
|
|
316
332
|
* onBurn: (args, log) => {
|
|
@@ -330,12 +346,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
330
346
|
*
|
|
331
347
|
* @example
|
|
332
348
|
* ```ts
|
|
333
|
-
* import {
|
|
349
|
+
* import { createClient, http } from 'viem'
|
|
334
350
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
351
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
352
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
335
353
|
*
|
|
336
|
-
* const client =
|
|
337
|
-
* account: privateKeyToAccount('0x...')
|
|
338
|
-
* })
|
|
354
|
+
* const client = createClient({
|
|
355
|
+
* account: privateKeyToAccount('0x...'),
|
|
356
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
357
|
+
* transport: http(),
|
|
358
|
+
* }).extend(tempoActions())
|
|
339
359
|
*
|
|
340
360
|
* const hash = await client.dex.buy({
|
|
341
361
|
* tokenIn: '0x20c...11',
|
|
@@ -354,12 +374,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
354
374
|
*
|
|
355
375
|
* @example
|
|
356
376
|
* ```ts
|
|
357
|
-
* import {
|
|
377
|
+
* import { createClient, http } from 'viem'
|
|
358
378
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
379
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
380
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
359
381
|
*
|
|
360
|
-
* const client =
|
|
361
|
-
* account: privateKeyToAccount('0x...')
|
|
362
|
-
* })
|
|
382
|
+
* const client = createClient({
|
|
383
|
+
* account: privateKeyToAccount('0x...'),
|
|
384
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
385
|
+
* transport: http(),
|
|
386
|
+
* }).extend(tempoActions())
|
|
363
387
|
*
|
|
364
388
|
* const result = await client.dex.buySync({
|
|
365
389
|
* tokenIn: '0x20c...11',
|
|
@@ -378,12 +402,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
378
402
|
*
|
|
379
403
|
* @example
|
|
380
404
|
* ```ts
|
|
381
|
-
* import {
|
|
405
|
+
* import { createClient, http } from 'viem'
|
|
382
406
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
407
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
408
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
383
409
|
*
|
|
384
|
-
* const client =
|
|
385
|
-
* account: privateKeyToAccount('0x...')
|
|
386
|
-
* })
|
|
410
|
+
* const client = createClient({
|
|
411
|
+
* account: privateKeyToAccount('0x...'),
|
|
412
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
413
|
+
* transport: http(),
|
|
414
|
+
* }).extend(tempoActions())
|
|
387
415
|
*
|
|
388
416
|
* const hash = await client.dex.cancel({
|
|
389
417
|
* orderId: 123n,
|
|
@@ -399,12 +427,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
399
427
|
*
|
|
400
428
|
* @example
|
|
401
429
|
* ```ts
|
|
402
|
-
* import {
|
|
430
|
+
* import { createClient, http } from 'viem'
|
|
403
431
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
432
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
433
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
404
434
|
*
|
|
405
|
-
* const client =
|
|
406
|
-
* account: privateKeyToAccount('0x...')
|
|
407
|
-
* })
|
|
435
|
+
* const client = createClient({
|
|
436
|
+
* account: privateKeyToAccount('0x...'),
|
|
437
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
438
|
+
* transport: http(),
|
|
439
|
+
* }).extend(tempoActions())
|
|
408
440
|
*
|
|
409
441
|
* const result = await client.dex.cancelSync({
|
|
410
442
|
* orderId: 123n,
|
|
@@ -420,12 +452,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
420
452
|
*
|
|
421
453
|
* @example
|
|
422
454
|
* ```ts
|
|
423
|
-
* import {
|
|
455
|
+
* import { createClient, http } from 'viem'
|
|
424
456
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
457
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
458
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
425
459
|
*
|
|
426
|
-
* const client =
|
|
427
|
-
* account: privateKeyToAccount('0x...')
|
|
428
|
-
* })
|
|
460
|
+
* const client = createClient({
|
|
461
|
+
* account: privateKeyToAccount('0x...'),
|
|
462
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
463
|
+
* transport: http(),
|
|
464
|
+
* }).extend(tempoActions())
|
|
429
465
|
*
|
|
430
466
|
* const hash = await client.dex.createPair({
|
|
431
467
|
* base: '0x20c...11',
|
|
@@ -441,12 +477,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
441
477
|
*
|
|
442
478
|
* @example
|
|
443
479
|
* ```ts
|
|
444
|
-
* import {
|
|
480
|
+
* import { createClient, http } from 'viem'
|
|
445
481
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
482
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
483
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
446
484
|
*
|
|
447
|
-
* const client =
|
|
448
|
-
* account: privateKeyToAccount('0x...')
|
|
449
|
-
* })
|
|
485
|
+
* const client = createClient({
|
|
486
|
+
* account: privateKeyToAccount('0x...'),
|
|
487
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
488
|
+
* transport: http(),
|
|
489
|
+
* }).extend(tempoActions())
|
|
450
490
|
*
|
|
451
491
|
* const result = await client.dex.createPairSync({
|
|
452
492
|
* base: '0x20c...11',
|
|
@@ -462,9 +502,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
462
502
|
*
|
|
463
503
|
* @example
|
|
464
504
|
* ```ts
|
|
465
|
-
* import {
|
|
505
|
+
* import { createClient, http } from 'viem'
|
|
506
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
507
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
466
508
|
*
|
|
467
|
-
* const client =
|
|
509
|
+
* const client = createClient({
|
|
510
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
511
|
+
* transport: http(),
|
|
512
|
+
* }).extend(tempoActions())
|
|
468
513
|
*
|
|
469
514
|
* const balance = await client.dex.getBalance({
|
|
470
515
|
* account: '0x...',
|
|
@@ -481,9 +526,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
481
526
|
*
|
|
482
527
|
* @example
|
|
483
528
|
* ```ts
|
|
484
|
-
* import {
|
|
529
|
+
* import { createClient, http } from 'viem'
|
|
530
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
531
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
485
532
|
*
|
|
486
|
-
* const client =
|
|
533
|
+
* const client = createClient({
|
|
534
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
535
|
+
* transport: http(),
|
|
536
|
+
* }).extend(tempoActions())
|
|
487
537
|
*
|
|
488
538
|
* const amountIn = await client.dex.getBuyQuote({
|
|
489
539
|
* tokenIn: '0x20c...11',
|
|
@@ -501,9 +551,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
501
551
|
*
|
|
502
552
|
* @example
|
|
503
553
|
* ```ts
|
|
504
|
-
* import {
|
|
554
|
+
* import { createClient, http } from 'viem'
|
|
555
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
556
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
505
557
|
*
|
|
506
|
-
* const client =
|
|
558
|
+
* const client = createClient({
|
|
559
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
560
|
+
* transport: http(),
|
|
561
|
+
* }).extend(tempoActions())
|
|
507
562
|
*
|
|
508
563
|
* const order = await client.dex.getOrder({
|
|
509
564
|
* orderId: 123n,
|
|
@@ -514,14 +569,46 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
514
569
|
* @returns The order details.
|
|
515
570
|
*/
|
|
516
571
|
getOrder: (parameters: dexActions.getOrder.Parameters) => Promise<dexActions.getOrder.ReturnValue>;
|
|
572
|
+
/**
|
|
573
|
+
* Gets paginated orders from the orderbook.
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* ```ts
|
|
577
|
+
* import { createClient, http } from 'viem'
|
|
578
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
579
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
580
|
+
*
|
|
581
|
+
* const client = createClient({
|
|
582
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
583
|
+
* transport: http(),
|
|
584
|
+
* }).extend(tempoActions())
|
|
585
|
+
*
|
|
586
|
+
* const { orders, nextCursor } = await client.dex.getOrders({
|
|
587
|
+
* limit: 100,
|
|
588
|
+
* filters: {
|
|
589
|
+
* baseToken: '0x20c0...',
|
|
590
|
+
* isBid: true,
|
|
591
|
+
* }
|
|
592
|
+
* })
|
|
593
|
+
* ```
|
|
594
|
+
*
|
|
595
|
+
* @param parameters - Parameters.
|
|
596
|
+
* @returns Paginated orders and next cursor.
|
|
597
|
+
*/
|
|
598
|
+
getOrders: (parameters?: dexActions.getOrders.Parameters) => Promise<dexActions.getOrders.ReturnValue>;
|
|
517
599
|
/**
|
|
518
600
|
* Gets the price level information at a specific tick.
|
|
519
601
|
*
|
|
520
602
|
* @example
|
|
521
603
|
* ```ts
|
|
522
|
-
* import {
|
|
604
|
+
* import { createClient, http } from 'viem'
|
|
605
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
606
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
523
607
|
*
|
|
524
|
-
* const client =
|
|
608
|
+
* const client = createClient({
|
|
609
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
610
|
+
* transport: http(),
|
|
611
|
+
* }).extend(tempoActions())
|
|
525
612
|
*
|
|
526
613
|
* const level = await client.dex.getPriceLevel({
|
|
527
614
|
* base: '0x20c...11',
|
|
@@ -539,9 +626,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
539
626
|
*
|
|
540
627
|
* @example
|
|
541
628
|
* ```ts
|
|
542
|
-
* import {
|
|
629
|
+
* import { createClient, http } from 'viem'
|
|
630
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
631
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
543
632
|
*
|
|
544
|
-
* const client =
|
|
633
|
+
* const client = createClient({
|
|
634
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
635
|
+
* transport: http(),
|
|
636
|
+
* }).extend(tempoActions())
|
|
545
637
|
*
|
|
546
638
|
* const amountOut = await client.dex.getSellQuote({
|
|
547
639
|
* tokenIn: '0x20c...11',
|
|
@@ -559,12 +651,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
559
651
|
*
|
|
560
652
|
* @example
|
|
561
653
|
* ```ts
|
|
562
|
-
* import {
|
|
654
|
+
* import { createClient, http } from 'viem'
|
|
563
655
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
656
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
657
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
564
658
|
*
|
|
565
|
-
* const client =
|
|
566
|
-
* account: privateKeyToAccount('0x...')
|
|
567
|
-
* })
|
|
659
|
+
* const client = createClient({
|
|
660
|
+
* account: privateKeyToAccount('0x...'),
|
|
661
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
662
|
+
* transport: http(),
|
|
663
|
+
* }).extend(tempoActions())
|
|
568
664
|
*
|
|
569
665
|
* const hash = await client.dex.place({
|
|
570
666
|
* token: '0x20c...11',
|
|
@@ -583,12 +679,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
583
679
|
*
|
|
584
680
|
* @example
|
|
585
681
|
* ```ts
|
|
586
|
-
* import {
|
|
682
|
+
* import { createClient, http } from 'viem'
|
|
587
683
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
684
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
685
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
588
686
|
*
|
|
589
|
-
* const client =
|
|
590
|
-
* account: privateKeyToAccount('0x...')
|
|
591
|
-
* })
|
|
687
|
+
* const client = createClient({
|
|
688
|
+
* account: privateKeyToAccount('0x...'),
|
|
689
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
690
|
+
* transport: http(),
|
|
691
|
+
* }).extend(tempoActions())
|
|
592
692
|
*
|
|
593
693
|
* const result = await client.dex.placeSync({
|
|
594
694
|
* token: '0x20c...11',
|
|
@@ -607,12 +707,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
607
707
|
*
|
|
608
708
|
* @example
|
|
609
709
|
* ```ts
|
|
610
|
-
* import {
|
|
710
|
+
* import { createClient, http } from 'viem'
|
|
611
711
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
712
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
713
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
612
714
|
*
|
|
613
|
-
* const client =
|
|
614
|
-
* account: privateKeyToAccount('0x...')
|
|
615
|
-
* })
|
|
715
|
+
* const client = createClient({
|
|
716
|
+
* account: privateKeyToAccount('0x...'),
|
|
717
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
718
|
+
* transport: http(),
|
|
719
|
+
* }).extend(tempoActions())
|
|
616
720
|
*
|
|
617
721
|
* const hash = await client.dex.placeFlip({
|
|
618
722
|
* token: '0x20c...11',
|
|
@@ -632,12 +736,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
632
736
|
*
|
|
633
737
|
* @example
|
|
634
738
|
* ```ts
|
|
635
|
-
* import {
|
|
739
|
+
* import { createClient, http } from 'viem'
|
|
636
740
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
741
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
742
|
+
* import { tempoActions, Tick } from 'tempo.ts/viem'
|
|
637
743
|
*
|
|
638
|
-
* const client =
|
|
639
|
-
* account: privateKeyToAccount('0x...')
|
|
640
|
-
* })
|
|
744
|
+
* const client = createClient({
|
|
745
|
+
* account: privateKeyToAccount('0x...'),
|
|
746
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
747
|
+
* transport: http(),
|
|
748
|
+
* }).extend(tempoActions())
|
|
641
749
|
*
|
|
642
750
|
* const result = await client.dex.placeFlipSync({
|
|
643
751
|
* token: '0x20c...11',
|
|
@@ -657,12 +765,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
657
765
|
*
|
|
658
766
|
* @example
|
|
659
767
|
* ```ts
|
|
660
|
-
* import {
|
|
768
|
+
* import { createClient, http } from 'viem'
|
|
661
769
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
770
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
771
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
662
772
|
*
|
|
663
|
-
* const client =
|
|
664
|
-
* account: privateKeyToAccount('0x...')
|
|
665
|
-
* })
|
|
773
|
+
* const client = createClient({
|
|
774
|
+
* account: privateKeyToAccount('0x...'),
|
|
775
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
776
|
+
* transport: http(),
|
|
777
|
+
* }).extend(tempoActions())
|
|
666
778
|
*
|
|
667
779
|
* const hash = await client.dex.sell({
|
|
668
780
|
* tokenIn: '0x20c...11',
|
|
@@ -681,12 +793,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
681
793
|
*
|
|
682
794
|
* @example
|
|
683
795
|
* ```ts
|
|
684
|
-
* import {
|
|
796
|
+
* import { createClient, http } from 'viem'
|
|
685
797
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
798
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
799
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
686
800
|
*
|
|
687
|
-
* const client =
|
|
688
|
-
* account: privateKeyToAccount('0x...')
|
|
689
|
-
* })
|
|
801
|
+
* const client = createClient({
|
|
802
|
+
* account: privateKeyToAccount('0x...'),
|
|
803
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
804
|
+
* transport: http(),
|
|
805
|
+
* }).extend(tempoActions())
|
|
690
806
|
*
|
|
691
807
|
* const result = await client.dex.sellSync({
|
|
692
808
|
* tokenIn: '0x20c...11',
|
|
@@ -705,12 +821,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
705
821
|
*
|
|
706
822
|
* @example
|
|
707
823
|
* ```ts
|
|
708
|
-
* import {
|
|
824
|
+
* import { createClient, http } from 'viem'
|
|
709
825
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
826
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
827
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
710
828
|
*
|
|
711
|
-
* const client =
|
|
712
|
-
* account: privateKeyToAccount('0x...')
|
|
713
|
-
* })
|
|
829
|
+
* const client = createClient({
|
|
830
|
+
* account: privateKeyToAccount('0x...'),
|
|
831
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
832
|
+
* transport: http(),
|
|
833
|
+
* }).extend(tempoActions())
|
|
714
834
|
*
|
|
715
835
|
* const hash = await client.dex.withdraw({
|
|
716
836
|
* token: '0x20c...11',
|
|
@@ -727,12 +847,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
727
847
|
*
|
|
728
848
|
* @example
|
|
729
849
|
* ```ts
|
|
730
|
-
* import {
|
|
850
|
+
* import { createClient, http } from 'viem'
|
|
731
851
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
852
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
853
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
732
854
|
*
|
|
733
|
-
* const client =
|
|
734
|
-
* account: privateKeyToAccount('0x...')
|
|
735
|
-
* })
|
|
855
|
+
* const client = createClient({
|
|
856
|
+
* account: privateKeyToAccount('0x...'),
|
|
857
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
858
|
+
* transport: http(),
|
|
859
|
+
* }).extend(tempoActions())
|
|
736
860
|
*
|
|
737
861
|
* const result = await client.dex.withdrawSync({
|
|
738
862
|
* token: '0x20c...11',
|
|
@@ -749,9 +873,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
749
873
|
*
|
|
750
874
|
* @example
|
|
751
875
|
* ```ts
|
|
752
|
-
* import {
|
|
876
|
+
* import { createClient, http } from 'viem'
|
|
877
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
878
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
753
879
|
*
|
|
754
|
-
* const client =
|
|
880
|
+
* const client = createClient({
|
|
881
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
882
|
+
* transport: http(),
|
|
883
|
+
* }).extend(tempoActions())
|
|
755
884
|
*
|
|
756
885
|
* const unwatch = client.dex.watchFlipOrderPlaced({
|
|
757
886
|
* onFlipOrderPlaced: (args, log) => {
|
|
@@ -769,9 +898,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
769
898
|
*
|
|
770
899
|
* @example
|
|
771
900
|
* ```ts
|
|
772
|
-
* import {
|
|
901
|
+
* import { createClient, http } from 'viem'
|
|
902
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
903
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
773
904
|
*
|
|
774
|
-
* const client =
|
|
905
|
+
* const client = createClient({
|
|
906
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
907
|
+
* transport: http(),
|
|
908
|
+
* }).extend(tempoActions())
|
|
775
909
|
*
|
|
776
910
|
* const unwatch = client.dex.watchOrderCancelled({
|
|
777
911
|
* onOrderCancelled: (args, log) => {
|
|
@@ -789,9 +923,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
789
923
|
*
|
|
790
924
|
* @example
|
|
791
925
|
* ```ts
|
|
792
|
-
* import {
|
|
926
|
+
* import { createClient, http } from 'viem'
|
|
927
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
928
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
793
929
|
*
|
|
794
|
-
* const client =
|
|
930
|
+
* const client = createClient({
|
|
931
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
932
|
+
* transport: http(),
|
|
933
|
+
* }).extend(tempoActions())
|
|
795
934
|
*
|
|
796
935
|
* const unwatch = client.dex.watchOrderFilled({
|
|
797
936
|
* onOrderFilled: (args, log) => {
|
|
@@ -809,9 +948,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
809
948
|
*
|
|
810
949
|
* @example
|
|
811
950
|
* ```ts
|
|
812
|
-
* import {
|
|
951
|
+
* import { createClient, http } from 'viem'
|
|
952
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
953
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
813
954
|
*
|
|
814
|
-
* const client =
|
|
955
|
+
* const client = createClient({
|
|
956
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
957
|
+
* transport: http(),
|
|
958
|
+
* }).extend(tempoActions())
|
|
815
959
|
*
|
|
816
960
|
* const unwatch = client.dex.watchOrderPlaced({
|
|
817
961
|
* onOrderPlaced: (args, log) => {
|
|
@@ -825,18 +969,48 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
825
969
|
*/
|
|
826
970
|
watchOrderPlaced: (parameters: dexActions.watchOrderPlaced.Parameters) => () => void;
|
|
827
971
|
};
|
|
972
|
+
faucet: {
|
|
973
|
+
/**
|
|
974
|
+
* Funds an account with an initial amount of set token(s)
|
|
975
|
+
* on Tempo's testnet.
|
|
976
|
+
*
|
|
977
|
+
* @example
|
|
978
|
+
* ```ts
|
|
979
|
+
* import { createClient, http } from 'viem'
|
|
980
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
981
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
982
|
+
*
|
|
983
|
+
* const client = createClient({
|
|
984
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
985
|
+
* transport: http(),
|
|
986
|
+
* }).extend(tempoActions())
|
|
987
|
+
*
|
|
988
|
+
* const hashes = await client.faucet.fund({
|
|
989
|
+
* account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
|
|
990
|
+
* })
|
|
991
|
+
* ```
|
|
992
|
+
*
|
|
993
|
+
* @param parameters - Parameters.
|
|
994
|
+
* @returns The transaction hashes.
|
|
995
|
+
*/
|
|
996
|
+
fund: (parameters: faucetActions.fund.Parameters) => Promise<faucetActions.fund.ReturnValue>;
|
|
997
|
+
};
|
|
828
998
|
fee: {
|
|
829
999
|
/**
|
|
830
1000
|
* Gets the user's default fee token.
|
|
831
1001
|
*
|
|
832
1002
|
* @example
|
|
833
1003
|
* ```ts
|
|
834
|
-
* import {
|
|
1004
|
+
* import { createClient, http } from 'viem'
|
|
835
1005
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1006
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1007
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
836
1008
|
*
|
|
837
|
-
* const client =
|
|
838
|
-
* account: privateKeyToAccount('0x...')
|
|
839
|
-
* })
|
|
1009
|
+
* const client = createClient({
|
|
1010
|
+
* account: privateKeyToAccount('0x...'),
|
|
1011
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1012
|
+
* transport: http(),
|
|
1013
|
+
* }).extend(tempoActions())
|
|
840
1014
|
*
|
|
841
1015
|
* const { address, id } = await client.token.getUserToken()
|
|
842
1016
|
* ```
|
|
@@ -851,12 +1025,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
851
1025
|
*
|
|
852
1026
|
* @example
|
|
853
1027
|
* ```ts
|
|
854
|
-
* import {
|
|
1028
|
+
* import { createClient, http } from 'viem'
|
|
855
1029
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1030
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1031
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
856
1032
|
*
|
|
857
|
-
* const client =
|
|
858
|
-
* account: privateKeyToAccount('0x...')
|
|
859
|
-
* })
|
|
1033
|
+
* const client = createClient({
|
|
1034
|
+
* account: privateKeyToAccount('0x...'),
|
|
1035
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1036
|
+
* transport: http(),
|
|
1037
|
+
* }).extend(tempoActions())
|
|
860
1038
|
*
|
|
861
1039
|
* const hash = await client.token.setUserToken({
|
|
862
1040
|
* token: '0x...',
|
|
@@ -873,12 +1051,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
873
1051
|
*
|
|
874
1052
|
* @example
|
|
875
1053
|
* ```ts
|
|
876
|
-
* import {
|
|
1054
|
+
* import { createClient, http } from 'viem'
|
|
877
1055
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1056
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1057
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
878
1058
|
*
|
|
879
|
-
* const client =
|
|
880
|
-
* account: privateKeyToAccount('0x...')
|
|
881
|
-
* })
|
|
1059
|
+
* const client = createClient({
|
|
1060
|
+
* account: privateKeyToAccount('0x...'),
|
|
1061
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1062
|
+
* transport: http(),
|
|
1063
|
+
* }).extend(tempoActions())
|
|
882
1064
|
*
|
|
883
1065
|
* const result = await client.fee.setUserTokenSync({
|
|
884
1066
|
* token: '0x...',
|
|
@@ -894,9 +1076,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
894
1076
|
*
|
|
895
1077
|
* @example
|
|
896
1078
|
* ```ts
|
|
897
|
-
* import {
|
|
1079
|
+
* import { createClient, http } from 'viem'
|
|
1080
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1081
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
898
1082
|
*
|
|
899
|
-
* const client =
|
|
1083
|
+
* const client = createClient({
|
|
1084
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1085
|
+
* transport: http(),
|
|
1086
|
+
* }).extend(tempoActions())
|
|
900
1087
|
*
|
|
901
1088
|
* const unwatch = client.token.watchSetUserToken({
|
|
902
1089
|
* onUserTokenSet: (args, log) => {
|
|
@@ -917,12 +1104,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
917
1104
|
*
|
|
918
1105
|
* @example
|
|
919
1106
|
* ```ts
|
|
920
|
-
* import {
|
|
1107
|
+
* import { createClient, http } from 'viem'
|
|
921
1108
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1109
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1110
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
922
1111
|
*
|
|
923
|
-
* const client =
|
|
924
|
-
* account: privateKeyToAccount('0x...')
|
|
925
|
-
* })
|
|
1112
|
+
* const client = createClient({
|
|
1113
|
+
* account: privateKeyToAccount('0x...'),
|
|
1114
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1115
|
+
* transport: http(),
|
|
1116
|
+
* }).extend(tempoActions())
|
|
926
1117
|
*
|
|
927
1118
|
* const hash = await client.policy.create({
|
|
928
1119
|
* admin: '0x...',
|
|
@@ -939,12 +1130,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
939
1130
|
*
|
|
940
1131
|
* @example
|
|
941
1132
|
* ```ts
|
|
942
|
-
* import {
|
|
1133
|
+
* import { createClient, http } from 'viem'
|
|
943
1134
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1135
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1136
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
944
1137
|
*
|
|
945
|
-
* const client =
|
|
946
|
-
* account: privateKeyToAccount('0x...')
|
|
947
|
-
* })
|
|
1138
|
+
* const client = createClient({
|
|
1139
|
+
* account: privateKeyToAccount('0x...'),
|
|
1140
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1141
|
+
* transport: http(),
|
|
1142
|
+
* }).extend(tempoActions())
|
|
948
1143
|
*
|
|
949
1144
|
* const result = await client.policy.createSync({
|
|
950
1145
|
* admin: '0x...',
|
|
@@ -961,12 +1156,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
961
1156
|
*
|
|
962
1157
|
* @example
|
|
963
1158
|
* ```ts
|
|
964
|
-
* import {
|
|
1159
|
+
* import { createClient, http } from 'viem'
|
|
965
1160
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1161
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1162
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
966
1163
|
*
|
|
967
|
-
* const client =
|
|
968
|
-
* account: privateKeyToAccount('0x...')
|
|
969
|
-
* })
|
|
1164
|
+
* const client = createClient({
|
|
1165
|
+
* account: privateKeyToAccount('0x...'),
|
|
1166
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1167
|
+
* transport: http(),
|
|
1168
|
+
* }).extend(tempoActions())
|
|
970
1169
|
*
|
|
971
1170
|
* const hash = await client.policy.setAdmin({
|
|
972
1171
|
* policyId: 2n,
|
|
@@ -983,12 +1182,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
983
1182
|
*
|
|
984
1183
|
* @example
|
|
985
1184
|
* ```ts
|
|
986
|
-
* import {
|
|
1185
|
+
* import { createClient, http } from 'viem'
|
|
987
1186
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1187
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1188
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
988
1189
|
*
|
|
989
|
-
* const client =
|
|
990
|
-
* account: privateKeyToAccount('0x...')
|
|
991
|
-
* })
|
|
1190
|
+
* const client = createClient({
|
|
1191
|
+
* account: privateKeyToAccount('0x...'),
|
|
1192
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1193
|
+
* transport: http(),
|
|
1194
|
+
* }).extend(tempoActions())
|
|
992
1195
|
*
|
|
993
1196
|
* const result = await client.policy.setAdminSync({
|
|
994
1197
|
* policyId: 2n,
|
|
@@ -1005,12 +1208,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1005
1208
|
*
|
|
1006
1209
|
* @example
|
|
1007
1210
|
* ```ts
|
|
1008
|
-
* import {
|
|
1211
|
+
* import { createClient, http } from 'viem'
|
|
1009
1212
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1213
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1214
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1010
1215
|
*
|
|
1011
|
-
* const client =
|
|
1012
|
-
* account: privateKeyToAccount('0x...')
|
|
1013
|
-
* })
|
|
1216
|
+
* const client = createClient({
|
|
1217
|
+
* account: privateKeyToAccount('0x...'),
|
|
1218
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1219
|
+
* transport: http(),
|
|
1220
|
+
* }).extend(tempoActions())
|
|
1014
1221
|
*
|
|
1015
1222
|
* const hash = await client.policy.modifyWhitelist({
|
|
1016
1223
|
* policyId: 2n,
|
|
@@ -1028,12 +1235,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1028
1235
|
*
|
|
1029
1236
|
* @example
|
|
1030
1237
|
* ```ts
|
|
1031
|
-
* import {
|
|
1238
|
+
* import { createClient, http } from 'viem'
|
|
1032
1239
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1240
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1241
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1033
1242
|
*
|
|
1034
|
-
* const client =
|
|
1035
|
-
* account: privateKeyToAccount('0x...')
|
|
1036
|
-
* })
|
|
1243
|
+
* const client = createClient({
|
|
1244
|
+
* account: privateKeyToAccount('0x...'),
|
|
1245
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1246
|
+
* transport: http(),
|
|
1247
|
+
* }).extend(tempoActions())
|
|
1037
1248
|
*
|
|
1038
1249
|
* const result = await client.policy.modifyWhitelistSync({
|
|
1039
1250
|
* policyId: 2n,
|
|
@@ -1051,12 +1262,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1051
1262
|
*
|
|
1052
1263
|
* @example
|
|
1053
1264
|
* ```ts
|
|
1054
|
-
* import {
|
|
1265
|
+
* import { createClient, http } from 'viem'
|
|
1055
1266
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1267
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1268
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1056
1269
|
*
|
|
1057
|
-
* const client =
|
|
1058
|
-
* account: privateKeyToAccount('0x...')
|
|
1059
|
-
* })
|
|
1270
|
+
* const client = createClient({
|
|
1271
|
+
* account: privateKeyToAccount('0x...'),
|
|
1272
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1273
|
+
* transport: http(),
|
|
1274
|
+
* }).extend(tempoActions())
|
|
1060
1275
|
*
|
|
1061
1276
|
* const hash = await client.policy.modifyBlacklist({
|
|
1062
1277
|
* policyId: 2n,
|
|
@@ -1074,12 +1289,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1074
1289
|
*
|
|
1075
1290
|
* @example
|
|
1076
1291
|
* ```ts
|
|
1077
|
-
* import {
|
|
1292
|
+
* import { createClient, http } from 'viem'
|
|
1078
1293
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1294
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1295
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1079
1296
|
*
|
|
1080
|
-
* const client =
|
|
1081
|
-
* account: privateKeyToAccount('0x...')
|
|
1082
|
-
* })
|
|
1297
|
+
* const client = createClient({
|
|
1298
|
+
* account: privateKeyToAccount('0x...'),
|
|
1299
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1300
|
+
* transport: http(),
|
|
1301
|
+
* }).extend(tempoActions())
|
|
1083
1302
|
*
|
|
1084
1303
|
* const result = await client.policy.modifyBlacklistSync({
|
|
1085
1304
|
* policyId: 2n,
|
|
@@ -1097,9 +1316,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1097
1316
|
*
|
|
1098
1317
|
* @example
|
|
1099
1318
|
* ```ts
|
|
1100
|
-
* import {
|
|
1319
|
+
* import { createClient, http } from 'viem'
|
|
1320
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1321
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1101
1322
|
*
|
|
1102
|
-
* const client =
|
|
1323
|
+
* const client = createClient({
|
|
1324
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1325
|
+
* transport: http(),
|
|
1326
|
+
* }).extend(tempoActions())
|
|
1103
1327
|
*
|
|
1104
1328
|
* const data = await client.policy.getData({
|
|
1105
1329
|
* policyId: 2n,
|
|
@@ -1115,9 +1339,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1115
1339
|
*
|
|
1116
1340
|
* @example
|
|
1117
1341
|
* ```ts
|
|
1118
|
-
* import {
|
|
1342
|
+
* import { createClient, http } from 'viem'
|
|
1343
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1344
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1119
1345
|
*
|
|
1120
|
-
* const client =
|
|
1346
|
+
* const client = createClient({
|
|
1347
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1348
|
+
* transport: http(),
|
|
1349
|
+
* }).extend(tempoActions())
|
|
1121
1350
|
*
|
|
1122
1351
|
* const authorized = await client.policy.isAuthorized({
|
|
1123
1352
|
* policyId: 2n,
|
|
@@ -1134,9 +1363,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1134
1363
|
*
|
|
1135
1364
|
* @example
|
|
1136
1365
|
* ```ts
|
|
1137
|
-
* import {
|
|
1366
|
+
* import { createClient, http } from 'viem'
|
|
1367
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1368
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1138
1369
|
*
|
|
1139
|
-
* const client =
|
|
1370
|
+
* const client = createClient({
|
|
1371
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1372
|
+
* transport: http(),
|
|
1373
|
+
* }).extend(tempoActions())
|
|
1140
1374
|
*
|
|
1141
1375
|
* const unwatch = client.policy.watchCreate({
|
|
1142
1376
|
* onPolicyCreated: (args, log) => {
|
|
@@ -1154,9 +1388,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1154
1388
|
*
|
|
1155
1389
|
* @example
|
|
1156
1390
|
* ```ts
|
|
1157
|
-
* import {
|
|
1391
|
+
* import { createClient, http } from 'viem'
|
|
1392
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1393
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1158
1394
|
*
|
|
1159
|
-
* const client =
|
|
1395
|
+
* const client = createClient({
|
|
1396
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1397
|
+
* transport: http(),
|
|
1398
|
+
* }).extend(tempoActions())
|
|
1160
1399
|
*
|
|
1161
1400
|
* const unwatch = client.policy.watchAdminUpdated({
|
|
1162
1401
|
* onAdminUpdated: (args, log) => {
|
|
@@ -1174,9 +1413,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1174
1413
|
*
|
|
1175
1414
|
* @example
|
|
1176
1415
|
* ```ts
|
|
1177
|
-
* import {
|
|
1416
|
+
* import { createClient, http } from 'viem'
|
|
1417
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1418
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1178
1419
|
*
|
|
1179
|
-
* const client =
|
|
1420
|
+
* const client = createClient({
|
|
1421
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1422
|
+
* transport: http(),
|
|
1423
|
+
* }).extend(tempoActions())
|
|
1180
1424
|
*
|
|
1181
1425
|
* const unwatch = client.policy.watchWhitelistUpdated({
|
|
1182
1426
|
* onWhitelistUpdated: (args, log) => {
|
|
@@ -1194,9 +1438,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1194
1438
|
*
|
|
1195
1439
|
* @example
|
|
1196
1440
|
* ```ts
|
|
1197
|
-
* import {
|
|
1441
|
+
* import { createClient, http } from 'viem'
|
|
1442
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1443
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1198
1444
|
*
|
|
1199
|
-
* const client =
|
|
1445
|
+
* const client = createClient({
|
|
1446
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1447
|
+
* transport: http(),
|
|
1448
|
+
* }).extend(tempoActions())
|
|
1200
1449
|
*
|
|
1201
1450
|
* const unwatch = client.policy.watchBlacklistUpdated({
|
|
1202
1451
|
* onBlacklistUpdated: (args, log) => {
|
|
@@ -1210,88 +1459,311 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1210
1459
|
*/
|
|
1211
1460
|
watchBlacklistUpdated: (parameters: policyActions.watchBlacklistUpdated.Parameters) => () => void;
|
|
1212
1461
|
};
|
|
1213
|
-
|
|
1462
|
+
reward: {
|
|
1214
1463
|
/**
|
|
1215
|
-
*
|
|
1464
|
+
* Cancels an active reward stream and refunds remaining tokens.
|
|
1216
1465
|
*
|
|
1217
1466
|
* @example
|
|
1218
1467
|
* ```ts
|
|
1219
|
-
* import {
|
|
1468
|
+
* import { createClient, http } from 'viem'
|
|
1220
1469
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1470
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1471
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1221
1472
|
*
|
|
1222
|
-
* const client =
|
|
1223
|
-
* account: privateKeyToAccount('0x...')
|
|
1224
|
-
* })
|
|
1473
|
+
* const client = createClient({
|
|
1474
|
+
* account: privateKeyToAccount('0x...'),
|
|
1475
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1476
|
+
* transport: http(),
|
|
1477
|
+
* }).extend(tempoActions())
|
|
1225
1478
|
*
|
|
1226
|
-
* const hash = await client.
|
|
1227
|
-
*
|
|
1228
|
-
*
|
|
1479
|
+
* const hash = await client.reward.cancel({
|
|
1480
|
+
* id: 1n,
|
|
1481
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1229
1482
|
* })
|
|
1230
1483
|
* ```
|
|
1231
1484
|
*
|
|
1232
|
-
* @param client - Client.
|
|
1233
1485
|
* @param parameters - Parameters.
|
|
1234
1486
|
* @returns The transaction hash.
|
|
1235
1487
|
*/
|
|
1236
|
-
|
|
1488
|
+
cancel: (parameters: rewardActions.cancel.Parameters<chain, account>) => Promise<rewardActions.cancel.ReturnValue>;
|
|
1237
1489
|
/**
|
|
1238
|
-
*
|
|
1490
|
+
* Cancels an active reward stream and waits for confirmation.
|
|
1239
1491
|
*
|
|
1240
1492
|
* @example
|
|
1241
1493
|
* ```ts
|
|
1242
|
-
* import {
|
|
1494
|
+
* import { createClient, http } from 'viem'
|
|
1243
1495
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1496
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1497
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1244
1498
|
*
|
|
1245
|
-
* const client =
|
|
1246
|
-
* account: privateKeyToAccount('0x...')
|
|
1247
|
-
* })
|
|
1499
|
+
* const client = createClient({
|
|
1500
|
+
* account: privateKeyToAccount('0x...'),
|
|
1501
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1502
|
+
* transport: http(),
|
|
1503
|
+
* }).extend(tempoActions())
|
|
1248
1504
|
*
|
|
1249
|
-
* const result = await client.
|
|
1250
|
-
*
|
|
1251
|
-
*
|
|
1505
|
+
* const result = await client.reward.cancelSync({
|
|
1506
|
+
* id: 1n,
|
|
1507
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1252
1508
|
* })
|
|
1253
1509
|
* ```
|
|
1254
1510
|
*
|
|
1255
|
-
* @param client - Client.
|
|
1256
1511
|
* @param parameters - Parameters.
|
|
1257
1512
|
* @returns The transaction receipt and event data.
|
|
1258
1513
|
*/
|
|
1259
|
-
|
|
1514
|
+
cancelSync: (parameters: rewardActions.cancelSync.Parameters<chain, account>) => Promise<rewardActions.cancelSync.ReturnValue>;
|
|
1260
1515
|
/**
|
|
1261
|
-
*
|
|
1516
|
+
* Gets a reward stream by its ID.
|
|
1262
1517
|
*
|
|
1263
1518
|
* @example
|
|
1264
1519
|
* ```ts
|
|
1265
|
-
* import {
|
|
1266
|
-
* import {
|
|
1520
|
+
* import { createClient, http } from 'viem'
|
|
1521
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1522
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1267
1523
|
*
|
|
1268
|
-
* const client =
|
|
1269
|
-
*
|
|
1270
|
-
*
|
|
1524
|
+
* const client = createClient({
|
|
1525
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1526
|
+
* transport: http(),
|
|
1527
|
+
* }).extend(tempoActions())
|
|
1271
1528
|
*
|
|
1272
|
-
* const
|
|
1273
|
-
*
|
|
1274
|
-
*
|
|
1275
|
-
* token: '0x...',
|
|
1529
|
+
* const stream = await client.reward.getStream({
|
|
1530
|
+
* id: 1n,
|
|
1531
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1276
1532
|
* })
|
|
1277
1533
|
* ```
|
|
1278
1534
|
*
|
|
1279
|
-
* @param client - Client.
|
|
1280
1535
|
* @param parameters - Parameters.
|
|
1281
|
-
* @returns The
|
|
1536
|
+
* @returns The reward stream details.
|
|
1282
1537
|
*/
|
|
1283
|
-
|
|
1538
|
+
getStream: (parameters: rewardActions.getStream.Parameters) => Promise<rewardActions.getStream.ReturnValue>;
|
|
1539
|
+
/**
|
|
1540
|
+
* Gets the total reward per second rate for all active streams.
|
|
1541
|
+
*
|
|
1542
|
+
* @example
|
|
1543
|
+
* ```ts
|
|
1544
|
+
* import { createClient, http } from 'viem'
|
|
1545
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1546
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1547
|
+
*
|
|
1548
|
+
* const client = createClient({
|
|
1549
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1550
|
+
* transport: http(),
|
|
1551
|
+
* }).extend(tempoActions())
|
|
1552
|
+
*
|
|
1553
|
+
* const rate = await client.reward.getTotalPerSecond({
|
|
1554
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1555
|
+
* })
|
|
1556
|
+
* ```
|
|
1557
|
+
*
|
|
1558
|
+
* @param parameters - Parameters.
|
|
1559
|
+
* @returns The total reward per second (scaled by 1e18).
|
|
1560
|
+
*/
|
|
1561
|
+
getTotalPerSecond: (parameters: rewardActions.getTotalPerSecond.Parameters) => Promise<rewardActions.getTotalPerSecond.ReturnValue>;
|
|
1562
|
+
/**
|
|
1563
|
+
* Sets or changes the reward recipient for a token holder.
|
|
1564
|
+
*
|
|
1565
|
+
* @example
|
|
1566
|
+
* ```ts
|
|
1567
|
+
* import { createClient, http } from 'viem'
|
|
1568
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1569
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1570
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1571
|
+
*
|
|
1572
|
+
* const client = createClient({
|
|
1573
|
+
* account: privateKeyToAccount('0x...'),
|
|
1574
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1575
|
+
* transport: http(),
|
|
1576
|
+
* }).extend(tempoActions())
|
|
1577
|
+
*
|
|
1578
|
+
* const hash = await client.reward.setRecipient({
|
|
1579
|
+
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1580
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1581
|
+
* })
|
|
1582
|
+
* ```
|
|
1583
|
+
*
|
|
1584
|
+
* @param parameters - Parameters.
|
|
1585
|
+
* @returns The transaction hash.
|
|
1586
|
+
*/
|
|
1587
|
+
setRecipient: (parameters: rewardActions.setRecipient.Parameters<chain, account>) => Promise<rewardActions.setRecipient.ReturnValue>;
|
|
1588
|
+
/**
|
|
1589
|
+
* Sets or changes the reward recipient for a token holder and waits for confirmation.
|
|
1590
|
+
*
|
|
1591
|
+
* @example
|
|
1592
|
+
* ```ts
|
|
1593
|
+
* import { createClient, http } from 'viem'
|
|
1594
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1595
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1596
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1597
|
+
*
|
|
1598
|
+
* const client = createClient({
|
|
1599
|
+
* account: privateKeyToAccount('0x...'),
|
|
1600
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1601
|
+
* transport: http(),
|
|
1602
|
+
* }).extend(tempoActions())
|
|
1603
|
+
*
|
|
1604
|
+
* const result = await client.reward.setRecipientSync({
|
|
1605
|
+
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1606
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1607
|
+
* })
|
|
1608
|
+
* ```
|
|
1609
|
+
*
|
|
1610
|
+
* @param parameters - Parameters.
|
|
1611
|
+
* @returns The transaction receipt and event data.
|
|
1612
|
+
*/
|
|
1613
|
+
setRecipientSync: (parameters: rewardActions.setRecipientSync.Parameters<chain, account>) => Promise<rewardActions.setRecipientSync.ReturnValue>;
|
|
1614
|
+
/**
|
|
1615
|
+
* Starts a new reward stream that distributes tokens to opted-in holders.
|
|
1616
|
+
*
|
|
1617
|
+
* @example
|
|
1618
|
+
* ```ts
|
|
1619
|
+
* import { createClient, http } from 'viem'
|
|
1620
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1621
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1622
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1623
|
+
*
|
|
1624
|
+
* const client = createClient({
|
|
1625
|
+
* account: privateKeyToAccount('0x...'),
|
|
1626
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1627
|
+
* transport: http(),
|
|
1628
|
+
* }).extend(tempoActions())
|
|
1629
|
+
*
|
|
1630
|
+
* const hash = await client.reward.start({
|
|
1631
|
+
* amount: 100000000000000000000n,
|
|
1632
|
+
* seconds: 86400,
|
|
1633
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1634
|
+
* })
|
|
1635
|
+
* ```
|
|
1636
|
+
*
|
|
1637
|
+
* @param parameters - Parameters.
|
|
1638
|
+
* @returns The transaction hash.
|
|
1639
|
+
*/
|
|
1640
|
+
start: (parameters: rewardActions.start.Parameters<chain, account>) => Promise<rewardActions.start.ReturnValue>;
|
|
1641
|
+
/**
|
|
1642
|
+
* Starts a new reward stream that distributes tokens to opted-in holders and waits for confirmation.
|
|
1643
|
+
*
|
|
1644
|
+
* @example
|
|
1645
|
+
* ```ts
|
|
1646
|
+
* import { createClient, http } from 'viem'
|
|
1647
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1648
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1649
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1650
|
+
*
|
|
1651
|
+
* const client = createClient({
|
|
1652
|
+
* account: privateKeyToAccount('0x...'),
|
|
1653
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1654
|
+
* transport: http(),
|
|
1655
|
+
* }).extend(tempoActions())
|
|
1656
|
+
*
|
|
1657
|
+
* const result = await client.reward.startSync({
|
|
1658
|
+
* amount: 100000000000000000000n,
|
|
1659
|
+
* seconds: 86400,
|
|
1660
|
+
* token: '0x20c0000000000000000000000000000000000001',
|
|
1661
|
+
* })
|
|
1662
|
+
* ```
|
|
1663
|
+
*
|
|
1664
|
+
* @param parameters - Parameters.
|
|
1665
|
+
* @returns The transaction receipt and event data.
|
|
1666
|
+
*/
|
|
1667
|
+
startSync: (parameters: rewardActions.startSync.Parameters<chain, account>) => Promise<rewardActions.startSync.ReturnValue>;
|
|
1668
|
+
};
|
|
1669
|
+
token: {
|
|
1670
|
+
/**
|
|
1671
|
+
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
1672
|
+
*
|
|
1673
|
+
* @example
|
|
1674
|
+
* ```ts
|
|
1675
|
+
* import { createClient, http } from 'viem'
|
|
1676
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1677
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1678
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1679
|
+
*
|
|
1680
|
+
* const client = createClient({
|
|
1681
|
+
* account: privateKeyToAccount('0x...'),
|
|
1682
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1683
|
+
* transport: http(),
|
|
1684
|
+
* }).extend(tempoActions())
|
|
1685
|
+
*
|
|
1686
|
+
* const hash = await client.token.approve({
|
|
1687
|
+
* spender: '0x...',
|
|
1688
|
+
* amount: 100n,
|
|
1689
|
+
* })
|
|
1690
|
+
* ```
|
|
1691
|
+
*
|
|
1692
|
+
* @param client - Client.
|
|
1693
|
+
* @param parameters - Parameters.
|
|
1694
|
+
* @returns The transaction hash.
|
|
1695
|
+
*/
|
|
1696
|
+
approve: (parameters: tokenActions.approve.Parameters<chain, account>) => Promise<tokenActions.approve.ReturnValue>;
|
|
1697
|
+
/**
|
|
1698
|
+
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
1699
|
+
*
|
|
1700
|
+
* @example
|
|
1701
|
+
* ```ts
|
|
1702
|
+
* import { createClient, http } from 'viem'
|
|
1703
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1704
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1705
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1706
|
+
*
|
|
1707
|
+
* const client = createClient({
|
|
1708
|
+
* account: privateKeyToAccount('0x...'),
|
|
1709
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1710
|
+
* transport: http(),
|
|
1711
|
+
* }).extend(tempoActions())
|
|
1712
|
+
*
|
|
1713
|
+
* const result = await client.token.approveSync({
|
|
1714
|
+
* spender: '0x...',
|
|
1715
|
+
* amount: 100n,
|
|
1716
|
+
* })
|
|
1717
|
+
* ```
|
|
1718
|
+
*
|
|
1719
|
+
* @param client - Client.
|
|
1720
|
+
* @param parameters - Parameters.
|
|
1721
|
+
* @returns The transaction receipt and event data.
|
|
1722
|
+
*/
|
|
1723
|
+
approveSync: (parameters: tokenActions.approveSync.Parameters<chain, account>) => Promise<tokenActions.approveSync.ReturnValue>;
|
|
1284
1724
|
/**
|
|
1285
1725
|
* Burns TIP20 tokens from a blocked address.
|
|
1286
1726
|
*
|
|
1287
1727
|
* @example
|
|
1288
1728
|
* ```ts
|
|
1289
|
-
* import {
|
|
1729
|
+
* import { createClient, http } from 'viem'
|
|
1290
1730
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1731
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1732
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1291
1733
|
*
|
|
1292
|
-
* const client =
|
|
1293
|
-
* account: privateKeyToAccount('0x...')
|
|
1734
|
+
* const client = createClient({
|
|
1735
|
+
* account: privateKeyToAccount('0x...'),
|
|
1736
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1737
|
+
* transport: http(),
|
|
1738
|
+
* }).extend(tempoActions())
|
|
1739
|
+
*
|
|
1740
|
+
* const hash = await client.token.burnBlocked({
|
|
1741
|
+
* from: '0x...',
|
|
1742
|
+
* amount: 100n,
|
|
1743
|
+
* token: '0x...',
|
|
1294
1744
|
* })
|
|
1745
|
+
* ```
|
|
1746
|
+
*
|
|
1747
|
+
* @param client - Client.
|
|
1748
|
+
* @param parameters - Parameters.
|
|
1749
|
+
* @returns The transaction hash.
|
|
1750
|
+
*/
|
|
1751
|
+
burnBlocked: (parameters: tokenActions.burnBlocked.Parameters<chain, account>) => Promise<tokenActions.burnBlocked.ReturnValue>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Burns TIP20 tokens from a blocked address.
|
|
1754
|
+
*
|
|
1755
|
+
* @example
|
|
1756
|
+
* ```ts
|
|
1757
|
+
* import { createClient, http } from 'viem'
|
|
1758
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1759
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1760
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1761
|
+
*
|
|
1762
|
+
* const client = createClient({
|
|
1763
|
+
* account: privateKeyToAccount('0x...'),
|
|
1764
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1765
|
+
* transport: http(),
|
|
1766
|
+
* }).extend(tempoActions())
|
|
1295
1767
|
*
|
|
1296
1768
|
* const result = await client.token.burnBlockedSync({
|
|
1297
1769
|
* from: '0x...',
|
|
@@ -1310,12 +1782,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1310
1782
|
*
|
|
1311
1783
|
* @example
|
|
1312
1784
|
* ```ts
|
|
1313
|
-
* import {
|
|
1785
|
+
* import { createClient, http } from 'viem'
|
|
1314
1786
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1787
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1788
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1315
1789
|
*
|
|
1316
|
-
* const client =
|
|
1317
|
-
* account: privateKeyToAccount('0x...')
|
|
1318
|
-
* })
|
|
1790
|
+
* const client = createClient({
|
|
1791
|
+
* account: privateKeyToAccount('0x...'),
|
|
1792
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1793
|
+
* transport: http(),
|
|
1794
|
+
* }).extend(tempoActions())
|
|
1319
1795
|
*
|
|
1320
1796
|
* const hash = await client.token.burn({
|
|
1321
1797
|
* amount: 100n,
|
|
@@ -1333,12 +1809,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1333
1809
|
*
|
|
1334
1810
|
* @example
|
|
1335
1811
|
* ```ts
|
|
1336
|
-
* import {
|
|
1812
|
+
* import { createClient, http } from 'viem'
|
|
1337
1813
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1814
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1815
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1338
1816
|
*
|
|
1339
|
-
* const client =
|
|
1340
|
-
* account: privateKeyToAccount('0x...')
|
|
1341
|
-
* })
|
|
1817
|
+
* const client = createClient({
|
|
1818
|
+
* account: privateKeyToAccount('0x...'),
|
|
1819
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1820
|
+
* transport: http(),
|
|
1821
|
+
* }).extend(tempoActions())
|
|
1342
1822
|
*
|
|
1343
1823
|
* const result = await client.token.burnSync({
|
|
1344
1824
|
* amount: 100n,
|
|
@@ -1356,12 +1836,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1356
1836
|
*
|
|
1357
1837
|
* @example
|
|
1358
1838
|
* ```ts
|
|
1359
|
-
* import {
|
|
1839
|
+
* import { createClient, http } from 'viem'
|
|
1360
1840
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1841
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1842
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1361
1843
|
*
|
|
1362
|
-
* const client =
|
|
1363
|
-
* account: privateKeyToAccount('0x...')
|
|
1364
|
-
* })
|
|
1844
|
+
* const client = createClient({
|
|
1845
|
+
* account: privateKeyToAccount('0x...'),
|
|
1846
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1847
|
+
* transport: http(),
|
|
1848
|
+
* }).extend(tempoActions())
|
|
1365
1849
|
*
|
|
1366
1850
|
* const hash = await client.token.changeTransferPolicy({
|
|
1367
1851
|
* token: '0x...',
|
|
@@ -1379,12 +1863,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1379
1863
|
*
|
|
1380
1864
|
* @example
|
|
1381
1865
|
* ```ts
|
|
1382
|
-
* import {
|
|
1866
|
+
* import { createClient, http } from 'viem'
|
|
1383
1867
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1868
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1869
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1384
1870
|
*
|
|
1385
|
-
* const client =
|
|
1386
|
-
* account: privateKeyToAccount('0x...')
|
|
1387
|
-
* })
|
|
1871
|
+
* const client = createClient({
|
|
1872
|
+
* account: privateKeyToAccount('0x...'),
|
|
1873
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1874
|
+
* transport: http(),
|
|
1875
|
+
* }).extend(tempoActions())
|
|
1388
1876
|
*
|
|
1389
1877
|
* const result = await client.token.changeTransferPolicySync({
|
|
1390
1878
|
* token: '0x...',
|
|
@@ -1402,12 +1890,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1402
1890
|
*
|
|
1403
1891
|
* @example
|
|
1404
1892
|
* ```ts
|
|
1405
|
-
* import {
|
|
1893
|
+
* import { createClient, http } from 'viem'
|
|
1406
1894
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1895
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1896
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1407
1897
|
*
|
|
1408
|
-
* const client =
|
|
1409
|
-
* account: privateKeyToAccount('0x...')
|
|
1410
|
-
* })
|
|
1898
|
+
* const client = createClient({
|
|
1899
|
+
* account: privateKeyToAccount('0x...'),
|
|
1900
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1901
|
+
* transport: http(),
|
|
1902
|
+
* }).extend(tempoActions())
|
|
1411
1903
|
*
|
|
1412
1904
|
* const { hash, id, address } = await client.token.create({
|
|
1413
1905
|
* name: 'My Token',
|
|
@@ -1426,12 +1918,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1426
1918
|
*
|
|
1427
1919
|
* @example
|
|
1428
1920
|
* ```ts
|
|
1429
|
-
* import {
|
|
1921
|
+
* import { createClient, http } from 'viem'
|
|
1430
1922
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1923
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1924
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1431
1925
|
*
|
|
1432
|
-
* const client =
|
|
1433
|
-
* account: privateKeyToAccount('0x...')
|
|
1434
|
-
* })
|
|
1926
|
+
* const client = createClient({
|
|
1927
|
+
* account: privateKeyToAccount('0x...'),
|
|
1928
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1929
|
+
* transport: http(),
|
|
1930
|
+
* }).extend(tempoActions())
|
|
1435
1931
|
*
|
|
1436
1932
|
* const result = await client.token.createSync({
|
|
1437
1933
|
* name: 'My Token',
|
|
@@ -1450,12 +1946,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1450
1946
|
*
|
|
1451
1947
|
* @example
|
|
1452
1948
|
* ```ts
|
|
1453
|
-
* import {
|
|
1949
|
+
* import { createClient, http } from 'viem'
|
|
1454
1950
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1951
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1952
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1455
1953
|
*
|
|
1456
|
-
* const client =
|
|
1457
|
-
* account: privateKeyToAccount('0x...')
|
|
1458
|
-
* })
|
|
1954
|
+
* const client = createClient({
|
|
1955
|
+
* account: privateKeyToAccount('0x...'),
|
|
1956
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1957
|
+
* transport: http(),
|
|
1958
|
+
* }).extend(tempoActions())
|
|
1459
1959
|
*
|
|
1460
1960
|
* const allowance = await client.token.getAllowance({
|
|
1461
1961
|
* spender: '0x...',
|
|
@@ -1472,12 +1972,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1472
1972
|
*
|
|
1473
1973
|
* @example
|
|
1474
1974
|
* ```ts
|
|
1475
|
-
* import {
|
|
1975
|
+
* import { createClient, http } from 'viem'
|
|
1476
1976
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1977
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1978
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1477
1979
|
*
|
|
1478
|
-
* const client =
|
|
1479
|
-
* account: privateKeyToAccount('0x...')
|
|
1480
|
-
* })
|
|
1980
|
+
* const client = createClient({
|
|
1981
|
+
* account: privateKeyToAccount('0x...'),
|
|
1982
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1983
|
+
* transport: http(),
|
|
1984
|
+
* }).extend(tempoActions())
|
|
1481
1985
|
*
|
|
1482
1986
|
* const balance = await client.token.getBalance()
|
|
1483
1987
|
* ```
|
|
@@ -1486,15 +1990,20 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1486
1990
|
* @param parameters - Parameters.
|
|
1487
1991
|
* @returns The token balance.
|
|
1488
1992
|
*/
|
|
1489
|
-
getBalance: (
|
|
1993
|
+
getBalance: (parameters: tokenActions.getBalance.Parameters<account>) => Promise<tokenActions.getBalance.ReturnValue>;
|
|
1490
1994
|
/**
|
|
1491
1995
|
* Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
|
|
1492
1996
|
*
|
|
1493
1997
|
* @example
|
|
1494
1998
|
* ```ts
|
|
1495
|
-
* import {
|
|
1999
|
+
* import { createClient, http } from 'viem'
|
|
2000
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2001
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1496
2002
|
*
|
|
1497
|
-
* const client =
|
|
2003
|
+
* const client = createClient({
|
|
2004
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2005
|
+
* transport: http(),
|
|
2006
|
+
* }).extend(tempoActions())
|
|
1498
2007
|
*
|
|
1499
2008
|
* const metadata = await client.token.getMetadata({
|
|
1500
2009
|
* token: '0x...',
|
|
@@ -1506,17 +2015,46 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1506
2015
|
* @returns The token metadata.
|
|
1507
2016
|
*/
|
|
1508
2017
|
getMetadata: (parameters: tokenActions.getMetadata.Parameters) => Promise<tokenActions.getMetadata.ReturnValue>;
|
|
2018
|
+
/**
|
|
2019
|
+
* Gets the admin role for a specific role in a TIP20 token.
|
|
2020
|
+
*
|
|
2021
|
+
* @example
|
|
2022
|
+
* ```ts
|
|
2023
|
+
* import { createClient, http } from 'viem'
|
|
2024
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2025
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2026
|
+
*
|
|
2027
|
+
* const client = createClient({
|
|
2028
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2029
|
+
* transport: http(),
|
|
2030
|
+
* }).extend(tempoActions())
|
|
2031
|
+
*
|
|
2032
|
+
* const adminRole = await client.token.getRoleAdmin({
|
|
2033
|
+
* role: 'minter',
|
|
2034
|
+
* token: '0x...',
|
|
2035
|
+
* })
|
|
2036
|
+
* ```
|
|
2037
|
+
*
|
|
2038
|
+
* @param client - Client.
|
|
2039
|
+
* @param parameters - Parameters.
|
|
2040
|
+
* @returns The admin role hash.
|
|
2041
|
+
*/
|
|
2042
|
+
getRoleAdmin: (parameters: tokenActions.getRoleAdmin.Parameters) => Promise<tokenActions.getRoleAdmin.ReturnValue>;
|
|
1509
2043
|
/**
|
|
1510
2044
|
* Checks if an account has a specific role for a TIP20 token.
|
|
1511
2045
|
*
|
|
1512
2046
|
* @example
|
|
1513
2047
|
* ```ts
|
|
1514
|
-
* import {
|
|
2048
|
+
* import { createClient, http } from 'viem'
|
|
1515
2049
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2050
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2051
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1516
2052
|
*
|
|
1517
|
-
* const client =
|
|
1518
|
-
* account: privateKeyToAccount('0x...')
|
|
1519
|
-
* })
|
|
2053
|
+
* const client = createClient({
|
|
2054
|
+
* account: privateKeyToAccount('0x...'),
|
|
2055
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2056
|
+
* transport: http(),
|
|
2057
|
+
* }).extend(tempoActions())
|
|
1520
2058
|
*
|
|
1521
2059
|
* const hasRole = await client.token.hasRole({
|
|
1522
2060
|
* token: '0x...',
|
|
@@ -1534,12 +2072,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1534
2072
|
*
|
|
1535
2073
|
* @example
|
|
1536
2074
|
* ```ts
|
|
1537
|
-
* import {
|
|
2075
|
+
* import { createClient, http } from 'viem'
|
|
1538
2076
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2077
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2078
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1539
2079
|
*
|
|
1540
|
-
* const client =
|
|
1541
|
-
* account: privateKeyToAccount('0x...')
|
|
1542
|
-
* })
|
|
2080
|
+
* const client = createClient({
|
|
2081
|
+
* account: privateKeyToAccount('0x...'),
|
|
2082
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2083
|
+
* transport: http(),
|
|
2084
|
+
* }).extend(tempoActions())
|
|
1543
2085
|
*
|
|
1544
2086
|
* const hash = await client.token.grantRoles({
|
|
1545
2087
|
* token: '0x...',
|
|
@@ -1558,16 +2100,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1558
2100
|
*
|
|
1559
2101
|
* @example
|
|
1560
2102
|
* ```ts
|
|
1561
|
-
* import {
|
|
1562
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1563
|
-
* import { http } from 'viem'
|
|
2103
|
+
* import { createClient, http } from 'viem'
|
|
1564
2104
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2105
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2106
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1565
2107
|
*
|
|
1566
|
-
* const client =
|
|
2108
|
+
* const client = createClient({
|
|
1567
2109
|
* account: privateKeyToAccount('0x...'),
|
|
1568
|
-
* chain: tempo
|
|
2110
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1569
2111
|
* transport: http(),
|
|
1570
|
-
* })
|
|
2112
|
+
* }).extend(tempoActions())
|
|
1571
2113
|
*
|
|
1572
2114
|
* const result = await client.token.grantRolesSync({
|
|
1573
2115
|
* token: '0x...',
|
|
@@ -1585,12 +2127,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1585
2127
|
*
|
|
1586
2128
|
* @example
|
|
1587
2129
|
* ```ts
|
|
1588
|
-
* import {
|
|
2130
|
+
* import { createClient, http } from 'viem'
|
|
1589
2131
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2132
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2133
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1590
2134
|
*
|
|
1591
|
-
* const client =
|
|
1592
|
-
* account: privateKeyToAccount('0x...')
|
|
1593
|
-
* })
|
|
2135
|
+
* const client = createClient({
|
|
2136
|
+
* account: privateKeyToAccount('0x...'),
|
|
2137
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2138
|
+
* transport: http(),
|
|
2139
|
+
* }).extend(tempoActions())
|
|
1594
2140
|
*
|
|
1595
2141
|
* const hash = await client.token.mint({
|
|
1596
2142
|
* to: '0x...',
|
|
@@ -1609,12 +2155,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1609
2155
|
*
|
|
1610
2156
|
* @example
|
|
1611
2157
|
* ```ts
|
|
1612
|
-
* import {
|
|
2158
|
+
* import { createClient, http } from 'viem'
|
|
1613
2159
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2160
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2161
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1614
2162
|
*
|
|
1615
|
-
* const client =
|
|
1616
|
-
* account: privateKeyToAccount('0x...')
|
|
1617
|
-
* })
|
|
2163
|
+
* const client = createClient({
|
|
2164
|
+
* account: privateKeyToAccount('0x...'),
|
|
2165
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2166
|
+
* transport: http(),
|
|
2167
|
+
* }).extend(tempoActions())
|
|
1618
2168
|
*
|
|
1619
2169
|
* const result = await client.token.mintSync({
|
|
1620
2170
|
* to: '0x...',
|
|
@@ -1633,12 +2183,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1633
2183
|
*
|
|
1634
2184
|
* @example
|
|
1635
2185
|
* ```ts
|
|
1636
|
-
* import {
|
|
2186
|
+
* import { createClient, http } from 'viem'
|
|
1637
2187
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2188
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2189
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1638
2190
|
*
|
|
1639
|
-
* const client =
|
|
1640
|
-
* account: privateKeyToAccount('0x...')
|
|
1641
|
-
* })
|
|
2191
|
+
* const client = createClient({
|
|
2192
|
+
* account: privateKeyToAccount('0x...'),
|
|
2193
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2194
|
+
* transport: http(),
|
|
2195
|
+
* }).extend(tempoActions())
|
|
1642
2196
|
*
|
|
1643
2197
|
* const hash = await client.token.pause({
|
|
1644
2198
|
* token: '0x...',
|
|
@@ -1655,12 +2209,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1655
2209
|
*
|
|
1656
2210
|
* @example
|
|
1657
2211
|
* ```ts
|
|
1658
|
-
* import {
|
|
2212
|
+
* import { createClient, http } from 'viem'
|
|
1659
2213
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2214
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2215
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1660
2216
|
*
|
|
1661
|
-
* const client =
|
|
1662
|
-
* account: privateKeyToAccount('0x...')
|
|
1663
|
-
* })
|
|
2217
|
+
* const client = createClient({
|
|
2218
|
+
* account: privateKeyToAccount('0x...'),
|
|
2219
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2220
|
+
* transport: http(),
|
|
2221
|
+
* }).extend(tempoActions())
|
|
1664
2222
|
*
|
|
1665
2223
|
* const result = await client.token.pauseSync({
|
|
1666
2224
|
* token: '0x...',
|
|
@@ -1672,69 +2230,21 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1672
2230
|
* @returns The transaction receipt and event data.
|
|
1673
2231
|
*/
|
|
1674
2232
|
pauseSync: (parameters: tokenActions.pauseSync.Parameters<chain, account>) => Promise<tokenActions.pauseSync.ReturnValue>;
|
|
1675
|
-
/**
|
|
1676
|
-
* Approves a spender using a signed permit.
|
|
1677
|
-
*
|
|
1678
|
-
* @example
|
|
1679
|
-
* ```ts
|
|
1680
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
1681
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1682
|
-
*
|
|
1683
|
-
* const client = createTempoClient({
|
|
1684
|
-
* account: privateKeyToAccount('0x...')
|
|
1685
|
-
* })
|
|
1686
|
-
*
|
|
1687
|
-
* const hash = await client.token.permit({
|
|
1688
|
-
* owner: '0x...',
|
|
1689
|
-
* spender: '0x...',
|
|
1690
|
-
* value: 100n,
|
|
1691
|
-
* deadline: 1234567890n,
|
|
1692
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
1693
|
-
* })
|
|
1694
|
-
* ```
|
|
1695
|
-
*
|
|
1696
|
-
* @param client - Client.
|
|
1697
|
-
* @param parameters - Parameters.
|
|
1698
|
-
* @returns The transaction hash.
|
|
1699
|
-
*/
|
|
1700
|
-
permit: (parameters: tokenActions.permit.Parameters<chain, account>) => Promise<tokenActions.permit.ReturnValue>;
|
|
1701
|
-
/**
|
|
1702
|
-
* Approves a spender using a signed permit.
|
|
1703
|
-
*
|
|
1704
|
-
* @example
|
|
1705
|
-
* ```ts
|
|
1706
|
-
* import { createTempoClient } from 'tempo.ts/viem'
|
|
1707
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1708
|
-
*
|
|
1709
|
-
* const client = createTempoClient({
|
|
1710
|
-
* account: privateKeyToAccount('0x...')
|
|
1711
|
-
* })
|
|
1712
|
-
*
|
|
1713
|
-
* const result = await client.token.permitSync({
|
|
1714
|
-
* owner: '0x...',
|
|
1715
|
-
* spender: '0x...',
|
|
1716
|
-
* value: 100n,
|
|
1717
|
-
* deadline: 1234567890n,
|
|
1718
|
-
* signature: { r: 0n, s: 0n, yParity: 0 },
|
|
1719
|
-
* })
|
|
1720
|
-
* ```
|
|
1721
|
-
*
|
|
1722
|
-
* @param client - Client.
|
|
1723
|
-
* @param parameters - Parameters.
|
|
1724
|
-
* @returns The transaction receipt and event data.
|
|
1725
|
-
*/
|
|
1726
|
-
permitSync: (parameters: tokenActions.permitSync.Parameters<chain, account>) => Promise<tokenActions.permitSync.ReturnValue>;
|
|
1727
2233
|
/**
|
|
1728
2234
|
* Renounces a role for a TIP20 token.
|
|
1729
2235
|
*
|
|
1730
2236
|
* @example
|
|
1731
2237
|
* ```ts
|
|
1732
|
-
* import {
|
|
2238
|
+
* import { createClient, http } from 'viem'
|
|
1733
2239
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2240
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2241
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1734
2242
|
*
|
|
1735
|
-
* const client =
|
|
1736
|
-
* account: privateKeyToAccount('0x...')
|
|
1737
|
-
* })
|
|
2243
|
+
* const client = createClient({
|
|
2244
|
+
* account: privateKeyToAccount('0x...'),
|
|
2245
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2246
|
+
* transport: http(),
|
|
2247
|
+
* }).extend(tempoActions())
|
|
1738
2248
|
*
|
|
1739
2249
|
* const hash = await client.token.renounceRoles({
|
|
1740
2250
|
* token: '0x...',
|
|
@@ -1752,16 +2262,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1752
2262
|
*
|
|
1753
2263
|
* @example
|
|
1754
2264
|
* ```ts
|
|
1755
|
-
* import {
|
|
1756
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1757
|
-
* import { http } from 'viem'
|
|
2265
|
+
* import { createClient, http } from 'viem'
|
|
1758
2266
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2267
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2268
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1759
2269
|
*
|
|
1760
|
-
* const client =
|
|
2270
|
+
* const client = createClient({
|
|
1761
2271
|
* account: privateKeyToAccount('0x...'),
|
|
1762
|
-
* chain: tempo
|
|
2272
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1763
2273
|
* transport: http(),
|
|
1764
|
-
* })
|
|
2274
|
+
* }).extend(tempoActions())
|
|
1765
2275
|
*
|
|
1766
2276
|
* const result = await client.token.renounceRolesSync({
|
|
1767
2277
|
* token: '0x...',
|
|
@@ -1778,12 +2288,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1778
2288
|
*
|
|
1779
2289
|
* @example
|
|
1780
2290
|
* ```ts
|
|
1781
|
-
* import {
|
|
2291
|
+
* import { createClient, http } from 'viem'
|
|
1782
2292
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2293
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2294
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1783
2295
|
*
|
|
1784
|
-
* const client =
|
|
1785
|
-
* account: privateKeyToAccount('0x...')
|
|
1786
|
-
* })
|
|
2296
|
+
* const client = createClient({
|
|
2297
|
+
* account: privateKeyToAccount('0x...'),
|
|
2298
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2299
|
+
* transport: http(),
|
|
2300
|
+
* }).extend(tempoActions())
|
|
1787
2301
|
*
|
|
1788
2302
|
* const hash = await client.token.revokeRoles({
|
|
1789
2303
|
* token: '0x...',
|
|
@@ -1802,16 +2316,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1802
2316
|
*
|
|
1803
2317
|
* @example
|
|
1804
2318
|
* ```ts
|
|
1805
|
-
* import {
|
|
1806
|
-
* import { tempo } from 'tempo.ts/chains'
|
|
1807
|
-
* import { http } from 'viem'
|
|
2319
|
+
* import { createClient, http } from 'viem'
|
|
1808
2320
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2321
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2322
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1809
2323
|
*
|
|
1810
|
-
* const client =
|
|
2324
|
+
* const client = createClient({
|
|
1811
2325
|
* account: privateKeyToAccount('0x...'),
|
|
1812
|
-
* chain: tempo
|
|
2326
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1813
2327
|
* transport: http(),
|
|
1814
|
-
* })
|
|
2328
|
+
* }).extend(tempoActions())
|
|
1815
2329
|
*
|
|
1816
2330
|
* const result = await client.token.revokeRolesSync({
|
|
1817
2331
|
* token: '0x...',
|
|
@@ -1829,12 +2343,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1829
2343
|
*
|
|
1830
2344
|
* @example
|
|
1831
2345
|
* ```ts
|
|
1832
|
-
* import {
|
|
2346
|
+
* import { createClient, http } from 'viem'
|
|
1833
2347
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2348
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2349
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1834
2350
|
*
|
|
1835
|
-
* const client =
|
|
1836
|
-
* account: privateKeyToAccount('0x...')
|
|
1837
|
-
* })
|
|
2351
|
+
* const client = createClient({
|
|
2352
|
+
* account: privateKeyToAccount('0x...'),
|
|
2353
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2354
|
+
* transport: http(),
|
|
2355
|
+
* }).extend(tempoActions())
|
|
1838
2356
|
*
|
|
1839
2357
|
* const hash = await client.token.setSupplyCap({
|
|
1840
2358
|
* token: '0x...',
|
|
@@ -1852,12 +2370,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1852
2370
|
*
|
|
1853
2371
|
* @example
|
|
1854
2372
|
* ```ts
|
|
1855
|
-
* import {
|
|
2373
|
+
* import { createClient, http } from 'viem'
|
|
1856
2374
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2375
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2376
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1857
2377
|
*
|
|
1858
|
-
* const client =
|
|
1859
|
-
* account: privateKeyToAccount('0x...')
|
|
1860
|
-
* })
|
|
2378
|
+
* const client = createClient({
|
|
2379
|
+
* account: privateKeyToAccount('0x...'),
|
|
2380
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2381
|
+
* transport: http(),
|
|
2382
|
+
* }).extend(tempoActions())
|
|
1861
2383
|
*
|
|
1862
2384
|
* const result = await client.token.setSupplyCapSync({
|
|
1863
2385
|
* token: '0x...',
|
|
@@ -1875,12 +2397,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1875
2397
|
*
|
|
1876
2398
|
* @example
|
|
1877
2399
|
* ```ts
|
|
1878
|
-
* import {
|
|
2400
|
+
* import { createClient, http } from 'viem'
|
|
1879
2401
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2402
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2403
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1880
2404
|
*
|
|
1881
|
-
* const client =
|
|
1882
|
-
* account: privateKeyToAccount('0x...')
|
|
1883
|
-
* })
|
|
2405
|
+
* const client = createClient({
|
|
2406
|
+
* account: privateKeyToAccount('0x...'),
|
|
2407
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2408
|
+
* transport: http(),
|
|
2409
|
+
* }).extend(tempoActions())
|
|
1884
2410
|
*
|
|
1885
2411
|
* const hash = await client.token.setRoleAdmin({
|
|
1886
2412
|
* token: '0x...',
|
|
@@ -1899,12 +2425,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1899
2425
|
*
|
|
1900
2426
|
* @example
|
|
1901
2427
|
* ```ts
|
|
1902
|
-
* import {
|
|
2428
|
+
* import { createClient, http } from 'viem'
|
|
1903
2429
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2430
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2431
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1904
2432
|
*
|
|
1905
|
-
* const client =
|
|
1906
|
-
* account: privateKeyToAccount('0x...')
|
|
1907
|
-
* })
|
|
2433
|
+
* const client = createClient({
|
|
2434
|
+
* account: privateKeyToAccount('0x...'),
|
|
2435
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2436
|
+
* transport: http(),
|
|
2437
|
+
* }).extend(tempoActions())
|
|
1908
2438
|
*
|
|
1909
2439
|
* const result = await client.token.setRoleAdminSync({
|
|
1910
2440
|
* token: '0x...',
|
|
@@ -1923,12 +2453,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1923
2453
|
*
|
|
1924
2454
|
* @example
|
|
1925
2455
|
* ```ts
|
|
1926
|
-
* import {
|
|
2456
|
+
* import { createClient, http } from 'viem'
|
|
1927
2457
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2458
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2459
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1928
2460
|
*
|
|
1929
|
-
* const client =
|
|
1930
|
-
* account: privateKeyToAccount('0x...')
|
|
1931
|
-
* })
|
|
2461
|
+
* const client = createClient({
|
|
2462
|
+
* account: privateKeyToAccount('0x...'),
|
|
2463
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2464
|
+
* transport: http(),
|
|
2465
|
+
* }).extend(tempoActions())
|
|
1932
2466
|
*
|
|
1933
2467
|
* const hash = await client.token.transfer({
|
|
1934
2468
|
* to: '0x...',
|
|
@@ -1946,12 +2480,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1946
2480
|
*
|
|
1947
2481
|
* @example
|
|
1948
2482
|
* ```ts
|
|
1949
|
-
* import {
|
|
2483
|
+
* import { createClient, http } from 'viem'
|
|
1950
2484
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2485
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2486
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1951
2487
|
*
|
|
1952
|
-
* const client =
|
|
1953
|
-
* account: privateKeyToAccount('0x...')
|
|
1954
|
-
* })
|
|
2488
|
+
* const client = createClient({
|
|
2489
|
+
* account: privateKeyToAccount('0x...'),
|
|
2490
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2491
|
+
* transport: http(),
|
|
2492
|
+
* }).extend(tempoActions())
|
|
1955
2493
|
*
|
|
1956
2494
|
* const result = await client.token.transferSync({
|
|
1957
2495
|
* to: '0x...',
|
|
@@ -1969,12 +2507,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1969
2507
|
*
|
|
1970
2508
|
* @example
|
|
1971
2509
|
* ```ts
|
|
1972
|
-
* import {
|
|
2510
|
+
* import { createClient, http } from 'viem'
|
|
1973
2511
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2512
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2513
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1974
2514
|
*
|
|
1975
|
-
* const client =
|
|
1976
|
-
* account: privateKeyToAccount('0x...')
|
|
1977
|
-
* })
|
|
2515
|
+
* const client = createClient({
|
|
2516
|
+
* account: privateKeyToAccount('0x...'),
|
|
2517
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2518
|
+
* transport: http(),
|
|
2519
|
+
* }).extend(tempoActions())
|
|
1978
2520
|
*
|
|
1979
2521
|
* const hash = await client.token.unpause({
|
|
1980
2522
|
* token: '0x...',
|
|
@@ -1991,12 +2533,16 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
1991
2533
|
*
|
|
1992
2534
|
* @example
|
|
1993
2535
|
* ```ts
|
|
1994
|
-
* import {
|
|
2536
|
+
* import { createClient, http } from 'viem'
|
|
1995
2537
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2538
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2539
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
1996
2540
|
*
|
|
1997
|
-
* const client =
|
|
1998
|
-
* account: privateKeyToAccount('0x...')
|
|
1999
|
-
* })
|
|
2541
|
+
* const client = createClient({
|
|
2542
|
+
* account: privateKeyToAccount('0x...'),
|
|
2543
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2544
|
+
* transport: http(),
|
|
2545
|
+
* }).extend(tempoActions())
|
|
2000
2546
|
*
|
|
2001
2547
|
* const result = await client.token.unpauseSync({
|
|
2002
2548
|
* token: '0x...',
|
|
@@ -2013,9 +2559,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2013
2559
|
*
|
|
2014
2560
|
* @example
|
|
2015
2561
|
* ```ts
|
|
2016
|
-
* import {
|
|
2562
|
+
* import { createClient, http } from 'viem'
|
|
2563
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2564
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2017
2565
|
*
|
|
2018
|
-
* const client =
|
|
2566
|
+
* const client = createClient({
|
|
2567
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2568
|
+
* transport: http(),
|
|
2569
|
+
* }).extend(tempoActions())
|
|
2019
2570
|
*
|
|
2020
2571
|
* const unwatch = client.token.watchApprove({
|
|
2021
2572
|
* onApproval: (args, log) => {
|
|
@@ -2034,9 +2585,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2034
2585
|
*
|
|
2035
2586
|
* @example
|
|
2036
2587
|
* ```ts
|
|
2037
|
-
* import {
|
|
2588
|
+
* import { createClient, http } from 'viem'
|
|
2589
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2590
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2038
2591
|
*
|
|
2039
|
-
* const client =
|
|
2592
|
+
* const client = createClient({
|
|
2593
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2594
|
+
* transport: http(),
|
|
2595
|
+
* }).extend(tempoActions())
|
|
2040
2596
|
*
|
|
2041
2597
|
* const unwatch = client.token.watchBurn({
|
|
2042
2598
|
* onBurn: (args, log) => {
|
|
@@ -2055,9 +2611,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2055
2611
|
*
|
|
2056
2612
|
* @example
|
|
2057
2613
|
* ```ts
|
|
2058
|
-
* import {
|
|
2614
|
+
* import { createClient, http } from 'viem'
|
|
2615
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2616
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2059
2617
|
*
|
|
2060
|
-
* const client =
|
|
2618
|
+
* const client = createClient({
|
|
2619
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2620
|
+
* transport: http(),
|
|
2621
|
+
* }).extend(tempoActions())
|
|
2061
2622
|
*
|
|
2062
2623
|
* const unwatch = client.token.watchCreate({
|
|
2063
2624
|
* onTokenCreated: (args, log) => {
|
|
@@ -2076,9 +2637,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2076
2637
|
*
|
|
2077
2638
|
* @example
|
|
2078
2639
|
* ```ts
|
|
2079
|
-
* import {
|
|
2640
|
+
* import { createClient, http } from 'viem'
|
|
2641
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2642
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2080
2643
|
*
|
|
2081
|
-
* const client =
|
|
2644
|
+
* const client = createClient({
|
|
2645
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2646
|
+
* transport: http(),
|
|
2647
|
+
* }).extend(tempoActions())
|
|
2082
2648
|
*
|
|
2083
2649
|
* const unwatch = client.token.watchMint({
|
|
2084
2650
|
* onMint: (args, log) => {
|
|
@@ -2097,9 +2663,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2097
2663
|
*
|
|
2098
2664
|
* @example
|
|
2099
2665
|
* ```ts
|
|
2100
|
-
* import {
|
|
2666
|
+
* import { createClient, http } from 'viem'
|
|
2667
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2668
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2101
2669
|
*
|
|
2102
|
-
* const client =
|
|
2670
|
+
* const client = createClient({
|
|
2671
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2672
|
+
* transport: http(),
|
|
2673
|
+
* }).extend(tempoActions())
|
|
2103
2674
|
*
|
|
2104
2675
|
* const unwatch = client.token.watchAdminRole({
|
|
2105
2676
|
* onRoleAdminUpdated: (args, log) => {
|
|
@@ -2118,9 +2689,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2118
2689
|
*
|
|
2119
2690
|
* @example
|
|
2120
2691
|
* ```ts
|
|
2121
|
-
* import {
|
|
2692
|
+
* import { createClient, http } from 'viem'
|
|
2693
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2694
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2122
2695
|
*
|
|
2123
|
-
* const client =
|
|
2696
|
+
* const client = createClient({
|
|
2697
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2698
|
+
* transport: http(),
|
|
2699
|
+
* }).extend(tempoActions())
|
|
2124
2700
|
*
|
|
2125
2701
|
* const unwatch = client.token.watchRole({
|
|
2126
2702
|
* onRoleUpdated: (args, log) => {
|
|
@@ -2139,9 +2715,14 @@ export type Decorator<chain extends Chain | undefined = Chain | undefined, accou
|
|
|
2139
2715
|
*
|
|
2140
2716
|
* @example
|
|
2141
2717
|
* ```ts
|
|
2142
|
-
* import {
|
|
2718
|
+
* import { createClient, http } from 'viem'
|
|
2719
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2720
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
2143
2721
|
*
|
|
2144
|
-
* const client =
|
|
2722
|
+
* const client = createClient({
|
|
2723
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2724
|
+
* transport: http(),
|
|
2725
|
+
* }).extend(tempoActions())
|
|
2145
2726
|
*
|
|
2146
2727
|
* const unwatch = client.token.watchTransfer({
|
|
2147
2728
|
* onTransfer: (args, log) => {
|