Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@0xsequence/guard

Package Overview
Dependencies
Maintainers
6
Versions
477
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/guard - npm Package Compare versions

Comparing version 0.0.0-20240820154443 to 0.0.0-20240820173337

12

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

@@ -483,5 +483,5 @@ 'use strict';

request: {
msg: ethers.ethers.utils.hexlify(message),
msg: ethers.ethers.hexlify(message),
auxData: this.packMsgAndSig(metadata.address, metadata.digest, encoded, metadata.chainId),
chainId: ethers.ethers.BigNumber.from(metadata.chainId).toNumber()
chainId: Number(metadata.chainId)
},

@@ -614,6 +614,6 @@ token: guardTotpCode ? {

packMsgAndSig(address, msg, sig, chainId) {
return ethers.ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
return ethers.ethers.AbiCoder.defaultAbiCoder().encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
}
suffix() {
return this.appendSuffix ? [3] : [];
return new Uint8Array(this.appendSuffix ? [3] : []);
}

@@ -651,3 +651,3 @@ }

signerAddress,
signature: ethers.ethers.utils.hexlify(await signer.sign(digest, {}))
signature: ethers.ethers.hexlify(await signer.sign(digest, {}))
};

@@ -684,3 +684,3 @@ }

message: {
wallet: ethers.ethers.utils.getAddress(wallet),
wallet: ethers.ethers.getAddress(wallet),
timestamp: toUTCString(timestamp)

@@ -687,0 +687,0 @@ }

@@ -483,5 +483,5 @@ 'use strict';

request: {
msg: ethers.ethers.utils.hexlify(message),
msg: ethers.ethers.hexlify(message),
auxData: this.packMsgAndSig(metadata.address, metadata.digest, encoded, metadata.chainId),
chainId: ethers.ethers.BigNumber.from(metadata.chainId).toNumber()
chainId: Number(metadata.chainId)
},

@@ -614,6 +614,6 @@ token: guardTotpCode ? {

packMsgAndSig(address, msg, sig, chainId) {
return ethers.ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
return ethers.ethers.AbiCoder.defaultAbiCoder().encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
}
suffix() {
return this.appendSuffix ? [3] : [];
return new Uint8Array(this.appendSuffix ? [3] : []);
}

@@ -651,3 +651,3 @@ }

signerAddress,
signature: ethers.ethers.utils.hexlify(await signer.sign(digest, {}))
signature: ethers.ethers.hexlify(await signer.sign(digest, {}))
};

@@ -684,3 +684,3 @@ }

message: {
wallet: ethers.ethers.utils.getAddress(wallet),
wallet: ethers.ethers.getAddress(wallet),
timestamp: toUTCString(timestamp)

@@ -687,0 +687,0 @@ }

@@ -479,5 +479,5 @@ import { commons, universal } from '@0xsequence/core';

request: {
msg: ethers.utils.hexlify(message),
msg: ethers.hexlify(message),
auxData: this.packMsgAndSig(metadata.address, metadata.digest, encoded, metadata.chainId),
chainId: ethers.BigNumber.from(metadata.chainId).toNumber()
chainId: Number(metadata.chainId)
},

@@ -610,6 +610,6 @@ token: guardTotpCode ? {

packMsgAndSig(address, msg, sig, chainId) {
return ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
return ethers.AbiCoder.defaultAbiCoder().encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
}
suffix() {
return this.appendSuffix ? [3] : [];
return new Uint8Array(this.appendSuffix ? [3] : []);
}

@@ -647,3 +647,3 @@ }

signerAddress,
signature: ethers.utils.hexlify(await signer.sign(digest, {}))
signature: ethers.hexlify(await signer.sign(digest, {}))
};

@@ -680,3 +680,3 @@ }

message: {
wallet: ethers.utils.getAddress(wallet),
wallet: ethers.getAddress(wallet),
timestamp: toUTCString(timestamp)

@@ -683,0 +683,0 @@ }

@@ -5,3 +5,3 @@ import { Account } from '@0xsequence/account';

import { TypedData } from '@0xsequence/utils';
import { BytesLike, ethers } from 'ethers';
import { ethers } from 'ethers';
import { RecoveryCode as GuardRecoveryCode } from "./guard.gen.js";

