
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@automata-network/safe-authmodule-sdk
Advanced tools
This SDK includes the following modules:
setup.ts
: Provides a method that deploys a SafeWallet, which enables AuthModule
and creates an attestation of the user's device upon the initial setup of the wallet.
challenge.ts
: Deterministically pre-computes the address of a SafeWallet prior to its deployment. This address is included as a challenge data for the initial attestation.
To install the SDK, do the following:
NPM:
npm install --save-dev @automata-network/safe-authmodule-sdk
YARN:
yarn add --dev @automata-network/safe-authmodule-sdk
To use the SDK, you must first import the two essential functions.
import {
computeSafeAddress,
createNewWallet,
AUTH_MODULE_ADDRESS,
ANDROID_SAFETYNET_ATTESTATION_ADDRESS // this varies by the user's device
} from @automata-network/safe-authmodule-sdk;
// Step 1: Define a random nonce to generate a unique Safe wallet address.
// generates a random number from 0 to MAX_NUMBER - 1
const nonce = Math.floor(Math.random()) * MAX_NUMBER;
// This is OPTIONAL, but recommended. This would assign the provided address as the owner of the SafeWallet.
// SafeWallet is a multi-sig wallet, therefore ownership can be assigned to one or more addresses.
const ownerAddress = await signer.getAddress();
// This is OPTIONAL, but recommended. Some arbitrary number of signatures to execute a transaction (not via device attestation with AuthModule)
// as long as it is less than the number of owners.
const threshold = 5;
// Step 2: Computes the challenge
const safeAddress = await computeSafeAddress(nonce, [ownerAddress], threshold);
// Step 3: Sends a request to the Relayer to create a SafeWallet on chain.
// This step is performed after getting a response from creating a WebAuthn credential.
const response = await createNewWallet(
nonce,
{
authDataBytes,
clientDataJSONBytes // utf8 encoded
},
attStmt,
ANDROID_SAFETYNET_ATTESTATION_ADDRESS,
threshold,
[ownerAddress],
provider // OPTIONAL Web3 provider to overwrite default configurations. This is only used for reading on-chain data.
);
All contract deployment addresses can be found in constants.ts
.
FAQs
Unknown package
The npm package @automata-network/safe-authmodule-sdk receives a total of 22 weekly downloads. As such, @automata-network/safe-authmodule-sdk popularity was classified as not popular.
We found that @automata-network/safe-authmodule-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.