Socket
Socket
Sign inDemoInstall

@0xsequence/auth

Package Overview
Dependencies
Maintainers
6
Versions
492
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/auth - npm Package Compare versions

Comparing version 0.0.0-20240812142652 to 0.0.0-20240814043648

37

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

@@ -160,9 +160,6 @@ 'use strict';

const ethAuth = new ethauth.ETHAuth();
const chainId = BigInt(this.settings.sequenceApiChainId);
const found = network.findNetworkConfig(this.account.networks, chainId);
if (!found) {
throw Error('No network found');
}
ethAuth.chainId = Number(chainId);
const network$1 = new ethers.ethers.Network(found.name, chainId);
const chainId = ethers.ethers.BigNumber.from(this.settings.sequenceApiChainId);
const network$1 = network.findNetworkConfig(this.account.networks, chainId);
if (!network$1) throw Error('No network found');
ethAuth.chainId = chainId.toNumber();

@@ -172,4 +169,5 @@ // TODO: Modify ETHAuth so it can take a provider instead of a url

// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.ethers.JsonRpcProvider(utils.getFetchRequest(found.rpcUrl, this.projectAccessKey), network$1, {
staticNetwork: network$1
ethAuth.provider = new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(network$1.rpcUrl, this.projectAccessKey), {
name: '',
chainId: chainId.toNumber()
});

@@ -235,15 +233,12 @@ await ethAuth.decodeProof(proofString);

const ethAuth = new ethauth.ETHAuth();
const chainId = BigInt(this.settings.sequenceApiChainId);
const found = network.findNetworkConfig(this.account.networks, chainId);
if (!found) {
throw Error('No network found');
}
ethAuth.chainId = Number(chainId);
const network$1 = new ethers.ethers.Network(found.name, chainId);
const chainId = ethers.ethers.BigNumber.from(this.settings.sequenceApiChainId);
const network$1 = network.findNetworkConfig(this.account.networks, chainId);
if (!network$1) throw Error('No network found');
ethAuth.chainId = chainId.toNumber();
// TODO: Modify ETHAuth so it can take a provider instead of a url
// -----
// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.ethers.JsonRpcProvider(utils.getFetchRequest(found.rpcUrl, this.projectAccessKey), network$1, {
staticNetwork: network$1
ethAuth.provider = new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(network$1.rpcUrl, this.projectAccessKey), {
name: '',
chainId: chainId.toNumber()
});

@@ -279,3 +274,3 @@ const expiration = this.now() + this.expiration - EXPIRATION_JWT_MARGIN;

const signAuthorization = async (signer, chainId, options) => {
const address = ethers.ethers.getAddress(await signer.getAddress());
const address = ethers.ethers.utils.getAddress(await signer.getAddress());
if (!address || address === '' || address === '0x') {

@@ -522,3 +517,3 @@ throw ErrAccountIsRequired;

const newConfig = account$1.coders.config.editConfig(nextConfig, {
checkpoint: account$1.coders.config.checkpointOf(prevConfig) + 1n
checkpoint: account$1.coders.config.checkpointOf(prevConfig).add(1)
});

@@ -525,0 +520,0 @@ await account$1.updateConfig(newConfig);

@@ -160,9 +160,6 @@ 'use strict';

const ethAuth = new ethauth.ETHAuth();
const chainId = BigInt(this.settings.sequenceApiChainId);
const found = network.findNetworkConfig(this.account.networks, chainId);
if (!found) {
throw Error('No network found');
}
ethAuth.chainId = Number(chainId);
const network$1 = new ethers.ethers.Network(found.name, chainId);
const chainId = ethers.ethers.BigNumber.from(this.settings.sequenceApiChainId);
const network$1 = network.findNetworkConfig(this.account.networks, chainId);
if (!network$1) throw Error('No network found');
ethAuth.chainId = chainId.toNumber();

@@ -172,4 +169,5 @@ // TODO: Modify ETHAuth so it can take a provider instead of a url

// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.ethers.JsonRpcProvider(utils.getFetchRequest(found.rpcUrl, this.projectAccessKey), network$1, {
staticNetwork: network$1
ethAuth.provider = new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(network$1.rpcUrl, this.projectAccessKey), {
name: '',
chainId: chainId.toNumber()
});

@@ -235,15 +233,12 @@ await ethAuth.decodeProof(proofString);

const ethAuth = new ethauth.ETHAuth();
const chainId = BigInt(this.settings.sequenceApiChainId);
const found = network.findNetworkConfig(this.account.networks, chainId);
if (!found) {
throw Error('No network found');
}
ethAuth.chainId = Number(chainId);
const network$1 = new ethers.ethers.Network(found.name, chainId);
const chainId = ethers.ethers.BigNumber.from(this.settings.sequenceApiChainId);
const network$1 = network.findNetworkConfig(this.account.networks, chainId);
if (!network$1) throw Error('No network found');
ethAuth.chainId = chainId.toNumber();
// TODO: Modify ETHAuth so it can take a provider instead of a url
// -----
// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.ethers.JsonRpcProvider(utils.getFetchRequest(found.rpcUrl, this.projectAccessKey), network$1, {
staticNetwork: network$1
ethAuth.provider = new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(network$1.rpcUrl, this.projectAccessKey), {
name: '',
chainId: chainId.toNumber()
});

