Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR generate preview permit of 7$ to test payment cards #1

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generate-permit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
yarn start:sign
env:
BENEFICIARY_ADDRESS: ${{ github.event.inputs.beneficiary }}
PAYMENT_TOKEN_ADDRESS: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d"
AMOUNT_IN_ETH: 0
PAYMENT_TOKEN_ADDRESS: "0xC6ed4f520f6A4e4DC27273509239b7F8A68d2068"
AMOUNT_IN_ETH: 7
CHAIN_ID: 100
FRONTEND_URL: "http://localhost:8080"
RPC_PROVIDER_URL: "https://rpc.ankr.com/gnosis"
Expand Down
2 changes: 1 addition & 1 deletion cypress/scripts/anvil.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { spawnSync } from "child_process";
import { useHandler } from "../../static/scripts/rewards/web3/use-rpc-handler";
import { useHandler } from "../../shared/use-rpc-handler";
import { RPCHandler } from "@ubiquity-dao/rpc-handler";

class Anvil {
Expand Down
2 changes: 1 addition & 1 deletion functions/post-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getGiftCardValue, isClaimableForAmount } from "../shared/pricing";
import { ExchangeRate, GiftCard } from "../shared/types";
import { erc20Abi } from "../static/scripts/rewards/abis/erc20-abi";
import { permit2Abi } from "../static/scripts/rewards/abis/permit2-abi";
import { useRpcHandler } from "../static/scripts/rewards/web3/use-rpc-handler";
import { useRpcHandler } from "../shared/use-rpc-handler";
import { getTransactionFromOrderId } from "./get-order";
import { findBestCard } from "./utils/best-card-finder";
import { commonHeaders, getAccessToken, getReloadlyApiBaseUrl } from "./utils/shared";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RPCHandler, HandlerConstructorConfig, NetworkId } from "@ubiquity-dao/rpc-handler";
import { networkRpcs } from "../../../../shared/constants";
import { networkRpcs } from "./constants";
import { JsonRpcProvider } from "@ethersproject/providers";

export function convertToNetworkId(networkId: number | string): NetworkId {
Expand Down
4 changes: 2 additions & 2 deletions static/scripts/rewards/app-state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JsonRpcProvider, JsonRpcSigner } from "@ethersproject/providers";
import { Permit } from "@ubiquibot/permit-generation/types";
import { Permit } from "@ubiquibot/permit-generation";
import { getNetworkExplorer } from "@ubiquity-dao/rpc-handler";
import { convertToNetworkId } from "./web3/use-rpc-handler";
import { convertToNetworkId } from "../../../shared/use-rpc-handler";

export class AppState {
public claims: Permit[] = [];
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/rewards/cirip/query-reverse-ens.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ethers } from "ethers";
import { useHandler } from "../web3/use-rpc-handler";
import { useHandler } from "../../../../shared/use-rpc-handler";

export async function queryReverseEns(address: string) {
// Try to get the ENS name from localStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { checkRenderInvalidatePermitAdminControl, checkRenderMakeClaimControl }
import { claimRewardsPagination } from "./claim-rewards-pagination";
import { renderTransaction } from "./render-transaction";
import { setClaimMessage } from "./set-claim-message";
import { useRpcHandler } from "../web3/use-rpc-handler";
import { useRpcHandler } from "../../../../shared/use-rpc-handler";
import { switchNetwork } from "../web3/switch-network";
import { ethers } from "ethers";
import { getNetworkName, NetworkId } from "@ubiquity-dao/rpc-handler";
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/rewards/web3/add-network.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ethers } from "ethers";
import { getNetworkName, getNetworkExplorer, getNetworkCurrency, getNetworkRpcs } from "@ubiquity-dao/rpc-handler";
import { convertToNetworkId } from "./use-rpc-handler";
import { convertToNetworkId } from "../../../../shared/use-rpc-handler";

export async function addNetwork(provider: ethers.providers.Web3Provider, networkId: number): Promise<boolean> {
const networkIdTyped = convertToNetworkId(networkId);
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/rewards/web3/connect-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ethers } from "ethers";
import { toaster } from "../toaster";
import { buttonController } from "../button-controller";
import { app } from "../app-state";
import { useHandler } from "../web3/use-rpc-handler";
import { useHandler } from "../../../../shared/use-rpc-handler";

function checkMobile(a: string) {
// cspell:disable
Expand Down
2 changes: 1 addition & 1 deletion static/scripts/rewards/web3/erc20-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { supabase } from "../render-transaction/read-claim-data-from-url";
import { buttonController, getMakeClaimButton, viewClaimButton } from "../button-controller";
import { toaster, errorToast, MetaMaskError } from "../toaster";
import { connectWallet } from "./connect-wallet";
import { convertToNetworkId } from "./use-rpc-handler";
import { convertToNetworkId } from "../../../../shared/use-rpc-handler";

export async function fetchTreasury(permit: Permit): Promise<{ balance: BigNumber; allowance: BigNumber; decimals: number; symbol: string }> {
let balance: BigNumber, allowance: BigNumber, decimals: number, symbol: string;
Expand Down
Loading