@stableflow/wallet-tron 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 +29 -0
- package/dist/index.d.mts +91 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +884 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +875 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @stableflow/wallet-tron
|
|
2
|
+
|
|
3
|
+
Tron wallet adapter for the StableFlow SDK.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @stableflow/wallet-tron @stableflow/core @stableflow/bridges
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Peer dependencies:**
|
|
12
|
+
|
|
13
|
+
- `tronweb` ^6.3.0
|
|
14
|
+
- `@layerzerolabs/lz-v2-utilities` ^3.0.151
|
|
15
|
+
|
|
16
|
+
## When to use
|
|
17
|
+
|
|
18
|
+
Tron (TRX / USDT) as source or destination in bridge routes.
|
|
19
|
+
|
|
20
|
+
## Main exports
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import TronWallet, { TronWallet as Named } from '@stableflow/wallet-tron';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## See also
|
|
27
|
+
|
|
28
|
+
- [Developer Guide](../../DEVELOPER_GUIDE.md)
|
|
29
|
+
- [@stableflow/bridges](../bridges/README.md)
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Service, SendType } from '@stableflow/core';
|
|
2
|
+
|
|
3
|
+
declare class TronWallet {
|
|
4
|
+
private signAndSendTransaction;
|
|
5
|
+
private address;
|
|
6
|
+
private tronWeb;
|
|
7
|
+
private csl;
|
|
8
|
+
constructor(options: any);
|
|
9
|
+
waitForTronWeb(): Promise<unknown>;
|
|
10
|
+
transfer(data: {
|
|
11
|
+
originAsset: string;
|
|
12
|
+
depositAddress: string;
|
|
13
|
+
amount: string;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
transferTRX(to: string, amount: string): Promise<any>;
|
|
16
|
+
transferToken(contractAddress: string, to: string, amount: string): Promise<any>;
|
|
17
|
+
getBalance(token: any, account: string, options?: {
|
|
18
|
+
isCatchError?: boolean;
|
|
19
|
+
}): Promise<any>;
|
|
20
|
+
getTRXBalance(account: string, options?: {
|
|
21
|
+
isCatchError?: boolean;
|
|
22
|
+
}): Promise<any>;
|
|
23
|
+
getTokenBalance(contractAddress: string, account: string, options?: {
|
|
24
|
+
isCatchError?: boolean;
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
balanceOf(token: any, account: string, options?: {
|
|
27
|
+
isCatchError?: boolean;
|
|
28
|
+
}): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* Estimate gas limit for transfer transaction
|
|
31
|
+
* @param data Transfer data
|
|
32
|
+
* @returns Gas limit estimate (bandwidth or energy), gas price, and estimated gas cost
|
|
33
|
+
*/
|
|
34
|
+
estimateTransferGas(data: {
|
|
35
|
+
fromToken: any;
|
|
36
|
+
depositAddress: string;
|
|
37
|
+
amount: string;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
gasLimit: bigint;
|
|
40
|
+
gasPrice: bigint;
|
|
41
|
+
estimateGas: bigint;
|
|
42
|
+
}>;
|
|
43
|
+
getEstimateGas(params: any): Promise<{
|
|
44
|
+
gasPrice: bigint;
|
|
45
|
+
usd: string;
|
|
46
|
+
wei: bigint;
|
|
47
|
+
amount: string;
|
|
48
|
+
}>;
|
|
49
|
+
estimateTransaction(params: any): Promise<{
|
|
50
|
+
estimateSourceGasLimit: any;
|
|
51
|
+
estimateSourceGas: bigint;
|
|
52
|
+
estimateSourceGasUsd: string;
|
|
53
|
+
}>;
|
|
54
|
+
estimateApprove(params: any): Promise<{
|
|
55
|
+
estimateSourceGasLimit: any;
|
|
56
|
+
estimateSourceGas: bigint;
|
|
57
|
+
estimateSourceGasUsd: string;
|
|
58
|
+
}>;
|
|
59
|
+
pollingTransactionStatus(txHash: string, options?: {
|
|
60
|
+
maxPolls?: number;
|
|
61
|
+
pollInterval?: number;
|
|
62
|
+
isTRX?: boolean;
|
|
63
|
+
}): Promise<unknown>;
|
|
64
|
+
checkTransactionStatus(txHash: string): Promise<boolean>;
|
|
65
|
+
getTransactionResult(txHash: string): Promise<any>;
|
|
66
|
+
allowance(params: any): Promise<{
|
|
67
|
+
contract: any;
|
|
68
|
+
allowance: string;
|
|
69
|
+
needApprove: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
approve(params: any): Promise<any>;
|
|
72
|
+
toBytes32(addr: string): string;
|
|
73
|
+
quoteOFT(params: any): Promise<any>;
|
|
74
|
+
sendTransaction(params: any): Promise<any>;
|
|
75
|
+
/**
|
|
76
|
+
* Unified quote method that routes to specific quote methods based on type
|
|
77
|
+
* @param type Service type from Service
|
|
78
|
+
* @param params Parameters for the quote
|
|
79
|
+
*/
|
|
80
|
+
quote(type: Service, params: any): Promise<any>;
|
|
81
|
+
/**
|
|
82
|
+
* Unified send method that routes to specific send methods based on type
|
|
83
|
+
* @param type Send type from SendType enum
|
|
84
|
+
* @param params Parameters for the send transaction
|
|
85
|
+
*/
|
|
86
|
+
send(type: SendType, params: any): Promise<any>;
|
|
87
|
+
quoteOneClickProxy(params: any): Promise<any>;
|
|
88
|
+
getAccountResources(params: any): Promise<any>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { TronWallet, TronWallet as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Service, SendType } from '@stableflow/core';
|
|
2
|
+
|
|
3
|
+
declare class TronWallet {
|
|
4
|
+
private signAndSendTransaction;
|
|
5
|
+
private address;
|
|
6
|
+
private tronWeb;
|
|
7
|
+
private csl;
|
|
8
|
+
constructor(options: any);
|
|
9
|
+
waitForTronWeb(): Promise<unknown>;
|
|
10
|
+
transfer(data: {
|
|
11
|
+
originAsset: string;
|
|
12
|
+
depositAddress: string;
|
|
13
|
+
amount: string;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
transferTRX(to: string, amount: string): Promise<any>;
|
|
16
|
+
transferToken(contractAddress: string, to: string, amount: string): Promise<any>;
|
|
17
|
+
getBalance(token: any, account: string, options?: {
|
|
18
|
+
isCatchError?: boolean;
|
|
19
|
+
}): Promise<any>;
|
|
20
|
+
getTRXBalance(account: string, options?: {
|
|
21
|
+
isCatchError?: boolean;
|
|
22
|
+
}): Promise<any>;
|
|
23
|
+
getTokenBalance(contractAddress: string, account: string, options?: {
|
|
24
|
+
isCatchError?: boolean;
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
balanceOf(token: any, account: string, options?: {
|
|
27
|
+
isCatchError?: boolean;
|
|
28
|
+
}): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* Estimate gas limit for transfer transaction
|
|
31
|
+
* @param data Transfer data
|
|
32
|
+
* @returns Gas limit estimate (bandwidth or energy), gas price, and estimated gas cost
|
|
33
|
+
*/
|
|
34
|
+
estimateTransferGas(data: {
|
|
35
|
+
fromToken: any;
|
|
36
|
+
depositAddress: string;
|
|
37
|
+
amount: string;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
gasLimit: bigint;
|
|
40
|
+
gasPrice: bigint;
|
|
41
|
+
estimateGas: bigint;
|
|
42
|
+
}>;
|
|
43
|
+
getEstimateGas(params: any): Promise<{
|
|
44
|
+
gasPrice: bigint;
|
|
45
|
+
usd: string;
|
|
46
|
+
wei: bigint;
|
|
47
|
+
amount: string;
|
|
48
|
+
}>;
|
|
49
|
+
estimateTransaction(params: any): Promise<{
|
|
50
|
+
estimateSourceGasLimit: any;
|
|
51
|
+
estimateSourceGas: bigint;
|
|
52
|
+
estimateSourceGasUsd: string;
|
|
53
|
+
}>;
|
|
54
|
+
estimateApprove(params: any): Promise<{
|
|
55
|
+
estimateSourceGasLimit: any;
|
|
56
|
+
estimateSourceGas: bigint;
|
|
57
|
+
estimateSourceGasUsd: string;
|
|
58
|
+
}>;
|
|
59
|
+
pollingTransactionStatus(txHash: string, options?: {
|
|
60
|
+
maxPolls?: number;
|
|
61
|
+
pollInterval?: number;
|
|
62
|
+
isTRX?: boolean;
|
|
63
|
+
}): Promise<unknown>;
|
|
64
|
+
checkTransactionStatus(txHash: string): Promise<boolean>;
|
|
65
|
+
getTransactionResult(txHash: string): Promise<any>;
|
|
66
|
+
allowance(params: any): Promise<{
|
|
67
|
+
contract: any;
|
|
68
|
+
allowance: string;
|
|
69
|
+
needApprove: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
approve(params: any): Promise<any>;
|
|
72
|
+
toBytes32(addr: string): string;
|
|
73
|
+
quoteOFT(params: any): Promise<any>;
|
|
74
|
+
sendTransaction(params: any): Promise<any>;
|
|
75
|
+
/**
|
|
76
|
+
* Unified quote method that routes to specific quote methods based on type
|
|
77
|
+
* @param type Service type from Service
|
|
78
|
+
* @param params Parameters for the quote
|
|
79
|
+
*/
|
|
80
|
+
quote(type: Service, params: any): Promise<any>;
|
|
81
|
+
/**
|
|
82
|
+
* Unified send method that routes to specific send methods based on type
|
|
83
|
+
* @param type Send type from SendType enum
|
|
84
|
+
* @param params Parameters for the send transaction
|
|
85
|
+
*/
|
|
86
|
+
send(type: SendType, params: any): Promise<any>;
|
|
87
|
+
quoteOneClickProxy(params: any): Promise<any>;
|
|
88
|
+
getAccountResources(params: any): Promise<any>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { TronWallet, TronWallet as default };
|