@@ -279,3 +274,3 @@ const expiration = this.now() + this.expiration - EXPIRATION_JWT_MARGIN;

const signAuthorization = async (signer, chainId, options) => {
const address = ethers.ethers.getAddress(await signer.getAddress());
const address = ethers.ethers.utils.getAddress(await signer.getAddress());
if (!address || address === '' || address === '0x') {

@@ -522,3 +517,3 @@ throw ErrAccountIsRequired;

const newConfig = account$1.coders.config.editConfig(nextConfig, {
checkpoint: account$1.coders.config.checkpointOf(prevConfig) + 1n
checkpoint: account$1.coders.config.checkpointOf(prevConfig).add(1)
});

@@ -525,0 +520,0 @@ await account$1.updateConfig(newConfig);

@@ -8,3 +8,3 @@ import { ethers } from 'ethers';

import { SequenceMetadata } from '@0xsequence/metadata';
import { getFetchRequest, jwtDecodeClaims } from '@0xsequence/utils';
import { getEthersConnectionInfo, jwtDecodeClaims } from '@0xsequence/utils';
import { trackers } from '@0xsequence/sessions';

@@ -157,9 +157,6 @@ import { Orchestrator } from '@0xsequence/signhub';

const ethAuth = new ETHAuth();
const chainId = BigInt(this.settings.sequenceApiChainId);
const found = findNetworkConfig(this.account.networks, chainId);
if (!found) {
throw Error('No network found');
}
ethAuth.chainId = Number(chainId);
const network = new ethers.Network(found.name, chainId);
const chainId = ethers.BigNumber.from(this.settings.sequenceApiChainId);
const network = findNetworkConfig(this.account.networks, chainId);
if (!network) throw Error('No network found');
ethAuth.chainId = chainId.toNumber();

@@ -169,4 +166,5 @@ // TODO: Modify ETHAuth so it can take a provider instead of a url

// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.JsonRpcProvider(getFetchRequest(found.rpcUrl, this.projectAccessKey), network, {
staticNetwork: network
ethAuth.provider = new ethers.providers.StaticJsonRpcProvider(getEthersConnectionInfo(network.rpcUrl, this.projectAccessKey), {
name: '',
chainId: chainId.toNumber()
});

@@ -232,15 +230,12 @@ await ethAuth.decodeProof(proofString);

const ethAuth = new ETHAuth();
const chainId = BigInt(this.settings.sequenceApiChainId);
const found = findNetworkConfig(this.account.networks, chainId);
if (!found) {
throw Error('No network found');
}
ethAuth.chainId = Number(chainId);
const network = new ethers.Network(found.name, chainId);
const chainId = ethers.BigNumber.from(this.settings.sequenceApiChainId);
const network = findNetworkConfig(this.account.networks, chainId);
if (!network) throw Error('No network found');
ethAuth.chainId = chainId.toNumber();
// TODO: Modify ETHAuth so it can take a provider instead of a url
// -----
// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.JsonRpcProvider(getFetchRequest(found.rpcUrl, this.projectAccessKey), network, {
staticNetwork: network
ethAuth.provider = new ethers.providers.StaticJsonRpcProvider(getEthersConnectionInfo(network.rpcUrl, this.projectAccessKey), {
name: '',
chainId: chainId.toNumber()
});

@@ -276,3 +271,3 @@ const expiration = this.now() + this.expiration - EXPIRATION_JWT_MARGIN;

const signAuthorization = async (signer, chainId, options) => {
const address = ethers.getAddress(await signer.getAddress());
const address = ethers.utils.getAddress(await signer.getAddress());
if (!address || address === '' || address === '0x') {

@@ -519,3 +514,3 @@ throw ErrAccountIsRequired;

const newConfig = account.coders.config.editConfig(nextConfig, {
checkpoint: account.coders.config.checkpointOf(prevConfig) + 1n
checkpoint: account.coders.config.checkpointOf(prevConfig).add(1)
});

@@ -522,0 +517,0 @@ await account.updateConfig(newConfig);

{
"name": "@0xsequence/auth",
"version": "0.0.0-20240812142652",
"version": "0.0.0-20240814043648",
"description": "auth sub-package for Sequence",

@@ -12,26 +12,26 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/auth",

"dependencies": {
"@0xsequence/ethauth": "^1.0.0",
"@0xsequence/abi": "0.0.0-20240812142652",
"@0xsequence/account": "0.0.0-20240812142652",
"@0xsequence/api": "0.0.0-20240812142652",
"@0xsequence/core": "0.0.0-20240812142652",
"@0xsequence/indexer": "0.0.0-20240812142652",
"@0xsequence/metadata": "0.0.0-20240812142652",
"@0xsequence/migration": "0.0.0-20240812142652",
"@0xsequence/network": "0.0.0-20240812142652",
"@0xsequence/sessions": "0.0.0-20240812142652",
"@0xsequence/signhub": "0.0.0-20240812142652",
"@0xsequence/wallet": "0.0.0-20240812142652",
"@0xsequence/utils": "0.0.0-20240812142652"
"@0xsequence/ethauth": "^0.8.1",
"@0xsequence/abi": "0.0.0-20240814043648",
"@0xsequence/account": "0.0.0-20240814043648",
"@0xsequence/api": "0.0.0-20240814043648",
"@0xsequence/core": "0.0.0-20240814043648",
"@0xsequence/indexer": "0.0.0-20240814043648",
"@0xsequence/metadata": "0.0.0-20240814043648",
"@0xsequence/migration": "0.0.0-20240814043648",
"@0xsequence/network": "0.0.0-20240814043648",
"@0xsequence/sessions": "0.0.0-20240814043648",
"@0xsequence/signhub": "0.0.0-20240814043648",
"@0xsequence/wallet": "0.0.0-20240814043648",
"@0xsequence/utils": "0.0.0-20240814043648"
},
"peerDependencies": {
"ethers": ">=6"
"ethers": ">=5.5 < 6"
},
"devDependencies": {
"@0xsequence/wallet-contracts": "^3.0.1",
"@0xsequence/wallet-contracts": "^1.10.0",
"concurrently": "^7.5.0",
"ethers": "^6.13.0",
"ethers": "^5.7.2",
"hardhat": "^2.20.1",
"mockttp": "^3.6.0",
"@0xsequence/tests": "0.0.0-20240812142652"
"@0xsequence/tests": "0.0.0-20240814043648"
},

@@ -45,3 +45,3 @@ "files": [

"test:run": "pnpm test:file tests/**/*.spec.ts",
"test:file": "NODE_OPTIONS='--import tsx' mocha --timeout 60000",
"test:file": "NODE_OPTIONS='--import tsx' mocha --timeout 30000",
"test:concurrently": "concurrently -k --success first 'pnpm start:hardhat > /dev/null' ",

@@ -48,0 +48,0 @@ "start:hardhat": "hardhat node --port 9546",

@@ -38,3 +38,3 @@ import { ethers } from 'ethers'

): Promise<ETHAuthProof> => {
const address = ethers.getAddress(await signer.getAddress())
const address = ethers.utils.getAddress(await signer.getAddress())
if (!address || address === '' || address === '0x') {

@@ -41,0 +41,0 @@ throw ErrAccountIsRequired

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

): ValidatorFunc => {
return async (_provider: ethers.JsonRpcProvider, chainId: number, proof: Proof): Promise<{ isValid: boolean }> => {
return async (_provider: ethers.providers.JsonRpcProvider, chainId: number, proof: Proof): Promise<{ isValid: boolean }> => {
const digest = proof.messageDigest()

@@ -14,0 +14,0 @@ const isValid = await readerFor(chainId).isValidSignature(proof.address, digest, proof.signature)

@@ -7,3 +7,3 @@ import { Account } from '@0xsequence/account'

import { ChainIdLike, findNetworkConfig } from '@0xsequence/network'
import { getFetchRequest } from '@0xsequence/utils'
import { getEthersConnectionInfo } from '@0xsequence/utils'
import { ethers } from 'ethers'

@@ -205,17 +205,17 @@

const ethAuth = new ETHAuth()
const chainId = BigInt(this.settings.sequenceApiChainId)
const found = findNetworkConfig(this.account.networks, chainId)
if (!found) {
throw Error('No network found')
}
ethAuth.chainId = Number(chainId)
const chainId = ethers.BigNumber.from(this.settings.sequenceApiChainId)
const network = findNetworkConfig(this.account.networks, chainId)
if (!network) throw Error('No network found')
ethAuth.chainId = chainId.toNumber()
const network = new ethers.Network(found.name, chainId)
// TODO: Modify ETHAuth so it can take a provider instead of a url
// -----
// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.JsonRpcProvider(getFetchRequest(found.rpcUrl, this.projectAccessKey), network, {
staticNetwork: network
})
ethAuth.provider = new ethers.providers.StaticJsonRpcProvider(
getEthersConnectionInfo(network.rpcUrl, this.projectAccessKey),
{
name: '',
chainId: chainId.toNumber()
}
)

@@ -295,17 +295,16 @@ await ethAuth.decodeProof(proofString)

const ethAuth = new ETHAuth()
const chainId = BigInt(this.settings.sequenceApiChainId)
const found = findNetworkConfig(this.account.networks, chainId)
if (!found) {
throw Error('No network found')
}
ethAuth.chainId = Number(chainId)
const network = new ethers.Network(found.name, chainId)
const chainId = ethers.BigNumber.from(this.settings.sequenceApiChainId)
const network = findNetworkConfig(this.account.networks, chainId)
if (!network) throw Error('No network found')
ethAuth.chainId = chainId.toNumber()
// TODO: Modify ETHAuth so it can take a provider instead of a url
// -----
// Can't pass jwt here since this is used for getting the jwt
ethAuth.provider = new ethers.JsonRpcProvider(getFetchRequest(found.rpcUrl, this.projectAccessKey), network, {
staticNetwork: network
})
ethAuth.provider = new ethers.providers.StaticJsonRpcProvider(
getEthersConnectionInfo(network.rpcUrl, this.projectAccessKey),
{
name: '',
chainId: chainId.toNumber()
}
)

@@ -312,0 +311,0 @@ const expiration = this.now() + this.expiration - EXPIRATION_JWT_MARGIN

@@ -263,3 +263,3 @@ import { ChainId, NetworkConfig, allNetworks, findNetworkConfig } from '@0xsequence/network'

const newConfig = account.coders.config.editConfig(nextConfig, {
checkpoint: account.coders.config.checkpointOf(prevConfig) + 1n
checkpoint: account.coders.config.checkpointOf(prevConfig).add(1)
})

@@ -266,0 +266,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