@0xsequence/guard
Advanced tools
Comparing version 0.0.0-20240820154443 to 0.0.0-20240820173337
@@ -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', |
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
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
127182
+ Added@0xsequence/abi@0.0.0-20240820173337(transitive)
+ Added@0xsequence/account@0.0.0-20240820173337(transitive)
+ Added@0xsequence/core@0.0.0-20240820173337(transitive)
+ Added@0xsequence/indexer@0.0.0-20240820173337(transitive)
+ Added@0xsequence/migration@0.0.0-20240820173337(transitive)
+ Added@0xsequence/network@0.0.0-20240820173337(transitive)
+ Added@0xsequence/relayer@0.0.0-20240820173337(transitive)
+ Added@0xsequence/replacer@0.0.0-20240820173337(transitive)
+ Added@0xsequence/sessions@0.0.0-20240820173337(transitive)
+ Added@0xsequence/signhub@0.0.0-20240820173337(transitive)
+ Added@0xsequence/utils@0.0.0-20240820173337(transitive)
+ Added@0xsequence/wallet@0.0.0-20240820173337(transitive)
+ Added@adraffy/ens-normalize@1.10.1(transitive)
+ Added@noble/curves@1.2.0(transitive)
+ Added@noble/hashes@1.3.2(transitive)
+ Added@types/node@22.7.5(transitive)
+ Addedaes-js@4.0.0-beta.5(transitive)
+ Addedethers@6.13.4(transitive)
+ Addedtslib@2.7.0(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedws@8.17.1(transitive)
- Removed@0xsequence/abi@0.0.0-20240820154443(transitive)
- Removed@0xsequence/account@0.0.0-20240820154443(transitive)
- Removed@0xsequence/core@0.0.0-20240820154443(transitive)
- Removed@0xsequence/indexer@0.0.0-20240820154443(transitive)
- Removed@0xsequence/migration@0.0.0-20240820154443(transitive)
- Removed@0xsequence/network@0.0.0-20240820154443(transitive)
- Removed@0xsequence/relayer@0.0.0-20240820154443(transitive)
- Removed@0xsequence/replacer@0.0.0-20240820154443(transitive)
- Removed@0xsequence/sessions@0.0.0-20240820154443(transitive)
- Removed@0xsequence/signhub@0.0.0-20240820154443(transitive)
- Removed@0xsequence/utils@0.0.0-20240820154443(transitive)
- Removed@0xsequence/wallet@0.0.0-20240820154443(transitive)
- Removed@ethersproject/abi@5.7.0(transitive)
- Removed@ethersproject/abstract-provider@5.7.0(transitive)
- Removed@ethersproject/abstract-signer@5.7.0(transitive)
- Removed@ethersproject/address@5.7.0(transitive)
- Removed@ethersproject/base64@5.7.0(transitive)
- Removed@ethersproject/basex@5.7.0(transitive)
- Removed@ethersproject/bignumber@5.7.0(transitive)
- Removed@ethersproject/bytes@5.7.0(transitive)
- Removed@ethersproject/constants@5.7.0(transitive)
- Removed@ethersproject/contracts@5.7.0(transitive)
- Removed@ethersproject/hash@5.7.0(transitive)
- Removed@ethersproject/hdnode@5.7.0(transitive)
- Removed@ethersproject/json-wallets@5.7.0(transitive)
- Removed@ethersproject/keccak256@5.7.0(transitive)
- Removed@ethersproject/logger@5.7.0(transitive)
- Removed@ethersproject/networks@5.7.1(transitive)
- Removed@ethersproject/pbkdf2@5.7.0(transitive)
- Removed@ethersproject/properties@5.7.0(transitive)
- Removed@ethersproject/providers@5.7.2(transitive)
- Removed@ethersproject/random@5.7.0(transitive)
- Removed@ethersproject/rlp@5.7.0(transitive)
- Removed@ethersproject/sha2@5.7.0(transitive)
- Removed@ethersproject/signing-key@5.7.0(transitive)
- Removed@ethersproject/solidity@5.7.0(transitive)
- Removed@ethersproject/strings@5.7.0(transitive)
- Removed@ethersproject/transactions@5.7.0(transitive)
- Removed@ethersproject/units@5.7.0(transitive)
- Removed@ethersproject/wallet@5.7.0(transitive)
- Removed@ethersproject/web@5.7.1(transitive)
- Removed@ethersproject/wordlists@5.7.0(transitive)
- Removedaes-js@3.0.0(transitive)
- Removedbech32@1.1.4(transitive)
- Removedbn.js@4.12.15.2.1(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedelliptic@6.5.4(transitive)
- Removedethers@5.7.2(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjs-sha3@0.8.0(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedscrypt-js@3.0.1(transitive)
- Removedws@7.4.6(transitive)
Updatedethers@^6.13.0