@pooflabs/core 0.0.19 → 0.0.20
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/client/operations.d.ts +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
1
2
|
export type SetOptions = {
|
|
2
3
|
shouldSubmitTx?: boolean;
|
|
3
4
|
_overrides?: {
|
|
@@ -51,3 +52,5 @@ export declare function clearCache(path?: string, opts?: {
|
|
|
51
52
|
}): void;
|
|
52
53
|
export declare function getFiles(path: string): Promise<any>;
|
|
53
54
|
export declare function setFile(path: string, file: File | null): Promise<boolean>;
|
|
55
|
+
export declare function signMessage(message: string): Promise<string>;
|
|
56
|
+
export declare function signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { init } from './client/config';
|
|
2
2
|
export { getConfig, ClientConfig } from './client/config';
|
|
3
|
-
export { get, set, setMany, setFile, getFiles, runQuery, runQueryMany, runExpression, runExpressionMany, SetOptions, RunExpressionOptions, RunExpressionResult } from './client/operations';
|
|
3
|
+
export { get, set, setMany, setFile, getFiles, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, SetOptions, RunExpressionOptions, RunExpressionResult } from './client/operations';
|
|
4
4
|
export { subscribe } from './client/subscription';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export { getIdToken } from './utils/utils';
|
package/dist/index.js
CHANGED
|
@@ -3543,8 +3543,11 @@ async function setMany(many, options) {
|
|
|
3543
3543
|
async function handleOffchainTransaction(tx, authProvider, options) {
|
|
3544
3544
|
var _a, _b, _c, _d, _e;
|
|
3545
3545
|
const config = await getConfig();
|
|
3546
|
-
// 1. Sign the transaction message using
|
|
3547
|
-
|
|
3546
|
+
// 1. Sign the transaction message using mock signing for offchain transactions
|
|
3547
|
+
// Use signMessageMock if available (OffchainAuthProvider), otherwise fall back to signMessage
|
|
3548
|
+
const signature = authProvider.signMessageMock
|
|
3549
|
+
? await authProvider.signMessageMock(tx.message)
|
|
3550
|
+
: await authProvider.signMessage(tx.message);
|
|
3548
3551
|
// 2. Create signed transaction
|
|
3549
3552
|
const signedTx = {
|
|
3550
3553
|
transaction: tx,
|
|
@@ -3655,6 +3658,20 @@ async function setFile(path, file) {
|
|
|
3655
3658
|
// Optionally return the file's public URL or some confirmation
|
|
3656
3659
|
return true;
|
|
3657
3660
|
}
|
|
3661
|
+
async function signMessage(message) {
|
|
3662
|
+
const config = await getConfig();
|
|
3663
|
+
if (!config.authProvider) {
|
|
3664
|
+
throw new Error('Auth provider not initialized. Please call init() first.');
|
|
3665
|
+
}
|
|
3666
|
+
return config.authProvider.signMessage(message);
|
|
3667
|
+
}
|
|
3668
|
+
async function signTransaction(transaction) {
|
|
3669
|
+
const config = await getConfig();
|
|
3670
|
+
if (!config.authProvider) {
|
|
3671
|
+
throw new Error('Auth provider not initialized. Please call init() first.');
|
|
3672
|
+
}
|
|
3673
|
+
return config.authProvider.signTransaction(transaction);
|
|
3674
|
+
}
|
|
3658
3675
|
|
|
3659
3676
|
const activeConnections = {};
|
|
3660
3677
|
const responseCache = {};
|
|
@@ -3876,6 +3893,8 @@ exports.runQueryMany = runQueryMany;
|
|
|
3876
3893
|
exports.set = set;
|
|
3877
3894
|
exports.setFile = setFile;
|
|
3878
3895
|
exports.setMany = setMany;
|
|
3896
|
+
exports.signMessage = signMessage;
|
|
3879
3897
|
exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
3898
|
+
exports.signTransaction = signTransaction;
|
|
3880
3899
|
exports.subscribe = subscribe;
|
|
3881
3900
|
//# sourceMappingURL=index.js.map
|