@layerzerolabs/lz-corekit-tron 3.0.15 → 3.0.17

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @layerzerolabs/lz-corekit-tron
2
2
 
3
+ ## 3.0.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 40f2269: islander mainnet
8
+ - 40f2269: testnets
9
+ - Updated dependencies [40f2269]
10
+ - Updated dependencies [40f2269]
11
+ - @layerzerolabs/lz-core@3.0.17
12
+ - @layerzerolabs/tron-utilities@3.0.17
13
+ - @layerzerolabs/lz-utilities@3.0.17
14
+
15
+ ## 3.0.16
16
+
17
+ ### Patch Changes
18
+
19
+ - 87a4bc9: islander mainnet
20
+ - Updated dependencies [87a4bc9]
21
+ - @layerzerolabs/lz-core@3.0.16
22
+ - @layerzerolabs/tron-utilities@3.0.16
23
+ - @layerzerolabs/lz-utilities@3.0.16
24
+
3
25
  ## 3.0.15
4
26
 
5
27
  ### Patch Changes
package/README.md CHANGED
@@ -1 +1,98 @@
1
- # @layerzerolabs/lz-corekit
1
+ # @layerzerolabs/lz-corekit-tron
2
+
3
+ The Tron CoreKit is a comprehensive SDK designed to interact with the Tron blockchain. It provides a set of utilities and modules to facilitate the development and integration of applications with the Tron blockchain.
4
+
5
+ ## Features
6
+
7
+ - **Retrieve Account Information**: Gets the balance of the specified address.
8
+ - **Retrieve Block Information**: Gets the block height, timestamp and related transactions of the specified block.
9
+ - **Transaction Management**: Get, build, sign, send and confirm transactions.
10
+
11
+ ## Installation
12
+
13
+ To install the Tron CoreKit, you can use npm or yarn:
14
+
15
+ ```sh
16
+ npm install @layerzerolabs/lz-corekit-tron
17
+ ```
18
+
19
+ or
20
+
21
+ ```sh
22
+ yarn add @layerzerolabs/lz-corekit-tron
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### Initialization
28
+
29
+ ```typescript
30
+ import { TronProvider } from "@layerzerolabs/lz-corekit-tron";
31
+
32
+ // url is the Tron chain full node url
33
+ const url = "http://127.0.0.1:8513";
34
+ const provider = TronProvider.from(url);
35
+ ```
36
+
37
+ ### Retrieve Account Information
38
+
39
+ #### Get Account Balance
40
+
41
+ ```typescript
42
+ import { TronProvider } from "@layerzerolabs/lz-corekit-tron";
43
+
44
+ // url is the Tron chain full node url
45
+ const url = "http://127.0.0.1:8513";
46
+ const provider = TronProvider.from(url);
47
+
48
+ const address = "0x1";
49
+ const balance = await provider.getBalance(address);
50
+ ```
51
+
52
+ ### Retrieve Block Information
53
+
54
+ #### Get Latest Block Height
55
+
56
+ ```typescript
57
+ import { TronProvider } from "@layerzerolabs/lz-corekit-tron";
58
+
59
+ // url is the Tron chain full node url
60
+ const url = "http://127.0.0.1:8513";
61
+ const provider = TronProvider.from(url);
62
+
63
+ const number = await provider.getBlockNumber();
64
+ ```
65
+
66
+ ### Transaction Management
67
+
68
+ #### Get Transaction by hash
69
+
70
+ ```typescript
71
+ import { TronProvider } from "@layerzerolabs/lz-corekit-tron";
72
+
73
+ // url is the Tron chain full node url
74
+ const url = "http://127.0.0.1:8513";
75
+ const provider = TronProvider.from(url);
76
+
77
+ const hash = "0x1";
78
+ const tx = await provider.getTransaction(hash);
79
+ ```
80
+
81
+ #### Sign, Send and Confirm Transaction
82
+
83
+ ```typescript
84
+ import { TronProvider, TronSigner } from '@layerzerolabs/lz-corekit-tron'
85
+ import { SignedTransaction, TransactionReceipt, TransactionRequest } from '@layerzerolabs/lz-core'
86
+
87
+ // url is the Tron chain full node url
88
+ const url = "http://127.0.0.1:8513"
89
+ const provider = TronProvider.from(url)
90
+
91
+ const privateKey = '0x1234'
92
+ const signer = TronSigner.from(privateKey)
93
+ signer.connect(provider)
94
+
95
+ const tx: TransactionRequest = ...
96
+ const stx: SignedTransaction = await signer.signTransaction(tx)
97
+ const receipt: TransactionReceipt = await signer.sendAndConfirm(stx)
98
+ ```