Skip to content

Commit

Permalink
Fix decimals conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
matextrem committed Oct 11, 2023
1 parent 64f6716 commit 0f73541
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/Transaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ export const Transaction = () => {
if (!txData?.to || !accountConnected?.address) return;
try {
setIsLoading(true);
const decimals = api.apiPromise?.registry.chainDecimals[0] ?? 18;
const convertedValue = BigInt(amount * 10 ** decimals);
const transfer = api.apiPromise?.tx.balances.transfer(
txData.to,
amount
convertedValue
);
await transfer?.signAndSend(accountConnected?.address, {
signer: accountConnected?.signer,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Router.events.on("routeChangeComplete", () => {
});

export const squidClient = new ApolloClient({
uri: "https://squid.subsquid.io/ink-multisig-shibuya/v/v3/graphql",
uri: "https://squid.subsquid.io/ink-multisig-shibuya/v/v2/graphql",
cache: new InMemoryCache(),
});

Expand Down

0 comments on commit 0f73541

Please sign in to comment.