zksync-sso-connector-export 0.1.0
Install from the command line:
Learn more about npm packages
$ npm install @matter-labs/zksync-sso-connector-export@0.1.0
Install via package.json:
"@matter-labs/zksync-sso-connector-export": "0.1.0"
About this version
This package exports the ZKsync SSO connector with embedded Era Test Node support, eliminating the need to manually import and configure the era-test-node chain.
npm install zksync-sso-wagmi-connector
# or
pnpm add zksync-sso-wagmi-connector
# or
yarn add zksync-sso-wagmi-connector
The connector now automatically includes the Era Test Node (chain ID 260) configuration:
import { createConfig, http } from "@wagmi/core";
import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";
const wagmiConfig = createConfig({
chains: [eraTestNode], // Era test node is now exported directly
connectors: [
zksyncSsoConnector({
authServerUrl: "http://localhost:3002/confirm",
session: {
feeLimit: parseEther("0.1"),
transfers: [
{
to: "0x55bE1B079b53962746B2e86d12f158a41DF294A6",
valueLimit: parseEther("0.1"),
},
],
},
}),
],
transports: {
[eraTestNode.id]: http(),
},
});
You can disable the automatic Era Test Node inclusion if you want to configure chains manually:
import { zksyncSsoConnector } from "zksync-sso-wagmi-connector";
import { zksyncSepoliaTestnet } from "@wagmi/core/chains";
const connector = zksyncSsoConnector({
includeEraTestNode: false, // Disable automatic era-test-node inclusion
authServerUrl: "https://auth.zksync.dev/confirm",
// ... other options
});
const wagmiConfig = createConfig({
chains: [zksyncSepoliaTestnet], // Use your own chain configuration
connectors: [connector],
transports: {
[zksyncSepoliaTestnet.id]: http(),
},
});
Enhanced ZKsync SSO connector that automatically includes the era-test-node configuration.
All options from the original ZksyncSsoConnectorOptions
plus:
-
includeEraTestNode?: boolean
- Whether to include the era-test-node chain automatically. Defaults totrue
.
The Era Test Node chain definition (chain ID 260) that can be used directly in your wagmi configuration.
{
id: 260,
name: "ZKsync Era Test Node",
nativeCurrency: {
name: "Ether",
symbol: "ETH",
decimals: 18,
},
rpcUrls: {
default: {
http: ["http://localhost:8011"],
},
},
testnet: true,
// ... additional ZKsync-specific configuration
}
If you were previously importing the era-test-node chain manually:
Before:
import { zksyncSsoConnector } from "zksync-sso/connector";
import { zksyncInMemoryNode } from "@wagmi/core/chains";
const wagmiConfig = createConfig({
chains: [zksyncInMemoryNode],
connectors: [zksyncSsoConnector(options)],
// ...
});
After:
import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";
const wagmiConfig = createConfig({
chains: [eraTestNode], // Now exported directly from the connector package
connectors: [zksyncSsoConnector(options)], // Same API, but with era-test-node embedded
// ...
});
- Node.js 18+
- ZKsync SSO SDK
- Viem ^2.30.0
- Wagmi ^2.0.0
MIT
Details
- zksync-sso-connector-export
-
matter-labs
- about 1 month ago
- MIT
- 3 dependencies
Assets
- zksync-sso-connector-export-0.1.0.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0