Skip to content

Commit

Permalink
support pangolin
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Feb 6, 2024
1 parent 350fa0d commit 5ae94ac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
28 changes: 20 additions & 8 deletions apollo/src/xtoken/transfer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions apollo/src/xtoken/xtoken.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5ae94ac

Please sign in to comment.