snapshot-safe-sync
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

snapshot-safe-synchronizer

npm package Build Status Downloads Issues Commitizen Friendly Semantic Release

Synchronize Snapshot ⚡ and Safe{Wallet} backends for offchain signatures

The EIP-1271 is now supported for offchain signatures by both snapshot & safe backends.

However, Snapshot is not pulling signatures from safe after having collected all required signatures. This script is pulling signed messages from safe and pushing them to snapshot, after a small transformation to validate the payload.

You can run this script as a cron job to keep your snapshot proposals up to date with the latest signatures, or run it manually after you have collected all required signatures.

Getting started

You can run the script on the fly with npx:

npx snapshot-safe-sync <address-or-ens>

The CLI accept an optional --rpc-url to resolve the ENS. By default, the script is using the MAINNET_RPC_URL env variable, and fallbacks on the the default rpc of ethers

npx snapshot-safe-sync <address-or-ens> --rpc-url <rpc-url>

Or call the function in a script:

const { getDefaultProvider } = require('ethers');
const { syncBackends } = require('snapshot-safe-sync');

const provider = getDefaultProvider();

syncBackends('<address-or-ens>', provider);

Or, with a module import:

import { getDefaultProvider } from 'ethers';
import { syncBackends } from 'snapshot-safe-sync';

syncBackends('<address-or-ens>', getDefaultProvider(process.env.MAINNET_RPC_URL));

you can set a RPC_URL to resolve the ENS. By default, the script is using the default rpc of ethers

Warning The script is build only for mainnet.

Package Sidebar

Install

npm i snapshot-safe-sync

Weekly Downloads

2

Version

1.1.2

License

MIT

Unpacked Size

28.8 kB

Total Files

15

Last publish

Collaborators

  • morpho-labs-npm