diff --git a/index.d.ts b/index.d.ts index ef1ee57..24cbd92 100644 --- a/index.d.ts +++ b/index.d.ts @@ -33,8 +33,8 @@ declare class Lunar { public getData({ contract, func, params, data }: { contract: string, data?: string, func?: string, params?: string[], state?: string }): Promise; public send({ to, amount, data }: { to: string, amount: number, data:string }): Promise; public signTypedData(params: IJSON): Promise; - public verify(message: string, signature: string): boolean; - public verifyTypedData(params: IJSON, signature: string): boolean; + public verify(message: string, signature: string, expectSigner?: string): boolean; + public verifyTypedData(params: IJSON, signature: string, expectSigner?: string): boolean; public interfaceOf({ contract, abi }: { contract: string, abi: any }): Promise; } export default Lunar; diff --git a/package.json b/package.json index 80a2cb3..e2cd46a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cafeca/lunar", - "version": "0.5.6", + "version": "0.5.7", "description": "Blockchain Connect Module", "main": "dist/index.js", "files": [ diff --git a/src/index.ts b/src/index.ts index 410eba9..aeae223 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ declare global { export class Lunar { private static instance: Lunar; // static version = `v${version}`; - public static version = `v0.5.6`; + public static version = `v0.5.7`; public static Blockchains = Blockchains; public static Wallets = Wallets; public static keccak256 = keccak256; @@ -208,7 +208,7 @@ export class Lunar { const message = JSON.stringify(params); const json = JSON.parse(message); const address = json?.message?.signer; - const expectSigner = signer || address || ''; + const expectSigner = address || signer || ''; const result = address? (expectSigner === address.toLowerCase() && this.verify(message, signature, expectSigner)) : this.verify(message, signature, expectSigner);