@onekeyfe/onekey-cosmos-provider 2.2.26 → 2.2.27

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.
@@ -12,8 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12
12
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
13
13
  /* eslint-disable @typescript-eslint/no-explicit-any */
14
14
  /* eslint-disable tsdoc/syntax */
15
- import { bytesToHex, hexToBytes } from '@noble/hashes/utils';
16
- import { checkWalletSwitchEnable } from '@onekeyfe/cross-inpage-provider-core';
15
+ import { bytesToHex, hexToBytes, checkWalletSwitchEnable } from '@onekeyfe/cross-inpage-provider-core';
17
16
  import { getOrCreateExtInjectedJsBridge } from '@onekeyfe/extension-bridge-injected';
18
17
  import { ProviderCosmosBase } from './ProviderCosmosBase';
19
18
  // @ts-ignore
@@ -18,7 +18,6 @@ exports.ProviderCosmos = void 0;
18
18
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
19
19
  /* eslint-disable @typescript-eslint/no-explicit-any */
20
20
  /* eslint-disable tsdoc/syntax */
21
- const utils_1 = require("@noble/hashes/utils");
22
21
  const cross_inpage_provider_core_1 = require("@onekeyfe/cross-inpage-provider-core");
23
22
  const extension_bridge_injected_1 = require("@onekeyfe/extension-bridge-injected");
24
23
  const ProviderCosmosBase_1 = require("./ProviderCosmosBase");
@@ -172,9 +171,9 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
172
171
  });
173
172
  return Object.assign(Object.assign({}, key), {
174
173
  // @ts-expect-error
175
- pubKey: (0, utils_1.hexToBytes)(key.pubKey),
174
+ pubKey: (0, cross_inpage_provider_core_1.hexToBytes)(key.pubKey),
176
175
  // @ts-expect-error
177
- address: (0, utils_1.hexToBytes)(key.address) });
176
+ address: (0, cross_inpage_provider_core_1.hexToBytes)(key.address) });
178
177
  });
179
178
  }
180
179
  disconnect() {
@@ -192,9 +191,9 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
192
191
  });
193
192
  return Object.assign(Object.assign({}, key), {
194
193
  // @ts-expect-error
195
- pubKey: (0, utils_1.hexToBytes)(key.pubKey),
194
+ pubKey: (0, cross_inpage_provider_core_1.hexToBytes)(key.pubKey),
196
195
  // @ts-expect-error
197
- address: (0, utils_1.hexToBytes)(key.address) });
196
+ address: (0, cross_inpage_provider_core_1.hexToBytes)(key.address) });
198
197
  });
199
198
  }
200
199
  ping() {
@@ -229,8 +228,8 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
229
228
  chainId,
230
229
  signer,
231
230
  signDoc: {
232
- bodyBytes: (signDoc === null || signDoc === void 0 ? void 0 : signDoc.bodyBytes) ? (0, utils_1.bytesToHex)(signDoc === null || signDoc === void 0 ? void 0 : signDoc.bodyBytes) : null,
233
- authInfoBytes: (signDoc === null || signDoc === void 0 ? void 0 : signDoc.authInfoBytes) ? (0, utils_1.bytesToHex)(signDoc === null || signDoc === void 0 ? void 0 : signDoc.authInfoBytes) : null,
231
+ bodyBytes: (signDoc === null || signDoc === void 0 ? void 0 : signDoc.bodyBytes) ? (0, cross_inpage_provider_core_1.bytesToHex)(signDoc === null || signDoc === void 0 ? void 0 : signDoc.bodyBytes) : null,
232
+ authInfoBytes: (signDoc === null || signDoc === void 0 ? void 0 : signDoc.authInfoBytes) ? (0, cross_inpage_provider_core_1.bytesToHex)(signDoc === null || signDoc === void 0 ? void 0 : signDoc.authInfoBytes) : null,
234
233
  chainId: signDoc.chainId,
235
234
  accountNumber: (_a = signDoc === null || signDoc === void 0 ? void 0 : signDoc.accountNumber) === null || _a === void 0 ? void 0 : _a.toString(),
236
235
  },
@@ -239,9 +238,9 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
239
238
  });
