@onekeyfe/hd-core 0.2.43 → 0.2.44
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/BaseMethod.d.ts +4 -0
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/algo/AlgoGetAddress.d.ts.map +1 -1
- package/dist/api/aptos/AptosGetAddress.d.ts +1 -0
- package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
- package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxGetAddress.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosGetAddress.d.ts.map +1 -1
- package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
- package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -1
- package/dist/api/near/NearGetAddress.d.ts.map +1 -1
- package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
- package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
- package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
- package/dist/api/sui/SuiGetAddress.d.ts +1 -0
- package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
- package/dist/api/tron/TronGetAddress.d.ts.map +1 -1
- package/dist/api/xrp/XrpGetAddress.d.ts +1 -0
- package/dist/api/xrp/XrpGetAddress.d.ts.map +1 -1
- package/dist/constants/ui-request.d.ts +1 -0
- package/dist/constants/ui-request.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +12 -1
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +105 -30
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +12 -2
- package/src/api/algo/AlgoGetAddress.ts +4 -3
- package/src/api/aptos/AptosGetAddress.ts +11 -3
- package/src/api/btc/BTCGetAddress.ts +7 -1
- package/src/api/cardano/CardanoGetAddress.ts +7 -1
- package/src/api/conflux/ConfluxGetAddress.ts +7 -1
- package/src/api/cosmos/CosmosGetAddress.ts +4 -2
- package/src/api/evm/EVMGetAddress.ts +4 -2
- package/src/api/filecoin/FilecoinGetAddress.ts +4 -2
- package/src/api/near/NearGetAddress.ts +4 -2
- package/src/api/nem/NEMGetAddress.ts +6 -1
- package/src/api/polkadot/PolkadotGetAddress.ts +7 -1
- package/src/api/solana/SolGetAddress.ts +5 -2
- package/src/api/starcoin/StarcoinGetAddress.ts +7 -1
- package/src/api/stellar/StellarGetAddress.ts +5 -2
- package/src/api/sui/SuiGetAddress.ts +11 -3
- package/src/api/tron/TronGetAddress.ts +4 -2
- package/src/api/xrp/XrpGetAddress.ts +14 -2
- package/src/constants/ui-request.ts +2 -0
- package/src/events/ui-request.ts +15 -1
package/dist/api/BaseMethod.d.ts
CHANGED
|
@@ -32,5 +32,9 @@ export declare abstract class BaseMethod<Params = undefined> {
|
|
|
32
32
|
checkDeviceSupportFeature(): void;
|
|
33
33
|
checkSafetyLevelOnTestNet(): Promise<void>;
|
|
34
34
|
dispose(): void;
|
|
35
|
+
postPreviousAddressMessage: (data: {
|
|
36
|
+
address?: string;
|
|
37
|
+
path?: string;
|
|
38
|
+
}) => void;
|
|
35
39
|
}
|
|
36
40
|
//# sourceMappingURL=BaseMethod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,WAAW,EAA4D,MAAM,WAAW,CAAC;AAMlG,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAKnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAK7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAKtB,wBAAwB,UAAQ;IAMhC,oBAAoB,UAAS;IAG7B,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;gBAEhC,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,oBAAoB;IAkBpB,yBAAyB;IAiBnB,yBAAyB;IAkB/B,OAAO;IAGP,0BAA0B,SAAU;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UAOrE;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlgoGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/algo/AlgoGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IA6BJ,eAAe;;;;;IAQT,GAAG;
|
|
1
|
+
{"version":3,"file":"AlgoGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/algo/AlgoGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAwB,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IA6BJ,eAAe;;;;;IAQT,GAAG;CAqBV"}
|
|
@@ -3,6 +3,7 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
3
3
|
import { AptosAddress } from '../../types';
|
|
4
4
|
export default class AptosGetAddress extends BaseMethod<HardwareAptosGetAddress[]> {
|
|
5
5
|
hasBundle: boolean;
|
|
6
|
+
shouldConfirm: boolean;
|
|
6
7
|
init(): void;
|
|
7
8
|
publicKeyToAddress(publicKey: string): string;
|
|
8
9
|
getVersionRange(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AptosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/aptos/AptosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAMpF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAIlE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,uBAAuB,EAAE,CAAC;IAChF,SAAS,UAAS;IAElB,IAAI;
|
|
1
|
+
{"version":3,"file":"AptosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/aptos/AptosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAMpF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAyB,MAAM,aAAa,CAAC;AAIlE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,uBAAuB,EAAE,CAAC;IAChF,SAAS,UAAS;IAElB,aAAa,UAAS;IAEtB,IAAI;IAiCJ,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAOpC,eAAe;;;;;IAQT,GAAG;CAkCV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BTCGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAGhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;IACjE,SAAS,UAAS;IAElB,IAAI;IA6CE,GAAG;
|
|
1
|
+
{"version":3,"file":"BTCGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAGhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;IACjE,SAAS,UAAS;IAElB,IAAI;IA6CE,GAAG;CAwBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardanoGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cardano/CardanoGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,uBAAuB,EAAE,CAAC;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI;IAmCJ,eAAe;;;;;;;;IAWT,GAAG;
|
|
1
|
+
{"version":3,"file":"CardanoGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cardano/CardanoGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,uBAAuB,EAAE,CAAC;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI;IAmCJ,eAAe;;;;;;;;IAWT,GAAG;CAmEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfluxGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/conflux/ConfluxGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,cAAc,EAA2B,MAAM,mCAAmC,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA8BJ,eAAe;;;;;IAQT,GAAG;
|
|
1
|
+
{"version":3,"file":"ConfluxGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/conflux/ConfluxGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,cAAc,EAA2B,MAAM,mCAAmC,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA8BJ,eAAe;;;;;IAQT,GAAG;CAwBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAgCJ,eAAe;;;;;;;;IAWT,GAAG;
|
|
1
|
+
{"version":3,"file":"CosmosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAgCJ,eAAe;;;;;;;;IAWT,GAAG;CAsBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EVMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACzE,SAAS,UAAS;IAElB,IAAI;IA+BE,GAAG;
|
|
1
|
+
{"version":3,"file":"EVMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACzE,SAAS,UAAS;IAElB,IAAI;IA+BE,GAAG;CAsBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilecoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/filecoin/FilecoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA+BJ,eAAe;;;;;;;;IAWT,GAAG;
|
|
1
|
+
{"version":3,"file":"FilecoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/filecoin/FilecoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA+BJ,eAAe;;;;;;;;IAWT,GAAG;CAsBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NearGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/near/NearGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IA6BJ,eAAe;;;;;IAQT,GAAG;
|
|
1
|
+
{"version":3,"file":"NearGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/near/NearGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IA6BJ,eAAe;;;;;IAQT,GAAG;CAsBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NEMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/nem/NEMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAI9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC5E,SAAS,UAAS;IAElB,IAAI;IA+BE,GAAG;
|
|
1
|
+
{"version":3,"file":"NEMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/nem/NEMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAI9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC5E,SAAS,UAAS;IAElB,IAAI;IA+BE,GAAG;CAuBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolkadotGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/polkadot/PolkadotGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IAkCJ,eAAe;;;;;;;;IAWT,GAAG;
|
|
1
|
+
{"version":3,"file":"PolkadotGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/polkadot/PolkadotGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IAkCJ,eAAe;;;;;;;;IAWT,GAAG;CA2BV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/solana/SolGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,gBAAgB,EAAE,CAAC;IACvE,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;
|
|
1
|
+
{"version":3,"file":"SolGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/solana/SolGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,gBAAgB,EAAE,CAAC;IACvE,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAuBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarcoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,oCAAoC,CAAC;AAE/F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;
|
|
1
|
+
{"version":3,"file":"StarcoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,oCAAoC,CAAC;AAE/F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAwBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StellarGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAA2B,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;
|
|
1
|
+
{"version":3,"file":"StellarGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAA2B,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAuBV"}
|
|
@@ -3,6 +3,7 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
3
3
|
import { SuiAddress } from '../../types';
|
|
4
4
|
export default class SuiGetAddress extends BaseMethod<HardwareSuiGetAddress[]> {
|
|
5
5
|
hasBundle: boolean;
|
|
6
|
+
shouldConfirm: boolean;
|
|
6
7
|
init(): void;
|
|
7
8
|
publicKeyToAddress(publicKey: string): string;
|
|
8
9
|
getVersionRange(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuiGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/sui/SuiGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAMhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAI9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC5E,SAAS,UAAS;IAElB,IAAI;
|
|
1
|
+
{"version":3,"file":"SuiGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/sui/SuiGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAMhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAI9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC5E,SAAS,UAAS;IAElB,aAAa,UAAS;IAEtB,IAAI;IAiCJ,kBAAkB,CAAC,SAAS,EAAE,MAAM;IASpC,eAAe;;;;;;;;IAWT,GAAG;CAkCV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TronGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/tron/TronGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IA6BJ,eAAe;;;;;IAQT,GAAG;
|
|
1
|
+
{"version":3,"file":"TronGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/tron/TronGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAwB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IA6BJ,eAAe;;;;;IAQT,GAAG;CAsBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/xrp/XrpGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CACnD;IACE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB,EAAE,CACJ;IACC,SAAS,UAAS;IAElB,IAAI;
|
|
1
|
+
{"version":3,"file":"XrpGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/xrp/XrpGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CACnD;IACE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB,EAAE,CACJ;IACC,SAAS,UAAS;IAElB,aAAa,UAAS;IAEtB,IAAI;IA+BJ,eAAe;;;;;IAQT,GAAG;CA+CV"}
|
|
@@ -10,5 +10,6 @@ export declare const UI_REQUEST: {
|
|
|
10
10
|
readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed";
|
|
11
11
|
readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
|
|
12
12
|
readonly FIRMWARE_TIP: "ui-firmware-tip";
|
|
13
|
+
readonly PREVIOUS_ADDRESS_RESULT: "ui-previous_address_result";
|
|
13
14
|
};
|
|
14
15
|
//# sourceMappingURL=ui-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/constants/ui-request.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/constants/ui-request.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAeb,CAAC"}
|
|
@@ -16,6 +16,7 @@ export declare const UI_REQUEST: {
|
|
|
16
16
|
readonly FIRMWARE_PROGRESS: "ui-firmware-progress";
|
|
17
17
|
readonly FIRMWARE_TIP: "ui-firmware-tip";
|
|
18
18
|
readonly NOT_IN_BOOTLOADER: "ui-device_not_in_bootloader_mode";
|
|
19
|
+
readonly PREVIOUS_ADDRESS_RESULT: "ui-previous_address_result";
|
|
19
20
|
};
|
|
20
21
|
export interface UiRequestWithoutPayload {
|
|
21
22
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION;
|
|
@@ -62,7 +63,17 @@ export interface FirmwareTip {
|
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
|
-
export
|
|
66
|
+
export interface PreviousAddressResult {
|
|
67
|
+
type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
|
|
68
|
+
payload: {
|
|
69
|
+
device: Device;
|
|
70
|
+
data: {
|
|
71
|
+
address?: string;
|
|
72
|
+
path?: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export declare type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | FirmwareProgress | FirmwareTip | PreviousAddressResult;
|
|
66
77
|
export declare type UiEventMessage = UiEvent & {
|
|
67
78
|
event: typeof UI_EVENT;
|
|
68
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/events/ui-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/events/ui-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAmBb,CAAC;AAEX,MAAM,WAAW,uBAAuB;IACtC,IAAI,EACA,OAAO,UAAU,CAAC,eAAe,GACjC,OAAO,UAAU,CAAC,oBAAoB,GACtC,OAAO,UAAU,CAAC,mBAAmB,GACrC,OAAO,UAAU,CAAC,2BAA2B,CAAC;IAClD,OAAO,CAAC,EAAE,OAAO,SAAS,CAAC;CAC5B;AAED,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,OAAO,UAAU,CAAC,WAAW,CAAC;IACpC,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,KAAK,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;KAC9D,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,UAAU,CAAC,cAAc,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,UAAU,CAAC,kBAAkB,CAAC;IAC3C,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,OAAO,UAAU,CAAC,4BAA4B,CAAC;IACrD,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,UAAU,CAAC,iBAAiB,CAAC;IAC1C,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,UAAU,CAAC,YAAY,CAAC;IACrC,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,UAAU,CAAC,uBAAuB,CAAC;IAChD,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE;YACJ,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;CACH;AAED,oBAAY,OAAO,GACf,uBAAuB,GACvB,qBAAqB,GACrB,eAAe,GACf,2BAA2B,GAC3B,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,qBAAqB,CAAC;AAE1B,oBAAY,cAAc,GAAG,OAAO,GAAG;IAAE,KAAK,EAAE,OAAO,QAAQ,CAAA;CAAE,CAAC;AAElE,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,OAAO,QAAQ,EAAE,OAAO,CAK5D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1691,6 +1691,7 @@ declare const UI_REQUEST: {
|
|
|
1691
1691
|
readonly FIRMWARE_PROGRESS: "ui-firmware-progress";
|
|
1692
1692
|
readonly FIRMWARE_TIP: "ui-firmware-tip";
|
|
1693
1693
|
readonly NOT_IN_BOOTLOADER: "ui-device_not_in_bootloader_mode";
|
|
1694
|
+
readonly PREVIOUS_ADDRESS_RESULT: "ui-previous_address_result";
|
|
1694
1695
|
};
|
|
1695
1696
|
interface UiRequestWithoutPayload {
|
|
1696
1697
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION;
|
|
@@ -1737,7 +1738,17 @@ interface FirmwareTip {
|
|
|
1737
1738
|
};
|
|
1738
1739
|
};
|
|
1739
1740
|
}
|
|
1740
|
-
|
|
1741
|
+
interface PreviousAddressResult {
|
|
1742
|
+
type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
|
|
1743
|
+
payload: {
|
|
1744
|
+
device: Device$1;
|
|
1745
|
+
data: {
|
|
1746
|
+
address?: string;
|
|
1747
|
+
path?: string;
|
|
1748
|
+
};
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
declare type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | FirmwareProgress | FirmwareTip | PreviousAddressResult;
|
|
1741
1752
|
declare type UiEventMessage = UiEvent & {
|
|
1742
1753
|
event: typeof UI_EVENT;
|
|
1743
1754
|
};
|
|
@@ -2168,4 +2179,4 @@ declare class DataManager {
|
|
|
2168
2179
|
|
|
2169
2180
|
declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, }: InjectApi) => CoreApi;
|
|
2170
2181
|
|
|
2171
|
-
export { AccountAddress, AccountAddresses, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceUploadResourceParams, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease$1 as FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, Params, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TransactionOptions, TransportReleaseStatus, TronAddress, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBoot, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getFirmwareUpdateField, getHDPath, getHomeScreenHex, getLog, getLogger, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, versionCompare, versionSplit, wait };
|
|
2182
|
+
export { AccountAddress, AccountAddresses, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceUploadResourceParams, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease$1 as FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, Params, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TransactionOptions, TransportReleaseStatus, TronAddress, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBoot, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getFirmwareUpdateField, getHDPath, getHomeScreenHex, getLog, getLogger, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, versionCompare, versionSplit, wait };
|
package/dist/index.js
CHANGED
|
@@ -11521,6 +11521,7 @@ const UI_REQUEST$1 = {
|
|
|
11521
11521
|
FIRMWARE_PROGRESS: 'ui-firmware-progress',
|
|
11522
11522
|
FIRMWARE_TIP: 'ui-firmware-tip',
|
|
11523
11523
|
NOT_IN_BOOTLOADER: 'ui-device_not_in_bootloader_mode',
|
|
11524
|
+
PREVIOUS_ADDRESS_RESULT: 'ui-previous_address_result',
|
|
11524
11525
|
};
|
|
11525
11526
|
const createUiMessage = (type, payload) => ({
|
|
11526
11527
|
event: UI_EVENT,
|
|
@@ -12096,6 +12097,7 @@ const UI_REQUEST = {
|
|
|
12096
12097
|
FIRMWARE_NOT_INSTALLED: 'ui-device_firmware_not_installed',
|
|
12097
12098
|
NOT_USE_ONEKEY_DEVICE: 'ui-device_please_use_onekey_device',
|
|
12098
12099
|
FIRMWARE_TIP: 'ui-firmware-tip',
|
|
12100
|
+
PREVIOUS_ADDRESS_RESULT: 'ui-previous_address_result',
|
|
12099
12101
|
};
|
|
12100
12102
|
|
|
12101
12103
|
const parseRunOptions = (options) => {
|
|
@@ -12582,6 +12584,12 @@ class BaseMethod {
|
|
|
12582
12584
|
this.checkDeviceId = false;
|
|
12583
12585
|
this.useDevicePassphraseState = true;
|
|
12584
12586
|
this.skipForceUpdateCheck = false;
|
|
12587
|
+
this.postPreviousAddressMessage = (data) => {
|
|
12588
|
+
this.postMessage(createUiMessage(UI_REQUEST.PREVIOUS_ADDRESS_RESULT, {
|
|
12589
|
+
device: this.device.toMessageObject(),
|
|
12590
|
+
data,
|
|
12591
|
+
}));
|
|
12592
|
+
};
|
|
12585
12593
|
const { payload } = message;
|
|
12586
12594
|
this.name = payload.method;
|
|
12587
12595
|
this.payload = payload;
|
|
@@ -14204,7 +14212,12 @@ class BTCGetAddress extends BaseMethod {
|
|
|
14204
14212
|
for (let i = 0; i < this.params.length; i++) {
|
|
14205
14213
|
const param = this.params[i];
|
|
14206
14214
|
const res = yield this.device.commands.typedCall('GetAddress', 'Address', Object.assign({}, param));
|
|
14207
|
-
|
|
14215
|
+
const path = serializedPath(param.address_n);
|
|
14216
|
+
responses.push(Object.assign({ path }, res.message));
|
|
14217
|
+
this.postPreviousAddressMessage({
|
|
14218
|
+
address: res.message.address,
|
|
14219
|
+
path,
|
|
14220
|
+
});
|
|
14208
14221
|
}
|
|
14209
14222
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
14210
14223
|
});
|
|
@@ -14733,7 +14746,12 @@ class ConfluxGetAddress extends BaseMethod {
|
|
|
14733
14746
|
for (let i = 0; i < this.params.length; i++) {
|
|
14734
14747
|
const param = this.params[i];
|
|
14735
14748
|
const res = yield this.device.commands.typedCall('ConfluxGetAddress', 'ConfluxAddress', Object.assign({}, param));
|
|
14736
|
-
|
|
14749
|
+
const path = serializedPath(param.address_n);
|
|
14750
|
+
responses.push(Object.assign({ path }, res.message));
|
|
14751
|
+
this.postPreviousAddressMessage({
|
|
14752
|
+
path,
|
|
14753
|
+
address: res.message.address,
|
|
14754
|
+
});
|
|
14737
14755
|
}
|
|
14738
14756
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
14739
14757
|
});
|
|
@@ -14933,10 +14951,12 @@ class EvmGetAddress extends BaseMethod {
|
|
|
14933
14951
|
const param = this.params[i];
|
|
14934
14952
|
const res = yield this.device.commands.typedCall('EthereumGetAddress', 'EthereumAddress', Object.assign({}, param));
|
|
14935
14953
|
const { address } = res.message;
|
|
14936
|
-
|
|
14954
|
+
const result = {
|
|
14937
14955
|
path: serializedPath(param.address_n),
|
|
14938
14956
|
address,
|
|
14939
|
-
}
|
|
14957
|
+
};
|
|
14958
|
+
responses.push(result);
|
|
14959
|
+
this.postPreviousAddressMessage(result);
|
|
14940
14960
|
}
|
|
14941
14961
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
14942
14962
|
});
|
|
@@ -15565,7 +15585,12 @@ class StarcoinGetAddress extends BaseMethod {
|
|
|
15565
15585
|
for (let i = 0; i < this.params.length; i++) {
|
|
15566
15586
|
const param = this.params[i];
|
|
15567
15587
|
const res = yield this.device.commands.typedCall('StarcoinGetAddress', 'StarcoinAddress', Object.assign({}, param));
|
|
15568
|
-
|
|
15588
|
+
const path = serializedPath(param.address_n);
|
|
15589
|
+
responses.push(Object.assign({ path }, res.message));
|
|
15590
|
+
this.postPreviousAddressMessage({
|
|
15591
|
+
path,
|
|
15592
|
+
address: res.message.address,
|
|
15593
|
+
});
|
|
15569
15594
|
}
|
|
15570
15595
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
15571
15596
|
});
|
|
@@ -15718,7 +15743,12 @@ class NEMGetAddress extends BaseMethod {
|
|
|
15718
15743
|
for (let i = 0; i < this.params.length; i++) {
|
|
15719
15744
|
const param = this.params[i];
|
|
15720
15745
|
const res = yield this.device.commands.typedCall('NEMGetAddress', 'NEMAddress', Object.assign({}, param));
|
|
15721
|
-
|
|
15746
|
+
const path = serializedPath(param.address_n);
|
|
15747
|
+
responses.push(Object.assign({ path }, res.message));
|
|
15748
|
+
this.postPreviousAddressMessage({
|
|
15749
|
+
path,
|
|
15750
|
+
address: res.message.address,
|
|
15751
|
+
});
|
|
15722
15752
|
}
|
|
15723
15753
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
15724
15754
|
});
|
|
@@ -15949,10 +15979,12 @@ class SolGetAddress extends BaseMethod {
|
|
|
15949
15979
|
const param = this.params[i];
|
|
15950
15980
|
const res = yield this.device.commands.typedCall('SolanaGetAddress', 'SolanaAddress', Object.assign({}, param));
|
|
15951
15981
|
const { address } = res.message;
|
|
15952
|
-
|
|
15982
|
+
const result = {
|
|
15953
15983
|
path: serializedPath(param.address_n),
|
|
15954
15984
|
address,
|
|
15955
|
-
}
|
|
15985
|
+
};
|
|
15986
|
+
responses.push(result);
|
|
15987
|
+
this.postPreviousAddressMessage(result);
|
|
15956
15988
|
}
|
|
15957
15989
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
15958
15990
|
});
|
|
@@ -16045,10 +16077,12 @@ class StellarGetAddress extends BaseMethod {
|
|
|
16045
16077
|
const param = this.params[i];
|
|
16046
16078
|
const res = yield this.device.commands.typedCall('StellarGetAddress', 'StellarAddress', Object.assign({}, param));
|
|
16047
16079
|
const { address } = res.message;
|
|
16048
|
-
|
|
16080
|
+
const result = {
|
|
16049
16081
|
path: serializedPath(param.address_n),
|
|
16050
16082
|
address,
|
|
16051
|
-
}
|
|
16083
|
+
};
|
|
16084
|
+
responses.push(result);
|
|
16085
|
+
this.postPreviousAddressMessage(result);
|
|
16052
16086
|
}
|
|
16053
16087
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16054
16088
|
});
|
|
@@ -16269,10 +16303,12 @@ class TronGetAddress extends BaseMethod {
|
|
|
16269
16303
|
const param = this.params[i];
|
|
16270
16304
|
const res = yield this.device.commands.typedCall('TronGetAddress', 'TronAddress', Object.assign({}, param));
|
|
16271
16305
|
const { address } = res.message;
|
|
16272
|
-
|
|
16306
|
+
const result = {
|
|
16273
16307
|
path: serializedPath(param.address_n),
|
|
16274
16308
|
address,
|
|
16275
|
-
}
|
|
16309
|
+
};
|
|
16310
|
+
responses.push(result);
|
|
16311
|
+
this.postPreviousAddressMessage(result);
|
|
16276
16312
|
}
|
|
16277
16313
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16278
16314
|
});
|
|
@@ -16418,10 +16454,12 @@ class NearGetAddress extends BaseMethod {
|
|
|
16418
16454
|
const param = this.params[i];
|
|
16419
16455
|
const res = yield this.device.commands.typedCall('NearGetAddress', 'NearAddress', Object.assign({}, param));
|
|
16420
16456
|
const { address } = res.message;
|
|
16421
|
-
|
|
16457
|
+
const result = {
|
|
16422
16458
|
path: serializedPath(param.address_n),
|
|
16423
16459
|
address,
|
|
16424
|
-
}
|
|
16460
|
+
};
|
|
16461
|
+
responses.push(result);
|
|
16462
|
+
this.postPreviousAddressMessage(result);
|
|
16425
16463
|
}
|
|
16426
16464
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16427
16465
|
});
|
|
@@ -16462,6 +16500,7 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16462
16500
|
constructor() {
|
|
16463
16501
|
super(...arguments);
|
|
16464
16502
|
this.hasBundle = false;
|
|
16503
|
+
this.shouldConfirm = false;
|
|
16465
16504
|
}
|
|
16466
16505
|
init() {
|
|
16467
16506
|
var _a;
|
|
@@ -16469,6 +16508,9 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16469
16508
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16470
16509
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16471
16510
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16511
|
+
this.shouldConfirm = this.hasBundle
|
|
16512
|
+
? this.payload.bundle.some((i) => !!i.showOnOneKey)
|
|
16513
|
+
: false;
|
|
16472
16514
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
16473
16515
|
this.params = [];
|
|
16474
16516
|
payload.bundle.forEach((batch) => {
|
|
@@ -16501,7 +16543,7 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16501
16543
|
run() {
|
|
16502
16544
|
var _a;
|
|
16503
16545
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16504
|
-
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features)) {
|
|
16546
|
+
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features) && !this.shouldConfirm) {
|
|
16505
16547
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
16506
16548
|
paths: this.params,
|
|
16507
16549
|
ecdsa_curve_name: 'ed25519',
|
|
@@ -16518,10 +16560,12 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16518
16560
|
const param = this.params[i];
|
|
16519
16561
|
const res = yield this.device.commands.typedCall('AptosGetAddress', 'AptosAddress', Object.assign({}, param));
|
|
16520
16562
|
const { address } = res.message;
|
|
16521
|
-
|
|
16563
|
+
const result = {
|
|
16522
16564
|
path: serializedPath(param.address_n),
|
|
16523
16565
|
address: address === null || address === void 0 ? void 0 : address.toLowerCase(),
|
|
16524
|
-
}
|
|
16566
|
+
};
|
|
16567
|
+
responses.push(result);
|
|
16568
|
+
this.postPreviousAddressMessage(result);
|
|
16525
16569
|
}
|
|
16526
16570
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16527
16571
|
});
|
|
@@ -16709,10 +16753,12 @@ class AlgoGetAddress extends BaseMethod {
|
|
|
16709
16753
|
const param = this.params[i];
|
|
16710
16754
|
const res = yield this.device.commands.typedCall('AlgorandGetAddress', 'AlgorandAddress', Object.assign({}, param));
|
|
16711
16755
|
const { address } = res.message;
|
|
16712
|
-
|
|
16756
|
+
const result = {
|
|
16713
16757
|
path: serializedPath(param.address_n),
|
|
16714
16758
|
address,
|
|
16715
|
-
}
|
|
16759
|
+
};
|
|
16760
|
+
responses.push(result);
|
|
16761
|
+
this.postPreviousAddressMessage(result);
|
|
16716
16762
|
}
|
|
16717
16763
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16718
16764
|
});
|
|
@@ -16804,10 +16850,12 @@ class CosmosGetAddress extends BaseMethod {
|
|
|
16804
16850
|
const param = this.params[i];
|
|
16805
16851
|
const res = yield this.device.commands.typedCall('CosmosGetAddress', 'CosmosAddress', Object.assign({}, param));
|
|
16806
16852
|
const { address } = res.message;
|
|
16807
|
-
|
|
16853
|
+
const result = {
|
|
16808
16854
|
path: serializedPath(param.address_n),
|
|
16809
16855
|
address,
|
|
16810
|
-
}
|
|
16856
|
+
};
|
|
16857
|
+
responses.push(result);
|
|
16858
|
+
this.postPreviousAddressMessage(result);
|
|
16811
16859
|
}
|
|
16812
16860
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16813
16861
|
});
|
|
@@ -16920,6 +16968,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16920
16968
|
constructor() {
|
|
16921
16969
|
super(...arguments);
|
|
16922
16970
|
this.hasBundle = false;
|
|
16971
|
+
this.shouldConfirm = false;
|
|
16923
16972
|
}
|
|
16924
16973
|
init() {
|
|
16925
16974
|
var _a;
|
|
@@ -16927,6 +16976,9 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16927
16976
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16928
16977
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16929
16978
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16979
|
+
this.shouldConfirm = this.hasBundle
|
|
16980
|
+
? this.payload.bundle.some((i) => !!i.showOnOneKey)
|
|
16981
|
+
: false;
|
|
16930
16982
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
16931
16983
|
this.params = [];
|
|
16932
16984
|
payload.bundle.forEach((batch) => {
|
|
@@ -16953,7 +17005,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16953
17005
|
run() {
|
|
16954
17006
|
var _a, _b, _c;
|
|
16955
17007
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16956
|
-
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features)) {
|
|
17008
|
+
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features) && !this.shouldConfirm) {
|
|
16957
17009
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
16958
17010
|
paths: this.params,
|
|
16959
17011
|
ecdsa_curve_name: 'secp256k1',
|
|
@@ -16974,11 +17026,16 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16974
17026
|
ecdsa_curve_name: 'secp256k1',
|
|
16975
17027
|
});
|
|
16976
17028
|
const { address } = res.message;
|
|
17029
|
+
const path = serializedPath(param.address_n);
|
|
16977
17030
|
responses.push({
|
|
16978
|
-
path
|
|
17031
|
+
path,
|
|
16979
17032
|
address,
|
|
16980
17033
|
publicKey: (_c = (_b = publicKey.message) === null || _b === void 0 ? void 0 : _b.public_keys) === null || _c === void 0 ? void 0 : _c[0],
|
|
16981
17034
|
});
|
|
17035
|
+
this.postPreviousAddressMessage({
|
|
17036
|
+
path,
|
|
17037
|
+
address,
|
|
17038
|
+
});
|
|
16982
17039
|
}
|
|
16983
17040
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16984
17041
|
});
|
|
@@ -17047,6 +17104,7 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17047
17104
|
constructor() {
|
|
17048
17105
|
super(...arguments);
|
|
17049
17106
|
this.hasBundle = false;
|
|
17107
|
+
this.shouldConfirm = false;
|
|
17050
17108
|
}
|
|
17051
17109
|
init() {
|
|
17052
17110
|
var _a;
|
|
@@ -17054,6 +17112,9 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17054
17112
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17055
17113
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17056
17114
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17115
|
+
this.shouldConfirm = this.hasBundle
|
|
17116
|
+
? this.payload.bundle.some((i) => !!i.showOnOneKey)
|
|
17117
|
+
: false;
|
|
17057
17118
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
17058
17119
|
this.params = [];
|
|
17059
17120
|
payload.bundle.forEach((batch) => {
|
|
@@ -17089,7 +17150,7 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17089
17150
|
run() {
|
|
17090
17151
|
var _a;
|
|
17091
17152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17092
|
-
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features)) {
|
|
17153
|
+
if (this.hasBundle && supportBatchPublicKey((_a = this.device) === null || _a === void 0 ? void 0 : _a.features) && !this.shouldConfirm) {
|
|
17093
17154
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
17094
17155
|
paths: this.params,
|
|
17095
17156
|
ecdsa_curve_name: 'ed25519',
|
|
@@ -17106,10 +17167,12 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17106
17167
|
const param = this.params[i];
|
|
17107
17168
|
const res = yield this.device.commands.typedCall('SuiGetAddress', 'SuiAddress', Object.assign({}, param));
|
|
17108
17169
|
const { address } = res.message;
|
|
17109
|
-
|
|
17170
|
+
const result = {
|
|
17110
17171
|
path: serializedPath(param.address_n),
|
|
17111
17172
|
address: address === null || address === void 0 ? void 0 : address.toLowerCase(),
|
|
17112
|
-
}
|
|
17173
|
+
};
|
|
17174
|
+
responses.push(result);
|
|
17175
|
+
this.postPreviousAddressMessage(result);
|
|
17113
17176
|
}
|
|
17114
17177
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
17115
17178
|
});
|
|
@@ -17356,16 +17419,21 @@ class CardanoGetAddress extends BaseMethod {
|
|
|
17356
17419
|
});
|
|
17357
17420
|
stakeAddress = stakeAddressRes.message.address;
|
|
17358
17421
|
}
|
|
17422
|
+
const path = serializedPath(batch.address_parameters.address_n);
|
|
17359
17423
|
responses.push({
|
|
17360
17424
|
addressParameters: addressParametersFromProto(batch.address_parameters),
|
|
17361
17425
|
protocolMagic: batch.protocol_magic,
|
|
17362
17426
|
networkId: batch.network_id,
|
|
17363
|
-
serializedPath:
|
|
17427
|
+
serializedPath: path,
|
|
17364
17428
|
serializedStakingPath: serializedPath(batch.address_parameters.address_n_staking),
|
|
17365
17429
|
address: response.message.address,
|
|
17366
17430
|
xpub,
|
|
17367
17431
|
stakeAddress,
|
|
17368
17432
|
});
|
|
17433
|
+
this.postPreviousAddressMessage({
|
|
17434
|
+
path,
|
|
17435
|
+
address: response.message.address,
|
|
17436
|
+
});
|
|
17369
17437
|
}
|
|
17370
17438
|
return this.hasBundle ? responses : responses[0];
|
|
17371
17439
|
});
|
|
@@ -18130,10 +18198,12 @@ class FilecoinGetAddress extends BaseMethod {
|
|
|
18130
18198
|
const param = this.params[i];
|
|
18131
18199
|
const res = yield this.device.commands.typedCall('FilecoinGetAddress', 'FilecoinAddress', Object.assign({}, param));
|
|
18132
18200
|
const { address } = res.message;
|
|
18133
|
-
|
|
18201
|
+
const result = {
|
|
18134
18202
|
path: serializedPath(param.address_n),
|
|
18135
18203
|
address,
|
|
18136
|
-
}
|
|
18204
|
+
};
|
|
18205
|
+
responses.push(result);
|
|
18206
|
+
this.postPreviousAddressMessage(result);
|
|
18137
18207
|
}
|
|
18138
18208
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
18139
18209
|
});
|
|
@@ -18232,11 +18302,16 @@ class PolkadotGetAddress extends BaseMethod {
|
|
|
18232
18302
|
const param = this.params[i];
|
|
18233
18303
|
const res = yield this.device.commands.typedCall('PolkadotGetAddress', 'PolkadotAddress', Object.assign({}, param));
|
|
18234
18304
|
const { address, public_key } = res.message;
|
|
18305
|
+
const path = serializedPath(param.address_n);
|
|
18235
18306
|
responses.push({
|
|
18236
|
-
path
|
|
18307
|
+
path,
|
|
18237
18308
|
address,
|
|
18238
18309
|
publicKey: public_key !== null && public_key !== void 0 ? public_key : '',
|
|
18239
18310
|
});
|
|
18311
|
+
this.postPreviousAddressMessage({
|
|
18312
|
+
path,
|
|
18313
|
+
address,
|
|
18314
|
+
});
|
|
18240
18315
|
}
|
|
18241
18316
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
18242
18317
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.44",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onekeyfe/hd-shared": "^0.2.
|
|
28
|
-
"@onekeyfe/hd-transport": "^0.2.
|
|
27
|
+
"@onekeyfe/hd-shared": "^0.2.44",
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.2.44",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"bignumber.js": "^9.0.2",
|
|
31
31
|
"bytebuffer": "^5.0.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@types/semver": "^7.3.9",
|
|
44
44
|
"ripple-keypairs": "^1.1.4"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "dae6e809970f54643948117040e35c9c14c437f9"
|
|
47
47
|
}
|
package/src/api/BaseMethod.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { createDeviceMessage } from '../events/device';
|
|
|
7
7
|
import { UI_REQUEST } from '../constants/ui-request';
|
|
8
8
|
import { Device } from '../device/Device';
|
|
9
9
|
import DeviceConnector from '../device/DeviceConnector';
|
|
10
|
-
import { DeviceFirmwareRange } from '../types';
|
|
11
|
-
import { CoreMessage, createFirmwareMessage, DEVICE, FIRMWARE } from '../events';
|
|
10
|
+
import { DeviceFirmwareRange, KnownDevice } from '../types';
|
|
11
|
+
import { CoreMessage, createFirmwareMessage, DEVICE, FIRMWARE, createUiMessage } from '../events';
|
|
12
12
|
import { getBleFirmwareReleaseInfo, getFirmwareReleaseInfo } from './firmware/releaseHelper';
|
|
13
13
|
import { getLogger, LoggerNames } from '../utils';
|
|
14
14
|
|
|
@@ -167,4 +167,14 @@ export abstract class BaseMethod<Params = undefined> {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
dispose() {}
|
|
170
|
+
|
|
171
|
+
// Reusable events
|
|
172
|
+
postPreviousAddressMessage = (data: { address?: string; path?: string }) => {
|
|
173
|
+
this.postMessage(
|
|
174
|
+
createUiMessage(UI_REQUEST.PREVIOUS_ADDRESS_RESULT, {
|
|
175
|
+
device: this.device.toMessageObject() as KnownDevice,
|
|
176
|
+
data,
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
};
|
|
170
180
|
}
|
|
@@ -46,7 +46,6 @@ export default class AlgoGetAddress extends BaseMethod<HardwareAlgoGetAddress[]>
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
async run() {
|
|
49
|
-
// TODO: add batch support
|
|
50
49
|
const responses: AlgoAddress[] = [];
|
|
51
50
|
for (let i = 0; i < this.params.length; i++) {
|
|
52
51
|
const param = this.params[i];
|
|
@@ -57,10 +56,12 @@ export default class AlgoGetAddress extends BaseMethod<HardwareAlgoGetAddress[]>
|
|
|
57
56
|
|
|
58
57
|
const { address } = res.message;
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
const result = {
|
|
61
60
|
path: serializedPath(param.address_n),
|
|
62
61
|
address,
|
|
63
|
-
}
|
|
62
|
+
};
|
|
63
|
+
responses.push(result);
|
|
64
|
+
this.postPreviousAddressMessage(result);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -13,6 +13,8 @@ import { hexToBytes } from '../helpers/hexUtils';
|
|
|
13
13
|
export default class AptosGetAddress extends BaseMethod<HardwareAptosGetAddress[]> {
|
|
14
14
|
hasBundle = false;
|
|
15
15
|
|
|
16
|
+
shouldConfirm = false;
|
|
17
|
+
|
|
16
18
|
init() {
|
|
17
19
|
this.checkDeviceId = true;
|
|
18
20
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
@@ -20,6 +22,10 @@ export default class AptosGetAddress extends BaseMethod<HardwareAptosGetAddress[
|
|
|
20
22
|
this.hasBundle = !!this.payload?.bundle;
|
|
21
23
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
22
24
|
|
|
25
|
+
this.shouldConfirm = this.hasBundle
|
|
26
|
+
? this.payload.bundle.some((i: any) => !!i.showOnOneKey)
|
|
27
|
+
: false;
|
|
28
|
+
|
|
23
29
|
// check payload
|
|
24
30
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
25
31
|
|
|
@@ -58,7 +64,7 @@ export default class AptosGetAddress extends BaseMethod<HardwareAptosGetAddress[
|
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
async run() {
|
|
61
|
-
if (this.hasBundle && supportBatchPublicKey(this.device?.features)) {
|
|
67
|
+
if (this.hasBundle && supportBatchPublicKey(this.device?.features) && !this.shouldConfirm) {
|
|
62
68
|
const res = await this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
63
69
|
paths: this.params,
|
|
64
70
|
ecdsa_curve_name: 'ed25519',
|
|
@@ -81,10 +87,12 @@ export default class AptosGetAddress extends BaseMethod<HardwareAptosGetAddress[
|
|
|
81
87
|
|
|
82
88
|
const { address } = res.message;
|
|
83
89
|
|
|
84
|
-
|
|
90
|
+
const result = {
|
|
85
91
|
path: serializedPath(param.address_n),
|
|
86
92
|
address: address?.toLowerCase(),
|
|
87
|
-
}
|
|
93
|
+
};
|
|
94
|
+
responses.push(result);
|
|
95
|
+
this.postPreviousAddressMessage(result);
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -64,10 +64,16 @@ export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
|
|
|
64
64
|
...param,
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
const path = serializedPath(param.address_n);
|
|
67
68
|
responses.push({
|
|
68
|
-
path
|
|
69
|
+
path,
|
|
69
70
|
...res.message,
|
|
70
71
|
});
|
|
72
|
+
|
|
73
|
+
this.postPreviousAddressMessage({
|
|
74
|
+
address: res.message.address,
|
|
75
|
+
path,
|
|
76
|
+
});
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -108,16 +108,22 @@ export default class CardanoGetAddress extends BaseMethod<CardanoGetAddressParam
|
|
|
108
108
|
stakeAddress = stakeAddressRes.message.address;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
const path = serializedPath(batch.address_parameters.address_n);
|
|
111
112
|
responses.push({
|
|
112
113
|
addressParameters: addressParametersFromProto(batch.address_parameters),
|
|
113
114
|
protocolMagic: batch.protocol_magic,
|
|
114
115
|
networkId: batch.network_id,
|
|
115
|
-
serializedPath:
|
|
116
|
+
serializedPath: path,
|
|
116
117
|
serializedStakingPath: serializedPath(batch.address_parameters.address_n_staking),
|
|
117
118
|
address: response.message.address,
|
|
118
119
|
xpub,
|
|
119
120
|
stakeAddress,
|
|
120
121
|
});
|
|
122
|
+
|
|
123
|
+
this.postPreviousAddressMessage({
|
|
124
|
+
path,
|
|
125
|
+
address: response.message.address,
|
|
126
|
+
});
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
return this.hasBundle ? responses : responses[0];
|
|
@@ -56,10 +56,16 @@ export default class ConfluxGetAddress extends BaseMethod<HardwareConfluxGetAddr
|
|
|
56
56
|
...param,
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
const path = serializedPath(param.address_n);
|
|
59
60
|
responses.push({
|
|
60
|
-
path
|
|
61
|
+
path,
|
|
61
62
|
...res.message,
|
|
62
63
|
});
|
|
64
|
+
|
|
65
|
+
this.postPreviousAddressMessage({
|
|
66
|
+
path,
|
|
67
|
+
address: res.message.address,
|
|
68
|
+
});
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -63,10 +63,12 @@ export default class CosmosGetAddress extends BaseMethod<HardwareCosmosGetAddres
|
|
|
63
63
|
|
|
64
64
|
const { address } = res.message;
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
const result = {
|
|
67
67
|
path: serializedPath(param.address_n),
|
|
68
68
|
address,
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
|
+
responses.push(result);
|
|
71
|
+
this.postPreviousAddressMessage(result);
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -51,10 +51,12 @@ export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
|
|
|
51
51
|
|
|
52
52
|
const { address } = res.message;
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
const result = {
|
|
55
55
|
path: serializedPath(param.address_n),
|
|
56
56
|
address,
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
|
+
responses.push(result);
|
|
59
|
+
this.postPreviousAddressMessage(result);
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -62,10 +62,12 @@ export default class FilecoinGetAddress extends BaseMethod<HardwareFilecoinGetAd
|
|
|
62
62
|
|
|
63
63
|
const { address } = res.message;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const result = {
|
|
66
66
|
path: serializedPath(param.address_n),
|
|
67
67
|
address,
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
|
+
responses.push(result);
|
|
70
|
+
this.postPreviousAddressMessage(result);
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -57,10 +57,12 @@ export default class NearGetAddress extends BaseMethod<HardwareNearGetAddress[]>
|
|
|
57
57
|
|
|
58
58
|
const { address } = res.message;
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
const result = {
|
|
61
61
|
path: serializedPath(param.address_n),
|
|
62
62
|
address,
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
|
+
responses.push(result);
|
|
65
|
+
this.postPreviousAddressMessage(result);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -51,10 +51,15 @@ export default class NEMGetAddress extends BaseMethod<HardwareNEMGetAddress[]> {
|
|
|
51
51
|
...param,
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
const path = serializedPath(param.address_n);
|
|
54
55
|
responses.push({
|
|
55
|
-
path
|
|
56
|
+
path,
|
|
56
57
|
...res.message,
|
|
57
58
|
});
|
|
59
|
+
this.postPreviousAddressMessage({
|
|
60
|
+
path,
|
|
61
|
+
address: res.message.address,
|
|
62
|
+
});
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -65,11 +65,17 @@ export default class PolkadotGetAddress extends BaseMethod<HardwarePolkadotGetAd
|
|
|
65
65
|
|
|
66
66
|
const { address, public_key } = res.message;
|
|
67
67
|
|
|
68
|
+
const path = serializedPath(param.address_n);
|
|
68
69
|
responses.push({
|
|
69
|
-
path
|
|
70
|
+
path,
|
|
70
71
|
address,
|
|
71
72
|
publicKey: public_key ?? '',
|
|
72
73
|
});
|
|
74
|
+
|
|
75
|
+
this.postPreviousAddressMessage({
|
|
76
|
+
path,
|
|
77
|
+
address,
|
|
78
|
+
});
|
|
73
79
|
}
|
|
74
80
|
|
|
75
81
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -49,10 +49,13 @@ export default class SolGetAddress extends BaseMethod<SolanaGetAddress[]> {
|
|
|
49
49
|
|
|
50
50
|
const { address } = res.message;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const result = {
|
|
53
53
|
path: serializedPath(param.address_n),
|
|
54
54
|
address,
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
|
+
responses.push(result);
|
|
57
|
+
|
|
58
|
+
this.postPreviousAddressMessage(result);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -47,10 +47,16 @@ export default class StarcoinGetAddress extends BaseMethod<HardwareStarcoinGetAd
|
|
|
47
47
|
...param,
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
const path = serializedPath(param.address_n);
|
|
50
51
|
responses.push({
|
|
51
|
-
path
|
|
52
|
+
path,
|
|
52
53
|
...res.message,
|
|
53
54
|
});
|
|
55
|
+
|
|
56
|
+
this.postPreviousAddressMessage({
|
|
57
|
+
path,
|
|
58
|
+
address: res.message.address,
|
|
59
|
+
});
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -49,10 +49,13 @@ export default class StellarGetAddress extends BaseMethod<HardwareStellarGetAddr
|
|
|
49
49
|
|
|
50
50
|
const { address } = res.message;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const result = {
|
|
53
53
|
path: serializedPath(param.address_n),
|
|
54
54
|
address,
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
|
+
responses.push(result);
|
|
57
|
+
|
|
58
|
+
this.postPreviousAddressMessage(result);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -13,6 +13,8 @@ import { hexToBytes } from '../helpers/hexUtils';
|
|
|
13
13
|
export default class SuiGetAddress extends BaseMethod<HardwareSuiGetAddress[]> {
|
|
14
14
|
hasBundle = false;
|
|
15
15
|
|
|
16
|
+
shouldConfirm = false;
|
|
17
|
+
|
|
16
18
|
init() {
|
|
17
19
|
this.checkDeviceId = true;
|
|
18
20
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
@@ -20,6 +22,10 @@ export default class SuiGetAddress extends BaseMethod<HardwareSuiGetAddress[]> {
|
|
|
20
22
|
this.hasBundle = !!this.payload?.bundle;
|
|
21
23
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
22
24
|
|
|
25
|
+
this.shouldConfirm = this.hasBundle
|
|
26
|
+
? this.payload.bundle.some((i: any) => !!i.showOnOneKey)
|
|
27
|
+
: false;
|
|
28
|
+
|
|
23
29
|
// check payload
|
|
24
30
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
25
31
|
|
|
@@ -63,7 +69,7 @@ export default class SuiGetAddress extends BaseMethod<HardwareSuiGetAddress[]> {
|
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
async run() {
|
|
66
|
-
if (this.hasBundle && supportBatchPublicKey(this.device?.features)) {
|
|
72
|
+
if (this.hasBundle && supportBatchPublicKey(this.device?.features) && !this.shouldConfirm) {
|
|
67
73
|
const res = await this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
68
74
|
paths: this.params,
|
|
69
75
|
ecdsa_curve_name: 'ed25519',
|
|
@@ -86,10 +92,12 @@ export default class SuiGetAddress extends BaseMethod<HardwareSuiGetAddress[]> {
|
|
|
86
92
|
|
|
87
93
|
const { address } = res.message;
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
const result = {
|
|
90
96
|
path: serializedPath(param.address_n),
|
|
91
97
|
address: address?.toLowerCase(),
|
|
92
|
-
}
|
|
98
|
+
};
|
|
99
|
+
responses.push(result);
|
|
100
|
+
this.postPreviousAddressMessage(result);
|
|
93
101
|
}
|
|
94
102
|
|
|
95
103
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -57,10 +57,12 @@ export default class TronGetAddress extends BaseMethod<HardwareTronGetAddress[]>
|
|
|
57
57
|
|
|
58
58
|
const { address } = res.message;
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
const result = {
|
|
61
61
|
path: serializedPath(param.address_n),
|
|
62
62
|
address,
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
|
+
responses.push(result);
|
|
65
|
+
this.postPreviousAddressMessage(result);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
@@ -14,6 +14,8 @@ export default class XrpGetAddress extends BaseMethod<
|
|
|
14
14
|
> {
|
|
15
15
|
hasBundle = false;
|
|
16
16
|
|
|
17
|
+
shouldConfirm = false;
|
|
18
|
+
|
|
17
19
|
init() {
|
|
18
20
|
this.checkDeviceId = true;
|
|
19
21
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
@@ -21,6 +23,10 @@ export default class XrpGetAddress extends BaseMethod<
|
|
|
21
23
|
this.hasBundle = !!this.payload?.bundle;
|
|
22
24
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
23
25
|
|
|
26
|
+
this.shouldConfirm = this.hasBundle
|
|
27
|
+
? this.payload.bundle.some((i: any) => !!i.showOnOneKey)
|
|
28
|
+
: false;
|
|
29
|
+
|
|
24
30
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
25
31
|
|
|
26
32
|
this.params = [];
|
|
@@ -50,7 +56,7 @@ export default class XrpGetAddress extends BaseMethod<
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
async run() {
|
|
53
|
-
if (this.hasBundle && supportBatchPublicKey(this.device?.features)) {
|
|
59
|
+
if (this.hasBundle && supportBatchPublicKey(this.device?.features) && !this.shouldConfirm) {
|
|
54
60
|
const res = await this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
55
61
|
paths: this.params,
|
|
56
62
|
ecdsa_curve_name: 'secp256k1',
|
|
@@ -81,11 +87,17 @@ export default class XrpGetAddress extends BaseMethod<
|
|
|
81
87
|
|
|
82
88
|
const { address } = res.message;
|
|
83
89
|
|
|
90
|
+
const path = serializedPath(param.address_n);
|
|
84
91
|
responses.push({
|
|
85
|
-
path
|
|
92
|
+
path,
|
|
86
93
|
address,
|
|
87
94
|
publicKey: publicKey.message?.public_keys?.[0],
|
|
88
95
|
});
|
|
96
|
+
|
|
97
|
+
this.postPreviousAddressMessage({
|
|
98
|
+
path,
|
|
99
|
+
address,
|
|
100
|
+
});
|
|
89
101
|
}
|
|
90
102
|
|
|
91
103
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
package/src/events/ui-request.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const UI_REQUEST = {
|
|
|
22
22
|
FIRMWARE_TIP: 'ui-firmware-tip',
|
|
23
23
|
|
|
24
24
|
NOT_IN_BOOTLOADER: 'ui-device_not_in_bootloader_mode',
|
|
25
|
+
|
|
26
|
+
PREVIOUS_ADDRESS_RESULT: 'ui-previous_address_result',
|
|
25
27
|
} as const;
|
|
26
28
|
|
|
27
29
|
export interface UiRequestWithoutPayload {
|
|
@@ -78,6 +80,17 @@ export interface FirmwareTip {
|
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
|
|
83
|
+
export interface PreviousAddressResult {
|
|
84
|
+
type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
|
|
85
|
+
payload: {
|
|
86
|
+
device: Device;
|
|
87
|
+
data: {
|
|
88
|
+
address?: string;
|
|
89
|
+
path?: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
81
94
|
export type UiEvent =
|
|
82
95
|
| UiRequestWithoutPayload
|
|
83
96
|
| UiRequestDeviceAction
|
|
@@ -85,7 +98,8 @@ export type UiEvent =
|
|
|
85
98
|
| UiRequestPassphraseOnDevice
|
|
86
99
|
| UiRequestPassphrase
|
|
87
100
|
| FirmwareProgress
|
|
88
|
-
| FirmwareTip
|
|
101
|
+
| FirmwareTip
|
|
102
|
+
| PreviousAddressResult;
|
|
89
103
|
|
|
90
104
|
export type UiEventMessage = UiEvent & { event: typeof UI_EVENT };
|
|
91
105
|
|