@rocketh/unknown-signer
v0.20.2
Published
catchUnknownSigner for rocketh: capture calls your deployer cannot sign, for execution by a Safe or other multisig.
Downloads
1,402
Maintainers
Readme
@rocketh/unknown-signer
catchUnknownSigner and withUnknownSignerPolicy for rocketh. When a transaction's from is an account rocketh cannot sign for (a Safe, a timelock, an unplugged hardware wallet), rocketh by default pauses, prints the transaction and checks the hash you paste back, with nothing to install. This package is for the other workflow: catchUnknownSigner hands the transaction back as a value and lets the script carry on (hardhat-deploy v1's helper, for migrating a v1 script or a run that must never block), and withUnknownSignerPolicy sets the policy for one call.
Installation
pnpm add -D @rocketh/unknown-signer
# or
npm install --save-dev @rocketh/unknown-signerWiring it up
@rocketh/unknown-signer is an extension: spread it into extensions in rocketh/config.ts, and your deploy scripts receive its functions.
// rocketh/config.ts
import * as deployExtension from '@rocketh/deploy';
import * as unknownSignerExtension from '@rocketh/unknown-signer';
const extensions = {...deployExtension, ...unknownSignerExtension};
export {extensions};Example
const deferred = await catchUnknownSigner(() =>
deployViaProxy('Vault', {account: deployer, artifact: artifacts.Vault, args: []}, {owner: safe}),
);
if (deferred) {
// {from, to, value, data}: execute it on the Safe, then run the script again
}Unlike v1, the action is a function (() => deployViaProxy(...)), never a promise. UnknownSignerError is on the @rocketh/unknown-signer/errors subpath.
Documentation
- Unknown signers: deferring instead of asking
- catchUnknownSigner in a migrated script
- A Safe-owned project, end to end
The whole documentation is at rocketh.dev, the hardhat-deploy section at rocketh.dev/hardhat-deploy.
