@onekeyfe/hd-core 0.2.42 → 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/device/DeviceCommands.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 +118 -35
- 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/device/DeviceCommands.ts +10 -2
- 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/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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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCommands.d.ts","sourceRoot":"","sources":["../../src/device/DeviceCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAe,MAAM,wBAAwB,CAAC;AAK/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,aAAK,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AACxC,aAAK,UAAU,GAAG,MAAM,WAAW,CAAC;AACpC,oBAAY,oBAAoB,CAAC,CAAC,SAAS,UAAU,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACzB,CAAC;AACF,aAAK,oBAAoB,GAAG;KACzB,CAAC,IAAI,MAAM,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAClD,CAAC;AACF,oBAAY,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,WAAW,CAAC,CAAC;AAE7E,oBAAY,wBAAwB,GAAG;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EA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AAoB;IAwB/C,iBAAiB;CA2BlB;AAED,oBAAY,SAAS,GAAG,cAAc,CAAC,WAAW,CAAC,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,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ED
|
@@ -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,
|
|
@@ -11902,7 +11903,7 @@ class DeviceCommands {
|
|
|
11902
11903
|
});
|
|
11903
11904
|
}
|
|
11904
11905
|
call(type, msg = {}) {
|
|
11905
|
-
var _a, _b, _c, _d, _e;
|
|
11906
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11906
11907
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11907
11908
|
Log$6.debug('[DeviceCommands] [call] Sending', type);
|
|
11908
11909
|
try {
|
|
@@ -11914,10 +11915,13 @@ class DeviceCommands {
|
|
|
11914
11915
|
}
|
|
11915
11916
|
catch (error) {
|
|
11916
11917
|
Log$6.debug('[DeviceCommands] [call] Received error', error);
|
|
11917
|
-
if ((
|
|
11918
|
+
if ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) {
|
|
11919
|
+
Log$6.debug('error response', error === null || error === void 0 ? void 0 : error.response.data);
|
|
11920
|
+
}
|
|
11921
|
+
if (((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.error) === 'device disconnected during action') {
|
|
11918
11922
|
return { type: 'BridgeNetworkError', message: {} };
|
|
11919
11923
|
}
|
|
11920
|
-
if (((
|
|
11924
|
+
if (((_f = (_e = (_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) === null || _f === void 0 ? void 0 : _f.indexOf('Request failed with status code')) !== -1) {
|
|
11921
11925
|
return { type: 'CallMethodError', message: {} };
|
|
11922
11926
|
}
|
|
11923
11927
|
throw error;
|
|
@@ -11989,8 +11993,13 @@ class DeviceCommands {
|
|
|
11989
11993
|
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FileAlreadyExists);
|
|
11990
11994
|
}
|
|
11991
11995
|
}
|
|
11992
|
-
if (code === 'Failure_UnexpectedMessage'
|
|
11993
|
-
|
|
11996
|
+
if (code === 'Failure_UnexpectedMessage') {
|
|
11997
|
+
if (callType === 'PassphraseAck') {
|
|
11998
|
+
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.UnexpectPassphrase);
|
|
11999
|
+
}
|
|
12000
|
+
if (message === 'Not in Signing mode') {
|
|
12001
|
+
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.NotInSigningMode);
|
|
12002
|
+
}
|
|
11994
12003
|
}
|
|
11995
12004
|
if (error) {
|
|
11996
12005
|
return Promise.reject(error);
|
|
@@ -12088,6 +12097,7 @@ const UI_REQUEST = {
|
|
|
12088
12097
|
FIRMWARE_NOT_INSTALLED: 'ui-device_firmware_not_installed',
|
|
12089
12098
|
NOT_USE_ONEKEY_DEVICE: 'ui-device_please_use_onekey_device',
|
|
12090
12099
|
FIRMWARE_TIP: 'ui-firmware-tip',
|
|
12100
|
+
PREVIOUS_ADDRESS_RESULT: 'ui-previous_address_result',
|
|
12091
12101
|
};
|
|
12092
12102
|
|
|
12093
12103
|
const parseRunOptions = (options) => {
|
|
@@ -12574,6 +12584,12 @@ class BaseMethod {
|
|
|
12574
12584
|
this.checkDeviceId = false;
|
|
12575
12585
|
this.useDevicePassphraseState = true;
|
|
12576
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
|
+
};
|
|
12577
12593
|
const { payload } = message;
|
|
12578
12594
|
this.name = payload.method;
|
|
12579
12595
|
this.payload = payload;
|
|
@@ -14196,7 +14212,12 @@ class BTCGetAddress extends BaseMethod {
|
|
|
14196
14212
|
for (let i = 0; i < this.params.length; i++) {
|
|
14197
14213
|
const param = this.params[i];
|
|
14198
14214
|
const res = yield this.device.commands.typedCall('GetAddress', 'Address', Object.assign({}, param));
|
|
14199
|
-
|
|
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
|
+
});
|
|
14200
14221
|
}
|
|
14201
14222
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
14202
14223
|
});
|
|
@@ -14725,7 +14746,12 @@ class ConfluxGetAddress extends BaseMethod {
|
|
|
14725
14746
|
for (let i = 0; i < this.params.length; i++) {
|
|
14726
14747
|
const param = this.params[i];
|
|
14727
14748
|
const res = yield this.device.commands.typedCall('ConfluxGetAddress', 'ConfluxAddress', Object.assign({}, param));
|
|
14728
|
-
|
|
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
|
+
});
|
|
14729
14755
|
}
|
|
14730
14756
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
14731
14757
|
});
|
|
@@ -14925,10 +14951,12 @@ class EvmGetAddress extends BaseMethod {
|
|
|
14925
14951
|
const param = this.params[i];
|
|
14926
14952
|
const res = yield this.device.commands.typedCall('EthereumGetAddress', 'EthereumAddress', Object.assign({}, param));
|
|
14927
14953
|
const { address } = res.message;
|
|
14928
|
-
|
|
14954
|
+
const result = {
|
|
14929
14955
|
path: serializedPath(param.address_n),
|
|
14930
14956
|
address,
|
|
14931
|
-
}
|
|
14957
|
+
};
|
|
14958
|
+
responses.push(result);
|
|
14959
|
+
this.postPreviousAddressMessage(result);
|
|
14932
14960
|
}
|
|
14933
14961
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
14934
14962
|
});
|
|
@@ -15557,7 +15585,12 @@ class StarcoinGetAddress extends BaseMethod {
|
|
|
15557
15585
|
for (let i = 0; i < this.params.length; i++) {
|
|
15558
15586
|
const param = this.params[i];
|
|
15559
15587
|
const res = yield this.device.commands.typedCall('StarcoinGetAddress', 'StarcoinAddress', Object.assign({}, param));
|
|
15560
|
-
|
|
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
|
+
});
|
|
15561
15594
|
}
|
|
15562
15595
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
15563
15596
|
});
|
|
@@ -15710,7 +15743,12 @@ class NEMGetAddress extends BaseMethod {
|
|
|
15710
15743
|
for (let i = 0; i < this.params.length; i++) {
|
|
15711
15744
|
const param = this.params[i];
|
|
15712
15745
|
const res = yield this.device.commands.typedCall('NEMGetAddress', 'NEMAddress', Object.assign({}, param));
|
|
15713
|
-
|
|
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
|
+
});
|
|
15714
15752
|
}
|
|
15715
15753
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
15716
15754
|
});
|
|
@@ -15941,10 +15979,12 @@ class SolGetAddress extends BaseMethod {
|
|
|
15941
15979
|
const param = this.params[i];
|
|
15942
15980
|
const res = yield this.device.commands.typedCall('SolanaGetAddress', 'SolanaAddress', Object.assign({}, param));
|
|
15943
15981
|
const { address } = res.message;
|
|
15944
|
-
|
|
15982
|
+
const result = {
|
|
15945
15983
|
path: serializedPath(param.address_n),
|
|
15946
15984
|
address,
|
|
15947
|
-
}
|
|
15985
|
+
};
|
|
15986
|
+
responses.push(result);
|
|
15987
|
+
this.postPreviousAddressMessage(result);
|
|
15948
15988
|
}
|
|
15949
15989
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
15950
15990
|
});
|
|
@@ -16037,10 +16077,12 @@ class StellarGetAddress extends BaseMethod {
|
|
|
16037
16077
|
const param = this.params[i];
|
|
16038
16078
|
const res = yield this.device.commands.typedCall('StellarGetAddress', 'StellarAddress', Object.assign({}, param));
|
|
16039
16079
|
const { address } = res.message;
|
|
16040
|
-
|
|
16080
|
+
const result = {
|
|
16041
16081
|
path: serializedPath(param.address_n),
|
|
16042
16082
|
address,
|
|
16043
|
-
}
|
|
16083
|
+
};
|
|
16084
|
+
responses.push(result);
|
|
16085
|
+
this.postPreviousAddressMessage(result);
|
|
16044
16086
|
}
|
|
16045
16087
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16046
16088
|
});
|
|
@@ -16261,10 +16303,12 @@ class TronGetAddress extends BaseMethod {
|
|
|
16261
16303
|
const param = this.params[i];
|
|
16262
16304
|
const res = yield this.device.commands.typedCall('TronGetAddress', 'TronAddress', Object.assign({}, param));
|
|
16263
16305
|
const { address } = res.message;
|
|
16264
|
-
|
|
16306
|
+
const result = {
|
|
16265
16307
|
path: serializedPath(param.address_n),
|
|
16266
16308
|
address,
|
|
16267
|
-
}
|
|
16309
|
+
};
|
|
16310
|
+
responses.push(result);
|
|
16311
|
+
this.postPreviousAddressMessage(result);
|
|
16268
16312
|
}
|
|
16269
16313
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16270
16314
|
});
|
|
@@ -16410,10 +16454,12 @@ class NearGetAddress extends BaseMethod {
|
|
|
16410
16454
|
const param = this.params[i];
|
|
16411
16455
|
const res = yield this.device.commands.typedCall('NearGetAddress', 'NearAddress', Object.assign({}, param));
|
|
16412
16456
|
const { address } = res.message;
|
|
16413
|
-
|
|
16457
|
+
const result = {
|
|
16414
16458
|
path: serializedPath(param.address_n),
|
|
16415
16459
|
address,
|
|
16416
|
-
}
|
|
16460
|
+
};
|
|
16461
|
+
responses.push(result);
|
|
16462
|
+
this.postPreviousAddressMessage(result);
|
|
16417
16463
|
}
|
|
16418
16464
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16419
16465
|
});
|
|
@@ -16454,6 +16500,7 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16454
16500
|
constructor() {
|
|
16455
16501
|
super(...arguments);
|
|
16456
16502
|
this.hasBundle = false;
|
|
16503
|
+
this.shouldConfirm = false;
|
|
16457
16504
|
}
|
|
16458
16505
|
init() {
|
|
16459
16506
|
var _a;
|
|
@@ -16461,6 +16508,9 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16461
16508
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16462
16509
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16463
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;
|
|
16464
16514
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
16465
16515
|
this.params = [];
|
|
16466
16516
|
payload.bundle.forEach((batch) => {
|
|
@@ -16493,7 +16543,7 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16493
16543
|
run() {
|
|
16494
16544
|
var _a;
|
|
16495
16545
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16496
|
-
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) {
|
|
16497
16547
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
16498
16548
|
paths: this.params,
|
|
16499
16549
|
ecdsa_curve_name: 'ed25519',
|
|
@@ -16510,10 +16560,12 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16510
16560
|
const param = this.params[i];
|
|
16511
16561
|
const res = yield this.device.commands.typedCall('AptosGetAddress', 'AptosAddress', Object.assign({}, param));
|
|
16512
16562
|
const { address } = res.message;
|
|
16513
|
-
|
|
16563
|
+
const result = {
|
|
16514
16564
|
path: serializedPath(param.address_n),
|
|
16515
16565
|
address: address === null || address === void 0 ? void 0 : address.toLowerCase(),
|
|
16516
|
-
}
|
|
16566
|
+
};
|
|
16567
|
+
responses.push(result);
|
|
16568
|
+
this.postPreviousAddressMessage(result);
|
|
16517
16569
|
}
|
|
16518
16570
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16519
16571
|
});
|
|
@@ -16701,10 +16753,12 @@ class AlgoGetAddress extends BaseMethod {
|
|
|
16701
16753
|
const param = this.params[i];
|
|
16702
16754
|
const res = yield this.device.commands.typedCall('AlgorandGetAddress', 'AlgorandAddress', Object.assign({}, param));
|
|
16703
16755
|
const { address } = res.message;
|
|
16704
|
-
|
|
16756
|
+
const result = {
|
|
16705
16757
|
path: serializedPath(param.address_n),
|
|
16706
16758
|
address,
|
|
16707
|
-
}
|
|
16759
|
+
};
|
|
16760
|
+
responses.push(result);
|
|
16761
|
+
this.postPreviousAddressMessage(result);
|
|
16708
16762
|
}
|
|
16709
16763
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16710
16764
|
});
|
|
@@ -16796,10 +16850,12 @@ class CosmosGetAddress extends BaseMethod {
|
|
|
16796
16850
|
const param = this.params[i];
|
|
16797
16851
|
const res = yield this.device.commands.typedCall('CosmosGetAddress', 'CosmosAddress', Object.assign({}, param));
|
|
16798
16852
|
const { address } = res.message;
|
|
16799
|
-
|
|
16853
|
+
const result = {
|
|
16800
16854
|
path: serializedPath(param.address_n),
|
|
16801
16855
|
address,
|
|
16802
|
-
}
|
|
16856
|
+
};
|
|
16857
|
+
responses.push(result);
|
|
16858
|
+
this.postPreviousAddressMessage(result);
|
|
16803
16859
|
}
|
|
16804
16860
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16805
16861
|
});
|
|
@@ -16912,6 +16968,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16912
16968
|
constructor() {
|
|
16913
16969
|
super(...arguments);
|
|
16914
16970
|
this.hasBundle = false;
|
|
16971
|
+
this.shouldConfirm = false;
|
|
16915
16972
|
}
|
|
16916
16973
|
init() {
|
|
16917
16974
|
var _a;
|
|
@@ -16919,6 +16976,9 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16919
16976
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16920
16977
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16921
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;
|
|
16922
16982
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
16923
16983
|
this.params = [];
|
|
16924
16984
|
payload.bundle.forEach((batch) => {
|
|
@@ -16945,7 +17005,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16945
17005
|
run() {
|
|
16946
17006
|
var _a, _b, _c;
|
|
16947
17007
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16948
|
-
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) {
|
|
16949
17009
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
16950
17010
|
paths: this.params,
|
|
16951
17011
|
ecdsa_curve_name: 'secp256k1',
|
|
@@ -16966,11 +17026,16 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16966
17026
|
ecdsa_curve_name: 'secp256k1',
|
|
16967
17027
|
});
|
|
16968
17028
|
const { address } = res.message;
|
|
17029
|
+
const path = serializedPath(param.address_n);
|
|
16969
17030
|
responses.push({
|
|
16970
|
-
path
|
|
17031
|
+
path,
|
|
16971
17032
|
address,
|
|
16972
17033
|
publicKey: (_c = (_b = publicKey.message) === null || _b === void 0 ? void 0 : _b.public_keys) === null || _c === void 0 ? void 0 : _c[0],
|
|
16973
17034
|
});
|
|
17035
|
+
this.postPreviousAddressMessage({
|
|
17036
|
+
path,
|
|
17037
|
+
address,
|
|
17038
|
+
});
|
|
16974
17039
|
}
|
|
16975
17040
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
16976
17041
|
});
|
|
@@ -17039,6 +17104,7 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17039
17104
|
constructor() {
|
|
17040
17105
|
super(...arguments);
|
|
17041
17106
|
this.hasBundle = false;
|
|
17107
|
+
this.shouldConfirm = false;
|
|
17042
17108
|
}
|
|
17043
17109
|
init() {
|
|
17044
17110
|
var _a;
|
|
@@ -17046,6 +17112,9 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17046
17112
|
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17047
17113
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17048
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;
|
|
17049
17118
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
17050
17119
|
this.params = [];
|
|
17051
17120
|
payload.bundle.forEach((batch) => {
|
|
@@ -17081,7 +17150,7 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17081
17150
|
run() {
|
|
17082
17151
|
var _a;
|
|
17083
17152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17084
|
-
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) {
|
|
17085
17154
|
const res = yield this.device.commands.typedCall('BatchGetPublickeys', 'EcdsaPublicKeys', {
|
|
17086
17155
|
paths: this.params,
|
|
17087
17156
|
ecdsa_curve_name: 'ed25519',
|
|
@@ -17098,10 +17167,12 @@ class SuiGetAddress extends BaseMethod {
|
|
|
17098
17167
|
const param = this.params[i];
|
|
17099
17168
|
const res = yield this.device.commands.typedCall('SuiGetAddress', 'SuiAddress', Object.assign({}, param));
|
|
17100
17169
|
const { address } = res.message;
|
|
17101
|
-
|
|
17170
|
+
const result = {
|
|
17102
17171
|
path: serializedPath(param.address_n),
|
|
17103
17172
|
address: address === null || address === void 0 ? void 0 : address.toLowerCase(),
|
|
17104
|
-
}
|
|
17173
|
+
};
|
|
17174
|
+
responses.push(result);
|
|
17175
|
+
this.postPreviousAddressMessage(result);
|
|
17105
17176
|
}
|
|
17106
17177
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
17107
17178
|
});
|
|
@@ -17348,16 +17419,21 @@ class CardanoGetAddress extends BaseMethod {
|
|
|
17348
17419
|
});
|
|
17349
17420
|
stakeAddress = stakeAddressRes.message.address;
|
|
17350
17421
|
}
|
|
17422
|
+
const path = serializedPath(batch.address_parameters.address_n);
|
|
17351
17423
|
responses.push({
|
|
17352
17424
|
addressParameters: addressParametersFromProto(batch.address_parameters),
|
|
17353
17425
|
protocolMagic: batch.protocol_magic,
|
|
17354
17426
|
networkId: batch.network_id,
|
|
17355
|
-
serializedPath:
|
|
17427
|
+
serializedPath: path,
|
|
17356
17428
|
serializedStakingPath: serializedPath(batch.address_parameters.address_n_staking),
|
|
17357
17429
|
address: response.message.address,
|
|
17358
17430
|
xpub,
|
|
17359
17431
|
stakeAddress,
|
|
17360
17432
|
});
|
|
17433
|
+
this.postPreviousAddressMessage({
|
|
17434
|
+
path,
|
|
17435
|
+
address: response.message.address,
|
|
17436
|
+
});
|
|
17361
17437
|
}
|
|
17362
17438
|
return this.hasBundle ? responses : responses[0];
|
|
17363
17439
|
});
|
|
@@ -18122,10 +18198,12 @@ class FilecoinGetAddress extends BaseMethod {
|
|
|
18122
18198
|
const param = this.params[i];
|
|
18123
18199
|
const res = yield this.device.commands.typedCall('FilecoinGetAddress', 'FilecoinAddress', Object.assign({}, param));
|
|
18124
18200
|
const { address } = res.message;
|
|
18125
|
-
|
|
18201
|
+
const result = {
|
|
18126
18202
|
path: serializedPath(param.address_n),
|
|
18127
18203
|
address,
|
|
18128
|
-
}
|
|
18204
|
+
};
|
|
18205
|
+
responses.push(result);
|
|
18206
|
+
this.postPreviousAddressMessage(result);
|
|
18129
18207
|
}
|
|
18130
18208
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
18131
18209
|
});
|
|
@@ -18224,11 +18302,16 @@ class PolkadotGetAddress extends BaseMethod {
|
|
|
18224
18302
|
const param = this.params[i];
|
|
18225
18303
|
const res = yield this.device.commands.typedCall('PolkadotGetAddress', 'PolkadotAddress', Object.assign({}, param));
|
|
18226
18304
|
const { address, public_key } = res.message;
|
|
18305
|
+
const path = serializedPath(param.address_n);
|
|
18227
18306
|
responses.push({
|
|
18228
|
-
path
|
|
18307
|
+
path,
|
|
18229
18308
|
address,
|
|
18230
18309
|
publicKey: public_key !== null && public_key !== void 0 ? public_key : '',
|
|
18231
18310
|
});
|
|
18311
|
+
this.postPreviousAddressMessage({
|
|
18312
|
+
path,
|
|
18313
|
+
address,
|
|
18314
|
+
});
|
|
18232
18315
|
}
|
|
18233
18316
|
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
18234
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]);
|
|
@@ -79,6 +79,9 @@ export class DeviceCommands {
|
|
|
79
79
|
return res;
|
|
80
80
|
} catch (error) {
|
|
81
81
|
Log.debug('[DeviceCommands] [call] Received error', error);
|
|
82
|
+
if (error.response?.data) {
|
|
83
|
+
Log.debug('error response', error?.response.data);
|
|
84
|
+
}
|
|
82
85
|
if (error?.response?.data?.error === 'device disconnected during action') {
|
|
83
86
|
return { type: 'BridgeNetworkError', message: {} } as any;
|
|
84
87
|
}
|
|
@@ -189,8 +192,13 @@ export class DeviceCommands {
|
|
|
189
192
|
}
|
|
190
193
|
}
|
|
191
194
|
|
|
192
|
-
if (code === 'Failure_UnexpectedMessage'
|
|
193
|
-
|
|
195
|
+
if (code === 'Failure_UnexpectedMessage') {
|
|
196
|
+
if (callType === 'PassphraseAck') {
|
|
197
|
+
error = ERRORS.TypedError(HardwareErrorCode.UnexpectPassphrase);
|
|
198
|
+
}
|
|
199
|
+
if (message === 'Not in Signing mode') {
|
|
200
|
+
error = ERRORS.TypedError(HardwareErrorCode.NotInSigningMode);
|
|
201
|
+
}
|
|
194
202
|
}
|
|
195
203
|
|
|
196
204
|
if (error) {
|
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
|
|