Skip to content

Commit 5a60338

Browse files
authored
Merge branch 'main' into integration-gelato
2 parents 1f3ccad + 2b18795 commit 5a60338

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+906
-262
lines changed

docs/build/getting-started/fcl-quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ However:
285285

286286
### Integrating Authentication and Building the Complete UI
287287

288-
Finally, integrate the query, mutation, and transaction status hooks with authentication using `useCurrentFlowUser`. Combine all parts to build the complete page.
288+
Finally, integrate the query, mutation, and transaction status hooks with authentication using `useFlowCurrentUser`. Combine all parts to build the complete page.
289289

290290
```tsx
291291
"use client";
@@ -295,11 +295,11 @@ import {
295295
useFlowQuery,
296296
useFlowMutate,
297297
useFlowTransactionStatus,
298-
useCurrentFlowUser,
298+
useFlowCurrentUser,
299299
} from "@onflow/kit";
300300

301301
export default function Home() {
302-
const { user, authenticate, unauthenticate } = useCurrentFlowUser();
302+
const { user, authenticate, unauthenticate } = useFlowCurrentUser();
303303

304304
const { data, isLoading, error, refetch } = useFlowQuery({
305305
cadence: `
@@ -409,7 +409,7 @@ In this complete page:
409409
- **Step 1** queries the counter value.
410410
- **Step 2** sends a transaction to increment the counter and stores the transaction ID.
411411
- **Step 3** subscribes to transaction status updates using the stored transaction ID and uses a `useEffect` hook to automatically refetch the updated count when the transaction is sealed (status code 4).
412-
- **Step 4** integrates authentication via `useCurrentFlowUser` and combines all the pieces into a single user interface.
412+
- **Step 4** integrates authentication via `useFlowCurrentUser` and combines all the pieces into a single user interface.
413413

414414
:::tip
415415

@@ -451,7 +451,7 @@ Then visit [http://localhost:3000](http://localhost:3000) in your browser. You s
451451
By following these steps, you've built a simple Next.js dApp that interacts with a Flow smart contract using [**@onflow/kit**]. In this guide you learned how to:
452452

453453
- Wrap your application in a `FlowProvider` to configure blockchain connectivity.
454-
- Use kit hooks such as `useFlowQuery`, `useFlowMutate`, `useFlowTransactionStatus`, and `useCurrentFlowUser` to manage authentication, query on-chain data, submit transactions, and monitor their status.
454+
- Use kit hooks such as `useFlowQuery`, `useFlowMutate`, `useFlowTransactionStatus`, and `useFlowCurrentUser` to manage authentication, query on-chain data, submit transactions, and monitor their status.
455455
- Integrate with the local Flow emulator and Dev Wallet for a fully functional development setup.
456456

457457
For additional details and advanced usage, refer to the [@onflow/kit documentation] and other Flow developer resources.

docs/ecosystem/projects.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,5 +249,19 @@ Explore an array of exciting, grassroots initiatives, and projects that thrive w
249249
githubLink: 'https://github.com/doodles/flooks',
250250
},
251251
},
252+
{
253+
type: 'link',
254+
label: 'Stake & Eggs',
255+
href: 'https://stakeandeggs.wtf/',
256+
description:
257+
'A comprehensive Flow staking dashboard to track performance, estimate rewards, and simulate earnings.',
258+
customProps: {
259+
icon: '',
260+
author: {
261+
name: 'Chase Fleming',
262+
profileImage: 'https://avatars.githubusercontent.com/u/1666730?v=4',
263+
},
264+
},
265+
},
252266
]}
253267
/>

