@onekeyfe/hd-core 1.0.30 → 1.0.31-alpha.0
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/cardano/CardanoSignMessage.d.ts +5 -0
- package/dist/api/cardano/CardanoSignMessage.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -0
- package/dist/types/api/cardanoSignMessage.d.ts +3 -0
- package/dist/types/api/cardanoSignMessage.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/cardano/CardanoSignMessage.ts +15 -0
- package/src/types/api/cardanoSignMessage.ts +3 -0
|
@@ -9,6 +9,11 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
|
|
|
9
9
|
min: string;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
+
getAddressTypeVersionRange(): {
|
|
13
|
+
pro: {
|
|
14
|
+
min: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
12
17
|
run(): Promise<import("packages/hd-transport/dist").CardanoMessageSignature>;
|
|
13
18
|
}
|
|
14
19
|
//# sourceMappingURL=CardanoSignMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/cardano/CardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI;
|
|
1
|
+
{"version":3,"file":"CardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/cardano/CardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI;IA2BJ,eAAe;;;;;IAQf,0BAA0B;;;;;IAQpB,GAAG;CAcV"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1684,6 +1684,7 @@ type CardanoSignMessageMethodParams = {
|
|
|
1684
1684
|
message: string;
|
|
1685
1685
|
derivationType: number;
|
|
1686
1686
|
networkId: number;
|
|
1687
|
+
addressType?: Messages.CardanoAddressType;
|
|
1687
1688
|
};
|
|
1688
1689
|
declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
|
|
1689
1690
|
|
package/dist/index.js
CHANGED
|
@@ -35282,6 +35282,7 @@ class CardanoSignMessage extends BaseMethod {
|
|
|
35282
35282
|
{ name: 'message', type: 'string', required: true },
|
|
35283
35283
|
{ name: 'derivationType', type: 'number' },
|
|
35284
35284
|
{ name: 'networkId', type: 'number', required: true },
|
|
35285
|
+
{ name: 'addressType', type: 'number' },
|
|
35285
35286
|
]);
|
|
35286
35287
|
const addressN = validatePath(payload.path, 3);
|
|
35287
35288
|
this.params = {
|
|
@@ -35291,6 +35292,7 @@ class CardanoSignMessage extends BaseMethod {
|
|
|
35291
35292
|
? payload.derivationType
|
|
35292
35293
|
: hdTransport.Messages.CardanoDerivationType.ICARUS,
|
|
35293
35294
|
network_id: payload.networkId,
|
|
35295
|
+
address_type: payload.addressType,
|
|
35294
35296
|
};
|
|
35295
35297
|
}
|
|
35296
35298
|
getVersionRange() {
|
|
@@ -35300,8 +35302,16 @@ class CardanoSignMessage extends BaseMethod {
|
|
|
35300
35302
|
},
|
|
35301
35303
|
};
|
|
35302
35304
|
}
|
|
35305
|
+
getAddressTypeVersionRange() {
|
|
35306
|
+
return {
|
|
35307
|
+
pro: {
|
|
35308
|
+
min: '4.9.3',
|
|
35309
|
+
},
|
|
35310
|
+
};
|
|
35311
|
+
}
|
|
35303
35312
|
run() {
|
|
35304
35313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35314
|
+
this.checkFeatureVersionLimit(() => this.params.address_type !== null && this.params.address_type !== undefined, () => this.getAddressTypeVersionRange());
|
|
35305
35315
|
const res = yield this.device.commands.typedCall('CardanoSignMessage', 'CardanoMessageSignature', this.params);
|
|
35306
35316
|
return res.message;
|
|
35307
35317
|
});
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import type { CardanoMessageSignature } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
|
+
import { PROTO } from '../../constants';
|
|
3
4
|
export type CardanoSignMessageParams = {
|
|
4
5
|
address_n: number[];
|
|
5
6
|
message: string;
|
|
6
7
|
derivation_type: number;
|
|
7
8
|
network_id: number;
|
|
9
|
+
address_type: number;
|
|
8
10
|
};
|
|
9
11
|
export type CardanoSignMessageMethodParams = {
|
|
10
12
|
path: string;
|
|
11
13
|
message: string;
|
|
12
14
|
derivationType: number;
|
|
13
15
|
networkId: number;
|
|
16
|
+
addressType?: PROTO.CardanoAddressType;
|
|
14
17
|
};
|
|
15
18
|
export declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
|
|
16
19
|
//# sourceMappingURL=cardanoSignMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/cardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/cardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC;CACxC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,8BAA8B,GACpD,QAAQ,CAAC,uBAAuB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31-alpha.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "^1.0.
|
|
29
|
-
"@onekeyfe/hd-transport": "^1.0.
|
|
28
|
+
"@onekeyfe/hd-shared": "^1.0.31-alpha.0",
|
|
29
|
+
"@onekeyfe/hd-transport": "^1.0.31-alpha.0",
|
|
30
30
|
"axios": "^0.27.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"bytebuffer": "^5.0.1",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/web-bluetooth": "^0.0.21",
|
|
47
47
|
"ripple-keypairs": "^1.1.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "7db41b56eb68c7d30dceacce450c91a653ec3a5f"
|
|
50
50
|
}
|
|
@@ -20,6 +20,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
|
|
|
20
20
|
{ name: 'message', type: 'string', required: true },
|
|
21
21
|
{ name: 'derivationType', type: 'number' },
|
|
22
22
|
{ name: 'networkId', type: 'number', required: true },
|
|
23
|
+
{ name: 'addressType', type: 'number' },
|
|
23
24
|
]);
|
|
24
25
|
|
|
25
26
|
const addressN = validatePath(payload.path, 3);
|
|
@@ -32,6 +33,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
|
|
|
32
33
|
? payload.derivationType
|
|
33
34
|
: PROTO.CardanoDerivationType.ICARUS,
|
|
34
35
|
network_id: payload.networkId,
|
|
36
|
+
address_type: payload.addressType,
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -43,7 +45,20 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
|
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
getAddressTypeVersionRange() {
|
|
49
|
+
return {
|
|
50
|
+
pro: {
|
|
51
|
+
min: '4.9.3',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
async run() {
|
|
57
|
+
this.checkFeatureVersionLimit(
|
|
58
|
+
() => this.params.address_type !== null && this.params.address_type !== undefined,
|
|
59
|
+
() => this.getAddressTypeVersionRange()
|
|
60
|
+
);
|
|
61
|
+
|
|
47
62
|
const res = await this.device.commands.typedCall(
|
|
48
63
|
'CardanoSignMessage',
|
|
49
64
|
'CardanoMessageSignature',
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { CardanoMessageSignature } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
|
+
import { PROTO } from '../../constants';
|
|
3
4
|
|
|
4
5
|
export type CardanoSignMessageParams = {
|
|
5
6
|
address_n: number[];
|
|
6
7
|
message: string;
|
|
7
8
|
derivation_type: number;
|
|
8
9
|
network_id: number;
|
|
10
|
+
address_type: number;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export type CardanoSignMessageMethodParams = {
|
|
@@ -13,6 +15,7 @@ export type CardanoSignMessageMethodParams = {
|
|
|
13
15
|
message: string;
|
|
14
16
|
derivationType: number;
|
|
15
17
|
networkId: number;
|
|
18
|
+
addressType?: PROTO.CardanoAddressType;
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
export declare function cardanoSignMessage(
|