@sign-global/tokentable-wallets 0.0.0-beta-20250624084326
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/CHANGELOG.md +23 -0
- package/dist/index.d.mts +125 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.js +562 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +524 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -0
- package/src/WalletBase.ts +92 -0
- package/src/WalletFactory.tsx +35 -0
- package/src/index.ts +3 -0
- package/src/providers/evm/EvmWallet.ts +101 -0
- package/src/providers/evm/index.tsx +56 -0
- package/src/providers/index.ts +4 -0
- package/src/providers/solana/index.tsx +147 -0
- package/src/providers/ton/TonWallet.ts +153 -0
- package/src/providers/ton/index.tsx +41 -0
- package/src/types.ts +45 -0
- package/src/utils/index.ts +56 -0
- package/tsup.config.ts +47 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @sign-global/tokentable-wallets
|
|
2
|
+
|
|
3
|
+
## 0.0.0-beta-20250624084326
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ✨ feat: add fee handling for TokenTableMerkleDistributorWithFees
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @sign-global/tokentable-core@0.0.0-beta-20250624084326
|
|
13
|
+
|
|
14
|
+
## 1.0.0
|
|
15
|
+
|
|
16
|
+
### Major Changes
|
|
17
|
+
|
|
18
|
+
- ✨ feat: restructure project into monorepo with multiple packages
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @sign-global/tokentable-core@1.0.0
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { useConnectModal } from '@rainbow-me/rainbowkit';
|
|
2
|
+
import { useAccount, useWalletClient, ResolvedRegister } from 'wagmi';
|
|
3
|
+
import { useTonWallet, useTonConnectModal, useTonConnectUI, TonConnectUIProviderProps } from '@tonconnect/ui-react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { useWalletModal } from '@solana/wallet-adapter-react-ui';
|
|
7
|
+
import { useWallet } from '@solana/wallet-adapter-react';
|
|
8
|
+
import { Adapter } from '@solana/wallet-adapter-base';
|
|
9
|
+
import { Cluster } from '@solana/web3.js';
|
|
10
|
+
|
|
11
|
+
declare enum ChainType {
|
|
12
|
+
Evm = "evm",
|
|
13
|
+
Ton = "ton",
|
|
14
|
+
Solana = "solana"
|
|
15
|
+
}
|
|
16
|
+
type ISignResult = {
|
|
17
|
+
message: string;
|
|
18
|
+
signature: string;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
} | undefined;
|
|
21
|
+
|
|
22
|
+
declare abstract class WalletBase<S> {
|
|
23
|
+
type: string;
|
|
24
|
+
provider: any;
|
|
25
|
+
address?: string;
|
|
26
|
+
publicKey?: string;
|
|
27
|
+
chainId?: number | string;
|
|
28
|
+
protocolTag?: string;
|
|
29
|
+
authType: string;
|
|
30
|
+
userAddress?: string;
|
|
31
|
+
network?: string;
|
|
32
|
+
constructor(type: string, userAddress?: string);
|
|
33
|
+
protected get isConnected(): boolean;
|
|
34
|
+
abstract connect(_?: string): void;
|
|
35
|
+
abstract sign(_: string, _1?: string): Promise<ISignResult>;
|
|
36
|
+
safeSign(_: string, _1?: string): Promise<ISignResult>;
|
|
37
|
+
signin(statement?: string): Promise<ISignResult>;
|
|
38
|
+
signByEIP712(_: string): Promise<ISignResult>;
|
|
39
|
+
getSignEIP712Message(_: {
|
|
40
|
+
chainId: number | string;
|
|
41
|
+
info: string;
|
|
42
|
+
hash: string;
|
|
43
|
+
}): string;
|
|
44
|
+
getWallet(): {
|
|
45
|
+
address?: string;
|
|
46
|
+
isConnected: boolean;
|
|
47
|
+
publicKey: string | undefined;
|
|
48
|
+
type: string;
|
|
49
|
+
network: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
abstract getStore(): S;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface EVMStoreType {
|
|
55
|
+
account: ReturnType<typeof useAccount> | null;
|
|
56
|
+
connectModal: ReturnType<typeof useConnectModal> | undefined;
|
|
57
|
+
walletClient: ReturnType<typeof useWalletClient> | undefined;
|
|
58
|
+
config: ResolvedRegister['config'] | undefined;
|
|
59
|
+
counter: number;
|
|
60
|
+
}
|
|
61
|
+
declare class EvmWallet extends WalletBase<EVMStoreType> {
|
|
62
|
+
get isConnected(): boolean;
|
|
63
|
+
connect(): void;
|
|
64
|
+
disconnect(): Promise<void>;
|
|
65
|
+
sign(_message: string): Promise<{
|
|
66
|
+
message: string;
|
|
67
|
+
signature: `0x${string}`;
|
|
68
|
+
}>;
|
|
69
|
+
signin(statement: string, prepare?: boolean): Promise<ISignResult>;
|
|
70
|
+
getStore(): EVMStoreType;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare const EvmProvider: ({ children, config, theme }: {
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
config: ResolvedRegister["config"];
|
|
76
|
+
theme?: any;
|
|
77
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
interface TonStoreType {
|
|
80
|
+
account: ReturnType<typeof useTonWallet> | null;
|
|
81
|
+
connectModal: ReturnType<typeof useTonConnectModal> | undefined;
|
|
82
|
+
walletClient: ReturnType<typeof useTonConnectUI>[0] | undefined;
|
|
83
|
+
config: TonConnectUIProviderProps | undefined;
|
|
84
|
+
counter: number;
|
|
85
|
+
}
|
|
86
|
+
declare class TonWallet extends WalletBase<TonStoreType> {
|
|
87
|
+
get isConnected(): boolean;
|
|
88
|
+
connect(): void;
|
|
89
|
+
disconnect(): Promise<void>;
|
|
90
|
+
private getPublicKey;
|
|
91
|
+
sign(originMsg: string): Promise<ISignResult>;
|
|
92
|
+
signin(statement: string, prepare?: boolean): Promise<ISignResult>;
|
|
93
|
+
getStore(): TonStoreType;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const TonProvider: ({ children, config }: {
|
|
97
|
+
children: ReactNode;
|
|
98
|
+
config: TonConnectUIProviderProps;
|
|
99
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface SolStoreType {
|
|
102
|
+
connectModal: ReturnType<typeof useWalletModal> | null;
|
|
103
|
+
account: ReturnType<typeof useWallet> | null;
|
|
104
|
+
counter: number;
|
|
105
|
+
}
|
|
106
|
+
declare class SolWallet extends WalletBase<SolStoreType> {
|
|
107
|
+
getStore(): SolStoreType;
|
|
108
|
+
get isConnected(): boolean;
|
|
109
|
+
connect(): void;
|
|
110
|
+
disconnect(): void;
|
|
111
|
+
sign(message: string): Promise<ISignResult>;
|
|
112
|
+
signin(statement: string, prepare?: boolean): Promise<ISignResult>;
|
|
113
|
+
}
|
|
114
|
+
declare const SolanaProvider: ({ children, cluster, wallets }: {
|
|
115
|
+
children: ReactNode;
|
|
116
|
+
cluster?: Cluster;
|
|
117
|
+
wallets?: Adapter[];
|
|
118
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
119
|
+
|
|
120
|
+
declare abstract class WalletFactory {
|
|
121
|
+
private static instances;
|
|
122
|
+
static getWallet(type: ChainType, userAddress?: string): EvmWallet | TonWallet | SolWallet;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { EvmProvider, EvmWallet, SolWallet, SolanaProvider, TonProvider, TonWallet, WalletFactory };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { useConnectModal } from '@rainbow-me/rainbowkit';
|
|
2
|
+
import { useAccount, useWalletClient, ResolvedRegister } from 'wagmi';
|
|
3
|
+
import { useTonWallet, useTonConnectModal, useTonConnectUI, TonConnectUIProviderProps } from '@tonconnect/ui-react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { useWalletModal } from '@solana/wallet-adapter-react-ui';
|
|
7
|
+
import { useWallet } from '@solana/wallet-adapter-react';
|
|
8
|
+
import { Adapter } from '@solana/wallet-adapter-base';
|
|
9
|
+
import { Cluster } from '@solana/web3.js';
|
|
10
|
+
|
|
11
|
+
declare enum ChainType {
|
|
12
|
+
Evm = "evm",
|
|
13
|
+
Ton = "ton",
|
|
14
|
+
Solana = "solana"
|
|
15
|
+
}
|
|
16
|
+
type ISignResult = {
|
|
17
|
+
message: string;
|
|
18
|
+
signature: string;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
} | undefined;
|
|
21
|
+
|
|
22
|
+
declare abstract class WalletBase<S> {
|
|
23
|
+
type: string;
|
|
24
|
+
provider: any;
|
|
25
|
+
address?: string;
|
|
26
|
+
publicKey?: string;
|
|
27
|
+
chainId?: number | string;
|
|
28
|
+
protocolTag?: string;
|
|
29
|
+
authType: string;
|
|
30
|
+
userAddress?: string;
|
|
31
|
+
network?: string;
|
|
32
|
+
constructor(type: string, userAddress?: string);
|
|
33
|
+
protected get isConnected(): boolean;
|
|
34
|
+
abstract connect(_?: string): void;
|
|
35
|
+
abstract sign(_: string, _1?: string): Promise<ISignResult>;
|
|
36
|
+
safeSign(_: string, _1?: string): Promise<ISignResult>;
|
|
37
|
+
signin(statement?: string): Promise<ISignResult>;
|
|
38
|
+
signByEIP712(_: string): Promise<ISignResult>;
|
|
39
|
+
getSignEIP712Message(_: {
|
|
40
|
+
chainId: number | string;
|
|
41
|
+
info: string;
|
|
42
|
+
hash: string;
|
|
43
|
+
}): string;
|
|
44
|
+
getWallet(): {
|
|
45
|
+
address?: string;
|
|
46
|
+
isConnected: boolean;
|
|
47
|
+
publicKey: string | undefined;
|
|
48
|
+
type: string;
|
|
49
|
+
network: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
abstract getStore(): S;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface EVMStoreType {
|
|
55
|
+
account: ReturnType<typeof useAccount> | null;
|
|
56
|
+
connectModal: ReturnType<typeof useConnectModal> | undefined;
|
|
57
|
+
walletClient: ReturnType<typeof useWalletClient> | undefined;
|
|
58
|
+
config: ResolvedRegister['config'] | undefined;
|
|
59
|
+
counter: number;
|
|
60
|
+
}
|
|
61
|
+
declare class EvmWallet extends WalletBase<EVMStoreType> {
|
|
62
|
+
get isConnected(): boolean;
|
|
63
|
+
connect(): void;
|
|
64
|
+
disconnect(): Promise<void>;
|
|
65
|
+
sign(_message: string): Promise<{
|
|
66
|
+
message: string;
|
|
67
|
+
signature: `0x${string}`;
|
|
68
|
+
}>;
|
|
69
|
+
signin(statement: string, prepare?: boolean): Promise<ISignResult>;
|
|
70
|
+
getStore(): EVMStoreType;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare const EvmProvider: ({ children, config, theme }: {
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
config: ResolvedRegister["config"];
|
|
76
|
+
theme?: any;
|
|
77
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
interface TonStoreType {
|
|
80
|
+
account: ReturnType<typeof useTonWallet> | null;
|
|
81
|
+
connectModal: ReturnType<typeof useTonConnectModal> | undefined;
|
|
82
|
+
walletClient: ReturnType<typeof useTonConnectUI>[0] | undefined;
|
|
83
|
+
config: TonConnectUIProviderProps | undefined;
|
|
84
|
+
counter: number;
|
|
85
|
+
}
|
|
86
|
+
declare class TonWallet extends WalletBase<TonStoreType> {
|
|
87
|
+
get isConnected(): boolean;
|
|
88
|
+
connect(): void;
|
|
89
|
+
disconnect(): Promise<void>;
|
|
90
|
+
private getPublicKey;
|
|
91
|
+
sign(originMsg: string): Promise<ISignResult>;
|
|
92
|
+
signin(statement: string, prepare?: boolean): Promise<ISignResult>;
|
|
93
|
+
getStore(): TonStoreType;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const TonProvider: ({ children, config }: {
|
|
97
|
+
children: ReactNode;
|
|
98
|
+
config: TonConnectUIProviderProps;
|
|
99
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface SolStoreType {
|
|
102
|
+
connectModal: ReturnType<typeof useWalletModal> | null;
|
|
103
|
+
account: ReturnType<typeof useWallet> | null;
|
|
104
|
+
counter: number;
|
|
105
|
+
}
|
|
106
|
+
declare class SolWallet extends WalletBase<SolStoreType> {
|
|
107
|
+
getStore(): SolStoreType;
|
|
108
|
+
get isConnected(): boolean;
|
|
109
|
+
connect(): void;
|
|
110
|
+
disconnect(): void;
|
|
111
|
+
sign(message: string): Promise<ISignResult>;
|
|
112
|
+
signin(statement: string, prepare?: boolean): Promise<ISignResult>;
|
|
113
|
+
}
|
|
114
|
+
declare const SolanaProvider: ({ children, cluster, wallets }: {
|
|
115
|
+
children: ReactNode;
|
|
116
|
+
cluster?: Cluster;
|
|
117
|
+
wallets?: Adapter[];
|
|
118
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
119
|
+
|
|
120
|
+
declare abstract class WalletFactory {
|
|
121
|
+
private static instances;
|
|
122
|
+
static getWallet(type: ChainType, userAddress?: string): EvmWallet | TonWallet | SolWallet;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { EvmProvider, EvmWallet, SolWallet, SolanaProvider, TonProvider, TonWallet, WalletFactory };
|