Unverified Commit 13396b89 authored by Andrei Eres's avatar Andrei Eres Committed by GitHub
Browse files

Update polkadot deps (#92)

* Update polkadot deps

* Add hex string type
parent 0d988a7d
Pipeline #166443 passed with stages
in 1 minute and 31 seconds
......@@ -5,6 +5,7 @@ import {
MetadataRequest,
SigningRequest,
} from '@polkadot/extension-base/background/types'
import { HexString } from '@polkadot/util/types'
import { sendUIMessage } from './sendUIMessage'
export function editAccount(address: string, name: string): Promise<boolean> {
......@@ -29,7 +30,7 @@ export function cancelSignRequest(id: string): Promise<boolean> {
export function approveSignSignature(
id: string,
signature: string
signature: HexString
): Promise<boolean> {
return sendUIMessage('pri(signing.approve.signature)', { id, signature })
}
......
......@@ -28,5 +28,6 @@ redirectIfPhishing()
})
function inject() {
injectExtension(enable, { name: PKG_NAME, version: PKG_VERSION })
// eslint-disable-next-line @typescript-eslint/no-explicit-any
injectExtension(enable as any, { name: PKG_NAME, version: PKG_VERSION })
}
import { useStore } from '@nanostores/react'
import {
AccountJson,
RequestSign,
} from '@polkadot/extension-base/background/types'
import { wrapBytes } from '@polkadot/extension-dapp/wrapBytes'
import { QrDisplayPayload, QrScanSignature } from '@polkadot/react-qr'
import { useStore } from '@nanostores/react'
import { HexString } from '@polkadot/util/types'
import React, { useEffect, useRef, useState } from 'react'
import styled from 'styled-components'
import Address from '../components/Address'
import { Button } from '../components/Button'
import {
approveSignSignature,
cancelSignRequest,
} from '../../messaging/uiActions'
import {
accountNamesByAddressStore,
accountsStore,
} from '../../stores/accounts'
import { addHeaderAction, resetHeaderActions } from '../../stores/headerActions'
import { BaseProps } from '../types'
import { isRawPayload } from '../../utils/guards'
import {
approveSignSignature,
cancelSignRequest,
} from '../../messaging/uiActions'
import { getGenesisHashByAddress } from '../../utils/getGenesisHashByAddress'
import { getExtrinsicPayload } from '../../utils/getExtrinsicPayload'
import { getGenesisHashByAddress } from '../../utils/getGenesisHashByAddress'
import { isRawPayload } from '../../utils/guards'
import Address from '../components/Address'
import { Button } from '../components/Button'
import { BaseProps } from '../types'
const CMD_MORTAL = 2
const CMD_SIGN_MESSAGE = 3
......@@ -52,7 +53,7 @@ const Request: React.FC<Props> = ({ request, signId, className }) => {
: payloadRef.current?.toU8a()
const toggleOnQr = () => setBeginning((v) => !v)
const onSignature = ({ signature }: { signature: string }) =>
const onSignature = ({ signature }: { signature: HexString }) =>
approveSignSignature(signId, signature).catch(console.error)
useEffect(() => {
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment