From b6456f2b5ee32c69a4b2a835858bd571f5c36d73 Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Wed, 20 Mar 2024 09:41:36 +0000 Subject: [PATCH] ci: remove unused --- .gitmodules | 4 - build/esbuild-build.ts | 11 - lib/chainlist | 1 - package.json | 2 - static/scripts/onboarding/abis/index.ts | 1 - .../scripts/onboarding/abis/nftRewardAbi.ts | 992 ------------------ static/scripts/onboarding/abis/permit2Abi.ts | 353 ------- static/scripts/onboarding/constants.ts | 28 - yarn.lock | 35 +- 9 files changed, 1 insertion(+), 1426 deletions(-) delete mode 100644 .gitmodules delete mode 160000 lib/chainlist delete mode 100644 static/scripts/onboarding/abis/nftRewardAbi.ts delete mode 100644 static/scripts/onboarding/abis/permit2Abi.ts diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 9b3aa47..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "lib/chainlist"] - path = lib/chainlist - url = https://github.com/DefiLlama/chainlist.git - branch = main diff --git a/build/esbuild-build.ts b/build/esbuild-build.ts index 6ca183f..c88a5ff 100644 --- a/build/esbuild-build.ts +++ b/build/esbuild-build.ts @@ -1,21 +1,11 @@ import { execSync } from "child_process"; import { config } from "dotenv"; import esbuild from "esbuild"; -import extraRpcs from "../lib/chainlist/constants/extraRpcs"; const typescriptEntries = ["static/scripts/onboarding/onboarding.ts"]; const cssEntries = ["static/styles/onboarding/onboarding.css"]; export const entries = [...typescriptEntries, ...cssEntries]; -const allNetworkUrls: Record = {}; -// this flattens all the rpcs into a single object, with key names that match the networkIds. The arrays are just of URLs per network ID. - -Object.keys(extraRpcs).forEach((networkId) => { - const officialUrls = extraRpcs[networkId].rpcs.filter((rpc) => typeof rpc === "string"); - const extraUrls: string[] = extraRpcs[networkId].rpcs.filter((rpc) => rpc.url !== undefined).map((rpc) => rpc.url); - allNetworkUrls[networkId] = [...officialUrls, ...extraUrls]; -}); - export const esBuildContext: esbuild.BuildOptions = { sourcemap: true, entryPoints: entries, @@ -31,7 +21,6 @@ export const esBuildContext: esbuild.BuildOptions = { }, outdir: "static/out", define: createEnvDefines(["SUPABASE_URL", "SUPABASE_ANON_KEY", "FRONTEND_URL"], { - extraRpcs: allNetworkUrls, commitHash: execSync(`git rev-parse --short HEAD`).toString().trim(), }), }; diff --git a/lib/chainlist b/lib/chainlist deleted file mode 160000 index 8059283..0000000 --- a/lib/chainlist +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 805928372c7a97eec513e8c74c344dd759f07e1c diff --git a/package.json b/package.json index 28c4e52..3269ed7 100644 --- a/package.json +++ b/package.json @@ -34,12 +34,10 @@ "@octokit/core": "^5.1.0", "@octokit/plugin-create-or-update-text-file": "^4.0.1", "@octokit/rest": "^20.0.2", - "@sinclair/typebox": "^0.32.15", "@supabase/supabase-js": "2.39.7", "@types/libsodium-wrappers": "^0.7.13", "@ubiquibot/configuration": "1.1.0", "@uniswap/permit2-sdk": "^1.2.0", - "axios": "^1.6.8", "dotenv": "^16.4.4", "ethers": "^5.7.2", "libsodium-wrappers": "^0.7.13", diff --git a/static/scripts/onboarding/abis/index.ts b/static/scripts/onboarding/abis/index.ts index de30ac1..3813550 100644 --- a/static/scripts/onboarding/abis/index.ts +++ b/static/scripts/onboarding/abis/index.ts @@ -1,2 +1 @@ export * from "./erc20Abi"; -export * from "./permit2Abi"; diff --git a/static/scripts/onboarding/abis/nftRewardAbi.ts b/static/scripts/onboarding/abis/nftRewardAbi.ts deleted file mode 100644 index eb89aac..0000000 --- a/static/scripts/onboarding/abis/nftRewardAbi.ts +++ /dev/null @@ -1,992 +0,0 @@ -/* eslint-disable sonarjs/no-duplicate-string */ -export const nftRewardAbi = [ - { - inputs: [ - { - internalType: "string", - name: "_tokenName", - type: "string", - }, - { - internalType: "string", - name: "_tokenSymbol", - type: "string", - }, - { - internalType: "address", - name: "_initialOwner", - type: "address", - }, - { - internalType: "address", - name: "_minter", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "ECDSAInvalidSignature", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "length", - type: "uint256", - }, - ], - name: "ECDSAInvalidSignatureLength", - type: "error", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "ECDSAInvalidSignatureS", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "ERC721IncorrectOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ERC721InsufficientApproval", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "approver", - type: "address", - }, - ], - name: "ERC721InvalidApprover", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "ERC721InvalidOperator", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "ERC721InvalidOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "ERC721InvalidReceiver", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "sender", - type: "address", - }, - ], - name: "ERC721InvalidSender", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ERC721NonexistentToken", - type: "error", - }, - { - inputs: [], - name: "EnforcedPause", - type: "error", - }, - { - inputs: [], - name: "ExpectedPause", - type: "error", - }, - { - inputs: [], - name: "InvalidShortString", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "OwnableInvalidOwner", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "OwnableUnauthorizedAccount", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "str", - type: "string", - }, - ], - name: "StringTooLong", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [], - name: "EIP712DomainChanged", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "previousOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "OwnershipTransferred", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "Paused", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: "address", - name: "account", - type: "address", - }, - ], - name: "Unpaused", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "baseUri", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "eip712Domain", - outputs: [ - { - internalType: "bytes1", - name: "fields", - type: "bytes1", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "string", - name: "version", - type: "string", - }, - { - internalType: "uint256", - name: "chainId", - type: "uint256", - }, - { - internalType: "address", - name: "verifyingContract", - type: "address", - }, - { - internalType: "bytes32", - name: "salt", - type: "bytes32", - }, - { - internalType: "uint256[]", - name: "extensions", - type: "uint256[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "beneficiary", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "keys", - type: "bytes32[]", - }, - { - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - internalType: "string[]", - name: "values", - type: "string[]", - }, - ], - internalType: "struct NftReward.MintRequest", - name: "_mintRequest", - type: "tuple", - }, - ], - name: "getMintRequestDigest", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getTokenDataKeys", - outputs: [ - { - internalType: "bytes32[]", - name: "", - type: "bytes32[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "minter", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - ], - name: "nonceRedeemed", - outputs: [ - { - internalType: "bool", - name: "isRedeemed", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "owner", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "pause", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "paused", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "beneficiary", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "keys", - type: "bytes32[]", - }, - { - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - internalType: "string[]", - name: "values", - type: "string[]", - }, - ], - internalType: "struct NftReward.MintRequest", - name: "_mintRequest", - type: "tuple", - }, - { - internalType: "bytes", - name: "_signature", - type: "bytes", - }, - ], - name: "recover", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "renounceOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "address", - name: "beneficiary", - type: "address", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "bytes32[]", - name: "keys", - type: "bytes32[]", - }, - { - internalType: "uint256", - name: "nonce", - type: "uint256", - }, - { - internalType: "string[]", - name: "values", - type: "string[]", - }, - ], - internalType: "struct NftReward.MintRequest", - name: "_mintRequest", - type: "tuple", - }, - { - internalType: "bytes", - name: "_signature", - type: "bytes", - }, - ], - name: "safeMint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "string", - name: "_newBaseUri", - type: "string", - }, - ], - name: "setBaseUri", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_newMinter", - type: "address", - }, - ], - name: "setMinter", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "symbol", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes32", - name: "key", - type: "bytes32", - }, - ], - name: "tokenData", - outputs: [ - { - internalType: "string", - name: "value", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "tokenDataKey", - type: "bytes32", - }, - ], - name: "tokenDataKeyExists", - outputs: [ - { - internalType: "bool", - name: "isTokenDataKeyExists", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "tokenDataKeys", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "tokenIdCounter", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "tokenURI", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "transferOwnership", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "unpause", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; diff --git a/static/scripts/onboarding/abis/permit2Abi.ts b/static/scripts/onboarding/abis/permit2Abi.ts deleted file mode 100644 index 5d17050..0000000 --- a/static/scripts/onboarding/abis/permit2Abi.ts +++ /dev/null @@ -1,353 +0,0 @@ -// cspell: word lockdown -export const permit2Abi = [ - { inputs: [{ internalType: "uint256", name: "deadline", type: "uint256" }], name: "AllowanceExpired", type: "error" }, - { inputs: [], name: "ExcessiveInvalidation", type: "error" }, - { inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }], name: "InsufficientAllowance", type: "error" }, - { inputs: [{ internalType: "uint256", name: "maxAmount", type: "uint256" }], name: "InvalidAmount", type: "error" }, - { inputs: [], name: "InvalidContractSignature", type: "error" }, - { inputs: [], name: "InvalidNonce", type: "error" }, - { inputs: [], name: "InvalidSignature", type: "error" }, - { inputs: [], name: "InvalidSignatureLength", type: "error" }, - { inputs: [], name: "InvalidSigner", type: "error" }, - { inputs: [], name: "LengthMismatch", type: "error" }, - { inputs: [{ internalType: "uint256", name: "signatureDeadline", type: "uint256" }], name: "SignatureExpired", type: "error" }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: true, internalType: "address", name: "token", type: "address" }, - { indexed: true, internalType: "address", name: "spender", type: "address" }, - { indexed: false, internalType: "uint160", name: "amount", type: "uint160" }, - { indexed: false, internalType: "uint48", name: "expiration", type: "uint48" }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: false, internalType: "address", name: "token", type: "address" }, - { indexed: false, internalType: "address", name: "spender", type: "address" }, - ], - name: "Lockdown", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: true, internalType: "address", name: "token", type: "address" }, - { indexed: true, internalType: "address", name: "spender", type: "address" }, - { indexed: false, internalType: "uint48", name: "newNonce", type: "uint48" }, - { indexed: false, internalType: "uint48", name: "oldNonce", type: "uint48" }, - ], - name: "NonceInvalidation", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: true, internalType: "address", name: "token", type: "address" }, - { indexed: true, internalType: "address", name: "spender", type: "address" }, - { indexed: false, internalType: "uint160", name: "amount", type: "uint160" }, - { indexed: false, internalType: "uint48", name: "expiration", type: "uint48" }, - { indexed: false, internalType: "uint48", name: "nonce", type: "uint48" }, - ], - name: "Permit", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, internalType: "address", name: "owner", type: "address" }, - { indexed: false, internalType: "uint256", name: "word", type: "uint256" }, - { indexed: false, internalType: "uint256", name: "mask", type: "uint256" }, - ], - name: "UnorderedNonceInvalidation", - type: "event", - }, - { inputs: [], name: "DOMAIN_SEPARATOR", outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], stateMutability: "view", type: "function" }, - { - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "address", name: "", type: "address" }, - { internalType: "address", name: "", type: "address" }, - ], - name: "allowance", - outputs: [ - { internalType: "uint160", name: "amount", type: "uint160" }, - { internalType: "uint48", name: "expiration", type: "uint48" }, - { internalType: "uint48", name: "nonce", type: "uint48" }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "address", name: "spender", type: "address" }, - { internalType: "uint160", name: "amount", type: "uint160" }, - { internalType: "uint48", name: "expiration", type: "uint48" }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "address", name: "spender", type: "address" }, - { internalType: "uint48", name: "newNonce", type: "uint48" }, - ], - name: "invalidateNonces", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "uint256", name: "wordPos", type: "uint256" }, - { internalType: "uint256", name: "mask", type: "uint256" }, - ], - name: "invalidateUnorderedNonces", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "address", name: "spender", type: "address" }, - ], - internalType: "struct IAllowanceTransfer.TokenSpenderPair[]", - name: "approvals", - type: "tuple[]", - }, - ], - name: "lockdown", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "", type: "address" }, - { internalType: "uint256", name: "", type: "uint256" }, - ], - name: "nonceBitmap", - outputs: [{ internalType: "uint256", name: "", type: "uint256" }], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "owner", type: "address" }, - { - components: [ - { - components: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "uint160", name: "amount", type: "uint160" }, - { internalType: "uint48", name: "expiration", type: "uint48" }, - { internalType: "uint48", name: "nonce", type: "uint48" }, - ], - internalType: "struct IAllowanceTransfer.PermitDetails[]", - name: "details", - type: "tuple[]", - }, - { internalType: "address", name: "spender", type: "address" }, - { internalType: "uint256", name: "sigDeadline", type: "uint256" }, - ], - internalType: "struct IAllowanceTransfer.PermitBatch", - name: "permitBatch", - type: "tuple", - }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - name: "permit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "owner", type: "address" }, - { - components: [ - { - components: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "uint160", name: "amount", type: "uint160" }, - { internalType: "uint48", name: "expiration", type: "uint48" }, - { internalType: "uint48", name: "nonce", type: "uint48" }, - ], - internalType: "struct IAllowanceTransfer.PermitDetails", - name: "details", - type: "tuple", - }, - { internalType: "address", name: "spender", type: "address" }, - { internalType: "uint256", name: "sigDeadline", type: "uint256" }, - ], - internalType: "struct IAllowanceTransfer.PermitSingle", - name: "permitSingle", - type: "tuple", - }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - name: "permit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "uint256", name: "amount", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.TokenPermissions", - name: "permitted", - type: "tuple", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { internalType: "uint256", name: "deadline", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.PermitTransferFrom", - name: "permit", - type: "tuple", - }, - { - components: [ - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "requestedAmount", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.SignatureTransferDetails", - name: "transferDetails", - type: "tuple", - }, - { internalType: "address", name: "owner", type: "address" }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - name: "permitTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "uint256", name: "amount", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.TokenPermissions", - name: "permitted", - type: "tuple", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { internalType: "uint256", name: "deadline", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.PermitTransferFrom", - name: "permit", - type: "tuple", - }, - { - components: [ - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "requestedAmount", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.SignatureTransferDetails", - name: "transferDetails", - type: "tuple", - }, - { internalType: "address", name: "owner", type: "address" }, - { internalType: "bytes32", name: "witness", type: "bytes32" }, - { internalType: "string", name: "witnessTypeString", type: "string" }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - name: "permitWitnessTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - components: [ - { internalType: "address", name: "token", type: "address" }, - { internalType: "uint256", name: "amount", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.TokenPermissions[]", - name: "permitted", - type: "tuple[]", - }, - { internalType: "uint256", name: "nonce", type: "uint256" }, - { internalType: "uint256", name: "deadline", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.PermitBatchTransferFrom", - name: "permit", - type: "tuple", - }, - { - components: [ - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint256", name: "requestedAmount", type: "uint256" }, - ], - internalType: "struct ISignatureTransfer.SignatureTransferDetails[]", - name: "transferDetails", - type: "tuple[]", - }, - { internalType: "address", name: "owner", type: "address" }, - { internalType: "bytes32", name: "witness", type: "bytes32" }, - { internalType: "string", name: "witnessTypeString", type: "string" }, - { internalType: "bytes", name: "signature", type: "bytes" }, - ], - name: "permitWitnessTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - components: [ - { internalType: "address", name: "from", type: "address" }, - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint160", name: "amount", type: "uint160" }, - { internalType: "address", name: "token", type: "address" }, - ], - internalType: "struct IAllowanceTransfer.AllowanceTransferDetails[]", - name: "transferDetails", - type: "tuple[]", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { internalType: "address", name: "from", type: "address" }, - { internalType: "address", name: "to", type: "address" }, - { internalType: "uint160", name: "amount", type: "uint160" }, - { internalType: "address", name: "token", type: "address" }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; diff --git a/static/scripts/onboarding/constants.ts b/static/scripts/onboarding/constants.ts index 979c5d1..dc2bf37 100644 --- a/static/scripts/onboarding/constants.ts +++ b/static/scripts/onboarding/constants.ts @@ -1,9 +1,3 @@ -// type RPC = { url: string; tracking?: string; trackingDetails?: string }; -// type Network = { name?: string; rpcs: RPC[]; websiteDead?: boolean; rpcWorking?: boolean }; -// type Networks = { [key: string]: Network }; - -declare const extraRpcs: Record; // @DEV: passed in at build time check build/esbuild-build.ts - export enum NetworkIds { Mainnet = 1, Goerli = 5, @@ -23,13 +17,6 @@ export const networkNames = { [NetworkIds.Anvil]: "http://127.0.0.1:8545", }; -export const networkCurrencies: Record = { - [NetworkIds.Mainnet]: { symbol: "ETH", decimals: 18 }, - [NetworkIds.Goerli]: { symbol: "GoerliETH", decimals: 18 }, - [NetworkIds.Gnosis]: { symbol: "XDAI", decimals: 18 }, - [NetworkIds.Anvil]: { symbol: "XDAI", decimals: 18 }, -}; - export function getNetworkName(networkId?: number) { const networkName = networkNames[networkId as keyof typeof networkNames]; if (!networkName) { @@ -38,20 +25,5 @@ export function getNetworkName(networkId?: number) { return networkName ?? "Unknown Network"; } -export const networkExplorers: Record = { - [NetworkIds.Mainnet]: "https://etherscan.io", - [NetworkIds.Goerli]: "https://goerli.etherscan.io", - [NetworkIds.Gnosis]: "https://gnosisscan.io", - [NetworkIds.Anvil]: "https://gnosisscan.io", -}; - -export const networkRpcs: Record = { - [NetworkIds.Mainnet]: ["https://rpc-pay.ubq.fi/v1/mainnet", ...(extraRpcs[NetworkIds.Mainnet] || [])], - [NetworkIds.Goerli]: ["https://rpc-pay.ubq.fi/v1/goerli", ...(extraRpcs[NetworkIds.Goerli] || [])], - [NetworkIds.Gnosis]: ["https://rpc.ankr.com/gnosis", ...(extraRpcs[NetworkIds.Gnosis] || [])], - [NetworkIds.Anvil]: ["http://127.0.0.1:8545", ""], -}; - -export const permit2Address = "0x000000000022D473030F116dDEE9F6B43aC78BA3"; // eslint-disable-next-line @typescript-eslint/no-unused-vars const nftAddress = "0xAa1bfC0e51969415d64d6dE74f27CDa0587e645b"; diff --git a/yarn.lock b/yarn.lock index af700aa..46bb7c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1542,11 +1542,6 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.32.14.tgz#ef0a4ed981515fd430cadfb65cb6c2719a0b5539" integrity sha512-EC77Mw8huT2z9YlYbWfpIQgN6shZE1tH4NP4/Trig8UBel9FZNMZRJ42ubJI8PLor2uIU+waLml1dce5ReCOPg== -"@sinclair/typebox@^0.32.15": - version "0.32.15" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.32.15.tgz#92dcdc12907f7c0f6d954ba3700b5bb888d2eb34" - integrity sha512-5Lrwo7VOiWEBJBhHmqNmf3TPB9ll8gcEshvYJyAIJyCZ2PF48MFOtiDHJNj8+FsNcqImaQYmxVkKBCBlyAa/wg== - "@snyk/github-codeowners@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz#45b99732c3c38b5f5b47e43d2b0c9db67a6d2bcc" @@ -2038,15 +2033,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axios@^1.6.8: - version "1.6.8" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" - integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - babylon@^6.9.1: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -2328,7 +2314,7 @@ colorette@^2.0.16, colorette@^2.0.20: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3383,11 +3369,6 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== -follow-redirects@^1.15.6: - version "1.15.6" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== - for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -3408,15 +3389,6 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -5086,11 +5058,6 @@ proxy-from-env@1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"