@0xsequence/core
Advanced tools
Comparing version 0.0.0-20230704142612 to 0.0.0-20230706234338
@@ -8,2 +8,3 @@ export * as config from './config'; | ||
export * as reader from './reader'; | ||
export * as EIP6492 from './validateEIP6492'; | ||
export * from './orchestrator'; |
{ | ||
"name": "@0xsequence/core", | ||
"version": "0.0.0-20230704142612", | ||
"version": "0.0.0-20230706234338", | ||
"description": "core primitives for interacting with the sequence wallet contracts", | ||
@@ -23,3 +23,3 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/core", | ||
"dependencies": { | ||
"@0xsequence/abi": "0.0.0-20230704142612" | ||
"@0xsequence/abi": "0.0.0-20230706234338" | ||
}, | ||
@@ -26,0 +26,0 @@ "scripts": { |
@@ -9,3 +9,4 @@ | ||
export * as reader from './reader' | ||
export * as EIP6492 from './validateEIP6492' | ||
export * from './orchestrator' |
import { walletContracts } from "@0xsequence/abi" | ||
import { ethers } from "ethers" | ||
import { commons } from ".." | ||
import { isValidCounterfactual } from "./context" | ||
import { validateEIP6492Offchain } from "./validateEIP6492" | ||
@@ -98,2 +98,5 @@ /** | ||
// We use the EIP-6492 validator contract to check the signature | ||
// this means that if the wallet is not deployed, then the signature | ||
// must be prefixed with a transaction that deploys the wallet | ||
async isValidSignature( | ||
@@ -104,24 +107,4 @@ wallet: string, | ||
): Promise<boolean> { | ||
const isDeployed = await this.isDeployed(wallet) | ||
if (isDeployed) { | ||
const isValid = await this.module(wallet).isValidSignature(digest, signature) | ||
return isValid === '0x1626ba7e' // as defined in ERC1271 | ||
} | ||
// We can try to recover the counterfactual address | ||
// and check if it matches the wallet address | ||
if (this.contexts) { | ||
return isValidCounterfactual( | ||
wallet, | ||
digest, | ||
signature, | ||
await this.provider.getNetwork().then((n) => n.chainId), | ||
this.provider, | ||
this.contexts | ||
) | ||
} else { | ||
throw new Error('Wallet must be deployed to validate signature, or context info must be provided') | ||
} | ||
return validateEIP6492Offchain(this.provider, wallet, digest, signature) | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
424100
47
10388
5
+ Added@0xsequence/abi@0.0.0-20230706234338(transitive)
- Removed@0xsequence/abi@0.0.0-20230704142612(transitive)