@onekeyfe/hd-core 0.2.50 → 0.2.51
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/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/kaspa/KaspaGetAddress.d.ts +17 -0
- package/dist/api/kaspa/KaspaGetAddress.d.ts.map +1 -0
- package/dist/api/kaspa/KaspaSignTransaction.d.ts +19 -0
- package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -0
- package/dist/api/kaspa/helpers/BufferWriter.d.ts +28 -0
- package/dist/api/kaspa/helpers/BufferWriter.d.ts.map +1 -0
- package/dist/api/kaspa/helpers/HashWriter.d.ts +22 -0
- package/dist/api/kaspa/helpers/HashWriter.d.ts.map +1 -0
- package/dist/api/kaspa/helpers/SignatureType.d.ts +8 -0
- package/dist/api/kaspa/helpers/SignatureType.d.ts.map +1 -0
- package/dist/api/kaspa/helpers/TransferSerialize.d.ts +9 -0
- package/dist/api/kaspa/helpers/TransferSerialize.d.ts.map +1 -0
- package/dist/index.d.ts +61 -4
- package/dist/index.js +467 -1
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +2 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +4 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/kaspaGetAddress.d.ts +16 -0
- package/dist/types/api/kaspaGetAddress.d.ts.map +1 -0
- package/dist/types/api/kaspaSignTransaction.d.ts +35 -0
- package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -0
- package/dist/types/api/suiGetAddress.d.ts +2 -2
- package/dist/types/api/suiGetAddress.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/index.ts +3 -0
- package/src/api/kaspa/KaspaGetAddress.ts +77 -0
- package/src/api/kaspa/KaspaSignTransaction.ts +157 -0
- package/src/api/kaspa/helpers/BufferWriter.ts +177 -0
- package/src/api/kaspa/helpers/HashWriter.ts +72 -0
- package/src/api/kaspa/helpers/SignatureType.ts +7 -0
- package/src/api/kaspa/helpers/TransferSerialize.ts +143 -0
- package/src/inject.ts +5 -0
- package/src/types/api/export.ts +8 -0
- package/src/types/api/index.ts +9 -0
- package/src/types/api/kaspaGetAddress.ts +25 -0
- package/src/types/api/kaspaSignTransaction.ts +43 -0
- package/src/types/api/suiGetAddress.ts +2 -2
package/src/types/api/index.ts
CHANGED
|
@@ -104,6 +104,9 @@ import { filecoinSignTransaction } from './filecoinSignTransaction';
|
|
|
104
104
|
import { polkadotGetAddress } from './polkadotGetAddress';
|
|
105
105
|
import { polkadotSignTransaction } from './polkadotSignTransaction';
|
|
106
106
|
|
|
107
|
+
import { kaspaGetAddress } from './kaspaGetAddress';
|
|
108
|
+
import { kaspaSignTransaction } from './kaspaSignTransaction';
|
|
109
|
+
|
|
107
110
|
export * from './export';
|
|
108
111
|
|
|
109
112
|
export type CoreApi = {
|
|
@@ -277,4 +280,10 @@ export type CoreApi = {
|
|
|
277
280
|
*/
|
|
278
281
|
polkadotGetAddress: typeof polkadotGetAddress;
|
|
279
282
|
polkadotSignTransaction: typeof polkadotSignTransaction;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Kaspa function
|
|
286
|
+
*/
|
|
287
|
+
kaspaGetAddress: typeof kaspaGetAddress;
|
|
288
|
+
kaspaSignTransaction: typeof kaspaSignTransaction;
|
|
280
289
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { KaspaAddress as HardwareKaspaAddress } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type KaspaAddress = {
|
|
5
|
+
path: string;
|
|
6
|
+
} & HardwareKaspaAddress;
|
|
7
|
+
|
|
8
|
+
export type KaspaGetAddressParams = {
|
|
9
|
+
path: string | number[];
|
|
10
|
+
prefix?: string;
|
|
11
|
+
scheme?: string;
|
|
12
|
+
showOnOneKey?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export declare function kaspaGetAddress(
|
|
16
|
+
connectId: string,
|
|
17
|
+
deviceId: string,
|
|
18
|
+
params: CommonParams & KaspaGetAddressParams
|
|
19
|
+
): Response<KaspaAddress>;
|
|
20
|
+
|
|
21
|
+
export declare function kaspaGetAddress(
|
|
22
|
+
connectId: string,
|
|
23
|
+
deviceId: string,
|
|
24
|
+
params: CommonParams & { bundle?: KaspaGetAddressParams[] }
|
|
25
|
+
): Response<Array<KaspaAddress>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SignatureType } from '../../api/kaspa/helpers/SignatureType';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type KaspaSignature = {
|
|
5
|
+
index: number;
|
|
6
|
+
signature: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type KaspaSignInputParams = {
|
|
10
|
+
path: string | number[];
|
|
11
|
+
prevTxId: string;
|
|
12
|
+
outputIndex: number;
|
|
13
|
+
sequenceNumber: number | string;
|
|
14
|
+
output: {
|
|
15
|
+
satoshis: number | string;
|
|
16
|
+
script: string;
|
|
17
|
+
};
|
|
18
|
+
sigOpCount?: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type KaspaSignOutputParams = {
|
|
22
|
+
satoshis: number | string;
|
|
23
|
+
script: string;
|
|
24
|
+
scriptVersion: number;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type KaspaSignTransactionParams = {
|
|
28
|
+
version: number;
|
|
29
|
+
inputs: KaspaSignInputParams[];
|
|
30
|
+
outputs: KaspaSignOutputParams[];
|
|
31
|
+
lockTime: number | string;
|
|
32
|
+
sigHashType?: SignatureType;
|
|
33
|
+
sigOpCount?: number;
|
|
34
|
+
subNetworkID?: string;
|
|
35
|
+
scheme?: string;
|
|
36
|
+
prefix?: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export declare function kaspaSignTransaction(
|
|
40
|
+
connectId: string,
|
|
41
|
+
deviceId: string,
|
|
42
|
+
params: CommonParams & KaspaSignTransactionParams
|
|
43
|
+
): Response<KaspaSignature[]>;
|
|
@@ -14,11 +14,11 @@ export type SuiGetAddressParams = {
|
|
|
14
14
|
export declare function suiGetAddress(
|
|
15
15
|
connectId: string,
|
|
16
16
|
deviceId: string,
|
|
17
|
-
params: CommonParams &
|
|
17
|
+
params: CommonParams & SuiGetAddressParams
|
|
18
18
|
): Response<SuiAddress>;
|
|
19
19
|
|
|
20
20
|
export declare function suiGetAddress(
|
|
21
21
|
connectId: string,
|
|
22
22
|
deviceId: string,
|
|
23
|
-
params: CommonParams & { bundle?:
|
|
23
|
+
params: CommonParams & { bundle?: SuiGetAddressParams[] }
|
|
24
24
|
): Response<Array<SuiAddress>>;
|