tempo.ts 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/chains.d.ts +56 -1572
- 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 +14 -14
- package/dist/viem/Actions/fee.d.ts.map +1 -1
- package/dist/viem/Actions/fee.js +16 -14
- package/dist/viem/Actions/fee.js.map +1 -1
- package/dist/viem/Actions/index.d.ts +1 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +1 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/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/Chain.d.ts +8 -5
- package/dist/viem/Chain.d.ts.map +1 -1
- package/dist/viem/Chain.js +25 -25
- package/dist/viem/Chain.js.map +1 -1
- 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 -54
- 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 +16 -14
- 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/Chain.ts +36 -32
- 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
|
@@ -15,7 +15,7 @@ import * as viem_Actions from '../../viem/Actions/token.js'
|
|
|
15
15
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
16
16
|
*
|
|
17
17
|
* const config = createConfig({
|
|
18
|
-
* chains: [tempo],
|
|
18
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
19
19
|
* transports: {
|
|
20
20
|
* [tempo.id]: http(),
|
|
21
21
|
* },
|
|
@@ -73,7 +73,7 @@ export declare namespace approve {
|
|
|
73
73
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
74
74
|
*
|
|
75
75
|
* const config = createConfig({
|
|
76
|
-
* chains: [tempo],
|
|
76
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
77
77
|
* transports: {
|
|
78
78
|
* [tempo.id]: http(),
|
|
79
79
|
* },
|
|
@@ -128,7 +128,7 @@ export declare namespace approveSync {
|
|
|
128
128
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
129
129
|
*
|
|
130
130
|
* const config = createConfig({
|
|
131
|
-
* chains: [tempo],
|
|
131
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
132
132
|
* transports: {
|
|
133
133
|
* [tempo.id]: http(),
|
|
134
134
|
* },
|
|
@@ -180,7 +180,7 @@ export declare namespace burn {
|
|
|
180
180
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
181
181
|
*
|
|
182
182
|
* const config = createConfig({
|
|
183
|
-
* chains: [tempo],
|
|
183
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
184
184
|
* transports: {
|
|
185
185
|
* [tempo.id]: http(),
|
|
186
186
|
* },
|
|
@@ -239,7 +239,7 @@ export declare namespace burnBlocked {
|
|
|
239
239
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
240
240
|
*
|
|
241
241
|
* const config = createConfig({
|
|
242
|
-
* chains: [tempo],
|
|
242
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
243
243
|
* transports: {
|
|
244
244
|
* [tempo.id]: http(),
|
|
245
245
|
* },
|
|
@@ -298,7 +298,7 @@ export declare namespace burnBlockedSync {
|
|
|
298
298
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
299
299
|
*
|
|
300
300
|
* const config = createConfig({
|
|
301
|
-
* chains: [tempo],
|
|
301
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
302
302
|
* transports: {
|
|
303
303
|
* [tempo.id]: http(),
|
|
304
304
|
* },
|
|
@@ -353,7 +353,7 @@ export declare namespace burnSync {
|
|
|
353
353
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
354
354
|
*
|
|
355
355
|
* const config = createConfig({
|
|
356
|
-
* chains: [tempo],
|
|
356
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
357
357
|
* transports: {
|
|
358
358
|
* [tempo.id]: http(),
|
|
359
359
|
* },
|
|
@@ -414,7 +414,7 @@ export declare namespace changeTransferPolicy {
|
|
|
414
414
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
415
415
|
*
|
|
416
416
|
* const config = createConfig({
|
|
417
|
-
* chains: [tempo],
|
|
417
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
418
418
|
* transports: {
|
|
419
419
|
* [tempo.id]: http(),
|
|
420
420
|
* },
|
|
@@ -472,7 +472,7 @@ export declare namespace changeTransferPolicySync {
|
|
|
472
472
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
473
473
|
*
|
|
474
474
|
* const config = createConfig({
|
|
475
|
-
* chains: [tempo],
|
|
475
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
476
476
|
* transports: {
|
|
477
477
|
* [tempo.id]: http(),
|
|
478
478
|
* },
|
|
@@ -531,7 +531,7 @@ export declare namespace create {
|
|
|
531
531
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
532
532
|
*
|
|
533
533
|
* const config = createConfig({
|
|
534
|
-
* chains: [tempo],
|
|
534
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
535
535
|
* transports: {
|
|
536
536
|
* [tempo.id]: http(),
|
|
537
537
|
* },
|
|
@@ -587,7 +587,7 @@ export declare namespace createSync {
|
|
|
587
587
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
588
588
|
*
|
|
589
589
|
* const config = createConfig({
|
|
590
|
-
* chains: [tempo],
|
|
590
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
591
591
|
* transports: {
|
|
592
592
|
* [tempo.id]: http(),
|
|
593
593
|
* },
|
|
@@ -644,7 +644,7 @@ export declare namespace updateQuoteToken {
|
|
|
644
644
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
645
645
|
*
|
|
646
646
|
* const config = createConfig({
|
|
647
|
-
* chains: [tempo],
|
|
647
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
648
648
|
* transports: {
|
|
649
649
|
* [tempo.id]: http(),
|
|
650
650
|
* },
|
|
@@ -701,7 +701,7 @@ export declare namespace updateQuoteTokenSync {
|
|
|
701
701
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
702
702
|
*
|
|
703
703
|
* const config = createConfig({
|
|
704
|
-
* chains: [tempo],
|
|
704
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
705
705
|
* transports: {
|
|
706
706
|
* [tempo.id]: http(),
|
|
707
707
|
* },
|
|
@@ -792,7 +792,7 @@ export namespace getAllowance {
|
|
|
792
792
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
793
793
|
*
|
|
794
794
|
* const config = createConfig({
|
|
795
|
-
* chains: [tempo],
|
|
795
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
796
796
|
* transports: {
|
|
797
797
|
* [tempo.id]: http(),
|
|
798
798
|
* },
|
|
@@ -842,7 +842,7 @@ export namespace getBalance {
|
|
|
842
842
|
queryKey: queryKey(rest),
|
|
843
843
|
async queryFn({ queryKey }) {
|
|
844
844
|
const [, parameters] = queryKey
|
|
845
|
-
return await getBalance(config, parameters)
|
|
845
|
+
return (await getBalance(config, parameters)) ?? null
|
|
846
846
|
},
|
|
847
847
|
}
|
|
848
848
|
}
|
|
@@ -882,7 +882,7 @@ export namespace getBalance {
|
|
|
882
882
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
883
883
|
*
|
|
884
884
|
* const config = createConfig({
|
|
885
|
-
* chains: [tempo],
|
|
885
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
886
886
|
* transports: {
|
|
887
887
|
* [tempo.id]: http(),
|
|
888
888
|
* },
|
|
@@ -972,7 +972,7 @@ export namespace getMetadata {
|
|
|
972
972
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
973
973
|
*
|
|
974
974
|
* const config = createConfig({
|
|
975
|
-
* chains: [tempo],
|
|
975
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
976
976
|
* transports: {
|
|
977
977
|
* [tempo.id]: http(),
|
|
978
978
|
* },
|
|
@@ -1063,7 +1063,7 @@ export namespace getRoleAdmin {
|
|
|
1063
1063
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1064
1064
|
*
|
|
1065
1065
|
* const config = createConfig({
|
|
1066
|
-
* chains: [tempo],
|
|
1066
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1067
1067
|
* transports: {
|
|
1068
1068
|
* [tempo.id]: http(),
|
|
1069
1069
|
* },
|
|
@@ -1122,7 +1122,7 @@ export declare namespace grantRoles {
|
|
|
1122
1122
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1123
1123
|
*
|
|
1124
1124
|
* const config = createConfig({
|
|
1125
|
-
* chains: [tempo],
|
|
1125
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1126
1126
|
* transports: {
|
|
1127
1127
|
* [tempo.id]: http(),
|
|
1128
1128
|
* },
|
|
@@ -1178,7 +1178,7 @@ export declare namespace grantRolesSync {
|
|
|
1178
1178
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1179
1179
|
*
|
|
1180
1180
|
* const config = createConfig({
|
|
1181
|
-
* chains: [tempo],
|
|
1181
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1182
1182
|
* transports: {
|
|
1183
1183
|
* [tempo.id]: http(),
|
|
1184
1184
|
* },
|
|
@@ -1270,7 +1270,7 @@ export namespace hasRole {
|
|
|
1270
1270
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1271
1271
|
*
|
|
1272
1272
|
* const config = createConfig({
|
|
1273
|
-
* chains: [tempo],
|
|
1273
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1274
1274
|
* transports: {
|
|
1275
1275
|
* [tempo.id]: http(),
|
|
1276
1276
|
* },
|
|
@@ -1326,7 +1326,7 @@ export declare namespace mint {
|
|
|
1326
1326
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1327
1327
|
*
|
|
1328
1328
|
* const config = createConfig({
|
|
1329
|
-
* chains: [tempo],
|
|
1329
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1330
1330
|
* transports: {
|
|
1331
1331
|
* [tempo.id]: http(),
|
|
1332
1332
|
* },
|
|
@@ -1382,7 +1382,7 @@ export declare namespace mintSync {
|
|
|
1382
1382
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1383
1383
|
*
|
|
1384
1384
|
* const config = createConfig({
|
|
1385
|
-
* chains: [tempo],
|
|
1385
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1386
1386
|
* transports: {
|
|
1387
1387
|
* [tempo.id]: http(),
|
|
1388
1388
|
* },
|
|
@@ -1436,7 +1436,7 @@ export declare namespace pause {
|
|
|
1436
1436
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1437
1437
|
*
|
|
1438
1438
|
* const config = createConfig({
|
|
1439
|
-
* chains: [tempo],
|
|
1439
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1440
1440
|
* transports: {
|
|
1441
1441
|
* [tempo.id]: http(),
|
|
1442
1442
|
* },
|
|
@@ -1490,7 +1490,7 @@ export declare namespace pauseSync {
|
|
|
1490
1490
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1491
1491
|
*
|
|
1492
1492
|
* const config = createConfig({
|
|
1493
|
-
* chains: [tempo],
|
|
1493
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1494
1494
|
* transports: {
|
|
1495
1495
|
* [tempo.id]: http(),
|
|
1496
1496
|
* },
|
|
@@ -1548,7 +1548,7 @@ export declare namespace renounceRoles {
|
|
|
1548
1548
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1549
1549
|
*
|
|
1550
1550
|
* const config = createConfig({
|
|
1551
|
-
* chains: [tempo],
|
|
1551
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1552
1552
|
* transports: {
|
|
1553
1553
|
* [tempo.id]: http(),
|
|
1554
1554
|
* },
|
|
@@ -1603,7 +1603,7 @@ export declare namespace renounceRolesSync {
|
|
|
1603
1603
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1604
1604
|
*
|
|
1605
1605
|
* const config = createConfig({
|
|
1606
|
-
* chains: [tempo],
|
|
1606
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1607
1607
|
* transports: {
|
|
1608
1608
|
* [tempo.id]: http(),
|
|
1609
1609
|
* },
|
|
@@ -1662,7 +1662,7 @@ export declare namespace revokeRoles {
|
|
|
1662
1662
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1663
1663
|
*
|
|
1664
1664
|
* const config = createConfig({
|
|
1665
|
-
* chains: [tempo],
|
|
1665
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1666
1666
|
* transports: {
|
|
1667
1667
|
* [tempo.id]: http(),
|
|
1668
1668
|
* },
|
|
@@ -1718,7 +1718,7 @@ export declare namespace revokeRolesSync {
|
|
|
1718
1718
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1719
1719
|
*
|
|
1720
1720
|
* const config = createConfig({
|
|
1721
|
-
* chains: [tempo],
|
|
1721
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1722
1722
|
* transports: {
|
|
1723
1723
|
* [tempo.id]: http(),
|
|
1724
1724
|
* },
|
|
@@ -1777,7 +1777,7 @@ export declare namespace setRoleAdmin {
|
|
|
1777
1777
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1778
1778
|
*
|
|
1779
1779
|
* const config = createConfig({
|
|
1780
|
-
* chains: [tempo],
|
|
1780
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1781
1781
|
* transports: {
|
|
1782
1782
|
* [tempo.id]: http(),
|
|
1783
1783
|
* },
|
|
@@ -1833,7 +1833,7 @@ export declare namespace setRoleAdminSync {
|
|
|
1833
1833
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1834
1834
|
*
|
|
1835
1835
|
* const config = createConfig({
|
|
1836
|
-
* chains: [tempo],
|
|
1836
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1837
1837
|
* transports: {
|
|
1838
1838
|
* [tempo.id]: http(),
|
|
1839
1839
|
* },
|
|
@@ -1891,7 +1891,7 @@ export declare namespace setSupplyCap {
|
|
|
1891
1891
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1892
1892
|
*
|
|
1893
1893
|
* const config = createConfig({
|
|
1894
|
-
* chains: [tempo],
|
|
1894
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1895
1895
|
* transports: {
|
|
1896
1896
|
* [tempo.id]: http(),
|
|
1897
1897
|
* },
|
|
@@ -1946,7 +1946,7 @@ export declare namespace setSupplyCapSync {
|
|
|
1946
1946
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
1947
1947
|
*
|
|
1948
1948
|
* const config = createConfig({
|
|
1949
|
-
* chains: [tempo],
|
|
1949
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
1950
1950
|
* transports: {
|
|
1951
1951
|
* [tempo.id]: http(),
|
|
1952
1952
|
* },
|
|
@@ -2004,7 +2004,7 @@ export declare namespace transfer {
|
|
|
2004
2004
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2005
2005
|
*
|
|
2006
2006
|
* const config = createConfig({
|
|
2007
|
-
* chains: [tempo],
|
|
2007
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2008
2008
|
* transports: {
|
|
2009
2009
|
* [tempo.id]: http(),
|
|
2010
2010
|
* },
|
|
@@ -2059,7 +2059,7 @@ export declare namespace transferSync {
|
|
|
2059
2059
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2060
2060
|
*
|
|
2061
2061
|
* const config = createConfig({
|
|
2062
|
-
* chains: [tempo],
|
|
2062
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2063
2063
|
* transports: {
|
|
2064
2064
|
* [tempo.id]: http(),
|
|
2065
2065
|
* },
|
|
@@ -2116,7 +2116,7 @@ export declare namespace unpause {
|
|
|
2116
2116
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2117
2117
|
*
|
|
2118
2118
|
* const config = createConfig({
|
|
2119
|
-
* chains: [tempo],
|
|
2119
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2120
2120
|
* transports: {
|
|
2121
2121
|
* [tempo.id]: http(),
|
|
2122
2122
|
* },
|
|
@@ -2170,7 +2170,7 @@ export declare namespace unpauseSync {
|
|
|
2170
2170
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2171
2171
|
*
|
|
2172
2172
|
* const config = createConfig({
|
|
2173
|
-
* chains: [tempo],
|
|
2173
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2174
2174
|
* transports: {
|
|
2175
2175
|
* [tempo.id]: http(),
|
|
2176
2176
|
* },
|
|
@@ -2231,7 +2231,7 @@ export declare namespace prepareUpdateQuoteToken {
|
|
|
2231
2231
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2232
2232
|
*
|
|
2233
2233
|
* const config = createConfig({
|
|
2234
|
-
* chains: [tempo],
|
|
2234
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2235
2235
|
* transports: {
|
|
2236
2236
|
* [tempo.id]: http(),
|
|
2237
2237
|
* },
|
|
@@ -2289,7 +2289,7 @@ export declare namespace prepareUpdateQuoteTokenSync {
|
|
|
2289
2289
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2290
2290
|
*
|
|
2291
2291
|
* const config = createConfig({
|
|
2292
|
-
* chains: [tempo],
|
|
2292
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2293
2293
|
* transports: {
|
|
2294
2294
|
* [tempo.id]: http(),
|
|
2295
2295
|
* },
|
|
@@ -2330,7 +2330,7 @@ export declare namespace watchAdminRole {
|
|
|
2330
2330
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2331
2331
|
*
|
|
2332
2332
|
* const config = createConfig({
|
|
2333
|
-
* chains: [tempo],
|
|
2333
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2334
2334
|
* transports: {
|
|
2335
2335
|
* [tempo.id]: http(),
|
|
2336
2336
|
* },
|
|
@@ -2371,7 +2371,7 @@ export declare namespace watchApprove {
|
|
|
2371
2371
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2372
2372
|
*
|
|
2373
2373
|
* const config = createConfig({
|
|
2374
|
-
* chains: [tempo],
|
|
2374
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2375
2375
|
* transports: {
|
|
2376
2376
|
* [tempo.id]: http(),
|
|
2377
2377
|
* },
|
|
@@ -2412,7 +2412,7 @@ export declare namespace watchBurn {
|
|
|
2412
2412
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2413
2413
|
*
|
|
2414
2414
|
* const config = createConfig({
|
|
2415
|
-
* chains: [tempo],
|
|
2415
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2416
2416
|
* transports: {
|
|
2417
2417
|
* [tempo.id]: http(),
|
|
2418
2418
|
* },
|
|
@@ -2453,7 +2453,7 @@ export declare namespace watchCreate {
|
|
|
2453
2453
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2454
2454
|
*
|
|
2455
2455
|
* const config = createConfig({
|
|
2456
|
-
* chains: [tempo],
|
|
2456
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2457
2457
|
* transports: {
|
|
2458
2458
|
* [tempo.id]: http(),
|
|
2459
2459
|
* },
|
|
@@ -2496,7 +2496,7 @@ export declare namespace watchMint {
|
|
|
2496
2496
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2497
2497
|
*
|
|
2498
2498
|
* const config = createConfig({
|
|
2499
|
-
* chains: [tempo],
|
|
2499
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2500
2500
|
* transports: {
|
|
2501
2501
|
* [tempo.id]: http(),
|
|
2502
2502
|
* },
|
|
@@ -2537,7 +2537,7 @@ export declare namespace watchRole {
|
|
|
2537
2537
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2538
2538
|
*
|
|
2539
2539
|
* const config = createConfig({
|
|
2540
|
-
* chains: [tempo],
|
|
2540
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2541
2541
|
* transports: {
|
|
2542
2542
|
* [tempo.id]: http(),
|
|
2543
2543
|
* },
|
|
@@ -2578,7 +2578,7 @@ export declare namespace watchTransfer {
|
|
|
2578
2578
|
* import { Actions } from 'tempo.ts/wagmi'
|
|
2579
2579
|
*
|
|
2580
2580
|
* const config = createConfig({
|
|
2581
|
-
* chains: [tempo],
|
|
2581
|
+
* chains: [tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })],
|
|
2582
2582
|
* transports: {
|
|
2583
2583
|
* [tempo.id]: http(),
|
|
2584
2584
|
* },
|
package/src/wagmi/Connector.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Address from 'ox/Address'
|
|
2
|
+
import * as Bytes from 'ox/Bytes'
|
|
2
3
|
import { Account, WebAuthnP256 } from 'tempo.ts/viem'
|
|
3
4
|
import {
|
|
4
5
|
createClient,
|
|
@@ -240,8 +241,12 @@ export function webAuthn(options: webAuthn.Parameters = {}) {
|
|
|
240
241
|
typeof parameters.capabilities?.createAccount === 'boolean'
|
|
241
242
|
? {}
|
|
242
243
|
: parameters.capabilities?.createAccount
|
|
244
|
+
const challenge = await options.createOptions?.getChallenge?.()
|
|
243
245
|
credential = await WebAuthnP256.createCredential({
|
|
244
246
|
...(options.createOptions ?? {}),
|
|
247
|
+
challenge: challenge
|
|
248
|
+
? new Uint8Array(Bytes.fromHex(challenge))
|
|
249
|
+
: undefined,
|
|
245
250
|
label:
|
|
246
251
|
createOptions.label ??
|
|
247
252
|
options.createOptions?.label ??
|
|
@@ -265,11 +270,19 @@ export function webAuthn(options: webAuthn.Parameters = {}) {
|
|
|
265
270
|
...(options.getOptions ?? {}),
|
|
266
271
|
credentialId: lastActiveCredential?.id,
|
|
267
272
|
async getPublicKey(credential) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
{
|
|
274
|
+
const publicKey =
|
|
275
|
+
await options.getOptions?.getPublicKey?.(credential)
|
|
276
|
+
if (publicKey) return publicKey
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
{
|
|
280
|
+
const publicKey = await config.storage?.getItem(
|
|
281
|
+
`webAuthn.${credential.id}.publicKey`,
|
|
282
|
+
)
|
|
283
|
+
if (!publicKey) throw new Error('publicKey not found')
|
|
284
|
+
return publicKey as Hex
|
|
285
|
+
}
|
|
273
286
|
},
|
|
274
287
|
})
|
|
275
288
|
}
|
|
@@ -354,14 +367,24 @@ export function webAuthn(options: webAuthn.Parameters = {}) {
|
|
|
354
367
|
|
|
355
368
|
export declare namespace webAuthn {
|
|
356
369
|
export type Parameters = {
|
|
370
|
+
/** Options for WebAuthn registration. */
|
|
357
371
|
createOptions?:
|
|
358
|
-
| Pick<
|
|
372
|
+
| (Pick<
|
|
359
373
|
WebAuthnP256.createCredential.Parameters,
|
|
360
374
|
'createFn' | 'label' | 'rpId' | 'userId' | 'timeout'
|
|
361
|
-
>
|
|
375
|
+
> & {
|
|
376
|
+
/** Function to fetch a challenge to sign over at registration. */
|
|
377
|
+
getChallenge?: (() => Promise<Hex>) | undefined
|
|
378
|
+
})
|
|
362
379
|
| undefined
|
|
380
|
+
/** Options for WebAuthn authentication. */
|
|
363
381
|
getOptions?:
|
|
364
|
-
| Pick<WebAuthnP256.getCredential.Parameters, 'getFn' | 'rpId'>
|
|
382
|
+
| (Pick<WebAuthnP256.getCredential.Parameters, 'getFn' | 'rpId'> & {
|
|
383
|
+
/** Function to fetch the public key for a credential. */
|
|
384
|
+
getPublicKey?:
|
|
385
|
+
| WebAuthnP256.getCredential.Parameters['getPublicKey']
|
|
386
|
+
| undefined
|
|
387
|
+
})
|
|
365
388
|
| undefined
|
|
366
389
|
}
|
|
367
390
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { UseMutationResult } from '@tanstack/react-query'
|
|
2
|
+
import type { Config, ResolvedRegister } from '@wagmi/core'
|
|
3
|
+
import type { BaseErrorType } from 'viem'
|
|
4
|
+
import { useConfig } from 'wagmi'
|
|
5
|
+
import type { ConfigParameter } from 'wagmi/internal'
|
|
6
|
+
import { type UseMutationParameters, useMutation } from 'wagmi/query'
|
|
7
|
+
|
|
8
|
+
import { fund } from '../Actions/faucet.js'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Hook for funding an account with an initial amount of set token(s)
|
|
12
|
+
* on Tempo's testnet.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { Hooks } from 'tempo.ts/wagmi'
|
|
17
|
+
*
|
|
18
|
+
* function App() {
|
|
19
|
+
* const { mutate, isPending } = Hooks.faucet.useFund()
|
|
20
|
+
*
|
|
21
|
+
* return (
|
|
22
|
+
* <button
|
|
23
|
+
* onClick={() => mutate({ account: '0xdeadbeef...' })}
|
|
24
|
+
* disabled={isPending}
|
|
25
|
+
* >
|
|
26
|
+
* Fund Account
|
|
27
|
+
* </button>
|
|
28
|
+
* )
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param parameters - Parameters.
|
|
33
|
+
* @returns Mutation result.
|
|
34
|
+
*/
|
|
35
|
+
export function useFund<
|
|
36
|
+
config extends Config = ResolvedRegister['config'],
|
|
37
|
+
context = unknown,
|
|
38
|
+
>(
|
|
39
|
+
parameters: useFund.Parameters<config, context> = {},
|
|
40
|
+
): useFund.ReturnType<config, context> {
|
|
41
|
+
const { mutation } = parameters
|
|
42
|
+
const config = useConfig(parameters)
|
|
43
|
+
return useMutation({
|
|
44
|
+
...mutation,
|
|
45
|
+
async mutationFn(variables) {
|
|
46
|
+
return fund(config, variables)
|
|
47
|
+
},
|
|
48
|
+
mutationKey: ['fund'],
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare namespace useFund {
|
|
53
|
+
type Parameters<
|
|
54
|
+
config extends Config = Config,
|
|
55
|
+
context = unknown,
|
|
56
|
+
> = ConfigParameter<config> & {
|
|
57
|
+
mutation?:
|
|
58
|
+
| UseMutationParameters<
|
|
59
|
+
fund.ReturnValue,
|
|
60
|
+
BaseErrorType,
|
|
61
|
+
fund.Parameters<config>,
|
|
62
|
+
context
|
|
63
|
+
>
|
|
64
|
+
| undefined
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
type ReturnType<
|
|
68
|
+
config extends Config = Config,
|
|
69
|
+
context = unknown,
|
|
70
|
+
> = UseMutationResult<
|
|
71
|
+
fund.ReturnValue,
|
|
72
|
+
BaseErrorType,
|
|
73
|
+
fund.Parameters<config>,
|
|
74
|
+
context
|
|
75
|
+
>
|
|
76
|
+
}
|