feat: publishing infernet-container-starter v0.2.0
This commit is contained in:
45
projects/prompt-to-nft/ui/src/util/chain.ts
Normal file
45
projects/prompt-to-nft/ui/src/util/chain.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import { type Chain } from "viem";
|
||||
|
||||
export const anvilNode = {
|
||||
id: 31337,
|
||||
name: "Anvil Node",
|
||||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
||||
rpcUrls: {
|
||||
default: { http: ["http://localhost:8545"] },
|
||||
},
|
||||
blockExplorers: {
|
||||
default: { name: "Etherscan", url: "https://etherscan.io" },
|
||||
},
|
||||
contracts: {
|
||||
ensRegistry: {
|
||||
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
|
||||
},
|
||||
ensUniversalResolver: {
|
||||
address: "0xE4Acdd618deED4e6d2f03b9bf62dc6118FC9A4da",
|
||||
blockCreated: 16773775,
|
||||
},
|
||||
multicall3: {
|
||||
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
||||
blockCreated: 14353601,
|
||||
},
|
||||
},
|
||||
} as const satisfies Chain;
|
||||
|
||||
export const addNetwork = () => {
|
||||
window.ethereum.request({
|
||||
method: "wallet_addEthereumChain",
|
||||
params: [
|
||||
{
|
||||
chainId: `0x${(31337).toString(16)}`,
|
||||
rpcUrls: ["http://184.105.4.216:8545"],
|
||||
chainName: "Anvil Node",
|
||||
nativeCurrency: {
|
||||
name: "Ethereum",
|
||||
symbol: "ETH",
|
||||
decimals: 18,
|
||||
},
|
||||
blockExplorerUrls: ["https://etherscan.io/"],
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
26
projects/prompt-to-nft/ui/src/util/config.ts
Normal file
26
projects/prompt-to-nft/ui/src/util/config.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import "@rainbow-me/rainbowkit/styles.css";
|
||||
import { connectorsForWallets, getDefaultConfig } from "@rainbow-me/rainbowkit";
|
||||
import { anvilNode } from "@/util/chain";
|
||||
import { metaMaskWallet } from "@rainbow-me/rainbowkit/wallets";
|
||||
import { createConfig, http } from "wagmi";
|
||||
|
||||
const connectors = connectorsForWallets(
|
||||
[
|
||||
{
|
||||
groupName: "Recommended",
|
||||
wallets: [metaMaskWallet],
|
||||
},
|
||||
],
|
||||
{
|
||||
appName: "My RainbowKit App",
|
||||
projectId: "YOUR_PROJECT_ID",
|
||||
},
|
||||
);
|
||||
|
||||
export const config = createConfig({
|
||||
connectors,
|
||||
chains: [anvilNode],
|
||||
transports: {
|
||||
[anvilNode.id]: http(),
|
||||
},
|
||||
});
|
4
projects/prompt-to-nft/ui/src/util/constants.ts
Normal file
4
projects/prompt-to-nft/ui/src/util/constants.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import {Address} from "viem";
|
||||
|
||||
export const NFT_ADDRESS: Address =
|
||||
"0x663F3ad617193148711d28f5334eE4Ed07016602";
|
454
projects/prompt-to-nft/ui/src/util/nftAbi.ts
Normal file
454
projects/prompt-to-nft/ui/src/util/nftAbi.ts
Normal file
@ -0,0 +1,454 @@
|
||||
export const nftAbi = <const>[
|
||||
{
|
||||
type: "constructor",
|
||||
inputs: [
|
||||
{
|
||||
name: "coordinator",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "approve",
|
||||
inputs: [
|
||||
{
|
||||
name: "spender",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "arweaveHashes",
|
||||
inputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "string",
|
||||
internalType: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "balanceOf",
|
||||
inputs: [
|
||||
{
|
||||
name: "owner",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "counter",
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "getApproved",
|
||||
inputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "isApprovedForAll",
|
||||
inputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "bool",
|
||||
internalType: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "mint",
|
||||
inputs: [
|
||||
{
|
||||
name: "prompt",
|
||||
type: "string",
|
||||
internalType: "string",
|
||||
},
|
||||
{
|
||||
name: "to",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "name",
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "string",
|
||||
internalType: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "nftCollection",
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "uint256[]",
|
||||
internalType: "uint256[]",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "ownerOf",
|
||||
inputs: [
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "owner",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "rawReceiveCompute",
|
||||
inputs: [
|
||||
{
|
||||
name: "subscriptionId",
|
||||
type: "uint32",
|
||||
internalType: "uint32",
|
||||
},
|
||||
{
|
||||
name: "interval",
|
||||
type: "uint32",
|
||||
internalType: "uint32",
|
||||
},
|
||||
{
|
||||
name: "redundancy",
|
||||
type: "uint16",
|
||||
internalType: "uint16",
|
||||
},
|
||||
{
|
||||
name: "node",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "input",
|
||||
type: "bytes",
|
||||
internalType: "bytes",
|
||||
},
|
||||
{
|
||||
name: "output",
|
||||
type: "bytes",
|
||||
internalType: "bytes",
|
||||
},
|
||||
{
|
||||
name: "proof",
|
||||
type: "bytes",
|
||||
internalType: "bytes",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "safeTransferFrom",
|
||||
inputs: [
|
||||
{
|
||||
name: "from",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "to",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "safeTransferFrom",
|
||||
inputs: [
|
||||
{
|
||||
name: "from",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "to",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
{
|
||||
name: "data",
|
||||
type: "bytes",
|
||||
internalType: "bytes",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "setApprovalForAll",
|
||||
inputs: [
|
||||
{
|
||||
name: "operator",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "approved",
|
||||
type: "bool",
|
||||
internalType: "bool",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "supportsInterface",
|
||||
inputs: [
|
||||
{
|
||||
name: "interfaceId",
|
||||
type: "bytes4",
|
||||
internalType: "bytes4",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "bool",
|
||||
internalType: "bool",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "symbol",
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "string",
|
||||
internalType: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "tokenURI",
|
||||
inputs: [
|
||||
{
|
||||
name: "tokenId",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
name: "",
|
||||
type: "string",
|
||||
internalType: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
},
|
||||
{
|
||||
type: "function",
|
||||
name: "transferFrom",
|
||||
inputs: [
|
||||
{
|
||||
name: "from",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "to",
|
||||
type: "address",
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
},
|
||||
{
|
||||
type: "event",
|
||||
name: "Approval",
|
||||
inputs: [
|
||||
{
|
||||
name: "owner",
|
||||
type: "address",
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "spender",
|
||||
type: "address",
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
anonymous: false,
|
||||
},
|
||||
{
|
||||
type: "event",
|
||||
name: "ApprovalForAll",
|
||||
inputs: [
|
||||
{
|
||||
name: "owner",
|
||||
type: "address",
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "operator",
|
||||
type: "address",
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "approved",
|
||||
type: "bool",
|
||||
indexed: false,
|
||||
internalType: "bool",
|
||||
},
|
||||
],
|
||||
anonymous: false,
|
||||
},
|
||||
{
|
||||
type: "event",
|
||||
name: "Transfer",
|
||||
inputs: [
|
||||
{
|
||||
name: "from",
|
||||
type: "address",
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "to",
|
||||
type: "address",
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
},
|
||||
{
|
||||
name: "id",
|
||||
type: "uint256",
|
||||
indexed: true,
|
||||
internalType: "uint256",
|
||||
},
|
||||
],
|
||||
anonymous: false,
|
||||
},
|
||||
{
|
||||
type: "error",
|
||||
name: "NotCoordinator",
|
||||
inputs: [],
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user