Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support/filecoin evm #7413

Merged
9 changes: 9 additions & 0 deletions .changeset/famous-worms-pull.md
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const fieldComponents = {
"filecoin.gasPremium": FilecoinField,
"filecoin.gasLimit": FilecoinField,
"filecoin.method": FilecoinField,
"filecoin.recipient": FilecoinField,
};
export default {
fieldComponents,
Expand Down
3 changes: 3 additions & 0 deletions apps/ledger-live-desktop/static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5515,6 +5515,9 @@
"title": "Impossible to calculate amount and fees",
"description": "Impossible to calculate amount and fees"
},
"InvalidRecipientForTokenTransfer": {
"title": "Invalid recipient for token transfer, supported account types for token transfer: [f0, f4, 0x]"
},
"NotEnoughBalance": {
"title": "Sorry, insufficient funds",
"description": "Please make sure the account has enough funds."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const fieldComponents = {
"filecoin.gasPremium": FilecoinField,
"filecoin.gasLimit": FilecoinField,
"filecoin.method": FilecoinField,
"filecoin.recipient": FilecoinField,
};
export default {
fieldComponents,
Expand Down
3 changes: 3 additions & 0 deletions apps/ledger-live-mobile/src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,9 @@
"InvalidMemoICP": {
"title": "Memo is required to be a number"
},
"InvalidRecipientForTokenTransfer": {
"title": "Invalid recipient for token transfer, supported account types for token transfer: [f0, f4, 0x]"
},
"FirmwareNotRecognized": {
"title": "Invalid Provider",
"description": "You have to change \"My Ledger provider\" setting. To change it, open Ledger Live \"Settings\", select \"Experimental features\", and then select a different provider."
Expand Down
3 changes: 2 additions & 1 deletion libs/ledger-live-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@
"cosmjs-types": "0.2.1",
"date-fns": "^2.23.0",
"eip55": "^2.1.1",
"ethers": "5.7.2",
"expect": "^27.4.6",
"fuse.js": "^6.6.2",
"invariant": "^2.2.2",
"iso-filecoin": "^4.0.3",
"iso-filecoin": "^4.1.0",
"isomorphic-ws": "^4.0.1",
"jotai": "^2.7.0",
"json-rpc-2.0": "^0.2.19",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
// 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,
"name": "Filecoin 1",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "1000000000000000",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": true,
},
{
"approvals": undefined,
"balance": "1234000000000000",
"id": "js:2:filecoin:t15lauyzdivqj7m3yob3rxmzdsy7uyhfflwyheuri:glifLegacy+filecoin%2Ferc20%2Fwrapped~!underscore!~fil",
"operationsCount": 1,
"parentId": "js:2:filecoin:t15lauyzdivqj7m3yob3rxmzdsy7uyhfflwyheuri:glifLegacy",
"pendingOperations": [],
"spendableBalance": "1234000000000000",
"starred": false,
"swapHistory": [],
"tokenId": "filecoin/erc20/wrapped_fil",
"type": "TokenAccountRaw",
},
{
"balance": "100000000000000000",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a",
"freshAddressPath": "44'/461'/0'/0/0",
"id": "js:2:filecoin:f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a:glif",
"index": 0,
"name": "Filecoin 1",
"nfts": undefined,
"operationsCount": 1,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "100000000000000000",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": true,
},
{
"balance": "10000000000000000",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia",
"freshAddressPath": "44'/461'/0'/0/1",
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif",
"index": 1,
"name": "Filecoin 2",
"nfts": undefined,
"operationsCount": 1,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "10000000000000000",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": true,
},
{
"approvals": undefined,
"balance": "12340000000000000",
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif+filecoin%2Ferc20%2Fwrapped~!underscore!~fil",
"operationsCount": 1,
"parentId": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif",
"pendingOperations": [],
"spendableBalance": "12340000000000000",
"starred": false,
"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,
"name": "Filecoin 3",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "0",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": false,
},
{
"balance": "0",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1lg3347otxjblwqx6pnqnqoz4cqwasq57yo2bxcy",
"freshAddressPath": "44'/461'/0'/0/3",
"id": "js:2:filecoin:f1lg3347otxjblwqx6pnqnqoz4cqwasq57yo2bxcy:glif",
"index": 3,
"name": "Filecoin 4",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "0",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": false,
},
{
"balance": "0",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1j2uoeuoiusmh2godly4fivd6gomi6asmzkd47li",
"freshAddressPath": "44'/461'/0'/0/4",
"id": "js:2:filecoin:f1j2uoeuoiusmh2godly4fivd6gomi6asmzkd47li:glif",
"index": 4,
"name": "Filecoin 5",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "0",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": false,
},
{
"balance": "0",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1l7h6nvobmqc7adq7plta5kn7xaltx6k6l7paqsq",
"freshAddressPath": "44'/461'/0'/0/5",
"id": "js:2:filecoin:f1l7h6nvobmqc7adq7plta5kn7xaltx6k6l7paqsq:glif",
"index": 5,
"name": "Filecoin 6",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "0",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": false,
},
{
"balance": "0",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1i2drwsilv35pp75dvd52enl3ohqakua2mshf5fy",
"freshAddressPath": "44'/461'/0'/0/6",
"id": "js:2:filecoin:f1i2drwsilv35pp75dvd52enl3ohqakua2mshf5fy:glif",
"index": 6,
"name": "Filecoin 7",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "0",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": false,
},
{
"balance": "0",
"currencyId": "filecoin",
"derivationMode": "glif",
"freshAddress": "f1347zfz7jiz3oeufp2lrbcwwt265ejk32n2wqrla",
"freshAddressPath": "44'/461'/0'/0/7",
"id": "js:2:filecoin:f1347zfz7jiz3oeufp2lrbcwwt265ejk32n2wqrla:glif",
"index": 7,
"name": "Filecoin 8",
"nfts": undefined,
"operationsCount": 0,
"pendingOperations": [],
"seedIdentifier": "04ca7b02cafdf36e8b4caaf530a96b949764af71b956b2a3328b7a10940794c860f574a9199be98bde3c261887fec8e5fd94bc5f104908bf5f992f52ef2a89abb0",
"spendableBalance": "0",
"starred": false,
"subAccounts": [],
"swapHistory": [],
"syncHash": undefined,
"unitMagnitude": 18,
"used": false,
},
]
`;

exports[`filecoin currency bridge scanAccounts filecoin seed 1 2`] = `
[
[],
[
{
"accountId": "js:2:filecoin:t15lauyzdivqj7m3yob3rxmzdsy7uyhfflwyheuri:glifLegacy+filecoin%2Ferc20%2Fwrapped~!underscore!~fil",
"blockHash": null,
"blockHeight": 3836167,
"contract": undefined,
"extra": {},
"fee": "0",
"hash": "bafy2bzaceahk5vhtmsflroh5cdivfks3jf2xywh4zzy5ej32w3747alcjxxow",
"id": "js:2:filecoin:t15lauyzdivqj7m3yob3rxmzdsy7uyhfflwyheuri:glifLegacy+filecoin%2Ferc20%2Fwrapped~!underscore!~fil-bafy2bzaceahk5vhtmsflroh5cdivfks3jf2xywh4zzy5ej32w3747alcjxxow-IN",
"operator": undefined,
"recipients": [
"0xFF000000000000000000000000000000001c748a",
],
"senders": [
"0xff000000000000000000000000000000001FDA97",
],
"standard": undefined,
"tokenId": undefined,
"type": "IN",
"value": "1234000000000000",
},
],
[
{
"accountId": "js:2:filecoin:f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a:glif",
"blockHash": null,
"blockHeight": 1802367,
"contract": undefined,
"extra": {},
"fee": "0",
"hasFailed": false,
"hash": "bafy2bzaceaztepnzdzbul7nmkef6blk5x2luvbvangrjal25k6xi5qob36k32",
"id": "js:2:filecoin:f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a:glif-bafy2bzaceaztepnzdzbul7nmkef6blk5x2luvbvangrjal25k6xi5qob36k32-IN",
"operator": undefined,
"recipients": [
"f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a",
],
"senders": [
"f1ov6d42tujoyexkbdh34oik2vhe5unqo2a5ocqoq",
],
"standard": undefined,
"tokenId": undefined,
"type": "IN",
"value": "100000000000000000",
},
],
[
{
"accountId": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif",
"blockHash": null,
"blockHeight": 3853241,
"contract": undefined,
"extra": {},
"fee": "0",
"hasFailed": false,
"hash": "bafy2bzacecwvvvxtlbm5s6wpk546r66hjqw4amjioihe2rt5ufoebu3zv6xiw",
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif-bafy2bzacecwvvvxtlbm5s6wpk546r66hjqw4amjioihe2rt5ufoebu3zv6xiw-IN",
"operator": undefined,
"recipients": [
"f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia",
],
"senders": [
"f1ovlkmtnqji7wrvdpcys3i22c62obbamgokmg35q",
],
"standard": undefined,
"tokenId": undefined,
"type": "IN",
"value": "10000000000000000",
},
],
[
{
"accountId": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif+filecoin%2Ferc20%2Fwrapped~!underscore!~fil",
"blockHash": null,
"blockHeight": 3853248,
"contract": undefined,
"extra": {},
"fee": "0",
"hash": "bafy2bzaceaw6jxm3bp6rdvtse7k4evsg2zhis3ootn2pe5k3txtxor4efhl7k",
"id": "js:2:filecoin:f1plmg3kklvmnodfboimcq5w27mnfs2hwjtas6gia:glif+filecoin%2Ferc20%2Fwrapped~!underscore!~fil-bafy2bzaceaw6jxm3bp6rdvtse7k4evsg2zhis3ootn2pe5k3txtxor4efhl7k-IN",
"operator": undefined,
"recipients": [
"0xFf000000000000000000000000000000002ED783",
],
"senders": [
"0xff000000000000000000000000000000001FDA97",
],
"standard": undefined,
"tokenId": undefined,
"type": "IN",
"value": "12340000000000000",
},
],
[],
[],
[],
[],
[],
[],
]
`;
Loading
Loading