@sudobility/contracts 0.15.1 → 1.10.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/README.md +2 -3
- package/artifacts/contracts/Mailer.sol/Mailer.d.ts +2 -185
- package/artifacts/contracts/Mailer.sol/Mailer.dbg.json +1 -1
- package/artifacts/contracts/Mailer.sol/Mailer.json +2 -185
- package/artifacts/contracts/MockUSDC.sol/MockUSDC.dbg.json +1 -1
- package/artifacts/contracts/interfaces/IERC20.sol/IERC20.dbg.json +1 -1
- 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/evm/src/evm/mailer-client.d.ts +210 -0
- package/dist/evm/src/evm/mailer-client.d.ts.map +1 -0
- package/dist/evm/src/evm/mailer-client.js +417 -0
- package/dist/evm/src/evm/mailer-client.js.map +1 -0
- package/dist/evm/typechain-types/Mailer.d.ts +10 -128
- package/dist/evm/typechain-types/Mailer.d.ts.map +1 -1
- package/dist/evm/typechain-types/factories/Mailer__factory.d.ts +1 -145
- package/dist/evm/typechain-types/factories/Mailer__factory.d.ts.map +1 -1
- package/dist/evm/typechain-types/factories/Mailer__factory.js +1 -184
- package/dist/evm/typechain-types/factories/Mailer__factory.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 +1 -4
- package/dist/solana/solana/index.js.map +1 -1
- package/dist/solana/solana/mailer-client.d.ts +209 -0
- package/dist/solana/solana/mailer-client.d.ts.map +1 -0
- package/dist/solana/solana/mailer-client.js +728 -0
- package/dist/solana/solana/mailer-client.js.map +1 -0
- package/dist/solana/solana/types.d.ts +2 -3
- package/dist/solana/solana/types.d.ts.map +1 -1
- package/dist/solana/solana/types.js.map +1 -1
- 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/evm/mailer-client.d.ts +210 -0
- package/dist/unified/src/evm/mailer-client.d.ts.map +1 -0
- package/dist/unified/src/evm/mailer-client.js +417 -0
- package/dist/unified/src/evm/mailer-client.js.map +1 -0
- package/dist/unified/src/react/context/MailerProvider.d.ts +20 -26
- 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 +192 -225
- package/dist/unified/src/react/hooks/useMailerMutations.d.ts.map +1 -1
- package/dist/unified/src/react/hooks/useMailerMutations.js +266 -263
- package/dist/unified/src/react/hooks/useMailerMutations.js.map +1 -1
- package/dist/unified/src/react/hooks/useMailerQueries.d.ts +63 -117
- package/dist/unified/src/react/hooks/useMailerQueries.d.ts.map +1 -1
- package/dist/unified/src/react/hooks/useMailerQueries.js +104 -239
- package/dist/unified/src/react/hooks/useMailerQueries.js.map +1 -1
- package/dist/unified/src/react/index.d.ts +3 -5
- package/dist/unified/src/react/index.d.ts.map +1 -1
- package/dist/unified/src/react/index.js +26 -41
- 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 +1 -4
- package/dist/unified/src/solana/index.js.map +1 -1
- package/dist/unified/src/solana/mailer-client.d.ts +209 -0
- package/dist/unified/src/solana/mailer-client.d.ts.map +1 -0
- package/dist/unified/src/solana/mailer-client.js +728 -0
- package/dist/unified/src/solana/mailer-client.js.map +1 -0
- package/dist/unified/src/solana/types.d.ts +2 -3
- 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 +247 -192
- package/dist/unified/src/unified/onchain-mailer-client.d.ts.map +1 -1
- package/dist/unified/src/unified/onchain-mailer-client.js +1462 -551
- package/dist/unified/src/unified/onchain-mailer-client.js.map +1 -1
- package/dist/unified/src/unified/types.d.ts +6 -23
- package/dist/unified/src/unified/types.d.ts.map +1 -1
- package/dist/unified/src/utils/chain-config.d.ts +2 -4
- package/dist/unified/src/utils/chain-config.d.ts.map +1 -1
- package/dist/unified/src/utils/chain-config.js +36 -46
- package/dist/unified/src/utils/chain-config.js.map +1 -1
- package/dist/unified/typechain-types/Mailer.d.ts +10 -128
- package/dist/unified/typechain-types/Mailer.d.ts.map +1 -1
- package/dist/unified/typechain-types/factories/Mailer__factory.d.ts +1 -145
- package/dist/unified/typechain-types/factories/Mailer__factory.d.ts.map +1 -1
- package/dist/unified/typechain-types/factories/Mailer__factory.js +1 -184
- package/dist/unified/typechain-types/factories/Mailer__factory.js.map +1 -1
- 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/evm/mailer-client.d.ts +210 -0
- package/dist/unified-esm/src/evm/mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/evm/mailer-client.js +413 -0
- package/dist/unified-esm/src/evm/mailer-client.js.map +1 -0
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts +20 -26
- package/dist/unified-esm/src/react/context/MailerProvider.d.ts.map +1 -1
- package/dist/unified-esm/src/react/context/MailerProvider.js +26 -25
- package/dist/unified-esm/src/react/context/MailerProvider.js.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts +192 -225
- package/dist/unified-esm/src/react/hooks/useMailerMutations.d.ts.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js +262 -254
- package/dist/unified-esm/src/react/hooks/useMailerMutations.js.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts +63 -117
- package/dist/unified-esm/src/react/hooks/useMailerQueries.d.ts.map +1 -1
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js +102 -232
- package/dist/unified-esm/src/react/hooks/useMailerQueries.js.map +1 -1
- package/dist/unified-esm/src/react/index.d.ts +3 -5
- package/dist/unified-esm/src/react/index.d.ts.map +1 -1
- package/dist/unified-esm/src/react/index.js +5 -9
- 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 +1 -2
- package/dist/unified-esm/src/solana/index.js.map +1 -1
- package/dist/unified-esm/src/solana/mailer-client.d.ts +209 -0
- package/dist/unified-esm/src/solana/mailer-client.d.ts.map +1 -0
- package/dist/unified-esm/src/solana/mailer-client.js +724 -0
- package/dist/unified-esm/src/solana/mailer-client.js.map +1 -0
- package/dist/unified-esm/src/solana/types.d.ts +2 -3
- 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 +247 -192
- package/dist/unified-esm/src/unified/onchain-mailer-client.d.ts.map +1 -1
- package/dist/unified-esm/src/unified/onchain-mailer-client.js +1462 -551
- package/dist/unified-esm/src/unified/onchain-mailer-client.js.map +1 -1
- package/dist/unified-esm/src/unified/types.d.ts +6 -23
- package/dist/unified-esm/src/unified/types.d.ts.map +1 -1
- package/dist/unified-esm/src/utils/chain-config.d.ts +2 -4
- package/dist/unified-esm/src/utils/chain-config.d.ts.map +1 -1
- package/dist/unified-esm/src/utils/chain-config.js +35 -46
- package/dist/unified-esm/src/utils/chain-config.js.map +1 -1
- package/dist/unified-esm/typechain-types/Mailer.d.ts +10 -128
- package/dist/unified-esm/typechain-types/Mailer.d.ts.map +1 -1
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts +1 -145
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.d.ts.map +1 -1
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.js +1 -184
- package/dist/unified-esm/typechain-types/factories/Mailer__factory.js.map +1 -1
- package/package.json +10 -17
- package/programs/mailer/src/lib.rs +145 -764
- package/programs/mailer/tests/integration_tests.rs +65 -586
- package/typechain-types/Mailer.ts +8 -215
- package/typechain-types/factories/Mailer__factory.ts +1 -184
- package/dist/evm/src/evm/evm-mailer-client.d.ts +0 -1062
- package/dist/evm/src/evm/evm-mailer-client.d.ts.map +0 -1
- package/dist/evm/src/evm/evm-mailer-client.js +0 -924
- package/dist/evm/src/evm/evm-mailer-client.js.map +0 -1
- package/dist/solana/solana/solana-mailer-client.d.ts +0 -209
- package/dist/solana/solana/solana-mailer-client.d.ts.map +0 -1
- package/dist/solana/solana/solana-mailer-client.js +0 -1004
- package/dist/solana/solana/solana-mailer-client.js.map +0 -1
- package/dist/unified/src/evm/evm-mailer-client.d.ts +0 -1062
- package/dist/unified/src/evm/evm-mailer-client.d.ts.map +0 -1
- package/dist/unified/src/evm/evm-mailer-client.js +0 -924
- package/dist/unified/src/evm/evm-mailer-client.js.map +0 -1
- package/dist/unified/src/solana/solana-mailer-client.d.ts +0 -209
- package/dist/unified/src/solana/solana-mailer-client.d.ts.map +0 -1
- package/dist/unified/src/solana/solana-mailer-client.js +0 -1004
- package/dist/unified/src/solana/solana-mailer-client.js.map +0 -1
- 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/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
|
@@ -1,268 +1,159 @@
|
|
|
1
1
|
import { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
2
|
-
import type { MessageResult, UnifiedTransaction, DelegationResult
|
|
3
|
-
import type { ChainInfo } from '@sudobility/configs';
|
|
4
|
-
import type { OnchainMailerClient } from '../../unified/onchain-mailer-client';
|
|
2
|
+
import type { MessageResult, UnifiedTransaction, DelegationResult } from '../../unified/types';
|
|
5
3
|
/**
|
|
6
|
-
* Hook
|
|
4
|
+
* Hook to send a message
|
|
7
5
|
*
|
|
8
6
|
* @example
|
|
9
7
|
* ```tsx
|
|
10
|
-
* function
|
|
11
|
-
* const
|
|
12
|
-
* const { sendMessage, sendPrepared } = useMessaging(client, wallet, chainInfo);
|
|
8
|
+
* function SendMessageForm() {
|
|
9
|
+
* const sendMessage = useSendMessage();
|
|
13
10
|
*
|
|
14
11
|
* const handleSend = () => {
|
|
15
12
|
* sendMessage.mutate({
|
|
16
13
|
* subject: 'Hello',
|
|
17
14
|
* body: 'World!',
|
|
18
|
-
* priority: true
|
|
15
|
+
* priority: true,
|
|
16
|
+
* resolveSenderToName: false
|
|
19
17
|
* });
|
|
20
18
|
* };
|
|
21
19
|
*
|
|
22
20
|
* return (
|
|
23
21
|
* <button onClick={handleSend} disabled={sendMessage.isPending}>
|
|
24
|
-
* Send Message
|
|
22
|
+
* {sendMessage.isPending ? 'Sending...' : 'Send Message'}
|
|
25
23
|
* </button>
|
|
26
24
|
* );
|
|
27
25
|
* }
|
|
28
26
|
* ```
|
|
29
27
|
*/
|
|
30
|
-
export declare function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
resolveSenderToName?: boolean;
|
|
42
|
-
}>;
|
|
43
|
-
}): {
|
|
44
|
-
sendMessage: UseMutationResult<import("@sudobility/types").MessageSendResponse, Error, {
|
|
45
|
-
subject: string;
|
|
46
|
-
body: string;
|
|
47
|
-
priority?: boolean;
|
|
48
|
-
resolveSenderToName?: boolean;
|
|
49
|
-
}, unknown>;
|
|
50
|
-
sendPrepared: UseMutationResult<import("@sudobility/types").MessageSendResponse, Error, {
|
|
51
|
-
to: string;
|
|
52
|
-
mailId: string;
|
|
53
|
-
priority?: boolean;
|
|
54
|
-
resolveSenderToName?: boolean;
|
|
55
|
-
}, unknown>;
|
|
56
|
-
};
|
|
28
|
+
export declare function useSendMessage(options?: UseMutationOptions<MessageResult, Error, {
|
|
29
|
+
subject: string;
|
|
30
|
+
body: string;
|
|
31
|
+
priority?: boolean;
|
|
32
|
+
resolveSenderToName?: boolean;
|
|
33
|
+
}>): UseMutationResult<MessageResult, Error, {
|
|
34
|
+
subject: string;
|
|
35
|
+
body: string;
|
|
36
|
+
priority?: boolean;
|
|
37
|
+
resolveSenderToName?: boolean;
|
|
38
|
+
}>;
|
|
57
39
|
/**
|
|
58
|
-
* Hook
|
|
40
|
+
* Hook to send a prepared message
|
|
59
41
|
*
|
|
60
42
|
* @example
|
|
61
43
|
* ```tsx
|
|
62
|
-
* function
|
|
63
|
-
* const
|
|
44
|
+
* function SendPreparedButton() {
|
|
45
|
+
* const sendPrepared = useSendPrepared();
|
|
64
46
|
*
|
|
65
47
|
* return (
|
|
66
|
-
* <
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
48
|
+
* <button
|
|
49
|
+
* onClick={() => sendPrepared.mutate({
|
|
50
|
+
* to: '0x123...',
|
|
51
|
+
* mailId: 'template-001',
|
|
52
|
+
* priority: true
|
|
53
|
+
* })}
|
|
54
|
+
* disabled={sendPrepared.isPending}
|
|
55
|
+
* >
|
|
56
|
+
* Send Prepared
|
|
57
|
+
* </button>
|
|
74
58
|
* );
|
|
75
59
|
* }
|
|
76
60
|
* ```
|
|
77
61
|
*/
|
|
78
|
-
export declare function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, unknown>;
|
|
90
|
-
};
|
|
62
|
+
export declare function useSendPrepared(options?: UseMutationOptions<MessageResult, Error, {
|
|
63
|
+
to: string;
|
|
64
|
+
mailId: string;
|
|
65
|
+
priority?: boolean;
|
|
66
|
+
resolveSenderToName?: boolean;
|
|
67
|
+
}>): UseMutationResult<MessageResult, Error, {
|
|
68
|
+
to: string;
|
|
69
|
+
mailId: string;
|
|
70
|
+
priority?: boolean;
|
|
71
|
+
resolveSenderToName?: boolean;
|
|
72
|
+
}>;
|
|
91
73
|
/**
|
|
92
|
-
* Hook
|
|
74
|
+
* Hook to send message to email address
|
|
93
75
|
*
|
|
94
76
|
* @example
|
|
95
77
|
* ```tsx
|
|
96
|
-
* function
|
|
97
|
-
* const
|
|
78
|
+
* function SendToEmailForm() {
|
|
79
|
+
* const sendToEmail = useSendToEmail();
|
|
98
80
|
*
|
|
99
81
|
* return (
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
82
|
+
* <button
|
|
83
|
+
* onClick={() => sendToEmail.mutate({
|
|
84
|
+
* toEmail: 'user@example.com',
|
|
85
|
+
* subject: 'Hello',
|
|
86
|
+
* body: 'Welcome!'
|
|
87
|
+
* })}
|
|
88
|
+
* >
|
|
89
|
+
* Send to Email
|
|
90
|
+
* </button>
|
|
108
91
|
* );
|
|
109
92
|
* }
|
|
110
93
|
* ```
|
|
111
94
|
*/
|
|
112
|
-
export declare function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
delegate: string;
|
|
122
|
-
}, unknown>;
|
|
123
|
-
rejectDelegation: UseMutationResult<UnifiedTransaction, Error, {
|
|
124
|
-
delegatorAddress: string;
|
|
125
|
-
}, unknown>;
|
|
126
|
-
};
|
|
95
|
+
export declare function useSendToEmail(options?: UseMutationOptions<MessageResult, Error, {
|
|
96
|
+
toEmail: string;
|
|
97
|
+
subject: string;
|
|
98
|
+
body: string;
|
|
99
|
+
}>): UseMutationResult<MessageResult, Error, {
|
|
100
|
+
toEmail: string;
|
|
101
|
+
subject: string;
|
|
102
|
+
body: string;
|
|
103
|
+
}>;
|
|
127
104
|
/**
|
|
128
|
-
* Hook
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```tsx
|
|
132
|
-
* function PermissionManager() {
|
|
133
|
-
* const { setPermission, removePermission } = usePermissions(client, wallet, chainInfo);
|
|
134
|
-
*
|
|
135
|
-
* return (
|
|
136
|
-
* <>
|
|
137
|
-
* <button onClick={() => setPermission.mutate({ contractAddress: '0xABC...' })}>
|
|
138
|
-
* Grant Permission
|
|
139
|
-
* </button>
|
|
140
|
-
* <button onClick={() => removePermission.mutate({ contractAddress: '0xABC...' })}>
|
|
141
|
-
* Revoke Permission
|
|
142
|
-
* </button>
|
|
143
|
-
* </>
|
|
144
|
-
* );
|
|
145
|
-
* }
|
|
146
|
-
* ```
|
|
105
|
+
* Hook to send prepared message to email address
|
|
147
106
|
*/
|
|
148
|
-
export declare function
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}): {
|
|
156
|
-
setPermission: UseMutationResult<UnifiedTransaction, Error, {
|
|
157
|
-
contractAddress: string;
|
|
158
|
-
}, unknown>;
|
|
159
|
-
removePermission: UseMutationResult<UnifiedTransaction, Error, {
|
|
160
|
-
contractAddress: string;
|
|
161
|
-
}, unknown>;
|
|
162
|
-
};
|
|
107
|
+
export declare function useSendPreparedToEmail(options?: UseMutationOptions<MessageResult, Error, {
|
|
108
|
+
toEmail: string;
|
|
109
|
+
mailId: string;
|
|
110
|
+
}>): UseMutationResult<MessageResult, Error, {
|
|
111
|
+
toEmail: string;
|
|
112
|
+
mailId: string;
|
|
113
|
+
}>;
|
|
163
114
|
/**
|
|
164
|
-
* Hook
|
|
115
|
+
* Hook to claim revenue share
|
|
165
116
|
*
|
|
166
117
|
* @example
|
|
167
118
|
* ```tsx
|
|
168
|
-
* function
|
|
169
|
-
* const {
|
|
119
|
+
* function ClaimButton() {
|
|
120
|
+
* const { data: claimable } = useGetClaimableAmount();
|
|
121
|
+
* const claimRevenue = useClaimRevenue();
|
|
122
|
+
*
|
|
123
|
+
* if (!claimable || claimable === 0n) return null;
|
|
170
124
|
*
|
|
171
125
|
* return (
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
126
|
+
* <button
|
|
127
|
+
* onClick={() => claimRevenue.mutate()}
|
|
128
|
+
* disabled={claimRevenue.isPending}
|
|
129
|
+
* >
|
|
130
|
+
* Claim {Number(claimable) / 1_000_000} USDC
|
|
131
|
+
* </button>
|
|
177
132
|
* );
|
|
178
133
|
* }
|
|
179
134
|
* ```
|
|
180
135
|
*/
|
|
181
|
-
export declare function
|
|
182
|
-
pause?: UseMutationOptions<UnifiedTransaction, Error, void>;
|
|
183
|
-
unpause?: UseMutationOptions<UnifiedTransaction, Error, void>;
|
|
184
|
-
emergencyUnpause?: UseMutationOptions<UnifiedTransaction, Error, void>;
|
|
185
|
-
}): {
|
|
186
|
-
pause: UseMutationResult<UnifiedTransaction, Error, void, unknown>;
|
|
187
|
-
unpause: UseMutationResult<UnifiedTransaction, Error, void, unknown>;
|
|
188
|
-
emergencyUnpause: UseMutationResult<UnifiedTransaction, Error, void, unknown>;
|
|
189
|
-
};
|
|
136
|
+
export declare function useClaimRevenue(options?: UseMutationOptions<UnifiedTransaction, Error, void>): UseMutationResult<UnifiedTransaction, Error, void>;
|
|
190
137
|
/**
|
|
191
|
-
* Hook
|
|
138
|
+
* Hook to claim owner share (owner only)
|
|
192
139
|
*
|
|
193
140
|
* @example
|
|
194
141
|
* ```tsx
|
|
195
|
-
* function
|
|
196
|
-
* const {
|
|
142
|
+
* function OwnerClaimButton() {
|
|
143
|
+
* const { data: ownerClaimable } = useGetOwnerClaimable();
|
|
144
|
+
* const claimOwner = useClaimOwnerShare();
|
|
197
145
|
*
|
|
198
146
|
* return (
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* </button>
|
|
203
|
-
* <button onClick={() => distributeClaimableFunds.mutate({ recipient: '0xABC...' })}>
|
|
204
|
-
* Distribute Funds
|
|
205
|
-
* </button>
|
|
206
|
-
* </>
|
|
147
|
+
* <button onClick={() => claimOwner.mutate()}>
|
|
148
|
+
* Claim Owner Fees: {Number(ownerClaimable) / 1_000_000} USDC
|
|
149
|
+
* </button>
|
|
207
150
|
* );
|
|
208
151
|
* }
|
|
209
152
|
* ```
|
|
210
153
|
*/
|
|
211
|
-
export declare function useOwnerOperations(client: OnchainMailerClient, connectedWallet: Wallet, chainInfo: ChainInfo, options?: {
|
|
212
|
-
setFees?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
213
|
-
sendFee: bigint;
|
|
214
|
-
delegationFee: bigint;
|
|
215
|
-
}>;
|
|
216
|
-
distributeClaimableFunds?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
217
|
-
recipient: string;
|
|
218
|
-
}>;
|
|
219
|
-
}): {
|
|
220
|
-
setFees: UseMutationResult<UnifiedTransaction, Error, {
|
|
221
|
-
sendFee: bigint;
|
|
222
|
-
delegationFee: bigint;
|
|
223
|
-
}, unknown>;
|
|
224
|
-
distributeClaimableFunds: UseMutationResult<UnifiedTransaction, Error, {
|
|
225
|
-
recipient: string;
|
|
226
|
-
}, unknown>;
|
|
227
|
-
};
|
|
228
|
-
/**
|
|
229
|
-
* @deprecated Use useMessaging() instead
|
|
230
|
-
*/
|
|
231
|
-
export declare function useSendMessage(options?: UseMutationOptions<MessageResult, Error, {
|
|
232
|
-
subject: string;
|
|
233
|
-
body: string;
|
|
234
|
-
priority?: boolean;
|
|
235
|
-
resolveSenderToName?: boolean;
|
|
236
|
-
}>): UseMutationResult<MessageResult, Error, {
|
|
237
|
-
subject: string;
|
|
238
|
-
body: string;
|
|
239
|
-
priority?: boolean;
|
|
240
|
-
resolveSenderToName?: boolean;
|
|
241
|
-
}>;
|
|
242
|
-
/**
|
|
243
|
-
* @deprecated Use useMessaging() instead
|
|
244
|
-
*/
|
|
245
|
-
export declare function useSendPrepared(options?: UseMutationOptions<MessageResult, Error, {
|
|
246
|
-
to: string;
|
|
247
|
-
mailId: string;
|
|
248
|
-
priority?: boolean;
|
|
249
|
-
resolveSenderToName?: boolean;
|
|
250
|
-
}>): UseMutationResult<MessageResult, Error, {
|
|
251
|
-
to: string;
|
|
252
|
-
mailId: string;
|
|
253
|
-
priority?: boolean;
|
|
254
|
-
resolveSenderToName?: boolean;
|
|
255
|
-
}>;
|
|
256
|
-
/**
|
|
257
|
-
* @deprecated Use useClaims() instead
|
|
258
|
-
*/
|
|
259
|
-
export declare function useClaimRevenue(options?: UseMutationOptions<UnifiedTransaction, Error, void>): UseMutationResult<UnifiedTransaction, Error, void>;
|
|
260
|
-
/**
|
|
261
|
-
* @deprecated Use useClaims() instead
|
|
262
|
-
*/
|
|
263
154
|
export declare function useClaimOwnerShare(options?: UseMutationOptions<UnifiedTransaction, Error, void>): UseMutationResult<UnifiedTransaction, Error, void>;
|
|
264
155
|
/**
|
|
265
|
-
*
|
|
156
|
+
* Hook to claim expired shares (owner only, EVM only)
|
|
266
157
|
*/
|
|
267
158
|
export declare function useClaimExpiredShares(options?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
268
159
|
recipient: string;
|
|
@@ -270,7 +161,23 @@ export declare function useClaimExpiredShares(options?: UseMutationOptions<Unifi
|
|
|
270
161
|
recipient: string;
|
|
271
162
|
}>;
|
|
272
163
|
/**
|
|
273
|
-
*
|
|
164
|
+
* Hook to delegate to another address
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```tsx
|
|
168
|
+
* function DelegateButton() {
|
|
169
|
+
* const delegate = useDelegateTo();
|
|
170
|
+
*
|
|
171
|
+
* return (
|
|
172
|
+
* <button
|
|
173
|
+
* onClick={() => delegate.mutate({ delegate: '0xABC...' })}
|
|
174
|
+
* disabled={delegate.isPending}
|
|
175
|
+
* >
|
|
176
|
+
* Delegate
|
|
177
|
+
* </button>
|
|
178
|
+
* );
|
|
179
|
+
* }
|
|
180
|
+
* ```
|
|
274
181
|
*/
|
|
275
182
|
export declare function useDelegateTo(options?: UseMutationOptions<DelegationResult, Error, {
|
|
276
183
|
delegate: string;
|
|
@@ -278,7 +185,22 @@ export declare function useDelegateTo(options?: UseMutationOptions<DelegationRes
|
|
|
278
185
|
delegate: string;
|
|
279
186
|
}>;
|
|
280
187
|
/**
|
|
281
|
-
*
|
|
188
|
+
* Hook to reject a delegation made to you
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```tsx
|
|
192
|
+
* function RejectDelegationButton({ delegatorAddress }: { delegatorAddress: string }) {
|
|
193
|
+
* const rejectDelegation = useRejectDelegation();
|
|
194
|
+
*
|
|
195
|
+
* return (
|
|
196
|
+
* <button
|
|
197
|
+
* onClick={() => rejectDelegation.mutate({ delegatorAddress })}
|
|
198
|
+
* >
|
|
199
|
+
* Reject Delegation
|
|
200
|
+
* </button>
|
|
201
|
+
* );
|
|
202
|
+
* }
|
|
203
|
+
* ```
|
|
282
204
|
*/
|
|
283
205
|
export declare function useRejectDelegation(options?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
284
206
|
delegatorAddress: string;
|
|
@@ -286,45 +208,90 @@ export declare function useRejectDelegation(options?: UseMutationOptions<Unified
|
|
|
286
208
|
delegatorAddress: string;
|
|
287
209
|
}>;
|
|
288
210
|
/**
|
|
289
|
-
*
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
*
|
|
211
|
+
* Hook to set send fee (owner only)
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```tsx
|
|
215
|
+
* function SetFeeForm() {
|
|
216
|
+
* const setFee = useSetFee();
|
|
217
|
+
*
|
|
218
|
+
* return (
|
|
219
|
+
* <button onClick={() => setFee.mutate({ newFee: 200000n })}>
|
|
220
|
+
* Update Fee to 0.2 USDC
|
|
221
|
+
* </button>
|
|
222
|
+
* );
|
|
223
|
+
* }
|
|
224
|
+
* ```
|
|
298
225
|
*/
|
|
299
|
-
export declare function
|
|
300
|
-
|
|
226
|
+
export declare function useSetFee(options?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
227
|
+
newFee: bigint;
|
|
301
228
|
}>): UseMutationResult<UnifiedTransaction, Error, {
|
|
302
|
-
|
|
229
|
+
newFee: bigint;
|
|
303
230
|
}>;
|
|
304
231
|
/**
|
|
305
|
-
*
|
|
232
|
+
* Hook to set delegation fee (owner only)
|
|
306
233
|
*/
|
|
307
|
-
export declare function
|
|
308
|
-
|
|
309
|
-
delegationFee: bigint;
|
|
234
|
+
export declare function useSetDelegationFee(options?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
235
|
+
newFee: bigint;
|
|
310
236
|
}>): UseMutationResult<UnifiedTransaction, Error, {
|
|
311
|
-
|
|
312
|
-
delegationFee: bigint;
|
|
237
|
+
newFee: bigint;
|
|
313
238
|
}>;
|
|
314
239
|
/**
|
|
315
|
-
*
|
|
240
|
+
* Hook to pause the contract (owner only)
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```tsx
|
|
244
|
+
* function PauseButton() {
|
|
245
|
+
* const pause = usePause();
|
|
246
|
+
*
|
|
247
|
+
* return (
|
|
248
|
+
* <button
|
|
249
|
+
* onClick={() => pause.mutate()}
|
|
250
|
+
* disabled={pause.isPending}
|
|
251
|
+
* >
|
|
252
|
+
* Pause Contract
|
|
253
|
+
* </button>
|
|
254
|
+
* );
|
|
255
|
+
* }
|
|
256
|
+
* ```
|
|
316
257
|
*/
|
|
317
258
|
export declare function usePause(options?: UseMutationOptions<UnifiedTransaction, Error, void>): UseMutationResult<UnifiedTransaction, Error, void>;
|
|
318
259
|
/**
|
|
319
|
-
*
|
|
260
|
+
* Hook to unpause the contract (owner only)
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```tsx
|
|
264
|
+
* function UnpauseButton() {
|
|
265
|
+
* const unpause = useUnpause();
|
|
266
|
+
*
|
|
267
|
+
* return (
|
|
268
|
+
* <button onClick={() => unpause.mutate()}>
|
|
269
|
+
* Unpause Contract
|
|
270
|
+
* </button>
|
|
271
|
+
* );
|
|
272
|
+
* }
|
|
273
|
+
* ```
|
|
320
274
|
*/
|
|
321
275
|
export declare function useUnpause(options?: UseMutationOptions<UnifiedTransaction, Error, void>): UseMutationResult<UnifiedTransaction, Error, void>;
|
|
322
276
|
/**
|
|
323
|
-
*
|
|
277
|
+
* Hook to emergency unpause (owner only)
|
|
324
278
|
*/
|
|
325
279
|
export declare function useEmergencyUnpause(options?: UseMutationOptions<UnifiedTransaction, Error, void>): UseMutationResult<UnifiedTransaction, Error, void>;
|
|
326
280
|
/**
|
|
327
|
-
*
|
|
281
|
+
* Hook to distribute claimable funds (anyone can call when paused)
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```tsx
|
|
285
|
+
* function DistributeFundsButton({ recipient }: { recipient: string }) {
|
|
286
|
+
* const distribute = useDistributeClaimableFunds();
|
|
287
|
+
*
|
|
288
|
+
* return (
|
|
289
|
+
* <button onClick={() => distribute.mutate({ recipient })}>
|
|
290
|
+
* Distribute Funds to {recipient}
|
|
291
|
+
* </button>
|
|
292
|
+
* );
|
|
293
|
+
* }
|
|
294
|
+
* ```
|
|
328
295
|
*/
|
|
329
296
|
export declare function useDistributeClaimableFunds(options?: UseMutationOptions<UnifiedTransaction, Error, {
|
|
330
297
|
recipient: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMailerMutations.d.ts","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useMailerMutations.d.ts","sourceRoot":"","sources":["../../../../../src/react/hooks/useMailerMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAE,iBAAiB,EAAkB,MAAM,uBAAuB,CAAC;AAG3G,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,kBAAkB,CAC1B,aAAa,EACb,KAAK,EACL;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAE,CACrF,GACA,iBAAiB,CAClB,aAAa,EACb,KAAK,EACL;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAAE,CACrF,CAcA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,CAAC,EAAE,kBAAkB,CAC1B,aAAa,EACb,KAAK,EACL;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CA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