-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(fil): add erc20 tokens data for filecoin * chore(fil): add token icons and remove staked tokens * refac(fil): update logic and minor updates to dependencies * chore(fil): update logic post refac * tests(fil): update bot tests * refac(fil): fixup operation and increase bot tests timeout * chore(fil): bump iso-filecoin * feat(fil): use importer for erc20 tokens * refac(fil): update ifil svg icon * refac(fil): add recipient address when using 0xff * refac(fil): deviceTransactionConfig updates * fix: rework estimate fees for token transfer * refac(fil): lowercase recipient always * refac(fil): drop network call for address convert * refactor: rework functions to make them cleaner * refac(fil): fix error when estimating fee with wrong params * refac(fil): fix wrong recipient on confirmation screen * refac(fil): fix problem with estimating gas * fix: remove leading 0x for eth addresses * feat: handle hasFailed flag from erc20 txs sync * fix(fil): irrelevant error on feeEstimationFail * refac(fil): update type of fees transfers * fix(fil): estimateMaxSpendable failing for native transfer * fix(fil): sort operations on sync * fix: update snapshots * fix(icp): estimatedSpendable and transactionStatus * fix: unit test * fix: update sortByMarketcap unit test snapshot --------- Co-authored-by: Prateek Rathod <[email protected]> Co-authored-by: emmanuelm41 <[email protected]>
- Loading branch information
1 parent
a3fbf6d
commit 5758950
Showing
41 changed files
with
1,588 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@ledgerhq/cryptoassets": minor | ||
"ledger-live-desktop": minor | ||
"live-mobile": minor | ||
"@ledgerhq/live-common": minor | ||
"@ledgerhq/live-env": minor | ||
--- | ||
|
||
Add ERC20 token support for filecoin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
242 changes: 242 additions & 0 deletions
242
libs/ledger-live-common/src/families/filecoin/__snapshots__/bridge.integration.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`filecoin currency bridge scanAccounts filecoin seed 1 1`] = ` | ||
[ | ||
{ | ||
"balance": "1000000000000000", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glifLegacy", | ||
"freshAddress": "t15lauyzdivqj7m3yob3rxmzdsy7uyhfflwyheuri", | ||
"freshAddressPath": "44'/1'/0'/0/0", | ||
"id": "js:2:filecoin:t15lauyzdivqj7m3yob3rxmzdsy7uyhfflwyheuri:glifLegacy", | ||
"index": 0, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "1000000000000000", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": true, | ||
}, | ||
{ | ||
"balance": "100000000000000000", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a", | ||
"freshAddressPath": "44'/461'/0'/0/0", | ||
"id": "js:2:filecoin:f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a:glif", | ||
"index": 0, | ||
"operationsCount": 1, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "100000000000000000", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": true, | ||
}, | ||
{ | ||
"balance": "10000000000000000", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia", | ||
"freshAddressPath": "44'/461'/0'/0/1", | ||
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif", | ||
"index": 1, | ||
"operationsCount": 1, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "10000000000000000", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": true, | ||
}, | ||
{ | ||
"balance": "12340000000000000", | ||
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif+filecoin%2Ferc20%2Fwrapped~!underscore!~fil", | ||
"operationsCount": 1, | ||
"parentId": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif", | ||
"pendingOperations": [], | ||
"spendableBalance": "12340000000000000", | ||
"swapHistory": [], | ||
"tokenId": "filecoin/erc20/wrapped_fil", | ||
"type": "TokenAccountRaw", | ||
}, | ||
{ | ||
"balance": "0", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f15nh4cywefp6pavzjifbe2ormma74malwdyy5rfq", | ||
"freshAddressPath": "44'/461'/0'/0/2", | ||
"id": "js:2:filecoin:f15nh4cywefp6pavzjifbe2ormma74malwdyy5rfq:glif", | ||
"index": 2, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "0", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": false, | ||
}, | ||
{ | ||
"balance": "0", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1lg3347otxjblwqx6pnqnqoz4cqwasq57yo2bxcy", | ||
"freshAddressPath": "44'/461'/0'/0/3", | ||
"id": "js:2:filecoin:f1lg3347otxjblwqx6pnqnqoz4cqwasq57yo2bxcy:glif", | ||
"index": 3, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "0", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": false, | ||
}, | ||
{ | ||
"balance": "0", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1j2uoeuoiusmh2godly4fivd6gomi6asmzkd47li", | ||
"freshAddressPath": "44'/461'/0'/0/4", | ||
"id": "js:2:filecoin:f1j2uoeuoiusmh2godly4fivd6gomi6asmzkd47li:glif", | ||
"index": 4, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "0", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": false, | ||
}, | ||
{ | ||
"balance": "0", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1l7h6nvobmqc7adq7plta5kn7xaltx6k6l7paqsq", | ||
"freshAddressPath": "44'/461'/0'/0/5", | ||
"id": "js:2:filecoin:f1l7h6nvobmqc7adq7plta5kn7xaltx6k6l7paqsq:glif", | ||
"index": 5, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "0", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": false, | ||
}, | ||
{ | ||
"balance": "0", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1i2drwsilv35pp75dvd52enl3ohqakua2mshf5fy", | ||
"freshAddressPath": "44'/461'/0'/0/6", | ||
"id": "js:2:filecoin:f1i2drwsilv35pp75dvd52enl3ohqakua2mshf5fy:glif", | ||
"index": 6, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "0", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": false, | ||
}, | ||
{ | ||
"balance": "0", | ||
"currencyId": "filecoin", | ||
"derivationMode": "glif", | ||
"freshAddress": "f1347zfz7jiz3oeufp2lrbcwwt265ejk32n2wqrla", | ||
"freshAddressPath": "44'/461'/0'/0/7", | ||
"id": "js:2:filecoin:f1347zfz7jiz3oeufp2lrbcwwt265ejk32n2wqrla:glif", | ||
"index": 7, | ||
"operationsCount": 0, | ||
"pendingOperations": [], | ||
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0", | ||
"spendableBalance": "0", | ||
"subAccounts": [], | ||
"swapHistory": [], | ||
"syncHash": undefined, | ||
"used": false, | ||
}, | ||
] | ||
`; | ||
|
||
exports[`filecoin currency bridge scanAccounts filecoin seed 1 2`] = ` | ||
[ | ||
[], | ||
[ | ||
{ | ||
"accountId": "js:2:filecoin:f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a:glif", | ||
"blockHash": null, | ||
"blockHeight": 1802367, | ||
"extra": {}, | ||
"fee": "0", | ||
"hasFailed": false, | ||
"hash": "bafy2bzaceaztepnzdzbul7nmkef6blk5x2luvbvangrjal25k6xi5qob36k32", | ||
"id": "js:2:filecoin:f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a:glif-bafy2bzaceaztepnzdzbul7nmkef6blk5x2luvbvangrjal25k6xi5qob36k32-IN", | ||
"recipients": [ | ||
"f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a", | ||
], | ||
"senders": [ | ||
"f1ov6d42tujoyexkbdh34oik2vhe5unqo2a5ocqoq", | ||
], | ||
"type": "IN", | ||
"value": "100000000000000000", | ||
}, | ||
], | ||
[ | ||
{ | ||
"accountId": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif", | ||
"blockHash": null, | ||
"blockHeight": 3853241, | ||
"extra": {}, | ||
"fee": "0", | ||
"hasFailed": false, | ||
"hash": "bafy2bzacecwvvvxtlbm5s6wpk546r66hjqw4amjioihe2rt5ufoebu3zv6xiw", | ||
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif-bafy2bzacecwvvvxtlbm5s6wpk546r66hjqw4amjioihe2rt5ufoebu3zv6xiw-IN", | ||
"recipients": [ | ||
"f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia", | ||
], | ||
"senders": [ | ||
"f1ovlkmtnqji7wrvdpcys3i22c62obbamgokmg35q", | ||
], | ||
"type": "IN", | ||
"value": "10000000000000000", | ||
}, | ||
], | ||
[ | ||
{ | ||
"accountId": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif+filecoin%2Ferc20%2Fwrapped~!underscore!~fil", | ||
"blockHash": "", | ||
"blockHeight": 3853248, | ||
"extra": {}, | ||
"fee": "0", | ||
"hasFailed": false, | ||
"hash": "bafy2bzaceaw6jxm3bp6rdvtse7k4evsg2zhis3ootn2pe5k3txtxor4efhl7k", | ||
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif+filecoin%2Ferc20%2Fwrapped~!underscore!~fil-bafy2bzaceaw6jxm3bp6rdvtse7k4evsg2zhis3ootn2pe5k3txtxor4efhl7k-IN", | ||
"recipients": [ | ||
"f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia", | ||
], | ||
"senders": [ | ||
"f1pnc33cba2c2a3olqadho7wiohyosbkl3upescei", | ||
], | ||
"type": "IN", | ||
"value": "12340000000000000", | ||
}, | ||
], | ||
[], | ||
[], | ||
[], | ||
[], | ||
[], | ||
[], | ||
] | ||
`; |
Oops, something went wrong.