@sudobility/contracts 1.11.2 → 1.13.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/evm/src/evm/{mailer-client.d.ts → evm-mailer-client.d.ts} +199 -47
- package/dist/evm/src/evm/evm-mailer-client.d.ts.map +1 -0
- package/dist/evm/src/evm/evm-mailer-client.js +924 -0
- package/dist/evm/src/evm/evm-mailer-client.js.map +1 -0
- package/dist/evm/src/evm/index.d.ts +1 -1
- package/dist/evm/src/evm/index.d.ts.map +1 -1
- package/dist/evm/src/evm/index.js +4 -4
- package/dist/evm/src/evm/index.js.map +1 -1
- package/dist/solana/solana/index.d.ts +1 -1
- package/dist/solana/solana/index.d.ts.map +1 -1
- package/dist/solana/solana/index.js +4 -1
- package/dist/solana/solana/index.js.map +1 -1
- package/dist/solana/solana/solana-mailer-client.d.ts +209 -0
- package/dist/solana/solana/solana-mailer-client.d.ts.map +1 -0
- package/dist/solana/solana/solana-mailer-client.js +1004 -0
- package/dist/solana/solana/solana-mailer-client.js.map +1 -0
- package/dist/solana/solana/types.d.ts +3 -2
- package/dist/solana/solana/types.d.ts.map +1 -1
- package/dist/solana/solana/types.js.map +1 -1
- package/dist/{unified-esm/src/evm/mailer-client.d.ts → unified/src/evm/evm-mailer-client.d.ts} +199 -47
- package/dist/unified/src/evm/evm-mailer-client.d.ts.map +1 -0
- package/dist/unified/src/evm/evm-mailer-client.js +924 -0
- package/dist/unified/src/evm/evm-mailer-client.js.map +1 -0
- package/dist/unified/src/evm/index.d.ts +1 -1
- package/dist/unified/src/evm/index.d.ts.map +1 -1
- package/dist/unified/src/evm/index.js +4 -4
- package/dist/unified/src/evm/index.js.map +1 -1
- package/dist/unified/src/react/context/MailerProvider.d.ts +26 -20
- package/dist/unified/src/react/context/MailerProvider.d.ts.map +1 -1
- package/dist/unified/src/react/context/MailerProvider.js +26 -26
- package/dist/unified/src/react/context/MailerProvider.js.map +1 -1
- package/dist/unified/src/react/hooks/useMailerMutations.d.ts +225 -192
- package/dist/unified/src/react/hooks/useMailerMutations.d.ts.map +1 -1
- package/dist/unified/src/react/hooks/useMailerMutations.js +263 -266
- package/dist/unified/src/react/hooks/useMailerMutations.js.map +1 -1
- package/dist/unified/src/react/hooks/useMailerQueries.d.ts +117 -63
- package/dist/unified/src/react/hooks/useMailerQueries.d.ts.map +1 -1
- package/dist/unified/src/react/hooks/useMailerQueries.js +239 -104
- package/dist/unified/src/react/hooks/useMailerQueries.js.map +1 -1
- package/dist/unified/src/react/index.d.ts +5 -3
- package/dist/unified/src/react/index.d.ts.map +1 -1
- package/dist/unified/src/react/index.js +41 -26
- package/dist/unified/src/react/index.js.map +1 -1
- package/dist/unified/src/solana/index.d.ts +1 -1
- package/dist/unified/src/solana/index.d.ts.map +1 -1
- package/dist/unified/src/solana/index.js +4 -1
- package/dist/unified/src/solana/index.js.map +1 -1
- package/dist/unified/src/solana/solana-mailer-client.d.ts +209 -0
- package/dist/unified/src/solana/solana-mailer-client.d.ts.map +1 -0
- package/dist/unified/src/solana/solana-mailer-client.js +1004 -0
- package/dist/unified/src/solana/solana-mailer-client.js.map +1 -0
- package/dist/unified/src/solana/types.d.ts +3 -2
- package/dist/unified/src/solana/types.d.ts.map +1 -1
- package/dist/unified/src/solana/types.js.map +1 -1
- package/dist/unified/src/unified/index.d.ts +1 -1
- package/dist/unified/src/unified/index.d.ts.map +1 -1
- package/dist/unified/src/unified/onchain-mailer-client.d.ts +187 -268
- package/dist/unified/src/unified/onchain-mailer-client.d.ts.map +1 -1
- package/dist/unified/src/unified/onchain-mailer-client.js +539 -1614
- package/dist/unified/src/unified/onchain-mailer-client.js.map +1 -1
- package/dist/unified/src/unified/types.d.ts +23 -6
- package/dist/unified/src/unified/types.d.ts.map +1 -1
- package/dist/{unified/src/evm/mailer-client.d.ts → unified-esm/src/evm/evm-mailer-client.d.ts} +199 -47
- package/dist/unified-esm/src/evm/evm-mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/evm/evm-mailer-client.js +920 -0
- package/dist/unified-esm/src/evm/evm-mailer-client.js.map +1 -0
- package/dist/unified-esm/src/evm/index.d.ts +1 -1
- package/dist/unified-esm/src/evm/index.d.ts.map +1 -1
- package/dist/unified-esm/src/evm/index.js +2 -2
- package/dist/unified-esm/src/evm/index.js.map +1 -1
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts +26 -20
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts.map +1 -1
- package/dist/unified-esm/src/react/context/MailerProvider.js +25 -26
- package/dist/unified-esm/src/react/context/MailerProvider.js.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts +225 -192
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js +254 -262
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts +117 -63
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js +232 -102
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js.map +1 -1
- package/dist/unified-esm/src/react/index.d.ts +5 -3
- package/dist/unified-esm/src/react/index.d.ts.map +1 -1
- package/dist/unified-esm/src/react/index.js +9 -5
- package/dist/unified-esm/src/react/index.js.map +1 -1
- package/dist/unified-esm/src/solana/index.d.ts +1 -1
- package/dist/unified-esm/src/solana/index.d.ts.map +1 -1
- package/dist/unified-esm/src/solana/index.js +2 -1
- package/dist/unified-esm/src/solana/index.js.map +1 -1
- package/dist/unified-esm/src/solana/solana-mailer-client.d.ts +209 -0
- package/dist/unified-esm/src/solana/solana-mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/solana/solana-mailer-client.js +1000 -0
- package/dist/unified-esm/src/solana/solana-mailer-client.js.map +1 -0
- package/dist/unified-esm/src/solana/types.d.ts +3 -2
- package/dist/unified-esm/src/solana/types.d.ts.map +1 -1
- package/dist/unified-esm/src/solana/types.js.map +1 -1
- package/dist/unified-esm/src/unified/index.d.ts +1 -1
- package/dist/unified-esm/src/unified/index.d.ts.map +1 -1
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts +187 -268
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts.map +1 -1
- package/dist/unified-esm/src/unified/onchain-mailer-client.js +539 -1614
- package/dist/unified-esm/src/unified/onchain-mailer-client.js.map +1 -1
- package/dist/unified-esm/src/unified/types.d.ts +23 -6
- package/dist/unified-esm/src/unified/types.d.ts.map +1 -1
- package/package.json +5 -4
- package/programs/mailer/Cargo.toml +1 -1
- package/dist/evm/src/evm/mailer-client.d.ts.map +0 -1
- package/dist/evm/src/evm/mailer-client.js +0 -349
- package/dist/evm/src/evm/mailer-client.js.map +0 -1
- package/dist/solana/solana/mailer-client.d.ts +0 -220
- package/dist/solana/solana/mailer-client.d.ts.map +0 -1
- package/dist/solana/solana/mailer-client.js +0 -920
- package/dist/solana/solana/mailer-client.js.map +0 -1
- package/dist/unified/src/evm/mailer-client.d.ts.map +0 -1
- package/dist/unified/src/evm/mailer-client.js +0 -349
- package/dist/unified/src/evm/mailer-client.js.map +0 -1
- package/dist/unified/src/solana/mailer-client.d.ts +0 -220
- package/dist/unified/src/solana/mailer-client.d.ts.map +0 -1
- package/dist/unified/src/solana/mailer-client.js +0 -920
- package/dist/unified/src/solana/mailer-client.js.map +0 -1
- package/dist/unified-esm/src/evm/mailer-client.d.ts.map +0 -1
- package/dist/unified-esm/src/evm/mailer-client.js +0 -345
- package/dist/unified-esm/src/evm/mailer-client.js.map +0 -1
- package/dist/unified-esm/src/solana/mailer-client.d.ts +0 -220
- package/dist/unified-esm/src/solana/mailer-client.d.ts.map +0 -1
- package/dist/unified-esm/src/solana/mailer-client.js +0 -916
- package/dist/unified-esm/src/solana/mailer-client.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { ChainType } from '@sudobility/types';
|
|
3
3
|
/**
|
|
4
4
|
* Query keys for React Query cache management
|
|
5
5
|
*/
|
|
@@ -11,176 +11,306 @@ export const mailerQueryKeys = {
|
|
|
11
11
|
ownerClaimable: () => [...mailerQueryKeys.all, 'ownerClaimable'],
|
|
12
12
|
delegation: (address) => [...mailerQueryKeys.all, 'delegation', address],
|
|
13
13
|
isPaused: () => [...mailerQueryKeys.all, 'isPaused'],
|
|
14
|
+
permissions: (contractAddress, walletAddress) => [...mailerQueryKeys.all, 'permissions', contractAddress, walletAddress],
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
|
-
* Hook
|
|
17
|
+
* Hook for fee-related queries
|
|
17
18
|
*
|
|
18
19
|
* @example
|
|
19
20
|
* ```tsx
|
|
20
21
|
* function FeeDisplay() {
|
|
21
|
-
* const {
|
|
22
|
+
* const { sendFee, delegationFee } = useFees(client, chainInfo);
|
|
22
23
|
*
|
|
23
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
24
|
-
*
|
|
24
|
+
* if (sendFee.isLoading) return <div>Loading...</div>;
|
|
25
|
+
*
|
|
26
|
+
* return (
|
|
27
|
+
* <div>
|
|
28
|
+
* Send Fee: {Number(sendFee.data) / 1_000_000} USDC
|
|
29
|
+
* Delegation Fee: {Number(delegationFee.data) / 1_000_000} USDC
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
25
32
|
* }
|
|
26
33
|
* ```
|
|
27
34
|
*/
|
|
28
|
-
export function
|
|
29
|
-
const
|
|
30
|
-
return useQuery({
|
|
35
|
+
export function useFees(client, chainInfo, publicClientOrConnection, options) {
|
|
36
|
+
const sendFee = useQuery({
|
|
31
37
|
queryKey: mailerQueryKeys.sendFee(),
|
|
32
|
-
queryFn: () =>
|
|
38
|
+
queryFn: () => {
|
|
39
|
+
if (chainInfo.chainType === ChainType.EVM) {
|
|
40
|
+
return client.getSendFee(chainInfo, publicClientOrConnection);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return client.getSendFee(chainInfo, undefined, publicClientOrConnection);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
33
46
|
staleTime: 5 * 60 * 1000, // 5 minutes - fees don't change often
|
|
34
|
-
...options,
|
|
47
|
+
...options?.sendFee,
|
|
35
48
|
});
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Hook to get the current delegation fee
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```tsx
|
|
42
|
-
* function DelegationFeeDisplay() {
|
|
43
|
-
* const { data: fee, isLoading } = useGetDelegationFee();
|
|
44
|
-
*
|
|
45
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
46
|
-
* return <div>Delegation Fee: {Number(fee) / 1_000_000} USDC</div>;
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export function useGetDelegationFee(options) {
|
|
51
|
-
const client = useMailerClient();
|
|
52
|
-
return useQuery({
|
|
49
|
+
const delegationFee = useQuery({
|
|
53
50
|
queryKey: mailerQueryKeys.delegationFee(),
|
|
54
|
-
queryFn: () =>
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
queryFn: () => {
|
|
52
|
+
if (chainInfo.chainType === ChainType.EVM) {
|
|
53
|
+
return client.getDelegationFee(chainInfo, publicClientOrConnection);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return client.getDelegationFee(chainInfo, undefined, publicClientOrConnection);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
staleTime: 5 * 60 * 1000,
|
|
60
|
+
...options?.delegationFee,
|
|
57
61
|
});
|
|
62
|
+
return {
|
|
63
|
+
sendFee,
|
|
64
|
+
delegationFee,
|
|
65
|
+
};
|
|
58
66
|
}
|
|
59
67
|
/**
|
|
60
|
-
* Hook
|
|
68
|
+
* Hook for claimable amount queries
|
|
61
69
|
*
|
|
62
|
-
* @param address - Address to check (defaults to connected wallet)
|
|
63
70
|
* @example
|
|
64
71
|
* ```tsx
|
|
65
|
-
* function
|
|
66
|
-
* const {
|
|
72
|
+
* function ClaimableDisplay({ address }: { address?: string }) {
|
|
73
|
+
* const { claimableAmount, ownerClaimable } = useClaimableAmounts(
|
|
74
|
+
* client,
|
|
75
|
+
* chainInfo,
|
|
76
|
+
* address
|
|
77
|
+
* );
|
|
67
78
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
79
|
+
* return (
|
|
80
|
+
* <div>
|
|
81
|
+
* User Claimable: {Number(claimableAmount.data) / 1_000_000} USDC
|
|
82
|
+
* Owner Claimable: {Number(ownerClaimable.data) / 1_000_000} USDC
|
|
83
|
+
* </div>
|
|
84
|
+
* );
|
|
71
85
|
* }
|
|
72
86
|
* ```
|
|
73
87
|
*/
|
|
74
|
-
export function
|
|
75
|
-
const
|
|
76
|
-
return useQuery({
|
|
88
|
+
export function useClaimableAmounts(client, chainInfo, address, publicClientOrConnection, options) {
|
|
89
|
+
const claimableAmount = useQuery({
|
|
77
90
|
queryKey: mailerQueryKeys.claimableAmount(address),
|
|
78
|
-
queryFn: () =>
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
queryFn: async () => {
|
|
92
|
+
if (!address)
|
|
93
|
+
return BigInt(0);
|
|
94
|
+
let result;
|
|
95
|
+
if (chainInfo.chainType === ChainType.EVM) {
|
|
96
|
+
result = await client.getRecipientClaimable(address, chainInfo, publicClientOrConnection);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
result = await client.getRecipientClaimable(address, chainInfo, undefined, publicClientOrConnection);
|
|
100
|
+
}
|
|
101
|
+
// Extract just the amount from the result
|
|
102
|
+
return result ? result.amount : BigInt(0);
|
|
103
|
+
},
|
|
104
|
+
enabled: Boolean(address),
|
|
105
|
+
staleTime: 30 * 1000, // 30 seconds
|
|
106
|
+
...options?.claimableAmount,
|
|
81
107
|
});
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Hook to get owner's claimable fee balance
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```tsx
|
|
88
|
-
* function OwnerDashboard() {
|
|
89
|
-
* const { data: amount, isLoading } = useGetOwnerClaimable();
|
|
90
|
-
*
|
|
91
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
92
|
-
* return <div>Owner Fees: {Number(amount) / 1_000_000} USDC</div>;
|
|
93
|
-
* }
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
export function useGetOwnerClaimable(options) {
|
|
97
|
-
const client = useMailerClient();
|
|
98
|
-
return useQuery({
|
|
108
|
+
const ownerClaimable = useQuery({
|
|
99
109
|
queryKey: mailerQueryKeys.ownerClaimable(),
|
|
100
|
-
queryFn: () =>
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
queryFn: () => {
|
|
111
|
+
if (chainInfo.chainType === ChainType.EVM) {
|
|
112
|
+
return client.getOwnerClaimable(chainInfo, publicClientOrConnection);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return client.getOwnerClaimable(chainInfo, undefined, publicClientOrConnection);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
staleTime: 30 * 1000,
|
|
119
|
+
...options?.ownerClaimable,
|
|
103
120
|
});
|
|
121
|
+
return {
|
|
122
|
+
claimableAmount,
|
|
123
|
+
ownerClaimable,
|
|
124
|
+
};
|
|
104
125
|
}
|
|
105
126
|
/**
|
|
106
|
-
* Hook
|
|
127
|
+
* Hook for delegation and permission queries
|
|
107
128
|
*
|
|
108
|
-
* @param address - Address to check delegation for (defaults to connected wallet)
|
|
109
129
|
* @example
|
|
110
130
|
* ```tsx
|
|
111
|
-
* function DelegationStatus() {
|
|
112
|
-
* const {
|
|
131
|
+
* function DelegationStatus({ address }: { address: string }) {
|
|
132
|
+
* const { delegation, hasPermission } = useDelegationAndPermissions(
|
|
133
|
+
* client,
|
|
134
|
+
* chainInfo,
|
|
135
|
+
* {
|
|
136
|
+
* delegationAddress: address,
|
|
137
|
+
* contractAddress: '0xContract...',
|
|
138
|
+
* walletAddress: address
|
|
139
|
+
* }
|
|
140
|
+
* );
|
|
113
141
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
142
|
+
* return (
|
|
143
|
+
* <div>
|
|
144
|
+
* Delegated to: {delegation.data}
|
|
145
|
+
* Has Permission: {hasPermission.data ? 'Yes' : 'No'}
|
|
146
|
+
* </div>
|
|
147
|
+
* );
|
|
117
148
|
* }
|
|
118
149
|
* ```
|
|
119
150
|
*/
|
|
120
|
-
export function
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
151
|
+
export function useDelegationAndPermissions(client, chainInfo, params, publicClientOrConnection, options) {
|
|
152
|
+
const delegation = useQuery({
|
|
153
|
+
queryKey: mailerQueryKeys.delegation(params?.delegationAddress),
|
|
154
|
+
queryFn: async () => {
|
|
155
|
+
if (!params?.delegationAddress)
|
|
156
|
+
return null;
|
|
157
|
+
if (chainInfo.chainType === ChainType.EVM) {
|
|
158
|
+
return client.getDelegation(params.delegationAddress, chainInfo, publicClientOrConnection);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return client.getDelegation(params.delegationAddress, chainInfo, undefined, publicClientOrConnection);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
enabled: Boolean(params?.delegationAddress),
|
|
165
|
+
staleTime: 30 * 1000,
|
|
166
|
+
...options?.delegation,
|
|
127
167
|
});
|
|
168
|
+
const hasPermission = useQuery({
|
|
169
|
+
queryKey: mailerQueryKeys.permissions(params?.contractAddress, params?.walletAddress),
|
|
170
|
+
queryFn: async () => {
|
|
171
|
+
if (!params?.contractAddress || !params?.walletAddress) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
return client.hasPermission(chainInfo, params.contractAddress, params.walletAddress, publicClientOrConnection);
|
|
175
|
+
},
|
|
176
|
+
enabled: Boolean(params?.contractAddress && params?.walletAddress),
|
|
177
|
+
staleTime: 30 * 1000,
|
|
178
|
+
...options?.hasPermission,
|
|
179
|
+
});
|
|
180
|
+
return {
|
|
181
|
+
delegation,
|
|
182
|
+
hasPermission,
|
|
183
|
+
};
|
|
128
184
|
}
|
|
129
185
|
/**
|
|
130
|
-
* Hook
|
|
186
|
+
* Hook for contract state queries
|
|
131
187
|
*
|
|
132
188
|
* @example
|
|
133
189
|
* ```tsx
|
|
134
|
-
* function
|
|
135
|
-
* const {
|
|
190
|
+
* function ContractStatus() {
|
|
191
|
+
* const { isPaused } = useContractState(client, chainInfo);
|
|
136
192
|
*
|
|
137
|
-
* if (isLoading) return <div>Loading...</div>;
|
|
138
193
|
* return (
|
|
139
194
|
* <div>
|
|
140
|
-
* Contract
|
|
195
|
+
* Contract: {isPaused.data ? 'Paused' : 'Active'}
|
|
141
196
|
* </div>
|
|
142
197
|
* );
|
|
143
198
|
* }
|
|
144
199
|
* ```
|
|
145
200
|
*/
|
|
146
|
-
export function
|
|
147
|
-
const
|
|
148
|
-
return useQuery({
|
|
201
|
+
export function useContractState(client, chainInfo, publicClientOrConnection, options) {
|
|
202
|
+
const isPaused = useQuery({
|
|
149
203
|
queryKey: mailerQueryKeys.isPaused(),
|
|
150
|
-
queryFn: () =>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
204
|
+
queryFn: () => {
|
|
205
|
+
if (chainInfo.chainType === ChainType.EVM) {
|
|
206
|
+
return client.isPaused(chainInfo, publicClientOrConnection);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
return client.isPaused(chainInfo, undefined, publicClientOrConnection);
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
staleTime: 30 * 1000,
|
|
213
|
+
...options?.isPaused,
|
|
154
214
|
});
|
|
215
|
+
return {
|
|
216
|
+
isPaused,
|
|
217
|
+
};
|
|
155
218
|
}
|
|
156
219
|
/**
|
|
157
|
-
*
|
|
220
|
+
* Helper hook to get wallet address from different wallet types
|
|
158
221
|
*
|
|
159
222
|
* @example
|
|
160
223
|
* ```tsx
|
|
161
|
-
* function
|
|
162
|
-
* const address = useWalletAddress();
|
|
163
|
-
* return <div>
|
|
224
|
+
* function WalletDisplay({ wallet }: { wallet: Wallet }) {
|
|
225
|
+
* const address = useWalletAddress(wallet);
|
|
226
|
+
* return <div>Address: {address}</div>;
|
|
164
227
|
* }
|
|
165
228
|
* ```
|
|
166
229
|
*/
|
|
167
|
-
export function useWalletAddress() {
|
|
168
|
-
|
|
169
|
-
|
|
230
|
+
export function useWalletAddress(wallet) {
|
|
231
|
+
if (!wallet)
|
|
232
|
+
return undefined;
|
|
233
|
+
// For EVM wallets
|
|
234
|
+
if ('walletClient' in wallet && wallet.walletClient) {
|
|
235
|
+
return wallet.walletClient.account?.address;
|
|
236
|
+
}
|
|
237
|
+
// For Solana wallets
|
|
238
|
+
if ('wallet' in wallet && wallet.wallet) {
|
|
239
|
+
return wallet.wallet.publicKey?.toString();
|
|
240
|
+
}
|
|
241
|
+
return undefined;
|
|
170
242
|
}
|
|
171
243
|
/**
|
|
172
|
-
*
|
|
244
|
+
* Helper hook to get chain type from ChainInfo
|
|
173
245
|
*
|
|
174
246
|
* @example
|
|
175
247
|
* ```tsx
|
|
176
|
-
* function ChainBadge() {
|
|
177
|
-
* const chainType = useChainType();
|
|
248
|
+
* function ChainBadge({ chainInfo }: { chainInfo: ChainInfo }) {
|
|
249
|
+
* const chainType = useChainType(chainInfo);
|
|
178
250
|
* return <div>Chain: {chainType}</div>;
|
|
179
251
|
* }
|
|
180
252
|
* ```
|
|
181
253
|
*/
|
|
182
|
-
export function useChainType() {
|
|
183
|
-
|
|
184
|
-
|
|
254
|
+
export function useChainType(chainInfo) {
|
|
255
|
+
return chainInfo.chainType || ChainType.EVM;
|
|
256
|
+
}
|
|
257
|
+
// ========== Legacy individual hooks for backward compatibility ==========
|
|
258
|
+
// These use context for convenience but the grouped hooks above are preferred
|
|
259
|
+
import { useMailerContext } from '../context/MailerProvider.js';
|
|
260
|
+
/**
|
|
261
|
+
* @deprecated Use useFees() instead
|
|
262
|
+
*/
|
|
263
|
+
export function useGetSendFee(options) {
|
|
264
|
+
const { client, chainInfo } = useMailerContext();
|
|
265
|
+
const { sendFee } = useFees(client, chainInfo, undefined, { sendFee: options });
|
|
266
|
+
return sendFee;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @deprecated Use useFees() instead
|
|
270
|
+
*/
|
|
271
|
+
export function useGetDelegationFee(options) {
|
|
272
|
+
const { client, chainInfo } = useMailerContext();
|
|
273
|
+
const { delegationFee } = useFees(client, chainInfo, undefined, { delegationFee: options });
|
|
274
|
+
return delegationFee;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* @deprecated Use useClaimableAmounts() instead
|
|
278
|
+
*/
|
|
279
|
+
export function useGetClaimableAmount(address, options) {
|
|
280
|
+
const { client, chainInfo } = useMailerContext();
|
|
281
|
+
const { claimableAmount } = useClaimableAmounts(client, chainInfo, address, undefined, { claimableAmount: options });
|
|
282
|
+
return claimableAmount;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* @deprecated Use useClaimableAmounts() instead
|
|
286
|
+
*/
|
|
287
|
+
export function useGetOwnerClaimable(options) {
|
|
288
|
+
const { client, chainInfo } = useMailerContext();
|
|
289
|
+
const { ownerClaimable } = useClaimableAmounts(client, chainInfo, undefined, undefined, { ownerClaimable: options });
|
|
290
|
+
return ownerClaimable;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* @deprecated Use useDelegationAndPermissions() instead
|
|
294
|
+
*/
|
|
295
|
+
export function useGetDelegation(address, options) {
|
|
296
|
+
const { client, chainInfo } = useMailerContext();
|
|
297
|
+
const { delegation } = useDelegationAndPermissions(client, chainInfo, { delegationAddress: address }, undefined, { delegation: options });
|
|
298
|
+
return delegation;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* @deprecated Use useContractState() instead
|
|
302
|
+
*/
|
|
303
|
+
export function useIsPaused(options) {
|
|
304
|
+
const { client, chainInfo } = useMailerContext();
|
|
305
|
+
const { isPaused } = useContractState(client, chainInfo, undefined, { isPaused: options });
|
|
306
|
+
return isPaused;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* @deprecated Use useDelegationAndPermissions() instead
|
|
310
|
+
*/
|
|
311
|
+
export function useHasPermission(contractAddress, walletAddress, options) {
|
|
312
|
+
const { client, chainInfo } = useMailerContext();
|
|
313
|
+
const { hasPermission } = useDelegationAndPermissions(client, chainInfo, { contractAddress, walletAddress }, undefined, { hasPermission: options });
|
|
314
|
+
return hasPermission;
|
|
185
315
|
}
|
|
186
316
|
//# sourceMappingURL=useMailerQueries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMailerQueries.js","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmC,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useMailerQueries.js","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmC,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAO9C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,CAAC,QAAQ,CAAU;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,GAAG,EAAE,SAAS,CAAU;IAC3D,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,GAAG,EAAE,eAAe,CAAU;IACvE,eAAe,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,GAAG,eAAe,CAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,CAAU;IACpG,cAAc,EAAE,GAAG,EAAE,C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E,SAAS,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3F,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,OAAuE;IAEvE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACjD,MAAM,EAAE,aAAa,EAAE,GAAG,2BAA2B,CACnD,MAAM,EACN,SAAS,EACT,EAAE,eAAe,EAAE,aAAa,EAAE,EAClC,SAAS,EACT,EAAE,aAAa,EAAE,OAAO,EAAE,CAC3B,CAAC;IACF,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
* }
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
|
-
export { MailerProvider, useMailerClient, QueryClient, QueryClientProvider } from './context/MailerProvider';
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
33
|
+
export { MailerProvider, useMailerClient, useMailerContext, QueryClient, QueryClientProvider } from './context/MailerProvider';
|
|
34
|
+
export { useFees, useClaimableAmounts, useDelegationAndPermissions, useContractState, mailerQueryKeys, } from './hooks/useMailerQueries';
|
|
35
|
+
export { useMessaging, useClaims, useDelegation, usePermissions, useContractControl, useOwnerOperations, } from './hooks/useMailerMutations';
|
|
36
|
+
export { useGetSendFee, useGetDelegationFee, useGetClaimableAmount, useGetOwnerClaimable, useGetDelegation, useIsPaused, useWalletAddress, useChainType, useHasPermission, } from './hooks/useMailerQueries';
|
|
37
|
+
export { useSendMessage, useSendPrepared, useClaimRevenue, useClaimOwnerShare, useClaimExpiredShares, useDelegateTo, useRejectDelegation, useSetFees, useSetPermission, useRemovePermission, usePause, useUnpause, useEmergencyUnpause, useDistributeClaimableFunds, } from './hooks/useMailerMutations';
|
|
36
38
|
export type { ChainConfig, MessageResult, UnifiedTransaction } from '../unified/types';
|
|
37
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/H,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -31,9 +31,13 @@
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
// Context and Provider
|
|
34
|
-
export { MailerProvider, useMailerClient, QueryClient, QueryClientProvider } from './context/MailerProvider.js';
|
|
35
|
-
// Query Hooks (
|
|
36
|
-
export {
|
|
37
|
-
// Mutation Hooks (
|
|
38
|
-
export {
|
|
34
|
+
export { MailerProvider, useMailerClient, useMailerContext, QueryClient, QueryClientProvider } from './context/MailerProvider.js';
|
|
35
|
+
// Grouped Query Hooks (Preferred - no context dependency)
|
|
36
|
+
export { useFees, useClaimableAmounts, useDelegationAndPermissions, useContractState, mailerQueryKeys, } from './hooks/useMailerQueries.js';
|
|
37
|
+
// Grouped Mutation Hooks (Preferred - no context dependency)
|
|
38
|
+
export { useMessaging, useClaims, useDelegation, usePermissions, useContractControl, useOwnerOperations, } from './hooks/useMailerMutations.js';
|
|
39
|
+
// Legacy Individual Query Hooks (Deprecated - use grouped hooks above)
|
|
40
|
+
export { useGetSendFee, useGetDelegationFee, useGetClaimableAmount, useGetOwnerClaimable, useGetDelegation, useIsPaused, useWalletAddress, useChainType, useHasPermission, } from './hooks/useMailerQueries.js';
|
|
41
|
+
// Legacy Individual Mutation Hooks (Deprecated - use grouped hooks above)
|
|
42
|
+
export { useSendMessage, useSendPrepared, useClaimRevenue, useClaimOwnerShare, useClaimExpiredShares, useDelegateTo, useRejectDelegation, useSetFees, useSetPermission, useRemovePermission, usePause, useUnpause, useEmergencyUnpause, useDistributeClaimableFunds, } from './hooks/useMailerMutations.js';
|
|
39
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/H,0DAA0D;AAC1D,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,6DAA6D;AAC7D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,uEAAuE;AACvE,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,0EAA0E;AAC1E,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/solana/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/solana/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AAEnC,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/solana/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/solana/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,OAAO,EACL,kBAAkB,EAKnB,MAAM,2BAA2B,CAAC;AAEnC,cAAc,YAAY,CAAC"}
|