@injectivelabs/wallet-turnkey 1.16.36 → 1.16.38-alpha.0
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 +681 -0
- package/dist/cjs/index.d.cts +92 -0
- package/dist/cjs/package.json +2 -2
- package/dist/esm/index.d.ts +92 -3
- package/dist/esm/index.js +680 -3
- package/dist/esm/package.json +2 -2
- package/package.json +33 -42
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.js +0 -21
- package/dist/cjs/strategy/Eip1193Provider.d.ts +0 -3
- package/dist/cjs/strategy/Eip1193Provider.js +0 -131
- package/dist/cjs/strategy/consts.d.ts +0 -13
- package/dist/cjs/strategy/consts.js +0 -16
- package/dist/cjs/strategy/strategy.d.ts +0 -48
- package/dist/cjs/strategy/strategy.js +0 -275
- package/dist/cjs/strategy/turnkey/oauth.d.ts +0 -16
- package/dist/cjs/strategy/turnkey/oauth.js +0 -53
- package/dist/cjs/strategy/turnkey/otp.d.ts +0 -23
- package/dist/cjs/strategy/turnkey/otp.js +0 -65
- package/dist/cjs/strategy/turnkey/turnkey.d.ts +0 -35
- package/dist/cjs/strategy/turnkey/turnkey.js +0 -259
- package/dist/cjs/strategy/types.d.ts +0 -28
- package/dist/cjs/strategy/types.js +0 -6
- package/dist/cjs/utils.d.ts +0 -7
- package/dist/cjs/utils.js +0 -10
- package/dist/esm/strategy/Eip1193Provider.d.ts +0 -3
- package/dist/esm/strategy/Eip1193Provider.js +0 -127
- package/dist/esm/strategy/consts.d.ts +0 -13
- package/dist/esm/strategy/consts.js +0 -13
- package/dist/esm/strategy/strategy.d.ts +0 -48
- package/dist/esm/strategy/strategy.js +0 -271
- package/dist/esm/strategy/turnkey/oauth.d.ts +0 -16
- package/dist/esm/strategy/turnkey/oauth.js +0 -49
- package/dist/esm/strategy/turnkey/otp.d.ts +0 -23
- package/dist/esm/strategy/turnkey/otp.js +0 -61
- package/dist/esm/strategy/turnkey/turnkey.d.ts +0 -35
- package/dist/esm/strategy/turnkey/turnkey.js +0 -255
- package/dist/esm/strategy/types.d.ts +0 -28
- package/dist/esm/strategy/types.js +0 -3
- package/dist/esm/utils.d.ts +0 -7
- package/dist/esm/utils.js +0 -7
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { HttpRestClient } from "@injectivelabs/utils";
|
|
2
|
+
import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, TurnkeyMetadata, TurnkeyProvider, WalletDeviceType, WalletMetadata, WalletStrategyEvmOptions } from "@injectivelabs/wallet-base";
|
|
3
|
+
import { AccountAddress, EvmChainId } from "@injectivelabs/ts-types";
|
|
4
|
+
import * as _turnkey_sdk_browser0 from "@turnkey/sdk-browser";
|
|
5
|
+
import { Turnkey, TurnkeyIndexedDbClient } from "@turnkey/sdk-browser";
|
|
6
|
+
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts";
|
|
7
|
+
import { createAccount } from "@turnkey/viem";
|
|
8
|
+
|
|
9
|
+
//#region src/strategy/strategy.d.ts
|
|
10
|
+
declare class TurnkeyWalletStrategy extends BaseConcreteStrategy implements ConcreteWalletStrategy {
|
|
11
|
+
turnkeyWallet?: TurnkeyWallet$1;
|
|
12
|
+
evmOptions: WalletStrategyEvmOptions;
|
|
13
|
+
client: HttpRestClient;
|
|
14
|
+
constructor(args: ConcreteEvmWalletStrategyArgs & {
|
|
15
|
+
apiServerEndpoint?: string;
|
|
16
|
+
});
|
|
17
|
+
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
18
|
+
setMetadata(metadata?: {
|
|
19
|
+
turnkey?: Partial<WalletMetadata['turnkey']>;
|
|
20
|
+
}): void;
|
|
21
|
+
enable(): Promise<boolean>;
|
|
22
|
+
disconnect(): Promise<void>;
|
|
23
|
+
getAddresses(): Promise<string[]>;
|
|
24
|
+
getSessionOrConfirm(_address?: string): Promise<string>;
|
|
25
|
+
getWalletClient<TurnkeyWallet$1>(): Promise<TurnkeyWallet$1>;
|
|
26
|
+
sendEvmTransaction(transaction: unknown, args: {
|
|
27
|
+
address: AccountAddress;
|
|
28
|
+
evmChainId: EvmChainId;
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
sendTransaction(transaction: TxRaw, options: SendTransactionOptions): Promise<any>;
|
|
31
|
+
signEip712TypedData(eip712json: string, address: AccountAddress): Promise<string>;
|
|
32
|
+
signCosmosTransaction(_transaction: {
|
|
33
|
+
txRaw: TxRaw;
|
|
34
|
+
accountNumber: number;
|
|
35
|
+
chainId: string;
|
|
36
|
+
address: string;
|
|
37
|
+
}): Promise<DirectSignResponse>;
|
|
38
|
+
signAminoCosmosTransaction(_transaction: {
|
|
39
|
+
address: string;
|
|
40
|
+
signDoc: StdSignDoc;
|
|
41
|
+
}): Promise<AminoSignResponse>;
|
|
42
|
+
signArbitrary(_signer: AccountAddress, _data: string | Uint8Array): Promise<string>;
|
|
43
|
+
getEthereumChainId(): Promise<string>;
|
|
44
|
+
getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<Record<string, any>>;
|
|
45
|
+
getPubKey(): Promise<string>;
|
|
46
|
+
getIndexedDbClient(): Promise<TurnkeyIndexedDbClient>;
|
|
47
|
+
private getTurnkeyWallet;
|
|
48
|
+
getEip1193Provider(): Promise<Eip1193Provider>;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/strategy/types.d.ts
|
|
52
|
+
type TurnkeyOTPCredentialsResponse = {
|
|
53
|
+
otpId: string;
|
|
54
|
+
organizationId: string;
|
|
55
|
+
};
|
|
56
|
+
type TurnkeyConfirmEmailOTPResponse = {
|
|
57
|
+
session: string;
|
|
58
|
+
organizationId: string;
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/strategy/turnkey/turnkey.d.ts
|
|
62
|
+
declare class TurnkeyWallet {
|
|
63
|
+
private otpId?;
|
|
64
|
+
protected turnkey?: Turnkey;
|
|
65
|
+
userOrganizationId?: string;
|
|
66
|
+
protected client: HttpRestClient;
|
|
67
|
+
private metadata;
|
|
68
|
+
protected indexedDbClient?: TurnkeyIndexedDbClient;
|
|
69
|
+
private accountMap;
|
|
70
|
+
setMetadata(metadata: Partial<TurnkeyMetadata>): void;
|
|
71
|
+
constructor(metadata: TurnkeyMetadata);
|
|
72
|
+
static getTurnkeyInstance(metadata: TurnkeyMetadata): Promise<{
|
|
73
|
+
turnkey: Turnkey;
|
|
74
|
+
indexedDbClient: TurnkeyIndexedDbClient;
|
|
75
|
+
}>;
|
|
76
|
+
getTurnkey(): Promise<Turnkey>;
|
|
77
|
+
getIndexedDbClient(): Promise<TurnkeyIndexedDbClient>;
|
|
78
|
+
getSession(existingCredentialBundle?: string): Promise<{
|
|
79
|
+
session: _turnkey_sdk_browser0.Session | undefined;
|
|
80
|
+
organizationId: string;
|
|
81
|
+
}>;
|
|
82
|
+
getAccounts(): Promise<string[]>;
|
|
83
|
+
getOrCreateAndGetAccount(address: string): Promise<ReturnType<typeof createAccount>>;
|
|
84
|
+
initOTP(email: string): Promise<TurnkeyOTPCredentialsResponse>;
|
|
85
|
+
confirmOTP(otpCode: string): Promise<TurnkeyConfirmEmailOTPResponse>;
|
|
86
|
+
initOAuth(provider: TurnkeyProvider): Promise<string>;
|
|
87
|
+
confirmOAuth(provider: TurnkeyProvider, oidcToken: string): Promise<string>;
|
|
88
|
+
refreshSession(): Promise<string>;
|
|
89
|
+
private initClient;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { TurnkeyWallet, TurnkeyWalletStrategy };
|
package/dist/cjs/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
"type": "commonjs"
|
|
3
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,3 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts";
|
|
2
|
+
import { HttpRestClient } from "@injectivelabs/utils";
|
|
3
|
+
import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, TurnkeyMetadata, TurnkeyProvider, WalletDeviceType, WalletMetadata, WalletStrategyEvmOptions } from "@injectivelabs/wallet-base";
|
|
4
|
+
import { createAccount } from "@turnkey/viem";
|
|
5
|
+
import * as _turnkey_sdk_browser0 from "@turnkey/sdk-browser";
|
|
6
|
+
import { Turnkey, TurnkeyIndexedDbClient } from "@turnkey/sdk-browser";
|
|
7
|
+
import { AccountAddress, EvmChainId } from "@injectivelabs/ts-types";
|
|
8
|
+
|
|
9
|
+
//#region src/strategy/strategy.d.ts
|
|
10
|
+
declare class TurnkeyWalletStrategy extends BaseConcreteStrategy implements ConcreteWalletStrategy {
|
|
11
|
+
turnkeyWallet?: TurnkeyWallet$1;
|
|
12
|
+
evmOptions: WalletStrategyEvmOptions;
|
|
13
|
+
client: HttpRestClient;
|
|
14
|
+
constructor(args: ConcreteEvmWalletStrategyArgs & {
|
|
15
|
+
apiServerEndpoint?: string;
|
|
16
|
+
});
|
|
17
|
+
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
18
|
+
setMetadata(metadata?: {
|
|
19
|
+
turnkey?: Partial<WalletMetadata['turnkey']>;
|
|
20
|
+
}): void;
|
|
21
|
+
enable(): Promise<boolean>;
|
|
22
|
+
disconnect(): Promise<void>;
|
|
23
|
+
getAddresses(): Promise<string[]>;
|
|
24
|
+
getSessionOrConfirm(_address?: string): Promise<string>;
|
|
25
|
+
getWalletClient<TurnkeyWallet$1>(): Promise<TurnkeyWallet$1>;
|
|
26
|
+
sendEvmTransaction(transaction: unknown, args: {
|
|
27
|
+
address: AccountAddress;
|
|
28
|
+
evmChainId: EvmChainId;
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
sendTransaction(transaction: TxRaw, options: SendTransactionOptions): Promise<any>;
|
|
31
|
+
signEip712TypedData(eip712json: string, address: AccountAddress): Promise<string>;
|
|
32
|
+
signCosmosTransaction(_transaction: {
|
|
33
|
+
txRaw: TxRaw;
|
|
34
|
+
accountNumber: number;
|
|
35
|
+
chainId: string;
|
|
36
|
+
address: string;
|
|
37
|
+
}): Promise<DirectSignResponse>;
|
|
38
|
+
signAminoCosmosTransaction(_transaction: {
|
|
39
|
+
address: string;
|
|
40
|
+
signDoc: StdSignDoc;
|
|
41
|
+
}): Promise<AminoSignResponse>;
|
|
42
|
+
signArbitrary(_signer: AccountAddress, _data: string | Uint8Array): Promise<string>;
|
|
43
|
+
getEthereumChainId(): Promise<string>;
|
|
44
|
+
getEvmTransactionReceipt(txHash: string, evmChainId?: EvmChainId): Promise<Record<string, any>>;
|
|
45
|
+
getPubKey(): Promise<string>;
|
|
46
|
+
getIndexedDbClient(): Promise<TurnkeyIndexedDbClient>;
|
|
47
|
+
private getTurnkeyWallet;
|
|
48
|
+
getEip1193Provider(): Promise<Eip1193Provider>;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/strategy/types.d.ts
|
|
52
|
+
type TurnkeyOTPCredentialsResponse = {
|
|
53
|
+
otpId: string;
|
|
54
|
+
organizationId: string;
|
|
55
|
+
};
|
|
56
|
+
type TurnkeyConfirmEmailOTPResponse = {
|
|
57
|
+
session: string;
|
|
58
|
+
organizationId: string;
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/strategy/turnkey/turnkey.d.ts
|
|
62
|
+
declare class TurnkeyWallet {
|
|
63
|
+
private otpId?;
|
|
64
|
+
protected turnkey?: Turnkey;
|
|
65
|
+
userOrganizationId?: string;
|
|
66
|
+
protected client: HttpRestClient;
|
|
67
|
+
private metadata;
|
|
68
|
+
protected indexedDbClient?: TurnkeyIndexedDbClient;
|
|
69
|
+
private accountMap;
|
|
70
|
+
setMetadata(metadata: Partial<TurnkeyMetadata>): void;
|
|
71
|
+
constructor(metadata: TurnkeyMetadata);
|
|
72
|
+
static getTurnkeyInstance(metadata: TurnkeyMetadata): Promise<{
|
|
73
|
+
turnkey: Turnkey;
|
|
74
|
+
indexedDbClient: TurnkeyIndexedDbClient;
|
|
75
|
+
}>;
|
|
76
|
+
getTurnkey(): Promise<Turnkey>;
|
|
77
|
+
getIndexedDbClient(): Promise<TurnkeyIndexedDbClient>;
|
|
78
|
+
getSession(existingCredentialBundle?: string): Promise<{
|
|
79
|
+
session: _turnkey_sdk_browser0.Session | undefined;
|
|
80
|
+
organizationId: string;
|
|
81
|
+
}>;
|
|
82
|
+
getAccounts(): Promise<string[]>;
|
|
83
|
+
getOrCreateAndGetAccount(address: string): Promise<ReturnType<typeof createAccount>>;
|
|
84
|
+
initOTP(email: string): Promise<TurnkeyOTPCredentialsResponse>;
|
|
85
|
+
confirmOTP(otpCode: string): Promise<TurnkeyConfirmEmailOTPResponse>;
|
|
86
|
+
initOAuth(provider: TurnkeyProvider): Promise<string>;
|
|
87
|
+
confirmOAuth(provider: TurnkeyProvider, oidcToken: string): Promise<string>;
|
|
88
|
+
refreshSession(): Promise<string>;
|
|
89
|
+
private initClient;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { TurnkeyWallet, TurnkeyWalletStrategy };
|