@injectivelabs/wallet-turnkey 1.16.38-alpha.2 → 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.
- package/dist/cjs/index.cjs +6 -5
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -1
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -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,
|
|
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,
|
|
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
|
|
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,
|
|
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
|
};
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -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
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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.
|
|
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": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@turnkey/sdk-browser": "5.2.3",
|
|
42
42
|
"@turnkey/viem": "^0.9.10",
|
|
43
43
|
"viem": "^2.40.3",
|
|
44
|
-
"@injectivelabs/
|
|
45
|
-
"@injectivelabs/sdk-ts": "1.16.38-alpha.2",
|
|
44
|
+
"@injectivelabs/sdk-ts": "1.16.38-alpha.3",
|
|
46
45
|
"@injectivelabs/ts-types": "1.16.38-alpha.1",
|
|
47
|
-
"@injectivelabs/
|
|
48
|
-
"@injectivelabs/
|
|
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
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|