Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules/bitgo/src/v2/coinFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
coinFactory.register('eth', Eth.createInstance);
coinFactory.register('ethw', Ethw.createInstance);
coinFactory.register('baseeth', EthLikeCoin.createInstance);
coinFactory.register('opbnb', EthLikeCoin.createInstance);
coinFactory.register('og', EthLikeCoin.createInstance);
coinFactory.register('tog', EthLikeCoin.createInstance);
coinFactory.register('topbnb', TethLikeCoin.createInstance);
coinFactory.register('tbaseeth', TethLikeCoin.createInstance);
coinFactory.register('fiataed', FiatAED.createInstance);
coinFactory.register('fiateur', FiatEur.createInstance);
Expand Down Expand Up @@ -641,8 +643,12 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
return Ethw.createInstance;
case 'baseeth':
return EthLikeCoin.createInstance;
case 'opbnb':
return EthLikeCoin.createInstance;
case 'tbaseeth':
return TethLikeCoin.createInstance;
case 'topbnb':
return TethLikeCoin.createInstance;
case 'fiataed':
return FiatAED.createInstance;
case 'fiateur':
Expand Down Expand Up @@ -993,6 +999,10 @@ export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor |
case 'tbaseeth':
const coinNames = { Mainnet: 'baseeth', Testnet: 'tbaseeth' };
return EthLikeErc20Token.createTokenConstructor(tokenConfig as EthLikeTokenConfig, coinNames);
case 'opbnb':
case 'topbnb':
const opbnbCoinNames = { Mainnet: 'opbnb', Testnet: 'topbnb' };
return EthLikeErc20Token.createTokenConstructor(tokenConfig as EthLikeTokenConfig, opbnbCoinNames);
case 'coredao':
case 'tcoredao':
return CoredaoToken.createTokenConstructor(tokenConfig as EthLikeTokenConfig);
Expand Down
13 changes: 13 additions & 0 deletions modules/sdk-coin-ethlike/test/fixtures/ethlikeCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export const ccr = {
'0x02f9019683014a3402850ba43b740085746a5288008307a1209412fdf58540285273f9ddee9eac6f566418d6e7ac80b9016439125215000000000000000000000000b9f62c71d5f6949cfb211a67fb13ccf079cc760b00000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000066cc72e2000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410eddb08026d2d5ba942ed77d4caef5bf3c3d7b4282bd4d2defcbc9c113c5f9af10d803b211fc0ea8b16263a614444abfc5d20dea24db28b833c0e15063400c411c00000000000000000000000000000000000000000000000000000000000000c0808080',
txid: '0x663729bbb68b7638a7a58194e69546d64bb5536422f30557ef0118028317f3a8',
},
topbnb: {
txHex:
'0x02f901d38215eb01843b9aca00843b9aca00830186a0948ce59c2d1702844f8eded451aa103961bc37b4e880b90164391252150000000000000000000000002c2b9c9a4a25e24b174f26114e8926a9f2128fe40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006939c792000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041833fbbdb8457ee22924b2ad59becbd1629481ca2bf10b9c66dba45e6fbd8fe1f62fc94c6a3a0a8915abe7df7ce9cf2b3d43b0e46f539d11f00cbe9c5aa2dfbe71c00000000000000000000000000000000000000000000000000000000000000c080a05614c8ae83fee9c0d95334114103aa4fee94f574dd55497f41f532d98ce95100a0102dbe65dcd4034fbf2c2e997758180f15e8c626fb9df4f1695a7fa01dbb376e',
txid: '0x48052a9408a20f317b938dbcd7c30c6019c19571ed07ded11853bae9f16493fd',
},
};
export const encryptedUserKey =
'{"iv":"VFZ3jvXhxo1Z+Yaf2MtZnA==","v":1,"iter":10000,"ks":256,"ts":64,"mode"\n' +
Expand All @@ -94,4 +99,12 @@ export const custodialHot = {
signedTxHex:
'0xf9016b80830186a082520894702cf81e03aa310ec9481d814e3d04a20b04b50580b901440dcd7a6c000000000000000000000000b9f62c71d5f6949cfb211a67fb13ccf079cc760b0000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324100000000000000000000000000000000000000000000000000000000067f415e1000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041a9c3ead37547fa56b694e4eccc9352225b7458ef08e4e961ca5774d398abd55b5986a7446259374d2098012923583935189739f18dd117c4d15221b2a26f50911c00000000000000000000000000000000000000000000000000000000000000830cddff8080',
},
topbnb: {
signatureData:
'0dcd7a6c00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000b9f62c71d5f6949cfb211a67fb13ccf079cc760b0000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324100000000000000000000000000000000000000000000000000000000067f415e10000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000a353631312d45524332300000000000000000000000000000000000000000000000',
signature:
'0xa9c3ead37547fa56b694e4eccc9352225b7458ef08e4e961ca5774d398abd55b5986a7446259374d2098012923583935189739f18dd117c4d15221b2a26f50911c',
signedTxHex:
'0xf9016a80830186a082520894702cf81e03aa310ec9481d814e3d04a20b04b50580b901440dcd7a6c000000000000000000000000b9f62c71d5f6949cfb211a67fb13ccf079cc760b0000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324100000000000000000000000000000000000000000000000000000000067f415e1000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041a9c3ead37547fa56b694e4eccc9352225b7458ef08e4e961ca5774d398abd55b5986a7446259374d2098012923583935189739f18dd117c4d15221b2a26f50911c00000000000000000000000000000000000000000000000000000000000000822bf98080',
},
};
4 changes: 4 additions & 0 deletions modules/sdk-coin-ethlike/test/unit/ethlikeCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const coins = [
name: 'tarbeth',
common: getCommon('tarbeth'),
},
{
name: 'topbnb',
common: getCommon('topbnb'),
},
];

