@stableflow/wallet-solana 3.0.0-beta-02a59f37a0-20260515

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/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @stableflow/wallet-solana
2
+
3
+ Solana wallet adapter for the StableFlow SDK.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @stableflow/wallet-solana @stableflow/core @stableflow/bridges
9
+ ```
10
+
11
+ **Peer dependencies:**
12
+
13
+ - `@solana/web3.js` ^1.98.4
14
+ - `@solana/spl-token` ^0.4.14
15
+ - `@layerzerolabs/lz-v2-utilities` ^3.0.151
16
+ - `@layerzerolabs/lz-solana-sdk-v2` ^3.0.154
17
+ - `@layerzerolabs/oft-v2-solana-sdk` ^3.0.168
18
+ - `@coral-xyz/anchor` ^0.29.0
19
+ - `@metaplex-foundation/umi` ^1.5.1 (and related Metaplex packages — see `package.json`)
20
+
21
+ ## When to use
22
+
23
+ Solana as source or destination chain in `BridgeSFA` flows. Pass the adapter’s `wallet` (`WalletConfig`) into quote and send calls.
24
+
25
+ ## Main exports
26
+
27
+ ```ts
28
+ import SolanaWallet, { SolanaWallet as Named } from '@stableflow/wallet-solana';
29
+ ```
30
+
31
+ ## See also
32
+
33
+ - [Developer Guide](../../DEVELOPER_GUIDE.md)
34
+ - [@stableflow/bridges](../bridges/README.md)
@@ -0,0 +1,81 @@
1
+ import * as _solana_web3_js from '@solana/web3.js';
2
+ import { PublicKey, Connection } from '@solana/web3.js';
3
+ import { Service, SendType } from '@stableflow/core';
4
+
5
+ declare class SolanaWallet {
6
+ private publicKey;
7
+ private signTransaction;
8
+ private signer;
9
+ private csl;
10
+ constructor(options: {
11
+ publicKey: PublicKey | null;
12
+ signer: any;
13
+ });
14
+ getConnection(): Connection;
15
+ transferSOL(to: string, amount: string): Promise<string>;
16
+ transferToken(tokenMint: string, to: string, amount: string): Promise<string>;
17
+ transfer(data: {
18
+ originAsset: string;
19
+ depositAddress: string;
20
+ amount: string;
21
+ }): Promise<string>;
22
+ getSOLBalance(account: string, options?: {
23
+ isCatchError?: boolean;
24
+ }): Promise<number | "0">;
25
+ getTokenBalance(tokenMint: string, account: string, options?: {
26
+ isCatchError?: boolean;
27
+ }): Promise<bigint | "0">;
28
+ getBalance(token: any, account: string, options?: {
29
+ isCatchError?: boolean;
30
+ }): Promise<number | bigint | "0">;
31
+ balanceOf(token: any, account: string, options?: {
32
+ isCatchError?: boolean;
33
+ }): Promise<number | bigint | "0">;
34
+ /**
35
+ * Estimate gas limit for transfer transaction
36
+ * @param data Transfer data
37
+ * @returns Gas limit estimate, gas price, and estimated gas cost
38
+ */
39
+ estimateTransferGas(data: {
40
+ fromToken: any;
41
+ depositAddress: string;
42
+ amount: string;
43
+ }): Promise<{
44
+ gasLimit: bigint;
45
+ gasPrice: bigint;
46
+ estimateGas: bigint;
47
+ }>;
48
+ getEstimateGas(params: any): Promise<{
49
+ gasPrice: bigint;
50
+ usd: string;
51
+ wei: bigint;
52
+ amount: string;
53
+ }>;
54
+ estimateTransaction(params: any): Promise<{
55
+ estimateSourceGasLimit: bigint;
56
+ estimateSourceGas: bigint;
57
+ estimateSourceGasUsd: string;
58
+ }>;
59
+ checkTransactionStatus(signature: string): Promise<boolean>;
60
+ simulateIx(ix: any): Promise<_solana_web3_js.SimulatedTransactionResponse>;
61
+ quoteOFT(params: any): Promise<any>;
62
+ sendTransaction(params: any): Promise<string>;
63
+ /**
64
+ * Unified quote method that routes to specific quote methods based on type
65
+ * @param type Service type from Service
66
+ * @param params Parameters for the quote
67
+ */
68
+ quote(type: Service, params: any): Promise<any>;
69
+ /**
70
+ * Unified send method that routes to specific send methods based on type
71
+ * @param type Send type from SendType enum
72
+ * @param params Parameters for the send transaction
73
+ */
74
+ send(type: SendType, params: any): Promise<string>;
75
+ quoteOneClickProxy(params: any): Promise<any>;
76
+ quoteCCTP(params: any): Promise<any>;
77
+ createAssociatedTokenAddress(params: any): Promise<PublicKey>;
78
+ quoteFraxZero(params: any): Promise<any>;
79
+ }
80
+
81
+ export { SolanaWallet, SolanaWallet as default };
@@ -0,0 +1,81 @@
1
+ import * as _solana_web3_js from '@solana/web3.js';
2
+ import { PublicKey, Connection } from '@solana/web3.js';
3
+ import { Service, SendType } from '@stableflow/core';
4
+
5
+ declare class SolanaWallet {
6
+ private publicKey;
7
+ private signTransaction;
8
+ private signer;
9
+ private csl;
10
+ constructor(options: {
11
+ publicKey: PublicKey | null;
12
+ signer: any;
13
+ });
14
+ getConnection(): Connection;
15
+ transferSOL(to: string, amount: string): Promise<string>;
16
+ transferToken(tokenMint: string, to: string, amount: string): Promise<string>;
17
+ transfer(data: {
18
+ originAsset: string;
19
+ depositAddress: string;
20
+ amount: string;
21
+ }): Promise<string>;
22
+ getSOLBalance(account: string, options?: {
23
+ isCatchError?: boolean;
24
+ }): Promise<number | "0">;
25
+ getTokenBalance(tokenMint: string, account: string, options?: {
26
+ isCatchError?: boolean;
27
+ }): Promise<bigint | "0">;
28
+ getBalance(token: any, account: string, options?: {
29
+ isCatchError?: boolean;
30
+ }): Promise<number | bigint | "0">;
31
+ balanceOf(token: any, account: string, options?: {
32
+ isCatchError?: boolean;
33
+ }): Promise<number | bigint | "0">;
34
+ /**
35
+ * Estimate gas limit for transfer transaction
36
+ * @param data Transfer data
37
+ * @returns Gas limit estimate, gas price, and estimated gas cost
38
+ */
39
+ estimateTransferGas(data: {
40
+ fromToken: any;
41
+ depositAddress: string;
42
+ amount: string;
43
+ }): Promise<{
44
+ gasLimit: bigint;
45
+ gasPrice: bigint;
46
+ estimateGas: bigint;
47
+ }>;
48
+ getEstimateGas(params: any): Promise<{
49
+ gasPrice: bigint;
50
+ usd: string;
51
+ wei: bigint;
52
+ amount: string;
53
+ }>;
54
+ estimateTransaction(params: any): Promise<{
55
+ estimateSourceGasLimit: bigint;
56
+ estimateSourceGas: bigint;
57
+ estimateSourceGasUsd: string;
58
+ }>;
59
+ checkTransactionStatus(signature: string): Promise<boolean>;
60
+ simulateIx(ix: any): Promise<_solana_web3_js.SimulatedTransactionResponse>;
61
+ quoteOFT(params: any): Promise<any>;
62
+ sendTransaction(params: any): Promise<string>;
63
+ /**
64
+ * Unified quote method that routes to specific quote methods based on type
65
+ * @param type Service type from Service
66
+ * @param params Parameters for the quote
67
+ */
68
+ quote(type: Service, params: any): Promise<any>;
69
+ /**
70
+ * Unified send method that routes to specific send methods based on type
71
+ * @param type Send type from SendType enum
72
+ * @param params Parameters for the send transaction
73
+ */
74
+ send(type: SendType, params: any): Promise<string>;
75
+ quoteOneClickProxy(params: any): Promise<any>;
76
+ quoteCCTP(params: any): Promise<any>;
77
+ createAssociatedTokenAddress(params: any): Promise<PublicKey>;
78
+ quoteFraxZero(params: any): Promise<any>;
79
+ }
80
+
81
+ export { SolanaWallet, SolanaWallet as default };