@pooflabs/web 0.0.15 → 0.0.17
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.d.ts +1 -1
- package/dist/index.esm.js +9 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12370,7 +12370,8 @@ function loadKeypairFromEnv() {
|
|
|
12370
12370
|
async function createSession() {
|
|
12371
12371
|
const kp = loadKeypairFromEnv();
|
|
12372
12372
|
const address = kp.publicKey.toBase58();
|
|
12373
|
-
const
|
|
12373
|
+
const nonce = await genAuthNonce();
|
|
12374
|
+
const message = await genSolanaMessage(address, nonce);
|
|
12374
12375
|
/* sign the message */
|
|
12375
12376
|
const sigBytes = nacl.sign.detached(new TextEncoder().encode(message), kp.secretKey);
|
|
12376
12377
|
const signature = bufferExports.Buffer.from(sigBytes).toString("base64");
|
|
@@ -12447,7 +12448,7 @@ async function createAuthHeader(isServer) {
|
|
|
12447
12448
|
Authorization: bearerToken
|
|
12448
12449
|
};
|
|
12449
12450
|
}
|
|
12450
|
-
async function getIdToken(isServer) {
|
|
12451
|
+
async function getIdToken$1(isServer) {
|
|
12451
12452
|
if (isServer) {
|
|
12452
12453
|
const sessionMgr = ServerSessionManager.instance;
|
|
12453
12454
|
const session = await sessionMgr.getSession();
|
|
@@ -12947,7 +12948,7 @@ function isTokenExpired(token) {
|
|
|
12947
12948
|
}
|
|
12948
12949
|
// Get a fresh auth token, refreshing if necessary
|
|
12949
12950
|
async function getFreshAuthToken(isServer) {
|
|
12950
|
-
const currentToken = await getIdToken(isServer);
|
|
12951
|
+
const currentToken = await getIdToken$1(isServer);
|
|
12951
12952
|
if (!currentToken) {
|
|
12952
12953
|
return null;
|
|
12953
12954
|
}
|
|
@@ -42906,6 +42907,11 @@ function useAuth() {
|
|
|
42906
42907
|
};
|
|
42907
42908
|
}
|
|
42908
42909
|
|
|
42910
|
+
// Wrapper for getIdToken - passes isServer=false for client-side usage
|
|
42911
|
+
async function getIdToken() {
|
|
42912
|
+
return getIdToken$1(false);
|
|
42913
|
+
}
|
|
42914
|
+
|
|
42909
42915
|
exports.DEFAULT_TEST_ADDRESS = DEFAULT_TEST_ADDRESS;
|
|
42910
42916
|
exports.MockAuthProvider = MockAuthProvider;
|
|
42911
42917
|
exports.PhantomWalletProvider = PhantomWalletProvider;
|