From 5ae94ac0262d47f41e2282faa672b69e053c98ce Mon Sep 17 00:00:00 2001 From: xiaoch05 Date: Tue, 6 Feb 2024 15:54:24 +0800 Subject: [PATCH] support pangolin --- apollo/src/xtoken/transfer.service.ts | 28 +++++++++++++++++++-------- apollo/src/xtoken/xtoken.service.ts | 6 +++--- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apollo/src/xtoken/transfer.service.ts b/apollo/src/xtoken/transfer.service.ts index 43b41f0c..064d5ea4 100644 --- a/apollo/src/xtoken/transfer.service.ts +++ b/apollo/src/xtoken/transfer.service.ts @@ -14,19 +14,25 @@ export class TransferService extends BaseTransferServiceT2 { testChainTransfers: PartnerT2[] = [ { - chainId: 44, - chain: 'crab-dvm', + chainId: 43, + chain: 'pangolin-dvm', url: this.darwainiaUrl, bridge: 'xtokenbridge', symbols: [ { - originalSymbol: 'CRAB', - symbol: 'CRAB', + key: 'PRING', + symbol: 'PRING', address: '0x0000000000000000000000000000000000000000', protocolFee: 0, decimals: 18, }, ], + channels: [ + { + chain: 'sepolia', + channel: 'msgport' + } + ] }, { chainId: 11155111, @@ -35,18 +41,24 @@ export class TransferService extends BaseTransferServiceT2 { bridge: 'xtokenbridge', symbols: [ { - originalSymbol: 'CRAB', - symbol: 'xCRAB', - address: '0x9Da7E18441f26515CC713290BE846E726d41781d', + key: 'PRING', + symbol: 'xPRING', + address: '0xBC43cb6175FcC8E577a0846256eA699b87eFcEE5', protocolFee: 0, decimals: 18, }, ], + channels: [ + { + chain: 'pangolin-dvm', + channel: 'msgport' + } + ] }, ]; dispatchEndPoints = { - 'crab-dvm': this.darwiniaDispatchSubgraph, + 'pangolin-dvm': this.darwiniaDispatchSubgraph, sepolia: this.ethereumDispatchSubgraph, darwinia: this.darwiniaDispatchSubgraph, ethereum: this.ethereumDispatchSubgraph, diff --git a/apollo/src/xtoken/xtoken.service.ts b/apollo/src/xtoken/xtoken.service.ts index 0c764d12..294a04ea 100644 --- a/apollo/src/xtoken/xtoken.service.ts +++ b/apollo/src/xtoken/xtoken.service.ts @@ -89,7 +89,7 @@ export class xTokenService implements OnModuleInit { return ( chain.symbols.find( (item) => - item.originalSymbol === symbolOrAddress || + item.key === symbolOrAddress || symbolOrAddress.toLowerCase() === item.address.toLowerCase() ) ?? null ); @@ -130,10 +130,10 @@ export class xTokenService implements OnModuleInit { if (record.direction === 'lock') { sendTokenInfo = this.getToken(transfer, record.token); - recvTokenInfo = this.getToken(toChain, sendTokenInfo.originalSymbol); + recvTokenInfo = this.getToken(toChain, sendTokenInfo.key); } else { recvTokenInfo = this.getToken(toChain, record.token); - sendTokenInfo = this.getToken(transfer, recvTokenInfo.originalSymbol); + sendTokenInfo = this.getToken(transfer, recvTokenInfo.key); } if (sendTokenInfo == null) {