
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@projectlibertylabs/mock-siwf-embedded-wallet-sdk
Advanced tools
Find the real package version here: https://github.com/ProjectLibertyLabs/siwf-embedded-wallet-sdk
npm i @projectlibertylabs/mock-siwf-embedded-wallet-sdk
import { startSiwf } from "@projectlibertylabs/mock-siwf-embedded-wallet-sdk";
// ...
const startSiwfResponse = await startSiwf(
userAddress,
signatureFn,
gatewayFetchFn,
siwfSignedRequest,
userHandle,
email,
msaCreationCallback,
);
// ...
};
startSiwf
ParametersuserAddress
: The wallet address of the usersignatureFn
: Connect the specific embedded wallet to the SDK (see Signature Function below)gatewayFetchFn
: Connect the SDK to the Frequency Gateway Account Service (see Gateway Fetch Function below)userHandle
: (Optional, New User Only) The user supplied handle to registeremail
: (Optional, New User Only) The user's email address for generating the values for the Recovery SystemmsaCreationCallback
: (Optional) Will be called with the final MSA Id and Handle for the user (see MSA Callback Function below)This function connects your embedded wallet to the SIWF interface. It follows the same interface as the window.ethereum.request
method, although is reduced in scope.
There are only two methods requested: eth_signTypedData_v4
for EIP-712 signature requests and personal_sign
for CAIP-122 Sign In with X standard.
type SignatureFn = (request: WindowEthereumRequest) => Promise<string>;
This function connects the SDK to your instance of Frequency Gateway Account Service. Remember that Account Service is NOT a public facing service, so MUST be securely proxied. This function will only call two endpoints, but you must map those endpoints to your own endpoints.
authorizationPayload
versiontype Address = string;
type GatewayFetchFn = (
method: "GET" | "POST",
path: `/v1/accounts/account/${Address}` | "/v2/accounts/siwf",
body?: undefined | { authorizationPayload: string; },
) => Promise<Response>;
When a new user signs up, the allocation of the MSA Id on-chain can take some time. This callback will be called once the allocation is completed, or if the user already has an account, it will return the value without waiting.
interface AccountResponse {
msaId: string;
handle?: {
base_handle: string;
canonical_base: string;
suffix: number;
};
}
type MsaCreationCallbackFn = (account: AccountResponse) => void;
Examples and details for the Turnkey Embedded Wallet can be found Turnkey.md.
SignatureFn
and GatewayFetchFn
with the correct parameters.SignatureFn
or the GatewayFetchFn
.GatewayFetchFn
due to the static nature, but they do have the correct structure.FAQs
Mock SIWF SDK for Embedded Wallets
We found that @projectlibertylabs/mock-siwf-embedded-wallet-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.