@pooflabs/core 0.0.19 → 0.0.21
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 +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
1
2
|
export type SetOptions = {
|
|
2
3
|
shouldSubmitTx?: boolean;
|
|
3
4
|
_overrides?: {
|
|
@@ -51,3 +52,6 @@ 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>;
|
|
57
|
+
export declare function signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
|
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, signAndSubmitTransaction, 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,27 @@ 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
|
+
}
|
|
3675
|
+
async function signAndSubmitTransaction(transaction, feePayer) {
|
|
3676
|
+
const config = await getConfig();
|
|
3677
|
+
if (!config.authProvider) {
|
|
3678
|
+
throw new Error('Auth provider not initialized. Please call init() first.');
|
|
3679
|
+
}
|
|
3680
|
+
return config.authProvider.signAndSubmitTransaction(transaction, feePayer);
|
|
3681
|
+
}
|
|
3658
3682
|
|
|
3659
3683
|
const activeConnections = {};
|
|
3660
3684
|
const responseCache = {};
|
|
@@ -3876,6 +3900,9 @@ exports.runQueryMany = runQueryMany;
|
|
|
3876
3900
|
exports.set = set;
|
|
3877
3901
|
exports.setFile = setFile;
|
|
3878
3902
|
exports.setMany = setMany;
|
|
3903
|
+
exports.signAndSubmitTransaction = signAndSubmitTransaction;
|
|
3904
|
+
exports.signMessage = signMessage;
|
|
3879
3905
|
exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
3906
|
+
exports.signTransaction = signTransaction;
|
|
3880
3907
|
exports.subscribe = subscribe;
|
|
3881
3908
|
//# sourceMappingURL=index.js.map
|