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/dist/viem/Actions/dex.js
CHANGED
|
@@ -21,7 +21,7 @@ import { defineCall } from '../internal/utils.js';
|
|
|
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
|
*
|
|
@@ -66,7 +66,7 @@ export async function buy(client, parameters) {
|
|
|
66
66
|
* import { Actions } from 'tempo.ts/viem'
|
|
67
67
|
*
|
|
68
68
|
* const client = createClient({
|
|
69
|
-
* chain: tempo
|
|
69
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
70
70
|
* transport: http(),
|
|
71
71
|
* }).extend(walletActions)
|
|
72
72
|
*
|
|
@@ -108,7 +108,7 @@ export async function buy(client, parameters) {
|
|
|
108
108
|
*
|
|
109
109
|
* const client = createClient({
|
|
110
110
|
* account: privateKeyToAccount('0x...'),
|
|
111
|
-
* chain: tempo
|
|
111
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
112
112
|
* transport: http(),
|
|
113
113
|
* })
|
|
114
114
|
*
|
|
@@ -144,7 +144,7 @@ export async function buySync(client, parameters) {
|
|
|
144
144
|
*
|
|
145
145
|
* const client = createClient({
|
|
146
146
|
* account: privateKeyToAccount('0x...'),
|
|
147
|
-
* chain: tempo
|
|
147
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
148
148
|
* transport: http(),
|
|
149
149
|
* })
|
|
150
150
|
*
|
|
@@ -186,7 +186,7 @@ export async function cancel(client, parameters) {
|
|
|
186
186
|
* import { Actions } from 'tempo.ts/viem'
|
|
187
187
|
*
|
|
188
188
|
* const client = createClient({
|
|
189
|
-
* chain: tempo
|
|
189
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
190
190
|
* transport: http(),
|
|
191
191
|
* }).extend(walletActions)
|
|
192
192
|
*
|
|
@@ -243,7 +243,7 @@ export async function cancel(client, parameters) {
|
|
|
243
243
|
*
|
|
244
244
|
* const client = createClient({
|
|
245
245
|
* account: privateKeyToAccount('0x...'),
|
|
246
|
-
* chain: tempo
|
|
246
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
247
247
|
* transport: http(),
|
|
248
248
|
* })
|
|
249
249
|
*
|
|
@@ -280,7 +280,7 @@ export async function cancelSync(client, parameters) {
|
|
|
280
280
|
*
|
|
281
281
|
* const client = createClient({
|
|
282
282
|
* account: privateKeyToAccount('0x...'),
|
|
283
|
-
* chain: tempo
|
|
283
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
284
284
|
* transport: http(),
|
|
285
285
|
* })
|
|
286
286
|
*
|
|
@@ -322,7 +322,7 @@ export async function createPair(client, parameters) {
|
|
|
322
322
|
* import { Actions } from 'tempo.ts/viem'
|
|
323
323
|
*
|
|
324
324
|
* const client = createClient({
|
|
325
|
-
* chain: tempo
|
|
325
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
326
326
|
* transport: http(),
|
|
327
327
|
* }).extend(walletActions)
|
|
328
328
|
*
|
|
@@ -379,7 +379,7 @@ export async function createPair(client, parameters) {
|
|
|
379
379
|
*
|
|
380
380
|
* const client = createClient({
|
|
381
381
|
* account: privateKeyToAccount('0x...'),
|
|
382
|
-
* chain: tempo
|
|
382
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
383
383
|
* transport: http(),
|
|
384
384
|
* })
|
|
385
385
|
*
|
|
@@ -414,7 +414,7 @@ export async function createPairSync(client, parameters) {
|
|
|
414
414
|
* import { Actions } from 'tempo.ts/viem'
|
|
415
415
|
*
|
|
416
416
|
* const client = createClient({
|
|
417
|
-
* chain: tempo
|
|
417
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
418
418
|
* transport: http(),
|
|
419
419
|
* })
|
|
420
420
|
*
|
|
@@ -466,7 +466,7 @@ export async function getBalance(client, parameters) {
|
|
|
466
466
|
* import { Actions } from 'tempo.ts/viem'
|
|
467
467
|
*
|
|
468
468
|
* const client = createClient({
|
|
469
|
-
* chain: tempo
|
|
469
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
470
470
|
* transport: http(),
|
|
471
471
|
* })
|
|
472
472
|
*
|
|
@@ -516,7 +516,7 @@ export async function getBuyQuote(client, parameters) {
|
|
|
516
516
|
* import { Actions } from 'tempo.ts/viem'
|
|
517
517
|
*
|
|
518
518
|
* const client = createClient({
|
|
519
|
-
* chain: tempo
|
|
519
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
520
520
|
* transport: http(),
|
|
521
521
|
* })
|
|
522
522
|
*
|
|
@@ -564,7 +564,7 @@ export async function getOrder(client, parameters) {
|
|
|
564
564
|
* import { Actions } from 'tempo.ts/viem'
|
|
565
565
|
*
|
|
566
566
|
* const client = createClient({
|
|
567
|
-
* chain: tempo
|
|
567
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
568
568
|
* transport: http(),
|
|
569
569
|
* })
|
|
570
570
|
*
|
|
@@ -604,7 +604,7 @@ export async function getOrders(client, parameters = {}) {
|
|
|
604
604
|
* import { Actions } from 'tempo.ts/viem'
|
|
605
605
|
*
|
|
606
606
|
* const client = createClient({
|
|
607
|
-
* chain: tempo
|
|
607
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
608
608
|
* transport: http(),
|
|
609
609
|
* })
|
|
610
610
|
*
|
|
@@ -654,7 +654,7 @@ export async function getOrderbook(client, parameters) {
|
|
|
654
654
|
* import { Actions, Tick } from 'tempo.ts/viem'
|
|
655
655
|
*
|
|
656
656
|
* const client = createClient({
|
|
657
|
-
* chain: tempo
|
|
657
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
658
658
|
* transport: http(),
|
|
659
659
|
* })
|
|
660
660
|
*
|
|
@@ -704,7 +704,7 @@ export async function getPriceLevel(client, parameters) {
|
|
|
704
704
|
* import { Actions } from 'tempo.ts/viem'
|
|
705
705
|
*
|
|
706
706
|
* const client = createClient({
|
|
707
|
-
* chain: tempo
|
|
707
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
708
708
|
* transport: http(),
|
|
709
709
|
* })
|
|
710
710
|
*
|
|
@@ -756,7 +756,7 @@ export async function getSellQuote(client, parameters) {
|
|
|
756
756
|
*
|
|
757
757
|
* const client = createClient({
|
|
758
758
|
* account: privateKeyToAccount('0x...'),
|
|
759
|
-
* chain: tempo
|
|
759
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
760
760
|
* transport: http(),
|
|
761
761
|
* })
|
|
762
762
|
*
|
|
@@ -801,7 +801,7 @@ export async function place(client, parameters) {
|
|
|
801
801
|
* import { Actions, Tick } from 'tempo.ts/viem'
|
|
802
802
|
*
|
|
803
803
|
* const client = createClient({
|
|
804
|
-
* chain: tempo
|
|
804
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
805
805
|
* transport: http(),
|
|
806
806
|
* }).extend(walletActions)
|
|
807
807
|
*
|
|
@@ -862,7 +862,7 @@ export async function place(client, parameters) {
|
|
|
862
862
|
*
|
|
863
863
|
* const client = createClient({
|
|
864
864
|
* account: privateKeyToAccount('0x...'),
|
|
865
|
-
* chain: tempo
|
|
865
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
866
866
|
* transport: http(),
|
|
867
867
|
* })
|
|
868
868
|
*
|
|
@@ -908,7 +908,7 @@ export async function placeFlip(client, parameters) {
|
|
|
908
908
|
* import { Actions, Tick } from 'tempo.ts/viem'
|
|
909
909
|
*
|
|
910
910
|
* const client = createClient({
|
|
911
|
-
* chain: tempo
|
|
911
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
912
912
|
* transport: http(),
|
|
913
913
|
* }).extend(walletActions)
|
|
914
914
|
*
|
|
@@ -970,7 +970,7 @@ export async function placeFlip(client, parameters) {
|
|
|
970
970
|
*
|
|
971
971
|
* const client = createClient({
|
|
972
972
|
* account: privateKeyToAccount('0x...'),
|
|
973
|
-
* chain: tempo
|
|
973
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
974
974
|
* transport: http(),
|
|
975
975
|
* })
|
|
976
976
|
*
|
|
@@ -1011,7 +1011,7 @@ export async function placeFlipSync(client, parameters) {
|
|
|
1011
1011
|
*
|
|
1012
1012
|
* const client = createClient({
|
|
1013
1013
|
* account: privateKeyToAccount('0x...'),
|
|
1014
|
-
* chain: tempo
|
|
1014
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1015
1015
|
* transport: http(),
|
|
1016
1016
|
* })
|
|
1017
1017
|
*
|
|
@@ -1051,7 +1051,7 @@ export async function placeSync(client, parameters) {
|
|
|
1051
1051
|
*
|
|
1052
1052
|
* const client = createClient({
|
|
1053
1053
|
* account: privateKeyToAccount('0x...'),
|
|
1054
|
-
* chain: tempo
|
|
1054
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1055
1055
|
* transport: http(),
|
|
1056
1056
|
* })
|
|
1057
1057
|
*
|
|
@@ -1096,7 +1096,7 @@ export async function sell(client, parameters) {
|
|
|
1096
1096
|
* import { Actions } from 'tempo.ts/viem'
|
|
1097
1097
|
*
|
|
1098
1098
|
* const client = createClient({
|
|
1099
|
-
* chain: tempo
|
|
1099
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1100
1100
|
* transport: http(),
|
|
1101
1101
|
* }).extend(walletActions)
|
|
1102
1102
|
*
|
|
@@ -1138,7 +1138,7 @@ export async function sell(client, parameters) {
|
|
|
1138
1138
|
*
|
|
1139
1139
|
* const client = createClient({
|
|
1140
1140
|
* account: privateKeyToAccount('0x...'),
|
|
1141
|
-
* chain: tempo
|
|
1141
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1142
1142
|
* transport: http(),
|
|
1143
1143
|
* })
|
|
1144
1144
|
*
|
|
@@ -1172,7 +1172,7 @@ export async function sellSync(client, parameters) {
|
|
|
1172
1172
|
* import { Actions } from 'tempo.ts/viem'
|
|
1173
1173
|
*
|
|
1174
1174
|
* const client = createClient({
|
|
1175
|
-
* chain: tempo
|
|
1175
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1176
1176
|
* transport: http(),
|
|
1177
1177
|
* })
|
|
1178
1178
|
*
|
|
@@ -1215,7 +1215,7 @@ export function watchFlipOrderPlaced(client, parameters) {
|
|
|
1215
1215
|
* import { Actions } from 'tempo.ts/viem'
|
|
1216
1216
|
*
|
|
1217
1217
|
* const client = createClient({
|
|
1218
|
-
* chain: tempo
|
|
1218
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1219
1219
|
* transport: http(),
|
|
1220
1220
|
* })
|
|
1221
1221
|
*
|
|
@@ -1255,7 +1255,7 @@ export function watchOrderCancelled(client, parameters) {
|
|
|
1255
1255
|
* import { Actions } from 'tempo.ts/viem'
|
|
1256
1256
|
*
|
|
1257
1257
|
* const client = createClient({
|
|
1258
|
-
* chain: tempo
|
|
1258
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1259
1259
|
* transport: http(),
|
|
1260
1260
|
* })
|
|
1261
1261
|
*
|
|
@@ -1299,7 +1299,7 @@ export function watchOrderFilled(client, parameters) {
|
|
|
1299
1299
|
* import { Actions } from 'tempo.ts/viem'
|
|
1300
1300
|
*
|
|
1301
1301
|
* const client = createClient({
|
|
1302
|
-
* chain: tempo
|
|
1302
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1303
1303
|
* transport: http(),
|
|
1304
1304
|
* })
|
|
1305
1305
|
*
|
|
@@ -1344,7 +1344,7 @@ export function watchOrderPlaced(client, parameters) {
|
|
|
1344
1344
|
*
|
|
1345
1345
|
* const client = createClient({
|
|
1346
1346
|
* account: privateKeyToAccount('0x...'),
|
|
1347
|
-
* chain: tempo
|
|
1347
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1348
1348
|
* transport: http(),
|
|
1349
1349
|
* })
|
|
1350
1350
|
*
|
|
@@ -1387,7 +1387,7 @@ export async function withdraw(client, parameters) {
|
|
|
1387
1387
|
* import { Actions } from 'tempo.ts/viem'
|
|
1388
1388
|
*
|
|
1389
1389
|
* const client = createClient({
|
|
1390
|
-
* chain: tempo
|
|
1390
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1391
1391
|
* transport: http(),
|
|
1392
1392
|
* }).extend(walletActions)
|
|
1393
1393
|
*
|
|
@@ -1427,7 +1427,7 @@ export async function withdraw(client, parameters) {
|
|
|
1427
1427
|
*
|
|
1428
1428
|
* const client = createClient({
|
|
1429
1429
|
* account: privateKeyToAccount('0x...'),
|
|
1430
|
-
* chain: tempo
|
|
1430
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1431
1431
|
* transport: http(),
|
|
1432
1432
|
* })
|
|
1433
1433
|
*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Account, Address, Chain, Client, Hash, Transport } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Funds an account with an initial amount of set token(s)
|
|
4
|
+
* on Tempo's testnet.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { createClient, http } from 'viem'
|
|
9
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
10
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
11
|
+
*
|
|
12
|
+
* const client = createClient({
|
|
13
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
14
|
+
* transport: http(),
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* const hashes = await Actions.faucet.fund(client, {
|
|
18
|
+
* account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param client - Client.
|
|
23
|
+
* @param parameters - Parameters.
|
|
24
|
+
* @returns The transaction hash.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fund<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: fund.Parameters): Promise<fund.ReturnValue>;
|
|
27
|
+
export declare namespace fund {
|
|
28
|
+
type Parameters = {
|
|
29
|
+
/** Account to fund. */
|
|
30
|
+
account: Account | Address;
|
|
31
|
+
};
|
|
32
|
+
type ReturnValue = readonly Hash[];
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=faucet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faucet.d.ts","sourceRoot":"","sources":["../../../src/viem/Actions/faucet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAG5E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,IAAI,CAAC,KAAK,SAAS,KAAK,GAAG,SAAS,EACxD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,EAChC,UAAU,EAAE,IAAI,CAAC,UAAU,GAC1B,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAU3B;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,KAAY,UAAU,GAAG;QACvB,uBAAuB;QACvB,OAAO,EAAE,OAAO,GAAG,OAAO,CAAA;KAC3B,CAAA;IAED,KAAY,WAAW,GAAG,SAAS,IAAI,EAAE,CAAA;CAC1C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { parseAccount } from 'viem/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Funds an account with an initial amount of set token(s)
|
|
4
|
+
* on Tempo's testnet.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { createClient, http } from 'viem'
|
|
9
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
10
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
11
|
+
*
|
|
12
|
+
* const client = createClient({
|
|
13
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
|
|
14
|
+
* transport: http(),
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* const hashes = await Actions.faucet.fund(client, {
|
|
18
|
+
* account: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param client - Client.
|
|
23
|
+
* @param parameters - Parameters.
|
|
24
|
+
* @returns The transaction hash.
|
|
25
|
+
*/
|
|
26
|
+
export async function fund(client, parameters) {
|
|
27
|
+
const account = parseAccount(parameters.account);
|
|
28
|
+
return client.request({
|
|
29
|
+
method: 'tempo_fundAddress',
|
|
30
|
+
params: [account.address],
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=faucet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faucet.js","sourceRoot":"","sources":["../../../src/viem/Actions/faucet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,MAAgC,EAChC,UAA2B;IAE3B,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAChD,OAAO,MAAM,CAAC,OAAO,CAIlB;QACD,MAAM,EAAE,mBAAmB;QAC3B,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;KAC1B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -11,16 +11,16 @@ import type { GetAccountParameter, ReadParameters, WriteParameters } from '../in
|
|
|
11
11
|
* ```ts
|
|
12
12
|
* import { createClient, http } from 'viem'
|
|
13
13
|
* import { tempo } from 'tempo.ts/chains'
|
|
14
|
-
* import
|
|
14
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
15
15
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
16
16
|
*
|
|
17
17
|
* const client = createClient({
|
|
18
18
|
* account: privateKeyToAccount('0x...'),
|
|
19
|
-
* chain: tempo
|
|
19
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
20
20
|
* transport: http(),
|
|
21
21
|
* })
|
|
22
22
|
*
|
|
23
|
-
* const { address, id } = await
|
|
23
|
+
* const { address, id } = await Actions.fee.getUserToken(client)
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
26
26
|
* @param client - Client.
|
|
@@ -75,16 +75,16 @@ export declare namespace getUserToken {
|
|
|
75
75
|
* ```ts
|
|
76
76
|
* import { createClient, http } from 'viem'
|
|
77
77
|
* import { tempo } from 'tempo.ts/chains'
|
|
78
|
-
* import
|
|
78
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
79
79
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
80
80
|
*
|
|
81
81
|
* const client = createClient({
|
|
82
82
|
* account: privateKeyToAccount('0x...'),
|
|
83
|
-
* chain: tempo
|
|
83
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
84
84
|
* transport: http(),
|
|
85
85
|
* })
|
|
86
86
|
*
|
|
87
|
-
* const hash = await
|
|
87
|
+
* const hash = await Actions.fee.setUserToken(client, {
|
|
88
88
|
* token: '0x...',
|
|
89
89
|
* })
|
|
90
90
|
* ```
|
|
@@ -116,10 +116,10 @@ export declare namespace setUserToken {
|
|
|
116
116
|
* ```ts
|
|
117
117
|
* import { createClient, http, walletActions } from 'viem'
|
|
118
118
|
* import { tempo } from 'tempo.ts/chains'
|
|
119
|
-
* import
|
|
119
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
120
120
|
*
|
|
121
121
|
* const client = createClient({
|
|
122
|
-
* chain: tempo
|
|
122
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
123
123
|
* transport: http(),
|
|
124
124
|
* }).extend(walletActions)
|
|
125
125
|
*
|
|
@@ -290,16 +290,16 @@ export declare namespace setUserToken {
|
|
|
290
290
|
* ```ts
|
|
291
291
|
* import { createClient, http } from 'viem'
|
|
292
292
|
* import { tempo } from 'tempo.ts/chains'
|
|
293
|
-
* import
|
|
293
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
294
294
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
295
295
|
*
|
|
296
296
|
* const client = createClient({
|
|
297
297
|
* account: privateKeyToAccount('0x...'),
|
|
298
|
-
* chain: tempo
|
|
298
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
299
299
|
* transport: http(),
|
|
300
300
|
* })
|
|
301
301
|
*
|
|
302
|
-
* const result = await
|
|
302
|
+
* const result = await Actions.fee.setUserTokenSync(client, {
|
|
303
303
|
* token: '0x...',
|
|
304
304
|
* })
|
|
305
305
|
* ```
|
|
@@ -327,10 +327,10 @@ export declare namespace setUserTokenSync {
|
|
|
327
327
|
* ```ts
|
|
328
328
|
* import { createClient, http } from 'viem'
|
|
329
329
|
* import { tempo } from 'tempo.ts/chains'
|
|
330
|
-
* import
|
|
330
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
331
331
|
*
|
|
332
332
|
* const client = createClient({
|
|
333
|
-
* chain: tempo
|
|
333
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
334
334
|
* transport: http(),
|
|
335
335
|
* })
|
|
336
336
|
*
|
package/dist/viem/Actions/fee.js
CHANGED
|
@@ -12,16 +12,16 @@ import { defineCall } from '../internal/utils.js';
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* import { createClient, http } from 'viem'
|
|
14
14
|
* import { tempo } from 'tempo.ts/chains'
|
|
15
|
-
* import
|
|
15
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
16
16
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
17
17
|
*
|
|
18
18
|
* const client = createClient({
|
|
19
19
|
* account: privateKeyToAccount('0x...'),
|
|
20
|
-
* chain: tempo
|
|
20
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
21
21
|
* transport: http(),
|
|
22
22
|
* })
|
|
23
23
|
*
|
|
24
|
-
* const { address, id } = await
|
|
24
|
+
* const { address, id } = await Actions.fee.getUserToken(client)
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
27
|
* @param client - Client.
|
|
@@ -67,16 +67,16 @@ export async function getUserToken(client, ...parameters) {
|
|
|
67
67
|
* ```ts
|
|
68
68
|
* import { createClient, http } from 'viem'
|
|
69
69
|
* import { tempo } from 'tempo.ts/chains'
|
|
70
|
-
* import
|
|
70
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
71
71
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
72
72
|
*
|
|
73
73
|
* const client = createClient({
|
|
74
74
|
* account: privateKeyToAccount('0x...'),
|
|
75
|
-
* chain: tempo
|
|
75
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
76
76
|
* transport: http(),
|
|
77
77
|
* })
|
|
78
78
|
*
|
|
79
|
-
* const hash = await
|
|
79
|
+
* const hash = await Actions.fee.setUserToken(client, {
|
|
80
80
|
* token: '0x...',
|
|
81
81
|
* })
|
|
82
82
|
* ```
|
|
@@ -111,10 +111,10 @@ export async function setUserToken(client, parameters) {
|
|
|
111
111
|
* ```ts
|
|
112
112
|
* import { createClient, http, walletActions } from 'viem'
|
|
113
113
|
* import { tempo } from 'tempo.ts/chains'
|
|
114
|
-
* import
|
|
114
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
115
115
|
*
|
|
116
116
|
* const client = createClient({
|
|
117
|
-
* chain: tempo
|
|
117
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
118
118
|
* transport: http(),
|
|
119
119
|
* }).extend(walletActions)
|
|
120
120
|
*
|
|
@@ -163,16 +163,16 @@ export async function setUserToken(client, parameters) {
|
|
|
163
163
|
* ```ts
|
|
164
164
|
* import { createClient, http } from 'viem'
|
|
165
165
|
* import { tempo } from 'tempo.ts/chains'
|
|
166
|
-
* import
|
|
166
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
167
167
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
168
168
|
*
|
|
169
169
|
* const client = createClient({
|
|
170
170
|
* account: privateKeyToAccount('0x...'),
|
|
171
|
-
* chain: tempo
|
|
171
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
172
172
|
* transport: http(),
|
|
173
173
|
* })
|
|
174
174
|
*
|
|
175
|
-
* const result = await
|
|
175
|
+
* const result = await Actions.fee.setUserTokenSync(client, {
|
|
176
176
|
* token: '0x...',
|
|
177
177
|
* })
|
|
178
178
|
* ```
|
|
@@ -200,10 +200,10 @@ export async function setUserTokenSync(client, parameters) {
|
|
|
200
200
|
* ```ts
|
|
201
201
|
* import { createClient, http } from 'viem'
|
|
202
202
|
* import { tempo } from 'tempo.ts/chains'
|
|
203
|
-
* import
|
|
203
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
204
204
|
*
|
|
205
205
|
* const client = createClient({
|
|
206
|
-
* chain: tempo
|
|
206
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
207
207
|
* transport: http(),
|
|
208
208
|
* })
|
|
209
209
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viem/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viem/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viem/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viem/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|