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

@0xsequence/account

Package Overview
Dependencies
Maintainers
6
Versions
301
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/account - npm Package Compare versions

Comparing version 0.0.0-20241114193556 to 0.0.0-20241216114019

58

dist/0xsequence-account.cjs.dev.js

@@ -15,9 +15,14 @@ 'use strict';

function _extends() {
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]);
_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 n;
}, _extends.apply(null, arguments);
return target;
};
return _extends.apply(this, arguments);
}

@@ -528,3 +533,3 @@

const decoded = this.coders.signature.decode(signature);
const signatures = this.coders.signature.signaturesOfDecoded(decoded);
const signatures = this.coders.signature.signaturesOf(decoded);
if (signatures.length === 0) {

@@ -540,12 +545,25 @@ throw new Error('No signatures found');

}
async publishWitness() {
async publishWitness(chainId = 0, referenceChainId) {
const digest = ethers.ethers.id(`This is a Sequence account woo! ${Date.now()}`);
const signature = await this.signDigest(digest, 0, false);
// Apply ERC-6492 to undeployed children
const signature = await this.signDigest(digest, 0, false, 'ignore', {
chainId,
referenceChainId,
cantValidateBehavior: "eip6492"
});
const decoded = this.coders.signature.decode(signature);
const signatures = this.coders.signature.signaturesOfDecoded(decoded);
const recovered = await this.coders.signature.recover(decoded, {
digest,
chainId,
address: this.address
}, undefined, 'ignore');
const signatures = this.coders.signature.signaturesOf(recovered.config);
const signaturesWithReferenceChainId = signatures.map(s => _extends({}, s, {
referenceChainId
}));
return this.tracker.saveWitnesses({
wallet: this.address,
digest,
chainId: 0,
signatures
chainId,
signatures: signaturesWithReferenceChainId
});

@@ -666,3 +684,4 @@ }

nextConfig: config,
signature
signature,
referenceChainId: 1
});

@@ -707,4 +726,2 @@

}
console.log('chainId', chainId);
console.log('skale-nebula', network.ChainId.SKALE_NEBULA);

@@ -859,5 +876,5 @@ // Wallet deployment will vary depending on the version

}
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback) {
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
if (!Array.isArray(signedBundle)) {
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback);
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
}

@@ -868,3 +885,3 @@ const status = pstatus || (await this.status(chainId));

callback == null || callback(decoratedBundle);
return this.relayer(chainId).relay(decoratedBundle, quote);
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey);
}

@@ -910,3 +927,4 @@ async fillGasLimits(txs, chainId, status) {

const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
simulate: args.simulateForFeeOptions
simulate: args.simulateForFeeOptions,
projectAccessKey: args.projectAccessKey
});

@@ -934,3 +952,3 @@ const flatDecorated = core.commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions);

bundles.push(...childBundles.filter(b => b.transactions.length > 0));
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback);
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
}

@@ -937,0 +955,0 @@ async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {

@@ -15,9 +15,14 @@ 'use strict';

function _extends() {
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]);
_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 n;
}, _extends.apply(null, arguments);
return target;
};
return _extends.apply(this, arguments);
}

@@ -528,3 +533,3 @@

const decoded = this.coders.signature.decode(signature);
const signatures = this.coders.signature.signaturesOfDecoded(decoded);
const signatures = this.coders.signature.signaturesOf(decoded);
if (signatures.length === 0) {

@@ -540,12 +545,25 @@ throw new Error('No signatures found');

}
async publishWitness() {
async publishWitness(chainId = 0, referenceChainId) {
const digest = ethers.ethers.id(`This is a Sequence account woo! ${Date.now()}`);
const signature = await this.signDigest(digest, 0, false);
// Apply ERC-6492 to undeployed children
const signature = await this.signDigest(digest, 0, false, 'ignore', {
chainId,
referenceChainId,
cantValidateBehavior: "eip6492"
});
const decoded = this.coders.signature.decode(signature);
const signatures = this.coders.signature.signaturesOfDecoded(decoded);
const recovered = await this.coders.signature.recover(decoded, {
digest,
chainId,
address: this.address
}, undefined, 'ignore');
const signatures = this.coders.signature.signaturesOf(recovered.config);
const signaturesWithReferenceChainId = signatures.map(s => _extends({}, s, {
referenceChainId
}));
return this.tracker.saveWitnesses({
wallet: this.address,
digest,
chainId: 0,
signatures
chainId,
signatures: signaturesWithReferenceChainId
});

@@ -666,3 +684,4 @@ }

nextConfig: config,
signature
signature,
referenceChainId: 1
});

