- Add SIWE login to @settlekit/auth: requestWalletNonce + loginWithWallet on AuthService. - web3.ts: viem-backed SIWE helpers (generateWalletNonce, buildSiweMessage, parseWalletMessage, offline EOA recoverWalletSigner) — no new external dep beyond viem (already in workspace). - Single-use, address-bound, expiring nonce (replay-safe); nonce consumed only after the signature verifies. - Account.walletAddress + WalletNonce types; optional findAccountByWallet/saveWalletNonce/consumeWalletNonce on AuthStore (non-breaking — PgAuthStore opts in later), implemented in InMemoryAuthStore. - 6 tests: nonce issue/validation, login+account creation, returning account, replay rejection, expiry, wrong-signer rejection.
28 lines
529 B
JSON
28 lines
529 B
JSON
{
|
|
"name": "@settlekit/auth",
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
}
|
|
},
|
|
"files": ["dist"],
|
|
"scripts": {
|
|
"build": "tsc -b",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@settlekit/common": "workspace:*",
|
|
"viem": "^2.21.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.14.0",
|
|
"typescript": "^5.5.4",
|
|
"vitest": "^2.0.5"
|
|
}
|
|
}
|