@0xsequence/sessions
Advanced tools
Comparing version 0.0.0-20230309013947 to 0.0.0-20230309211731
@@ -1472,12 +1472,14 @@ 'use strict'; | ||
if (!best) return []; | ||
best.result.forEach(async function (res) { | ||
const nextConfig = await configOf(res.nextImageHash); | ||
if (nextConfig) { | ||
_this.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: res.signature | ||
}); | ||
(async function () { | ||
for (const result of best.result) { | ||
const nextConfig = await configOf(result.nextImageHash); | ||
if (nextConfig) { | ||
_this.cache.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: result.signature | ||
}); | ||
} | ||
} | ||
}); | ||
})(); | ||
return best.result; | ||
@@ -1565,3 +1567,3 @@ } | ||
do(key, validMilliseconds, task, ...args) { | ||
key = `${key}:${ethers.ethers.utils.keccak256(ethers.ethers.utils.toUtf8Bytes(JSON.stringify(args)))}`; | ||
key = `${key}:${ethers.ethers.utils.keccak256(ethers.ethers.utils.toUtf8Bytes(JSON.stringify(args, deterministically)))}`; | ||
let entry = this.cache.get(key); | ||
@@ -1578,3 +1580,3 @@ if (entry) { | ||
entry = { | ||
promise: Promise.reject('unreachable') | ||
promise: Promise.resolve() | ||
}; | ||
@@ -1596,2 +1598,8 @@ if (validMilliseconds === undefined) { | ||
} | ||
function deterministically(_key, value) { | ||
if (typeof value === 'object' && value !== null && !Array.isArray(value)) { | ||
return Object.fromEntries(Object.entries(value).sort()); | ||
} | ||
return value; | ||
} | ||
@@ -1598,0 +1606,0 @@ // This tracks wraps another tracker and dedupes calls to it, so in any calls |
@@ -1472,12 +1472,14 @@ 'use strict'; | ||
if (!best) return []; | ||
best.result.forEach(async function (res) { | ||
const nextConfig = await configOf(res.nextImageHash); | ||
if (nextConfig) { | ||
_this.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: res.signature | ||
}); | ||
(async function () { | ||
for (const result of best.result) { | ||
const nextConfig = await configOf(result.nextImageHash); | ||
if (nextConfig) { | ||
_this.cache.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: result.signature | ||
}); | ||
} | ||
} | ||
}); | ||
})(); | ||
return best.result; | ||
@@ -1565,3 +1567,3 @@ } | ||
do(key, validMilliseconds, task, ...args) { | ||
key = `${key}:${ethers.ethers.utils.keccak256(ethers.ethers.utils.toUtf8Bytes(JSON.stringify(args)))}`; | ||
key = `${key}:${ethers.ethers.utils.keccak256(ethers.ethers.utils.toUtf8Bytes(JSON.stringify(args, deterministically)))}`; | ||
let entry = this.cache.get(key); | ||
@@ -1578,3 +1580,3 @@ if (entry) { | ||
entry = { | ||
promise: Promise.reject('unreachable') | ||
promise: Promise.resolve() | ||
}; | ||
@@ -1596,2 +1598,8 @@ if (validMilliseconds === undefined) { | ||
} | ||
function deterministically(_key, value) { | ||
if (typeof value === 'object' && value !== null && !Array.isArray(value)) { | ||
return Object.fromEntries(Object.entries(value).sort()); | ||
} | ||
return value; | ||
} | ||
@@ -1598,0 +1606,0 @@ // This tracks wraps another tracker and dedupes calls to it, so in any calls |
@@ -1468,12 +1468,14 @@ import { v2, v1, universal, commons } from '@0xsequence/core'; | ||
if (!best) return []; | ||
best.result.forEach(async function (res) { | ||
const nextConfig = await configOf(res.nextImageHash); | ||
if (nextConfig) { | ||
_this.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: res.signature | ||
}); | ||
(async function () { | ||
for (const result of best.result) { | ||
const nextConfig = await configOf(result.nextImageHash); | ||
if (nextConfig) { | ||
_this.cache.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: result.signature | ||
}); | ||
} | ||
} | ||
}); | ||
})(); | ||
return best.result; | ||
@@ -1561,3 +1563,3 @@ } | ||
do(key, validMilliseconds, task, ...args) { | ||
key = `${key}:${ethers.utils.keccak256(ethers.utils.toUtf8Bytes(JSON.stringify(args)))}`; | ||
key = `${key}:${ethers.utils.keccak256(ethers.utils.toUtf8Bytes(JSON.stringify(args, deterministically)))}`; | ||
let entry = this.cache.get(key); | ||
@@ -1574,3 +1576,3 @@ if (entry) { | ||
entry = { | ||
promise: Promise.reject('unreachable') | ||
promise: Promise.resolve() | ||
}; | ||
@@ -1592,2 +1594,8 @@ if (validMilliseconds === undefined) { | ||
} | ||
function deterministically(_key, value) { | ||
if (typeof value === 'object' && value !== null && !Array.isArray(value)) { | ||
return Object.fromEntries(Object.entries(value).sort()); | ||
} | ||
return value; | ||
} | ||
@@ -1594,0 +1602,0 @@ // This tracks wraps another tracker and dedupes calls to it, so in any calls |
{ | ||
"name": "@0xsequence/sessions", | ||
"version": "0.0.0-20230309013947", | ||
"version": "0.0.0-20230309211731", | ||
"description": "tools for migrating sequence wallets to new versions", | ||
@@ -12,5 +12,5 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/sessions", | ||
"dependencies": { | ||
"@0xsequence/core": "0.0.0-20230309013947", | ||
"@0xsequence/migration": "0.0.0-20230309013947", | ||
"@0xsequence/replacer": "0.0.0-20230309013947", | ||
"@0xsequence/core": "0.0.0-20230309211731", | ||
"@0xsequence/migration": "0.0.0-20230309211731", | ||
"@0xsequence/replacer": "0.0.0-20230309211731", | ||
"ethers": "^5.5.2", | ||
@@ -20,4 +20,4 @@ "idb": "^7.1.1" | ||
"devDependencies": { | ||
"@0xsequence/signhub": "0.0.0-20230309013947", | ||
"@0xsequence/tests": "0.0.0-20230309013947", | ||
"@0xsequence/signhub": "0.0.0-20230309211731", | ||
"@0xsequence/tests": "0.0.0-20230309211731", | ||
"@istanbuljs/nyc-config-typescript": "^1.0.2", | ||
@@ -24,0 +24,0 @@ "fake-indexeddb": "^4.0.1", |
@@ -48,12 +48,14 @@ | ||
best.result.forEach(async res => { | ||
const nextConfig = await configOf(res.nextImageHash) | ||
if (nextConfig) { | ||
this.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: res.signature | ||
}) | ||
;(async () => { | ||
for (const result of best.result) { | ||
const nextConfig = await configOf(result.nextImageHash) | ||
if (nextConfig) { | ||
this.cache.savePresignedConfiguration({ | ||
wallet: args.wallet, | ||
nextConfig, | ||
signature: result.signature | ||
}) | ||
} | ||
} | ||
}) | ||
})() | ||
@@ -60,0 +62,0 @@ return best.result |
@@ -16,3 +16,3 @@ import { ethers } from 'ethers' | ||
): Promise<T> { | ||
key = `${key}:${ethers.utils.keccak256(ethers.utils.toUtf8Bytes(JSON.stringify(args)))}` | ||
key = `${key}:${ethers.utils.keccak256(ethers.utils.toUtf8Bytes(JSON.stringify(args, deterministically)))}` | ||
@@ -31,3 +31,3 @@ let entry = this.cache.get(key) | ||
if (!entry) { | ||
entry = { promise: Promise.reject('unreachable') } | ||
entry = { promise: Promise.resolve() } | ||
if (validMilliseconds === undefined) { | ||
@@ -54,1 +54,9 @@ entry.promise = task(...args) | ||
} | ||
function deterministically(_key: string, value: any): any { | ||
if (typeof value === 'object' && value !== null && !Array.isArray(value)) { | ||
return Object.fromEntries(Object.entries(value).sort()) | ||
} | ||
return value | ||
} |
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
285843
7340
+ Added@0xsequence/abi@0.0.0-20230309211731(transitive)
+ Added@0xsequence/account@0.0.0-20230309211731(transitive)
+ Added@0xsequence/api@0.0.0-20230309211731(transitive)
+ Added@0xsequence/auth@0.0.0-20230309211731(transitive)
+ Added@0xsequence/core@0.0.0-20230309211731(transitive)
+ Added@0xsequence/guard@0.0.0-20230309211731(transitive)
+ Added@0xsequence/indexer@0.0.0-20230309211731(transitive)
+ Added@0xsequence/metadata@0.0.0-20230309211731(transitive)
+ Added@0xsequence/migration@0.0.0-20230309211731(transitive)
+ Added@0xsequence/network@0.0.0-20230309211731(transitive)
+ Added@0xsequence/provider@0.0.0-20230309211731(transitive)
+ Added@0xsequence/relayer@0.0.0-20230309211731(transitive)
+ Added@0xsequence/replacer@0.0.0-20230309211731(transitive)
+ Added@0xsequence/signhub@0.0.0-20230309211731(transitive)
+ Added@0xsequence/utils@0.0.0-20230309211731(transitive)
+ Added@0xsequence/wallet@0.0.0-20230309211731(transitive)
- Removed@0xsequence/abi@0.0.0-20230309013947(transitive)
- Removed@0xsequence/account@0.0.0-20230309013947(transitive)
- Removed@0xsequence/api@0.0.0-20230309013947(transitive)
- Removed@0xsequence/auth@0.0.0-20230309013947(transitive)
- Removed@0xsequence/core@0.0.0-20230309013947(transitive)
- Removed@0xsequence/guard@0.0.0-20230309013947(transitive)
- Removed@0xsequence/indexer@0.0.0-20230309013947(transitive)
- Removed@0xsequence/metadata@0.0.0-20230309013947(transitive)
- Removed@0xsequence/migration@0.0.0-20230309013947(transitive)
- Removed@0xsequence/network@0.0.0-20230309013947(transitive)
- Removed@0xsequence/provider@0.0.0-20230309013947(transitive)
- Removed@0xsequence/relayer@0.0.0-20230309013947(transitive)
- Removed@0xsequence/replacer@0.0.0-20230309013947(transitive)
- Removed@0xsequence/signhub@0.0.0-20230309013947(transitive)
- Removed@0xsequence/utils@0.0.0-20230309013947(transitive)
- Removed@0xsequence/wallet@0.0.0-20230309013947(transitive)