Releases: spruceid/ssx
ssx/v2.1.0
2.1.0
Minor Changes
-
c942c3c: This adds the Credentials Modules, which allows developers to fetch credentials issued on SpruceKit Credential Issuer.
This module requires Storage Module, so you must enable both to make it work.const ssx = SSX({ modules: { storage: true, credentials: true, }, }); await ssx.signIn(); const { data } = ssx.credentials.list();
ssx-react/v2.0.2
ssx/2.0.1
ssx-react/v2.0.1
ssx/v2.0.0
2.0.0
Major rework of the library architecture
SSX is now composed of modules that add significant functionality improvements. The previous functions of SSX were moved into a new module called UserAuthorization and will, from now on, be responsible for end-user signing-related operations.
A new module was added, Storage, which provides functionality to store and retrieve data in Kepler. Kepler is architected as a decentralized storage system that uses DIDs and Authorization Capabilities to define where your data lives and who has access.
Improved tests
To keep improving the library, additional tests were added.
Updated dependencies
Updated several libraries to address deprecation issues and possible vulnerabilities.
⚠ You can check here for the latest documentation. ⚠
ssx-server/v2.0.0
2.0.0
- Added stricter checks on nonces
- SSX middleware was moved back to the server package
ssx-react/v2.0.0
2.0.0
Major rework to enable customizability
@spruceid/ssx-react
no longer depends on wagmi
. Instead, function hooks must be defined and used as arguments to the component.
onChangeAccount
property no longer exists. Replaced by thewatchProvider
property, which now allows for more customizability.web3Provider.providerLoaded
property was also removed. The new architecture assumes the provider no longer needs to be initialized, and callback functions will be called when changes occur.useSSX
now returns thessx
instance and theprovider
.- Now
watchProvider
is the new interface for listening to provider changes. The developer must set up this function to be called whenever an interaction with the user happens. An example of how to do it can be found here.
import React from 'react';
import ReactDOM from 'react-dom/client';
import { WagmiConfig, useWalletClient } from 'wagmi';
import { Web3Modal } from '@web3modal/react';
import { SSXProvider } from '@spruceid/ssx-react';
import { EthereumClient, w3mConnectors, w3mProvider } from '@web3modal/ethereum';
import { configureChains, createConfig } from 'wagmi';
import { polygon, mainnet, goerli, sepolia } from 'wagmi/chains';
import { type WalletClient } from '@wagmi/core';
import { providers } from 'ethers';
// 1. Get projectID at https://cloud.walletconnect.com
if (!process.env.REACT_APP_PROJECT_ID) {
console.error('You need to provide REACT_APP_PROJECT_ID env variable');
}
export const projectId = process.env.REACT_APP_PROJECT_ID ?? "";
// 2. Configure wagmi client
const chains = [mainnet, goerli, sepolia, polygon];
const { publicClient } = configureChains(chains, [w3mProvider({ projectId })]);
export const wagmiConfig = createConfig({
autoConnect: false,
connectors: w3mConnectors({ projectId, chains }),
publicClient
});
// 3. Configure modal ethereum client
export const ethereumClient = new EthereumClient(wagmiConfig, chains);
export function walletClientToEthers5Signer(walletClient: WalletClient) {
const { account, chain, transport } = walletClient
const network = {
chainId: chain.id,
name: chain.name,
ensAddress: chain.contracts?.ensRegistry?.address,
}
const provider = new providers.Web3Provider(transport, network)
const signer = provider.getSigner(account.address)
return signer
}
function SSXWithoutWatchProvider({ children }: any) {
const { data: walletClient } = useWalletClient();
const web3Provider = { provider: walletClient };
return (
<SSXProvider
ssxConfig={{ siweConfig: { domain: 'localhost:3000' }}}
web3Provider={web3Provider}>
{children}
</SSXProvider>
);
}
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<WagmiConfig config={wagmiConfig}>
<SSXWithoutWatchProvider>
/* your code goes here */
</SSXWithoutWatchProvider>
</WagmiConfig>
<Web3ModalV2 projectId={projectId} ethereumClient={ethereumClient} />
</React.StrictMode>
);
You can check here a more detailed example.
Updated dependencies
Updated several dependencies.
ssx-core/v2.0.0
2.0.0
- Added new types to support the new structure
- The package
@spruceid/ssx-gnosis-extension
had its code moved to this library.
ssx/v1.2.5
1.2.5
Patch Changes
- Updated dependencies [94cee9c]
- Updated dependencies [c1f0720]
- Updated dependencies [7f0343b]
- Updated dependencies [ef51b85]
- Updated dependencies [0274cdf]
- @spruceid/[email protected]
- @spruceid/[email protected]
ssx-serverless/v1.2.3
1.2.3
Patch Changes
- Updated dependencies [94cee9c]
- Updated dependencies [c1f0720]
- Updated dependencies [7f0343b]
- Updated dependencies [ef51b85]
- Updated dependencies [0274cdf]
- @spruceid/[email protected]
- @spruceid/[email protected]