-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
* Full conversion to typescript * Fix export logic * README fixes * Version bump to 1.1.0 While this looks like a significant change, the code is semantically the same as before getAddress is a typo and has been renamed to the correct getPublicKey. I'm the only user of this repo at this time and I'll be changing all references to the correct one when updating to this version so I consider this all a minor change. Breaking change: - getAddress is now getPublicKey (which is what it should've been in the first place)
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
node_modules/ | ||
coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export default { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testRegex: ".test.ts$", | ||
collectCoverage: true, | ||
testPathIgnorePatterns: ["packages/*/lib-es", "packages/*/lib"], | ||
coveragePathIgnorePatterns: ["packages/create-dapp"], | ||
passWithNoTests: true, | ||
rootDir: __dirname, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Kaspa from './kaspa'; | ||
export { TransactionInput, TransactionOutput, Transaction } from './transaction'; | ||
export default Kaspa; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/// <reference types="node" /> | ||
import Transport from "@ledgerhq/hw-transport"; | ||
import { Transaction } from "./transaction"; | ||
declare class Kaspa { | ||
/** | ||
* @type {Transport} | ||
*/ | ||
transport: Transport; | ||
constructor(transport: Transport); | ||
/** | ||
* Get Kaspa address (public key) for a BIP32 path. | ||
* | ||
* @param {string} path a BIP32 path | ||
* @param {boolean} display flag to show display | ||
* @returns {Buffer} an object with the address field | ||
* | ||
* @example | ||
* kaspa.getPublicKey("44'/111111'/0'").then(r => r.address) | ||
*/ | ||
getPublicKey(path: any, display?: boolean): Promise<Buffer>; | ||
/** | ||
* Sign a Kaspa transaction. Applies the signatures into the input objects | ||
* | ||
* @param {Transaction} transaction - the Transaction object | ||
* | ||
* | ||
* @example | ||
* kaspa.signTransaction(transaction) | ||
*/ | ||
signTransaction(transaction: Transaction): Promise<void>; | ||
/** | ||
* Sign personal message on the device | ||
* @param {String} message - the personal message string to sign. Max 120 len for Nano S, 200 len for others | ||
* @param {0|1} addressType | ||
* @param {number} addressIndex | ||
* | ||
* @returns {Buffer} application config object | ||
* | ||
* @example | ||
* kaspa.signMessage(message).then(r => r.version) | ||
*/ | ||
signMessage(message: string, addressType: 0 | 1, addressIndex: number): Promise<{ | ||
signature: string; | ||
messageHash: string; | ||
}>; | ||
/** | ||
* Get application configuration. | ||
* | ||
* @returns {Buffer} application config object | ||
* | ||
* @example | ||
* kaspa.getVersion().then(r => r.version) | ||
*/ | ||
getVersion(): Promise<{ | ||
version: string; | ||
}>; | ||
sendToDevice(instruction: any, p1: any, payload?: Buffer, p2?: number): Promise<Buffer>; | ||
} | ||
export default Kaspa; | ||
//# sourceMappingURL=kaspa.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.