Socket
Socket
Sign inDemoInstall

@0xsequence/replacer

Package Overview
Dependencies
Maintainers
6
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/replacer - npm Package Compare versions

Comparing version 0.0.0-20240709173026 to 0.0.0-20240711134535

8

dist/0xsequence-replacer.cjs.dev.js

@@ -64,3 +64,3 @@ 'use strict';

try {
const addr = ethers.ethers.recoverAddress(digest, ethers.ethers.hexlify(signature));
const addr = ethers.ethers.utils.recoverAddress(digest, signature);
if (addr.toLowerCase() === address.toLowerCase()) return true;

@@ -99,7 +99,5 @@ } catch (_unused) {}

if (!altUri || altUri === '') throw new Error('EIP5719 - Invalid signature and no alternative signature');
const altSignature = ethers.ethers.hexlify(await (solver || new URISolverIPFS()).resolve(altUri));
const altSignature = ethers.ethers.utils.hexlify(await (solver || new URISolverIPFS()).resolve(altUri));
if (!altSignature || altSignature === '') throw new Error('EIP5719 - Empty alternative signature');
if (altSignature === ethers.ethers.hexlify(signature)) {
throw new Error('EIP5719 - Alternative signature is invalid or the same');
}
if (altSignature === ethers.ethers.utils.hexlify(signature)) throw new Error('EIP5719 - Alternative signature is invalid or the same');
return runByEIP5719(address, provider, digest, altSignature, solver, tries + 1);

@@ -106,0 +104,0 @@ }

@@ -64,3 +64,3 @@ 'use strict';

try {
const addr = ethers.ethers.recoverAddress(digest, ethers.ethers.hexlify(signature));
const addr = ethers.ethers.utils.recoverAddress(digest, signature);
if (addr.toLowerCase() === address.toLowerCase()) return true;

@@ -99,7 +99,5 @@ } catch (_unused) {}

if (!altUri || altUri === '') throw new Error('EIP5719 - Invalid signature and no alternative signature');
const altSignature = ethers.ethers.hexlify(await (solver || new URISolverIPFS()).resolve(altUri));
const altSignature = ethers.ethers.utils.hexlify(await (solver || new URISolverIPFS()).resolve(altUri));
if (!altSignature || altSignature === '') throw new Error('EIP5719 - Empty alternative signature');
if (altSignature === ethers.ethers.hexlify(signature)) {
throw new Error('EIP5719 - Alternative signature is invalid or the same');
}
if (altSignature === ethers.ethers.utils.hexlify(signature)) throw new Error('EIP5719 - Alternative signature is invalid or the same');
return runByEIP5719(address, provider, digest, altSignature, solver, tries + 1);

@@ -106,0 +104,0 @@ }

@@ -60,3 +60,3 @@ import { ethers } from 'ethers';

try {
const addr = ethers.recoverAddress(digest, ethers.hexlify(signature));
const addr = ethers.utils.recoverAddress(digest, signature);
if (addr.toLowerCase() === address.toLowerCase()) return true;

@@ -95,7 +95,5 @@ } catch (_unused) {}

if (!altUri || altUri === '') throw new Error('EIP5719 - Invalid signature and no alternative signature');
const altSignature = ethers.hexlify(await (solver || new URISolverIPFS()).resolve(altUri));
const altSignature = ethers.utils.hexlify(await (solver || new URISolverIPFS()).resolve(altUri));
if (!altSignature || altSignature === '') throw new Error('EIP5719 - Empty alternative signature');
if (altSignature === ethers.hexlify(signature)) {
throw new Error('EIP5719 - Alternative signature is invalid or the same');
}
if (altSignature === ethers.utils.hexlify(signature)) throw new Error('EIP5719 - Alternative signature is invalid or the same');
return runByEIP5719(address, provider, digest, altSignature, solver, tries + 1);

@@ -102,0 +100,0 @@ }

