@0xsequence/guard
Advanced tools
Comparing version 0.0.0-20241216114019 to 0.0.0-20241218203257
@@ -11,14 +11,9 @@ 'use strict'; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
return _extends = Object.assign ? Object.assign.bind() : function (n) { | ||
for (var e = 1; e < arguments.length; e++) { | ||
var t = arguments[e]; | ||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
return n; | ||
}, _extends.apply(null, arguments); | ||
} | ||
@@ -480,2 +475,3 @@ | ||
async sign(message, metadata) { | ||
var _metadata$parts; | ||
if (!core.commons.isWalletSignRequestMetadata(metadata)) { | ||
@@ -489,8 +485,5 @@ throw new Error('expected sequence signature request metadata'); | ||
const coder = core.universal.genericCoderFor(metadata.config.version); | ||
const validationsParts = new Map(Array.from(metadata.parts || []).map(([signer, part]) => [signer, part.validationSignature ? _extends({}, part, { | ||
signature: part.validationSignature | ||
}) : part])); | ||
const { | ||
encoded | ||
} = coder.signature.encodeSigners(metadata.config, validationsParts, [], metadata.chainId); | ||
} = coder.signature.encodeSigners(metadata.config, (_metadata$parts = metadata.parts) != null ? _metadata$parts : new Map(), [], metadata.chainId); | ||
return (await this.guard.signWith({ | ||
@@ -497,0 +490,0 @@ signer: this.address, |
@@ -11,14 +11,9 @@ 'use strict'; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
return _extends = Object.assign ? Object.assign.bind() : function (n) { | ||
for (var e = 1; e < arguments.length; e++) { | ||
var t = arguments[e]; | ||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
return n; | ||
}, _extends.apply(null, arguments); | ||
} | ||
@@ -480,2 +475,3 @@ | ||
async sign(message, metadata) { | ||
var _metadata$parts; | ||
if (!core.commons.isWalletSignRequestMetadata(metadata)) { | ||
@@ -489,8 +485,5 @@ throw new Error('expected sequence signature request metadata'); | ||
const coder = core.universal.genericCoderFor(metadata.config.version); | ||
const validationsParts = new Map(Array.from(metadata.parts || []).map(([signer, part]) => [signer, part.validationSignature ? _extends({}, part, { | ||
signature: part.validationSignature | ||
}) : part])); | ||
const { | ||
encoded | ||
} = coder.signature.encodeSigners(metadata.config, validationsParts, [], metadata.chainId); | ||
} = coder.signature.encodeSigners(metadata.config, (_metadata$parts = metadata.parts) != null ? _metadata$parts : new Map(), [], metadata.chainId); | ||
return (await this.guard.signWith({ | ||
@@ -497,0 +490,0 @@ signer: this.address, |
@@ -7,14 +7,9 @@ import { commons, universal } from '@0xsequence/core'; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
return _extends = Object.assign ? Object.assign.bind() : function (n) { | ||
for (var e = 1; e < arguments.length; e++) { | ||
var t = arguments[e]; | ||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
return n; | ||
}, _extends.apply(null, arguments); | ||
} | ||
@@ -476,2 +471,3 @@ | ||
async sign(message, metadata) { | ||
var _metadata$parts; | ||
if (!commons.isWalletSignRequestMetadata(metadata)) { | ||
@@ -485,8 +481,5 @@ throw new Error('expected sequence signature request metadata'); | ||
const coder = universal.genericCoderFor(metadata.config.version); | ||
const validationsParts = new Map(Array.from(metadata.parts || []).map(([signer, part]) => [signer, part.validationSignature ? _extends({}, part, { | ||
signature: part.validationSignature | ||
}) : part])); | ||
const { | ||
encoded | ||
} = coder.signature.encodeSigners(metadata.config, validationsParts, [], metadata.chainId); | ||
} = coder.signature.encodeSigners(metadata.config, (_metadata$parts = metadata.parts) != null ? _metadata$parts : new Map(), [], metadata.chainId); | ||
return (await this.guard.signWith({ | ||
@@ -493,0 +486,0 @@ signer: this.address, |
{ | ||
"name": "@0xsequence/guard", | ||
"version": "0.0.0-20241216114019", | ||
"version": "0.0.0-20241218203257", | ||
"description": "guard sub-package for Sequence", | ||
@@ -15,6 +15,6 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/guard", | ||
"dependencies": { | ||
"@0xsequence/account": "0.0.0-20241216114019", | ||
"@0xsequence/core": "0.0.0-20241216114019", | ||
"@0xsequence/signhub": "0.0.0-20241216114019", | ||
"@0xsequence/utils": "0.0.0-20241216114019" | ||
"@0xsequence/core": "0.0.0-20241218203257", | ||
"@0xsequence/account": "0.0.0-20241218203257", | ||
"@0xsequence/signhub": "0.0.0-20241218203257", | ||
"@0xsequence/utils": "0.0.0-20241218203257" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -64,9 +64,3 @@ import { Account } from '@0xsequence/account' | ||
const coder = universal.genericCoderFor(metadata.config.version) | ||
const validationsParts = new Map( | ||
Array.from(metadata.parts || []).map(([signer, part]) => [ | ||
signer, | ||
part.validationSignature ? { ...part, signature: part.validationSignature } : part | ||
]) | ||
) | ||
const { encoded } = coder.signature.encodeSigners(metadata.config, validationsParts, [], metadata.chainId) | ||
const { encoded } = coder.signature.encodeSigners(metadata.config, metadata.parts ?? new Map(), [], metadata.chainId) | ||
@@ -73,0 +67,0 @@ return ( |
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
128419
3453
+ Added@0xsequence/abi@0.0.0-20241218203257(transitive)
+ Added@0xsequence/account@0.0.0-20241218203257(transitive)
+ Added@0xsequence/core@0.0.0-20241218203257(transitive)
+ Added@0xsequence/indexer@0.0.0-20241218203257(transitive)
+ Added@0xsequence/migration@0.0.0-20241218203257(transitive)
+ Added@0xsequence/network@0.0.0-20241218203257(transitive)
+ Added@0xsequence/relayer@0.0.0-20241218203257(transitive)
+ Added@0xsequence/replacer@0.0.0-20241218203257(transitive)
+ Added@0xsequence/sessions@0.0.0-20241218203257(transitive)
+ Added@0xsequence/signhub@0.0.0-20241218203257(transitive)
+ Added@0xsequence/utils@0.0.0-20241218203257(transitive)
+ Added@0xsequence/wallet@0.0.0-20241218203257(transitive)
- Removed@0xsequence/abi@0.0.0-20241216114019(transitive)
- Removed@0xsequence/account@0.0.0-20241216114019(transitive)
- Removed@0xsequence/core@0.0.0-20241216114019(transitive)
- Removed@0xsequence/indexer@0.0.0-20241216114019(transitive)
- Removed@0xsequence/migration@0.0.0-20241216114019(transitive)
- Removed@0xsequence/network@0.0.0-20241216114019(transitive)
- Removed@0xsequence/relayer@0.0.0-20241216114019(transitive)
- Removed@0xsequence/replacer@0.0.0-20241216114019(transitive)
- Removed@0xsequence/sessions@0.0.0-20241216114019(transitive)
- Removed@0xsequence/signhub@0.0.0-20241216114019(transitive)
- Removed@0xsequence/utils@0.0.0-20241216114019(transitive)
- Removed@0xsequence/wallet@0.0.0-20241216114019(transitive)