Users Data
Provider that allows to interact with users data. (E.g. Public key)
Users Data
Initialization
const afSdk = await Aftermath.create({ network: "MAINNET" });
const userData = afSdk.UserData();Get Users Public Key
const publicKey = userData.getUserPublicKey({
walletAddress: "0x.."
});Create User Public Key
const messageToSign = userData.createUserAccountMessageToSign();
const signedMessage = await signPersonalMessage({
message: new TextEncoder().encode(JSON.stringify(messageToSign)),
});
const publicKey = userData.createUserPublicKey({
walletAddress: "0x..",
bytes: signedMessage.bytes,
signature: signedMessage.signature
});Create Reusable Terms Message
Use the canonical terms message for current DCA and limit-order cancellation, GasPool sponsorship, referral/rewards actions, and authenticated perpetuals reads:
Send signedMessage.bytes and signedMessage.signature with the wallet address. Request-specific order IDs, filters, and referral codes remain plain request fields. createSignTermsAndConditionsMessageToSign() is deprecated and returns the old action-specific payload; do not use it for these routes.
Complete Example
Last updated