@bronlabs/intents-sdk 1.0.0 → 1.0.2

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 CHANGED
@@ -1,11 +1,11 @@
1
- # @bron/intents-sdk
1
+ # @bronlabs/intents-sdk
2
2
 
3
3
  TypeScript SDK for building Intents DeFi applications with order indexing, processing, and smart contract interactions.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @bron/intents-sdk
8
+ npm install @bronlabs/intents-sdk
9
9
  ```
10
10
 
11
11
  ## Core Components
@@ -15,7 +15,7 @@ npm install @bron/intents-sdk
15
15
  Monitors blockchain events and indexes order status changes.
16
16
 
17
17
  ```typescript
18
- import { OrderIndexer, IntentsConfig } from '@bron/intents-sdk';
18
+ import { OrderIndexer, IntentsConfig } from '@bronlabs/intents-sdk';
19
19
 
20
20
  const config: IntentsConfig = {
21
21
  rpcUrl: 'https://your-rpc-url',
@@ -41,7 +41,7 @@ await indexer.start();
41
41
  Base class for implementing custom order processing logic.
42
42
 
43
43
  ```typescript
44
- import { OrderProcessor } from '@bron/intents-sdk';
44
+ import { OrderProcessor } from '@bronlabs/intents-sdk';
45
45
 
46
46
  class CustomOrderProcessor extends OrderProcessor {
47
47
  async process(orderId: string, status: string): Promise<void> {
@@ -57,7 +57,7 @@ await processor.stop();
57
57
  ### Network Configuration
58
58
 
59
59
  ```typescript
60
- import { NetworkConfig, IntentsConfig } from '@bron/intents-sdk';
60
+ import { NetworkConfig, IntentsConfig } from '@bronlabs/intents-sdk';
61
61
 
62
62
  const config: IntentsConfig = {
63
63
  rpcUrl: 'https://mainnet.infura.io/v3/your-key',
package/abi/Erc20.json ADDED
@@ -0,0 +1,411 @@
1
+ [
2
+ {
3
+ "constant": true,
4
+ "inputs": [],
5
+ "name": "name",
6
+ "outputs": [{ "name": "", "type": "string" }],
7
+ "payable": false,
8
+ "stateMutability": "view",
9
+ "type": "function"
10
+ },
11
+ {
12
+ "constant": false,
13
+ "inputs": [{ "name": "_upgradedAddress", "type": "address" }],
14
+ "name": "deprecate",
15
+ "outputs": [],
16
+ "payable": false,
17
+ "stateMutability": "nonpayable",
18
+ "type": "function"
19
+ },
20
+ {
21
+ "constant": false,
22
+ "inputs": [
23
+ { "name": "_spender", "type": "address" },
24
+ { "name": "_value", "type": "uint256" }
25
+ ],
26
+ "name": "approve",
27
+ "outputs": [{ "name": "", "type": "bool" }],
28
+ "payable": false,
29
+ "stateMutability": "nonpayable",
30
+ "type": "function"
31
+ },
32
+ {
33
+ "constant": true,
34
+ "inputs": [],
35
+ "name": "deprecated",
36
+ "outputs": [{ "name": "", "type": "bool" }],
37
+ "payable": false,
38
+ "stateMutability": "view",
39
+ "type": "function"
40
+ },
41
+ {
42
+ "constant": false,
43
+ "inputs": [{ "name": "_evilUser", "type": "address" }],
44
+ "name": "addBlackList",
45
+ "outputs": [],
46
+ "payable": false,
47
+ "stateMutability": "nonpayable",
48
+ "type": "function"
49
+ },
50
+ {
51
+ "constant": true,
52
+ "inputs": [],
53
+ "name": "totalSupply",
54
+ "outputs": [{ "name": "", "type": "uint256" }],
55
+ "payable": false,
56
+ "stateMutability": "view",
57
+ "type": "function"
58
+ },
59
+ {
60
+ "constant": false,
61
+ "inputs": [
62
+ { "name": "_from", "type": "address" },
63
+ { "name": "_to", "type": "address" },
64
+ { "name": "_value", "type": "uint256" }
65
+ ],
66
+ "name": "transferFrom",
67
+ "outputs": [{ "name": "", "type": "bool" }],
68
+ "payable": false,
69
+ "stateMutability": "nonpayable",
70
+ "type": "function"
71
+ },
72
+ {
73
+ "constant": true,
74
+ "inputs": [],
75
+ "name": "upgradedAddress",
76
+ "outputs": [{ "name": "", "type": "address" }],
77
+ "payable": false,
78
+ "stateMutability": "view",
79
+ "type": "function"
80
+ },
81
+ {
82
+ "constant": true,
83
+ "inputs": [],
84
+ "name": "decimals",
85
+ "outputs": [{ "name": "", "type": "uint8" }],
86
+ "payable": false,
87
+ "stateMutability": "view",
88
+ "type": "function"
89
+ },
90
+ {
91
+ "constant": true,
92
+ "inputs": [],
93
+ "name": "maximumFee",
94
+ "outputs": [{ "name": "", "type": "uint256" }],
95
+ "payable": false,
96
+ "stateMutability": "view",
97
+ "type": "function"
98
+ },
99
+ {
100
+ "constant": true,
101
+ "inputs": [],
102
+ "name": "_totalSupply",
103
+ "outputs": [{ "name": "", "type": "uint256" }],
104
+ "payable": false,
105
+ "stateMutability": "view",
106
+ "type": "function"
107
+ },
108
+ {
109
+ "constant": false,
110
+ "inputs": [],
111
+ "name": "unpause",
112
+ "outputs": [],
113
+ "payable": false,
114
+ "stateMutability": "nonpayable",
115
+ "type": "function"
116
+ },
117
+ {
118
+ "constant": true,
119
+ "inputs": [{ "name": "_maker", "type": "address" }],
120
+ "name": "getBlackListStatus",
121
+ "outputs": [{ "name": "", "type": "bool" }],
122
+ "payable": false,
123
+ "stateMutability": "view",
124
+ "type": "function"
125
+ },
126
+ {
127
+ "constant": true,
128
+ "inputs": [],
129
+ "name": "paused",
130
+ "outputs": [{ "name": "", "type": "bool" }],
131
+ "payable": false,
132
+ "stateMutability": "view",
133
+ "type": "function"
134
+ },
135
+ {
136
+ "constant": false,
137
+ "inputs": [
138
+ { "name": "_spender", "type": "address" },
139
+ { "name": "_subtractedValue", "type": "uint256" }
140
+ ],
141
+ "name": "decreaseApproval",
142
+ "outputs": [{ "name": "", "type": "bool" }],
143
+ "payable": false,
144
+ "stateMutability": "nonpayable",
145
+ "type": "function"
146
+ },
147
+ {
148
+ "constant": true,
149
+ "inputs": [{ "name": "who", "type": "address" }],
150
+ "name": "balanceOf",
151
+ "outputs": [{ "name": "", "type": "uint256" }],
152
+ "payable": false,
153
+ "stateMutability": "view",
154
+ "type": "function"
155
+ },
156
+ {
157
+ "constant": true,
158
+ "inputs": [{ "name": "_value", "type": "uint256" }],
159
+ "name": "calcFee",
160
+ "outputs": [{ "name": "", "type": "uint256" }],
161
+ "payable": false,
162
+ "stateMutability": "view",
163
+ "type": "function"
164
+ },
165
+ {
166
+ "constant": false,
167
+ "inputs": [],
168
+ "name": "pause",
169
+ "outputs": [],
170
+ "payable": false,
171
+ "stateMutability": "nonpayable",
172
+ "type": "function"
173
+ },
174
+ {
175
+ "constant": true,
176
+ "inputs": [],
177
+ "name": "owner",
178
+ "outputs": [{ "name": "", "type": "address" }],
179
+ "payable": false,
180
+ "stateMutability": "view",
181
+ "type": "function"
182
+ },
183
+ {
184
+ "constant": true,
185
+ "inputs": [],
186
+ "name": "symbol",
187
+ "outputs": [{ "name": "", "type": "string" }],
188
+ "payable": false,
189
+ "stateMutability": "view",
190
+ "type": "function"
191
+ },
192
+ {
193
+ "constant": false,
194
+ "inputs": [
195
+ { "name": "_to", "type": "address" },
196
+ { "name": "_value", "type": "uint256" }
197
+ ],
198
+ "name": "transfer",
199
+ "outputs": [{ "name": "", "type": "bool" }],
200
+ "payable": false,
201
+ "stateMutability": "nonpayable",
202
+ "type": "function"
203
+ },
204
+ {
205
+ "constant": true,
206
+ "inputs": [{ "name": "who", "type": "address" }],
207
+ "name": "oldBalanceOf",
208
+ "outputs": [{ "name": "", "type": "uint256" }],
209
+ "payable": false,
210
+ "stateMutability": "view",
211
+ "type": "function"
212
+ },
213
+ {
214
+ "constant": false,
215
+ "inputs": [
216
+ { "name": "newBasisPoints", "type": "uint256" },
217
+ { "name": "newMaxFee", "type": "uint256" }
218
+ ],
219
+ "name": "setParams",
220
+ "outputs": [],
221
+ "payable": false,
222
+ "stateMutability": "nonpayable",
223
+ "type": "function"
224
+ },
225
+ {
226
+ "constant": false,
227
+ "inputs": [{ "name": "amount", "type": "uint256" }],
228
+ "name": "issue",
229
+ "outputs": [],
230
+ "payable": false,
231
+ "stateMutability": "nonpayable",
232
+ "type": "function"
233
+ },
234
+ {
235
+ "constant": false,
236
+ "inputs": [
237
+ { "name": "_spender", "type": "address" },
238
+ { "name": "_addedValue", "type": "uint256" }
239
+ ],
240
+ "name": "increaseApproval",
241
+ "outputs": [{ "name": "", "type": "bool" }],
242
+ "payable": false,
243
+ "stateMutability": "nonpayable",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "constant": false,
248
+ "inputs": [{ "name": "amount", "type": "uint256" }],
249
+ "name": "redeem",
250
+ "outputs": [],
251
+ "payable": false,
252
+ "stateMutability": "nonpayable",
253
+ "type": "function"
254
+ },
255
+ {
256
+ "constant": true,
257
+ "inputs": [
258
+ { "name": "_owner", "type": "address" },
259
+ { "name": "_spender", "type": "address" }
260
+ ],
261
+ "name": "allowance",
262
+ "outputs": [{ "name": "remaining", "type": "uint256" }],
263
+ "payable": false,
264
+ "stateMutability": "view",
265
+ "type": "function"
266
+ },
267
+ {
268
+ "constant": true,
269
+ "inputs": [],
270
+ "name": "basisPointsRate",
271
+ "outputs": [{ "name": "", "type": "uint256" }],
272
+ "payable": false,
273
+ "stateMutability": "view",
274
+ "type": "function"
275
+ },
276
+ {
277
+ "constant": true,
278
+ "inputs": [{ "name": "", "type": "address" }],
279
+ "name": "isBlackListed",
280
+ "outputs": [{ "name": "", "type": "bool" }],
281
+ "payable": false,
282
+ "stateMutability": "view",
283
+ "type": "function"
284
+ },
285
+ {
286
+ "constant": false,
287
+ "inputs": [{ "name": "_clearedUser", "type": "address" }],
288
+ "name": "removeBlackList",
289
+ "outputs": [],
290
+ "payable": false,
291
+ "stateMutability": "nonpayable",
292
+ "type": "function"
293
+ },
294
+ {
295
+ "constant": true,
296
+ "inputs": [],
297
+ "name": "MAX_UINT",
298
+ "outputs": [{ "name": "", "type": "uint256" }],
299
+ "payable": false,
300
+ "stateMutability": "view",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "constant": false,
305
+ "inputs": [{ "name": "newOwner", "type": "address" }],
306
+ "name": "transferOwnership",
307
+ "outputs": [],
308
+ "payable": false,
309
+ "stateMutability": "nonpayable",
310
+ "type": "function"
311
+ },
312
+ {
313
+ "constant": false,
314
+ "inputs": [{ "name": "_blackListedUser", "type": "address" }],
315
+ "name": "destroyBlackFunds",
316
+ "outputs": [],
317
+ "payable": false,
318
+ "stateMutability": "nonpayable",
319
+ "type": "function"
320
+ },
321
+ {
322
+ "inputs": [
323
+ { "name": "_initialSupply", "type": "uint256" },
324
+ { "name": "_name", "type": "string" },
325
+ { "name": "_symbol", "type": "string" },
326
+ { "name": "_decimals", "type": "uint8" }
327
+ ],
328
+ "payable": false,
329
+ "stateMutability": "nonpayable",
330
+ "type": "constructor"
331
+ },
332
+ {
333
+ "anonymous": false,
334
+ "inputs": [
335
+ { "indexed": true, "name": "_blackListedUser", "type": "address" },
336
+ { "indexed": false, "name": "_balance", "type": "uint256" }
337
+ ],
338
+ "name": "DestroyedBlackFunds",
339
+ "type": "event"
340
+ },
341
+ {
342
+ "anonymous": false,
343
+ "inputs": [{ "indexed": false, "name": "amount", "type": "uint256" }],
344
+ "name": "Issue",
345
+ "type": "event"
346
+ },
347
+ {
348
+ "anonymous": false,
349
+ "inputs": [{ "indexed": false, "name": "amount", "type": "uint256" }],
350
+ "name": "Redeem",
351
+ "type": "event"
352
+ },
353
+ {
354
+ "anonymous": false,
355
+ "inputs": [{ "indexed": false, "name": "newAddress", "type": "address" }],
356
+ "name": "Deprecate",
357
+ "type": "event"
358
+ },
359
+ {
360
+ "anonymous": false,
361
+ "inputs": [{ "indexed": true, "name": "_user", "type": "address" }],
362
+ "name": "AddedBlackList",
363
+ "type": "event"
364
+ },
365
+ {
366
+ "anonymous": false,
367
+ "inputs": [{ "indexed": true, "name": "_user", "type": "address" }],
368
+ "name": "RemovedBlackList",
369
+ "type": "event"
370
+ },
371
+ {
372
+ "anonymous": false,
373
+ "inputs": [
374
+ { "indexed": false, "name": "feeBasisPoints", "type": "uint256" },
375
+ { "indexed": false, "name": "maxFee", "type": "uint256" }
376
+ ],
377
+ "name": "Params",
378
+ "type": "event"
379
+ },
380
+ { "anonymous": false, "inputs": [], "name": "Pause", "type": "event" },
381
+ { "anonymous": false, "inputs": [], "name": "Unpause", "type": "event" },
382
+ {
383
+ "anonymous": false,
384
+ "inputs": [
385
+ { "indexed": true, "name": "previousOwner", "type": "address" },
386
+ { "indexed": true, "name": "newOwner", "type": "address" }
387
+ ],
388
+ "name": "OwnershipTransferred",
389
+ "type": "event"
390
+ },
391
+ {
392
+ "anonymous": false,
393
+ "inputs": [
394
+ { "indexed": true, "name": "owner", "type": "address" },
395
+ { "indexed": true, "name": "spender", "type": "address" },
396
+ { "indexed": false, "name": "value", "type": "uint256" }
397
+ ],
398
+ "name": "Approval",
399
+ "type": "event"
400
+ },
401
+ {
402
+ "anonymous": false,
403
+ "inputs": [
404
+ { "indexed": true, "name": "from", "type": "address" },
405
+ { "indexed": true, "name": "to", "type": "address" },
406
+ { "indexed": false, "name": "value", "type": "uint256" }
407
+ ],
408
+ "name": "Transfer",
409
+ "type": "event"
410
+ }
411
+ ]
@@ -44,8 +44,14 @@ export class EvmNetwork {
44
44
  })
45
45
  });
