@pooflabs/web 0.0.38 → 0.0.40
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/auth/providers/mock-auth-provider.d.ts +6 -0
- package/dist/auth/providers/offchain-auth-provider.d.ts +8 -0
- package/dist/auth/providers/phantom-wallet-provider.d.ts +28 -1
- package/dist/auth/providers/privy-wallet-provider.d.ts +45 -1
- package/dist/{index-DIB1IdkM.esm.js → index-BSBKiLWi.esm.js} +2 -2
- package/dist/{index-DIB1IdkM.esm.js.map → index-BSBKiLWi.esm.js.map} +1 -1
- package/dist/{index-5j5jdNNe.js → index-CdHX3Tgg.js} +10836 -10009
- package/dist/index-CdHX3Tgg.js.map +1 -0
- package/dist/{index-C6HaRwOE.js → index-UIsHf4b_.js} +2 -2
- package/dist/{index-C6HaRwOE.js.map → index-UIsHf4b_.js.map} +1 -1
- package/dist/{index-CSe3WqP-.esm.js → index-YqkhFncb.esm.js} +10831 -10009
- package/dist/index-YqkhFncb.esm.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/index-5j5jdNNe.js.map +0 -1
- package/dist/index-CSe3WqP-.esm.js.map +0 -1
|
@@ -27,6 +27,12 @@ export declare class MockAuthProvider implements AuthProvider {
|
|
|
27
27
|
* Mock transaction signing - returns the transaction as-is (no actual signing)
|
|
28
28
|
*/
|
|
29
29
|
signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
30
|
+
/**
|
|
31
|
+
* Sign and submit transaction - not supported in mock environment.
|
|
32
|
+
* See the real providers (PhantomWalletProvider, PrivyWalletProvider, SolanaKeypairProvider)
|
|
33
|
+
* for the full implementation with blockhash handling and feePayer support.
|
|
34
|
+
*/
|
|
35
|
+
signAndSubmitTransaction(_transaction: Transaction | VersionedTransaction, _feePayer?: any): Promise<string>;
|
|
30
36
|
/**
|
|
31
37
|
* Restore session - only restores if user previously called login() explicitly.
|
|
32
38
|
* This prevents auto-login on first page load, but allows session persistence after login.
|
|
@@ -23,9 +23,17 @@ export declare class OffchainAuthProvider implements AuthProvider {
|
|
|
23
23
|
restoreSession(): Promise<User | null>;
|
|
24
24
|
runTransaction(evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
|
|
25
25
|
signTransaction(tx: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
26
|
+
/**
|
|
27
|
+
* Sign and submit transaction - not supported in poofnet environment.
|
|
28
|
+
* See the real providers (PhantomWalletProvider, PrivyWalletProvider, SolanaKeypairProvider)
|
|
29
|
+
* for the full implementation with blockhash handling and feePayer support.
|
|
30
|
+
*/
|
|
31
|
+
signAndSubmitTransaction(_transaction: Transaction | VersionedTransaction, _feePayer?: any): Promise<string>;
|
|
26
32
|
getNativeMethods(): Promise<any>;
|
|
27
33
|
signMessage(message: string): Promise<string>;
|
|
28
34
|
signMessageMock(message: string): Promise<string>;
|
|
35
|
+
private showUnsupportedTransactionModal;
|
|
36
|
+
private getUnsupportedModalHTML;
|
|
29
37
|
private showTransactionModal;
|
|
30
38
|
private closeModal;
|
|
31
39
|
private formatPath;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EVMTransaction, SolTransaction, TransactionResult, User, AuthProvider, SetOptions } from '@pooflabs/core';
|
|
2
|
-
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
3
|
export type PhantomProviderType = 'injected' | 'google' | 'apple' | 'phantom';
|
|
4
4
|
export interface PhantomWalletConfig {
|
|
5
5
|
appId?: string;
|
|
@@ -50,10 +50,37 @@ export declare class PhantomWalletProvider implements AuthProvider {
|
|
|
50
50
|
restoreSession(): Promise<User | null>;
|
|
51
51
|
address(): Promise<string | null>;
|
|
52
52
|
runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Signs a Solana transaction without submitting it.
|
|
55
|
+
*
|
|
56
|
+
* This method handles blockhash automatically if not set - you do NOT need to
|
|
57
|
+
* set recentBlockhash on the transaction before calling this method.
|
|
58
|
+
* The network/RPC URL is derived from the provider's configuration (set during initialization).
|
|
59
|
+
*
|
|
60
|
+
* @param transaction - The transaction to sign (Transaction or VersionedTransaction)
|
|
61
|
+
* @returns The signed transaction
|
|
62
|
+
*/
|
|
53
63
|
signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
64
|
+
/**
|
|
65
|
+
* Signs and submits a Solana transaction to the network.
|
|
66
|
+
*
|
|
67
|
+
* This method handles blockhash and transaction confirmation automatically - you do NOT need to
|
|
68
|
+
* set recentBlockhash or lastValidBlockHeight on the transaction before calling this method.
|
|
69
|
+
* The network/RPC URL is derived from the provider's configuration (set during initialization).
|
|
70
|
+
*
|
|
71
|
+
* @param transaction - The transaction to sign and submit (Transaction or VersionedTransaction)
|
|
72
|
+
* @param feePayer - Optional fee payer public key. If not provided and the transaction doesn't
|
|
73
|
+
* already have a feePayer set, the connected wallet address will be used.
|
|
74
|
+
* Useful for co-signing scenarios where a different account pays the fees.
|
|
75
|
+
* @returns The transaction signature
|
|
76
|
+
*/
|
|
77
|
+
signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
|
|
54
78
|
signMessage(message: string): Promise<string>;
|
|
55
79
|
logout(): Promise<void>;
|
|
56
80
|
getNativeMethods(): Promise<any>;
|
|
81
|
+
private getRpcUrl;
|
|
82
|
+
private submitSignedTransaction;
|
|
83
|
+
private submitSignedTransactionWithBlockhash;
|
|
57
84
|
}
|
|
58
85
|
declare global {
|
|
59
86
|
interface Window {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EVMTransaction, SolTransaction, TransactionResult, AuthProvider, User, SetOptions } from '@pooflabs/core';
|
|
2
|
-
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
3
|
export declare class PrivyWalletProvider implements AuthProvider {
|
|
4
4
|
private static instance;
|
|
5
5
|
private containerElement;
|
|
@@ -12,6 +12,7 @@ export declare class PrivyWalletProvider implements AuthProvider {
|
|
|
12
12
|
private pendingTransaction;
|
|
13
13
|
private pendingSignTransaction;
|
|
14
14
|
private pendingSignMessage;
|
|
15
|
+
private pendingSignAndSubmitTransaction;
|
|
15
16
|
constructor(appName: string | null, appLogoUrl: string | null, privyConfig?: {
|
|
16
17
|
appId: string;
|
|
17
18
|
config: any;
|
|
@@ -22,7 +23,50 @@ export declare class PrivyWalletProvider implements AuthProvider {
|
|
|
22
23
|
getNativeMethods(): Promise<any>;
|
|
23
24
|
logout(): Promise<void>;
|
|
24
25
|
runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Signs a Solana transaction without submitting it.
|
|
28
|
+
*
|
|
29
|
+
* This method handles blockhash automatically if not set - you do NOT need to
|
|
30
|
+
* set recentBlockhash on the transaction before calling this method.
|
|
31
|
+
* The network/RPC URL is derived from the provider's configuration (set during initialization).
|
|
32
|
+
*
|
|
33
|
+
* @param transaction - The transaction to sign (Transaction or VersionedTransaction)
|
|
34
|
+
* @returns The signed transaction
|
|
35
|
+
*/
|
|
25
36
|
signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
37
|
+
/**
|
|
38
|
+
* Signs and submits a Solana transaction to the network.
|
|
39
|
+
*
|
|
40
|
+
* This method handles blockhash and transaction confirmation automatically - you do NOT need to
|
|
41
|
+
* set recentBlockhash or lastValidBlockHeight on the transaction before calling this method.
|
|
42
|
+
* The network/RPC URL is derived from the provider's configuration (set during initialization).
|
|
43
|
+
*
|
|
44
|
+
* @param transaction - The transaction to sign and submit (Transaction or VersionedTransaction)
|
|
45
|
+
* @param feePayer - Optional fee payer public key. If not provided and the transaction doesn't
|
|
46
|
+
* already have a feePayer set, the connected wallet address will be used.
|
|
47
|
+
* Useful for co-signing scenarios where a different account pays the fees.
|
|
48
|
+
* @returns The transaction signature
|
|
49
|
+
*/
|
|
50
|
+
signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
|
|
51
|
+
private getRpcUrl;
|
|
52
|
+
/**
|
|
53
|
+
* Internal sign transaction - serializes and signs via Privy
|
|
54
|
+
* Returns the raw result from Privy (Uint8Array)
|
|
55
|
+
* This mirrors exactly what runTransaction was doing
|
|
56
|
+
*/
|
|
57
|
+
private signTransactionRaw;
|
|
58
|
+
/**
|
|
59
|
+
* Deserialize a signed transaction from Uint8Array to Transaction object
|
|
60
|
+
*/
|
|
61
|
+
private deserializeSignedTransaction;
|
|
62
|
+
/**
|
|
63
|
+
* Internal sign and submit - handles Surfnet vs non-Surfnet logic
|
|
64
|
+
* This is the core submission logic used by both signAndSubmitTransaction and runTransaction
|
|
65
|
+
*
|
|
66
|
+
* For Surfnet: sign with signTransactionRaw, then sendRawTransaction
|
|
67
|
+
* For non-Surfnet: use Privy's signAndSendTransaction (combined operation)
|
|
68
|
+
*/
|
|
69
|
+
private signAndSubmitInternal;
|
|
26
70
|
signMessage(message: string): Promise<string>;
|
|
27
71
|
restoreSession(): Promise<User | null>;
|
|
28
72
|
private createSession;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useContext, createContext, useState, useMemo, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import globalAxios, { isAxiosError } from 'axios';
|
|
4
|
-
import { c as commonjsRequire, r as require$$0, b as bufferExports, a as bs58$1, E as EventEmitter4 } from './index-
|
|
4
|
+
import { c as commonjsRequire, r as require$$0, b as bufferExports, a as bs58$1, E as EventEmitter4 } from './index-YqkhFncb.esm.js';
|
|
5
5
|
import { Transaction as Transaction$1, VersionedTransaction } from '@solana/web3.js';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import '@coral-xyz/anchor';
|
|
@@ -17695,4 +17695,4 @@ function ConnectBox({ maxWidth = "350px", transparent = false, appIcon, appName
|
|
|
17695
17695
|
}
|
|
17696
17696
|
|
|
17697
17697
|
export { DerivationInfoAddressFormatEnum as AddressType, ConnectBox, ConnectButton, DebugLevel, NetworkId, PhantomProvider, darkTheme, debug, isMobileDevice, lightTheme, mergeTheme, useAccounts, useAutoConfirm, useConnect, useDisconnect, useDiscoveredWallets, useEthereum, useIsExtensionInstalled, useIsPhantomLoginAvailable, useModal, usePhantom, useSolana, useTheme };
|
|
17698
|
-
//# sourceMappingURL=index-
|
|
17698
|
+
//# sourceMappingURL=index-BSBKiLWi.esm.js.map
|