@hyperlane-xyz/tron-sdk 21.0.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/LICENSE.md +195 -0
- package/README.md +47 -0
- package/dist/abi/DomainRoutingIsm.json +240 -0
- package/dist/abi/ERC20.json +293 -0
- package/dist/abi/ERC20Test.json +365 -0
- package/dist/abi/HypERC20.json +920 -0
- package/dist/abi/HypERC20Collateral.json +1556 -0
- package/dist/abi/HypNative.json +1561 -0
- package/dist/abi/IERC20.json +190 -0
- package/dist/abi/IInterchainSecurityModule.json +44 -0
- package/dist/abi/IPostDispatchHook.json +81 -0
- package/dist/abi/InterchainGasPaymaster.json +518 -0
- package/dist/abi/Mailbox.json +686 -0
- package/dist/abi/MerkleTreeHook.json +375 -0
- package/dist/abi/NoopIsm.json +57 -0
- package/dist/abi/PausableHook.json +199 -0
- package/dist/abi/ProxyAdmin.json +156 -0
- package/dist/abi/StaticMerkleRootMultisigIsm.json +100 -0
- package/dist/abi/StaticMessageIdMultisigIsm.json +100 -0
- package/dist/abi/StorageGasOracle.json +205 -0
- package/dist/abi/TransparentUpgradeableProxy.json +81 -0
- package/dist/abi/ValidatorAnnounce.json +299 -0
- package/dist/clients/protocol.d.ts +17 -0
- package/dist/clients/protocol.d.ts.map +1 -0
- package/dist/clients/protocol.js +40 -0
- package/dist/clients/protocol.js.map +1 -0
- package/dist/clients/provider.d.ts +67 -0
- package/dist/clients/provider.d.ts.map +1 -0
- package/dist/clients/provider.js +558 -0
- package/dist/clients/provider.js.map +1 -0
- package/dist/clients/signer.d.ts +46 -0
- package/dist/clients/signer.d.ts.map +1 -0
- package/dist/clients/signer.js +561 -0
- package/dist/clients/signer.js.map +1 -0
- package/dist/hook/hook-query.d.ts +41 -0
- package/dist/hook/hook-query.d.ts.map +1 -0
- package/dist/hook/hook-query.js +79 -0
- package/dist/hook/hook-query.js.map +1 -0
- package/dist/hook/hook-tx.d.ts +39 -0
- package/dist/hook/hook-tx.d.ts.map +1 -0
- package/dist/hook/hook-tx.js +95 -0
- package/dist/hook/hook-tx.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/ism/ism-query.d.ts +70 -0
- package/dist/ism/ism-query.d.ts.map +1 -0
- package/dist/ism/ism-query.js +137 -0
- package/dist/ism/ism-query.js.map +1 -0
- package/dist/ism/ism-tx.d.ts +67 -0
- package/dist/ism/ism-tx.d.ts.map +1 -0
- package/dist/ism/ism-tx.js +110 -0
- package/dist/ism/ism-tx.js.map +1 -0
- package/dist/tests/1_interchain_security.e2e-test.d.ts +2 -0
- package/dist/tests/1_interchain_security.e2e-test.d.ts.map +1 -0
- package/dist/tests/1_interchain_security.e2e-test.js +172 -0
- package/dist/tests/1_interchain_security.e2e-test.js.map +1 -0
- package/dist/tests/2_core.e2e-test.d.ts +2 -0
- package/dist/tests/2_core.e2e-test.d.ts.map +1 -0
- package/dist/tests/2_core.e2e-test.js +117 -0
- package/dist/tests/2_core.e2e-test.js.map +1 -0
- package/dist/tests/3_post_dispatch.e2e-test.d.ts +2 -0
- package/dist/tests/3_post_dispatch.e2e-test.d.ts.map +1 -0
- package/dist/tests/3_post_dispatch.e2e-test.js +116 -0
- package/dist/tests/3_post_dispatch.e2e-test.js.map +1 -0
- package/dist/tests/4_warp.e2e-test.d.ts +2 -0
- package/dist/tests/4_warp.e2e-test.d.ts.map +1 -0
- package/dist/tests/4_warp.e2e-test.js +304 -0
- package/dist/tests/4_warp.e2e-test.js.map +1 -0
- package/dist/tests/index.e2e-test.d.ts +5 -0
- package/dist/tests/index.e2e-test.d.ts.map +1 -0
- package/dist/tests/index.e2e-test.js +6 -0
- package/dist/tests/index.e2e-test.js.map +1 -0
- package/dist/utils/index.d.ts +24 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +71 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/types.d.ts +94 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +13 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import { assert } from 'chai';
|
|
2
|
+
import HypNativeAbi from '../abi/HypNative.json' with { type: 'json' };
|
|
3
|
+
import TransparentUpgradeableProxyAbi from '../abi/TransparentUpgradeableProxy.json' with { type: 'json' };
|
|
4
|
+
import { getCreateOracleTx, getInitIgpTx, getSetOracleTx, getSetRemoteGasTx, } from '../hook/hook-tx.js';
|
|
5
|
+
import { getCreateMerkleRootMultisigIsmWithMetaProxyTx, getCreateMessageIdMultisigIsmWithMetaProxyTx, getInitRoutingIsmTx, } from '../ism/ism-tx.js';
|
|
6
|
+
import { TRON_EMPTY_ADDRESS, createDeploymentTransaction, } from '../utils/index.js';
|
|
7
|
+
import { TronProvider } from './provider.js';
|
|
8
|
+
export class TronSigner extends TronProvider {
|
|
9
|
+
static async connectWithSigner(rpcUrls, privateKey, extraParams) {
|
|
10
|
+
assert(extraParams, `extra params not defined`);
|
|
11
|
+
const metadata = extraParams.metadata;
|
|
12
|
+
assert(metadata, `metadata not defined in extra params`);
|
|
13
|
+
return new TronSigner(rpcUrls, privateKey);
|
|
14
|
+
}
|
|
15
|
+
constructor(rpcUrls, privateKey) {
|
|
16
|
+
super(rpcUrls, privateKey);
|
|
17
|
+
}
|
|
18
|
+
getSignerAddress() {
|
|
19
|
+
return this.tronweb.defaultAddress.base58 || '';
|
|
20
|
+
}
|
|
21
|
+
getTronweb() {
|
|
22
|
+
return this.tronweb;
|
|
23
|
+
}
|
|
24
|
+
supportsTransactionBatching() {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
async transactionToPrintableJson(transaction) {
|
|
28
|
+
return transaction;
|
|
29
|
+
}
|
|
30
|
+
async sendAndConfirmTransaction(transaction) {
|
|
31
|
+
const signedTx = await this.tronweb.trx.sign(transaction);
|
|
32
|
+
const result = await this.tronweb.trx.sendRawTransaction(signedTx);
|
|
33
|
+
if (!result?.result || !result.txid) {
|
|
34
|
+
throw new Error(`Failed to broadcast transaction: ${result.code ?? result.message ?? 'unknown error'}`);
|
|
35
|
+
}
|
|
36
|
+
const receipt = await this.waitForTransaction(result.txid);
|
|
37
|
+
return receipt;
|
|
38
|
+
}
|
|
39
|
+
async sendAndConfirmBatchTransactions(_transactions) {
|
|
40
|
+
throw new Error(`${TronSigner.name} does not support transaction batching`);
|
|
41
|
+
}
|
|
42
|
+
// ### TX CORE ###
|
|
43
|
+
async createMailbox(req) {
|
|
44
|
+
let proxyAdminAddress = req.proxyAdminAddress;
|
|
45
|
+
// 1. Deploy Proxy Admin if no address available
|
|
46
|
+
if (!proxyAdminAddress) {
|
|
47
|
+
const { proxyAdminAddress: address } = await this.createProxyAdmin({});
|
|
48
|
+
proxyAdminAddress = address;
|
|
49
|
+
}
|
|
50
|
+
// 2. Deploy Mailbox implementation
|
|
51
|
+
const implTx = await this.getCreateMailboxTransaction({
|
|
52
|
+
...req,
|
|
53
|
+
signer: this.getSignerAddress(),
|
|
54
|
+
});
|
|
55
|
+
const implReceipt = await this.sendAndConfirmTransaction(implTx);
|
|
56
|
+
const implementationAddress = this.tronweb.address.fromHex(implReceipt.contract_address);
|
|
57
|
+
// 3. Deploy TransparentUpgradeableProxy
|
|
58
|
+
// Note: We pass empty bytes for _data and initialize separately below
|
|
59
|
+
const proxyTx = await createDeploymentTransaction(this.tronweb, TransparentUpgradeableProxyAbi, this.getSignerAddress(), [implementationAddress, proxyAdminAddress, '0x']);
|
|
60
|
+
const proxyReceipt = await this.sendAndConfirmTransaction(proxyTx);
|
|
61
|
+
const mailboxAddress = this.tronweb.address.fromHex(proxyReceipt.contract_address);
|
|
62
|
+
// 4. Initialize the Mailbox through the proxy
|
|
63
|
+
const { transaction } = await this.tronweb.transactionBuilder.triggerSmartContract(mailboxAddress, 'initialize(address,address,address,address)', {}, [
|
|
64
|
+
{
|
|
65
|
+
type: 'address',
|
|
66
|
+
value: this.getSignerAddress(),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'address',
|
|
70
|
+
value: mailboxAddress,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'address',
|
|
74
|
+
value: mailboxAddress,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'address',
|
|
78
|
+
value: mailboxAddress,
|
|
79
|
+
},
|
|
80
|
+
], this.tronweb.address.toHex(this.getSignerAddress()));
|
|
81
|
+
await this.sendAndConfirmTransaction(transaction);
|
|
82
|
+
return {
|
|
83
|
+
mailboxAddress,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async setDefaultIsm(req) {
|
|
87
|
+
const tx = await this.getSetDefaultIsmTransaction({
|
|
88
|
+
...req,
|
|
89
|
+
signer: this.getSignerAddress(),
|
|
90
|
+
});
|
|
91
|
+
await this.sendAndConfirmTransaction(tx);
|
|
92
|
+
return {
|
|
93
|
+
ismAddress: req.ismAddress,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
async setDefaultHook(req) {
|
|
97
|
+
const tx = await this.getSetDefaultHookTransaction({
|
|
98
|
+
...req,
|
|
99
|
+
signer: this.getSignerAddress(),
|
|
100
|
+
});
|
|
101
|
+
await this.sendAndConfirmTransaction(tx);
|
|
102
|
+
return {
|
|
103
|
+
hookAddress: req.hookAddress,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
async setRequiredHook(req) {
|
|
107
|
+
const tx = await this.getSetRequiredHookTransaction({
|
|
108
|
+
...req,
|
|
109
|
+
signer: this.getSignerAddress(),
|
|
110
|
+
});
|
|
111
|
+
await this.sendAndConfirmTransaction(tx);
|
|
112
|
+
return {
|
|
113
|
+
hookAddress: req.hookAddress,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
async setMailboxOwner(req) {
|
|
117
|
+
const tx = await this.getSetMailboxOwnerTransaction({
|
|
118
|
+
...req,
|
|
119
|
+
signer: this.getSignerAddress(),
|
|
120
|
+
});
|
|
121
|
+
await this.sendAndConfirmTransaction(tx);
|
|
122
|
+
return {
|
|
123
|
+
newOwner: req.newOwner,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
async createMerkleRootMultisigIsm(req) {
|
|
127
|
+
const tx = await this.getCreateMerkleRootMultisigIsmTransaction({
|
|
128
|
+
signer: this.getSignerAddress(),
|
|
129
|
+
validators: req.validators,
|
|
130
|
+
threshold: req.threshold,
|
|
131
|
+
});
|
|
132
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
133
|
+
const implAddress = this.tronweb.address.fromHex(receipt.contract_address);
|
|
134
|
+
const metaProxyTx = await getCreateMerkleRootMultisigIsmWithMetaProxyTx(this.tronweb, this.getSignerAddress(), implAddress, {
|
|
135
|
+
validators: req.validators,
|
|
136
|
+
threshold: req.threshold,
|
|
137
|
+
});
|
|
138
|
+
const metaProxyReceipt = await this.sendAndConfirmTransaction(metaProxyTx);
|
|
139
|
+
const ismAddress = this.tronweb.address.fromHex(metaProxyReceipt.contract_address);
|
|
140
|
+
return {
|
|
141
|
+
ismAddress,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async createMessageIdMultisigIsm(req) {
|
|
145
|
+
const tx = await this.getCreateMessageIdMultisigIsmTransaction({
|
|
146
|
+
signer: this.getSignerAddress(),
|
|
147
|
+
validators: req.validators,
|
|
148
|
+
threshold: req.threshold,
|
|
149
|
+
});
|
|
150
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
151
|
+
const implAddress = this.tronweb.address.fromHex(receipt.contract_address);
|
|
152
|
+
const metaProxyTx = await getCreateMessageIdMultisigIsmWithMetaProxyTx(this.tronweb, this.getSignerAddress(), implAddress, {
|
|
153
|
+
validators: req.validators,
|
|
154
|
+
threshold: req.threshold,
|
|
155
|
+
});
|
|
156
|
+
const metaProxyReceipt = await this.sendAndConfirmTransaction(metaProxyTx);
|
|
157
|
+
const ismAddress = this.tronweb.address.fromHex(metaProxyReceipt.contract_address);
|
|
158
|
+
return {
|
|
159
|
+
ismAddress,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
async createRoutingIsm(req) {
|
|
163
|
+
const tx = await this.getCreateRoutingIsmTransaction({
|
|
164
|
+
...req,
|
|
165
|
+
signer: this.getSignerAddress(),
|
|
166
|
+
});
|
|
167
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
168
|
+
const ismAddress = this.tronweb.address.fromHex(receipt.contract_address);
|
|
169
|
+
const initTx = await getInitRoutingIsmTx(this.tronweb, this.getSignerAddress(), {
|
|
170
|
+
ismAddress,
|
|
171
|
+
routes: req.routes,
|
|
172
|
+
});
|
|
173
|
+
await this.sendAndConfirmTransaction(initTx);
|
|
174
|
+
return {
|
|
175
|
+
ismAddress,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
async setRoutingIsmRoute(req) {
|
|
179
|
+
const tx = await this.getSetRoutingIsmRouteTransaction({
|
|
180
|
+
...req,
|
|
181
|
+
signer: this.getSignerAddress(),
|
|
182
|
+
});
|
|
183
|
+
await this.sendAndConfirmTransaction(tx);
|
|
184
|
+
return {
|
|
185
|
+
route: req.route,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
async removeRoutingIsmRoute(req) {
|
|
189
|
+
const tx = await this.getRemoveRoutingIsmRouteTransaction({
|
|
190
|
+
...req,
|
|
191
|
+
signer: this.getSignerAddress(),
|
|
192
|
+
});
|
|
193
|
+
await this.sendAndConfirmTransaction(tx);
|
|
194
|
+
return {
|
|
195
|
+
domainId: req.domainId,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
async setRoutingIsmOwner(req) {
|
|
199
|
+
const tx = await this.getSetRoutingIsmOwnerTransaction({
|
|
200
|
+
...req,
|
|
201
|
+
signer: this.getSignerAddress(),
|
|
202
|
+
});
|
|
203
|
+
await this.sendAndConfirmTransaction(tx);
|
|
204
|
+
return {
|
|
205
|
+
newOwner: req.newOwner,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
async createNoopIsm(req) {
|
|
209
|
+
const tx = await this.getCreateNoopIsmTransaction({
|
|
210
|
+
...req,
|
|
211
|
+
signer: this.getSignerAddress(),
|
|
212
|
+
});
|
|
213
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
214
|
+
return {
|
|
215
|
+
ismAddress: this.tronweb.address.fromHex(receipt.contract_address),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
async createMerkleTreeHook(req) {
|
|
219
|
+
const tx = await this.getCreateMerkleTreeHookTransaction({
|
|
220
|
+
...req,
|
|
221
|
+
signer: this.getSignerAddress(),
|
|
222
|
+
});
|
|
223
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
224
|
+
return {
|
|
225
|
+
hookAddress: this.tronweb.address.fromHex(receipt.contract_address),
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
async createInterchainGasPaymasterHook(req) {
|
|
229
|
+
let proxyAdminAddress = req.proxyAdminAddress;
|
|
230
|
+
// 1. Deploy Proxy Admin if no address available
|
|
231
|
+
if (!proxyAdminAddress) {
|
|
232
|
+
const { proxyAdminAddress: address } = await this.createProxyAdmin({});
|
|
233
|
+
proxyAdminAddress = address;
|
|
234
|
+
}
|
|
235
|
+
// 2. Deploy IGP implementation
|
|
236
|
+
const implTx = await this.getCreateInterchainGasPaymasterHookTransaction({
|
|
237
|
+
...req,
|
|
238
|
+
signer: this.getSignerAddress(),
|
|
239
|
+
});
|
|
240
|
+
const implReceipt = await this.sendAndConfirmTransaction(implTx);
|
|
241
|
+
const implementationAddress = this.tronweb.address.fromHex(implReceipt.contract_address);
|
|
242
|
+
// 3. Deploy TransparentUpgradeableProxy
|
|
243
|
+
// Note: We pass empty bytes for _data and initialize separately below
|
|
244
|
+
const proxyTx = await createDeploymentTransaction(this.tronweb, TransparentUpgradeableProxyAbi, this.getSignerAddress(), [implementationAddress, proxyAdminAddress, '0x']);
|
|
245
|
+
const proxyReceipt = await this.sendAndConfirmTransaction(proxyTx);
|
|
246
|
+
const hookAddress = this.tronweb.address.fromHex(proxyReceipt.contract_address);
|
|
247
|
+
const initTx = await getInitIgpTx(this.tronweb, this.getSignerAddress(), {
|
|
248
|
+
igpAddress: hookAddress,
|
|
249
|
+
});
|
|
250
|
+
await this.sendAndConfirmTransaction(initTx);
|
|
251
|
+
const oracleTx = await getCreateOracleTx(this.tronweb, this.getSignerAddress());
|
|
252
|
+
const oracleReceipt = await this.sendAndConfirmTransaction(oracleTx);
|
|
253
|
+
const oracleAddress = this.tronweb.address.fromHex(oracleReceipt.contract_address);
|
|
254
|
+
const setOracleTx = await getSetOracleTx(this.tronweb, this.getSignerAddress(), {
|
|
255
|
+
igpAddress: hookAddress,
|
|
256
|
+
oracleAddress,
|
|
257
|
+
});
|
|
258
|
+
await this.sendAndConfirmTransaction(setOracleTx);
|
|
259
|
+
return {
|
|
260
|
+
hookAddress,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
async setInterchainGasPaymasterHookOwner(req) {
|
|
264
|
+
const tx = await this.getSetInterchainGasPaymasterHookOwnerTransaction({
|
|
265
|
+
...req,
|
|
266
|
+
signer: this.getSignerAddress(),
|
|
267
|
+
});
|
|
268
|
+
await this.sendAndConfirmTransaction(tx);
|
|
269
|
+
return {
|
|
270
|
+
newOwner: req.newOwner,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
async setDestinationGasConfig(req) {
|
|
274
|
+
const tx = await this.getSetDestinationGasConfigTransaction({
|
|
275
|
+
...req,
|
|
276
|
+
signer: this.getSignerAddress(),
|
|
277
|
+
});
|
|
278
|
+
await this.sendAndConfirmTransaction(tx);
|
|
279
|
+
const setGasTx = await getSetRemoteGasTx(this.tronweb, this.getSignerAddress(), {
|
|
280
|
+
igpAddress: req.hookAddress,
|
|
281
|
+
destinationGasConfigs: [
|
|
282
|
+
{
|
|
283
|
+
remoteDomainId: req.destinationGasConfig.remoteDomainId,
|
|
284
|
+
gasOracle: {
|
|
285
|
+
tokenExchangeRate: req.destinationGasConfig.gasOracle.tokenExchangeRate,
|
|
286
|
+
gasPrice: req.destinationGasConfig.gasOracle.gasPrice,
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
});
|
|
291
|
+
await this.sendAndConfirmTransaction(setGasTx);
|
|
292
|
+
return {
|
|
293
|
+
destinationGasConfig: req.destinationGasConfig,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
async removeDestinationGasConfig(req) {
|
|
297
|
+
const tx = await this.getRemoveDestinationGasConfigTransaction({
|
|
298
|
+
...req,
|
|
299
|
+
signer: this.getSignerAddress(),
|
|
300
|
+
});
|
|
301
|
+
await this.sendAndConfirmTransaction(tx);
|
|
302
|
+
return {
|
|
303
|
+
remoteDomainId: req.remoteDomainId,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
async createNoopHook(req) {
|
|
307
|
+
const tx = await this.getCreateNoopHookTransaction({
|
|
308
|
+
...req,
|
|
309
|
+
signer: this.getSignerAddress(),
|
|
310
|
+
});
|
|
311
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
312
|
+
return {
|
|
313
|
+
hookAddress: this.tronweb.address.fromHex(receipt.contract_address),
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
async createValidatorAnnounce(req) {
|
|
317
|
+
const tx = await this.getCreateValidatorAnnounceTransaction({
|
|
318
|
+
...req,
|
|
319
|
+
signer: this.getSignerAddress(),
|
|
320
|
+
});
|
|
321
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
322
|
+
return {
|
|
323
|
+
validatorAnnounceId: this.tronweb.address.fromHex(receipt.contract_address),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
async createProxyAdmin(req) {
|
|
327
|
+
const tx = await this.getCreateProxyAdminTransaction({
|
|
328
|
+
...req,
|
|
329
|
+
signer: this.getSignerAddress(),
|
|
330
|
+
});
|
|
331
|
+
const receipt = await this.sendAndConfirmTransaction(tx);
|
|
332
|
+
const proxyAdminAddress = this.tronweb.address.fromHex(receipt.contract_address);
|
|
333
|
+
// Transfer ownership if owner is provided and different from signer
|
|
334
|
+
if (req.owner && req.owner !== this.getSignerAddress()) {
|
|
335
|
+
const { transaction } = await this.tronweb.transactionBuilder.triggerSmartContract(proxyAdminAddress, 'transferOwnership(address)', {}, [
|
|
336
|
+
{
|
|
337
|
+
type: 'address',
|
|
338
|
+
value: req.owner,
|
|
339
|
+
},
|
|
340
|
+
], this.tronweb.address.toHex(this.getSignerAddress()));
|
|
341
|
+
await this.sendAndConfirmTransaction(transaction);
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
proxyAdminAddress,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
async setProxyAdminOwner(req) {
|
|
348
|
+
const tx = await this.getSetProxyAdminOwnerTransaction({
|
|
349
|
+
...req,
|
|
350
|
+
signer: this.getSignerAddress(),
|
|
351
|
+
});
|
|
352
|
+
await this.sendAndConfirmTransaction(tx);
|
|
353
|
+
return {
|
|
354
|
+
newOwner: req.newOwner,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
// ### TX WARP ###
|
|
358
|
+
async createNativeToken(req) {
|
|
359
|
+
let proxyAdminAddress = req.proxyAdminAddress;
|
|
360
|
+
// 1. Deploy Proxy Admin if no address available
|
|
361
|
+
if (!proxyAdminAddress) {
|
|
362
|
+
const { proxyAdminAddress: address } = await this.createProxyAdmin({});
|
|
363
|
+
proxyAdminAddress = address;
|
|
364
|
+
}
|
|
365
|
+
// 2. Deploy token implementation
|
|
366
|
+
const implTx = await this.getCreateNativeTokenTransaction({
|
|
367
|
+
...req,
|
|
368
|
+
signer: this.getSignerAddress(),
|
|
369
|
+
});
|
|
370
|
+
const implReceipt = await this.sendAndConfirmTransaction(implTx);
|
|
371
|
+
const implementationAddress = this.tronweb.address.fromHex(implReceipt.contract_address);
|
|
372
|
+
// 3. Deploy TransparentUpgradeableProxy
|
|
373
|
+
const proxyTx = await createDeploymentTransaction(this.tronweb, TransparentUpgradeableProxyAbi, this.getSignerAddress(), [implementationAddress, proxyAdminAddress, '0x']);
|
|
374
|
+
const proxyReceipt = await this.sendAndConfirmTransaction(proxyTx);
|
|
375
|
+
const tokenAddress = this.tronweb.address.fromHex(proxyReceipt.contract_address);
|
|
376
|
+
// 4. Initialize the token through the proxy
|
|
377
|
+
const { transaction } = await this.tronweb.transactionBuilder.triggerSmartContract(tokenAddress, 'initialize(address,address,address)', {}, [
|
|
378
|
+
{
|
|
379
|
+
type: 'address',
|
|
380
|
+
value: TRON_EMPTY_ADDRESS,
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
type: 'address',
|
|
384
|
+
value: TRON_EMPTY_ADDRESS,
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
type: 'address',
|
|
388
|
+
value: this.getSignerAddress(),
|
|
389
|
+
},
|
|
390
|
+
], this.tronweb.address.toHex(this.getSignerAddress()));
|
|
391
|
+
await this.sendAndConfirmTransaction(transaction);
|
|
392
|
+
return {
|
|
393
|
+
tokenAddress,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
async createCollateralToken(req) {
|
|
397
|
+
let proxyAdminAddress = req.proxyAdminAddress;
|
|
398
|
+
// 1. Deploy Proxy Admin if no address available
|
|
399
|
+
if (!proxyAdminAddress) {
|
|
400
|
+
const { proxyAdminAddress: address } = await this.createProxyAdmin({});
|
|
401
|
+
proxyAdminAddress = address;
|
|
402
|
+
}
|
|
403
|
+
// 2. Deploy token implementation
|
|
404
|
+
const implTx = await this.getCreateCollateralTokenTransaction({
|
|
405
|
+
...req,
|
|
406
|
+
signer: this.getSignerAddress(),
|
|
407
|
+
});
|
|
408
|
+
const implReceipt = await this.sendAndConfirmTransaction(implTx);
|
|
409
|
+
const implementationAddress = this.tronweb.address.fromHex(implReceipt.contract_address);
|
|
410
|
+
// 3. Deploy TransparentUpgradeableProxy
|
|
411
|
+
const proxyTx = await createDeploymentTransaction(this.tronweb, TransparentUpgradeableProxyAbi, this.getSignerAddress(), [implementationAddress, proxyAdminAddress, '0x']);
|
|
412
|
+
const proxyReceipt = await this.sendAndConfirmTransaction(proxyTx);
|
|
413
|
+
const tokenAddress = this.tronweb.address.fromHex(proxyReceipt.contract_address);
|
|
414
|
+
// 4. Initialize the token through the proxy
|
|
415
|
+
const { transaction } = await this.tronweb.transactionBuilder.triggerSmartContract(tokenAddress, 'initialize(address,address,address)', {}, [
|
|
416
|
+
{
|
|
417
|
+
type: 'address',
|
|
418
|
+
value: TRON_EMPTY_ADDRESS,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
type: 'address',
|
|
422
|
+
value: TRON_EMPTY_ADDRESS,
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
type: 'address',
|
|
426
|
+
value: this.getSignerAddress(),
|
|
427
|
+
},
|
|
428
|
+
], this.tronweb.address.toHex(this.getSignerAddress()));
|
|
429
|
+
await this.sendAndConfirmTransaction(transaction);
|
|
430
|
+
return {
|
|
431
|
+
tokenAddress,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
async createSyntheticToken(req) {
|
|
435
|
+
let proxyAdminAddress = req.proxyAdminAddress;
|
|
436
|
+
// 1. Deploy Proxy Admin if no address available
|
|
437
|
+
if (!proxyAdminAddress) {
|
|
438
|
+
const { proxyAdminAddress: address } = await this.createProxyAdmin({});
|
|
439
|
+
proxyAdminAddress = address;
|
|
440
|
+
}
|
|
441
|
+
// 2. Deploy token implementation
|
|
442
|
+
const implTx = await this.getCreateSyntheticTokenTransaction({
|
|
443
|
+
...req,
|
|
444
|
+
signer: this.getSignerAddress(),
|
|
445
|
+
});
|
|
446
|
+
const implReceipt = await this.sendAndConfirmTransaction(implTx);
|
|
447
|
+
const implementationAddress = this.tronweb.address.fromHex(implReceipt.contract_address);
|
|
448
|
+
// 3. Deploy TransparentUpgradeableProxy
|
|
449
|
+
const proxyTx = await createDeploymentTransaction(this.tronweb, TransparentUpgradeableProxyAbi, this.getSignerAddress(), [implementationAddress, proxyAdminAddress, '0x']);
|
|
450
|
+
const proxyReceipt = await this.sendAndConfirmTransaction(proxyTx);
|
|
451
|
+
const tokenAddress = this.tronweb.address.fromHex(proxyReceipt.contract_address);
|
|
452
|
+
// 4. Initialize the token through the proxy
|
|
453
|
+
const { transaction } = await this.tronweb.transactionBuilder.triggerSmartContract(tokenAddress, 'initialize(uint256,string,string,address,address,address)', {}, [
|
|
454
|
+
{
|
|
455
|
+
type: 'uint256',
|
|
456
|
+
value: 0,
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
type: 'string',
|
|
460
|
+
value: req.name,
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
type: 'string',
|
|
464
|
+
value: req.denom,
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
type: 'address',
|
|
468
|
+
value: TRON_EMPTY_ADDRESS,
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
type: 'address',
|
|
472
|
+
value: TRON_EMPTY_ADDRESS,
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
type: 'address',
|
|
476
|
+
value: this.getSignerAddress(),
|
|
477
|
+
},
|
|
478
|
+
], this.tronweb.address.toHex(this.getSignerAddress()));
|
|
479
|
+
await this.sendAndConfirmTransaction(transaction);
|
|
480
|
+
return {
|
|
481
|
+
tokenAddress,
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
async setTokenOwner(req) {
|
|
485
|
+
const tx = await this.getSetTokenOwnerTransaction({
|
|
486
|
+
...req,
|
|
487
|
+
signer: this.getSignerAddress(),
|
|
488
|
+
});
|
|
489
|
+
await this.sendAndConfirmTransaction(tx);
|
|
490
|
+
return {
|
|
491
|
+
newOwner: req.newOwner,
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
async setTokenIsm(req) {
|
|
495
|
+
const tx = await this.getSetTokenIsmTransaction({
|
|
496
|
+
...req,
|
|
497
|
+
signer: this.getSignerAddress(),
|
|
498
|
+
});
|
|
499
|
+
await this.sendAndConfirmTransaction(tx);
|
|
500
|
+
return {
|
|
501
|
+
ismAddress: req.ismAddress || '',
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
async setTokenHook(req) {
|
|
505
|
+
const tx = await this.getSetTokenHookTransaction({
|
|
506
|
+
...req,
|
|
507
|
+
signer: this.getSignerAddress(),
|
|
508
|
+
});
|
|
509
|
+
await this.sendAndConfirmTransaction(tx);
|
|
510
|
+
return {
|
|
511
|
+
hookAddress: req.hookAddress || '',
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
async enrollRemoteRouter(req) {
|
|
515
|
+
const tx = await this.getEnrollRemoteRouterTransaction({
|
|
516
|
+
...req,
|
|
517
|
+
signer: this.getSignerAddress(),
|
|
518
|
+
});
|
|
519
|
+
await this.sendAndConfirmTransaction(tx);
|
|
520
|
+
const token = this.tronweb.contract(HypNativeAbi.abi, req.tokenAddress);
|
|
521
|
+
await token
|
|
522
|
+
.setDestinationGas(req.remoteRouter.receiverDomainId, req.remoteRouter.gas)
|
|
523
|
+
.send({
|
|
524
|
+
shouldPollResponse: true,
|
|
525
|
+
});
|
|
526
|
+
return {
|
|
527
|
+
receiverDomainId: req.remoteRouter.receiverDomainId,
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
async unenrollRemoteRouter(req) {
|
|
531
|
+
const tx = await this.getUnenrollRemoteRouterTransaction({
|
|
532
|
+
...req,
|
|
533
|
+
signer: this.getSignerAddress(),
|
|
534
|
+
});
|
|
535
|
+
await this.sendAndConfirmTransaction(tx);
|
|
536
|
+
return {
|
|
537
|
+
receiverDomainId: req.receiverDomainId,
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
async transfer(req) {
|
|
541
|
+
const tx = await this.getTransferTransaction({
|
|
542
|
+
...req,
|
|
543
|
+
signer: this.getSignerAddress(),
|
|
544
|
+
});
|
|
545
|
+
await this.sendAndConfirmTransaction(tx);
|
|
546
|
+
return {
|
|
547
|
+
recipient: req.recipient,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
async remoteTransfer(req) {
|
|
551
|
+
const tx = await this.getRemoteTransferTransaction({
|
|
552
|
+
...req,
|
|
553
|
+
signer: this.getSignerAddress(),
|
|
554
|
+
});
|
|
555
|
+
await this.sendAndConfirmTransaction(tx);
|
|
556
|
+
return {
|
|
557
|
+
tokenAddress: req.tokenAddress,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
//# sourceMappingURL=signer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/clients/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,OAAO,YAAY,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvE,OAAO,8BAA8B,MAAM,yCAAyC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3G,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,6CAA6C,EAC7C,4CAA4C,EAC5C,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,OAAO,UACX,SAAQ,YAAY;IAGpB,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAC5B,OAAiB,EACjB,UAAkB,EAClB,WAAiC;QAEjC,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC,CAAC;QAEhD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAmC,CAAC;QACjE,MAAM,CAAC,QAAQ,EAAE,sCAAsC,CAAC,CA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C,yBAAyB,CAAC,EAAE,CAAC,CAAC;QAEzC,OAAO;YACL,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;SACvC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,GAAsC;QAEtC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC;YAC3C,GAAG,GAAG;YACN,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE;SAChC,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;QAEzC,OAAO;YACL,SAAS,EAAE,GAAG,CAAC,SAAS;SACzB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,GAA4C;QAE5C,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,4BAA4B,CAAC;YACjD,GAAG,GAAG;YACN,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE;SAChC,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC;QAEzC,OAAO;YACL,YAAY,EAAE,GAAG,CAAC,YAAY;SAC/B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TronWeb } from 'tronweb';
|
|
2
|
+
import { TronHookTypes } from '../utils/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Type alias for query client with ISM extension.
|
|
5
|
+
* Used throughout ISM readers to ensure type safety.
|
|
6
|
+
*/
|
|
7
|
+
export type TronHookQueryClient = TronWeb;
|
|
8
|
+
export declare function getHookType(query: TronHookQueryClient, hookAddress: string): Promise<TronHookTypes>;
|
|
9
|
+
/**
|
|
10
|
+
* Query IGP hook configuration from chain.
|
|
11
|
+
*
|
|
12
|
+
* @param query - Query client with PostDispatchExtension
|
|
13
|
+
* @param hookId - ID of the IGP hook to query
|
|
14
|
+
* @returns IGP hook configuration with address, owner, and destination gas configs
|
|
15
|
+
* @throws Error if IGP hook not found
|
|
16
|
+
*/
|
|
17
|
+
export declare function getIgpHookConfig(query: TronHookQueryClient, hookId: string): Promise<{
|
|
18
|
+
address: string;
|
|
19
|
+
owner: string;
|
|
20
|
+
destinationGasConfigs: {
|
|
21
|
+
[domainId: string]: {
|
|
22
|
+
gasOracle: {
|
|
23
|
+
tokenExchangeRate: string;
|
|
24
|
+
gasPrice: string;
|
|
25
|
+
};
|
|
26
|
+
gasOverhead: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Query MerkleTree hook configuration from chain.
|
|
32
|
+
*
|
|
33
|
+
* @param query - Query client with PostDispatchExtension
|
|
34
|
+
* @param hookId - ID of the MerkleTree hook to query
|
|
35
|
+
* @returns MerkleTree hook configuration with address
|
|
36
|
+
* @throws Error if MerkleTree hook not found
|
|
37
|
+
*/
|
|
38
|
+
export declare function getMerkleTreeHookConfig(query: TronHookQueryClient, hookId: string): Promise<{
|
|
39
|
+
address: string;
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=hook-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-query.d.ts","sourceRoot":"","sources":["../../src/hook/hook-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAE1C,wBAAsB,WAAW,CAC/B,KAAK,EAAE,mBAAmB,EAC1B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,CAAC,CAaxB;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB,EAAE;QACrB,CAAC,QAAQ,EAAE,MAAM,GAAG;YAClB,SAAS,EAAE;gBACT,iBAAiB,EAAE,MAAM,CAAC;gBAC1B,QAAQ,EAAE,MAAM,CAAC;aAClB,CAAC;YACF,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;CACH,CAAC,CAqDD;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAeD"}
|