Cosmos signature verification (#6)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import React, { useState } from "react";
|
||||
import { version } from "@walletconnect/client/package.json";
|
||||
import { formatDirectSignDoc, stringifySignDocValues } from "cosmos-wallet";
|
||||
import {
|
||||
formatDirectSignDoc,
|
||||
stringifySignDocValues,
|
||||
verifyAminoSignature,
|
||||
verifyDirectSignature,
|
||||
} from "cosmos-wallet";
|
||||
|
||||
import Banner from "./components/Banner";
|
||||
import Blockchain from "./components/Blockchain";
|
||||
@@ -129,10 +134,12 @@ export default function App() {
|
||||
params,
|
||||
});
|
||||
|
||||
const valid = await verifyDirectSignature(address, result.signature, signDoc);
|
||||
|
||||
return {
|
||||
method: "cosmos_signDirect",
|
||||
address,
|
||||
valid: true,
|
||||
valid,
|
||||
result: result.signature,
|
||||
};
|
||||
};
|
||||
@@ -162,10 +169,12 @@ export default function App() {
|
||||
params,
|
||||
});
|
||||
|
||||
const valid = await verifyAminoSignature(address, result.signature, signDoc);
|
||||
|
||||
return {
|
||||
method: "cosmos_signAmino",
|
||||
address,
|
||||
valid: true,
|
||||
valid,
|
||||
result: result.signature,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2605,7 +2605,7 @@
|
||||
"@walletconnect/utils" "^2.0.0-beta.23"
|
||||
ws "^8.3.0"
|
||||
|
||||
"@walletconnect/cosmos-provider@^2.0.0-beta.23":
|
||||
"@walletconnect/cosmos-provider@2.0.0-beta.23":
|
||||
version "2.0.0-beta.23"
|
||||
resolved "https://registry.yarnpkg.com/@walletconnect/cosmos-provider/-/cosmos-provider-2.0.0-beta.23.tgz#54c3c26835c6bc286b14eb63a7c24f6961df95e6"
|
||||
integrity sha512-RDTSHWtFVNJxK00tQtZyueaFoPEh9Nsc1Hae5NOphQsp+FQhwvVX76+J48ELW+ylS5RNU1Ji1Q/xXX32QNtRLw==
|
||||
|
||||
Reference in New Issue
Block a user