@talken/talkenkit 2.4.30 → 2.5.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/{abcWallet-TLGPQAMU.js → abcWallet-5GTT47V6.js} +1 -1
- package/dist/{chunk-MI7TNBED.js → chunk-REVMSQIO.js} +287 -71
- package/dist/index.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/abcAccessKeyProvider.d.ts +43 -0
- package/dist/wallets/walletConnectors/abcWallet/abcAccessKeyProvider.js +11 -0
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +4 -2
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +2 -1
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.d.ts +7 -0
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +5 -3
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/index.js +8 -6
- package/dist/wallets/walletConnectors/abcWallet/types.d.ts +2 -0
- package/dist/wallets/walletConnectors/{chunk-HHZ3JZRH.js → chunk-HWXOTEC3.js} +12 -2
- package/dist/wallets/walletConnectors/chunk-K66HU6GX.js +732 -0
- package/dist/wallets/walletConnectors/{chunk-XNA5NIFE.js → chunk-QSP2A4LA.js} +5 -2
- package/dist/wallets/walletConnectors/chunk-S2SQYPGR.js +220 -0
- package/dist/wallets/walletConnectors/{chunk-NU3ITJNK.js → chunk-TQHS6APN.js} +7 -731
- package/dist/wallets/walletConnectors/index.js +31 -29
- package/package.json +1 -1
- package/dist/wallets/walletConnectors/chunk-CABLJOMU.js +0 -194
- package/dist/wallets/walletConnectors/chunk-J3YPHDHM.js +0 -827
- package/dist/wallets/walletConnectors/chunk-J566FC7T.js +0 -54
- package/dist/wallets/walletConnectors/chunk-OHQXPSR6.js +0 -300
- package/dist/wallets/walletConnectors/chunk-OMOYFHBT.js +0 -1485
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ABC WaaS Access-Key EVM Provider
|
|
3
|
+
*
|
|
4
|
+
* EIP-1193 provider that uses X-Access-Key for server-side signing.
|
|
5
|
+
* Drop-in replacement for AbcEvmProvider (PIN mode) — no PIN required.
|
|
6
|
+
*
|
|
7
|
+
* Used in Telegram Mini App and other environments where the user
|
|
8
|
+
* has a pre-authenticated access-key stored in CloudStorage/localStorage.
|
|
9
|
+
*/
|
|
10
|
+
import type { AbcEvmWallet } from './types';
|
|
11
|
+
declare class EventEmitter {
|
|
12
|
+
private events;
|
|
13
|
+
on(event: string, listener: Function): this;
|
|
14
|
+
off(event: string, listener: Function): this;
|
|
15
|
+
removeListener(event: string, listener: Function): this;
|
|
16
|
+
emit(event: string, ...args: any[]): boolean;
|
|
17
|
+
removeAllListeners(event?: string): this;
|
|
18
|
+
}
|
|
19
|
+
interface RequestArguments {
|
|
20
|
+
method: string;
|
|
21
|
+
params?: unknown[] | Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export declare class AbcAccessKeyProvider extends EventEmitter {
|
|
24
|
+
private wallet;
|
|
25
|
+
private chainId;
|
|
26
|
+
private connected;
|
|
27
|
+
private accessKey;
|
|
28
|
+
private apiBaseUrl;
|
|
29
|
+
constructor(accessKey: string, apiBaseUrl?: string);
|
|
30
|
+
setWallet(wallet: AbcEvmWallet): void;
|
|
31
|
+
clearWallet(): void;
|
|
32
|
+
isConnected(): boolean;
|
|
33
|
+
getWallet(): AbcEvmWallet | null;
|
|
34
|
+
getChainId(): number;
|
|
35
|
+
setAccessKey(key: string): void;
|
|
36
|
+
request(args: RequestArguments): Promise<unknown>;
|
|
37
|
+
private sendTransaction;
|
|
38
|
+
private personalSign;
|
|
39
|
+
private signTypedData;
|
|
40
|
+
private apiPost;
|
|
41
|
+
private rpcCall;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
abcConnector
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-HWXOTEC3.js";
|
|
5
5
|
import "../chunk-R6ZE7JAZ.js";
|
|
6
6
|
import "../chunk-GFWUFYT2.js";
|
|
7
|
+
import "../chunk-S2SQYPGR.js";
|
|
7
8
|
import "../chunk-O4AU63LK.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-TQHS6APN.js";
|
|
10
|
+
import "../chunk-K66HU6GX.js";
|
|
9
11
|
import "../chunk-A66MTFML.js";
|
|
10
12
|
import "../chunk-BHEVY4QY.js";
|
|
11
13
|
import "../chunk-4P3SPC44.js";
|
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
AbcEvmProvider,
|
|
4
4
|
createAbcEvmProvider,
|
|
5
5
|
createAbcProvider
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-TQHS6APN.js";
|
|
7
|
+
import "../chunk-K66HU6GX.js";
|
|
7
8
|
import "../chunk-A66MTFML.js";
|
|
8
9
|
import "../chunk-4P3SPC44.js";
|
|
9
10
|
import "../chunk-6WF4SXLB.js";
|
|
@@ -7,8 +7,8 @@ import "../chunk-JGXJY3SB.js";
|
|
|
7
7
|
import "../chunk-OTLZVWY7.js";
|
|
8
8
|
import "../chunk-NULM3THX.js";
|
|
9
9
|
import "../chunk-MO2AXXLI.js";
|
|
10
|
-
import "../chunk-YPM7FC4M.js";
|
|
11
10
|
import "../chunk-VDWJ3NQ5.js";
|
|
11
|
+
import "../chunk-YPM7FC4M.js";
|
|
12
12
|
import "../chunk-BHEVY4QY.js";
|
|
13
13
|
import "../chunk-4P3SPC44.js";
|
|
14
14
|
import "../chunk-6WF4SXLB.js";
|
|
@@ -23,6 +23,13 @@ export interface AbcWalletSpecificOptions {
|
|
|
23
23
|
defaultSolanaNetwork?: SolanaNetwork;
|
|
24
24
|
/** Default Bitcoin network (optional) */
|
|
25
25
|
defaultBitcoinNetwork?: BitcoinNetwork;
|
|
26
|
+
/**
|
|
27
|
+
* Access-key for server-side signing (no PIN required).
|
|
28
|
+
* If provided, the provider uses X-Access-Key authentication
|
|
29
|
+
* instead of PIN + MPC client-side signing.
|
|
30
|
+
* Typically loaded from Telegram CloudStorage or localStorage.
|
|
31
|
+
*/
|
|
32
|
+
accessKey?: string;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* ABC Wallet for TalkenKit
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
abcWallet
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-QSP2A4LA.js";
|
|
5
|
+
import "../chunk-HWXOTEC3.js";
|
|
6
6
|
import "../chunk-R6ZE7JAZ.js";
|
|
7
7
|
import "../chunk-GFWUFYT2.js";
|
|
8
|
+
import "../chunk-S2SQYPGR.js";
|
|
8
9
|
import "../chunk-O4AU63LK.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-TQHS6APN.js";
|
|
11
|
+
import "../chunk-K66HU6GX.js";
|
|
10
12
|
import "../chunk-A66MTFML.js";
|
|
11
13
|
import "../chunk-BHEVY4QY.js";
|
|
12
14
|
import "../chunk-4P3SPC44.js";
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
TokenApi
|
|
11
11
|
} from "../../chunk-MO2AXXLI.js";
|
|
12
|
-
import {
|
|
13
|
-
GasApi
|
|
14
|
-
} from "../../chunk-YPM7FC4M.js";
|
|
15
12
|
import {
|
|
16
13
|
ConfigApi
|
|
17
14
|
} from "../../chunk-VDWJ3NQ5.js";
|
|
15
|
+
import {
|
|
16
|
+
GasApi
|
|
17
|
+
} from "../../chunk-YPM7FC4M.js";
|
|
18
18
|
import {
|
|
19
19
|
TalkenApiClient,
|
|
20
20
|
createTalkenApiClient
|
|
@@ -39,20 +39,21 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
TokenApi
|
|
41
41
|
} from "../chunk-MO2AXXLI.js";
|
|
42
|
-
import {
|
|
43
|
-
GasApi
|
|
44
|
-
} from "../chunk-YPM7FC4M.js";
|
|
45
42
|
import {
|
|
46
43
|
ConfigApi
|
|
47
44
|
} from "../chunk-VDWJ3NQ5.js";
|
|
45
|
+
import {
|
|
46
|
+
GasApi
|
|
47
|
+
} from "../chunk-YPM7FC4M.js";
|
|
48
48
|
import {
|
|
49
49
|
abcWallet
|
|
50
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-QSP2A4LA.js";
|
|
51
51
|
import {
|
|
52
52
|
abcConnector
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-HWXOTEC3.js";
|
|
54
54
|
import "../chunk-R6ZE7JAZ.js";
|
|
55
55
|
import "../chunk-GFWUFYT2.js";
|
|
56
|
+
import "../chunk-S2SQYPGR.js";
|
|
56
57
|
import {
|
|
57
58
|
BitcoinNetwork,
|
|
58
59
|
SolanaNetwork,
|
|
@@ -66,7 +67,8 @@ import {
|
|
|
66
67
|
AbcEvmProvider,
|
|
67
68
|
createAbcEvmProvider,
|
|
68
69
|
createAbcProvider
|
|
69
|
-
} from "../chunk-
|
|
70
|
+
} from "../chunk-TQHS6APN.js";
|
|
71
|
+
import "../chunk-K66HU6GX.js";
|
|
70
72
|
import {
|
|
71
73
|
calculateExpiryTimestamp,
|
|
72
74
|
clearAuthState,
|
|
@@ -40,6 +40,8 @@ export interface AbcWalletConfig {
|
|
|
40
40
|
defaultBitcoinNetwork?: BitcoinNetwork;
|
|
41
41
|
/** Project identifier */
|
|
42
42
|
projectId?: string;
|
|
43
|
+
/** Access-key for server-side signing (no PIN, used in TG Mini App) */
|
|
44
|
+
accessKey?: string;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Authentication provider types
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
resolveTalkenApiUrl
|
|
7
7
|
} from "./chunk-GFWUFYT2.js";
|
|
8
|
+
import {
|
|
9
|
+
AbcAccessKeyProvider
|
|
10
|
+
} from "./chunk-S2SQYPGR.js";
|
|
8
11
|
import {
|
|
9
12
|
setGlobalDefaultBitcoinNetwork,
|
|
10
13
|
setGlobalDefaultChainId,
|
|
@@ -12,7 +15,7 @@ import {
|
|
|
12
15
|
} from "./chunk-O4AU63LK.js";
|
|
13
16
|
import {
|
|
14
17
|
createAbcEvmProvider
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TQHS6APN.js";
|
|
16
19
|
import {
|
|
17
20
|
clearAuthState,
|
|
18
21
|
clearStorage,
|
|
@@ -49,7 +52,11 @@ function abcConnector(options) {
|
|
|
49
52
|
defaultChainId: config.defaultChainId
|
|
50
53
|
});
|
|
51
54
|
setTalkenApiClient(talkenApi);
|
|
52
|
-
const
|
|
55
|
+
const isAccessKeyMode = !!config.accessKey;
|
|
56
|
+
const provider = isAccessKeyMode ? new AbcAccessKeyProvider(
|
|
57
|
+
config.accessKey,
|
|
58
|
+
resolveTalkenApiUrl(config.talkenApiUrl)
|
|
59
|
+
) : createAbcEvmProvider(talkenApi);
|
|
53
60
|
let accountsChangedHandler;
|
|
54
61
|
let chainChangedHandler;
|
|
55
62
|
let disconnectHandler;
|
|
@@ -193,6 +200,9 @@ function abcConnector(options) {
|
|
|
193
200
|
*/
|
|
194
201
|
async isAuthorized() {
|
|
195
202
|
try {
|
|
203
|
+
if (isAccessKeyMode && provider.isConnected()) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
196
206
|
const authState = loadAuthState();
|
|
197
207
|
if (!authState || !authState.isAuthenticated) {
|
|
198
208
|
return false;
|