@@ -707,4 +726,2 @@

}
console.log('chainId', chainId);
console.log('skale-nebula', network.ChainId.SKALE_NEBULA);

@@ -859,5 +876,5 @@ // Wallet deployment will vary depending on the version

}
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback) {
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
if (!Array.isArray(signedBundle)) {
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback);
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
}

@@ -868,3 +885,3 @@ const status = pstatus || (await this.status(chainId));

callback == null || callback(decoratedBundle);
return this.relayer(chainId).relay(decoratedBundle, quote);
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey);
}

@@ -910,3 +927,4 @@ async fillGasLimits(txs, chainId, status) {

const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
simulate: args.simulateForFeeOptions
simulate: args.simulateForFeeOptions,
projectAccessKey: args.projectAccessKey
});

@@ -934,3 +952,3 @@ const flatDecorated = core.commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions);

bundles.push(...childBundles.filter(b => b.transactions.length > 0));
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback);
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
}

@@ -937,0 +955,0 @@ async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {

@@ -11,9 +11,14 @@ import { walletContracts } from '@0xsequence/abi';

function _extends() {
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]);
_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 n;
}, _extends.apply(null, arguments);
return target;
};
return _extends.apply(this, arguments);
}

@@ -524,3 +529,3 @@

const decoded = this.coders.signature.decode(signature);
const signatures = this.coders.signature.signaturesOfDecoded(decoded);
const signatures = this.coders.signature.signaturesOf(decoded);
if (signatures.length === 0) {

@@ -536,12 +541,25 @@ throw new Error('No signatures found');

}
async publishWitness() {
async publishWitness(chainId = 0, referenceChainId) {
const digest = ethers.id(`This is a Sequence account woo! ${Date.now()}`);
const signature = await this.signDigest(digest, 0, false);
// Apply ERC-6492 to undeployed children
const signature = await this.signDigest(digest, 0, false, 'ignore', {
chainId,
referenceChainId,
cantValidateBehavior: "eip6492"
});
const decoded = this.coders.signature.decode(signature);
const signatures = this.coders.signature.signaturesOfDecoded(decoded);
const recovered = await this.coders.signature.recover(decoded, {
digest,
chainId,
address: this.address
}, undefined, 'ignore');
const signatures = this.coders.signature.signaturesOf(recovered.config);
const signaturesWithReferenceChainId = signatures.map(s => _extends({}, s, {
referenceChainId
}));
return this.tracker.saveWitnesses({
wallet: this.address,
digest,
chainId: 0,
signatures
chainId,
signatures: signaturesWithReferenceChainId
});

@@ -662,3 +680,4 @@ }

nextConfig: config,
signature
signature,
referenceChainId: 1
});

@@ -703,4 +722,2 @@

}
console.log('chainId', chainId);
console.log('skale-nebula', ChainId.SKALE_NEBULA);

@@ -855,5 +872,5 @@ // Wallet deployment will vary depending on the version

}
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback) {
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
if (!Array.isArray(signedBundle)) {
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback);
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
}

@@ -864,3 +881,3 @@ const status = pstatus || (await this.status(chainId));

callback == null || callback(decoratedBundle);
return this.relayer(chainId).relay(decoratedBundle, quote);
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey);
}

@@ -906,3 +923,4 @@ async fillGasLimits(txs, chainId, status) {

const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
simulate: args.simulateForFeeOptions
simulate: args.simulateForFeeOptions,
projectAccessKey: args.projectAccessKey
});

@@ -930,3 +948,3 @@ const flatDecorated = commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions);

bundles.push(...childBundles.filter(b => b.transactions.length > 0));
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback);
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
}

