@injectivelabs/wallet-turnkey 1.16.38-alpha.1 → 1.16.38-alpha.3

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.
@@ -1,6 +1,7 @@
1
1
  let viem = require("viem");
2
- let __injectivelabs_sdk_ts = require("@injectivelabs/sdk-ts");
3
2
  let __injectivelabs_utils = require("@injectivelabs/utils");
3
+ let __injectivelabs_sdk_ts_core_tx = require("@injectivelabs/sdk-ts/core/tx");
4
+ let __injectivelabs_sdk_ts_utils = require("@injectivelabs/sdk-ts/utils");
4
5
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
5
6
  let __injectivelabs_wallet_base = require("@injectivelabs/wallet-base");
6
7
  let __turnkey_viem = require("@turnkey/viem");
@@ -79,7 +80,7 @@ var TurnkeyOauthWallet = class {
79
80
  await indexedDbClient.resetKeyPair();
80
81
  const targetPublicKey = await indexedDbClient.getPublicKey();
81
82
  if (!targetPublicKey) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("Target public key not found"));
82
- return Array.from((0, __injectivelabs_sdk_ts.sha256)(new TextEncoder().encode(targetPublicKey))).map((b) => b.toString(16).padStart(2, "0")).join("");
83
+ return Array.from((0, __injectivelabs_sdk_ts_utils.sha256)(new TextEncoder().encode(targetPublicKey))).map((b) => b.toString(16).padStart(2, "0")).join("");
83
84
  } catch (e) {
84
85
  throw new __injectivelabs_exceptions.WalletException(new Error(e.message), {
85
86
  code: __injectivelabs_exceptions.UnspecifiedErrorCode,
@@ -233,7 +234,7 @@ var TurnkeyWallet = class {
233
234
  })))).filter((account) => account.status === "fulfilled").flatMap((result) => {
234
235
  var _result$value;
235
236
  return (_result$value = result.value) === null || _result$value === void 0 ? void 0 : _result$value.accounts;
236
- }).filter((wa) => !!wa && wa.addressFormat === "ADDRESS_FORMAT_ETHEREUM" && !!wa.address).map((account) => (0, __injectivelabs_sdk_ts.getInjectiveAddress)(account.address));
237
+ }).filter((wa) => !!wa && wa.addressFormat === "ADDRESS_FORMAT_ETHEREUM" && !!wa.address).map((account) => (0, __injectivelabs_sdk_ts_utils.getInjectiveAddress)(account.address));
237
238
  } catch (e) {
238
239
  if (e.code === TurnkeyErrorCodes.UserLoggedOut) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("User is not logged in"), {
239
240
  code: __injectivelabs_exceptions.UnspecifiedErrorCode,
@@ -581,7 +582,7 @@ var TurnkeyWalletStrategy = class extends __injectivelabs_wallet_base.BaseConcre
581
582
  async sendTransaction(transaction, options) {
582
583
  const { endpoints, txTimeout } = options;
583
584
  if (!endpoints) throw new __injectivelabs_exceptions.WalletException(/* @__PURE__ */ new Error("You have to pass endpoints.grpc within the options for using Turnkey wallet"));
584
- const response = await new __injectivelabs_sdk_ts.TxGrpcApi(endpoints.grpc).broadcast(transaction, { txTimeout });
585
+ const response = await new __injectivelabs_sdk_ts_core_tx.TxGrpcApi(endpoints.grpc).broadcast(transaction, { txTimeout });
585
586
  if (response.code !== 0) throw new __injectivelabs_exceptions.TransactionException(new Error(response.rawLog), {
586
587
  code: __injectivelabs_exceptions.UnspecifiedErrorCode,
587
588
  contextCode: response.code,
@@ -671,7 +672,7 @@ var TurnkeyWalletStrategy = class extends __injectivelabs_wallet_base.BaseConcre
671
672
  }
672
673
  async getEip1193Provider() {
673
674
  const turnkeyWallet = await this.getTurnkeyWallet();
674
- const checksumAddress = (0, viem.getAddress)((0, __injectivelabs_sdk_ts.getEthereumAddress)((await turnkeyWallet.getAccounts())[0]));
675
+ const checksumAddress = (0, viem.getAddress)((0, __injectivelabs_sdk_ts_utils.getEthereumAddress)((await turnkeyWallet.getAccounts())[0]));
675
676
  return await getEip1193ProviderForTurnkey(await turnkeyWallet.getOrCreateAndGetAccount(checksumAddress), String(this.evmOptions.evmChainId));
676
677
  }
677
678
  };
@@ -3,7 +3,7 @@ import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStra
3
3
  import { AccountAddress, EvmChainId } from "@injectivelabs/ts-types";
4
4
  import * as _turnkey_sdk_browser0 from "@turnkey/sdk-browser";
5
5
  import { Turnkey, TurnkeyIndexedDbClient } from "@turnkey/sdk-browser";
6
- import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts";
6
+ import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
7
7
  import { createAccount } from "@turnkey/viem";
8
8
 
9
9
  //#region src/strategy/strategy.d.ts
@@ -1,10 +1,10 @@
1
- import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts";
2
1
  import { HttpRestClient } from "@injectivelabs/utils";
3
2
  import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, TurnkeyMetadata, TurnkeyProvider, WalletDeviceType, WalletMetadata, WalletStrategyEvmOptions } from "@injectivelabs/wallet-base";
4
3
  import { createAccount } from "@turnkey/viem";
5
4
  import * as _turnkey_sdk_browser0 from "@turnkey/sdk-browser";
6
5
  import { Turnkey, TurnkeyIndexedDbClient } from "@turnkey/sdk-browser";
7
6
  import { AccountAddress, EvmChainId } from "@injectivelabs/ts-types";
7
+ import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
8
8
 
9
9
  //#region src/strategy/strategy.d.ts
10
10
  declare class TurnkeyWalletStrategy extends BaseConcreteStrategy implements ConcreteWalletStrategy {
package/dist/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { getAddress } from "viem";
2
- import { TxGrpcApi, getEthereumAddress, getInjectiveAddress, sha256 } from "@injectivelabs/sdk-ts";
3
2
  import { HttpRestClient } from "@injectivelabs/utils";
3
+ import { TxGrpcApi } from "@injectivelabs/sdk-ts/core/tx";
4
+ import { getEthereumAddress, getInjectiveAddress, sha256 } from "@injectivelabs/sdk-ts/utils";
4
5
  import { CosmosWalletException, ErrorType, GeneralException, TransactionException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletException } from "@injectivelabs/exceptions";
5
6
  import { BaseConcreteStrategy, TurnkeyProvider, WalletAction, WalletDeviceType, getEvmChainConfig, getViemPublicClient, getViemWalletClient } from "@injectivelabs/wallet-base";
6
7
  import { createAccount } from "@turnkey/viem";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-turnkey",
3
- "version": "1.16.38-alpha.1",
3
+ "version": "1.16.38-alpha.3",
4
4
  "description": "Turnkey wallet strategy for use with @injectivelabs/wallet-core.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,6 +37,22 @@
37
37
  "files": [
38
38
  "dist"
39
39
  ],
40
+ "dependencies": {
41
+ "@turnkey/sdk-browser": "5.2.3",
42
+ "@turnkey/viem": "^0.9.10",
43
+ "viem": "^2.40.3",
44
+ "@injectivelabs/sdk-ts": "1.16.38-alpha.3",
45
+ "@injectivelabs/ts-types": "1.16.38-alpha.1",
46
+ "@injectivelabs/exceptions": "1.16.38-alpha.2",
47
+ "@injectivelabs/utils": "1.16.38-alpha.2",
48
+ "@injectivelabs/wallet-base": "1.16.38-alpha.3"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "_moduleAliases": {
54
+ "~wallet-turnkey": "dist"
55
+ },
40
56
  "scripts": {
41
57
  "build": "pnpm type-check && tsdown",
42
58
  "build:fast": "tsdown",
@@ -51,22 +67,5 @@
51
67
  "dev": "ts-node -r tsconfig-paths/register src/index.ts",
52
68
  "start": "node dist/index.js",
53
69
  "lint": "eslint . --ext .ts,.js"
54
- },
55
- "dependencies": {
56
- "@injectivelabs/exceptions": "1.16.38-alpha.0",
57
- "@injectivelabs/sdk-ts": "1.16.38-alpha.1",
58
- "@injectivelabs/ts-types": "1.16.38-alpha.0",
59
- "@injectivelabs/utils": "1.16.38-alpha.0",
60
- "@injectivelabs/wallet-base": "1.16.38-alpha.1",
61
- "@turnkey/sdk-browser": "5.2.3",
62
- "@turnkey/viem": "^0.9.10",
63
- "viem": "catalog:"
64
- },
65
- "publishConfig": {
66
- "access": "public"
67
- },
68
- "_moduleAliases": {
69
- "~wallet-turnkey": "dist"
70
- },
71
- "gitHead": "35dab975c20dbf43d52a85fb161cf810c46d8f6f"
72
- }
70
+ }
71
+ }