240
239
  return Object.assign(Object.assign({}, res), { signed: {
241
240
  // @ts-expect-error
242
- bodyBytes: (0, utils_1.hexToBytes)(res.signed.bodyBytes),
241
+ bodyBytes: (0, cross_inpage_provider_core_1.hexToBytes)(res.signed.bodyBytes),
243
242
  // @ts-expect-error
244
- authInfoBytes: (0, utils_1.hexToBytes)(res.signed.authInfoBytes),
243
+ authInfoBytes: (0, cross_inpage_provider_core_1.hexToBytes)(res.signed.authInfoBytes),
245
244
  // @ts-ignore
246
245
  accountNumber: (customOptions === null || customOptions === void 0 ? void 0 : customOptions.typeLongToString) ? (_b = res.signed.accountNumber) === null || _b === void 0 ? void 0 : _b.toString() : long_1.default.fromString(res.signed.accountNumber),
247
246
  chainId: res.signed.chainId,
@@ -255,15 +254,15 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
255
254
  // @ts-expect-error
256
255
  params: {
257
256
  chainId,
258
- tx: (0, utils_1.bytesToHex)(tx),
257
+ tx: (0, cross_inpage_provider_core_1.bytesToHex)(tx),
259
258
  mode,
260
259
  },
261
260
  });
262
- return (0, utils_1.hexToBytes)(res);
261
+ return (0, cross_inpage_provider_core_1.hexToBytes)(res);
263
262
  });
264
263
  }
265
264
  signArbitrary(chainId, signer, data) {
266
- const newData = typeof data === 'string' ? data : (0, utils_1.bytesToHex)(data);
265
+ const newData = typeof data === 'string' ? data : (0, cross_inpage_provider_core_1.bytesToHex)(data);
267
266
  return this._callBridge({
268
267
  method: 'signArbitrary',
269
268
  // @ts-expect-error
@@ -281,7 +280,7 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
281
280
  params: {
282
281
  chainId,
283
282
  signer,
284
- data: typeof data === 'string' ? data : (0, utils_1.bytesToHex)(data),
283
+ data: typeof data === 'string' ? data : (0, cross_inpage_provider_core_1.bytesToHex)(data),
285
284
  signature,
286
285
  },
287
286
  });
@@ -294,11 +293,11 @@ class ProviderCosmos extends ProviderCosmosBase_1.ProviderCosmosBase {
294
293
  params: {
295
294
  chainId,
296
295
  signer,
297
- data: typeof data === 'string' ? data : (0, utils_1.bytesToHex)(data),
296
+ data: typeof data === 'string' ? data : (0, cross_inpage_provider_core_1.bytesToHex)(data),
298
297
  type,
299
298
  },
300
299
  });
301
- return (0, utils_1.hexToBytes)(res);
300
+ return (0, cross_inpage_provider_core_1.hexToBytes)(res);
302
301
  });
303
302
  }
304
303
  getOfflineSigner(chainId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/onekey-cosmos-provider",
3
- "version": "2.2.26",
3
+ "version": "2.2.27",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -28,11 +28,10 @@
28
28
  "start": "tsc --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@noble/hashes": "^1.3.0",
32
- "@onekeyfe/cross-inpage-provider-core": "2.2.26",
33
- "@onekeyfe/cross-inpage-provider-errors": "2.2.26",
34
- "@onekeyfe/cross-inpage-provider-types": "2.2.26",
35
- "@onekeyfe/extension-bridge-injected": "2.2.26",
31
+ "@onekeyfe/cross-inpage-provider-core": "2.2.27",
32
+ "@onekeyfe/cross-inpage-provider-errors": "2.2.27",
33
+ "@onekeyfe/cross-inpage-provider-types": "2.2.27",
34
+ "@onekeyfe/extension-bridge-injected": "2.2.27",
36
35
  "eth-rpc-errors": "^4.0.3",
37
36
  "lodash-es": "^4.17.21",
38
37
  "long": "^4.0.0",
@@ -42,5 +41,5 @@
42
41
  "@types/lodash-es": "^4.17.12",
43
42
  "@types/long": "^4.0.0"
44
43
  },
45
- "gitHead": "bbf6e9bae844ea2d5aaed884a4ace9cc8051569d"
44
+ "gitHead": "6c2609b5fa195eab214606d197c1d078e019cce0"
46
45
  }