@injectivelabs/wallet-turnkey 1.19.23 → 1.19.25
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 +19 -6
- package/dist/cjs/index.d.cts +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +20 -7
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -823,12 +823,25 @@ var TurnkeyWalletStrategy = class extends __injectivelabs_wallet_base.BaseConcre
|
|
|
823
823
|
contextModule: __injectivelabs_wallet_base.WalletAction.SignTransaction
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
|
-
async signArbitrary(
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
826
|
+
async signArbitrary(signer, data) {
|
|
827
|
+
try {
|
|
828
|
+
const turnkeyWallet = await this.getTurnkeyWallet();
|
|
829
|
+
const checksumAddress = (0, viem.getAddress)((0, __injectivelabs_sdk_ts_utils.getEthereumAddress)(signer));
|
|
830
|
+
return await (await getEip1193ProviderForTurnkey(await turnkeyWallet.getOrCreateAndGetAccount(checksumAddress), String(this.evmOptions.evmChainId), {
|
|
831
|
+
rpcUrl: this.evmOptions.rpcUrl,
|
|
832
|
+
rpcUrls: this.evmOptions.rpcUrls
|
|
833
|
+
})).request({
|
|
834
|
+
method: "personal_sign",
|
|
835
|
+
params: [(0, __injectivelabs_sdk_ts_utils.toUtf8)(data), checksumAddress]
|
|
836
|
+
});
|
|
837
|
+
} catch (e) {
|
|
838
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
839
|
+
throw new __injectivelabs_exceptions.WalletException(new Error(message), {
|
|
840
|
+
code: __injectivelabs_exceptions.UnspecifiedErrorCode,
|
|
841
|
+
type: __injectivelabs_exceptions.ErrorType.WalletError,
|
|
842
|
+
contextModule: __injectivelabs_wallet_base.WalletAction.SignArbitrary
|
|
843
|
+
});
|
|
844
|
+
}
|
|
832
845
|
}
|
|
833
846
|
async getEthereumChainId() {
|
|
834
847
|
throw new __injectivelabs_exceptions.CosmosWalletException(/* @__PURE__ */ new Error("getEthereumChainId is not supported on Turnkey wallet"), {
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -44,7 +44,7 @@ declare class TurnkeyWalletStrategy extends BaseConcreteStrategy implements Conc
|
|
|
44
44
|
address: string;
|
|
45
45
|
signDoc: StdSignDoc;
|
|
46
46
|
}): Promise<AminoSignResponse>;
|
|
47
|
-
signArbitrary(
|
|
47
|
+
signArbitrary(signer: AccountAddress, data: string | Uint8Array): Promise<string>;
|
|
48
48
|
getEthereumChainId(): Promise<string>;
|
|
49
49
|
getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<Record<string, any>>;
|
|
50
50
|
getPubKey(): Promise<string>;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ declare class TurnkeyWalletStrategy extends BaseConcreteStrategy implements Conc
|
|
|
44
44
|
address: string;
|
|
45
45
|
signDoc: StdSignDoc;
|
|
46
46
|
}): Promise<AminoSignResponse>;
|
|
47
|
-
signArbitrary(
|
|
47
|
+
signArbitrary(signer: AccountAddress, data: string | Uint8Array): Promise<string>;
|
|
48
48
|
getEthereumChainId(): Promise<string>;
|
|
49
49
|
getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<Record<string, any>>;
|
|
50
50
|
getPubKey(): Promise<string>;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAddress, hashTypedData } from "viem";
|
|
2
2
|
import { HttpRestClient } from "@injectivelabs/utils";
|
|
3
3
|
import { TxGrpcApi } from "@injectivelabs/sdk-ts/core/tx";
|
|
4
|
-
import { getEthereumAddress, getInjectiveAddress, sha256 } from "@injectivelabs/sdk-ts/utils";
|
|
4
|
+
import { getEthereumAddress, getInjectiveAddress, sha256, toUtf8 } from "@injectivelabs/sdk-ts/utils";
|
|
5
5
|
import { CosmosWalletException, ErrorType, GeneralException, TransactionException, TurnkeyWalletSessionException, UnspecifiedErrorCode, WalletException } from "@injectivelabs/exceptions";
|
|
6
6
|
import { BaseConcreteStrategy, TurnkeyProvider, WalletAction, WalletDeviceType, getEvmChainConfig, getViemPublicClient, getViemWalletClient } from "@injectivelabs/wallet-base";
|
|
7
7
|
import { createAccount } from "@turnkey/viem";
|
|
@@ -823,12 +823,25 @@ var TurnkeyWalletStrategy = class extends BaseConcreteStrategy {
|
|
|
823
823
|
contextModule: WalletAction.SignTransaction
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
|
-
async signArbitrary(
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
826
|
+
async signArbitrary(signer, data) {
|
|
827
|
+
try {
|
|
828
|
+
const turnkeyWallet = await this.getTurnkeyWallet();
|
|
829
|
+
const checksumAddress = getAddress(getEthereumAddress(signer));
|
|
830
|
+
return await (await getEip1193ProviderForTurnkey(await turnkeyWallet.getOrCreateAndGetAccount(checksumAddress), String(this.evmOptions.evmChainId), {
|
|
831
|
+
rpcUrl: this.evmOptions.rpcUrl,
|
|
832
|
+
rpcUrls: this.evmOptions.rpcUrls
|
|
833
|
+
})).request({
|
|
834
|
+
method: "personal_sign",
|
|
835
|
+
params: [toUtf8(data), checksumAddress]
|
|
836
|
+
});
|
|
837
|
+
} catch (e) {
|
|
838
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
839
|
+
throw new WalletException(new Error(message), {
|
|
840
|
+
code: UnspecifiedErrorCode,
|
|
841
|
+
type: ErrorType.WalletError,
|
|
842
|
+
contextModule: WalletAction.SignArbitrary
|
|
843
|
+
});
|
|
844
|
+
}
|
|
832
845
|
}
|
|
833
846
|
async getEthereumChainId() {
|
|
834
847
|
throw new CosmosWalletException(/* @__PURE__ */ new Error("getEthereumChainId is not supported on Turnkey wallet"), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-turnkey",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.25",
|
|
4
4
|
"description": "Turnkey wallet strategy for use with @injectivelabs/wallet-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"@turnkey/sdk-browser": "5.16.1",
|
|
46
46
|
"@turnkey/viem": "0.13.1",
|
|
47
47
|
"viem": "^2.41.2",
|
|
48
|
-
"@injectivelabs/
|
|
49
|
-
"@injectivelabs/
|
|
50
|
-
"@injectivelabs/wallet-base": "1.19.
|
|
51
|
-
"@injectivelabs/
|
|
52
|
-
"@injectivelabs/
|
|
48
|
+
"@injectivelabs/exceptions": "1.19.25",
|
|
49
|
+
"@injectivelabs/sdk-ts": "1.19.25",
|
|
50
|
+
"@injectivelabs/wallet-base": "1.19.25",
|
|
51
|
+
"@injectivelabs/ts-types": "1.19.25",
|
|
52
|
+
"@injectivelabs/utils": "1.19.25"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|