Skip to content

Commit c4b472d

Browse files
committed
fix: update native currency types and add Tron network support
- Added TronChainName to the NativeEthCurrency type for better network representation. - Included Tron and Nile Tron definitions in the native currencies list. - Updated deployment scripts to correct artifact paths for Tron contracts.
1 parent b005528 commit c4b472d

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

packages/currency/src/native.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CurrencyTypes, RequestLogicTypes } from '@requestnetwork/types';
22

33
type NativeEthCurrency = CurrencyTypes.NamedNativeCurrency & {
4-
network: CurrencyTypes.EvmChainName | CurrencyTypes.NearChainName;
4+
network: CurrencyTypes.EvmChainName | CurrencyTypes.NearChainName | CurrencyTypes.TronChainName;
55
};
66
type NativeBtcCurrency = CurrencyTypes.NamedNativeCurrency & {
77
network: CurrencyTypes.BtcChainName;
@@ -178,6 +178,18 @@ export const nativeCurrencies: Record<RequestLogicTypes.CURRENCY.ETH, NativeEthC
178178
name: '$S',
179179
network: 'sonic',
180180
},
181+
{
182+
symbol: 'TRX',
183+
decimals: 6,
184+
name: 'Tron',
185+
network: 'tron',
186+
},
187+
{
188+
symbol: 'TRX-nile',
189+
decimals: 6,
190+
name: 'Nile Tron',
191+
network: 'nile',
192+
},
181193
],
182194
[RequestLogicTypes.CURRENCY.BTC]: [
183195
{

packages/smart-contracts/scripts/tron/deploy-mainnet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const tronWeb = new TronWeb({
3939
privateKey: PRIVATE_KEY,
4040
});
4141

42-
const ARTIFACTS_DIR = path.join(__dirname, '../../tron/build');
42+
const ARTIFACTS_DIR = path.join(__dirname, '../../build/tron');
4343

4444
async function loadArtifact(contractName) {
4545
const artifactPath = path.join(ARTIFACTS_DIR, `${contractName}.json`);

packages/smart-contracts/scripts/tron/deploy-nile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const tronWeb = new TronWeb({
3232
});
3333

3434
// Contract artifacts paths
35-
const ARTIFACTS_DIR = path.join(__dirname, '../../tron/build');
35+
const ARTIFACTS_DIR = path.join(__dirname, '../../build/tron');
3636

3737
async function loadArtifact(contractName) {
3838
const artifactPath = path.join(ARTIFACTS_DIR, `${contractName}.json`);

packages/smart-contracts/scripts/tron/deploy-test-token.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function main() {
4444
}
4545

4646
// Load compiled contract
47-
const buildPath = path.join(__dirname, '../../tron/build/TestTRC20.json');
47+
const buildPath = path.join(__dirname, '../../build/tron/TestTRC20.json');
4848

4949
if (!fs.existsSync(buildPath)) {
5050
console.error('❌ Contract not compiled. Run: yarn tron:compile');

packages/smart-contracts/scripts/tron/verify-deployment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function loadDeployment(network) {
4141
}
4242

4343
async function loadArtifact(contractName) {
44-
const artifactPath = path.join(__dirname, `../../tron/build/${contractName}.json`);
44+
const artifactPath = path.join(__dirname, `../../build/tron/${contractName}.json`);
4545
return JSON.parse(fs.readFileSync(artifactPath, 'utf8'));
4646
}
4747

0 commit comments

Comments
 (0)