@pooflabs/core 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -14
- package/dist/index.mjs.map +1 -1
- package/dist/utils/sol/sol-utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2847,24 +2847,15 @@ async function genSolanaMessage(address, nonce) {
|
|
|
2847
2847
|
const statement = "Sign this message to authenticate with our application.";
|
|
2848
2848
|
const currentDate = new Date();
|
|
2849
2849
|
const issuedAt = currentDate.toISOString();
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
const expirationDate = new Date(currentDate.getTime() + 5 * 60 * 1000);
|
|
2853
|
-
const expirationTime = expirationDate.toISOString();
|
|
2854
|
-
return `${statement}\n\n` +
|
|
2855
|
-
`Wallet address:\n${address}\n\n` +
|
|
2856
|
-
`Domain: ${domain}\n` +
|
|
2857
|
-
`Origin: ${origin}\n` +
|
|
2858
|
-
`Nonce: ${nonce}\n` +
|
|
2859
|
-
`Issued At: ${issuedAt}\n` +
|
|
2860
|
-
`Expiration Time: ${expirationTime}`;
|
|
2861
|
-
}
|
|
2862
|
-
// Backward compatible: without nonce (for server-side usage)
|
|
2850
|
+
const expirationDate = new Date(currentDate.getTime() + 5 * 60 * 1000);
|
|
2851
|
+
const expirationTime = expirationDate.toISOString();
|
|
2863
2852
|
return `${statement}\n\n` +
|
|
2864
2853
|
`Wallet address:\n${address}\n\n` +
|
|
2865
2854
|
`Domain: ${domain}\n` +
|
|
2866
2855
|
`Origin: ${origin}\n` +
|
|
2867
|
-
`
|
|
2856
|
+
`Nonce: ${nonce}\n` +
|
|
2857
|
+
`Issued At: ${issuedAt}\n` +
|
|
2858
|
+
`Expiration Time: ${expirationTime}`;
|
|
2868
2859
|
}
|
|
2869
2860
|
// ─────────────────────────────────────────────────────────────
|
|
2870
2861
|
// Serialization Helpers
|
|
@@ -3032,6 +3023,7 @@ function loadKeypairFromEnv() {
|
|
|
3032
3023
|
async function createSession() {
|
|
3033
3024
|
const kp = loadKeypairFromEnv();
|
|
3034
3025
|
const address = kp.publicKey.toBase58();
|
|
3026
|
+
/* fetch nonce from auth API */
|
|
3035
3027
|
const nonce = await genAuthNonce();
|
|
3036
3028
|
const message = await genSolanaMessage(address, nonce);
|
|
3037
3029
|
/* sign the message */
|