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

@0xsequence/sessions

Package Overview
Dependencies
Maintainers
6
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/sessions - npm Package Compare versions

Comparing version 0.0.0-20241216114019 to 0.0.0-20241218203257

7

dist/declarations/src/tracker.d.ts

@@ -20,7 +20,2 @@ import { commons } from '@0xsequence/core';

};
export type SignerSignature = {
address: string;
signature: string;
referenceChainId?: ethers.BigNumberish;
};
export interface ConfigTracker {

@@ -37,3 +32,3 @@ loadPresignedConfiguration: (args: {

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}) => Promise<void>;

@@ -40,0 +35,0 @@ configOfImageHash: (args: {

4

dist/declarations/src/trackers/arweave.d.ts
import { commons } from '@0xsequence/core';
import { migrator } from '@0xsequence/migration';
import { ethers } from 'ethers';
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../tracker.js";
export interface Options {

@@ -36,3 +36,3 @@ readonly namespace?: string;

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}): Promise<void>;

@@ -39,0 +39,0 @@ configOfImageHash(args: {

import { commons } from '@0xsequence/core';
import { migrator } from '@0xsequence/migration';
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../tracker.js";
import { ethers } from 'ethers';

@@ -49,3 +49,3 @@ export declare class CachedTracker implements migrator.PresignedMigrationTracker, ConfigTracker {

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}): Promise<void>;

@@ -52,0 +52,0 @@ getMigration(address: string, fromImageHash: string, fromVersion: number, chainId: ethers.BigNumberish): Promise<migrator.SignedMigration | undefined>;

import { commons } from '@0xsequence/core';
import { migrator } from '@0xsequence/migration';
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../tracker.js";
import { ethers } from 'ethers';

@@ -18,3 +18,3 @@ export declare class DebugConfigTracker implements ConfigTracker, migrator.PresignedMigrationTracker {

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}): Promise<void>;

@@ -21,0 +21,0 @@ configOfImageHash(args: {

import { commons } from '@0xsequence/core';
import { migrator } from '@0xsequence/migration';
import { ethers } from 'ethers';
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../tracker.js";
export declare function isDedupedTracker(tracker: any): tracker is DedupedTracker;

@@ -28,3 +28,3 @@ export declare class DedupedTracker implements migrator.PresignedMigrationTracker, ConfigTracker {

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}): Promise<void>;

@@ -31,0 +31,0 @@ saveWalletConfig(args: {

import { commons } from '@0xsequence/core';
import { migrator } from '@0xsequence/migration';
import { ethers } from 'ethers';
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../tracker.js";
import { TrackerStore } from "./stores/index.js";

@@ -48,3 +48,3 @@ export declare class LocalConfigTracker implements ConfigTracker, migrator.PresignedMigrationTracker {

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}) => Promise<void>;

@@ -51,0 +51,0 @@ walletsOfSigner: (args: {

@@ -1,2 +0,2 @@

import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../tracker.js";
import { migrator } from '@0xsequence/migration';

@@ -42,3 +42,3 @@ import { commons } from '@0xsequence/core';

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}): Promise<void>;

@@ -45,0 +45,0 @@ loadPresignedConfiguration(args: {

import { commons } from '@0xsequence/core';
import { migrator } from '@0xsequence/migration';
import { ethers } from 'ethers';
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from "../../tracker.js";
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from "../../tracker.js";
export declare class RemoteConfigTracker implements ConfigTracker, migrator.PresignedMigrationTracker {

@@ -19,3 +19,3 @@ readonly onlyRecoverable: boolean;

chainId: ethers.BigNumberish;
signatures: string[] | SignerSignature[];
signatures: string[];
}): Promise<void>;

@@ -22,0 +22,0 @@ configOfImageHash(args: {

{
"name": "@0xsequence/sessions",
"version": "0.0.0-20241216114019",
"version": "0.0.0-20241218203257",
"description": "tools for migrating sequence wallets to new versions",

@@ -16,6 +16,6 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/sessions",

"idb": "^7.1.1",
"@0xsequence/migration": "0.0.0-20241216114019",
"@0xsequence/replacer": "0.0.0-20241216114019",
"@0xsequence/utils": "0.0.0-20241216114019",
"@0xsequence/core": "0.0.0-20241216114019"
"@0xsequence/core": "0.0.0-20241218203257",
"@0xsequence/migration": "0.0.0-20241218203257",
"@0xsequence/utils": "0.0.0-20241218203257",
"@0xsequence/replacer": "0.0.0-20241218203257"
},

@@ -27,4 +27,4 @@ "devDependencies": {

"nyc": "^15.1.0",
"@0xsequence/signhub": "0.0.0-20241216114019",
"@0xsequence/tests": "0.0.0-20241216114019"
"@0xsequence/signhub": "0.0.0-20241218203257",
"@0xsequence/tests": "0.0.0-20241218203257"
},

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

@@ -22,8 +22,2 @@ import { commons } from '@0xsequence/core'

export type SignerSignature = {
address: string
signature: string
referenceChainId?: ethers.BigNumberish
}
export interface ConfigTracker {

@@ -38,3 +32,3 @@ loadPresignedConfiguration: (args: {

saveWitnesses: (args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] | SignerSignature[] }) => Promise<void>
saveWitnesses: (args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] }) => Promise<void>

@@ -41,0 +35,0 @@ configOfImageHash: (args: { imageHash: string; noCache?: boolean }) => Promise<commons.config.Config | undefined>

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

import { ethers } from 'ethers'
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../tracker'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../tracker'

@@ -235,3 +235,3 @@ // depending on @0xsequence/abi breaks 0xsequence's proxy-transport-channel integration test

saveWitnesses(_args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] | SignerSignature[] }): Promise<void> {
saveWitnesses(_args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] }): Promise<void> {
throw new Error('arweave backend does not support saving signatures')

@@ -238,0 +238,0 @@ }

import { commons, universal } from '@0xsequence/core'
import { migrator } from '@0xsequence/migration'
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../tracker'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../tracker'
import { ethers } from 'ethers'

@@ -151,3 +151,3 @@

chainId: ethers.BigNumberish
signatures: string[] | SignerSignature[]
signatures: string[]
}): Promise<void> {

@@ -154,0 +154,0 @@ await Promise.all([this.tracker.saveWitnesses(args), this.cache.saveWitnesses(args)])

import { commons } from '@0xsequence/core'
import { migrator } from '@0xsequence/migration'
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../tracker'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../tracker'
import { ethers } from 'ethers'

@@ -26,3 +26,3 @@ import { bigintReplacer } from '@0xsequence/utils'

saveWitnesses(args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] | SignerSignature[] }): Promise<void> {
saveWitnesses(args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] }): Promise<void> {
console.debug('? saveWitnesses')

@@ -29,0 +29,0 @@ debug(args, '? ')

@@ -5,3 +5,3 @@ import { commons } from '@0xsequence/core'

import { ethers } from 'ethers'
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../tracker'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../tracker'
import { PromiseCache } from './promise-cache'

@@ -67,3 +67,3 @@ import { LocalConfigTracker } from './local'

saveWitnesses(args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] | SignerSignature[] }): Promise<void> {
saveWitnesses(args: { wallet: string; digest: string; chainId: ethers.BigNumberish; signatures: string[] }): Promise<void> {
return this.cache.do('saveWitnesses', undefined, args => this.tracker.saveWitnesses(args), args)

@@ -70,0 +70,0 @@ }

@@ -5,3 +5,3 @@ import { commons, universal, v1, v2 } from '@0xsequence/core'

import { CachedEIP5719 } from '@0xsequence/replacer'
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../tracker'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../tracker'
import { isPlainNested, isPlainNode, isPlainV2Config, MemoryTrackerStore, PlainNested, PlainNode, TrackerStore } from './stores'

@@ -239,8 +239,3 @@

const recovered = await v2.signature.SignatureCoder.recover(
decoded,
payload,
this.provider,
'ignore'
)
const recovered = await v2.signature.SignatureCoder.recover(decoded, payload, this.provider)

@@ -398,3 +393,3 @@ // Save the recovered configuration and all signature parts

chainId: ethers.BigNumberish
signatures: string[] | SignerSignature[]
signatures: string[]
}): Promise<void> => {

@@ -412,3 +407,2 @@ const payload = {

...args.signatures
.map(s => (typeof s === 'string' ? s : s.signature))
.filter(signature => {

@@ -415,0 +409,0 @@ // We don't support saving witnesses for non-recoverable signatures

@@ -1,2 +0,2 @@

import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../tracker'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../tracker'
import { migrator } from '@0xsequence/migration'

@@ -154,3 +154,3 @@

chainId: ethers.BigNumberish
signatures: string[] | SignerSignature[]
signatures: string[]
}): Promise<void> {

@@ -157,0 +157,0 @@ await Promise.all(this.trackers.map(t => t.saveWitnesses(args)))

import { commons, universal, v1, v2 } from '@0xsequence/core'
import { migrator } from '@0xsequence/migration'
import { ethers } from 'ethers'
import { ConfigTracker, PresignedConfig, PresignedConfigLink, SignerSignature } from '../../tracker'
import { Sessions, SignatureType, Transaction, SignerSignature as SessionsSignerSignature } from './sessions.gen'
import { ConfigTracker, PresignedConfig, PresignedConfigLink } from '../../tracker'
import { Sessions, SignatureType, Transaction } from './sessions.gen'

@@ -59,24 +59,16 @@ export class RemoteConfigTracker implements ConfigTracker, migrator.PresignedMigrationTracker {

chainId: ethers.BigNumberish
signatures: string[] | SignerSignature[]
signatures: string[]
}): Promise<void> {
const signerSignatures: SessionsSignerSignature[] = []
for (const signature of args.signatures) {
if (typeof signature === 'string') {
if (!this.onlyRecoverable || commons.signer.canRecover(signature)) {
signerSignatures.push({ signature })
}
} else {
signerSignatures.push({
signer: signature.address,
signature: signature.signature,
referenceChainID: signature.referenceChainId?.toString()
})
}
let filteredSignatures = args.signatures
if (this.onlyRecoverable) {
filteredSignatures = filteredSignatures.filter(signature => {
return commons.signer.canRecover(signature)
})
}
await this.sessions.saveSignerSignatures2({
await this.sessions.saveSignerSignatures({
wallet: args.wallet,
digest: args.digest,
chainID: numberString(args.chainId),
signatures: signerSignatures
signatures: filteredSignatures
})

@@ -83,0 +75,0 @@ }

/* eslint-disable */
// sessions v0.0.1 48681273e3b0249c5feb593b9af1b59dc6a14869
// sessions v0.0.1 67f782e8acfe452f905078a7423ed5d27c6639a8
// --
// Code generated by webrpc-gen@v0.21.3 with typescript generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT.
//
// webrpc-gen -schema=sessions.ridl -target=typescript -client -out=./clients/sessions.gen.ts
export const WebrpcHeader = "Webrpc"
export const WebrpcHeaderValue = "webrpc@v0.21.3;gen-typescript@v0.16.0;sessions@v0.0.1"
// WebRPC description and code-gen version

@@ -134,5 +130,5 @@ export const WebRPCVersion = 'v1'

export interface SignerSignature {
referenceChainID?: string
signer?: string
signature: string
referenceChainID?: string
}

@@ -139,0 +135,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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