Skip to content

Commit

Permalink
fix: playground build (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAlec authored Aug 15, 2024
1 parent 4cb7ea2 commit ea769b6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
10 changes: 7 additions & 3 deletions playground/nextjs-app-router/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
const nextConfig = {
typescript: {
ignoreBuildErrors: true,
}
};

export default nextConfig;
2 changes: 1 addition & 1 deletion playground/nextjs-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:clean": "rm -fr ./onchainkit/esm && rm -fr ./onchainkit/src",
"build:link": "cd ./onchainkit && bun link && cd .. && bun link @coinbase/onchainkit",
"build:prepare": "bun run build:onchainkit && bun run cp && bun i",
"build:onchainkit": "cd ../.. && yarn build",
"build:onchainkit": "cd ../.. && yarn install && yarn build",
"start": "next start",
"lint": "next lint"
},
Expand Down
7 changes: 4 additions & 3 deletions src/swap/components/SwapButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { baseSepolia } from 'viem/chains';
import { http, WagmiProvider, createConfig } from 'wagmi';
Expand All @@ -19,7 +18,10 @@ const meta = {
(Story) => (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={new QueryClient()}>
<SwapProvider address="0x02feeb0AdE57b6adEEdE5A4EEea6Cf8c21BeB6B1">
<SwapProvider
address="0x02feeb0AdE57b6adEEdE5A4EEea6Cf8c21BeB6B1"
experimental={{ useAggregator: true }}
>
<Story />
</SwapProvider>
</QueryClientProvider>
Expand All @@ -35,7 +37,6 @@ const meta = {
},
args: {
disabled: true,
onSubmit: fn(),
},
} satisfies Meta<typeof SwapButton>;

Expand Down
5 changes: 4 additions & 1 deletion src/swap/components/SwapToggleButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const meta = {
(Story) => (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={new QueryClient()}>
<SwapProvider address="0x02feeb0AdE57b6adEEdE5A4EEea6Cf8c21BeB6B1">
<SwapProvider
address="0x02feeb0AdE57b6adEEdE5A4EEea6Cf8c21BeB6B1"
experimental={{ useAggregator: true }}
>
<Story />
</SwapProvider>
</QueryClientProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/swap/utils/fromReadableAmount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export function fromReadableAmount(amount: string, decimals: number): string {
const trimmedFractionalPart = paddedFractionalPart.slice(0, decimals);
return (
BigInt(wholePart + trimmedFractionalPart) *
10n ** BigInt(decimals - trimmedFractionalPart.length)
BigInt(10) ** BigInt(decimals - trimmedFractionalPart.length)
).toString();
}
2 changes: 1 addition & 1 deletion src/swap/utils/toReadableAmount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function toReadableAmount(amount: string, decimals: number): string {

// If no decimal point, proceed with the original logic
const bigIntAmount = BigInt(amount);
const divisor = 10n ** BigInt(decimals);
const divisor = BigInt(10) ** BigInt(decimals);
const wholePart = (bigIntAmount / divisor).toString();
const fractionalPart = (bigIntAmount % divisor)
.toString()
Expand Down

0 comments on commit ea769b6

Please sign in to comment.