Skip to content

Commit

Permalink
use origin token to find token pair
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Dec 14, 2023
1 parent 558ab54 commit a9ecb8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions apollo/src/base/TransferServiceT2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface BridgeBaseConfigure {
}

export interface PartnerSymbol {
originalSymbol: string;
symbol: string;
address: string;
protocolFee: number;
Expand Down
2 changes: 2 additions & 0 deletions apollo/src/xtoken/transfer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class TransferService extends BaseTransferServiceT2 {
bridge: 'xtokenbridge',
symbols: [
{
originalSymbol: 'CRAB',
symbol: 'CRAB',
address: '0x0000000000000000000000000000000000000000',
protocolFee: 0,
Expand All @@ -33,6 +34,7 @@ export class TransferService extends BaseTransferServiceT2 {
bridge: 'xtokenbridge',
symbols: [
{
originalSymbol: 'CRAB',
symbol: 'xCRAB',
address: '0xe8835bB0735fbfD5ECAC1e20835D5B7C39622ba3',
protocolFee: 0,
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 @@ -81,7 +81,7 @@ export class xTokenService implements OnModuleInit {
return (
chain.symbols.find(
(item) =>
item.symbol === symbolOrAddress ||
item.originalSymbol === symbolOrAddress ||
symbolOrAddress.toLowerCase() === item.address.toLowerCase()
) ?? null
);
Expand Down Expand Up @@ -122,10 +122,10 @@ export class xTokenService implements OnModuleInit {

if (record.direction === 'lock') {
sendTokenInfo = this.getToken(transfer, record.token);
recvTokenInfo = this.getToken(toChain, 'x' + sendTokenInfo.symbol);
recvTokenInfo = this.getToken(toChain, sendTokenInfo.originalSymbol);
} else {
recvTokenInfo = this.getToken(toChain, record.token);
sendTokenInfo = this.getToken(transfer, 'x' + recvTokenInfo.symbol);
sendTokenInfo = this.getToken(transfer, recvTokenInfo.originalSymbol);
}

if (sendTokenInfo == null) {
Expand Down

0 comments on commit a9ecb8e

Please sign in to comment.