Skip to content

Commit fd4e1b0

Browse files
committed
feat(coin-monitoring): monitor tier two adresses
1 parent c061f79 commit fd4e1b0

File tree

6 files changed

+122
-4
lines changed

6 files changed

+122
-4
lines changed

.changeset/quiet-llamas-scream.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@ledgerhq/coin-filecoin": minor
3+
"@ledgerhq/coin-hedera": minor
4+
"@ledgerhq/coin-modules-monitoring": minor
5+
"@ledgerhq/coin-tezos": minor
6+
"@ledgerhq/coin-near": minor
7+
---
8+
9+
feat(coin-monitoring): monitor tier two adresses

libs/coin-modules-monitoring/src/accounts.ts

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,111 @@ const info: Record<string, Partial<Record<AccountType, AccountInfo>>> = {
3131
average: { address: "Hj69wRzkrFuf1Nby4yzPEFHdsmQdMoVYjvDKZSLjZFEp" },
3232
pristine: { address: "Hbac8tM3SMbua9ZBqPRbEJ2n3FtikRJc7wFmZzpqbtBv" },
3333
},
34+
/* sui: {
35+
pristine: { address: "0x285836edd88055191e2448ac81d00786dc33de570bcfdf96fed3e39747449fdc" },
36+
average: { address: "0x085f6362077282f861abe75151ba3ec6df1dbb82291369f9a06da135ac156c15" },
37+
big: { address: "0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76" },
38+
}, */ // TODO: fix 403 issue
39+
polkadot: {
40+
pristine: { address: "5HEDGMG7mYqh18Xs4BZpYZ3u7EPWUJ8hPDTJhq3cDZh1ztRW" },
41+
average: { address: "1zugcabYjgfQdMLC3cAzQ8tJZMo45tMnGpivpAzpxB4CZyK" },
42+
big: { address: "15K6nb2qhMorgiaavGZPPKCzcyrWFiWaSZM15UjqEn8C4yLn" },
43+
},
44+
elrond: {
45+
// multiversx
46+
pristine: { address: "erd1s4pulht4wn96swcwel64624l40h5lyxfnl9cejwy27kvwvqayuvq2y7klj" },
47+
average: { address: "erd1trwn89w64n88xhl76y8rfzj4r59h2fc8u03mg0tzjh8r3lmwq0lsa3q0yk" },
48+
big: { address: "erd17l22xekj5lvfulatz20xr0llxky6c8zr923r95qg3pfx668m862skjdveh" },
49+
},
50+
filecoin: {
51+
pristine: { address: "f02901126" },
52+
average: { address: "f1dyqj5drgs4jjjkhddix2pptiwg2cjioyv4x4gli" },
53+
big: { address: "f1khdd2v7il7lxn4zjzzrqwceh466mq5k333ktu7q" },
54+
},
55+
mina: {
56+
pristine: { address: "B62qoBXNhc6YqTa86zzniBjNTyshkM7NjGf1Z1uBJJXjSTdYK1qyKr6" },
57+
average: { address: "B62qja3UzWbWrJU6gHbdASQyVdMtxcGwPhxaWDiSrT6892ovCqsR6f6" },
58+
big: { address: "B62qoErNk7pK8BPtbx1eKoa4GURxvyB65hJNXmeRyk56TeB26zqosvw" },
59+
},
60+
hedera: {
61+
pristine: { address: "0.0.433" },
62+
average: { address: "0.0.1000" },
63+
big: { address: "0.0.652978" },
64+
},
65+
/* aptos: {
66+
pristine: { address: "0x404ccbd2acb6208effa69c100849feff040cec697d06f745152bdb3aa3a70614" },
67+
average: { address: "0x201cf09644cd5d88aa6db2d1670011325eea2c3198ddfd0c1aa549be0003bb24" },
68+
big: { address: "0xb8922507317d85197d70c2bc1afc949c759fd0a62c8841a4300d1e2b63649bf6" },
69+
}, */ // TODO: fix 403 issue
70+
celo: {
71+
pristine: { address: "0x64947cDB38d9d364eD5Ab78bfa23b29DE2ecdF7b" },
72+
average: { address: "0x709fcCB2141EddCd95A4d618e82a9E895792055d" },
73+
big: { address: "0xA5c453BC33FD9C5C798Ac24F666fa2B49E0a87fe" },
74+
},
75+
algorand: {
76+
pristine: { address: "JHCRLKUBKMRUUHJFYCBYOVQRTSRHSSL6P376LNDQJSVLM7IQI2EUH6S4ZU" },
77+
average: { address: "EZ6UMFSEAURIYP2E7KI4BUAERRASJM233XLFBO3ZOQYOQOHYL6FRPTYCEI" },
78+
big: { address: "KJOLZZ55JVCXTXDEVFSPUSKGP7SCQDEURMAMEBJEPXRLIQBQDTVD4NO7GQ" },
79+
},
80+
near: {
81+
pristine: { address: "test-pristine.testnet" },
82+
average: { address: "nearkat.near" },
83+
big: { address: "relay.aurora" },
84+
},
85+
/* cosmos: {
86+
pristine: { address: "cosmos1cc3h49u9thwtvz4rlx9pf4kwycczx36q46rp59" },
87+
average: { address: "cosmos1gs72s636mzfnc0re2qrvupz0daytv4057y30g6" },
88+
big: { address: "cosmos18ejqp3d6yejcq3rxj4z6fsne63uj23cykw92pp" },
89+
}, */ // TODO: fix invalid url issue
90+
vechain: {
91+
pristine: { address: "0x5034aa590125b64023a0262112b98d72e3c8e40e" },
92+
average: { address: "0x23a93f95b5bafbf063cf63a129deca068de23288" },
93+
big: { address: "0xb0894ec7992e2ca4322dbd2eb99fa39448fe2d72" },
94+
},
95+
/* icon: {
96+
pristine: { address: "hx4d932cbcffcc95fbac52fcb388fa20c868673a96" },
97+
average: { address: "hx2124c477a48c589f377aebfd8028bd4a8d7c0d2d" },
98+
big: { address: "hxd75467e3e4ce64e3424c747dfb71503017440433" },
99+
}, */ // TODO: fix indexer issue (404)
100+
stellar: {
101+
pristine: { address: "GDO2OB4MWX4ZHDFGEHDTV6YB5TZY5MT2F5HEJ7UYR2JY3NTNNDOHA7AV" },
102+
average: { address: "GA6QQ7GWNAH7CW42IWV653UAERLQH3G2FDW76ZVL6KWJEZ37JTFH27ET" },
103+
big: { address: "GB6YM6S6NW5UDYQASFDFXHCIVLY7BEPRLYVUBXWME6K7YZKKA4VE2Q7C" },
104+
},
105+
tezos: {
106+
pristine: {
107+
address: "0082c6dcd37e14f83e852c8d3d21bc39289598f94cdd5800f6e4a9a8a5adfe3beb",
108+
},
109+
average: {
110+
address: "0019b730b7b55718272cd409ca3480ff07c848579cfa65c41a57d50398098c50b2",
111+
},
112+
big: {
113+
address: "007caac43b092bc041b15ca917c63ff7e721db93a16ace333c834fdcc1000884d2",
114+
},
115+
},
116+
tron: {
117+
pristine: { address: "TKttnV3NSMA8AqZKpnjFAUFsWsAGdgT5YG" },
118+
average: { address: "TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7" },
119+
big: { address: "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" },
120+
},
121+
ripple: {
122+
pristine: { address: "rMQ98K56yXJbDGv49ZSmW51sLn94Xe1mu1" },
123+
average: { address: "rPdvC6ccq8hCdPKSPJkPmyZ4Mi1oG2FFkT" },
124+
big: { address: "rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY" },
125+
},
126+
/* casper: {
127+
pristine: { address: "020319d3ace178361daf4a2438faa00ccacad7bd531c93173c1fc30ecc8173ef0f76" },
128+
average: { address: "015febf058ea3d58e62363c0f5b546d4cb1a4439fc439dc3d333db192606e6defa" },
129+
big: {
130+
address: "8c15bba2d147859c7b7a8f43028eeb4d3c9571c6e36dfecc97c77463d3af08cd",
131+
xpub: "02024c5e3ba7b1da49cda950319aec914cd3c720fbec3dcf25aa4add631e28f70aa9"
132+
},
133+
}, */ // xpub issues
134+
/* internet_computer: {
135+
pristine: { address: "020319d3ace178361daf4a2438faa00ccacad7bd531c93173c1fc30ecc8173ef0f76" },
136+
average: { address: "015febf058ea3d58e62363c0f5b546d4cb1a4439fc439dc3d333db192606e6defa" },
137+
big: { address: "015febf058ea3d58e62363c0f5b546d4cb1a4439fc439dc3d333db192606e6defa" },
138+
}, */ // TODO: fix 500 issue
34139
};
35140

