-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from bnb-chain/feat/meson
feat: Tron support
- Loading branch information
Showing
121 changed files
with
6,034 additions
and
1,092 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,4 @@ common/autoinstallers/*/.npmrc | |
.env*.local | ||
|
||
.pnpm-store | ||
.release/.npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@bnb-chain/canonical-bridge-widget": patch | ||
"@bnb-chain/canonical-bridge-sdk": patch | ||
--- | ||
|
||
Only show supported networks in status popup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@bnb-chain/canonical-bridge-widget": patch | ||
"@bnb-chain/canonical-bridge-sdk": patch | ||
--- | ||
|
||
Support switch network for tron & fix issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@bnb-chain/canonical-bridge-widget": patch | ||
"@bnb-chain/canonical-bridge-sdk": patch | ||
--- | ||
|
||
Only show supported networks in status popup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "alpha", | ||
"initialVersions": { | ||
"@bnb-chain/canonical-bridge-sdk": "0.1.6", | ||
"@bnb-chain/canonical-bridge-widget": "0.1.6" | ||
}, | ||
"changesets": [ | ||
"fluffy-rocks-count", | ||
"great-jars-float", | ||
"odd-lies-design", | ||
"stupid-mugs-push", | ||
"tiny-lizards-cross" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@bnb-chain/canonical-bridge-widget": patch | ||
"@bnb-chain/canonical-bridge-sdk": patch | ||
--- | ||
|
||
Add tips for switching network in tronLink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@bnb-chain/canonical-bridge-widget": minor | ||
"@bnb-chain/canonical-bridge-sdk": minor | ||
--- | ||
|
||
Support tron |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { ITransferConfig } from '@bnb-chain/canonical-bridge-widget'; | ||
|
||
import mesonConfigTestnet from '@/data-testnet/meson/config.json'; | ||
|
||
export function useTestnetTransferConfig() { | ||
const [transferConfig, setTransferConfig] = useState<ITransferConfig>(); | ||
|
||
useEffect(() => { | ||
const initConfig = async () => { | ||
const transferConfig: ITransferConfig = { | ||
defaultSelectedInfo: { | ||
fromChainId: 97, | ||
toChainId: 3448148188, | ||
tokenSymbol: 'USDT', // USDT | ||
amount: '', | ||
}, | ||
order: { | ||
chains: [], | ||
tokens: ['USDC', 'USDT'], | ||
}, | ||
displayTokenSymbols: {}, | ||
meson: { | ||
config: mesonConfigTestnet.result as any, | ||
exclude: { | ||
chains: [], | ||
tokens: {}, | ||
}, | ||
bridgedTokenGroups: [], | ||
}, | ||
}; | ||
|
||
setTransferConfig(transferConfig); | ||
}; | ||
|
||
initConfig(); | ||
}, []); | ||
|
||
return transferConfig; | ||
} |
118 changes: 118 additions & 0 deletions
118
apps/canonical-bridge-ui/data-testnet/meson/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"result": [ | ||
{ | ||
"id": "arb-sepolia", | ||
"name": "Arbitrum Sepolia", | ||
"chainId": "0x66eee", | ||
"address": "0x0d12d15b26a32e72A3330B2ac9016A22b1410CB6", | ||
"tokens": [ | ||
{ | ||
"id": "usdc", | ||
"addr": "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d", | ||
"min": "0.5", | ||
"max": "20000", | ||
"decimals": 6 | ||
}, | ||
{ | ||
"id": "eth", | ||
"decimals": 18, | ||
"min": "0.001", | ||
"max": "2" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "sepolia", | ||
"name": "Sepolia Testnet", | ||
"chainId": "0xaa36a7", | ||
"address": "0x0d12d15b26a32e72A3330B2ac9016A22b1410CB6", | ||
"tokens": [ | ||
{ | ||
"id": "usdc", | ||
"addr": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", | ||
"decimals": 6, | ||
"min": "0.5", | ||
"max": "20000" | ||
}, | ||
{ | ||
"id": "usdt", | ||
"addr": "0xd53e9530107a8d8856099d7d80126478d48e06dA", | ||
"decimals": 6, | ||
"min": "0.5", | ||
"max": "20000" | ||
}, | ||
{ | ||
"id": "eth", | ||
"decimals": 18, | ||
"min": "0.001", | ||
"max": "2" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "bnb-testnet", | ||
"name": "BNB Testnet", | ||
"chainId": "0x61", | ||
"address": "0x0d12d15b26a32e72A3330B2ac9016A22b1410CB6", | ||
"tokens": [ | ||
{ | ||
"id": "usdc", | ||
"addr": "0x64544969ed7EBf5f083679233325356EbE738930", | ||
"decimals": 18, | ||
"min": "0.5", | ||
"max": "20000" | ||
}, | ||
{ | ||
"id": "usdt", | ||
"addr": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd", | ||
"decimals": 18, | ||
"min": "0.5", | ||
"max": "20000" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "opt-sepolia", | ||
"name": "OP Sepolia", | ||
"chainId": "0xaa37dc", | ||
"address": "0x0d12d15b26a32e72A3330B2ac9016A22b1410CB6", | ||
"tokens": [ | ||
{ | ||
"id": "usdc", | ||
"addr": "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", | ||
"decimals": 6, | ||
"min": "0.5", | ||
"max": "20000" | ||
}, | ||
{ | ||
"id": "eth", | ||
"decimals": 18, | ||
"min": "0.001", | ||
"max": "2" | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "tron-testnet", | ||
"name": "Tron Nile Testnet", | ||
"chainId": "3448148188", | ||
"address": "TAp1rBTjC4tefEMR54vT2NDwLEhDL7E7Jo", | ||
"tokens": [ | ||
{ | ||
"id": "usdc", | ||
"addr": "TNavP4dSwhGssWjX4gR8NvrMsgAQvBWoyY", | ||
"decimals": 6, | ||
"min": "0.5", | ||
"max": "20000" | ||
}, | ||
{ | ||
"id": "usdt", | ||
"addr": "THkCEyw2uaJYPfxb2BNizGuiosCkyAsbWW", | ||
"decimals": 6, | ||
"min": "0.5", | ||
"max": "20000" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { IChainConfig } from '@bnb-chain/canonical-bridge-widget'; | ||
|
||
export const testnetChains: IChainConfig[] = [ | ||
{ | ||
id: 97, | ||
name: 'BSC Testnet', | ||
nativeCurrency: { | ||
name: 'BNB', | ||
symbol: 'BNB', | ||
decimals: 18, | ||
}, | ||
rpcUrl: 'https://bsc-testnet.bnbchain.org', | ||
explorer: { | ||
name: 'BSC Testnet', | ||
url: 'https://testnet.bscscan.com', | ||
}, | ||
}, | ||
{ | ||
id: 1001, | ||
name: 'Klaytn Testnet Baobab', | ||
nativeCurrency: { | ||
name: 'KLAY', | ||
symbol: 'KLAY', | ||
decimals: 18, | ||
}, | ||
rpcUrl: 'https://public-en-baobab.klaytn.net', | ||
explorer: { | ||
name: 'Klaytn Scope', | ||
url: 'https://baobab.klaytnscope.com', | ||
}, | ||
}, | ||
{ | ||
id: 11155111, | ||
name: 'Sepolia', | ||
nativeCurrency: { | ||
name: 'Ether', | ||
symbol: 'ETH', | ||
decimals: 18, | ||
}, | ||
rpcUrl: 'https://ethereum-sepolia-rpc.publicnode.com', | ||
explorer: { | ||
name: 'Sepolia Scan', | ||
url: 'https://sepolia.etherscan.io', | ||
}, | ||
}, | ||
{ | ||
id: 421614, | ||
name: 'Arbitrum Sepolia Testnet', | ||
nativeCurrency: { | ||
name: 'Ether', | ||
symbol: 'ETH', | ||
decimals: 18, | ||
}, | ||
rpcUrl: 'https://sepolia-rollup.arbitrum.io/rpc', | ||
explorer: { | ||
name: 'Sepolia ArbiScan', | ||
url: 'https://sepolia.arbiscan.io/', | ||
}, | ||
}, | ||
{ | ||
id: 11155420, | ||
name: 'OP Sepolia', | ||
nativeCurrency: { | ||
name: 'ETH', | ||
symbol: 'ETH', | ||
decimals: 18, | ||
}, | ||
rpcUrl: 'https://sepolia.optimism.io', | ||
explorer: { | ||
name: 'OP Sepolia Scan', | ||
url: 'https://sepolia-optimistic.etherscan.io', | ||
}, | ||
}, | ||
{ | ||
id: 3448148188, | ||
name: 'Tron Nile Testnet', | ||
nativeCurrency: { | ||
name: 'TRX', | ||
symbol: 'TRX', | ||
decimals: 6, | ||
}, | ||
rpcUrl: 'https://api.nileex.io', | ||
explorer: { | ||
name: 'Tron Nile Scan', | ||
url: 'https://nile.tronscan.org/', | ||
tokenUrlPattern: 'https://nile.tronscan.org/#/token20/{0}', | ||
}, | ||
chainType: 'tron', | ||
}, | ||
]; |
Oops, something went wrong.