Skip to content

Commit

Permalink
improving JS integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni committed May 12, 2024
1 parent 50b5967 commit 7f5d22c
Show file tree
Hide file tree
Showing 14 changed files with 554 additions and 504 deletions.
12 changes: 11 additions & 1 deletion js/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"printWidth": 120
"singleQuote": true,
"arrowParens": "avoid",
"semi": false,
"useTabs": false,
"printWidth": 140,
"tabWidth": 2,
"importOrder": ["^@(.*)/(.*)$", "^[./]"],
"trailingComma": "es5",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
Binary file modified js/bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@
"upgrade": "bunx npm-check-updates -i"
},
"dependencies": {
"@zondax/ledger-js": "^0.2"
"@zondax/ledger-js": "^0.6"
},
"devDependencies": {
"@ledgerhq/hw-transport-mocker": "^6.28.6",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/jest": "29.5.12",
"@types/node": "^20.12.8",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.4.0",
"eslint-plugin-n": "^17.6.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-tsdoc": "^0.2.17",
"eslint-plugin-unused-imports": "^3.2.0",
Expand Down
22 changes: 18 additions & 4 deletions js/src/common.ts → js/src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/******************************************************************************
* (c) 2018 - 2024 Zondax AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
export const CLA = 0x85;
export const CHUNK_SIZE = 250;

Expand Down Expand Up @@ -25,7 +40,6 @@ export const INS = {
EXTRACT_TRANS_SIGNATURE: 0xa5,
};


export const P1_VALUES = {
ONLY_RETRIEVE: 0x00,
SHOW_ADDRESS_IN_DEVICE: 0x01,
Expand All @@ -40,7 +54,7 @@ export const ERROR_CODE = {
NoError: 0x9000,
};

export const PKLEN = 33;
export const TRANSPARENT_PK_LEN = 33;
export const SAPLING_ADDR_LEN = 43;
export const SAPLING_DIV_LEN = 11;
export const SAPLING_IVK_LEN = 32;
Expand All @@ -49,7 +63,7 @@ export const SAPLING_NF_LEN = 32;
export const SAPLING_AK_LEN = 32;
export const SAPLING_NK_LEN = 32;
export const SAPLING_PGK_LEN = 64;
export const SAPLING_SPENDDATA_LEN = 128;
export const SAPLING_OUTPUTDATA_LEN = 96;
export const SAPLING_SPEND_DATA_LEN = 128;
export const SAPLING_OUTPUT_DATA_LEN = 96;
export const SAPLING_RND_LEN = 192; // fixme
export const SAPLING_SIGN_LEN = 64;

0 comments on commit 7f5d22c

Please sign in to comment.