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
|
@@ -16,16 +16,16 @@ import type { ReadParameters, WriteParameters } from '../internal/types.js';
|
|
|
16
16
|
* ```ts
|
|
17
17
|
* import { createClient, http } from 'viem'
|
|
18
18
|
* import { tempo } from 'tempo.ts/chains'
|
|
19
|
-
* import
|
|
19
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
20
20
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
21
21
|
*
|
|
22
22
|
* const client = createClient({
|
|
23
23
|
* account: privateKeyToAccount('0x...'),
|
|
24
|
-
* chain: tempo
|
|
24
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
25
25
|
* transport: http(),
|
|
26
26
|
* })
|
|
27
27
|
*
|
|
28
|
-
* const hash = await
|
|
28
|
+
* const hash = await Actions.rewards.cancel(client, {
|
|
29
29
|
* id: 1n,
|
|
30
30
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
31
31
|
* })
|
|
@@ -50,16 +50,16 @@ export declare function cancel<chain extends Chain | undefined, account extends
|
|
|
50
50
|
* ```ts
|
|
51
51
|
* import { createClient, http } from 'viem'
|
|
52
52
|
* import { tempo } from 'tempo.ts/chains'
|
|
53
|
-
* import
|
|
53
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
54
54
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
55
55
|
*
|
|
56
56
|
* const client = createClient({
|
|
57
57
|
* account: privateKeyToAccount('0x...'),
|
|
58
|
-
* chain: tempo
|
|
58
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
59
59
|
* transport: http(),
|
|
60
60
|
* })
|
|
61
61
|
*
|
|
62
|
-
* const { funder, id, refund, receipt } = await
|
|
62
|
+
* const { funder, id, refund, receipt } = await Actions.rewards.cancelSync(client, {
|
|
63
63
|
* id: 1n,
|
|
64
64
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
65
65
|
* })
|
|
@@ -94,10 +94,10 @@ export declare namespace cancel {
|
|
|
94
94
|
* ```ts
|
|
95
95
|
* import { createClient, http, walletActions } from 'viem'
|
|
96
96
|
* import { tempo } from 'tempo.ts/chains'
|
|
97
|
-
* import
|
|
97
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
98
98
|
*
|
|
99
99
|
* const client = createClient({
|
|
100
|
-
* chain: tempo
|
|
100
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
101
101
|
* transport: http(),
|
|
102
102
|
* }).extend(walletActions)
|
|
103
103
|
*
|
|
@@ -995,16 +995,16 @@ export declare namespace cancelSync {
|
|
|
995
995
|
* ```ts
|
|
996
996
|
* import { createClient, http } from 'viem'
|
|
997
997
|
* import { tempo } from 'tempo.ts/chains'
|
|
998
|
-
* import
|
|
998
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
999
999
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1000
1000
|
*
|
|
1001
1001
|
* const client = createClient({
|
|
1002
1002
|
* account: privateKeyToAccount('0x...'),
|
|
1003
|
-
* chain: tempo
|
|
1003
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1004
1004
|
* transport: http(),
|
|
1005
1005
|
* })
|
|
1006
1006
|
*
|
|
1007
|
-
* const hash = await
|
|
1007
|
+
* const hash = await Actions.reward.claim(client, {
|
|
1008
1008
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
1009
1009
|
* })
|
|
1010
1010
|
* ```
|
|
@@ -1036,10 +1036,10 @@ export declare namespace claim {
|
|
|
1036
1036
|
* ```ts
|
|
1037
1037
|
* import { createClient, http, walletActions } from 'viem'
|
|
1038
1038
|
* import { tempo } from 'tempo.ts/chains'
|
|
1039
|
-
* import
|
|
1039
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1040
1040
|
*
|
|
1041
1041
|
* const client = createClient({
|
|
1042
|
-
* chain: tempo
|
|
1042
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1043
1043
|
* transport: http(),
|
|
1044
1044
|
* }).extend(walletActions)
|
|
1045
1045
|
*
|
|
@@ -1093,16 +1093,16 @@ export declare namespace claim {
|
|
|
1093
1093
|
* ```ts
|
|
1094
1094
|
* import { createClient, http } from 'viem'
|
|
1095
1095
|
* import { tempo } from 'tempo.ts/chains'
|
|
1096
|
-
* import
|
|
1096
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1097
1097
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1098
1098
|
*
|
|
1099
1099
|
* const client = createClient({
|
|
1100
1100
|
* account: privateKeyToAccount('0x...'),
|
|
1101
|
-
* chain: tempo
|
|
1101
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1102
1102
|
* transport: http(),
|
|
1103
1103
|
* })
|
|
1104
1104
|
*
|
|
1105
|
-
* const { receipt } = await
|
|
1105
|
+
* const { receipt } = await Actions.reward.claimSync(client, {
|
|
1106
1106
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
1107
1107
|
* })
|
|
1108
1108
|
* ```
|
|
@@ -1136,14 +1136,14 @@ export declare namespace claimSync {
|
|
|
1136
1136
|
* ```ts
|
|
1137
1137
|
* import { createClient, http } from 'viem'
|
|
1138
1138
|
* import { tempo } from 'tempo.ts/chains'
|
|
1139
|
-
* import
|
|
1139
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1140
1140
|
*
|
|
1141
1141
|
* const client = createClient({
|
|
1142
|
-
* chain: tempo
|
|
1142
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1143
1143
|
* transport: http(),
|
|
1144
1144
|
* })
|
|
1145
1145
|
*
|
|
1146
|
-
* const stream = await
|
|
1146
|
+
* const stream = await Actions.rewards.getStream(client, {
|
|
1147
1147
|
* id: 1n,
|
|
1148
1148
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
1149
1149
|
* })
|
|
@@ -1220,14 +1220,14 @@ export declare namespace getStream {
|
|
|
1220
1220
|
* ```ts
|
|
1221
1221
|
* import { createClient, http } from 'viem'
|
|
1222
1222
|
* import { tempo } from 'tempo.ts/chains'
|
|
1223
|
-
* import
|
|
1223
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1224
1224
|
*
|
|
1225
1225
|
* const client = createClient({
|
|
1226
|
-
* chain: tempo
|
|
1226
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1227
1227
|
* transport: http(),
|
|
1228
1228
|
* })
|
|
1229
1229
|
*
|
|
1230
|
-
* const rate = await
|
|
1230
|
+
* const rate = await Actions.rewards.getTotalPerSecond(client, {
|
|
1231
1231
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
1232
1232
|
* })
|
|
1233
1233
|
* ```
|
|
@@ -1285,16 +1285,16 @@ export declare namespace getTotalPerSecond {
|
|
|
1285
1285
|
* ```ts
|
|
1286
1286
|
* import { createClient, http } from 'viem'
|
|
1287
1287
|
* import { tempo } from 'tempo.ts/chains'
|
|
1288
|
-
* import
|
|
1288
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1289
1289
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1290
1290
|
*
|
|
1291
1291
|
* const client = createClient({
|
|
1292
1292
|
* account: privateKeyToAccount('0x...'),
|
|
1293
|
-
* chain: tempo
|
|
1293
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1294
1294
|
* transport: http(),
|
|
1295
1295
|
* })
|
|
1296
1296
|
*
|
|
1297
|
-
* const hash = await
|
|
1297
|
+
* const hash = await Actions.rewards.setRecipient(client, {
|
|
1298
1298
|
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1299
1299
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
1300
1300
|
* })
|
|
@@ -1321,16 +1321,16 @@ export declare function setRecipient<chain extends Chain | undefined, account ex
|
|
|
1321
1321
|
* ```ts
|
|
1322
1322
|
* import { createClient, http } from 'viem'
|
|
1323
1323
|
* import { tempo } from 'tempo.ts/chains'
|
|
1324
|
-
* import
|
|
1324
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1325
1325
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1326
1326
|
*
|
|
1327
1327
|
* const client = createClient({
|
|
1328
1328
|
* account: privateKeyToAccount('0x...'),
|
|
1329
|
-
* chain: tempo
|
|
1329
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1330
1330
|
* transport: http(),
|
|
1331
1331
|
* })
|
|
1332
1332
|
*
|
|
1333
|
-
* const { holder, recipient, receipt } = await
|
|
1333
|
+
* const { holder, recipient, receipt } = await Actions.rewards.setRecipientSync(client, {
|
|
1334
1334
|
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
1335
1335
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
1336
1336
|
* })
|
|
@@ -1365,10 +1365,10 @@ export declare namespace setRecipient {
|
|
|
1365
1365
|
* ```ts
|
|
1366
1366
|
* import { createClient, http, walletActions } from 'viem'
|
|
1367
1367
|
* import { tempo } from 'tempo.ts/chains'
|
|
1368
|
-
* import
|
|
1368
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1369
1369
|
*
|
|
1370
1370
|
* const client = createClient({
|
|
1371
|
-
* chain: tempo
|
|
1371
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1372
1372
|
* transport: http(),
|
|
1373
1373
|
* }).extend(walletActions)
|
|
1374
1374
|
*
|
|
@@ -2260,16 +2260,16 @@ export declare namespace setRecipientSync {
|
|
|
2260
2260
|
* ```ts
|
|
2261
2261
|
* import { createClient, http } from 'viem'
|
|
2262
2262
|
* import { tempo } from 'tempo.ts/chains'
|
|
2263
|
-
* import
|
|
2263
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2264
2264
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2265
2265
|
*
|
|
2266
2266
|
* const client = createClient({
|
|
2267
2267
|
* account: privateKeyToAccount('0x...'),
|
|
2268
|
-
* chain: tempo
|
|
2268
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2269
2269
|
* transport: http(),
|
|
2270
2270
|
* })
|
|
2271
2271
|
*
|
|
2272
|
-
* const hash = await
|
|
2272
|
+
* const hash = await Actions.rewards.start(client, {
|
|
2273
2273
|
* amount: 100000000000000000000n,
|
|
2274
2274
|
* seconds: 86400,
|
|
2275
2275
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
@@ -2300,16 +2300,16 @@ export declare function start<chain extends Chain | undefined, account extends A
|
|
|
2300
2300
|
* ```ts
|
|
2301
2301
|
* import { createClient, http } from 'viem'
|
|
2302
2302
|
* import { tempo } from 'tempo.ts/chains'
|
|
2303
|
-
* import
|
|
2303
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2304
2304
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2305
2305
|
*
|
|
2306
2306
|
* const client = createClient({
|
|
2307
2307
|
* account: privateKeyToAccount('0x...'),
|
|
2308
|
-
* chain: tempo
|
|
2308
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2309
2309
|
* transport: http(),
|
|
2310
2310
|
* })
|
|
2311
2311
|
*
|
|
2312
|
-
* const { id, receipt } = await
|
|
2312
|
+
* const { id, receipt } = await Actions.rewards.startSync(client, {
|
|
2313
2313
|
* amount: 100000000000000000000n,
|
|
2314
2314
|
* seconds: 86400,
|
|
2315
2315
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
@@ -2347,10 +2347,10 @@ export declare namespace start {
|
|
|
2347
2347
|
* ```ts
|
|
2348
2348
|
* import { createClient, http, walletActions } from 'viem'
|
|
2349
2349
|
* import { tempo } from 'tempo.ts/chains'
|
|
2350
|
-
* import
|
|
2350
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2351
2351
|
*
|
|
2352
2352
|
* const client = createClient({
|
|
2353
|
-
* chain: tempo
|
|
2353
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2354
2354
|
* transport: http(),
|
|
2355
2355
|
* }).extend(walletActions)
|
|
2356
2356
|
*
|
|
@@ -16,16 +16,16 @@ import { defineCall } from '../internal/utils.js';
|
|
|
16
16
|
* ```ts
|
|
17
17
|
* import { createClient, http } from 'viem'
|
|
18
18
|
* import { tempo } from 'tempo.ts/chains'
|
|
19
|
-
* import
|
|
19
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
20
20
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
21
21
|
*
|
|
22
22
|
* const client = createClient({
|
|
23
23
|
* account: privateKeyToAccount('0x...'),
|
|
24
|
-
* chain: tempo
|
|
24
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
25
25
|
* transport: http(),
|
|
26
26
|
* })
|
|
27
27
|
*
|
|
28
|
-
* const hash = await
|
|
28
|
+
* const hash = await Actions.rewards.cancel(client, {
|
|
29
29
|
* id: 1n,
|
|
30
30
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
31
31
|
* })
|
|
@@ -52,16 +52,16 @@ export async function cancel(client, parameters) {
|
|
|
52
52
|
* ```ts
|
|
53
53
|
* import { createClient, http } from 'viem'
|
|
54
54
|
* import { tempo } from 'tempo.ts/chains'
|
|
55
|
-
* import
|
|
55
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
56
56
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
57
57
|
*
|
|
58
58
|
* const client = createClient({
|
|
59
59
|
* account: privateKeyToAccount('0x...'),
|
|
60
|
-
* chain: tempo
|
|
60
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
61
61
|
* transport: http(),
|
|
62
62
|
* })
|
|
63
63
|
*
|
|
64
|
-
* const { funder, id, refund, receipt } = await
|
|
64
|
+
* const { funder, id, refund, receipt } = await Actions.rewards.cancelSync(client, {
|
|
65
65
|
* id: 1n,
|
|
66
66
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
67
67
|
* })
|
|
@@ -106,10 +106,10 @@ export async function cancelSync(client, parameters) {
|
|
|
106
106
|
* ```ts
|
|
107
107
|
* import { createClient, http, walletActions } from 'viem'
|
|
108
108
|
* import { tempo } from 'tempo.ts/chains'
|
|
109
|
-
* import
|
|
109
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
110
110
|
*
|
|
111
111
|
* const client = createClient({
|
|
112
|
-
* chain: tempo
|
|
112
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
113
113
|
* transport: http(),
|
|
114
114
|
* }).extend(walletActions)
|
|
115
115
|
*
|
|
@@ -174,16 +174,16 @@ export async function cancelSync(client, parameters) {
|
|
|
174
174
|
* ```ts
|
|
175
175
|
* import { createClient, http } from 'viem'
|
|
176
176
|
* import { tempo } from 'tempo.ts/chains'
|
|
177
|
-
* import
|
|
177
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
178
178
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
179
179
|
*
|
|
180
180
|
* const client = createClient({
|
|
181
181
|
* account: privateKeyToAccount('0x...'),
|
|
182
|
-
* chain: tempo
|
|
182
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
183
183
|
* transport: http(),
|
|
184
184
|
* })
|
|
185
185
|
*
|
|
186
|
-
* const hash = await
|
|
186
|
+
* const hash = await Actions.reward.claim(client, {
|
|
187
187
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
188
188
|
* })
|
|
189
189
|
* ```
|
|
@@ -218,10 +218,10 @@ export async function claim(client, parameters) {
|
|
|
218
218
|
* ```ts
|
|
219
219
|
* import { createClient, http, walletActions } from 'viem'
|
|
220
220
|
* import { tempo } from 'tempo.ts/chains'
|
|
221
|
-
* import
|
|
221
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
222
222
|
*
|
|
223
223
|
* const client = createClient({
|
|
224
|
-
* chain: tempo
|
|
224
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
225
225
|
* transport: http(),
|
|
226
226
|
* }).extend(walletActions)
|
|
227
227
|
*
|
|
@@ -267,16 +267,16 @@ export async function claim(client, parameters) {
|
|
|
267
267
|
* ```ts
|
|
268
268
|
* import { createClient, http } from 'viem'
|
|
269
269
|
* import { tempo } from 'tempo.ts/chains'
|
|
270
|
-
* import
|
|
270
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
271
271
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
272
272
|
*
|
|
273
273
|
* const client = createClient({
|
|
274
274
|
* account: privateKeyToAccount('0x...'),
|
|
275
|
-
* chain: tempo
|
|
275
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
276
276
|
* transport: http(),
|
|
277
277
|
* })
|
|
278
278
|
*
|
|
279
|
-
* const { receipt } = await
|
|
279
|
+
* const { receipt } = await Actions.reward.claimSync(client, {
|
|
280
280
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
281
281
|
* })
|
|
282
282
|
* ```
|
|
@@ -311,14 +311,14 @@ export async function claimSync(client, parameters) {
|
|
|
311
311
|
* ```ts
|
|
312
312
|
* import { createClient, http } from 'viem'
|
|
313
313
|
* import { tempo } from 'tempo.ts/chains'
|
|
314
|
-
* import
|
|
314
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
315
315
|
*
|
|
316
316
|
* const client = createClient({
|
|
317
|
-
* chain: tempo
|
|
317
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
318
318
|
* transport: http(),
|
|
319
319
|
* })
|
|
320
320
|
*
|
|
321
|
-
* const stream = await
|
|
321
|
+
* const stream = await Actions.rewards.getStream(client, {
|
|
322
322
|
* id: 1n,
|
|
323
323
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
324
324
|
* })
|
|
@@ -363,14 +363,14 @@ export async function getStream(client, parameters) {
|
|
|
363
363
|
* ```ts
|
|
364
364
|
* import { createClient, http } from 'viem'
|
|
365
365
|
* import { tempo } from 'tempo.ts/chains'
|
|
366
|
-
* import
|
|
366
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
367
367
|
*
|
|
368
368
|
* const client = createClient({
|
|
369
|
-
* chain: tempo
|
|
369
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
370
370
|
* transport: http(),
|
|
371
371
|
* })
|
|
372
372
|
*
|
|
373
|
-
* const rate = await
|
|
373
|
+
* const rate = await Actions.rewards.getTotalPerSecond(client, {
|
|
374
374
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
375
375
|
* })
|
|
376
376
|
* ```
|
|
@@ -419,16 +419,16 @@ export async function getTotalPerSecond(client, parameters) {
|
|
|
419
419
|
* ```ts
|
|
420
420
|
* import { createClient, http } from 'viem'
|
|
421
421
|
* import { tempo } from 'tempo.ts/chains'
|
|
422
|
-
* import
|
|
422
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
423
423
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
424
424
|
*
|
|
425
425
|
* const client = createClient({
|
|
426
426
|
* account: privateKeyToAccount('0x...'),
|
|
427
|
-
* chain: tempo
|
|
427
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
428
428
|
* transport: http(),
|
|
429
429
|
* })
|
|
430
430
|
*
|
|
431
|
-
* const hash = await
|
|
431
|
+
* const hash = await Actions.rewards.setRecipient(client, {
|
|
432
432
|
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
433
433
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
434
434
|
* })
|
|
@@ -457,16 +457,16 @@ export async function setRecipient(client, parameters) {
|
|
|
457
457
|
* ```ts
|
|
458
458
|
* import { createClient, http } from 'viem'
|
|
459
459
|
* import { tempo } from 'tempo.ts/chains'
|
|
460
|
-
* import
|
|
460
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
461
461
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
462
462
|
*
|
|
463
463
|
* const client = createClient({
|
|
464
464
|
* account: privateKeyToAccount('0x...'),
|
|
465
|
-
* chain: tempo
|
|
465
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
466
466
|
* transport: http(),
|
|
467
467
|
* })
|
|
468
468
|
*
|
|
469
|
-
* const { holder, recipient, receipt } = await
|
|
469
|
+
* const { holder, recipient, receipt } = await Actions.rewards.setRecipientSync(client, {
|
|
470
470
|
* recipient: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
471
471
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
472
472
|
* })
|
|
@@ -511,10 +511,10 @@ export async function setRecipientSync(client, parameters) {
|
|
|
511
511
|
* ```ts
|
|
512
512
|
* import { createClient, http, walletActions } from 'viem'
|
|
513
513
|
* import { tempo } from 'tempo.ts/chains'
|
|
514
|
-
* import
|
|
514
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
515
515
|
*
|
|
516
516
|
* const client = createClient({
|
|
517
|
-
* chain: tempo
|
|
517
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
518
518
|
* transport: http(),
|
|
519
519
|
* }).extend(walletActions)
|
|
520
520
|
*
|
|
@@ -577,16 +577,16 @@ export async function setRecipientSync(client, parameters) {
|
|
|
577
577
|
* ```ts
|
|
578
578
|
* import { createClient, http } from 'viem'
|
|
579
579
|
* import { tempo } from 'tempo.ts/chains'
|
|
580
|
-
* import
|
|
580
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
581
581
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
582
582
|
*
|
|
583
583
|
* const client = createClient({
|
|
584
584
|
* account: privateKeyToAccount('0x...'),
|
|
585
|
-
* chain: tempo
|
|
585
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
586
586
|
* transport: http(),
|
|
587
587
|
* })
|
|
588
588
|
*
|
|
589
|
-
* const hash = await
|
|
589
|
+
* const hash = await Actions.rewards.start(client, {
|
|
590
590
|
* amount: 100000000000000000000n,
|
|
591
591
|
* seconds: 86400,
|
|
592
592
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
@@ -619,16 +619,16 @@ export async function start(client, parameters) {
|
|
|
619
619
|
* ```ts
|
|
620
620
|
* import { createClient, http } from 'viem'
|
|
621
621
|
* import { tempo } from 'tempo.ts/chains'
|
|
622
|
-
* import
|
|
622
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
623
623
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
624
624
|
*
|
|
625
625
|
* const client = createClient({
|
|
626
626
|
* account: privateKeyToAccount('0x...'),
|
|
627
|
-
* chain: tempo
|
|
627
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
628
628
|
* transport: http(),
|
|
629
629
|
* })
|
|
630
630
|
*
|
|
631
|
-
* const { id, receipt } = await
|
|
631
|
+
* const { id, receipt } = await Actions.rewards.startSync(client, {
|
|
632
632
|
* amount: 100000000000000000000n,
|
|
633
633
|
* seconds: 86400,
|
|
634
634
|
* token: '0x20c0000000000000000000000000000000000001',
|
|
@@ -674,10 +674,10 @@ export async function startSync(client, parameters) {
|
|
|
674
674
|
* ```ts
|
|
675
675
|
* import { createClient, http, walletActions } from 'viem'
|
|
676
676
|
* import { tempo } from 'tempo.ts/chains'
|
|
677
|
-
* import
|
|
677
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
678
678
|
*
|
|
679
679
|
* const client = createClient({
|
|
680
|
-
* chain: tempo
|
|
680
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
681
681
|
* transport: http(),
|
|
682
682
|
* }).extend(walletActions)
|
|
683
683
|
*
|