@@ -18,3 +18,3 @@ export declare class GuardSigner implements signers.SapientSigner {

decorateTransactions(bundle: commons.transaction.IntendedTransactionBundle, _metadata: object): Promise<commons.transaction.IntendedTransactionBundle>;
sign(message: BytesLike, metadata: object): Promise<BytesLike>;
sign(message: ethers.BytesLike, metadata: object): Promise<ethers.BytesLike>;
notifyStatusChange(_id: string, _status: Status, _metadata: object): void;

@@ -34,3 +34,3 @@ getAuthMethods(proof: OwnershipProof): Promise<{

private packMsgAndSig;
suffix(): BytesLike;
suffix(): ethers.BytesLike;
}

@@ -37,0 +37,0 @@ export type RecoveryCode = GuardRecoveryCode;

{
"name": "@0xsequence/guard",
"version": "0.0.0-20240820154443",
"version": "0.0.0-20240820173337",
"description": "guard sub-package for Sequence",

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

"dependencies": {
"ethers": "^5.7.2",
"@0xsequence/account": "0.0.0-20240820154443",
"@0xsequence/core": "0.0.0-20240820154443",
"@0xsequence/signhub": "0.0.0-20240820154443",
"@0xsequence/utils": "0.0.0-20240820154443"
"ethers": "^6.13.0",
"@0xsequence/account": "0.0.0-20240820173337",
"@0xsequence/core": "0.0.0-20240820173337",
"@0xsequence/signhub": "0.0.0-20240820173337",
"@0xsequence/utils": "0.0.0-20240820173337"
},

@@ -19,0 +19,0 @@ "files": [

@@ -5,3 +5,3 @@ import { Account } from '@0xsequence/account'

import { encodeTypedDataDigest, TypedData } from '@0xsequence/utils'
import { BytesLike, ethers, TypedDataDomain } from 'ethers'
import { ethers } from 'ethers'
import { AuthMethodsReturn, Guard, RecoveryCode as GuardRecoveryCode } from './guard.gen'

@@ -41,3 +41,3 @@

async sign(message: BytesLike, metadata: object): Promise<BytesLike> {
async sign(message: ethers.BytesLike, metadata: object): Promise<ethers.BytesLike> {
if (!commons.isWalletSignRequestMetadata(metadata)) {

@@ -58,5 +58,5 @@ throw new Error('expected sequence signature request metadata')

request: {
msg: ethers.utils.hexlify(message),
msg: ethers.hexlify(message),
auxData: this.packMsgAndSig(metadata.address, metadata.digest, encoded, metadata.chainId),
chainId: ethers.BigNumber.from(metadata.chainId).toNumber()
chainId: Number(metadata.chainId)
},

@@ -176,8 +176,8 @@ token: guardTotpCode ? { id: AuthMethod.TOTP, token: guardTotpCode } : undefined

private packMsgAndSig(address: string, msg: BytesLike, sig: BytesLike, chainId: ethers.BigNumberish): string {
return ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig])
private packMsgAndSig(address: string, msg: ethers.BytesLike, sig: ethers.BytesLike, chainId: ethers.BigNumberish): string {
return ethers.AbiCoder.defaultAbiCoder().encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig])
}
suffix(): BytesLike {
return this.appendSuffix ? [3] : []
suffix(): ethers.BytesLike {
return new Uint8Array(this.appendSuffix ? [3] : [])
}

@@ -236,3 +236,3 @@ }

signerAddress,
signature: ethers.utils.hexlify(await signer.sign(digest, {}))
signature: ethers.hexlify(await signer.sign(digest, {}))
}

@@ -273,3 +273,3 @@ }

message: {
wallet: ethers.utils.getAddress(wallet),
wallet: ethers.getAddress(wallet),
timestamp: toUTCString(timestamp)

@@ -292,3 +292,3 @@ }

const domain: TypedDataDomain = {
const domain: ethers.TypedDataDomain = {
name: 'Sequence Guard',

@@ -295,0 +295,0 @@ version: '1',

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