docs/evm/guides/index.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Flow EVM Guides
3+
description: Tutorials and guides for building on Flow EVM, integrating with popular Ethereum tools, and leveraging Flow's unique features.
4+
sidebar_position: 1
5+
keywords:
6+
- Flow EVM
7+
- guides
8+
- tutorials
9+
- Ethereum
10+
- Solidity
11+
- Foundry
12+
- Hardhat
13+
- Remix
14+
- wagmi
15+
- RainbowKit
16+
- web3.js
17+
- ethers.js
18+
---
19+
20+
# EVM Guides
21+
22+
This section contains guides and tutorials for building on [Flow EVM], integrating with popular Ethereum tools, and leveraging Flow's unique features.
23+
24+
## Guides
25+
26+
- **[Integrating MetaMask]** - How to connect MetaMask to Flow EVM and interact with your dapps.
27+
- **[Using ethers.js]** - Learn to use ethers.js with Flow EVM for contract interaction and account management.
28+
- **[Using web3.js]** - Use web3.js to build and interact with Flow EVM smart contracts.
29+
- **[Using wagmi]** - Integrate wagmi for React-based EVM dapps on Flow.
30+
- **[Using RainbowKit]** - Add wallet connection and onboarding with RainbowKit in your Flow EVM dapp.
31+
- **[Using Foundry]** - Develop, test, and deploy smart contracts on Flow EVM using Foundry.
32+
- **[Using Hardhat]** - Build, test, and deploy Solidity contracts on Flow EVM with Hardhat.
33+
- **[Using Remix]** - Write, deploy, and interact with contracts on Flow EVM using the Remix IDE.
34+
35+
## More Coming Soon
36+
37+
Stay tuned - more guides and advanced tutorials are on the way!
38+
39+
[Flow EVM]: ../about.md
40+
[Integrating MetaMask]: ./integrating-metamask.mdx
41+
[Using ethers.js]: ./ethers.md
42+
[Using web3.js]: ./web3-js.md
43+
[Using wagmi]: ./wagmi.md
44+
[Using RainbowKit]: ./rainbowkit.md
45+
[Using Foundry]: ./foundry.md
46+
[Using Hardhat]: ./hardhat.md
47+
[Using Remix]: ./remix.md

docs/evm/quickstart.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ export default ClickerModule;
251251

252252
Visit the [Flow Faucet] and follow the instructions to add testnet funds. Compared to other networks, the [Flow Faucet] grants a vast amount of tokens - enough gas for millions of transactions.
253253

254+
:::warning
255+
256+
EVM accounts created by the [Flow Wallet] are [Cadence-Owned Accounts], or COAs - **Not** EOAs. COAs have many advantages over EOAs, but they are generated differently, which means they don't have a key that's compatible with hardhat.
257+
258+
Use your [MetaMask] or similar EOA account to deploy contracts on Flow EVM.
259+
260+
:::
261+
254262
### Deploy the Contract
255263

