Skip to content

Commit

Permalink
Update pk format for signer qr
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovNikita committed May 6, 2024
1 parent b428b05 commit dbaee14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/service/signerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export const parseSignerSignature = (payload: string): Buffer => {
}
};

export const createTransferQr = (publicKey: string, boc: string) => {
const pk = encodeURIComponent(Buffer.from(publicKey, 'hex').toString('base64'));
return `tonsign://?network=ton&pk=${pk}&body=${boc}`;
};

export const storeTransactionAndCreateDeepLink = async (
sdk: IAppSdk,
publicKey: string,
Expand Down
5 changes: 2 additions & 3 deletions packages/uikit/src/components/PairSignerNotification.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IAppSdk } from '@tonkeeper/core/dist/AppSdk';
import { createTransferQr } from '@tonkeeper/core/dist/service/signerService';
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
import { useAppContext, useWalletContext } from '../hooks/appContext';
import { useAppSdk } from '../hooks/appSdk';
Expand All @@ -25,9 +26,7 @@ export const SignerContent: FC<{
const openScanner = useScanner(null, onSubmit);

const message = useMemo(() => {
return `tonsign://?pk=${Buffer.from(wallet.publicKey, 'hex').toString(
'base64'
)}&body=${boc}`;
return createTransferQr(wallet.publicKey, boc);
}, [wallet, boc]);

return (
Expand Down

0 comments on commit dbaee14

Please sign in to comment.