-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Coin Modularization] Cardano (#6812)
* chore: define cardano in its own module Signed-off-by: Stéphane Prohaszka <[email protected]> * fix: lint Signed-off-by: Stéphane Prohaszka <[email protected]> * chore: update unimported Signed-off-by: Stéphane Prohaszka <[email protected]> * chore: feedbacks Signed-off-by: Stéphane Prohaszka <[email protected]> * fix: remove unnecessary test in favor of relying on type Signed-off-by: Stéphane Prohaszka <[email protected]> * fix: lint issue Signed-off-by: Stéphane Prohaszka <[email protected]> * feat: limit code in LLC by adding simpler serialiazer for signer Signed-off-by: Stéphane Prohaszka <[email protected]> * chore: simplify signOperation readability Signed-off-by: Stéphane Prohaszka <[email protected]> * chore: reorganize imports Signed-off-by: Stéphane Prohaszka <[email protected]> * fix: unimported and lock file Signed-off-by: Stéphane Prohaszka <[email protected]> --------- Signed-off-by: Stéphane Prohaszka <[email protected]>
- Loading branch information
1 parent
6623cd1
commit cec1599
Showing
86 changed files
with
1,951 additions
and
1,478 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/coin-cardano": minor | ||
"@ledgerhq/errors": minor | ||
"ledger-live-desktop": minor | ||
"live-mobile": minor | ||
"@ledgerhq/live-common": minor | ||
--- | ||
|
||
Modularize Cardano |
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
3 changes: 1 addition & 2 deletions
3
.../ledger-live-desktop/src/renderer/families/cardano/DelegationFlowModal/LedgerPoolIcon.tsx
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
2 changes: 1 addition & 1 deletion
2
...dger-live-desktop/src/renderer/families/cardano/DelegationFlowModal/ScrollLoadingList.tsx
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
2 changes: 1 addition & 1 deletion
2
apps/ledger-live-mobile/src/families/cardano/DelegationFlow/types.ts
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
2 changes: 1 addition & 1 deletion
2
apps/ledger-live-mobile/src/families/cardano/shared/PoolRow.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es6: true, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["src/**/*.test.{ts,tsx}"], | ||
env: { | ||
"jest/globals": true, | ||
}, | ||
plugins: ["jest"], | ||
}, | ||
], | ||
rules: { | ||
"no-console": ["error", { allow: ["warn", "error"] }], | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
}, | ||
}; |
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,33 @@ | ||
{ | ||
"entry": [ | ||
"src/account.ts", | ||
"src/api/getPools.ts", | ||
"src/bridge/index.ts", | ||
"src/cli-transaction.ts", | ||
"src/datasets/rawAccount.1.ts", | ||
"src/datasets/scanAccounts.ts", | ||
"src/deviceTransactionConfig.ts", | ||
"src/errors.ts", | ||
"src/specs.ts", | ||
"src/speculos-deviceActions.ts", | ||
"src/transaction.ts", | ||
"src/utils.ts" | ||
], | ||
"ignoreUnimported": [ | ||
"src/api/getDelegationInfo.ts", | ||
"src/api/getNetworkInfo.ts", | ||
"src/api/getTransactions.ts", | ||
"src/api/submitTransaction.ts", | ||
"src/hw-getAddress.ts", | ||
"src/js-broadcast.ts", | ||
"src/js-buildTransaction.ts", | ||
"src/js-estimateMaxSpendable.ts", | ||
"src/js-getTransactionStatus.ts", | ||
"src/js-signOperation.ts", | ||
"src/js-synchronisation.ts", | ||
"src/js-transaction.ts", | ||
"src/postSyncPatch.ts", | ||
"src/serialization.ts", | ||
"src/signer.ts" | ||
] | ||
} |
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,8 @@ | ||
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ | ||
module.exports = { | ||
collectCoverageFrom: ["src/**/*.ts"], | ||
coverageDirectory: "coverage", | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testPathIgnorePatterns: ["lib/", "lib-es/"], | ||
}; |
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,91 @@ | ||
{ | ||
"name": "@ledgerhq/coin-cardano", | ||
"version": "0.0.1", | ||
"description": "Ledger Cardano Coin integration", | ||
"keywords": [ | ||
"Ledger", | ||
"LedgerWallet", | ||
"ada", | ||
"Cardano", | ||
"Hardware Wallet" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/LedgerHQ/ledger-live.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/LedgerHQ/ledger-live/issues" | ||
}, | ||
"homepage": "https://github.com/LedgerHQ/ledger-live/tree/develop/libs/coin-modules/coin-cardano", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"lib/*": [ | ||
"lib/*" | ||
], | ||
"lib-es/*": [ | ||
"lib-es/*" | ||
], | ||
"bridge": [ | ||
"lib/bridge/index" | ||
], | ||
"*": [ | ||
"lib/*" | ||
] | ||
} | ||
}, | ||
"exports": { | ||
"./lib/*": "./lib/*.js", | ||
"./lib-es/*": "./lib-es/*.js", | ||
"./bridge": { | ||
"require": "./lib/bridge/index.js", | ||
"default": "./lib-es/bridge/index.js" | ||
}, | ||
"./*": { | ||
"require": "./lib/*.js", | ||
"default": "./lib-es/*.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@ledgerhq/coin-framework": "workspace:^", | ||
"@ledgerhq/cryptoassets": "workspace:^", | ||
"@ledgerhq/devices": "workspace:^", | ||
"@ledgerhq/errors": "workspace:^", | ||
"@ledgerhq/live-env": "workspace:^", | ||
"@ledgerhq/live-network": "workspace:^", | ||
"@ledgerhq/logs": "workspace:^", | ||
"@ledgerhq/types-cryptoassets": "workspace:^", | ||
"@ledgerhq/types-live": "workspace:^", | ||
"@stricahq/bip32ed25519": "^1.0.3", | ||
"@stricahq/typhonjs": "^1.2.6", | ||
"bech32": "^1.1.3", | ||
"bignumber.js": "^9.1.2", | ||
"expect": "^27.4.6", | ||
"invariant": "^2.2.2", | ||
"lodash": "^4.17.21", | ||
"rxjs": "^7.8.1" | ||
}, | ||
"devDependencies": { | ||
"@types/invariant": "^2.2.2", | ||
"@types/jest": "^29.5.10", | ||
"@types/lodash": "^4.14.191", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.1.1" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf lib lib-es", | ||
"build": "tsc && tsc -m ES6 --outDir lib-es", | ||
"coverage": "jest --coverage --testPathIgnorePatterns='/bridge.integration.test.ts|node_modules|lib-es|lib/' --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-cardano.json", | ||
"prewatch": "pnpm build", | ||
"watch": "tsc --watch", | ||
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts", | ||
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache", | ||
"lint:fix": "pnpm lint --fix", | ||
"test": "jest", | ||
"unimported": "unimported" | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...ve-common/src/families/cardano/account.ts → .../coin-modules/coin-cardano/src/account.ts
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.