import { ethers } from 'ethers';
import { URISolver } from "./index.js";
export declare class CachedEIP5719 {
provider: ethers.Provider;
provider: ethers.providers.Provider;
solver?: URISolver | undefined;
window: number;
constructor(provider: ethers.Provider, solver?: URISolver | undefined, window?: number);
constructor(provider: ethers.providers.Provider, solver?: URISolver | undefined, window?: number);
private pending;
runByEIP5719(address: string, digest: ethers.BytesLike, signature: ethers.BytesLike): Promise<ethers.BytesLike>;
}
import { ethers } from 'ethers';
export * from "./cached.js";
export declare function eip5719Contract(address: string, provider: ethers.Provider): ethers.Contract;
export declare function eip1271Contract(address: string, provider: ethers.Provider): ethers.Contract;
export declare function isValidSignature(address: string, provider: ethers.Provider, digest: ethers.BytesLike, signature: ethers.BytesLike): Promise<boolean>;
export declare function eip5719Contract(address: string, provider: ethers.providers.Provider): ethers.Contract;
export declare function eip1271Contract(address: string, provider: ethers.providers.Provider): ethers.Contract;
export declare function isValidSignature(address: string, provider: ethers.providers.Provider, digest: ethers.BytesLike, signature: ethers.BytesLike): Promise<boolean>;
export interface URISolver {
resolve: (uri: string) => Promise<string>;
}
export declare function runByEIP5719(address: string, provider: ethers.Provider, digest: ethers.BytesLike, signature: ethers.BytesLike, solver?: URISolver, tries?: number): Promise<ethers.BytesLike>;
export declare function runByEIP5719(address: string, provider: ethers.providers.Provider, digest: ethers.BytesLike, signature: ethers.BytesLike, solver?: URISolver, tries?: number): Promise<ethers.BytesLike>;
export declare class URISolverIPFS implements URISolver {

@@ -11,0 +11,0 @@ gateway: string;

{
"name": "@0xsequence/replacer",
"version": "0.0.0-20240709173026",
"version": "0.0.0-20240711134535",
"description": "EIP-5719 client implementation",

@@ -12,7 +12,7 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/replacer",

"dependencies": {
"@0xsequence/abi": "0.0.0-20240709173026",
"@0xsequence/core": "0.0.0-20240709173026"
"@0xsequence/abi": "0.0.0-20240711134535",
"@0xsequence/core": "0.0.0-20240711134535"
},
"peerDependencies": {
"ethers": ">=6"
"ethers": ">=5.5"
},

@@ -19,0 +19,0 @@ "devDependencies": {},

@@ -6,3 +6,3 @@ import { ethers } from 'ethers'

constructor(
public provider: ethers.Provider,
public provider: ethers.providers.Provider,
public solver?: URISolver,

@@ -9,0 +9,0 @@ public window: number = 1000

@@ -8,3 +8,3 @@ import { ethers } from 'ethers'

export function eip5719Contract(address: string, provider: ethers.Provider): ethers.Contract {
export function eip5719Contract(address: string, provider: ethers.providers.Provider): ethers.Contract {
// TODO: for some reason walletContracts is not being loaded from local

@@ -35,3 +35,3 @@ // remove this code once fixed

export function eip1271Contract(address: string, provider: ethers.Provider): ethers.Contract {
export function eip1271Contract(address: string, provider: ethers.providers.Provider): ethers.Contract {
return new ethers.Contract(address, walletContracts.erc1271.abi, provider)

@@ -42,3 +42,3 @@ }

address: string,
provider: ethers.Provider,
provider: ethers.providers.Provider,
digest: ethers.BytesLike,

@@ -49,3 +49,3 @@ signature: ethers.BytesLike

try {
const addr = ethers.recoverAddress(digest, ethers.hexlify(signature))
const addr = ethers.utils.recoverAddress(digest, signature)
if (addr.toLowerCase() === address.toLowerCase()) return true

@@ -79,3 +79,3 @@ } catch {}

address: string,
provider: ethers.Provider,
provider: ethers.providers.Provider,
digest: ethers.BytesLike,

@@ -102,7 +102,6 @@ signature: ethers.BytesLike,

const altSignature = ethers.hexlify(await (solver || new URISolverIPFS()).resolve(altUri))
const altSignature = ethers.utils.hexlify(await (solver || new URISolverIPFS()).resolve(altUri))
if (!altSignature || altSignature === '') throw new Error('EIP5719 - Empty alternative signature')
if (altSignature === ethers.hexlify(signature)) {
throw new Error('EIP5719 - Alternative signature is invalid or the same')
}
if (altSignature === ethers.utils.hexlify(signature)) throw new Error('EIP5719 - Alternative signature is invalid or the same')
return runByEIP5719(address, provider, digest, altSignature, solver, tries + 1)

@@ -109,0 +108,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc