@@ -15,7 +15,7 @@ import {
1515 parseAbi ,
1616 PrivateKeyAccount ,
1717} from 'viem' ;
18- import { sepolia , arbitrumSepolia , baseSepolia } from 'viem/chains' ;
18+ import { sepolia , arbitrumSepolia , baseSepolia , bscTestnet } from 'viem/chains' ;
1919import { keccak256 , toBytes } from 'viem' ;
2020import { MulticallCall } from '../orchestrator/orchestrator.types' ;
2121import { CHAIN_INFO } from '../constants/chain' ;
@@ -36,6 +36,9 @@ const ARBITRUM_SEPOLIA_RPC =
3636const BASE_SEPOLIA_RPC =
3737 process . env [ 'BASE_SEPOLIA_RPC' ] ||
3838 CHAIN_INFO [ CHAIN . BASE_SEPOLIA ] . defaultRPC [ 0 ] ;
39+ const BNB_TESTNET_RPC =
40+ process . env [ 'BNB_TESTNET_RPC' ] ||
41+ CHAIN_INFO [ CHAIN . BNB_TESTNET ] . defaultRPC [ 0 ] ;
3942const SOLANA_RPC =
4043 process . env [ 'SOLANA_RPC_URL' ] ||
4144 CHAIN_INFO [ CHAIN . SOLANA_DEVNET ] . defaultRPC [ 0 ] ;
@@ -44,7 +47,7 @@ const SOLANA_RPC =
4447interface EVMChainTestConfig {
4548 name : string ;
4649 chain : CHAIN ;
47- viemChain : typeof sepolia | typeof arbitrumSepolia | typeof baseSepolia ;
50+ viemChain : typeof sepolia | typeof arbitrumSepolia | typeof baseSepolia | typeof bscTestnet ;
4851 rpcUrl : string ;
4952 gatewayAddress : string ;
5053 tokens : {
@@ -107,6 +110,22 @@ const EVM_CHAIN_CONFIGS: EVMChainTestConfig[] = [
107110 } ,
108111 } ,
109112 } ,
113+ {
114+ name : 'BNB Testnet' ,
115+ chain : CHAIN . BNB_TESTNET ,
116+ viemChain : bscTestnet ,
117+ rpcUrl : BNB_TESTNET_RPC ,
118+ gatewayAddress : '0x44aFFC61983F4348DdddB886349eb992C061EaC0' ,
119+ tokens : {
120+ usdt : {
121+ address : '0xBC14F348BC9667be46b35Edc9B68653d86013DC5' ,
122+ decimals : 6 ,
123+ } ,
124+ eth : {
125+ decimals : 18 ,
126+ } ,
127+ } ,
128+ } ,
110129] ;
111130
112131// Reusable test helper functions
@@ -273,6 +292,9 @@ async function testSendTxWithFundsUSDT(
273292 expect ( resUSDT . hash . startsWith ( '0x' ) ) . toBe ( true ) ;
274293 await resUSDT . wait ( ) ;
275294
295+ // Wait for Push Chain state to finalize
296+ await new Promise ( resolve => setTimeout ( resolve , 3000 ) ) ;
297+
276298 const afterCount = ( await pushPublicClient . readContract ( {
277299 abi : COUNTER_ABI ,
278300 address : COUNTER_ADDRESS ,
@@ -794,6 +816,27 @@ describe('PushChain', () => {
794816 } , 300000 ) ;
795817 } ) ;
796818
819+ describe ( 'Multicall - BNB Testnet' , ( ) => {
820+ const config = EVM_CHAIN_CONFIGS [ 3 ] ; // BNB Testnet
821+ const PRIVATE_KEY = process . env [ 'EVM_PRIVATE_KEY' ] as
822+ | `0x${string } `
823+ | undefined ;
824+ let client : PushChain ;
825+
826+ beforeAll ( async ( ) => {
827+ if ( ! PRIVATE_KEY ) {
828+ throw new Error ( 'EVM_PRIVATE_KEY environment variable is not set' ) ;
829+ }
830+
831+ const result = await setupEVMChainClient ( config , PRIVATE_KEY ) ;
832+ client = result . client ;
833+ } ) ;
834+
835+ it ( 'integration: should build and send multicall payload' , async ( ) => {
836+ await testMulticall ( client , config ) ;
837+ } , 300000 ) ;
838+ } ) ;
839+
797840 describe ( 'signTypedData' , ( ) => {
798841 it ( 'should signTypedData - EIP-712 format' , async ( ) => {
799842 const domain = {
@@ -1606,6 +1649,37 @@ describe('PushChain', () => {
16061649 } , 500000 ) ;
16071650 } ) ;
16081651
1652+ describe ( 'Universal.sendTransaction (FUNDS_TX via UniversalGatewayV0) - BNB Testnet' , ( ) => {
1653+ const config = EVM_CHAIN_CONFIGS [ 3 ] ; // BNB Testnet
1654+ const PRIVATE_KEY = process . env [ 'EVM_PRIVATE_KEY' ] as
1655+ | `0x${string } `
1656+ | undefined ;
1657+ let account : PrivateKeyAccount ;
1658+ let client : PushChain ;
1659+
1660+ beforeAll ( async ( ) => {
1661+ if ( ! PRIVATE_KEY ) {
1662+ throw new Error ( 'EVM_PRIVATE_KEY environment variable is not set' ) ;
1663+ }
1664+
1665+ const result = await setupEVMChainClient ( config , PRIVATE_KEY ) ;
1666+ account = result . account ;
1667+ client = result . client ;
1668+ } ) ;
1669+
1670+ it ( 'integration: sendFunds USDT via UniversalGatewayV0' , async ( ) => {
1671+ await testSendFundsUSDT ( client , account , config ) ;
1672+ } , 300000 ) ;
1673+
1674+ it ( 'integration: sendFunds BNB via UniversalGatewayV0' , async ( ) => {
1675+ await testSendFundsETH ( client , config ) ;
1676+ } , 300000 ) ;
1677+
1678+ it ( 'integration: sendTxWithFunds USDT via UniversalGatewayV0' , async ( ) => {
1679+ await testSendTxWithFundsUSDT ( client , account , config ) ;
1680+ } , 500000 ) ;
1681+ } ) ;
1682+
16091683 // Test for unsupported origin chains (only needs to run once, not per chain)
16101684 describe ( 'Universal.sendTransaction - Unsupported chains' , ( ) => {
16111685 it ( 'should throw on unsupported origin chains' , async ( ) => {
0 commit comments