@@ -933,0 +951,0 @@ async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {

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

};
export type AccountCoders = {
signature: commons.signature.SignatureCoder;
config: commons.config.ConfigCoder;
};
export interface PreparedTransactions {

@@ -71,6 +75,3 @@ transactions: commons.transaction.SimulatedTransaction[];

get version(): number;
get coders(): {
signature: commons.signature.SignatureCoder;
config: commons.config.ConfigCoder;
};
get coders(): AccountCoders;
network(chainId: ethers.BigNumberish): NetworkConfig;

@@ -84,3 +85,3 @@ providerFor(chainId: ethers.BigNumberish): ethers.Provider;

walletForStatus(chainId: ethers.BigNumberish, status: Pick<AccountStatus, 'version'> & Pick<AccountStatus, 'config'>): Wallet;
walletFor(chainId: ethers.BigNumberish, context: commons.context.WalletContext, config: commons.config.Config, coders: typeof this.coders): Wallet;
walletFor(chainId: ethers.BigNumberish, context: commons.context.WalletContext, config: commons.config.Config, coders: AccountCoders): Wallet;
status(chainId: ethers.BigNumberish, longestPath?: boolean): Promise<AccountStatus>;

@@ -93,3 +94,3 @@ private mustBeFullyMigrated;

publishWitnessFor(signers: string[], chainId?: ethers.BigNumberish): Promise<void>;
publishWitness(): Promise<void>;
publishWitness(chainId?: ethers.BigNumberish, referenceChainId?: ethers.BigNumberish): Promise<void>;
signDigest(digest: ethers.BytesLike, chainId: ethers.BigNumberish, decorate?: boolean, cantValidateBehavior?: 'ignore' | 'eip6492' | 'throw', metadata?: object): Promise<string>;

@@ -135,6 +136,7 @@ buildOnChainSignature(digest: ethers.BytesLike): {

}>;
sendSignedTransactions(signedBundle: commons.transaction.IntendedTransactionBundle | commons.transaction.IntendedTransactionBundle[], chainId: ethers.BigNumberish, quote?: FeeQuote, pstatus?: AccountStatus, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void): Promise<ethers.TransactionResponse>;
sendSignedTransactions(signedBundle: commons.transaction.IntendedTransactionBundle | commons.transaction.IntendedTransactionBundle[], chainId: ethers.BigNumberish, quote?: FeeQuote, pstatus?: AccountStatus, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void, projectAccessKey?: string): Promise<ethers.TransactionResponse>;
fillGasLimits(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, status?: AccountStatus): Promise<commons.transaction.SimulatedTransaction[]>;
gasRefundQuotes(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, stubSignatureOverrides: Map<string, string>, status?: AccountStatus, options?: {
simulate?: boolean;
projectAccessKey?: string;
}): Promise<{

@@ -150,2 +152,3 @@ options: FeeOption[];

simulateForFeeOptions?: boolean;
projectAccessKey?: string;
}): Promise<PreparedTransactions>;

@@ -155,2 +158,3 @@ sendTransaction(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, quote?: FeeQuote, skipPreDecorate?: boolean, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void, options?: {

serial?: boolean;
projectAccessKey?: string;
}): Promise<ethers.TransactionResponse | undefined>;

@@ -157,0 +161,0 @@ signTypedData(domain: ethers.TypedDataDomain, types: Record<string, Array<ethers.TypedDataField>>, message: Record<string, any>, chainId: ethers.BigNumberish, cantValidateBehavior?: 'ignore' | 'eip6492' | 'throw'): Promise<string>;

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

@@ -15,10 +15,10 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/account",

"dependencies": {
"@0xsequence/abi": "0.0.0-20241114193556",
"@0xsequence/core": "0.0.0-20241114193556",
"@0xsequence/migration": "0.0.0-20241114193556",
"@0xsequence/network": "0.0.0-20241114193556",
"@0xsequence/relayer": "0.0.0-20241114193556",
"@0xsequence/sessions": "0.0.0-20241114193556",
"@0xsequence/utils": "0.0.0-20241114193556",
"@0xsequence/wallet": "0.0.0-20241114193556"
"@0xsequence/network": "0.0.0-20241216114019",
"@0xsequence/sessions": "0.0.0-20241216114019",
"@0xsequence/utils": "0.0.0-20241216114019",
"@0xsequence/wallet": "0.0.0-20241216114019",
"@0xsequence/core": "0.0.0-20241216114019",
"@0xsequence/migration": "0.0.0-20241216114019",
"@0xsequence/relayer": "0.0.0-20241216114019",
"@0xsequence/abi": "0.0.0-20241216114019"
},

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

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

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

