diff --git a/src/backend/BrownFi.mo b/src/backend/BrownFi.mo index ecff2c7..084376f 100644 --- a/src/backend/BrownFi.mo +++ b/src/backend/BrownFi.mo @@ -587,7 +587,7 @@ shared(msg) actor class BrownFi(owner_ : Principal, bfId: Principal, capId_: Pri var realUser: Principal = msg.caller; switch (await getDelegatee(msg.caller)) { case (?delegatee) { realUser := delegatee; }; - case (_) { return #err("Delegatee not found")}; + case (_) { realUser := realUser; }; }; if (tokens.balanceOf(qtid, realUser) < (pAmount)) return #err("Insufficient balance: " # qtid); if (tokens.zeroFeeTransfer(qtid, realUser, Principal.fromActor(this), pAmount) == false) diff --git a/src/frontend/src/components/Swap.tsx b/src/frontend/src/components/Swap.tsx index 2b6597f..f7034a0 100644 --- a/src/frontend/src/components/Swap.tsx +++ b/src/frontend/src/components/Swap.tsx @@ -102,7 +102,7 @@ function Swap() { args: [ Principal.fromText((tokens.INPUT as TokenDetails).address), Principal.fromText((tokens.OUTPUT as TokenDetails).address), - BigInt(tokenAmounts[Field.INPUT]) * (BigInt(10) ** BigInt((tokens.INPUT as TokenDetails).decimals)), + BigInt(tokenAmounts[Field.INPUT]), BigInt("1741447837000000000") ] }); @@ -123,7 +123,7 @@ function Swap() { console.error(error) setStatus("fail") }) - + setStatus("loading") }; @@ -138,7 +138,7 @@ function Swap() {
- {tokens.INPUT && ({tokens.INPUT.symbol})} + {tokens.INPUT && ({tokens.INPUT.symbol})} You Pay
Balance: @@ -175,7 +175,7 @@ function Swap() { />
- {tokens.OUTPUT && ({tokens.OUTPUT.symbol})} + {tokens.OUTPUT && ({tokens.OUTPUT.symbol})} Your Receive
Balance: diff --git a/src/frontend/src/hooks/usePositions.ts b/src/frontend/src/hooks/usePositions.ts index 907d4ff..2567a74 100644 --- a/src/frontend/src/hooks/usePositions.ts +++ b/src/frontend/src/hooks/usePositions.ts @@ -2,13 +2,14 @@ import { useAuth } from "@ic-reactor/react"; import { useEffect } from "react"; import { useCoreQueryCall } from "./coreActor"; import { PositionDetails } from "../model/pools"; +import { Principal } from "@dfinity/principal"; export function usePositions() { const { authenticated, identity } = useAuth(); const { call, data, error, loading } = useCoreQueryCall({ functionName: "getPairListByCreator", - args: [identity?.getPrincipal()], + args: [Principal.fromText("medlw-2c5pb-n4eht-4f3js-vtrp7-2juyk-smdl5-xitl6-x7ezi-dm5wx-cae")], refetchInterval: 100_000, refetchOnMount: true, })