Skip to content

Commit be7b7e5

Browse files
committed
fix: types in frontend
1 parent 930178f commit be7b7e5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

apps/interface/src/lib/components/SendForm.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { lib } from "$lib";
33
import { requestRollup } from "$lib/utils";
44
import { sdk } from "@repo/contracts/sdk";
5+
import { TokenAmount } from "@repo/contracts/sdk/RollupService";
56
import { Ui } from "@repo/ui";
67
import { utils } from "@repo/utils";
78
import { assert } from "ts-essentials";
@@ -38,7 +39,10 @@
3839
secretKey,
3940
fromNote: note,
4041
to,
41-
amount: BigInt(amount.quotient.toString()),
42+
amount: await TokenAmount.from({
43+
token: amount.currency.address,
44+
amount: BigInt(amount.quotient.toString()),
45+
}),
4246
});
4347
await requestRollup();
4448
}

apps/interface/src/lib/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const contract = PoolERC20__factory.connect(
3838
const coreSdk = sdk.createCoreSdk(contract);
3939
const trees = new sdk.RemoteTreesService(route("POST /api/trees"));
4040
const interfaceSdk = sdk.createInterfaceSdk(coreSdk, trees, {
41-
shield: import("@repo/contracts/noir/target/shield.json"),
42-
unshield: import("@repo/contracts/noir/target/unshield.json"),
43-
join: import("@repo/contracts/noir/target/join.json"),
44-
transfer: import("@repo/contracts/noir/target/transfer.json"),
41+
shield: import("@repo/contracts/noir/target/erc20_shield.json"),
42+
unshield: import("@repo/contracts/noir/target/erc20_unshield.json"),
43+
join: import("@repo/contracts/noir/target/erc20_join.json"),
44+
transfer: import("@repo/contracts/noir/target/erc20_transfer.json"),
4545
});
4646
const reown = new ReownService(contract);
4747
const evm = new EvmAccountService();

packages/contracts/sdk/RollupService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ export class Erc20Note {
464464
}
465465
}
466466

467+
// TODO: replace with uniswap's CurrencyAmount
467468
export class TokenAmount {
468469
constructor(
469470
readonly token: string,

0 commit comments

Comments
 (0)