From 5c96fd09eed1e535394b3b2b379dcb862ec2de9e Mon Sep 17 00:00:00 2001 From: xiaoch05 Date: Wed, 27 Mar 2024 14:06:43 +0800 Subject: [PATCH] add outer token address --- .../20240327060430_init/migration.sql | 3 +++ apollo/prisma/schema.prisma | 2 ++ .../aggregation/aggregation.history.graphql | 2 ++ apollo/src/base/TransferServiceT2.ts | 1 + apollo/src/graphql.ts | 2 ++ apollo/src/lnv3/transfer.service.ts | 27 +++++++++++++++++++ apollo/src/xtoken/transfer.service.ts | 6 +++++ apollo/src/xtoken/xtoken.service.ts | 2 ++ 8 files changed, 45 insertions(+) create mode 100644 apollo/prisma/migrations/20240327060430_init/migration.sql diff --git a/apollo/prisma/migrations/20240327060430_init/migration.sql b/apollo/prisma/migrations/20240327060430_init/migration.sql new file mode 100644 index 00000000..357d5431 --- /dev/null +++ b/apollo/prisma/migrations/20240327060430_init/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable +ALTER TABLE "HistoryRecord" ADD COLUMN "recvOuterTokenAddress" TEXT, +ADD COLUMN "sendOuterTokenAddress" TEXT; diff --git a/apollo/prisma/schema.prisma b/apollo/prisma/schema.prisma index 907e312b..14ee97c2 100644 --- a/apollo/prisma/schema.prisma +++ b/apollo/prisma/schema.prisma @@ -35,6 +35,8 @@ model HistoryRecord { messageNonce String sendTokenAddress String recvTokenAddress String? + sendOuterTokenAddress String? + recvOuterTokenAddress String? guardSignatures String? relayer String? endTxHash String? diff --git a/apollo/src/aggregation/aggregation.history.graphql b/apollo/src/aggregation/aggregation.history.graphql index 077e4329..3a67fe19 100644 --- a/apollo/src/aggregation/aggregation.history.graphql +++ b/apollo/src/aggregation/aggregation.history.graphql @@ -24,6 +24,8 @@ type HistoryRecord { messageNonce: String sendTokenAddress: String recvTokenAddress: String + sendOuterTokenAddress: String + recvOuterTokenAddress: String guardSignatures: String relayer: String endTxHash: String diff --git a/apollo/src/base/TransferServiceT2.ts b/apollo/src/base/TransferServiceT2.ts index 6b132205..4c23292d 100644 --- a/apollo/src/base/TransferServiceT2.ts +++ b/apollo/src/base/TransferServiceT2.ts @@ -35,6 +35,7 @@ export interface PartnerSymbol { key: string; symbol: string; address: string; + outerAddress: string; protocolFee: number; decimals: number; } diff --git a/apollo/src/graphql.ts b/apollo/src/graphql.ts index 48c9433f..44e5eeba 100644 --- a/apollo/src/graphql.ts +++ b/apollo/src/graphql.ts @@ -63,6 +63,8 @@ export class HistoryRecord { messageNonce?: Nullable; sendTokenAddress?: Nullable; recvTokenAddress?: Nullable; + sendOuterTokenAddress?: Nullable; + recvOuterTokenAddress?: Nullable; guardSignatures?: Nullable; relayer?: Nullable; endTxHash?: Nullable; diff --git a/apollo/src/lnv3/transfer.service.ts b/apollo/src/lnv3/transfer.service.ts index 926cdb3d..c44bd19b 100644 --- a/apollo/src/lnv3/transfer.service.ts +++ b/apollo/src/lnv3/transfer.service.ts @@ -31,6 +31,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'RING', symbol: 'RING', address: '0x9C1C23E60B72Bc88a043bf64aFdb16A02540Ae8f', + outerAddress: '0x9C1C23E60B72Bc88a043bf64aFdb16A02540Ae8f', protocolFee: 30000000000000000000, decimals: 18, }, @@ -38,6 +39,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F', + outerAddress: '0xc2132D05D31c914a87C6611C10748AEb04B58e8F', protocolFee: 100000, decimals: 6, } @@ -87,6 +89,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'RING', symbol: 'RING', address: '0x9e523234D36973f9e38642886197D023C88e307e', + outerAddress: '0x9e523234D36973f9e38642886197D023C88e307e', protocolFee: 30000000000000000000, decimals: 18, }, @@ -94,6 +97,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', + outerAddress: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', protocolFee: 100000, decimals: 6, }, @@ -101,6 +105,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'ETH', symbol: 'ETH', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 10000000000000, decimals: 18, } @@ -154,6 +159,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x55d398326f99059fF775485246999027B3197955', + outerAddress: '0x55d398326f99059fF775485246999027B3197955', protocolFee: 100000000000000000, decimals: 18, } @@ -199,6 +205,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0xA219439258ca9da29E9Cc4cE5596924745e12B93', + outerAddress: '0xA219439258ca9da29E9Cc4cE5596924745e12B93', protocolFee: 100000, decimals: 6, }, @@ -206,6 +213,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'ETH', symbol: 'ETH', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 10000000000000, decimals: 18, } @@ -251,6 +259,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', + outerAddress: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', protocolFee: 100000, decimals: 6, } @@ -296,6 +305,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x4ECaBa5870353805a9F068101A40E0f32ed605C6', + outerAddress: '0x4ECaBa5870353805a9F068101A40E0f32ed605C6', protocolFee: 100000, decimals: 6, } @@ -341,6 +351,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE', + outerAddress: '0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE', protocolFee: 100000, decimals: 6, } @@ -386,6 +397,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df', + outerAddress: '0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df', protocolFee: 100000, decimals: 6, } @@ -431,6 +443,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'RING', symbol: 'RING', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 30000000000000000000, decimals: 18, } @@ -456,6 +469,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'ETH', symbol: 'ETH', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 10000000000000, decimals: 18, } @@ -481,6 +495,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDC', symbol: 'USDC', address: '0x0ac58Df0cc3542beC4cDa71B16D06C3cCc39f405', + outerAddress: '0x0ac58Df0cc3542beC4cDa71B16D06C3cCc39f405', protocolFee: 10000000000000000, decimals: 18, }, @@ -488,6 +503,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x876A4f6eCF13EEb101F9E75FCeF58f19Ff383eEB', + outerAddress: '0x876A4f6eCF13EEb101F9E75FCeF58f19Ff383eEB', protocolFee: 10000000000000000, decimals: 18, }, @@ -495,6 +511,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'ETH', symbol: 'ETH', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 1000000000000000, decimals: 18, }, @@ -520,6 +537,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDC', symbol: 'USDC', address: '0x8A87497488073307E1a17e8A12475a94Afcb413f', + outerAddress: '0x8A87497488073307E1a17e8A12475a94Afcb413f', protocolFee: 10000000000000000, decimals: 18, }, @@ -527,6 +545,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x3b8Bb7348D4F581e67E2498574F73e4B9Fc51855', + outerAddress: '0x3b8Bb7348D4F581e67E2498574F73e4B9Fc51855', protocolFee: 10000000000000000, decimals: 18, }, @@ -534,6 +553,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'ETH', symbol: 'ETH', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 1000000000000000, decimals: 18, }, @@ -567,6 +587,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDC', symbol: 'USDC', address: '0x253adBFE99Fcd096B9b5502753F96CF78D42eaD0', + outerAddress: '0x253adBFE99Fcd096B9b5502753F96CF78D42eaD0', protocolFee: 10000, decimals: 6, }, @@ -574,6 +595,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x3350f1ef046e21E052dCbA60Fc575919CCaFEdeb', + outerAddress: '0x3350f1ef046e21E052dCbA60Fc575919CCaFEdeb', protocolFee: 10000, decimals: 6, }, @@ -581,6 +603,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'ETH', symbol: 'ETH', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 1000000000000000, decimals: 18, }, @@ -606,6 +629,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDC', symbol: 'USDC', address: '0x3F7DF5866591e7E48D18C8EbeAE61Bc343a63283', + outerAddress: '0x3F7DF5866591e7E48D18C8EbeAE61Bc343a63283', protocolFee: 1000000000000000, decimals: 18, }, @@ -613,6 +637,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x89AF830781A2C1d3580Db930bea11094F55AfEae', + outerAddress: '0x89AF830781A2C1d3580Db930bea11094F55AfEae', protocolFee: 1000000000000000, decimals: 18, }, @@ -634,6 +659,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDC', symbol: 'USDC', address: '0x89AF830781A2C1d3580Db930bea11094F55AfEae', + outerAddress: '0x89AF830781A2C1d3580Db930bea11094F55AfEae', protocolFee: 1000000000000000, decimals: 18, }, @@ -641,6 +667,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'USDT', symbol: 'USDT', address: '0x463D1730a8527CA58d48EF70C7460B9920346567', + outerAddress: '0x463D1730a8527CA58d48EF70C7460B9920346567', protocolFee: 1000000000000000, decimals: 18, }, diff --git a/apollo/src/xtoken/transfer.service.ts b/apollo/src/xtoken/transfer.service.ts index 5afc286e..186ae2c5 100644 --- a/apollo/src/xtoken/transfer.service.ts +++ b/apollo/src/xtoken/transfer.service.ts @@ -23,6 +23,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'RING', symbol: 'RING', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 0, decimals: 18, }, @@ -30,6 +31,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'CRAB', symbol: 'xWCRAB', address: '0x656567Eb75b765FC320783cc6EDd86bD854b2305', + outerAddress: '0x656567Eb75b765FC320783cc6EDd86bD854b2305', protocolFee: 0, decimals: 18, } @@ -51,6 +53,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'RING', symbol: 'xWRING', address: '0x273131F7CB50ac002BDd08cA721988731F7e1092', + outerAddress: '0x273131F7CB50ac002BDd08cA721988731F7e1092', protocolFee: 0, decimals: 18, }, @@ -58,6 +61,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'CRAB', symbol: 'CRAB', address: '0x0000000000000000000000000000000000000000', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 0, decimals: 18, } @@ -83,6 +87,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'PRING', symbol: 'PRING', address: '0x617E55f692FA2feFfdD5D9C513782A479cC1FF57', + outerAddress: '0x0000000000000000000000000000000000000000', protocolFee: 0, decimals: 18, }, @@ -104,6 +109,7 @@ export class TransferService extends BaseTransferServiceT2 { key: 'PRING', symbol: 'xPRING', address: '0xF874fad204757588e67EE55cE93D654b6f5C39C6', + outerAddress: '0xBD50868F36Eb46355eC5a153AbD3a7eA094A5c37', protocolFee: 0, decimals: 18, }, diff --git a/apollo/src/xtoken/xtoken.service.ts b/apollo/src/xtoken/xtoken.service.ts index 3c0bf9e6..4e133cbf 100644 --- a/apollo/src/xtoken/xtoken.service.ts +++ b/apollo/src/xtoken/xtoken.service.ts @@ -169,6 +169,8 @@ export class xTokenService implements OnModuleInit { reason: '', sendTokenAddress: sendTokenInfo.address.toLowerCase(), recvTokenAddress: recvTokenInfo.address.toLowerCase(), + sendOuterTokenAddress: sendTokenInfo.outerAddress.toLowerCase(), + recvOuterTokenAddress: recvTokenInfo.outerAddress.toLowerCase(), endTxHash: '', confirmedBlocks: '', extData: record.extData,