Skip to content

Commit 51a22da

Browse files
committed
Build at 4d35b1a (demo: display signed Nimiq transaction hash for sending a transaction manually)
1 parent 67288ba commit 51a22da

File tree

102 files changed

+69967
-35969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+69967
-35969
lines changed

demo/index.js

Lines changed: 33706 additions & 12127 deletions
Large diffs are not rendered by default.

demo/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

high-level-api/app-utils.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export declare function isAppSupported(app: string, requiredApp: string, allowLegacyApp: boolean, allowSpeculos: boolean): boolean;
2+
export declare function isAppVersionSupported(versionString: string, minRequiredVersion: string): boolean;
3+
export declare function isLegacyApp(app: string): boolean;
4+
export declare function getLegacyApp(app: string): string;

high-level-api/bip32-utils.d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { AddressTypeBitcoin, Coin, Network } from './constants';
2-
declare type Bip32PathParams = {
2+
type Bip32PathParams = {
33
addressIndex: number;
44
accountIndex?: number;
55
} & ({
66
coin: Coin.NIMIQ;
77
} | {
88
coin: Coin.BITCOIN;
99
addressType?: AddressTypeBitcoin;
10-
network?: Network;
10+
network?: Exclude<Network, Network.DEVNET>;
1111
isInternal?: boolean;
1212
});
1313
/**
@@ -17,5 +17,7 @@ export declare function getBip32Path(params: Bip32PathParams): string;
1717
/**
1818
* Parse bip32 path according to path layout specified in bip44.
1919
*/
20-
export declare function parseBip32Path(path: string): Required<Bip32PathParams>;
20+
export declare function parseBip32Path(path: string): Required<Bip32PathParams> & {
21+
accountPath: string;
22+
};
2123
export {};

high-level-api/constants.d.ts

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,53 @@ export declare enum Coin {
44
}
55
export declare enum Network {
66
MAINNET = "main",
7-
TESTNET = "test"
7+
TESTNET = "test",
8+
DEVNET = "dev"
9+
}
10+
export declare const NetworkIdNimiq: {
11+
readonly main: 24;
12+
readonly test: 5;
13+
readonly dev: 6;
14+
readonly legacy: {
15+
readonly main: 42;
16+
readonly test: 1;
17+
readonly dev: 2;
18+
};
19+
};
20+
export declare enum AccountTypeNimiq {
21+
BASIC = 0,
22+
VESTING = 1,
23+
HTLC = 2,
24+
STAKING = 3
25+
}
26+
export declare enum TransactionFlagsNimiq {
27+
NONE = 0,
28+
CONTRACT_CREATION = 1,
29+
SIGNALING = 2
830
}
931
export declare enum AddressTypeBitcoin {
1032
LEGACY = "legacy-bitcoin",
1133
P2SH_SEGWIT = "p2sh-segwit-bitcoin",
1234
NATIVE_SEGWIT = "native-segwit-bitcoin"
1335
}
36+
export declare const LedgerAddressFormatMapBitcoin: {
37+
"legacy-bitcoin": "legacy";
38+
"p2sh-segwit-bitcoin": "p2sh";
39+
"native-segwit-bitcoin": "bech32";
40+
};
1441
export declare const REQUEST_EVENT_CANCEL = "cancel";
1542
export declare enum RequestTypeNimiq {
1643
GET_WALLET_ID = "get-wallet-id-nimiq",
1744
DERIVE_ADDRESSES = "derive-addresses-nimiq",
1845
GET_PUBLIC_KEY = "get-public-key-nimiq",
1946
GET_ADDRESS = "get-address-nimiq",
20-
SIGN_TRANSACTION = "sign-transaction-nimiq"
47+
SIGN_TRANSACTION = "sign-transaction-nimiq",
48+
SIGN_MESSAGE = "sign-message-nimiq"
2149
}
2250
export declare enum RequestTypeBitcoin {
2351
GET_WALLET_ID = "get-wallet-id-bitcoin",
2452
GET_ADDRESS_AND_PUBLIC_KEY = "get-address-and-public-key-bitcoin",
2553
GET_EXTENDED_PUBLIC_KEY = "get-extended-public-key-bitcoin",
26-
SIGN_TRANSACTION = "sign-transaction-bitcoin"
54+
SIGN_TRANSACTION = "sign-transaction-bitcoin",
55+
SIGN_MESSAGE = "sign-message-bitcoin"
2756
}

high-level-api/error-state.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
declare type StateTypeError = import('./ledger-api').StateType.ERROR;
2-
declare type RequestBase = import('./requests/request').default<any>;
3-
declare type SpecificRequest = import('./ledger-api').Request;
1+
type StateTypeError = import('./ledger-api').StateType.ERROR;
2+
type RequestBase = import('./requests/request').default<any>;
3+
type SpecificRequest = import('./ledger-api').Request;
44
export declare enum ErrorType {
55
LEDGER_BUSY = "ledger-busy",
66
LOADING_DEPENDENCIES_FAILED = "loading-dependencies-failed",

0 commit comments

Comments
 (0)