@initia/initia.js 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -55
- package/dist/client/rest/RESTClient.d.ts +0 -2
- package/dist/client/rest/Wallet.d.ts +0 -1
- package/dist/client/rest/api/EvmAPI.d.ts +24 -3
- package/dist/client/rest/api/MstakingAPI.d.ts +2 -2
- package/dist/client/rest/api/OracleAPI.d.ts +16 -1
- package/dist/core/evm/msgs/MsgCreate2.d.ts +2 -2
- package/dist/core/num.d.ts +0 -2
- package/dist/core/opchild/msgs/MsgAddBridgeExecutor.d.ts +32 -0
- package/dist/core/opchild/msgs/MsgAddFeeWhitelistAddresses.d.ts +32 -0
- package/dist/core/opchild/msgs/MsgRemoveBridgeExecutor.d.ts +32 -0
- package/dist/core/opchild/msgs/MsgRemoveFeeWhitelistAddresses.d.ts +32 -0
- package/dist/core/opchild/msgs/MsgUpdateMinGasPrices.d.ts +33 -0
- package/dist/core/opchild/msgs/MsgUpdateOpchildAdmin.d.ts +32 -0
- package/dist/core/opchild/msgs/index.d.ts +16 -4
- package/dist/core/ophost/msgs/MsgUpdateFinalizationPeriod.d.ts +36 -0
- package/dist/core/ophost/msgs/index.d.ts +6 -4
- package/dist/index.cjs +6 -6
- package/dist/index.mjs +34999 -31503
- package/dist/key/ledger/LedgerKey.d.ts +21 -15
- package/dist/key/ledger/app.d.ts +43 -17
- package/dist/key/ledger/error.d.ts +3 -0
- package/dist/key/ledger/index.d.ts +2 -4
- package/package.json +11 -5
- package/dist/key/ledger/constants.d.ts +0 -22
- package/dist/key/ledger/device.d.ts +0 -10
- package/dist/key/ledger/types.d.ts +0 -44
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as Transport } from '@ledgerhq/hw-transport';
|
|
2
2
|
import { AccAddress, SignatureV2, SignDoc } from '../..';
|
|
3
3
|
import { Key } from '../Key';
|
|
4
|
-
import {
|
|
4
|
+
import { LoadConfig } from '@ledgerhq/hw-app-eth/lib/services/types';
|
|
5
|
+
import { LedgerApp } from './app';
|
|
5
6
|
declare global {
|
|
6
7
|
interface Window {
|
|
7
8
|
google: any;
|
|
@@ -10,25 +11,30 @@ declare global {
|
|
|
10
11
|
hid: any;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
export declare
|
|
14
|
-
|
|
14
|
+
export declare enum Kind {
|
|
15
|
+
Ethereum = "Ethereum",
|
|
16
|
+
Cosmos = "Cosmos"
|
|
15
17
|
}
|
|
16
18
|
export declare class LedgerKey extends Key {
|
|
17
|
-
private
|
|
19
|
+
private readonly path;
|
|
18
20
|
private app;
|
|
19
|
-
private
|
|
20
|
-
constructor(transport
|
|
21
|
+
private appKind;
|
|
22
|
+
constructor(transport: Transport, index?: number, appKind?: Kind);
|
|
21
23
|
get accAddress(): AccAddress;
|
|
22
|
-
static create(transport?: Transport, index?: number): Promise<LedgerKey>;
|
|
24
|
+
static create(transport?: Transport, index?: number, appKind?: Kind): Promise<LedgerKey>;
|
|
23
25
|
private initialize;
|
|
26
|
+
getApplicationKind(): Kind;
|
|
27
|
+
getApplication(): LedgerApp;
|
|
28
|
+
setLoadConfig(loadConfig: LoadConfig): void;
|
|
29
|
+
getPath(): string;
|
|
24
30
|
loadAccountDetails(): Promise<LedgerKey>;
|
|
25
|
-
sign(
|
|
26
|
-
signWithKeccak256(): Promise<Buffer>;
|
|
31
|
+
sign(payload: Buffer): Promise<Buffer>;
|
|
32
|
+
signWithKeccak256(payload: Buffer): Promise<Buffer>;
|
|
27
33
|
createSignature(_tx: SignDoc): Promise<SignatureV2>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
signText(payload: string | Buffer): Promise<Buffer>;
|
|
35
|
+
getAppConfiguration(): Promise<any>;
|
|
36
|
+
showAddressAndPubKey(): Promise<void>;
|
|
37
|
+
getTransport(): Transport;
|
|
38
|
+
static createEthereumApp(transport?: Transport, index?: number): Promise<LedgerKey>;
|
|
39
|
+
static createCosmosApp(transport?: Transport, index?: number): Promise<LedgerKey>;
|
|
34
40
|
}
|
package/dist/key/ledger/app.d.ts
CHANGED
|
@@ -1,19 +1,45 @@
|
|
|
1
|
+
import { default as Eth } from '@ledgerhq/hw-app-eth';
|
|
2
|
+
import { LoadConfig } from '@ledgerhq/hw-app-eth/lib/services/types';
|
|
3
|
+
import { default as Cosmos } from '@zondax/ledger-cosmos-js';
|
|
1
4
|
import { default as Transport } from '@ledgerhq/hw-transport';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
import { PublicKey } from '../..';
|
|
6
|
+
export declare abstract class LedgerApp {
|
|
7
|
+
transport: Transport;
|
|
8
|
+
constructor(transport: Transport);
|
|
9
|
+
abstract getAppConfiguration(): Promise<any>;
|
|
10
|
+
abstract getVersion(): Promise<string>;
|
|
11
|
+
abstract getMininumRequiredVersion(): string;
|
|
12
|
+
abstract setLoadConfig(config: any): void;
|
|
13
|
+
abstract getAddress(path: string, display: boolean): Promise<string>;
|
|
14
|
+
abstract getPublicKey(path: string, display: boolean): Promise<PublicKey>;
|
|
15
|
+
abstract sign(path: string, payload: Buffer): Promise<Buffer>;
|
|
16
|
+
abstract signWithKeccak256(path: string, payload: Buffer): Promise<Buffer>;
|
|
17
|
+
abstract signText(path: string, payload: string | Buffer): Promise<Buffer>;
|
|
18
|
+
}
|
|
19
|
+
export declare class EthereumApp extends LedgerApp {
|
|
20
|
+
app: Eth;
|
|
21
|
+
constructor(transport: Transport);
|
|
22
|
+
getVersion(): Promise<string>;
|
|
23
|
+
getAppConfiguration(): Promise<any>;
|
|
24
|
+
setLoadConfig(config: LoadConfig): void;
|
|
25
|
+
getAddress(path: string, display?: boolean): Promise<string>;
|
|
26
|
+
getPublicKey(path: string, display?: boolean): Promise<PublicKey>;
|
|
27
|
+
sign(path: string, payload: Buffer): Promise<Buffer>;
|
|
28
|
+
signWithKeccak256(path: string, payload: Buffer): Promise<Buffer>;
|
|
29
|
+
signText(path: string, payload: string | Buffer): Promise<Buffer>;
|
|
30
|
+
getMininumRequiredVersion(): string;
|
|
31
|
+
}
|
|
32
|
+
export declare class CosmosApp extends LedgerApp {
|
|
33
|
+
app: Cosmos;
|
|
34
|
+
constructor(transport: Transport);
|
|
35
|
+
getVersion(): Promise<string>;
|
|
36
|
+
getAppConfiguration(): Promise<any>;
|
|
37
|
+
setLoadConfig(_config: any): void;
|
|
38
|
+
getAddress(path: string, display?: boolean): Promise<string>;
|
|
39
|
+
getPublicKey(path: string, display?: boolean): Promise<PublicKey>;
|
|
40
|
+
sign(path: string, payload: string | Buffer): Promise<Buffer>;
|
|
41
|
+
signWithKeccak256(_path: string, _payload: Buffer): Promise<Buffer>;
|
|
42
|
+
signText(_path: string, _payload: string | Buffer): Promise<Buffer>;
|
|
43
|
+
signTextual(path: string, payload: string | Buffer): Promise<Buffer>;
|
|
44
|
+
getMininumRequiredVersion(): string;
|
|
19
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@initia/initia.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "The JavaScript SDK for Initia",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Initia Foundation",
|
|
@@ -58,13 +58,16 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@bitcoinerlab/secp256k1": "^1.1.1",
|
|
61
|
-
"@initia/initia.proto": "^0.
|
|
62
|
-
"@initia/opinit.proto": "^
|
|
63
|
-
"@ledgerhq/hw-
|
|
61
|
+
"@initia/initia.proto": "^1.0.1",
|
|
62
|
+
"@initia/opinit.proto": "^1.0.1",
|
|
63
|
+
"@ledgerhq/hw-app-eth": "^6.45.5",
|
|
64
|
+
"@ledgerhq/hw-transport": "^6.31.5",
|
|
65
|
+
"@ledgerhq/hw-transport-node-hid": "^6.29.6",
|
|
64
66
|
"@ledgerhq/hw-transport-webhid": "^6.29.4",
|
|
65
67
|
"@ledgerhq/hw-transport-webusb": "^6.29.4",
|
|
66
68
|
"@mysten/bcs": "^1.1.0",
|
|
67
|
-
"
|
|
69
|
+
"@zondax/ledger-cosmos-js": "^4.0.1",
|
|
70
|
+
"axios": "^1.9.0",
|
|
68
71
|
"bech32": "^2.0.0",
|
|
69
72
|
"bignumber.js": "^9.1.2",
|
|
70
73
|
"bip32": "^5.0.0-rc.0",
|
|
@@ -76,6 +79,9 @@
|
|
|
76
79
|
"semver": "^7.6.3",
|
|
77
80
|
"ws": "^8.18.0"
|
|
78
81
|
},
|
|
82
|
+
"overrides": {
|
|
83
|
+
"axios": "^1.9.0"
|
|
84
|
+
},
|
|
79
85
|
"lint-staged": {
|
|
80
86
|
"src/**/*.{mjs|ts}": [
|
|
81
87
|
"npx eslint . --fix"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const CLA = 85;
|
|
2
|
-
export declare const CHUNK_SIZE = 250;
|
|
3
|
-
export declare const APP_KEY = "CSM";
|
|
4
|
-
export declare const INS: {
|
|
5
|
-
GET_VERSION: number;
|
|
6
|
-
INS_PUBLIC_KEY_SECP256K1: number;
|
|
7
|
-
SIGN_SECP256K1: number;
|
|
8
|
-
GET_ADDR_SECP256K1: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const PAYLOAD_TYPE: {
|
|
11
|
-
INIT: number;
|
|
12
|
-
ADD: number;
|
|
13
|
-
LAST: number;
|
|
14
|
-
};
|
|
15
|
-
export declare const P1_VALUES: {
|
|
16
|
-
ONLY_RETRIEVE: number;
|
|
17
|
-
SHOW_ADDRESS_IN_DEVICE: number;
|
|
18
|
-
};
|
|
19
|
-
export declare const ERROR_CODE: {
|
|
20
|
-
NoError: number;
|
|
21
|
-
};
|
|
22
|
-
export declare const ERROR_DESCRIPTION: Record<number, string>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as Transport } from '@ledgerhq/hw-transport';
|
|
2
|
-
import { AppInfoResponse, VersionResponse, DeviceInfoResponse, PublicKeyResponse, SignResponse } from './types';
|
|
3
|
-
export declare function serializePath(path: number[]): Buffer;
|
|
4
|
-
export declare function getVersion(transport: Transport): Promise<VersionResponse>;
|
|
5
|
-
export declare function getAppInfo(transport: Transport): Promise<AppInfoResponse>;
|
|
6
|
-
export declare function getDeviceInfo(transport: Transport): Promise<DeviceInfoResponse>;
|
|
7
|
-
export declare function publicKey(transport: Transport, data: Buffer): Promise<PublicKeyResponse>;
|
|
8
|
-
export declare function getAddressAndPubKey(transport: Transport, data: Buffer): Promise<PublicKeyResponse>;
|
|
9
|
-
export declare function showAddressAndPubKey(transport: Transport, data: Buffer): Promise<PublicKeyResponse>;
|
|
10
|
-
export declare function sign(transport: Transport, path: number[], message: Buffer): Promise<SignResponse>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export interface JSONBuffer {
|
|
2
|
-
type: 'Buffer';
|
|
3
|
-
data: number[];
|
|
4
|
-
}
|
|
5
|
-
export interface CommonResponse {
|
|
6
|
-
return_code: number;
|
|
7
|
-
error_message: string;
|
|
8
|
-
device_locked?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface PublicKeyResponse extends CommonResponse {
|
|
11
|
-
bech32_address: string;
|
|
12
|
-
pk: 'OBSOLETE PROPERTY';
|
|
13
|
-
compressed_pk: JSONBuffer;
|
|
14
|
-
}
|
|
15
|
-
export interface AddressResponse extends CommonResponse {
|
|
16
|
-
bech32_address: string;
|
|
17
|
-
compressed_pk: JSONBuffer;
|
|
18
|
-
}
|
|
19
|
-
export interface SignResponse extends CommonResponse {
|
|
20
|
-
signature: JSONBuffer;
|
|
21
|
-
}
|
|
22
|
-
export interface AppInfoResponse extends CommonResponse {
|
|
23
|
-
app_name: string;
|
|
24
|
-
app_version: string;
|
|
25
|
-
flag_len: number;
|
|
26
|
-
flags_value: number;
|
|
27
|
-
flag_recovery: boolean;
|
|
28
|
-
flag_signed_mcu_code: boolean;
|
|
29
|
-
flag_onboarded: boolean;
|
|
30
|
-
flag_pin_validated: boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface VersionResponse extends CommonResponse {
|
|
33
|
-
test_mode: boolean;
|
|
34
|
-
major: number;
|
|
35
|
-
minor: number;
|
|
36
|
-
patch: number;
|
|
37
|
-
target_id: string;
|
|
38
|
-
}
|
|
39
|
-
export interface DeviceInfoResponse extends CommonResponse {
|
|
40
|
-
target_id: string;
|
|
41
|
-
se_version: string;
|
|
42
|
-
flag: string;
|
|
43
|
-
mcu_version: string;
|
|
44
|
-
}
|