This file contains 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 {PrivyClient} from '@privy-io/privy-node'; | |
const PRIVY_API_KEY = '<retrieved from the Privy console>'; | |
const PRIVY_API_SECRET = '<retrieved from the Privy console>'; | |
export default async function quickstart() { | |
const client = new PrivyClient(PRIVY_API_KEY, PRIVY_API_SECRET); | |
await client.put('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B', 'first-name', 'Vitalik'); |
This file contains 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 type { ReservoirWallet } from '@reservoir0x/reservoir-sdk'; | |
import { GelatoRelay } from "@gelatonetwork/relay-sdk"; | |
import { arrayify } from 'ethers/lib/utils'; | |
import type { Web3Provider } from '@ethersproject/providers'; | |
import type { TypedDataSigner } from '@ethersproject/abstract-signer/lib/index'; | |
const sleep = (time: number) => new Promise((resolve) => setTimeout(resolve, time)); | |
const getTaskStatus = async (taskId: string) => { | |
let taskState; |
This file contains 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
// These values are for Goerli | |
const CHAIN_ID = '0x5'; | |
const USDC_ABI = 'import USDC ABI as JSON'; | |
const USDC_ADDRESS = '0x07865c6e87b9f70255377e024ace6630c1eaa37f'; | |
const SEAPORT_CONDUIT_ADDRESS = '0x1E0049783F008A0085193E00003D00cd54003c71'; | |
const PERMIT_DOMAIN = { | |
"name": "USD Coin", | |
"version": "2", | |
"chainId": CHAIN_ID, |
This file contains 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 { getClient, type ReservoirWallet } from '@reservoir0x/reservoir-sdk'; | |
import { GelatoRelay } from "@gelatonetwork/relay-sdk"; | |
import { ConnectedWallet } from '@privy-io/react-auth'; | |
import { ethers } from 'ethers'; | |
import { getTaskStatus } from './poll'; | |
import USDC_ABI from './usdcABI.json'; | |
import {ethers} from 'ethers'; | |
const GELATO_API_KEY = process.env.NEXT_PUBLIC_GELATO_API_KEY || ""; |
This file contains 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 type { ReservoirWallet } from '@reservoir0x/reservoir-sdk'; | |
import { GelatoRelay } from '@gelatonetwork/relay-sdk'; | |
import type { Signer } from 'ethers/lib/ethers'; | |
import { arrayify } from 'ethers/lib/utils'; | |
import type { TypedDataSigner } from '@ethersproject/abstract-signer/lib/index'; | |
import { getTaskStatus } from './poll'; | |
const sleep = (time: number) => new Promise((resolve) => setTimeout(resolve, time)); | |
// Helper function to poll the status of a Gelato relay task given the taskId |