diff --git a/README.md b/README.md index ebbad61..49c6413 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ [Github](https://github.com/LedgerHQ/ledgerjs/), [Ledger Devs Slack](https://ledger-dev.slack.com/) -## @obsidiansystems/hw-app-ckb +## @magickbase/hw-app-ckb + +> This repository is a fork of [obsidiansystems/hw-app-ckb](https://github.com/obsidiansystems/hw-app-ckb) Ledger Hardware Wallet CKB JavaScript bindings. @@ -15,7 +17,7 @@ for this package. Here is a sample app for Node: let Transport = require("@ledgerhq/hw-transport-node-hid").default; - let Ckb = require("@obsidiansystems/hw-app-ckb").default; + let Ckb = require("@magickbase/hw-app-ckb").default; const getWalletId = async () => { const transport = await Transport.create(); @@ -101,7 +103,7 @@ Nervos API #### Examples ```javascript -import Ckb from "@obsidiansystems/hw-app-ckb"; +import Ckb from "@magickbase/hw-app-ckb"; const ckb = new Ckb(transport); ``` diff --git a/examples/sampleapp.js b/examples/sampleapp.js index a697c53..633ba12 100644 --- a/examples/sampleapp.js +++ b/examples/sampleapp.js @@ -1,5 +1,5 @@ let Transport = require("@ledgerhq/hw-transport-node-speculos").default; -let Ckb = require("@obsidiansystems/hw-app-ckb").default; +let Ckb = require("@magickbase/hw-app-ckb").default; apduPort = 9999; tp=Transport.open( { apduPort } ); diff --git a/package.json b/package.json index f11ae2e..b62128c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "hw-app-ckb", - "version": "0.1.2", + "name": "@magickbase/hw-app-ckb", + "version": "0.2.0-alpha.0", "description": "Ledger Hardware Wallet Nervos CKB API", "keywords": [ "Ledger", @@ -12,16 +12,18 @@ ], "repository": { "type": "git", - "url": "https://github.com/obsidiansystems/hw-app-ckb" + "url": "https://github.com/magickbase/hw-app-ckb" }, "bugs": { - "url": "https://github.com/obsidiansystems/hw-app-ckb/issues" + "url": "https://github.com/magickbase/hw-app-ckb/issues" }, - "homepage": "https://github.com/LedgerHQ/ledgerjs", + "homepage": "https://github.com/magickbase/hw-app-ckb", "publishConfig": { "access": "public" }, - "files": ["lib"], + "files": [ + "lib" + ], "main": "lib/Ckb.js", "module": "lib-es/Ckb.js", "license": "Apache-2.0", diff --git a/src/Ckb.js b/src/Ckb.js index d672634..4d13aec 100644 --- a/src/Ckb.js +++ b/src/Ckb.js @@ -14,7 +14,7 @@ const BECH32_LIMIT = 1023; * Nervos API * * @example - * import Ckb from "@obsidiansystems/hw-app-ckb"; + * import Ckb from "@magickbase/hw-app-ckb"; * const ckb = new Ckb(transport); */ export default class Ckb { diff --git a/src/annotated.js b/src/annotated.js index 4e16ffc..ce01b42 100644 --- a/src/annotated.js +++ b/src/annotated.js @@ -87,13 +87,13 @@ function fromStringEnum(val) { // If the last bit is 0, it indicates using code hash to locate the contract code. // The first 7 bits prepresent the VM version to run the contract code. case "type": - return 0b0000000_1; + return 0b00000001; case "data": - return 0b0000000_0; + return 0b00000000; case "data1": - return 0b0000001_0; + return 0b00000010; case "data2": - return 0b0000010_0; + return 0b00000100; default: throw new Error("Not a valid byte representation: "+val); }