Snippets

Browse an entire list of code examples for you to copy.

To add your own Snippet, make a Pull Request here.

Snippet

Bulk Transfer NFTs in Cadence

Learn how to bulk transfer NFTs to different addresses in Cadence using the example Avataaars contract.

Habilidades que aprenderás
cadence
Snippet

Burn an NFT in Cadence

Learn how to burn an NFT in Cadence using the example Avataaars contract.

Habilidades que aprenderás
cadence
Snippet

Create an Account in Cadence

Learn how to create an account directly in Cadence.

Habilidades que aprenderás
cadence
Snippet

Deploy a Contract in Cadence

Learn how to deploy a smart contract directly in Cadence.

Habilidades que aprenderás
cadence
Snippet

Mint an NFT in Cadence

Learn how to mint an NFT in Cadence using the example Avataaars contract.

Habilidades que aprenderás
cadence
Snippet

Random Number in Cadence

Generate a random number bewteen min & max in Cadence using the built-in revertibleRandom function.

Habilidades que aprenderás
cadence
Snippet

Time in Cadence

Learn how to get and calculate time in Cadence.

Habilidades que aprenderás
cadence
Snippet

Transfer an NFT in Cadence

Learn how to transfer an NFT in Cadence using the example Avataaars contract.

Habilidades que aprenderás
cadence
Snippet

Dynamically Import a Contract

Learn how to import a Cadence contract at run-time in a script or transaction.

Habilidades que aprenderás
cadence
Snippet

Proving Authentication with FCL (Account Proof)

Learn how to verify a users authentication ("account proof") using FCL on testnet and mainnet.

Habilidades que aprenderás
dapp
javascript
Snippet

Dapper Wallet-Only Authentication using FCL

Learn how to log in, log out, and access user data using only Dapper Wallet.

Habilidades que aprenderás
dapp
javascript
Snippet

Authenticate using FCL

Learn how to log in, log out, and access user data.

Habilidades que aprenderás
dapp
javascript
Snippet

Configure WalletConnect w/ FCL

Configure WalletConnect and mobile wallets with FCL.

Habilidades que aprenderás
dapp
javascript
Snippet

Create an Account with FCL

Learn how to take a public key and create an account with it using FCL.

Habilidades que aprenderás
dapp
javascript
Snippet

Execute a Transaction w/ FCL (Custodial Wallet)

Learn how to execute a basic transaction with FCL using a custodial wallet (Blocto, Lilico, etc).

Habilidades que aprenderás
dapp
javascript
Snippet

Execute a Transaction w/ FCL (Non-Custodial Wallet)

Learn how to execute a basic transaction with FCL using a non-custodial wallet (aka with a private key).

Habilidades que aprenderás
dapp
javascript
Snippet

Pass a Dictionary Arg to Cadence in FCL

Learn how to pass a dictionary argument to a Cadence script or transaction in FCL.

Habilidades que aprenderás
javascript
Snippet

Pass a Storage/Public Path Arg to Cadence in FCL

Learn how to pass a storage/public path arg to a Cadence script or transaction in FCL.

Habilidades que aprenderás
javascript
Snippet

Pass a Struct Arg to Cadence in FCL

Learn how to pass a struct argument to a Cadence script or transaction in FCL.

Habilidades que aprenderás
javascript
Snippet

Execute a Script with FCL

Learn how to execute a basic script using FCL.

Habilidades que aprenderás
dapp
javascript
Snippet

Sign a Message with FCL

Sign a user message with FCL on the frontend.

Habilidades que aprenderás
dapp
javascript
Snippet

Fetch Historical Blocks

Learn how to fetch blocks with the Historical API.

Habilidades que aprenderás
dapp
javascript
Snippet

Fetch Historical Events

Learn how to fetch events with the Historical API.

Habilidades que aprenderás
dapp
javascript
Snippet

Fetch Historical Transaction Data

Learn how to fetch transaction data with the Historical API.

Habilidades que aprenderás
dapp
javascript
Snippet

Cadence Setup using Unity SDK

Learn how to setup cadence using Flow Unity SDK.

Habilidades que aprenderás
dapp
unity
Snippet

Execute Scripts using Unity SDK

Learn how to execute scripts using Flow Unity SDK.

Habilidades que aprenderás
dapp
unity
Snippet

Setup and Authenticate using Unity SDK

Learn how to setup and authenticate using Flow Unity SDK.

Habilidades que aprenderás
dapp
unity
Snippet

Send Transactions using Unity SDK

Learn how to send transactions using Flow Unity SDK.

Habilidades que aprenderás
dapp
unity
Snippet

Listen for Events in FCL

Poll for events happening on chain using FCL.

Habilidades que aprenderás
dapp
javascript
Snippet

Get all User NBATopShot Moments

Get all the moments a user has on NBATopShot.

Habilidades que aprenderás
cadence
Snippet

Buy an NFT in Cadence

Buy an NFT listed on NFTStorefrontV2 via NFT Catalog.

Habilidades que aprenderás
cadence
Snippet

Sign & Verify a User Message On Chain

Sign a user message with FCL and verify it on chain in Cadence.

Habilidades que aprenderás
dapp
javascript
cadence