@sudobility/contracts 1.13.1 → 1.13.2
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/evm-mailer-client.js +3 -3
- package/dist/evm/src/evm/evm-mailer-client.js.map +1 -1
- package/dist/evm/src/evm/index.d.ts +3 -3
- 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 +2 -2
- package/dist/solana/solana/index.d.ts.map +1 -1
- package/dist/solana/solana/index.js +3 -3
- package/dist/solana/solana/index.js.map +1 -1
- package/dist/solana/solana/solana-mailer-client.d.ts +1 -1
- package/dist/solana/solana/solana-mailer-client.d.ts.map +1 -1
- package/dist/solana/solana/solana-mailer-client.js +1 -1
- package/dist/solana/solana/solana-mailer-client.js.map +1 -1
- package/dist/solana/solana/types.d.ts +1 -1
- package/dist/solana/solana/types.d.ts.map +1 -1
- package/dist/solana/solana/types.js +5 -5
- package/dist/solana/solana/types.js.map +1 -1
- package/dist/unified/src/evm/evm-mailer-client.js +7 -11
- package/dist/unified/src/evm/evm-mailer-client.js.map +1 -1
- package/dist/unified/src/evm/index.d.ts +3 -3
- package/dist/unified/src/evm/index.d.ts.map +1 -1
- package/dist/unified/src/evm/index.js +2 -7
- package/dist/unified/src/evm/index.js.map +1 -1
- package/dist/unified/src/react/context/MailerProvider.js +14 -55
- package/dist/unified/src/react/context/MailerProvider.js.map +1 -1
- package/dist/unified/src/react/hooks/useMailerMutations.js +76 -98
- package/dist/unified/src/react/hooks/useMailerMutations.js.map +1 -1
- package/dist/unified/src/react/hooks/useMailerQueries.js +52 -68
- package/dist/unified/src/react/hooks/useMailerQueries.js.map +1 -1
- package/dist/unified/src/react/index.js +5 -47
- package/dist/unified/src/react/index.js.map +1 -1
- package/dist/unified/src/solana/index.d.ts +2 -2
- package/dist/unified/src/solana/index.d.ts.map +1 -1
- package/dist/unified/src/solana/index.js +2 -20
- package/dist/unified/src/solana/index.js.map +1 -1
- package/dist/unified/src/solana/solana-mailer-client.d.ts +1 -1
- package/dist/unified/src/solana/solana-mailer-client.d.ts.map +1 -1
- package/dist/unified/src/solana/solana-mailer-client.js +129 -133
- package/dist/unified/src/solana/solana-mailer-client.js.map +1 -1
- package/dist/unified/src/solana/types.d.ts +1 -1
- package/dist/unified/src/solana/types.d.ts.map +1 -1
- package/dist/unified/src/solana/types.js +6 -13
- package/dist/unified/src/solana/types.js.map +1 -1
- package/dist/unified/src/unified/index.d.ts +3 -3
- package/dist/unified/src/unified/index.d.ts.map +1 -1
- package/dist/unified/src/unified/index.js +2 -7
- package/dist/unified/src/unified/index.js.map +1 -1
- package/dist/unified/src/unified/onchain-mailer-client.d.ts +3 -3
- package/dist/unified/src/unified/onchain-mailer-client.d.ts.map +1 -1
- package/dist/unified/src/unified/onchain-mailer-client.js +88 -125
- package/dist/unified/src/unified/onchain-mailer-client.js.map +1 -1
- package/dist/unified/src/unified/types.js +1 -2
- package/dist/unified/src/unified/wallet-detector.js +10 -14
- package/dist/unified/src/unified/wallet-detector.js.map +1 -1
- package/dist/unified/src/utils/chain-config.d.ts +1 -1
- package/dist/unified/src/utils/chain-config.d.ts.map +1 -1
- package/dist/unified/src/utils/chain-config.js +9 -13
- package/dist/unified/src/utils/chain-config.js.map +1 -1
- package/dist/unified/src/utils/currency.js +6 -11
- package/dist/unified/src/utils/currency.js.map +1 -1
- package/dist/unified/src/utils/index.d.ts +3 -3
- package/dist/unified/src/utils/index.d.ts.map +1 -1
- package/dist/unified/src/utils/index.js +3 -19
- package/dist/unified/src/utils/index.js.map +1 -1
- package/dist/unified/src/utils/validation.js +11 -17
- package/dist/unified/src/utils/validation.js.map +1 -1
- package/dist/unified/typechain-types/Mailer.js +1 -2
- package/dist/unified/typechain-types/MockUSDC.js +1 -2
- package/dist/unified/typechain-types/common.js +1 -2
- package/dist/unified/typechain-types/factories/Mailer__factory.js +4 -8
- package/dist/unified/typechain-types/factories/Mailer__factory.js.map +1 -1
- package/dist/unified/typechain-types/factories/MockUSDC__factory.js +4 -8
- package/dist/unified/typechain-types/factories/MockUSDC__factory.js.map +1 -1
- package/dist/unified/typechain-types/factories/index.js +3 -41
- package/dist/unified/typechain-types/factories/index.js.map +1 -1
- package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.js +4 -8
- package/dist/unified/typechain-types/factories/interfaces/IERC20__factory.js.map +1 -1
- package/dist/unified/typechain-types/factories/interfaces/index.js +1 -5
- package/dist/unified/typechain-types/factories/interfaces/index.js.map +1 -1
- package/dist/unified/typechain-types/index.js +4 -43
- package/dist/unified/typechain-types/index.js.map +1 -1
- package/dist/unified/typechain-types/interfaces/IERC20.js +1 -2
- package/dist/unified/typechain-types/interfaces/index.js +1 -2
- package/package.json +12 -18
- package/dist/unified/package.json +0 -3
- package/dist/unified-esm/src/evm/evm-mailer-client.d.ts +0 -1062
- package/dist/unified-esm/src/evm/evm-mailer-client.d.ts.map +0 -1
- package/dist/unified-esm/src/evm/evm-mailer-client.js +0 -920
- package/dist/unified-esm/src/evm/evm-mailer-client.js.map +0 -1
- package/dist/unified-esm/src/evm/index.d.ts +0 -4
- package/dist/unified-esm/src/evm/index.d.ts.map +0 -1
- package/dist/unified-esm/src/evm/index.js +0 -5
- package/dist/unified-esm/src/evm/index.js.map +0 -1
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts +0 -108
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts.map +0 -1
- package/dist/unified-esm/src/react/context/MailerProvider.js +0 -119
- package/dist/unified-esm/src/react/context/MailerProvider.js.map +0 -1
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts +0 -334
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts.map +0 -1
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js +0 -392
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js.map +0 -1
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts +0 -184
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts.map +0 -1
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js +0 -316
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js.map +0 -1
- package/dist/unified-esm/src/react/index.d.ts +0 -39
- package/dist/unified-esm/src/react/index.d.ts.map +0 -1
- package/dist/unified-esm/src/react/index.js +0 -43
- package/dist/unified-esm/src/react/index.js.map +0 -1
- package/dist/unified-esm/src/solana/index.d.ts +0 -3
- package/dist/unified-esm/src/solana/index.d.ts.map +0 -1
- package/dist/unified-esm/src/solana/index.js +0 -4
- package/dist/unified-esm/src/solana/index.js.map +0 -1
- package/dist/unified-esm/src/solana/solana-mailer-client.d.ts +0 -209
- package/dist/unified-esm/src/solana/solana-mailer-client.d.ts.map +0 -1
- package/dist/unified-esm/src/solana/solana-mailer-client.js +0 -1000
- package/dist/unified-esm/src/solana/solana-mailer-client.js.map +0 -1
- package/dist/unified-esm/src/solana/types.d.ts +0 -29
- package/dist/unified-esm/src/solana/types.d.ts.map +0 -1
- package/dist/unified-esm/src/solana/types.js +0 -16
- package/dist/unified-esm/src/solana/types.js.map +0 -1
- package/dist/unified-esm/src/unified/index.d.ts +0 -4
- package/dist/unified-esm/src/unified/index.d.ts.map +0 -1
- package/dist/unified-esm/src/unified/index.js +0 -4
- package/dist/unified-esm/src/unified/index.js.map +0 -1
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts +0 -258
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts.map +0 -1
- package/dist/unified-esm/src/unified/onchain-mailer-client.js +0 -731
- package/dist/unified-esm/src/unified/onchain-mailer-client.js.map +0 -1
- package/dist/unified-esm/src/unified/types.d.ts +0 -54
- package/dist/unified-esm/src/unified/types.d.ts.map +0 -1
- package/dist/unified-esm/src/unified/types.js +0 -2
- package/dist/unified-esm/src/unified/types.js.map +0 -1
- package/dist/unified-esm/src/unified/wallet-detector.d.ts +0 -28
- package/dist/unified-esm/src/unified/wallet-detector.d.ts.map +0 -1
- package/dist/unified-esm/src/unified/wallet-detector.js +0 -59
- package/dist/unified-esm/src/unified/wallet-detector.js.map +0 -1
- package/dist/unified-esm/src/utils/chain-config.d.ts +0 -75
- package/dist/unified-esm/src/utils/chain-config.d.ts.map +0 -1
- package/dist/unified-esm/src/utils/chain-config.js +0 -199
- package/dist/unified-esm/src/utils/chain-config.js.map +0 -1
- package/dist/unified-esm/src/utils/currency.d.ts +0 -26
- package/dist/unified-esm/src/utils/currency.d.ts.map +0 -1
- package/dist/unified-esm/src/utils/currency.js +0 -31
- package/dist/unified-esm/src/utils/currency.js.map +0 -1
- package/dist/unified-esm/src/utils/index.d.ts +0 -4
- package/dist/unified-esm/src/utils/index.d.ts.map +0 -1
- package/dist/unified-esm/src/utils/index.js +0 -4
- package/dist/unified-esm/src/utils/index.js.map +0 -1
- package/dist/unified-esm/src/utils/validation.d.ts +0 -10
- package/dist/unified-esm/src/utils/validation.d.ts.map +0 -1
- package/dist/unified-esm/src/utils/validation.js +0 -96
- package/dist/unified-esm/src/utils/validation.js.map +0 -1
- package/dist/unified-esm/typechain-types/Mailer.d.ts +0 -698
- package/dist/unified-esm/typechain-types/Mailer.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/Mailer.js +0 -2
- package/dist/unified-esm/typechain-types/Mailer.js.map +0 -1
- package/dist/unified-esm/typechain-types/MockUSDC.d.ts +0 -118
- package/dist/unified-esm/typechain-types/MockUSDC.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/MockUSDC.js +0 -2
- package/dist/unified-esm/typechain-types/MockUSDC.js.map +0 -1
- package/dist/unified-esm/typechain-types/common.d.ts +0 -51
- package/dist/unified-esm/typechain-types/common.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/common.js +0 -2
- package/dist/unified-esm/typechain-types/common.js.map +0 -1
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts +0 -875
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.js +0 -1121
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.js.map +0 -1
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.d.ts +0 -193
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.js +0 -259
- package/dist/unified-esm/typechain-types/factories/MockUSDC__factory.js.map +0 -1
- package/dist/unified-esm/typechain-types/factories/index.d.ts +0 -4
- package/dist/unified-esm/typechain-types/factories/index.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/factories/index.js +0 -7
- package/dist/unified-esm/typechain-types/factories/index.js.map +0 -1
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.d.ts +0 -80
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.js +0 -112
- package/dist/unified-esm/typechain-types/factories/interfaces/IERC20__factory.js.map +0 -1
- package/dist/unified-esm/typechain-types/factories/interfaces/index.d.ts +0 -2
- package/dist/unified-esm/typechain-types/factories/interfaces/index.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/factories/interfaces/index.js +0 -5
- package/dist/unified-esm/typechain-types/factories/interfaces/index.js.map +0 -1
- package/dist/unified-esm/typechain-types/index.d.ts +0 -10
- package/dist/unified-esm/typechain-types/index.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/index.js +0 -5
- package/dist/unified-esm/typechain-types/index.js.map +0 -1
- package/dist/unified-esm/typechain-types/interfaces/IERC20.d.ts +0 -70
- package/dist/unified-esm/typechain-types/interfaces/IERC20.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/interfaces/IERC20.js +0 -2
- package/dist/unified-esm/typechain-types/interfaces/IERC20.js.map +0 -1
- package/dist/unified-esm/typechain-types/interfaces/index.d.ts +0 -2
- package/dist/unified-esm/typechain-types/interfaces/index.d.ts.map +0 -1
- package/dist/unified-esm/typechain-types/interfaces/index.js +0 -2
- package/dist/unified-esm/typechain-types/interfaces/index.js.map +0 -1
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
import { ChainType } from '@sudobility/types';
|
|
3
|
-
/**
|
|
4
|
-
* Query keys for React Query cache management
|
|
5
|
-
*/
|
|
6
|
-
export const mailerQueryKeys = {
|
|
7
|
-
all: ['mailer'],
|
|
8
|
-
sendFee: () => [...mailerQueryKeys.all, 'sendFee'],
|
|
9
|
-
delegationFee: () => [...mailerQueryKeys.all, 'delegationFee'],
|
|
10
|
-
claimableAmount: (address) => [...mailerQueryKeys.all, 'claimableAmount', address],
|
|
11
|
-
ownerClaimable: () => [...mailerQueryKeys.all, 'ownerClaimable'],
|
|
12
|
-
delegation: (address) => [...mailerQueryKeys.all, 'delegation', address],
|
|
13
|
-
isPaused: () => [...mailerQueryKeys.all, 'isPaused'],
|
|
14
|
-
permissions: (contractAddress, walletAddress) => [...mailerQueryKeys.all, 'permissions', contractAddress, walletAddress],
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Hook for fee-related queries
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* function FeeDisplay() {
|
|
22
|
-
* const { sendFee, delegationFee } = useFees(client, chainInfo);
|
|
23
|
-
*
|
|
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
|
-
* );
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
export function useFees(client, chainInfo, publicClientOrConnection, options) {
|
|
36
|
-
const sendFee = useQuery({
|
|
37
|
-
queryKey: mailerQueryKeys.sendFee(),
|
|
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
|
-
},
|
|
46
|
-
staleTime: 5 * 60 * 1000, // 5 minutes - fees don't change often
|
|
47
|
-
...options?.sendFee,
|
|
48
|
-
});
|
|
49
|
-
const delegationFee = useQuery({
|
|
50
|
-
queryKey: mailerQueryKeys.delegationFee(),
|
|
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,
|
|
61
|
-
});
|
|
62
|
-
return {
|
|
63
|
-
sendFee,
|
|
64
|
-
delegationFee,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Hook for claimable amount queries
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```tsx
|
|
72
|
-
* function ClaimableDisplay({ address }: { address?: string }) {
|
|
73
|
-
* const { claimableAmount, ownerClaimable } = useClaimableAmounts(
|
|
74
|
-
* client,
|
|
75
|
-
* chainInfo,
|
|
76
|
-
* address
|
|
77
|
-
* );
|
|
78
|
-
*
|
|
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
|
-
* );
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
export function useClaimableAmounts(client, chainInfo, address, publicClientOrConnection, options) {
|
|
89
|
-
const claimableAmount = useQuery({
|
|
90
|
-
queryKey: mailerQueryKeys.claimableAmount(address),
|
|
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,
|
|
107
|
-
});
|
|
108
|
-
const ownerClaimable = useQuery({
|
|
109
|
-
queryKey: mailerQueryKeys.ownerClaimable(),
|
|
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,
|
|
120
|
-
});
|
|
121
|
-
return {
|
|
122
|
-
claimableAmount,
|
|
123
|
-
ownerClaimable,
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Hook for delegation and permission queries
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```tsx
|
|
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
|
-
* );
|
|
141
|
-
*
|
|
142
|
-
* return (
|
|
143
|
-
* <div>
|
|
144
|
-
* Delegated to: {delegation.data}
|
|
145
|
-
* Has Permission: {hasPermission.data ? 'Yes' : 'No'}
|
|
146
|
-
* </div>
|
|
147
|
-
* );
|
|
148
|
-
* }
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
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,
|
|
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
|
-
};
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Hook for contract state queries
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* ```tsx
|
|
190
|
-
* function ContractStatus() {
|
|
191
|
-
* const { isPaused } = useContractState(client, chainInfo);
|
|
192
|
-
*
|
|
193
|
-
* return (
|
|
194
|
-
* <div>
|
|
195
|
-
* Contract: {isPaused.data ? 'Paused' : 'Active'}
|
|
196
|
-
* </div>
|
|
197
|
-
* );
|
|
198
|
-
* }
|
|
199
|
-
* ```
|
|
200
|
-
*/
|
|
201
|
-
export function useContractState(client, chainInfo, publicClientOrConnection, options) {
|
|
202
|
-
const isPaused = useQuery({
|
|
203
|
-
queryKey: mailerQueryKeys.isPaused(),
|
|
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,
|
|
214
|
-
});
|
|
215
|
-
return {
|
|
216
|
-
isPaused,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Helper hook to get wallet address from different wallet types
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* ```tsx
|
|
224
|
-
* function WalletDisplay({ wallet }: { wallet: Wallet }) {
|
|
225
|
-
* const address = useWalletAddress(wallet);
|
|
226
|
-
* return <div>Address: {address}</div>;
|
|
227
|
-
* }
|
|
228
|
-
* ```
|
|
229
|
-
*/
|
|
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;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Helper hook to get chain type from ChainInfo
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* ```tsx
|
|
248
|
-
* function ChainBadge({ chainInfo }: { chainInfo: ChainInfo }) {
|
|
249
|
-
* const chainType = useChainType(chainInfo);
|
|
250
|
-
* return <div>Chain: {chainType}</div>;
|
|
251
|
-
* }
|
|
252
|
-
* ```
|
|
253
|
-
*/
|
|
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;
|
|
315
|
-
}
|
|
316
|
-
//# sourceMappingURL=useMailerQueries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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,EAAE,OAAO,EAAE,CAAC,CAAC;IACrH,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAgB,EAChB,OAA6E;IAE7E,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACjD,MAAM,EAAE,UAAU,EAAE,GAAG,2BAA2B,CAChD,MAAM,EACN,SAAS,EACT,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAC9B,SAAS,EACT,EAAE,UAAU,EAAE,OAAO,EAAE,CACxB,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,OAAuE;IAEvE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,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"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React integration for @johnqh/mail_box_contracts
|
|
3
|
-
*
|
|
4
|
-
* Provides React Query hooks and context for interacting with the
|
|
5
|
-
* OnchainMailerClient across EVM and Solana chains.
|
|
6
|
-
*
|
|
7
|
-
* @module @johnqh/mail_box_contracts/react
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { MailerProvider, useGetSendFee, useSendMessage } from '@johnqh/mail_box_contracts/react';
|
|
12
|
-
*
|
|
13
|
-
* function App() {
|
|
14
|
-
* return (
|
|
15
|
-
* <MailerProvider wallet={wallet} config={config}>
|
|
16
|
-
* <MessageSender />
|
|
17
|
-
* </MailerProvider>
|
|
18
|
-
* );
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* function MessageSender() {
|
|
22
|
-
* const { data: fee } = useGetSendFee();
|
|
23
|
-
* const sendMessage = useSendMessage();
|
|
24
|
-
*
|
|
25
|
-
* return (
|
|
26
|
-
* <button onClick={() => sendMessage.mutate({ subject: 'Hi', body: 'Hello!' })}>
|
|
27
|
-
* Send (Fee: {Number(fee) / 1_000_000} USDC)
|
|
28
|
-
* </button>
|
|
29
|
-
* );
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
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';
|
|
38
|
-
export type { ChainConfig, MessageResult, UnifiedTransaction } from '../unified/types';
|
|
39
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React integration for @johnqh/mail_box_contracts
|
|
3
|
-
*
|
|
4
|
-
* Provides React Query hooks and context for interacting with the
|
|
5
|
-
* OnchainMailerClient across EVM and Solana chains.
|
|
6
|
-
*
|
|
7
|
-
* @module @johnqh/mail_box_contracts/react
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { MailerProvider, useGetSendFee, useSendMessage } from '@johnqh/mail_box_contracts/react';
|
|
12
|
-
*
|
|
13
|
-
* function App() {
|
|
14
|
-
* return (
|
|
15
|
-
* <MailerProvider wallet={wallet} config={config}>
|
|
16
|
-
* <MessageSender />
|
|
17
|
-
* </MailerProvider>
|
|
18
|
-
* );
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* function MessageSender() {
|
|
22
|
-
* const { data: fee } = useGetSendFee();
|
|
23
|
-
* const sendMessage = useSendMessage();
|
|
24
|
-
*
|
|
25
|
-
* return (
|
|
26
|
-
* <button onClick={() => sendMessage.mutate({ subject: 'Hi', body: 'Hello!' })}>
|
|
27
|
-
* Send (Fee: {Number(fee) / 1_000_000} USDC)
|
|
28
|
-
* </button>
|
|
29
|
-
* );
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
// Context and Provider
|
|
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';
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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"}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { Connection, PublicKey, Transaction } from '@solana/web3.js';
|
|
2
|
-
import { ChainInfo } from '@sudobility/configs';
|
|
3
|
-
import { Optional } from '@sudobility/types';
|
|
4
|
-
import { ClaimableInfo, MailerFees } from './types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Interface for wallet adapter pattern
|
|
7
|
-
*/
|
|
8
|
-
export interface Wallet {
|
|
9
|
-
publicKey: PublicKey;
|
|
10
|
-
signTransaction<T extends Transaction>(transaction: T): Promise<T>;
|
|
11
|
-
signAllTransactions<T extends Transaction>(transactions: T[]): Promise<T[]>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Solana Wallet interface
|
|
15
|
-
*/
|
|
16
|
-
export interface SolanaWallet {
|
|
17
|
-
wallet: Wallet;
|
|
18
|
-
connection?: Connection;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Compute unit optimization options for Solana transactions
|
|
22
|
-
*/
|
|
23
|
-
export interface ComputeUnitOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Compute unit limit for the transaction (default: 200,000)
|
|
26
|
-
* Max: 1,400,000
|
|
27
|
-
*/
|
|
28
|
-
computeUnitLimit?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Priority fee in micro-lamports per compute unit
|
|
31
|
-
* Higher values = faster inclusion during congestion
|
|
32
|
-
*/
|
|
33
|
-
computeUnitPrice?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Automatically simulate and optimize compute units
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
autoOptimize?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Multiplier for compute unit buffer when auto-optimizing
|
|
41
|
-
* @default 1.2 (20% buffer)
|
|
42
|
-
*/
|
|
43
|
-
computeUnitMultiplier?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Skip compute unit settings entirely
|
|
46
|
-
* @default false
|
|
47
|
-
*/
|
|
48
|
-
skipComputeUnits?: boolean;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Transaction result with compute unit details
|
|
52
|
-
*/
|
|
53
|
-
export interface TransactionResult {
|
|
54
|
-
/**
|
|
55
|
-
* Transaction signature
|
|
56
|
-
*/
|
|
57
|
-
signature: string;
|
|
58
|
-
/**
|
|
59
|
-
* Transaction hash (same as signature for Solana)
|
|
60
|
-
*/
|
|
61
|
-
transactionHash: string;
|
|
62
|
-
/**
|
|
63
|
-
* Simulated compute units (if auto-optimized)
|
|
64
|
-
*/
|
|
65
|
-
simulatedUnits?: number;
|
|
66
|
-
/**
|
|
67
|
-
* Actual compute unit limit set
|
|
68
|
-
*/
|
|
69
|
-
computeUnitLimit?: number;
|
|
70
|
-
/**
|
|
71
|
-
* Priority fee per compute unit (if set)
|
|
72
|
-
*/
|
|
73
|
-
computeUnitPrice?: number;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Stateless Solana Mailer client.
|
|
77
|
-
* All methods take wallet and chainInfo as parameters.
|
|
78
|
-
* No state is stored in the instance.
|
|
79
|
-
*/
|
|
80
|
-
export declare class SolanaMailerClient {
|
|
81
|
-
private defaultComputeUnitMultiplier;
|
|
82
|
-
private readonly defaultComputeUnits;
|
|
83
|
-
private readonly priorityFeeRecommendations;
|
|
84
|
-
/**
|
|
85
|
-
* Create or get connection from wallet/chainInfo
|
|
86
|
-
*/
|
|
87
|
-
private getOrCreateConnection;
|
|
88
|
-
/**
|
|
89
|
-
* Get program and state PDAs from chainInfo
|
|
90
|
-
*/
|
|
91
|
-
private getProgramAddresses;
|
|
92
|
-
/**
|
|
93
|
-
* Optimize compute units for a transaction
|
|
94
|
-
*/
|
|
95
|
-
private optimizeComputeUnits;
|
|
96
|
-
/**
|
|
97
|
-
* Send and confirm transaction
|
|
98
|
-
*/
|
|
99
|
-
private sendTransaction;
|
|
100
|
-
/**
|
|
101
|
-
* Initialize the mailer program (owner only)
|
|
102
|
-
*/
|
|
103
|
-
initialize(connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
104
|
-
/**
|
|
105
|
-
* Send a message with optional revenue sharing
|
|
106
|
-
*/
|
|
107
|
-
send(connectedWallet: SolanaWallet, chainInfo: ChainInfo, to: string | PublicKey, subject: string, body: string, revenueShareToReceiver: boolean, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
108
|
-
/**
|
|
109
|
-
* Send a prepared message
|
|
110
|
-
*/
|
|
111
|
-
sendPrepared(connectedWallet: SolanaWallet, chainInfo: ChainInfo, to: string | PublicKey, mailId: string, revenueShareToReceiver: boolean, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
112
|
-
/**
|
|
113
|
-
* Send through webhook
|
|
114
|
-
*/
|
|
115
|
-
sendThroughWebhook(connectedWallet: SolanaWallet, chainInfo: ChainInfo, to: string | PublicKey, subject: string, body: string, webhookId: string, revenueShareToReceiver: boolean, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
116
|
-
/**
|
|
117
|
-
* Send to email address
|
|
118
|
-
*/
|
|
119
|
-
sendToEmail(emailHash: string, subject: string, body: string, payer: string | PublicKey, revenueShareToReceiver: boolean, connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
120
|
-
/**
|
|
121
|
-
* Send prepared to email address
|
|
122
|
-
*/
|
|
123
|
-
sendPreparedToEmail(emailHash: string, mailId: string, payer: string | PublicKey, revenueShareToReceiver: boolean, connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
124
|
-
/**
|
|
125
|
-
* Claim recipient share
|
|
126
|
-
*/
|
|
127
|
-
claimRecipientShare(connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
128
|
-
/**
|
|
129
|
-
* Claim owner share (owner only)
|
|
130
|
-
*/
|
|
131
|
-
claimOwnerShare(connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
132
|
-
/**
|
|
133
|
-
* Claim expired shares (owner only)
|
|
134
|
-
*/
|
|
135
|
-
claimExpiredShares(connectedWallet: SolanaWallet, chainInfo: ChainInfo, recipient: string | PublicKey, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
136
|
-
/**
|
|
137
|
-
* Delegate to another address
|
|
138
|
-
*/
|
|
139
|
-
delegateTo(connectedWallet: SolanaWallet, chainInfo: ChainInfo, delegate: Optional<string | PublicKey>, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
140
|
-
/**
|
|
141
|
-
* Reject delegation
|
|
142
|
-
*/
|
|
143
|
-
rejectDelegation(connectedWallet: SolanaWallet, chainInfo: ChainInfo, delegatingAddress: string | PublicKey, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
144
|
-
/**
|
|
145
|
-
* Set fees (owner only)
|
|
146
|
-
*/
|
|
147
|
-
setFees(connectedWallet: SolanaWallet, chainInfo: ChainInfo, sendFee: number | bigint, delegationFee: number | bigint, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
148
|
-
/**
|
|
149
|
-
* Set custom fee percentage
|
|
150
|
-
*/
|
|
151
|
-
setCustomFeePercentage(account: string | PublicKey, percentage: number, connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
152
|
-
/**
|
|
153
|
-
* Clear custom fee percentage
|
|
154
|
-
*/
|
|
155
|
-
clearCustomFeePercentage(account: string | PublicKey, connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
156
|
-
/**
|
|
157
|
-
* Pause the program (owner only)
|
|
158
|
-
*/
|
|
159
|
-
pause(connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
160
|
-
/**
|
|
161
|
-
* Unpause the program (owner only)
|
|
162
|
-
*/
|
|
163
|
-
unpause(connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
164
|
-
/**
|
|
165
|
-
* Emergency unpause (owner only)
|
|
166
|
-
*/
|
|
167
|
-
emergencyUnpause(connectedWallet: SolanaWallet, chainInfo: ChainInfo, computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
168
|
-
/**
|
|
169
|
-
* Distribute claimable funds when paused
|
|
170
|
-
*/
|
|
171
|
-
distributeClaimableFunds(connectedWallet: SolanaWallet, chainInfo: ChainInfo, recipients: (string | PublicKey)[], computeOptions?: ComputeUnitOptions): Promise<TransactionResult>;
|
|
172
|
-
/**
|
|
173
|
-
* Get fees configuration
|
|
174
|
-
*/
|
|
175
|
-
getFees(chainInfo: ChainInfo, connection?: Connection): Promise<MailerFees>;
|
|
176
|
-
/**
|
|
177
|
-
* Get send fee only
|
|
178
|
-
*/
|
|
179
|
-
getSendFee(chainInfo: ChainInfo, connection?: Connection): Promise<bigint>;
|
|
180
|
-
/**
|
|
181
|
-
* Get delegation fee only
|
|
182
|
-
*/
|
|
183
|
-
getDelegationFee(chainInfo: ChainInfo, connection?: Connection): Promise<bigint>;
|
|
184
|
-
/**
|
|
185
|
-
* Get recipient claimable info
|
|
186
|
-
*/
|
|
187
|
-
getRecipientClaimable(recipient: string | PublicKey, chainInfo: ChainInfo, connection?: Connection): Promise<ClaimableInfo | null>;
|
|
188
|
-
/**
|
|
189
|
-
* Get owner claimable amount
|
|
190
|
-
*/
|
|
191
|
-
getOwnerClaimable(chainInfo: ChainInfo, connection?: Connection): Promise<number>;
|
|
192
|
-
/**
|
|
193
|
-
* Get delegation for an address
|
|
194
|
-
*/
|
|
195
|
-
getDelegation(address: string | PublicKey, chainInfo: ChainInfo, connection?: Connection): Promise<PublicKey | null>;
|
|
196
|
-
/**
|
|
197
|
-
* Get custom fee percentage for an account
|
|
198
|
-
*/
|
|
199
|
-
getCustomFeePercentage(account: string | PublicKey, chainInfo: ChainInfo, connection?: Connection): Promise<number>;
|
|
200
|
-
/**
|
|
201
|
-
* Check if the program is paused
|
|
202
|
-
*/
|
|
203
|
-
isPaused(chainInfo: ChainInfo, connection?: Connection): Promise<boolean>;
|
|
204
|
-
/**
|
|
205
|
-
* Get the contract owner
|
|
206
|
-
*/
|
|
207
|
-
getOwner(chainInfo: ChainInfo, connection?: Connection): Promise<PublicKey>;
|
|
208
|
-
}
|
|
209
|
-
//# sourceMappingURL=solana-mailer-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solana-mailer-client.d.ts","sourceRoot":"","sources":["../../../../src/solana/solana-mailer-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACnE,mBAAmB,CAAC,CAAC,SAAS,WAAW,EAAE,YAAY,EAAE,CAAC,EAA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