tempo.ts 0.2.0 → 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/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +3 -1
- package/dist/chains.js.map +1 -1
- package/dist/viem/Actions/amm.d.ts +64 -43
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +62 -47
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/dex.d.ts +32 -32
- package/dist/viem/Actions/dex.js +32 -32
- 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 +13 -13
- package/dist/viem/Actions/fee.js +13 -13
- package/dist/viem/Actions/index.d.ts +1 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +1 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/policy.d.ts +46 -46
- package/dist/viem/Actions/policy.js +46 -46
- package/dist/viem/Actions/reward.d.ts +38 -38
- package/dist/viem/Actions/reward.js +38 -38
- package/dist/viem/Actions/token.d.ts +159 -159
- package/dist/viem/Actions/token.js +159 -159
- package/dist/viem/Decorator.d.ts +128 -101
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +4 -0
- package/dist/viem/Decorator.js.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +12 -12
- package/dist/wagmi/Actions/amm.js +12 -12
- package/dist/wagmi/Actions/dex.d.ts +25 -25
- package/dist/wagmi/Actions/dex.js +25 -25
- 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 +3 -3
- package/dist/wagmi/Actions/fee.js +3 -3
- package/dist/wagmi/Actions/index.d.ts +1 -0
- package/dist/wagmi/Actions/index.d.ts.map +1 -1
- package/dist/wagmi/Actions/index.js +1 -0
- package/dist/wagmi/Actions/index.js.map +1 -1
- package/dist/wagmi/Actions/reward.d.ts +10 -10
- package/dist/wagmi/Actions/reward.js +10 -10
- package/dist/wagmi/Actions/token.d.ts +45 -45
- package/dist/wagmi/Actions/token.js +46 -46
- package/dist/wagmi/Actions/token.js.map +1 -1
- package/dist/wagmi/Connector.d.ts +11 -3
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +16 -4
- package/dist/wagmi/Connector.js.map +1 -1
- 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/index.d.ts +1 -0
- package/dist/wagmi/Hooks/index.d.ts.map +1 -1
- package/dist/wagmi/Hooks/index.js +1 -0
- package/dist/wagmi/Hooks/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chains.ts +3 -1
- package/src/viem/Actions/amm.test.ts +75 -0
- package/src/viem/Actions/amm.ts +63 -48
- package/src/viem/Actions/dex.ts +32 -32
- package/src/viem/Actions/faucet.ts +50 -0
- package/src/viem/Actions/fee.ts +13 -13
- package/src/viem/Actions/index.ts +1 -0
- package/src/viem/Actions/policy.ts +46 -46
- package/src/viem/Actions/reward.ts +38 -38
- package/src/viem/Actions/token.ts +159 -159
- package/src/viem/Chain.bench-d.ts +12 -0
- package/src/viem/Decorator.bench-d.ts +1 -1
- package/src/viem/Decorator.test.ts +1 -0
- package/src/viem/Decorator.ts +133 -101
- package/src/wagmi/Actions/amm.ts +12 -12
- package/src/wagmi/Actions/dex.ts +25 -25
- package/src/wagmi/Actions/faucet.ts +46 -0
- package/src/wagmi/Actions/fee.ts +3 -3
- package/src/wagmi/Actions/index.ts +1 -0
- package/src/wagmi/Actions/reward.ts +10 -10
- package/src/wagmi/Actions/token.ts +46 -46
- package/src/wagmi/Connector.ts +31 -8
- package/src/wagmi/Hooks/faucet.ts +76 -0
- package/src/wagmi/Hooks/index.ts +1 -0
package/src/viem/Actions/dex.ts
CHANGED
|
@@ -54,7 +54,7 @@ type OrderType = 'buy' | 'sell'
|
|
|
54
54
|
*
|
|
55
55
|
* const client = createClient({
|
|
56
56
|
* account: privateKeyToAccount('0x...'),
|
|
57
|
-
* chain: tempo
|
|
57
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
58
58
|
* transport: http(),
|
|
59
59
|
* })
|
|
60
60
|
*
|
|
@@ -135,7 +135,7 @@ export namespace buy {
|
|
|
135
135
|
* import { Actions } from 'tempo.ts/viem'
|
|
136
136
|
*
|
|
137
137
|
* const client = createClient({
|
|
138
|
-
* chain: tempo
|
|
138
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
139
139
|
* transport: http(),
|
|
140
140
|
* }).extend(walletActions)
|
|
141
141
|
*
|
|
@@ -177,7 +177,7 @@ export namespace buy {
|
|
|
177
177
|
*
|
|
178
178
|
* const client = createClient({
|
|
179
179
|
* account: privateKeyToAccount('0x...'),
|
|
180
|
-
* chain: tempo
|
|
180
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
181
181
|
* transport: http(),
|
|
182
182
|
* })
|
|
183
183
|
*
|
|
@@ -237,7 +237,7 @@ export namespace buySync {
|
|
|
237
237
|
*
|
|
238
238
|
* const client = createClient({
|
|
239
239
|
* account: privateKeyToAccount('0x...'),
|
|
240
|
-
* chain: tempo
|
|
240
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
241
241
|
* transport: http(),
|
|
242
242
|
* })
|
|
243
243
|
*
|
|
@@ -309,7 +309,7 @@ export namespace cancel {
|
|
|
309
309
|
* import { Actions } from 'tempo.ts/viem'
|
|
310
310
|
*
|
|
311
311
|
* const client = createClient({
|
|
312
|
-
* chain: tempo
|
|
312
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
313
313
|
* transport: http(),
|
|
314
314
|
* }).extend(walletActions)
|
|
315
315
|
*
|
|
@@ -365,7 +365,7 @@ export namespace cancel {
|
|
|
365
365
|
*
|
|
366
366
|
* const client = createClient({
|
|
367
367
|
* account: privateKeyToAccount('0x...'),
|
|
368
|
-
* chain: tempo
|
|
368
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
369
369
|
* transport: http(),
|
|
370
370
|
* })
|
|
371
371
|
*
|
|
@@ -432,7 +432,7 @@ export namespace cancelSync {
|
|
|
432
432
|
*
|
|
433
433
|
* const client = createClient({
|
|
434
434
|
* account: privateKeyToAccount('0x...'),
|
|
435
|
-
* chain: tempo
|
|
435
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
436
436
|
* transport: http(),
|
|
437
437
|
* })
|
|
438
438
|
*
|
|
@@ -504,7 +504,7 @@ export namespace createPair {
|
|
|
504
504
|
* import { Actions } from 'tempo.ts/viem'
|
|
505
505
|
*
|
|
506
506
|
* const client = createClient({
|
|
507
|
-
* chain: tempo
|
|
507
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
508
508
|
* transport: http(),
|
|
509
509
|
* }).extend(walletActions)
|
|
510
510
|
*
|
|
@@ -560,7 +560,7 @@ export namespace createPair {
|
|
|
560
560
|
*
|
|
561
561
|
* const client = createClient({
|
|
562
562
|
* account: privateKeyToAccount('0x...'),
|
|
563
|
-
* chain: tempo
|
|
563
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
564
564
|
* transport: http(),
|
|
565
565
|
* })
|
|
566
566
|
*
|
|
@@ -625,7 +625,7 @@ export namespace createPairSync {
|
|
|
625
625
|
* import { Actions } from 'tempo.ts/viem'
|
|
626
626
|
*
|
|
627
627
|
* const client = createClient({
|
|
628
|
-
* chain: tempo
|
|
628
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
629
629
|
* transport: http(),
|
|
630
630
|
* })
|
|
631
631
|
*
|
|
@@ -700,7 +700,7 @@ export namespace getBalance {
|
|
|
700
700
|
* import { Actions } from 'tempo.ts/viem'
|
|
701
701
|
*
|
|
702
702
|
* const client = createClient({
|
|
703
|
-
* chain: tempo
|
|
703
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
704
704
|
* transport: http(),
|
|
705
705
|
* })
|
|
706
706
|
*
|
|
@@ -771,7 +771,7 @@ export namespace getBuyQuote {
|
|
|
771
771
|
* import { Actions } from 'tempo.ts/viem'
|
|
772
772
|
*
|
|
773
773
|
* const client = createClient({
|
|
774
|
-
* chain: tempo
|
|
774
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
775
775
|
* transport: http(),
|
|
776
776
|
* })
|
|
777
777
|
*
|
|
@@ -836,7 +836,7 @@ export namespace getOrder {
|
|
|
836
836
|
* import { Actions } from 'tempo.ts/viem'
|
|
837
837
|
*
|
|
838
838
|
* const client = createClient({
|
|
839
|
-
* chain: tempo
|
|
839
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
840
840
|
* transport: http(),
|
|
841
841
|
* })
|
|
842
842
|
*
|
|
@@ -886,7 +886,7 @@ export namespace getOrders {
|
|
|
886
886
|
* import { Actions } from 'tempo.ts/viem'
|
|
887
887
|
*
|
|
888
888
|
* const client = createClient({
|
|
889
|
-
* chain: tempo
|
|
889
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
890
890
|
* transport: http(),
|
|
891
891
|
* })
|
|
892
892
|
*
|
|
@@ -955,7 +955,7 @@ export namespace getOrderbook {
|
|
|
955
955
|
* import { Actions, Tick } from 'tempo.ts/viem'
|
|
956
956
|
*
|
|
957
957
|
* const client = createClient({
|
|
958
|
-
* chain: tempo
|
|
958
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
959
959
|
* transport: http(),
|
|
960
960
|
* })
|
|
961
961
|
*
|
|
@@ -1026,7 +1026,7 @@ export namespace getPriceLevel {
|
|
|
1026
1026
|
* import { Actions } from 'tempo.ts/viem'
|
|
1027
1027
|
*
|
|
1028
1028
|
* const client = createClient({
|
|
1029
|
-
* chain: tempo
|
|
1029
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1030
1030
|
* transport: http(),
|
|
1031
1031
|
* })
|
|
1032
1032
|
*
|
|
@@ -1099,7 +1099,7 @@ export namespace getSellQuote {
|
|
|
1099
1099
|
*
|
|
1100
1100
|
* const client = createClient({
|
|
1101
1101
|
* account: privateKeyToAccount('0x...'),
|
|
1102
|
-
* chain: tempo
|
|
1102
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1103
1103
|
* transport: http(),
|
|
1104
1104
|
* })
|
|
1105
1105
|
*
|
|
@@ -1180,7 +1180,7 @@ export namespace place {
|
|
|
1180
1180
|
* import { Actions, Tick } from 'tempo.ts/viem'
|
|
1181
1181
|
*
|
|
1182
1182
|
* const client = createClient({
|
|
1183
|
-
* chain: tempo
|
|
1183
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1184
1184
|
* transport: http(),
|
|
1185
1185
|
* }).extend(walletActions)
|
|
1186
1186
|
*
|
|
@@ -1240,7 +1240,7 @@ export namespace place {
|
|
|
1240
1240
|
*
|
|
1241
1241
|
* const client = createClient({
|
|
1242
1242
|
* account: privateKeyToAccount('0x...'),
|
|
1243
|
-
* chain: tempo
|
|
1243
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1244
1244
|
* transport: http(),
|
|
1245
1245
|
* })
|
|
1246
1246
|
*
|
|
@@ -1324,7 +1324,7 @@ export namespace placeFlip {
|
|
|
1324
1324
|
* import { Actions, Tick } from 'tempo.ts/viem'
|
|
1325
1325
|
*
|
|
1326
1326
|
* const client = createClient({
|
|
1327
|
-
* chain: tempo
|
|
1327
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1328
1328
|
* transport: http(),
|
|
1329
1329
|
* }).extend(walletActions)
|
|
1330
1330
|
*
|
|
@@ -1385,7 +1385,7 @@ export namespace placeFlip {
|
|
|
1385
1385
|
*
|
|
1386
1386
|
* const client = createClient({
|
|
1387
1387
|
* account: privateKeyToAccount('0x...'),
|
|
1388
|
-
* chain: tempo
|
|
1388
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1389
1389
|
* transport: http(),
|
|
1390
1390
|
* })
|
|
1391
1391
|
*
|
|
@@ -1456,7 +1456,7 @@ export namespace placeFlipSync {
|
|
|
1456
1456
|
*
|
|
1457
1457
|
* const client = createClient({
|
|
1458
1458
|
* account: privateKeyToAccount('0x...'),
|
|
1459
|
-
* chain: tempo
|
|
1459
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1460
1460
|
* transport: http(),
|
|
1461
1461
|
* })
|
|
1462
1462
|
*
|
|
@@ -1526,7 +1526,7 @@ export namespace placeSync {
|
|
|
1526
1526
|
*
|
|
1527
1527
|
* const client = createClient({
|
|
1528
1528
|
* account: privateKeyToAccount('0x...'),
|
|
1529
|
-
* chain: tempo
|
|
1529
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1530
1530
|
* transport: http(),
|
|
1531
1531
|
* })
|
|
1532
1532
|
*
|
|
@@ -1607,7 +1607,7 @@ export namespace sell {
|
|
|
1607
1607
|
* import { Actions } from 'tempo.ts/viem'
|
|
1608
1608
|
*
|
|
1609
1609
|
* const client = createClient({
|
|
1610
|
-
* chain: tempo
|
|
1610
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1611
1611
|
* transport: http(),
|
|
1612
1612
|
* }).extend(walletActions)
|
|
1613
1613
|
*
|
|
@@ -1649,7 +1649,7 @@ export namespace sell {
|
|
|
1649
1649
|
*
|
|
1650
1650
|
* const client = createClient({
|
|
1651
1651
|
* account: privateKeyToAccount('0x...'),
|
|
1652
|
-
* chain: tempo
|
|
1652
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1653
1653
|
* transport: http(),
|
|
1654
1654
|
* })
|
|
1655
1655
|
*
|
|
@@ -1707,7 +1707,7 @@ export namespace sellSync {
|
|
|
1707
1707
|
* import { Actions } from 'tempo.ts/viem'
|
|
1708
1708
|
*
|
|
1709
1709
|
* const client = createClient({
|
|
1710
|
-
* chain: tempo
|
|
1710
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1711
1711
|
* transport: http(),
|
|
1712
1712
|
* })
|
|
1713
1713
|
*
|
|
@@ -1788,7 +1788,7 @@ export declare namespace watchFlipOrderPlaced {
|
|
|
1788
1788
|
* import { Actions } from 'tempo.ts/viem'
|
|
1789
1789
|
*
|
|
1790
1790
|
* const client = createClient({
|
|
1791
|
-
* chain: tempo
|
|
1791
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1792
1792
|
* transport: http(),
|
|
1793
1793
|
* })
|
|
1794
1794
|
*
|
|
@@ -1864,7 +1864,7 @@ export declare namespace watchOrderCancelled {
|
|
|
1864
1864
|
* import { Actions } from 'tempo.ts/viem'
|
|
1865
1865
|
*
|
|
1866
1866
|
* const client = createClient({
|
|
1867
|
-
* chain: tempo
|
|
1867
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1868
1868
|
* transport: http(),
|
|
1869
1869
|
* })
|
|
1870
1870
|
*
|
|
@@ -1948,7 +1948,7 @@ export declare namespace watchOrderFilled {
|
|
|
1948
1948
|
* import { Actions } from 'tempo.ts/viem'
|
|
1949
1949
|
*
|
|
1950
1950
|
* const client = createClient({
|
|
1951
|
-
* chain: tempo
|
|
1951
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1952
1952
|
* transport: http(),
|
|
1953
1953
|
* })
|
|
1954
1954
|
*
|
|
@@ -2031,7 +2031,7 @@ export declare namespace watchOrderPlaced {
|
|
|
2031
2031
|
*
|
|
2032
2032
|
* const client = createClient({
|
|
2033
2033
|
* account: privateKeyToAccount('0x...'),
|
|
2034
|
-
* chain: tempo
|
|
2034
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2035
2035
|
* transport: http(),
|
|
2036
2036
|
* })
|
|
2037
2037
|
*
|
|
@@ -2106,7 +2106,7 @@ export namespace withdraw {
|
|
|
2106
2106
|
* import { Actions } from 'tempo.ts/viem'
|
|
2107
2107
|
*
|
|
2108
2108
|
* const client = createClient({
|
|
2109
|
-
* chain: tempo
|
|
2109
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2110
2110
|
* transport: http(),
|
|
2111
2111
|
* }).extend(walletActions)
|
|
2112
2112
|
*
|
|
@@ -2146,7 +2146,7 @@ export namespace withdraw {
|
|
|
2146
2146
|
*
|
|
2147
2147
|
* const client = createClient({
|
|
2148
2148
|
* account: privateKeyToAccount('0x...'),
|
|
2149
|
-
* chain: tempo
|
|
2149
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2150
2150
|
* transport: http(),
|
|
2151
2151
|
* })
|
|
2152
2152
|
*
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Account, Address, Chain, Client, Hash, Transport } from 'viem'
|
|
2
|
+
import { parseAccount } from 'viem/utils'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Funds an account with an initial amount of set token(s)
|
|
6
|
+
* on Tempo's testnet.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createClient, http } from 'viem'
|
|
11
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
12
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
13
|
+
*
|
|
14
|
+
* const client = createClient({
|
|
15
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
16
|
+
* transport: http(),
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* const hashes = await Actions.faucet.fund(client, {
|
|
20
|
+
* account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param client - Client.
|
|
25
|
+
* @param parameters - Parameters.
|
|
26
|
+
* @returns The transaction hash.
|
|
27
|
+
*/
|
|
28
|
+
export async function fund<chain extends Chain | undefined>(
|
|
29
|
+
client: Client<Transport, chain>,
|
|
30
|
+
parameters: fund.Parameters,
|
|
31
|
+
): Promise<fund.ReturnValue> {
|
|
32
|
+
const account = parseAccount(parameters.account)
|
|
33
|
+
return client.request<{
|
|
34
|
+
Method: 'tempo_fundAddress'
|
|
35
|
+
Parameters: [address: Address]
|
|
36
|
+
ReturnType: readonly Hash[]
|
|
37
|
+
}>({
|
|
38
|
+
method: 'tempo_fundAddress',
|
|
39
|
+
params: [account.address],
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare namespace fund {
|
|
44
|
+
export type Parameters = {
|
|
45
|
+
/** Account to fund. */
|
|
46
|
+
account: Account | Address
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type ReturnValue = readonly Hash[]
|
|
50
|
+
}
|
package/src/viem/Actions/fee.ts
CHANGED
|
@@ -39,16 +39,16 @@ import { defineCall } from '../internal/utils.js'
|
|
|
39
39
|
* ```ts
|
|
40
40
|
* import { createClient, http } from 'viem'
|
|
41
41
|
* import { tempo } from 'tempo.ts/chains'
|
|
42
|
-
* import
|
|
42
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
43
43
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
44
44
|
*
|
|
45
45
|
* const client = createClient({
|
|
46
46
|
* account: privateKeyToAccount('0x...'),
|
|
47
|
-
* chain: tempo
|
|
47
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
48
48
|
* transport: http(),
|
|
49
49
|
* })
|
|
50
50
|
*
|
|
51
|
-
* const { address, id } = await
|
|
51
|
+
* const { address, id } = await Actions.fee.getUserToken(client)
|
|
52
52
|
* ```
|
|
53
53
|
*
|
|
54
54
|
* @param client - Client.
|
|
@@ -116,16 +116,16 @@ export namespace getUserToken {
|
|
|
116
116
|
* ```ts
|
|
117
117
|
* import { createClient, http } from 'viem'
|
|
118
118
|
* import { tempo } from 'tempo.ts/chains'
|
|
119
|
-
* import
|
|
119
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
120
120
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
121
121
|
*
|
|
122
122
|
* const client = createClient({
|
|
123
123
|
* account: privateKeyToAccount('0x...'),
|
|
124
|
-
* chain: tempo
|
|
124
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
125
125
|
* transport: http(),
|
|
126
126
|
* })
|
|
127
127
|
*
|
|
128
|
-
* const hash = await
|
|
128
|
+
* const hash = await Actions.fee.setUserToken(client, {
|
|
129
129
|
* token: '0x...',
|
|
130
130
|
* })
|
|
131
131
|
* ```
|
|
@@ -190,10 +190,10 @@ export namespace setUserToken {
|
|
|
190
190
|
* ```ts
|
|
191
191
|
* import { createClient, http, walletActions } from 'viem'
|
|
192
192
|
* import { tempo } from 'tempo.ts/chains'
|
|
193
|
-
* import
|
|
193
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
194
194
|
*
|
|
195
195
|
* const client = createClient({
|
|
196
|
-
* chain: tempo
|
|
196
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
197
197
|
* transport: http(),
|
|
198
198
|
* }).extend(walletActions)
|
|
199
199
|
*
|
|
@@ -241,16 +241,16 @@ export namespace setUserToken {
|
|
|
241
241
|
* ```ts
|
|
242
242
|
* import { createClient, http } from 'viem'
|
|
243
243
|
* import { tempo } from 'tempo.ts/chains'
|
|
244
|
-
* import
|
|
244
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
245
245
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
246
246
|
*
|
|
247
247
|
* const client = createClient({
|
|
248
248
|
* account: privateKeyToAccount('0x...'),
|
|
249
|
-
* chain: tempo
|
|
249
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
250
250
|
* transport: http(),
|
|
251
251
|
* })
|
|
252
252
|
*
|
|
253
|
-
* const result = await
|
|
253
|
+
* const result = await Actions.fee.setUserTokenSync(client, {
|
|
254
254
|
* token: '0x...',
|
|
255
255
|
* })
|
|
256
256
|
* ```
|
|
@@ -307,10 +307,10 @@ export namespace setUserTokenSync {
|
|
|
307
307
|
* ```ts
|
|
308
308
|
* import { createClient, http } from 'viem'
|
|
309
309
|
* import { tempo } from 'tempo.ts/chains'
|
|
310
|
-
* import
|
|
310
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
311
311
|
*
|
|
312
312
|
* const client = createClient({
|
|
313
|
-
* chain: tempo
|
|
313
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
314
314
|
* transport: http(),
|
|
315
315
|
* })
|
|
316
316
|
*
|