This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| flow project deploy --update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as fcl from "@onflow/fcl"; | |
| import * as t from "@onflow/types" | |
| import './App.css'; | |
| import { useEffect, useState } from "react"; | |
| fcl | |
| .config() | |
| // Point App at Emulator REST API | |
| .put("accessNode.api", "http://localhost:8888") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const updateProfile = async () => { | |
| const txId = await fcl.send( | |
| [ | |
| fcl.transaction` | |
| import Profile from 0xProfile | |
| transaction(newFirstName: String, newLastName: String, newEmail: String) { | |
| prepare(signer: AuthAccount) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getProfile = async () => { | |
| const [firstName, lastName, email] = await fcl.send([ | |
| fcl.script` | |
| import Profile from 0xf8d6e0586b0a20c7 | |
| pub fun main(): [String] { | |
| return [Profile.firstName, Profile.lastName, Profile.email] | |
| } | |
| ` | |
| ]).then(fcl.decode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| flow emulator | |
| npm run dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| … | |
| "contracts": { | |
| "Profile": { | |
| "source": "./cadence/contracts/Profile.cdc" | |
| "aliases": { | |
| "emulator": "0xee82856bf20e2aa6" | |
| } | |
| }, | |
| … |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm i @onflow/fcl @onflow/types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npx create-react-app my-first-dapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as fcl from "@onflow/fcl"; | |
| import './App.css'; | |
| import { useEffect, useState } from "react"; | |
| fcl | |
| .config() | |
| // Point App at Emulator REST API | |
| .put("accessNode.api", "http://localhost:8888") | |
| // Point FCL at dev-wallet (default port) |