describe('EthLike coin tests', function () {
Expand Down
8 changes: 8 additions & 0 deletions modules/sdk-core/src/bitgo/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ const mainnetBase: EnvironmentTemplate = {
baseeth: {
baseUrl: 'https://api.etherscan.io/v2',
},
opbnb: {
baseUrl: 'https://api.etherscan.io/v2',
apiToken: process.env.ETHERSCAN_API_TOKEN,
},
flow: {
baseUrl: 'https://evm.flowscan.io',
},
Expand Down Expand Up @@ -420,6 +424,10 @@ const testnetBase: EnvironmentTemplate = {
tbaseeth: {
baseUrl: 'https://api.etherscan.io/v2',
},
topbnb: {
baseUrl: 'https://api.etherscan.io/v2',
apiToken: process.env.ETHERSCAN_API_TOKEN,
},
flow: {
baseUrl: 'https://evm-testnet.flowscan.io',
},
Expand Down
20 changes: 20 additions & 0 deletions modules/statics/src/allCoinsAndTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,26 @@ export const allCoinsAndTokens = [
'',
'BaseETH'
),
account(
'2b5c52f8-0d0c-4a17-8052-d56373f5d264',
'topbnb',
'opBNB Testnet',
Networks.test.opbnb,
18,
UnderlyingAsset.OPBNB,
BaseUnit.ETH,
[...ETH_FEATURES, CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA, CoinFeature.EIP1559]
),
account(
'1588f6da-8e43-4535-8e1c-25e53788437b',
'opbnb',
'opBNB Mainnet',
Networks.main.opbnb,
18,
UnderlyingAsset.OPBNB,
BaseUnit.ETH,
[...ETH_FEATURES, CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA, CoinFeature.EIP1559]
),
account(
'ffc472f5-27c6-49f8-ad9a-f57659258fb9',
'etc',
Expand Down
2 changes: 2 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export enum CoinFamily {
OAS = 'oas',
OFC = 'ofc',
OG = 'og',
OPBNB = 'opbnb', // opBNB Chain
OKB = 'okb',
OPETH = 'opeth',
OSMO = 'osmo',
Expand Down Expand Up @@ -597,6 +598,7 @@ export enum UnderlyingAsset {
OAS = 'oas',
OG = 'og',
OKB = 'okb',
OPBNB = 'opbnb', // opBNB Chain
OPETH = 'opeth',
OSMO = 'osmo',
XPL = 'xpl', // Plasma Network
Expand Down
22 changes: 22 additions & 0 deletions modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,26 @@ class BinanceSmartChainTestnet extends Testnet implements EthereumNetwork {
batcherContractAddress = '0x3e1e5d78e44f15593b3b61ed278f12c27f0ff33e';
}

class OpBNB extends Mainnet implements EthereumNetwork {
name = 'OpBNB';
family = CoinFamily.OPBNB;
explorerUrl = 'https://opbnbscan.com/tx/';
accountExplorerUrl = 'https://opbnbscan.com/address/';
chainId = 204;
nativeCoinOperationHashPrefix = '204';
tokenOperationHashPrefix = '204-ERC20';
}

class OpBNBTestnet extends Testnet implements EthereumNetwork {
name = 'OpBNBTestnet';
family = CoinFamily.OPBNB;
explorerUrl = 'https://testnet.opbnbscan.com/tx/';
accountExplorerUrl = 'https://testnet.opbnbscan.com/address/';
chainId = 5611;
nativeCoinOperationHashPrefix = '5611';
tokenOperationHashPrefix = '5611-ERC20';
}

class LightningBitcoin extends Mainnet implements LightningNetwork {
name = 'LightningBitcoin';
family = CoinFamily.LNBTC;
Expand Down Expand Up @@ -2253,6 +2273,7 @@ export const Networks = {
og: Object.freeze(new Og()),
ofc: Object.freeze(new Ofc()),
okb: Object.freeze(new Xlayer()),
opbnb: Object.freeze(new OpBNB()),
morph: Object.freeze(new Morph()),
optimism: Object.freeze(new Optimism()),
osmo: Object.freeze(new Osmo()),
Expand Down Expand Up @@ -2360,6 +2381,7 @@ export const Networks = {
og: Object.freeze(new OgTestnet()),
ofc: Object.freeze(new OfcTestnet()),
okb: Object.freeze(new XlayerTestnet()),
opbnb: Object.freeze(new OpBNBTestnet()),
morph: Object.freeze(new MorphTestnet()),
optimism: Object.freeze(new OptimismTestnet()),
osmo: Object.freeze(new OsmoTestnet()),
Expand Down
2 changes: 2 additions & 0 deletions modules/statics/test/unit/fixtures/expectedColdFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export const expectedColdFeatures = {
],
neither: [
'ethw',
'opbnb',
'topbnb',
'fiataed',
'fiateur',
'fiatgbp',
Expand Down