@dynamic-labs/tron 4.32.0 → 4.32.1-alpha.0
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/CHANGELOG.md +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +3 -2
- package/src/index.d.ts +1 -1
- package/src/types.d.ts +139 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.32.1-alpha.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.32.0...v4.32.1-alpha.0) (2025-09-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* correct naming ([#9513](https://github.com/dynamic-labs/dynamic-auth/issues/9513)) ([5b4e31b](https://github.com/dynamic-labs/dynamic-auth/commit/5b4e31b9bbf2401d377201a4cd12edf79eaef75f))
|
|
8
|
+
* don't deep link to metamask in-app browser when already in the in-app browser ([585b31f](https://github.com/dynamic-labs/dynamic-auth/commit/585b31f73c03534e6c1a59630599d17f331ff9a0))
|
|
9
|
+
|
|
2
10
|
## [4.32.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.31.4...v4.32.0) (2025-09-17)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/tron",
|
|
3
|
-
"version": "4.32.0",
|
|
3
|
+
"version": "4.32.1-alpha.0",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://www.dynamic.xyz/",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dynamic-labs/assert-package-version": "4.32.0"
|
|
16
|
+
"@dynamic-labs/assert-package-version": "4.32.1-alpha.0",
|
|
17
|
+
"tronweb": "6.0.4"
|
|
17
18
|
}
|
|
18
19
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { type ITronProvider } from './types';
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { TronWeb, Types } from 'tronweb';
|
|
2
|
+
/**
|
|
3
|
+
* Tron wallet provider interface
|
|
4
|
+
* Defines the contract that Tron wallet providers must implement
|
|
5
|
+
*/
|
|
6
|
+
export interface ITronProvider {
|
|
7
|
+
/** Whether the wallet is currently connected */
|
|
8
|
+
isConnected: boolean;
|
|
9
|
+
/** The current network chain ID */
|
|
10
|
+
chainId?: string;
|
|
11
|
+
/** The current network name */
|
|
12
|
+
network?: string;
|
|
13
|
+
/** The current wallet address */
|
|
14
|
+
address?: string;
|
|
15
|
+
/** TronWeb instance */
|
|
16
|
+
tronWeb?: TronWeb;
|
|
17
|
+
/**
|
|
18
|
+
* Connect to the wallet
|
|
19
|
+
* @returns Promise that resolves to connection result
|
|
20
|
+
*/
|
|
21
|
+
connect(): Promise<{
|
|
22
|
+
address: string;
|
|
23
|
+
chainId?: string;
|
|
24
|
+
network?: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Disconnect from the wallet
|
|
28
|
+
* @returns Promise that resolves when disconnected
|
|
29
|
+
*/
|
|
30
|
+
disconnect(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the current account address
|
|
33
|
+
* @returns Promise that resolves to the address
|
|
34
|
+
*/
|
|
35
|
+
getAddress(): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the current network information
|
|
38
|
+
* @returns Promise that resolves to network info
|
|
39
|
+
*/
|
|
40
|
+
getNetwork(): Promise<{
|
|
41
|
+
chainId: string;
|
|
42
|
+
name: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Sign a message
|
|
46
|
+
* @param message - Message to sign
|
|
47
|
+
* @param useTronHeader - Whether to use Tron message header
|
|
48
|
+
* @returns Promise that resolves to the signature
|
|
49
|
+
*/
|
|
50
|
+
signMessage(message: string | Uint8Array, useTronHeader?: boolean): Promise<string>;
|
|
51
|
+
/**
|
|
52
|
+
* Sign a transaction
|
|
53
|
+
* @param transaction - Transaction to sign
|
|
54
|
+
* @param privateKey - Optional private key (if not using wallet's key)
|
|
55
|
+
* @returns Promise that resolves to the signed transaction
|
|
56
|
+
*/
|
|
57
|
+
signTransaction(transaction: Types.Transaction, privateKey?: string): Promise<Types.SignedTransaction>;
|
|
58
|
+
/**
|
|
59
|
+
* Send a transaction
|
|
60
|
+
* @param transaction - Transaction to send
|
|
61
|
+
* @returns Promise that resolves to transaction result
|
|
62
|
+
*/
|
|
63
|
+
sendTransaction(transaction: Types.SignedTransaction): Promise<Types.BroadcastReturn<Types.SignedTransaction>>;
|
|
64
|
+
/**
|
|
65
|
+
* Send TRX to an address
|
|
66
|
+
* @param to - Recipient address
|
|
67
|
+
* @param amount - Amount in TRX
|
|
68
|
+
* @returns Promise that resolves to transaction result
|
|
69
|
+
*/
|
|
70
|
+
sendTrx(to: string, amount: number, options?: {
|
|
71
|
+
from?: string;
|
|
72
|
+
}): Promise<Types.BroadcastReturn<Types.SignedTransaction>>;
|
|
73
|
+
/**
|
|
74
|
+
* Send tokens to an address
|
|
75
|
+
* @param to - Recipient address
|
|
76
|
+
* @param amount - Amount of tokens
|
|
77
|
+
* @param tokenId - Token ID
|
|
78
|
+
* @returns Promise that resolves to transaction result
|
|
79
|
+
*/
|
|
80
|
+
sendToken(to: string, amount: number, tokenId: string | number, options?: {
|
|
81
|
+
from?: string;
|
|
82
|
+
}): Promise<Types.BroadcastReturn<Types.SignedTransaction>>;
|
|
83
|
+
/**
|
|
84
|
+
* Get account balance
|
|
85
|
+
* @param address - Optional address (defaults to current account)
|
|
86
|
+
* @returns Promise that resolves to balance
|
|
87
|
+
*/
|
|
88
|
+
getBalance(address?: string): Promise<number>;
|
|
89
|
+
/**
|
|
90
|
+
* Get token balance
|
|
91
|
+
* @param tokenId - Token ID
|
|
92
|
+
* @param address - Optional address (defaults to current account)
|
|
93
|
+
* @returns Promise that resolves to token balance
|
|
94
|
+
*/
|
|
95
|
+
getTokenBalance(tokenId: string, address?: string): Promise<number>;
|
|
96
|
+
/**
|
|
97
|
+
* Switch network
|
|
98
|
+
* @param networkId - Network ID to switch to
|
|
99
|
+
* @returns Promise that resolves when network is switched
|
|
100
|
+
*/
|
|
101
|
+
switchNetwork(networkId: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Add network
|
|
104
|
+
* @param network - Network configuration to add
|
|
105
|
+
* @returns Promise that resolves when network is added
|
|
106
|
+
*/
|
|
107
|
+
addNetwork(network: {
|
|
108
|
+
networkId: string;
|
|
109
|
+
name: string;
|
|
110
|
+
rpcUrl: string;
|
|
111
|
+
chainId?: string;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Listen for account changes
|
|
115
|
+
* @param callback - Callback function for account changes
|
|
116
|
+
*/
|
|
117
|
+
onAccountChange(callback: (address: string) => void): void;
|
|
118
|
+
/**
|
|
119
|
+
* Listen for network changes
|
|
120
|
+
* @param callback - Callback function for network changes
|
|
121
|
+
*/
|
|
122
|
+
onNetworkChange(callback: (network: {
|
|
123
|
+
chainId: string;
|
|
124
|
+
name: string;
|
|
125
|
+
}) => void): void;
|
|
126
|
+
/**
|
|
127
|
+
* Remove account change listener
|
|
128
|
+
* @param callback - Callback function to remove
|
|
129
|
+
*/
|
|
130
|
+
removeAccountChangeListener(callback: (address: string) => void): void;
|
|
131
|
+
/**
|
|
132
|
+
* Remove network change listener
|
|
133
|
+
* @param callback - Callback function to remove
|
|
134
|
+
*/
|
|
135
|
+
removeNetworkChangeListener(callback: (network: {
|
|
136
|
+
chainId: string;
|
|
137
|
+
name: string;
|
|
138
|
+
}) => void): void;
|
|
139
|
+
}
|