@0xsequence/utils
Advanced tools
Comparing version 0.16.0 to 0.18.0
# @0xsequence/utils | ||
## 0.18.0 | ||
### Minor Changes | ||
- relayer improvements and pending transaction handling | ||
## 0.16.0 | ||
@@ -4,0 +10,0 @@ |
@@ -14,3 +14,10 @@ 'use strict'; | ||
} | ||
}; // packMessageData encodes the specified data ready for the Sequence Wallet contracts. | ||
const packMessageData = (walletAddress, chainId, digest) => { | ||
return ethers.ethers.utils.solidityPack(['string', 'uint256', 'address', 'bytes32'], ['\x19\x01', chainId, walletAddress, digest]); | ||
}; | ||
const subDigestOf = (address, chainId, digest) => { | ||
return ethers.ethers.utils.keccak256(packMessageData(address, chainId, digest)); | ||
}; | ||
@@ -229,5 +236,7 @@ const isNode = () => { | ||
exports.logger = logger; | ||
exports.packMessageData = packMessageData; | ||
exports.promisify = promisify; | ||
exports.sanitizeNumberString = sanitizeNumberString; | ||
exports.sleep = sleep; | ||
exports.subDigestOf = subDigestOf; | ||
exports.urlClean = urlClean; |
@@ -14,3 +14,10 @@ 'use strict'; | ||
} | ||
}; // packMessageData encodes the specified data ready for the Sequence Wallet contracts. | ||
const packMessageData = (walletAddress, chainId, digest) => { | ||
return ethers.ethers.utils.solidityPack(['string', 'uint256', 'address', 'bytes32'], ['\x19\x01', chainId, walletAddress, digest]); | ||
}; | ||
const subDigestOf = (address, chainId, digest) => { | ||
return ethers.ethers.utils.keccak256(packMessageData(address, chainId, digest)); | ||
}; | ||
@@ -229,5 +236,7 @@ const isNode = () => { | ||
exports.logger = logger; | ||
exports.packMessageData = packMessageData; | ||
exports.promisify = promisify; | ||
exports.sanitizeNumberString = sanitizeNumberString; | ||
exports.sleep = sleep; | ||
exports.subDigestOf = subDigestOf; | ||
exports.urlClean = urlClean; |
@@ -10,3 +10,10 @@ import { ethers } from 'ethers'; | ||
} | ||
}; // packMessageData encodes the specified data ready for the Sequence Wallet contracts. | ||
const packMessageData = (walletAddress, chainId, digest) => { | ||
return ethers.utils.solidityPack(['string', 'uint256', 'address', 'bytes32'], ['\x19\x01', chainId, walletAddress, digest]); | ||
}; | ||
const subDigestOf = (address, chainId, digest) => { | ||
return ethers.utils.keccak256(packMessageData(address, chainId, digest)); | ||
}; | ||
@@ -180,2 +187,2 @@ const isNode = () => { | ||
export { Logger, configureLogger, encodeMessageDigest, encodeTypedDataDigest, encodeTypedDataHash, getRandomInt, isBrowser, isNode, logger, promisify, sanitizeNumberString, sleep, urlClean }; | ||
export { Logger, configureLogger, encodeMessageDigest, encodeTypedDataDigest, encodeTypedDataHash, getRandomInt, isBrowser, isNode, logger, packMessageData, promisify, sanitizeNumberString, sleep, subDigestOf, urlClean }; |
@@ -0,1 +1,4 @@ | ||
import { ethers } from 'ethers'; | ||
export declare const encodeMessageDigest: (message: string | Uint8Array) => Uint8Array; | ||
export declare const packMessageData: (walletAddress: string, chainId: ethers.BigNumberish, digest: ethers.BytesLike) => string; | ||
export declare const subDigestOf: (address: string, chainId: ethers.BigNumberish, digest: ethers.BytesLike) => string; |
{ | ||
"name": "@0xsequence/utils", | ||
"version": "0.16.0", | ||
"version": "0.18.0", | ||
"description": "utils sub-package for Sequence", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/utils", |
@@ -1,2 +0,2 @@ | ||
import { ethers} from 'ethers' | ||
import { ethers } from 'ethers' | ||
@@ -10,1 +10,15 @@ export const encodeMessageDigest = (message: string | Uint8Array) => { | ||
} | ||
// packMessageData encodes the specified data ready for the Sequence Wallet contracts. | ||
export const packMessageData = (walletAddress: string, chainId: ethers.BigNumberish, digest: ethers.BytesLike): string => { | ||
return ethers.utils.solidityPack( | ||
['string', 'uint256', 'address', 'bytes32'], | ||
['\x19\x01', chainId, walletAddress, digest] | ||
) | ||
} | ||
export const subDigestOf = (address: string, chainId: ethers.BigNumberish, digest: ethers.BytesLike): string => { | ||
return ethers.utils.keccak256( | ||
packMessageData(address, chainId, digest) | ||
) | ||
} |
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
31692
810