36141
export default info;

libs/coin-modules/coin-filecoin/src/common-logic/utils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,17 @@ export const getAccountShape: GetAccountShape = async info => {
200200
const balance = await fetchBalances(address);
201201
const rawTxs = await fetchTxs(address);
202202
const tokenAccounts = await buildTokenAccounts(address, accountId, info.initialAccount);
203+
const operations = flatMap(processTxs(rawTxs), mapTxToOps(accountId, info)).sort(
204+
(a, b) => b.date.getTime() - a.date.getTime(),
205+
);
203206

204207
const result: Partial<Account> = {
205208
id: accountId,
206209
subAccounts: tokenAccounts,
207210
balance: new BigNumber(balance.total_balance),
208211
spendableBalance: new BigNumber(balance.spendable_balance),
209-
operations: flatMap(processTxs(rawTxs), mapTxToOps(accountId, info)).sort(
210-
(a, b) => b.date.getTime() - a.date.getTime(),
211-
),
212+
operations,
213+
operationsCount: operations.length,
212214
blockHeight: blockHeight.current_block_identifier.index,
213215
};
214216
return result;

libs/coin-modules/coin-hedera/src/bridge/synchronisation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const getAccountShape: GetAccountShape<Account> = async (
5353
balance: accountBalance.balance,
5454
spendableBalance: accountBalance.balance,
5555
operations,
56+
operationsCount: operations.length,
5657
// NOTE: there are no "blocks" in hedera
5758
// Set a value just so that operations are considered confirmed according to isConfirmedOperation
5859
blockHeight: 10,

libs/coin-modules/coin-near/src/api/indexer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function getOperationType(transaction: NearTransaction, address: string): Operat
4545
}
4646

4747
function getOperationValue(transaction: NearTransaction, type: OperationType): BigNumber {
48-
const amount = transaction.actions[0].data.deposit || 0;
48+
const amount = transaction.actions[0]?.data?.deposit || 0;
4949

5050
if (type === "OUT") {
5151
return new BigNumber(amount).plus(transaction.fee);

libs/coin-modules/coin-tezos/src/bridge/synchronization.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const getAccountShape: GetAccountShape<TezosAccount> = async ({
8585
xpub: publicKey,
8686
freshAddress: address,
8787
operations,
88+
operationsCount: operations.length,
8889
balance,
8990
subAccounts,
9091
spendableBalance: balance,

0 commit comments

Comments
 (0)