46
46
  const { result } = await response.json();
47
- if (!result) {
48
- return undefined;
47
+ if (!result || result.status == "0x0") {
48
+ log.info(`Transaction ${txHash} failed`);
49
+ return {
50
+ to: "",
51
+ token: "",
52
+ amount: BigNumber.from(0),
53
+ confirmed: true,
54
+ };
49
55
  }
50
56
  const { to, value, blockNumber } = result;
51
57
  log.info(`Confirmations ${txHash}: ${currentBlock - blockNumber}`);
@@ -67,8 +73,14 @@ export class EvmNetwork {
67
73
  })
68
74
  });
69
75
  const { result } = await response.json();
70
- if (!result) {
71
- return undefined;
76
+ if (!result || result.status == "0x0") {
77
+ log.info(`Transaction ${txHash} failed`);
78
+ return {
79
+ to: "",
80
+ token: "",
81
+ amount: BigNumber.from(0),
82
+ confirmed: true,
83
+ };
72
84
  }
73
85
  const receipt = result;
74
86
  log.info(`Confirmations ${txHash}: ${currentBlock - receipt.blockNumber}`);
@@ -1 +1 @@
1
- {"version":3,"file":"evm.js","sourceRoot":"","sources":["../../src/networks/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG3C,OAAO,EA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AE;YACtD,8DAA8D;SAC/D,EAAE,MAAM,CAAC,CAAC;QAEX,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { BigNumber } from "ethers";
2
+ import { Network, TransactionData } from "./index.js";
3
+ export declare class TrxNetwork implements Network {
4
+ private readonly rpcUrl;
5
+ private readonly confirmations;
6
+ private readonly nativeAssetDecimals;
7
+ readonly retryDelay: number;
8
+ private tronWeb;
9
+ constructor(rpcUrl: string, confirmations: number);
10
+ getDecimals(tokenAddress: string): Promise<number>;
11
+ getTxData(txHash: string, tokenAddress: string): Promise<TransactionData | undefined>;
12
+ transfer(privateKey: string, to: string, value: BigNumber, tokenAddress: string): Promise<string>;
13
+ }
@@ -0,0 +1,116 @@
1
+ import { BigNumber } from "ethers";
2
+ import { fromHex } from "tron-format-address";
3
+ import { TronWeb } from "tronweb";
4
+ import { log } from "../utils.js";
5
+ export class TrxNetwork {
6
+ constructor(rpcUrl, confirmations) {
7
+ this.nativeAssetDecimals = 18;
8
+ this.retryDelay = 5000;
9
+ this.rpcUrl = rpcUrl;
10
+ this.confirmations = confirmations;
11
+ this.tronWeb = new TronWeb({
12
+ fullHost: rpcUrl,
13
+ });
14
+ }
15
+ async getDecimals(tokenAddress) {
16
+ if (tokenAddress === "0x0") {
17
+ return this.nativeAssetDecimals;
18
+ }
19
+ const response = await fetch(`${this.rpcUrl}/wallet/triggerconstantcontract`, {
20
+ method: "POST",
21
+ headers: {
22
+ accept: "application/json",
23
+ "content-type": "application/json",
24
+ },
25
+ body: JSON.stringify({ owner_address: tokenAddress, contract_address: tokenAddress, function_selector: "decimals()", parameter: "", visible: true }),
26
+ }).then((res) => res.json()).then((res) => res.constant_result[0]);
27
+ return parseInt(response, 16);
28
+ }
29
+ async getTxData(txHash, tokenAddress) {
30
+ const currentBlock = await fetch(`${this.rpcUrl}/wallet/getblockbylatestnum`, {
31
+ method: "POST",
32
+ headers: {
33
+ accept: "application/json",
34
+ "content-type": "application/json",
35
+ },
36
+ body: JSON.stringify({ num: 1 }),
37
+ }).then((res) => res.json()).then((res) => res.block[0].block_header.raw_data.number);
38
+ // Native token - TRX
39
+ if (tokenAddress === "0x0") {
40
+ const response = await fetch(`${this.rpcUrl}/wallet/gettransactionbyid`, {
41
+ method: "POST",
42
+ headers: {
43
+ accept: "application/json",
44
+ "content-type": "application/json",
45
+ },
46
+ body: JSON.stringify({ value: txHash }),
47
+ }).then((res) => res.json());
48
+ if (!response || response.ret[0].contractRet != "SUCCESS") {
49
+ log.info(`Transaction ${txHash} failed`);
50
+ return {
51
+ to: "",
52
+ token: "",
53
+ amount: BigNumber.from(0),
54
+ confirmed: true,
55
+ };
56
+ }
57
+ const to = fromHex(response.raw_data.contract[0].parameter.value.to_address);
58
+ const value = response.raw_data.contract[0].parameter.value.amount;
59
+ const blockNumber = await fetch(`${this.rpcUrl}/wallet/gettransactioninfobyid`, {
60
+ method: "POST",
61
+ headers: {
62
+ accept: "application/json",
63
+ "content-type": "application/json",
64
+ },
65
+ body: JSON.stringify({ value: txHash }),
66
+ }).then((res) => res.json()).then((res) => res.blockNumber);
67
+ log.info(`Confirmations ${txHash}: ${currentBlock - blockNumber}`);
68
+ return {
69
+ to: to,
70
+ token: tokenAddress,
71
+ amount: BigNumber.from(value),
72
+ confirmed: currentBlock - blockNumber >= this.confirmations,
73
+ };
74
+ }
75
+ // ERC20 token
76
+ const response = await fetch(`${this.rpcUrl}/wallet/gettransactioninfobyid`, {
77
+ method: "POST",
78
+ headers: {
79
+ accept: "application/json",
80
+ "content-type": "application/json",
81
+ },
82
+ body: JSON.stringify({ value: txHash }),
83
+ }).then((res) => res.json());
84
+ if (!response || response.result != "SUCCESS") {
85
+ log.info(`Transaction ${txHash} failed`);
86
+ return {
87
+ to: "",
88
+ token: "",
89
+ amount: BigNumber.from(0),
90
+ confirmed: true,
91
+ };
92
+ }
93
+ log.info(`Confirmations ${txHash}: ${currentBlock - response.blockNumber}`);
94
+ return {
95
+ to: fromHex(response.log[0].topics[3].slice(24)),
96
+ token: fromHex(response.contract_address),
97
+ amount: BigNumber.from(parseInt(response.log[0].data, 16)),
98
+ confirmed: currentBlock - response.blockNumber >= this.confirmations,
99
+ };
100
+ }
101
+ async transfer(privateKey, to, value, tokenAddress) {
102
+ // Set private key
103
+ this.tronWeb.setPrivateKey(privateKey);
104
+ const { abi } = await this.tronWeb.trx.getContract(tokenAddress);
105
+ if (tokenAddress === "0x0") {
106
+ // Send TRX (native token)
107
+ const tx = await this.tronWeb.trx.sendTransaction(to, value.toNumber());
108
+ return tx.txid;
109
+ }
110
+ // Send USDT or other TRC20 tokens
111
+ const contract = await this.tronWeb.contract(abi.entrys, tokenAddress);
112
+ const tx = await contract.methods.transfer(to, value.toNumber()).send();
113
+ return tx.txid;
114
+ }
115
+ }
116
+ //# sourceMappingURL=trx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trx.js","sourceRoot":"","sources":["../../src/networks/trx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,OAAO,EAAS,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,OAAO,UAAU;IAOrB,YAAY,MAAc,EAAE,aAAqB;QAJhC,wBAAmB,GAAW,EAAE,CAAC;QACzC,eAAU,GAAW,IAAI,CAAC;QAIjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC;YACzB,QAAQ,EAAE,MAAM;SACjB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,WAAW,CAA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,CAAC;QACxE,OAAO,EAAE,CAAC,IAAI,CAAC;IAEjB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bronlabs/intents-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "SDK for Intents DeFi smart contracts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,11 +34,13 @@
34
34
  "dependencies": {
35
35
  "dotenv": "^16.5.0",
36
36
  "ethers": "^5.8.0",
37
+ "tron-format-address": "^0.1.12",
38
+ "tronweb": "^6.0.3",
37
39
  "winston": "^3.17.0"
38
40
  },
39
41
  "devDependencies": {
42
+ "@types/node": "^22.15.31",
40
43
  "rimraf": "^6.0.1",
41
- "typescript": "^5.8.3",
42
- "@types/node": "^22.15.31"
44
+ "typescript": "^5.8.3"
43
45
  }
44
46
  }