Skip to content

Commit 65a7ab4

Browse files
committed
feat(coin-monitoring): monitor tier two adresses
1 parent 44e1e6f commit 65a7ab4

File tree

6 files changed

+164
-4
lines changed

6 files changed

+164
-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/currencies.ts

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,153 @@ const info: Record<string, { accounts: Partial<Record<AccountType, AccountInfo>>
3838
pristine: { address: "Hbac8tM3SMbua9ZBqPRbEJ2n3FtikRJc7wFmZzpqbtBv" },
3939
},
4040
},
41+
sui: {
42+
accounts: {
43+
pristine: { address: "0x285836edd88055191e2448ac81d00786dc33de570bcfdf96fed3e39747449fdc" },
44+
average: { address: "0x085f6362077282f861abe75151ba3ec6df1dbb82291369f9a06da135ac156c15" },
45+
big: { address: "0x15610fa7ee546b96cb580be4060fae1c4bb15eca87f9a0aa931512bad445fc76" },
46+
},
47+
skip: "403 issue",
48+
},
49+
polkadot: {
50+
accounts: {
51+
pristine: { address: "5HEDGMG7mYqh18Xs4BZpYZ3u7EPWUJ8hPDTJhq3cDZh1ztRW" },
52+
average: { address: "1zugcabYjgfQdMLC3cAzQ8tJZMo45tMnGpivpAzpxB4CZyK" },
53+
big: { address: "15K6nb2qhMorgiaavGZPPKCzcyrWFiWaSZM15UjqEn8C4yLn" },
54+
},
55+
},
56+
elrond: {
57+
// multiversx
58+
accounts: {
59+
pristine: { address: "erd1s4pulht4wn96swcwel64624l40h5lyxfnl9cejwy27kvwvqayuvq2y7klj" },
60+
average: { address: "erd1trwn89w64n88xhl76y8rfzj4r59h2fc8u03mg0tzjh8r3lmwq0lsa3q0yk" },
61+
big: { address: "erd17l22xekj5lvfulatz20xr0llxky6c8zr923r95qg3pfx668m862skjdveh" },
62+
},
63+
},
64+
filecoin: {
65+
accounts: {
66+
pristine: { address: "f02901126" },
67+
average: { address: "f1dyqj5drgs4jjjkhddix2pptiwg2cjioyv4x4gli" },
68+
big: { address: "f1khdd2v7il7lxn4zjzzrqwceh466mq5k333ktu7q" },
69+
},
70+
},
71+
mina: {
72+
accounts: {
73+
pristine: { address: "B62qoBXNhc6YqTa86zzniBjNTyshkM7NjGf1Z1uBJJXjSTdYK1qyKr6" },
74+
average: { address: "B62qja3UzWbWrJU6gHbdASQyVdMtxcGwPhxaWDiSrT6892ovCqsR6f6" },
75+
big: { address: "B62qoErNk7pK8BPtbx1eKoa4GURxvyB65hJNXmeRyk56TeB26zqosvw" },
76+
},
77+
},
78+
hedera: {
79+
accounts: {
80+
pristine: { address: "0.0.433" },
81+
average: { address: "0.0.1000" },
82+
big: { address: "0.0.652978" },
83+
},
84+
},
85+
aptos: {
86+
accounts: {
87+
pristine: { address: "0x404ccbd2acb6208effa69c100849feff040cec697d06f745152bdb3aa3a70614" },
88+
average: { address: "0x201cf09644cd5d88aa6db2d1670011325eea2c3198ddfd0c1aa549be0003bb24" },
89+
big: { address: "0xb8922507317d85197d70c2bc1afc949c759fd0a62c8841a4300d1e2b63649bf6" },
90+
},
91+
skip: "403 issue",
92+
},
93+
celo: {
94+
accounts: {
95+
pristine: { address: "0x64947cDB38d9d364eD5Ab78bfa23b29DE2ecdF7b" },
96+
average: { address: "0x709fcCB2141EddCd95A4d618e82a9E895792055d" },
97+
big: { address: "0xA5c453BC33FD9C5C798Ac24F666fa2B49E0a87fe" },
98+
},
99+
},
100+
algorand: {
101+
accounts: {
102+
pristine: { address: "JHCRLKUBKMRUUHJFYCBYOVQRTSRHSSL6P376LNDQJSVLM7IQI2EUH6S4ZU" },
103+
average: { address: "EZ6UMFSEAURIYP2E7KI4BUAERRASJM233XLFBO3ZOQYOQOHYL6FRPTYCEI" },
104+
big: { address: "KJOLZZ55JVCXTXDEVFSPUSKGP7SCQDEURMAMEBJEPXRLIQBQDTVD4NO7GQ" },
105+
},
106+
},
107+
near: {
108+
accounts: {
109+
pristine: { address: "test-pristine.testnet" },
110+
average: { address: "nearkat.near" },
111+
big: { address: "relay.aurora" },
112+
},
113+
},
114+
cosmos: {
115+
accounts: {
116+
pristine: { address: "cosmos1cc3h49u9thwtvz4rlx9pf4kwycczx36q46rp59" },
117+
average: { address: "cosmos1gs72s636mzfnc0re2qrvupz0daytv4057y30g6" },
118+
big: { address: "cosmos18ejqp3d6yejcq3rxj4z6fsne63uj23cykw92pp" },
119+
},
120+
skip: "invalid url issue",
121+
},
122+
vechain: {
123+
accounts: {
124+
pristine: { address: "0x5034aa590125b64023a0262112b98d72e3c8e40e" },
125+
average: { address: "0x23a93f95b5bafbf063cf63a129deca068de23288" },
126+
big: { address: "0xb0894ec7992e2ca4322dbd2eb99fa39448fe2d72" },
127+
},
128+
},
129+
icon: {
130+
accounts: {
131+
pristine: { address: "hx4d932cbcffcc95fbac52fcb388fa20c868673a96" },
132+
average: { address: "hx2124c477a48c589f377aebfd8028bd4a8d7c0d2d" },
133+
big: { address: "hxd75467e3e4ce64e3424c747dfb71503017440433" },
134+
},
135+
skip: "indexer issue (404)",
136+
},
137+
stellar: {
138+
accounts: {
139+
pristine: { address: "GDO2OB4MWX4ZHDFGEHDTV6YB5TZY5MT2F5HEJ7UYR2JY3NTNNDOHA7AV" },
140+
average: { address: "GA6QQ7GWNAH7CW42IWV653UAERLQH3G2FDW76ZVL6KWJEZ37JTFH27ET" },
141+
big: { address: "GB6YM6S6NW5UDYQASFDFXHCIVLY7BEPRLYVUBXWME6K7YZKKA4VE2Q7C" },
142+
},
143+
},
144+
tezos: {
145+
accounts: {
146+
pristine: { address: "0082c6dcd37e14f83e852c8d3d21bc39289598f94cdd5800f6e4a9a8a5adfe3beb" },
147+
average: { address: "0019b730b7b55718272cd409ca3480ff07c848579cfa65c41a57d50398098c50b2" },
148+
big: { address: "007caac43b092bc041b15ca917c63ff7e721db93a16ace333c834fdcc1000884d2" },
149+
},
150+
},
151+
tron: {
152+
accounts: {
153+
pristine: { address: "TKttnV3NSMA8AqZKpnjFAUFsWsAGdgT5YG" },
154+
average: { address: "TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7" },
155+
big: { address: "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" },
156+
},
157+
},
158+
ripple: {
159+
accounts: {
160+
pristine: { address: "rMQ98K56yXJbDGv49ZSmW51sLn94Xe1mu1" },
161+
average: { address: "rPdvC6ccq8hCdPKSPJkPmyZ4Mi1oG2FFkT" },
162+
big: { address: "rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY" },
163+
},
164+
},
165+
casper: {
166+
accounts: {
167+
pristine: {
168+
address: "020319d3ace178361daf4a2438faa00ccacad7bd531c93173c1fc30ecc8173ef0f76",
169+
},
170+
average: { address: "015febf058ea3d58e62363c0f5b546d4cb1a4439fc439dc3d333db192606e6defa" },
171+
big: {
172+
address: "8c15bba2d147859c7b7a8f43028eeb4d3c9571c6e36dfecc97c77463d3af08cd",
173+
xpub: "02024c5e3ba7b1da49cda950319aec914cd3c720fbec3dcf25aa4add631e28f70aa9",
174+
},
175+
},
176+
skip: "xpub issues",
177+
},
178+
internet_computer: {
179+
accounts: {
180+
pristine: {
181+
address: "020319d3ace178361daf4a2438faa00ccacad7bd531c93173c1fc30ecc8173ef0f76",
182+
},
183+
average: { address: "015febf058ea3d58e62363c0f5b546d4cb1a4439fc439dc3d333db192606e6defa" },
184+
big: { address: "015febf058ea3d58e62363c0f5b546d4cb1a4439fc439dc3d333db192606e6defa" },
185+
},
186+
skip: "500 issue",
187+
},
41188
};
42189

43190
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)