@@ -64,2 +64,7 @@ import { walletContracts } from '@0xsequence/abi'

export type AccountCoders = {
signature: commons.signature.SignatureCoder
config: commons.config.ConfigCoder
}
export interface PreparedTransactions {

@@ -168,6 +173,3 @@ transactions: commons.transaction.SimulatedTransaction[]

get coders(): {
signature: commons.signature.SignatureCoder
config: commons.config.ConfigCoder
} {
get coders(): AccountCoders {
const lastMigration = this.migrator.lastMigration()

@@ -249,3 +251,3 @@

config: commons.config.Config,
coders: typeof this.coders
coders: AccountCoders,
): Wallet {

@@ -511,5 +513,4 @@ const isNetworkZero = BigInt(chainId) === 0n

const signature = await wallet.signDigest(digest)
const decoded = this.coders.signature.decode(signature)
const signatures = this.coders.signature.signaturesOfDecoded(decoded)
const signatures = this.coders.signature.signaturesOf(decoded)

@@ -523,8 +524,11 @@ if (signatures.length === 0) {

async publishWitness(): Promise<void> {
async publishWitness(chainId: ethers.BigNumberish = 0, referenceChainId?: ethers.BigNumberish): Promise<void> {
const digest = ethers.id(`This is a Sequence account woo! ${Date.now()}`)
const signature = await this.signDigest(digest, 0, false)
// Apply ERC-6492 to undeployed children
const signature = await this.signDigest(digest, 0, false, 'ignore', {chainId, referenceChainId, cantValidateBehavior: "eip6492"})
const decoded = this.coders.signature.decode(signature)
const signatures = this.coders.signature.signaturesOfDecoded(decoded)
return this.tracker.saveWitnesses({ wallet: this.address, digest, chainId: 0, signatures })
const recovered = await this.coders.signature.recover(decoded, { digest, chainId, address: this.address }, undefined, 'ignore')
const signatures = this.coders.signature.signaturesOf(recovered.config)
const signaturesWithReferenceChainId = signatures.map(s => ({...s, referenceChainId}))
return this.tracker.saveWitnesses({ wallet: this.address, digest, chainId, signatures: signaturesWithReferenceChainId })
}

@@ -673,3 +677,4 @@

nextConfig: config,
signature
signature,
referenceChainId: 1
})

@@ -716,5 +721,2 @@

console.log('chainId', chainId)
console.log('skale-nebula', ChainId.SKALE_NEBULA)
// Wallet deployment will vary depending on the version

@@ -893,6 +895,7 @@ // so we need to use the context to get the correct deployment

pstatus?: AccountStatus,
callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void
callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void,
projectAccessKey?: string
): Promise<ethers.TransactionResponse> {
if (!Array.isArray(signedBundle)) {
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback)
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey)
}

@@ -905,3 +908,3 @@ const status = pstatus || (await this.status(chainId))

return this.relayer(chainId).relay(decoratedBundle, quote)
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey)
}

@@ -925,2 +928,3 @@

simulate?: boolean
projectAccessKey?: string
}

@@ -968,2 +972,3 @@ ): Promise<{

simulateForFeeOptions?: boolean
projectAccessKey?: string
}): Promise<PreparedTransactions> {

@@ -974,3 +979,4 @@ const status = await this.status(args.chainId)

const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
simulate: args.simulateForFeeOptions
simulate: args.simulateForFeeOptions,
projectAccessKey: args.projectAccessKey
})

@@ -996,2 +1002,3 @@ const flatDecorated = commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions)

serial?: boolean
projectAccessKey?: string
}

@@ -1013,3 +1020,3 @@ ): Promise<ethers.TransactionResponse | undefined> {

return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback)
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options?.projectAccessKey)
}

@@ -1016,0 +1023,0 @@

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