256264
Deploy the contract with:
@@ -354,3 +362,4 @@ Ready to unlock the full potential of Flow EVM? Start with our [Batched Transact
354362
[Cross-VM Apps]: ../tutorials/cross-vm-apps/introduction.md
355363
[Batched Transactions]: ../tutorials/cross-vm-apps/introduction.md
356364
[OpenZeppelin Contracts]: https://www.openzeppelin.com/contracts
365+
[Cadence-Owned Accounts]: ./accounts.md#cadence-owned-accounts

docs/tools/clients/fcl-js/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ import * as fcl from "@onflow/fcl";
7878

7979
const result = await fcl.query({
8080
cadence: `
81-
pub fun main(a: Int, b: Int, addr: Address): Int {
81+
access(all)
82+
fun main(a: Int, b: Int, addr: Address): Int {
8283
log(addr)
8384
return a + b
8485
}
@@ -98,7 +99,7 @@ import * as fcl from "@onflow/fcl";
9899
const txId = await fcl.mutate({
99100
cadence: `
100101
import Profile from 0xba1132bc08f82fe2
101-
102+
102103
transaction(name: String) {
103104
prepare(account: AuthAccount) {
104105
account.borrow<&{Profile.Owner}>(from: Profile.privatePath)!.setName(name)
@@ -127,7 +128,7 @@ FCL JS supports TypeScript. If you need to import specific types, you can do so
127128
```typescript
128129
import {CurrentUser} from "@onflow/typedefs"
129130

130-
const newUser: CurrentUser = {
131+
const newUser: CurrentUser = {
131132
addr: null,
132133
cid: null,
133134
expiresAt: null,

docs/tools/flow-cli/flow.json/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Flow configuration (`flow.json`) file will contain the following properties:
2525
"accounts": {
2626
"emulator-account": {
2727
"address": "f8d6e0586b0a20c7",
28-
"key": "ae1b44c0f5e8f6992ef2348898a35e50a8b0b9684000da8b1dade1b3bcd6ebee",
28+
"key": "ae1b44c0f5e8f6992ef2348898a35e50a8b0b9684000da8b1dade1b3bcd6ebee"
2929
}
3030
},
3131
"deployments": {},
@@ -80,7 +80,7 @@ We'll walk through each property one by one.
8080
},
8181
"emulator-account": {
8282
"address": "f8d6e0586b0a20c7",
83-
"key": "2eae2f31cb5b756151fa11d82949c634b8f28796a711d7eb1e52cc301ed11111",
83+
"key": "2eae2f31cb5b756151fa11d82949c634b8f28796a711d7eb1e52cc301ed11111"
8484
}
8585
},
8686

docs/tools/kit/index.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 1
1010

1111
## 🔌 Included React Hooks
1212

13-
- [`useCurrentFlowUser`](#usecurrentflowuser) – Authenticate and manage the current Flow user
13+
- [`useFlowCurrentUser`](#useflowcurrentuser) – Authenticate and manage the current Flow user
1414
- [`useFlowAccount`](#useflowaccount) – Fetch Flow account details by address
1515
- [`useFlowBlock`](#useflowblock) – Query latest or specific Flow blocks
1616
- [`useFlowChainId`](#useflowchainid) – Retrieve the current Flow chain ID
@@ -20,6 +20,7 @@ sidebar_position: 1
2020
- [`useFlowQueryRaw`](#useflowqueryraw) – Execute Cadence scripts with optional arguments returning non-decoded data
2121
- [`useFlowMutate`](#useflowmutate) – Send transactions to the Flow blockchain
2222
- [`useFlowRevertibleRandom`](#useflowrevertiblerandom) – Generate pseudorandom values tied to block height
23+
- [`useFlowTransaction`](#useflowtransaction) – Fetch a Flow transaction by ID
2324
- [`useFlowTransactionStatus`](#useflowtransactionstatus) – Track transaction status updates
2425

2526
### Cross-VM (Flow EVM ↔ Cadence) Hooks
@@ -82,10 +83,10 @@ Many of these hooks are built using [`@tanstack/react-query`](https://tanstack.c
8283

8384
:::
8485

85-
### `useCurrentFlowUser`
86+
### `useFlowCurrentUser`
8687

8788
```tsx
88-
import { useCurrentFlowUser } from "@onflow/kit"
89+
import { useFlowCurrentUser } from "@onflow/kit"
8990
```
9091

9192
#### Returns:
@@ -96,7 +97,7 @@ import { useCurrentFlowUser } from "@onflow/kit"
9697

9798
```tsx
9899
function AuthComponent() {
99-
const { user, authenticate, unauthenticate } = useCurrentFlowUser()
100+
const { user, authenticate, unauthenticate } = useFlowCurrentUser()
100101

101102
return (
102103
<div>
@@ -470,6 +471,45 @@ function RandomValues() {
470471

471472
---
472473

474+
### `useFlowTransaction`
475+
476+
```tsx
477+
import { useFlowTransaction } from "@onflow/kit"
478+
```
479+
480+
Fetches a Flow transaction by ID and returns the decoded transaction object.
481+
482+
#### Parameters:
483+
484+
* `txId?: string` – The Flow transaction ID to fetch.
485+
* `query?: Omit<UseQueryOptions<Transaction | null, Error>, "queryKey" | "queryFn">` – Optional TanStack Query options like `staleTime`, `enabled`, etc.
486+
487+
#### Returns: `UseQueryResult<Transaction | null, Error>`
488+
489+
```tsx
490+
function TransactionDetails({ txId }: { txId: string }) {
491+
const { data: transaction, isLoading, error, refetch } = useFlowTransaction({
492+
txId,
493+
query: { staleTime: 10000 },
494+
})
495+
496+
if (isLoading) return <p>Loading transaction...</p>
497+
if (error) return <p>Error fetching transaction: {error.message}</p>
498+
if (!transaction) return <p>No transaction data.</p>
499+
500+
return (
501+
<div>
502+
<h2>Transaction ID: {transaction.id}</h2>
503+
<p>Gas Limit: {transaction.gasLimit}</p>
504+
<pre>Arguments: {JSON.stringify(transaction.arguments, null, 2)}</pre>
505+
<button onClick={refetch}>Refetch</button>
506+
</div>
507+
)
508+
}
509+
```
510+
511+
---
512+
473513
### `useFlowTransactionStatus`
474514

475515
```tsx

docs/tutorials/cross-vm-apps/add-to-wagmi.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ For a complete reference implementation, check out the [FCL + RainbowKit + wagmi
503503
[create an issue]: https://github.com/onflow/docs/issues/new/choose
504504
[Cadence]: https://cadence-lang.org
505505
[Solidity]: https://soliditylang.org/
506+
[native VRF]: ../../tutorials/native-vrf/vrf-in-solidity.md
506507
[structure and call EVM transactions]: ./batched-evm-transactions.md
507508
[FLIP 316]: https://github.com/onflow/flips/pull/317
508509
[Flow Client Library (FCL)]: ../../tools/clients/fcl-js
@@ -516,4 +517,4 @@ For a complete reference implementation, check out the [FCL + RainbowKit + wagmi
516517
[Testnet Cadence Flowscan]: https://testnet.flowscan.io
517518
[Cadence Owned Accounts]: ../../build/basics/accounts.md
518519
[Testnet EVM Flowscan]: https://evm-testnet.flowscan.io
519-
[pre-built utility from the `@onflow/kit`]: ../../tools/kit/index.md#usecrossvmbatchtransaction
520+
[pre-built utility from the `@onflow/kit`]: ../../tools/kit/index.md#usecrossvmbatchtransaction

docs/tutorials/flowtobooth/image-gallery.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ const flowWallet = ({ projectId }: MyWalletOptions): Wallet => ({
393393
qrCode: 'https://link.lilico.app',
394394
},
395395
mobile: {
396-
getUri: (uri: string) => `https://fcw-link.lilico.app/wc?uri=${encodeURIComponent(uri)}`,
396+
getUri: (uri: string) =>
397+
`https://fcw-link.lilico.app/wc?uri=${encodeURIComponent(uri)}`,
397398
},
398399
qrCode: {
399400
getUri: (uri: string) => uri,

docs/tutorials/native-vrf/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This series covers how to leverage Flow's native VRF (Verifiable Random Function
2727
- **[Secure Randomness with Commit-Reveal in Cadence]** - Learn how to implement secure randomness in Cadence using Flow's commit-reveal scheme.
2828
- **[VRF (Randomness) in Solidity]** - Learn how to use Flow's native VRF capabilities in Solidity.
2929
- **[Deploy a Solidity Contract Using Cadence]** - Discover how to deploy and interact with Solidity contracts on Flow EVM using Cadence.
30+
- **[VRF (Randomness) in Solidity]** - How to access Flow's native verifiable randomness from Solidity smart contracts on Flow EVM, including code examples and security considerations.
3031

3132
## More Coming Soon
3233

@@ -35,3 +36,4 @@ Stay tuned—more tutorials and advanced guides are on the way!
3536
[Secure Randomness with Commit-Reveal in Cadence]: ./commit-reveal-cadence.md
3637
[VRF (Randomness) in Solidity]: ./vrf-in-solidity.md
3738
[Deploy a Solidity Contract Using Cadence]: ./deploy-solidity-contract.md
39+
[VRF (Randomness) in Solidity]: ./vrf-in-solidity.md

0 commit comments

Comments
 (0)