@fractalshq/sync 0.0.5 → 0.0.7
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/LICENSE +24 -0
- package/dist/api-C0dGK-PK.d.mts +203 -0
- package/dist/api-C0dGK-PK.d.ts +203 -0
- package/dist/core/index.d.mts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/react/index.d.mts +30 -2
- package/dist/react/index.d.ts +30 -2
- package/dist/react/index.js +61 -0
- package/dist/react/index.mjs +60 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Fractals
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
type DistributionStatus = "draft" | "committed" | "clawed_back" | "hidden";
|
|
2
|
+
interface Distribution {
|
|
3
|
+
id: string;
|
|
4
|
+
orgId: string;
|
|
5
|
+
mint: string;
|
|
6
|
+
status: DistributionStatus;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
totalUnlocked?: string;
|
|
10
|
+
totalLocked?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ClaimAllocation {
|
|
13
|
+
distributorId: string;
|
|
14
|
+
claimant: string;
|
|
15
|
+
amountUnlocked: string;
|
|
16
|
+
amountLocked?: string;
|
|
17
|
+
proof?: string[];
|
|
18
|
+
idx?: number;
|
|
19
|
+
}
|
|
20
|
+
interface ClaimTransactionInstruction {
|
|
21
|
+
programId: string;
|
|
22
|
+
keys: Array<{
|
|
23
|
+
pubkey: string;
|
|
24
|
+
isSigner: boolean;
|
|
25
|
+
isWritable: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
data: string;
|
|
28
|
+
}
|
|
29
|
+
interface ClaimTransactionRequest {
|
|
30
|
+
distributionId: string;
|
|
31
|
+
claimant: string;
|
|
32
|
+
index?: number;
|
|
33
|
+
proof?: string[];
|
|
34
|
+
unlockedAmount?: number;
|
|
35
|
+
lockedAmount?: number;
|
|
36
|
+
mint?: string;
|
|
37
|
+
distributorPda?: string;
|
|
38
|
+
rpcEndpoint?: string;
|
|
39
|
+
}
|
|
40
|
+
interface ClaimTransactionResponse {
|
|
41
|
+
label: string;
|
|
42
|
+
instructions: ClaimTransactionInstruction[];
|
|
43
|
+
transaction?: string;
|
|
44
|
+
}
|
|
45
|
+
interface ClaimCommitRequest {
|
|
46
|
+
distributionId: string;
|
|
47
|
+
signature: string;
|
|
48
|
+
}
|
|
49
|
+
interface ClaimableDistribution {
|
|
50
|
+
distributorId: string;
|
|
51
|
+
distributorName?: string;
|
|
52
|
+
tokenMint: string;
|
|
53
|
+
tokenSymbol?: string;
|
|
54
|
+
owedAmount: string;
|
|
55
|
+
status: "claimable" | "vesting" | "locked";
|
|
56
|
+
fees?: {
|
|
57
|
+
fixedFee?: string;
|
|
58
|
+
solFee?: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type Fetcher = typeof fetch;
|
|
63
|
+
declare const DEFAULT_BASE_PATH: string;
|
|
64
|
+
interface SyncRequestOptions {
|
|
65
|
+
basePath?: string;
|
|
66
|
+
fetcher?: Fetcher;
|
|
67
|
+
}
|
|
68
|
+
interface SyncRequestConfig {
|
|
69
|
+
basePath: string;
|
|
70
|
+
fetcher: Fetcher;
|
|
71
|
+
}
|
|
72
|
+
declare function resolveRequestConfig(options?: SyncRequestOptions): SyncRequestConfig;
|
|
73
|
+
declare class SyncReactError extends Error {
|
|
74
|
+
readonly status: number;
|
|
75
|
+
readonly code?: string | undefined;
|
|
76
|
+
readonly details?: unknown | undefined;
|
|
77
|
+
constructor(status: number, code?: string | undefined, details?: unknown | undefined);
|
|
78
|
+
}
|
|
79
|
+
declare function requestJSON<T>(config: SyncRequestConfig, path: string, init?: RequestInit): Promise<T>;
|
|
80
|
+
declare function resolveFetcher(custom?: Fetcher): Fetcher;
|
|
81
|
+
declare function sanitizeBasePath(path: string): string;
|
|
82
|
+
declare function buildUrl(basePath: string, path: string): string;
|
|
83
|
+
declare function isAbsoluteUrl(path: string): boolean;
|
|
84
|
+
declare function isRelativeUrl(path: string): boolean;
|
|
85
|
+
|
|
86
|
+
interface ListDistributionsRequest {
|
|
87
|
+
orgId?: string;
|
|
88
|
+
status?: DistributionStatus;
|
|
89
|
+
mint?: string;
|
|
90
|
+
limit?: number;
|
|
91
|
+
cursor?: string;
|
|
92
|
+
}
|
|
93
|
+
interface ListDistributionsResponse {
|
|
94
|
+
items: Distribution[];
|
|
95
|
+
nextCursor: string | null;
|
|
96
|
+
}
|
|
97
|
+
interface DistributionRecipientInput {
|
|
98
|
+
address: string;
|
|
99
|
+
shareBps: number;
|
|
100
|
+
}
|
|
101
|
+
interface DistributionInstruction {
|
|
102
|
+
programId: string;
|
|
103
|
+
keys: Array<{
|
|
104
|
+
pubkey: string;
|
|
105
|
+
isSigner: boolean;
|
|
106
|
+
isWritable: boolean;
|
|
107
|
+
}>;
|
|
108
|
+
data: string;
|
|
109
|
+
}
|
|
110
|
+
interface DistributionPersistenceWarning {
|
|
111
|
+
id?: string;
|
|
112
|
+
reason: string;
|
|
113
|
+
message: string;
|
|
114
|
+
distributionId?: string;
|
|
115
|
+
detail?: unknown;
|
|
116
|
+
exportJson?: unknown;
|
|
117
|
+
}
|
|
118
|
+
interface DistributionTransactionPayload {
|
|
119
|
+
distributionId: string;
|
|
120
|
+
label?: string;
|
|
121
|
+
instructions: DistributionInstruction[];
|
|
122
|
+
transaction?: string;
|
|
123
|
+
preview?: unknown;
|
|
124
|
+
exportJson?: unknown;
|
|
125
|
+
persistenceWarning?: DistributionPersistenceWarning;
|
|
126
|
+
title?: string | null;
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
interface BuildDistributionTransactionRequest {
|
|
130
|
+
owner: string;
|
|
131
|
+
amountUi: number;
|
|
132
|
+
recipients: DistributionRecipientInput[];
|
|
133
|
+
mint: string;
|
|
134
|
+
distributionId?: string;
|
|
135
|
+
rpcEndpoint?: string;
|
|
136
|
+
title?: string;
|
|
137
|
+
[key: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
type CreateDistributionRequest = BuildDistributionTransactionRequest;
|
|
140
|
+
type BuildDistributionTransactionResponse = DistributionTransactionPayload;
|
|
141
|
+
type CreateDistributionResponse = DistributionTransactionPayload;
|
|
142
|
+
interface CommitDistributionRequest {
|
|
143
|
+
transaction?: string;
|
|
144
|
+
signedTransactionBase64?: string;
|
|
145
|
+
signature?: string;
|
|
146
|
+
exportJson?: unknown;
|
|
147
|
+
[key: string]: unknown;
|
|
148
|
+
}
|
|
149
|
+
interface CommitDistributionResponse {
|
|
150
|
+
success: boolean;
|
|
151
|
+
distributorId: string;
|
|
152
|
+
signature?: string;
|
|
153
|
+
status?: DistributionStatus | string;
|
|
154
|
+
alreadyCommitted?: boolean;
|
|
155
|
+
[key: string]: unknown;
|
|
156
|
+
}
|
|
157
|
+
interface CommitDistributionSignatureInput extends CommitDistributionRequest {
|
|
158
|
+
distributionId: string;
|
|
159
|
+
}
|
|
160
|
+
type BuildClaimTransactionRequest = ClaimTransactionRequest;
|
|
161
|
+
type BuildClaimTransactionResponse = ClaimTransactionResponse;
|
|
162
|
+
interface CommitClaimRequest {
|
|
163
|
+
distributionId: string;
|
|
164
|
+
signature?: string;
|
|
165
|
+
transaction?: string;
|
|
166
|
+
signedTransactionBase64?: string;
|
|
167
|
+
claimantPubkey?: string;
|
|
168
|
+
[key: string]: unknown;
|
|
169
|
+
}
|
|
170
|
+
interface CommitClaimResponse {
|
|
171
|
+
ok: boolean;
|
|
172
|
+
}
|
|
173
|
+
interface ClaimableResponse {
|
|
174
|
+
wallet: string;
|
|
175
|
+
claimable: ClaimableDistribution[];
|
|
176
|
+
}
|
|
177
|
+
interface ClaimHistoryItem {
|
|
178
|
+
distributorId: string;
|
|
179
|
+
signature: string;
|
|
180
|
+
claimedAmount: string;
|
|
181
|
+
claimedAt: string;
|
|
182
|
+
}
|
|
183
|
+
interface ClaimHistoryResponse {
|
|
184
|
+
items: ClaimHistoryItem[];
|
|
185
|
+
nextCursor: string | null;
|
|
186
|
+
}
|
|
187
|
+
interface HealthResponse {
|
|
188
|
+
status: string;
|
|
189
|
+
timestamp: string;
|
|
190
|
+
}
|
|
191
|
+
interface PrepareDistributionDraftRequest {
|
|
192
|
+
projectId: string;
|
|
193
|
+
mint: string;
|
|
194
|
+
title?: string;
|
|
195
|
+
}
|
|
196
|
+
interface PrepareDistributionDraftResponse {
|
|
197
|
+
id: string;
|
|
198
|
+
}
|
|
199
|
+
declare function buildDistributionTransaction(input: BuildDistributionTransactionRequest, options?: SyncRequestOptions): Promise<DistributionTransactionPayload>;
|
|
200
|
+
declare function commitDistributionSignature(input: CommitDistributionSignatureInput, options?: SyncRequestOptions): Promise<CommitDistributionResponse>;
|
|
201
|
+
declare function prepareDistributionDraft(input: PrepareDistributionDraftRequest, options?: SyncRequestOptions): Promise<PrepareDistributionDraftResponse>;
|
|
202
|
+
|
|
203
|
+
export { commitDistributionSignature as A, type BuildDistributionTransactionRequest as B, type ClaimAllocation as C, type DistributionStatus as D, prepareDistributionDraft as E, type Fetcher as F, DEFAULT_BASE_PATH as G, type HealthResponse as H, type SyncRequestConfig as I, resolveRequestConfig as J, SyncReactError as K, type ListDistributionsRequest as L, requestJSON as M, resolveFetcher as N, sanitizeBasePath as O, type PrepareDistributionDraftRequest as P, buildUrl as Q, isAbsoluteUrl as R, type SyncRequestOptions as S, isRelativeUrl as T, type Distribution as a, type ClaimTransactionInstruction as b, type ClaimTransactionRequest as c, type ClaimTransactionResponse as d, type ClaimCommitRequest as e, type ClaimableDistribution as f, type ListDistributionsResponse as g, type DistributionRecipientInput as h, type DistributionInstruction as i, type DistributionPersistenceWarning as j, type DistributionTransactionPayload as k, type CreateDistributionRequest as l, type BuildDistributionTransactionResponse as m, type CreateDistributionResponse as n, type CommitDistributionRequest as o, type CommitDistributionResponse as p, type CommitDistributionSignatureInput as q, type BuildClaimTransactionRequest as r, type BuildClaimTransactionResponse as s, type CommitClaimRequest as t, type CommitClaimResponse as u, type ClaimableResponse as v, type ClaimHistoryItem as w, type ClaimHistoryResponse as x, type PrepareDistributionDraftResponse as y, buildDistributionTransaction as z };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
type DistributionStatus = "draft" | "committed" | "clawed_back" | "hidden";
|
|
2
|
+
interface Distribution {
|
|
3
|
+
id: string;
|
|
4
|
+
orgId: string;
|
|
5
|
+
mint: string;
|
|
6
|
+
status: DistributionStatus;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
totalUnlocked?: string;
|
|
10
|
+
totalLocked?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ClaimAllocation {
|
|
13
|
+
distributorId: string;
|
|
14
|
+
claimant: string;
|
|
15
|
+
amountUnlocked: string;
|
|
16
|
+
amountLocked?: string;
|
|
17
|
+
proof?: string[];
|
|
18
|
+
idx?: number;
|
|
19
|
+
}
|
|
20
|
+
interface ClaimTransactionInstruction {
|
|
21
|
+
programId: string;
|
|
22
|
+
keys: Array<{
|
|
23
|
+
pubkey: string;
|
|
24
|
+
isSigner: boolean;
|
|
25
|
+
isWritable: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
data: string;
|
|
28
|
+
}
|
|
29
|
+
interface ClaimTransactionRequest {
|
|
30
|
+
distributionId: string;
|
|
31
|
+
claimant: string;
|
|
32
|
+
index?: number;
|
|
33
|
+
proof?: string[];
|
|
34
|
+
unlockedAmount?: number;
|
|
35
|
+
lockedAmount?: number;
|
|
36
|
+
mint?: string;
|
|
37
|
+
distributorPda?: string;
|
|
38
|
+
rpcEndpoint?: string;
|
|
39
|
+
}
|
|
40
|
+
interface ClaimTransactionResponse {
|
|
41
|
+
label: string;
|
|
42
|
+
instructions: ClaimTransactionInstruction[];
|
|
43
|
+
transaction?: string;
|
|
44
|
+
}
|
|
45
|
+
interface ClaimCommitRequest {
|
|
46
|
+
distributionId: string;
|
|
47
|
+
signature: string;
|
|
48
|
+
}
|
|
49
|
+
interface ClaimableDistribution {
|
|
50
|
+
distributorId: string;
|
|
51
|
+
distributorName?: string;
|
|
52
|
+
tokenMint: string;
|
|
53
|
+
tokenSymbol?: string;
|
|
54
|
+
owedAmount: string;
|
|
55
|
+
status: "claimable" | "vesting" | "locked";
|
|
56
|
+
fees?: {
|
|
57
|
+
fixedFee?: string;
|
|
58
|
+
solFee?: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type Fetcher = typeof fetch;
|
|
63
|
+
declare const DEFAULT_BASE_PATH: string;
|
|
64
|
+
interface SyncRequestOptions {
|
|
65
|
+
basePath?: string;
|
|
66
|
+
fetcher?: Fetcher;
|
|
67
|
+
}
|
|
68
|
+
interface SyncRequestConfig {
|
|
69
|
+
basePath: string;
|
|
70
|
+
fetcher: Fetcher;
|
|
71
|
+
}
|
|
72
|
+
declare function resolveRequestConfig(options?: SyncRequestOptions): SyncRequestConfig;
|
|
73
|
+
declare class SyncReactError extends Error {
|
|
74
|
+
readonly status: number;
|
|
75
|
+
readonly code?: string | undefined;
|
|
76
|
+
readonly details?: unknown | undefined;
|
|
77
|
+
constructor(status: number, code?: string | undefined, details?: unknown | undefined);
|
|
78
|
+
}
|
|
79
|
+
declare function requestJSON<T>(config: SyncRequestConfig, path: string, init?: RequestInit): Promise<T>;
|
|
80
|
+
declare function resolveFetcher(custom?: Fetcher): Fetcher;
|
|
81
|
+
declare function sanitizeBasePath(path: string): string;
|
|
82
|
+
declare function buildUrl(basePath: string, path: string): string;
|
|
83
|
+
declare function isAbsoluteUrl(path: string): boolean;
|
|
84
|
+
declare function isRelativeUrl(path: string): boolean;
|
|
85
|
+
|
|
86
|
+
interface ListDistributionsRequest {
|
|
87
|
+
orgId?: string;
|
|
88
|
+
status?: DistributionStatus;
|
|
89
|
+
mint?: string;
|
|
90
|
+
limit?: number;
|
|
91
|
+
cursor?: string;
|
|
92
|
+
}
|
|
93
|
+
interface ListDistributionsResponse {
|
|
94
|
+
items: Distribution[];
|
|
95
|
+
nextCursor: string | null;
|
|
96
|
+
}
|
|
97
|
+
interface DistributionRecipientInput {
|
|
98
|
+
address: string;
|
|
99
|
+
shareBps: number;
|
|
100
|
+
}
|
|
101
|
+
interface DistributionInstruction {
|
|
102
|
+
programId: string;
|
|
103
|
+
keys: Array<{
|
|
104
|
+
pubkey: string;
|
|
105
|
+
isSigner: boolean;
|
|
106
|
+
isWritable: boolean;
|
|
107
|
+
}>;
|
|
108
|
+
data: string;
|
|
109
|
+
}
|
|
110
|
+
interface DistributionPersistenceWarning {
|
|
111
|
+
id?: string;
|
|
112
|
+
reason: string;
|
|
113
|
+
message: string;
|
|
114
|
+
distributionId?: string;
|
|
115
|
+
detail?: unknown;
|
|
116
|
+
exportJson?: unknown;
|
|
117
|
+
}
|
|
118
|
+
interface DistributionTransactionPayload {
|
|
119
|
+
distributionId: string;
|
|
120
|
+
label?: string;
|
|
121
|
+
instructions: DistributionInstruction[];
|
|
122
|
+
transaction?: string;
|
|
123
|
+
preview?: unknown;
|
|
124
|
+
exportJson?: unknown;
|
|
125
|
+
persistenceWarning?: DistributionPersistenceWarning;
|
|
126
|
+
title?: string | null;
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
}
|
|
129
|
+
interface BuildDistributionTransactionRequest {
|
|
130
|
+
owner: string;
|
|
131
|
+
amountUi: number;
|
|
132
|
+
recipients: DistributionRecipientInput[];
|
|
133
|
+
mint: string;
|
|
134
|
+
distributionId?: string;
|
|
135
|
+
rpcEndpoint?: string;
|
|
136
|
+
title?: string;
|
|
137
|
+
[key: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
type CreateDistributionRequest = BuildDistributionTransactionRequest;
|
|
140
|
+
type BuildDistributionTransactionResponse = DistributionTransactionPayload;
|
|
141
|
+
type CreateDistributionResponse = DistributionTransactionPayload;
|
|
142
|
+
interface CommitDistributionRequest {
|
|
143
|
+
transaction?: string;
|
|
144
|
+
signedTransactionBase64?: string;
|
|
145
|
+
signature?: string;
|
|
146
|
+
exportJson?: unknown;
|
|
147
|
+
[key: string]: unknown;
|
|
148
|
+
}
|
|
149
|
+
interface CommitDistributionResponse {
|
|
150
|
+
success: boolean;
|
|
151
|
+
distributorId: string;
|
|
152
|
+
signature?: string;
|
|
153
|
+
status?: DistributionStatus | string;
|
|
154
|
+
alreadyCommitted?: boolean;
|
|
155
|
+
[key: string]: unknown;
|
|
156
|
+
}
|
|
157
|
+
interface CommitDistributionSignatureInput extends CommitDistributionRequest {
|
|
158
|
+
distributionId: string;
|
|
159
|
+
}
|
|
160
|
+
type BuildClaimTransactionRequest = ClaimTransactionRequest;
|
|
161
|
+
type BuildClaimTransactionResponse = ClaimTransactionResponse;
|
|
162
|
+
interface CommitClaimRequest {
|
|
163
|
+
distributionId: string;
|
|
164
|
+
signature?: string;
|
|
165
|
+
transaction?: string;
|
|
166
|
+
signedTransactionBase64?: string;
|
|
167
|
+
claimantPubkey?: string;
|
|
168
|
+
[key: string]: unknown;
|
|
169
|
+
}
|
|
170
|
+
interface CommitClaimResponse {
|
|
171
|
+
ok: boolean;
|
|
172
|
+
}
|
|
173
|
+
interface ClaimableResponse {
|
|
174
|
+
wallet: string;
|
|
175
|
+
claimable: ClaimableDistribution[];
|
|
176
|
+
}
|
|
177
|
+
interface ClaimHistoryItem {
|
|
178
|
+
distributorId: string;
|
|
179
|
+
signature: string;
|
|
180
|
+
claimedAmount: string;
|
|
181
|
+
claimedAt: string;
|
|
182
|
+
}
|
|
183
|
+
interface ClaimHistoryResponse {
|
|
184
|
+
items: ClaimHistoryItem[];
|
|
185
|
+
nextCursor: string | null;
|
|
186
|
+
}
|
|
187
|
+
interface HealthResponse {
|
|
188
|
+
status: string;
|
|
189
|
+
timestamp: string;
|
|
190
|
+
}
|
|
191
|
+
interface PrepareDistributionDraftRequest {
|
|
192
|
+
projectId: string;
|
|
193
|
+
mint: string;
|
|
194
|
+
title?: string;
|
|
195
|
+
}
|
|
196
|
+
interface PrepareDistributionDraftResponse {
|
|
197
|
+
id: string;
|
|
198
|
+
}
|
|
199
|
+
declare function buildDistributionTransaction(input: BuildDistributionTransactionRequest, options?: SyncRequestOptions): Promise<DistributionTransactionPayload>;
|
|
200
|
+
declare function commitDistributionSignature(input: CommitDistributionSignatureInput, options?: SyncRequestOptions): Promise<CommitDistributionResponse>;
|
|
201
|
+
declare function prepareDistributionDraft(input: PrepareDistributionDraftRequest, options?: SyncRequestOptions): Promise<PrepareDistributionDraftResponse>;
|
|
202
|
+
|
|
203
|
+
export { commitDistributionSignature as A, type BuildDistributionTransactionRequest as B, type ClaimAllocation as C, type DistributionStatus as D, prepareDistributionDraft as E, type Fetcher as F, DEFAULT_BASE_PATH as G, type HealthResponse as H, type SyncRequestConfig as I, resolveRequestConfig as J, SyncReactError as K, type ListDistributionsRequest as L, requestJSON as M, resolveFetcher as N, sanitizeBasePath as O, type PrepareDistributionDraftRequest as P, buildUrl as Q, isAbsoluteUrl as R, type SyncRequestOptions as S, isRelativeUrl as T, type Distribution as a, type ClaimTransactionInstruction as b, type ClaimTransactionRequest as c, type ClaimTransactionResponse as d, type ClaimCommitRequest as e, type ClaimableDistribution as f, type ListDistributionsResponse as g, type DistributionRecipientInput as h, type DistributionInstruction as i, type DistributionPersistenceWarning as j, type DistributionTransactionPayload as k, type CreateDistributionRequest as l, type BuildDistributionTransactionResponse as m, type CreateDistributionResponse as n, type CommitDistributionRequest as o, type CommitDistributionResponse as p, type CommitDistributionSignatureInput as q, type BuildClaimTransactionRequest as r, type BuildClaimTransactionResponse as s, type CommitClaimRequest as t, type CommitClaimResponse as u, type ClaimableResponse as v, type ClaimHistoryItem as w, type ClaimHistoryResponse as x, type PrepareDistributionDraftResponse as y, buildDistributionTransaction as z };
|
package/dist/core/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from '../api-
|
|
1
|
+
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from '../api-C0dGK-PK.mjs';
|
|
2
2
|
|
|
3
3
|
declare const MEMO_PROGRAM_ID = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
|
|
4
4
|
declare const XNET_2022_MINT = "xNETbUB7cRb3AAu2pNG2pUwQcJ2BHcktfvSB8x1Pq6L";
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from '../api-
|
|
1
|
+
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from '../api-C0dGK-PK.js';
|
|
2
2
|
|
|
3
3
|
declare const MEMO_PROGRAM_ID = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
|
|
4
4
|
declare const XNET_2022_MINT = "xNETbUB7cRb3AAu2pNG2pUwQcJ2BHcktfvSB8x1Pq6L";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ApiAuthRequest, GET, POST, SyncHandlerOptions, SyncServerClient, SyncServerOptions, createMethodHandler, syncRouteHandler } from './server/index.mjs';
|
|
2
2
|
export { DEFAULT_RPC_ENDPOINT, DISTRIBUTION_MEMO_PREFIX, MEMO_PROGRAM_ID, PERSISTENCE_WARNING_EVENT, PersistenceWarningRecord, XNET_2022_MINT, assertTruthy, buildDistributionMemoTag, clearPersistenceWarning, handlePersistenceWarningResponse, loadPersistenceWarnings, recordPersistenceWarning } from './core/index.mjs';
|
|
3
|
-
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from './api-
|
|
3
|
+
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from './api-C0dGK-PK.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ApiAuthRequest, GET, POST, SyncHandlerOptions, SyncServerClient, SyncServerOptions, createMethodHandler, syncRouteHandler } from './server/index.js';
|
|
2
2
|
export { DEFAULT_RPC_ENDPOINT, DISTRIBUTION_MEMO_PREFIX, MEMO_PROGRAM_ID, PERSISTENCE_WARNING_EVENT, PersistenceWarningRecord, XNET_2022_MINT, assertTruthy, buildDistributionMemoTag, clearPersistenceWarning, handlePersistenceWarningResponse, loadPersistenceWarnings, recordPersistenceWarning } from './core/index.js';
|
|
3
|
-
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from './api-
|
|
3
|
+
export { r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, B as BuildDistributionTransactionRequest, m as BuildDistributionTransactionResponse, C as ClaimAllocation, e as ClaimCommitRequest, w as ClaimHistoryItem, x as ClaimHistoryResponse, b as ClaimTransactionInstruction, c as ClaimTransactionRequest, d as ClaimTransactionResponse, f as ClaimableDistribution, v as ClaimableResponse, t as CommitClaimRequest, u as CommitClaimResponse, o as CommitDistributionRequest, p as CommitDistributionResponse, q as CommitDistributionSignatureInput, l as CreateDistributionRequest, n as CreateDistributionResponse, G as DEFAULT_BASE_PATH, a as Distribution, i as DistributionInstruction, j as DistributionPersistenceWarning, h as DistributionRecipientInput, D as DistributionStatus, k as DistributionTransactionPayload, F as Fetcher, H as HealthResponse, L as ListDistributionsRequest, g as ListDistributionsResponse, P as PrepareDistributionDraftRequest, y as PrepareDistributionDraftResponse, K as SyncReactError, I as SyncRequestConfig, S as SyncRequestOptions, z as buildDistributionTransaction, Q as buildUrl, A as commitDistributionSignature, R as isAbsoluteUrl, T as isRelativeUrl, E as prepareDistributionDraft, M as requestJSON, N as resolveFetcher, J as resolveRequestConfig, O as sanitizeBasePath } from './api-C0dGK-PK.js';
|
package/dist/react/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { UseQueryOptions, UseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
4
|
-
import { F as Fetcher, g as ListDistributionsResponse, K as SyncReactError, a as Distribution, B as BuildDistributionTransactionRequest, k as DistributionTransactionPayload, q as CommitDistributionSignatureInput, p as CommitDistributionResponse, v as ClaimableResponse, x as ClaimHistoryResponse, r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse } from '../api-
|
|
4
|
+
import { F as Fetcher, g as ListDistributionsResponse, K as SyncReactError, a as Distribution, B as BuildDistributionTransactionRequest, k as DistributionTransactionPayload, q as CommitDistributionSignatureInput, p as CommitDistributionResponse, v as ClaimableResponse, x as ClaimHistoryResponse, r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse } from '../api-C0dGK-PK.mjs';
|
|
5
5
|
|
|
6
6
|
interface SyncContextValue {
|
|
7
7
|
basePath: string;
|
|
@@ -79,5 +79,33 @@ interface ClaimFlowResult {
|
|
|
79
79
|
reset: () => void;
|
|
80
80
|
}
|
|
81
81
|
declare function useClaimFlow(distributionId: string | null | undefined): ClaimFlowResult;
|
|
82
|
+
interface RecipientComposerRow {
|
|
83
|
+
id: string;
|
|
84
|
+
address: string;
|
|
85
|
+
amount: string;
|
|
86
|
+
}
|
|
87
|
+
type RecipientRow = RecipientComposerRow;
|
|
88
|
+
interface RecipientComposerState {
|
|
89
|
+
rows: RecipientComposerRow[];
|
|
90
|
+
totals: {
|
|
91
|
+
count: number;
|
|
92
|
+
totalAmount: number;
|
|
93
|
+
normalized: Array<{
|
|
94
|
+
id: string;
|
|
95
|
+
address: string;
|
|
96
|
+
amount: number;
|
|
97
|
+
shareBps: number;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
interface RecipientComposerApi {
|
|
102
|
+
state: RecipientComposerState;
|
|
103
|
+
addRow: () => void;
|
|
104
|
+
removeRow: (id: string) => void;
|
|
105
|
+
updateRow: (id: string, patch: Partial<Omit<RecipientComposerRow, "id">>) => void;
|
|
106
|
+
replaceRows: (rows: Array<Pick<RecipientComposerRow, "address" | "amount">>) => void;
|
|
107
|
+
clearRows: () => void;
|
|
108
|
+
}
|
|
109
|
+
declare function useRecipientComposer(initial?: Array<Pick<RecipientComposerRow, "address" | "amount">>): RecipientComposerApi;
|
|
82
110
|
|
|
83
|
-
export { type ClaimCommitInput, type ClaimFlowClaimResult, type ClaimFlowResult, type ClaimFlowSigner, type ClaimFlowState, type ClaimTransactionInput, type DistributionCommitInput, type DistributionFlowCommitResult, type DistributionFlowResult, type DistributionFlowSigner, type DistributionFlowSignerInput, type DistributionFlowState, type DistributionTransactionInput, type DistributionsQueryParams, type SyncClient, SyncProvider, type SyncProviderProps, useClaimFlow, useClaimHistory, useClaimTransaction, useClaimableDistributions, useCommitClaim, useCommitDistribution, useDistribution, useDistributionFlow, useDistributionTransaction, useDistributions, useSyncClient };
|
|
111
|
+
export { type ClaimCommitInput, type ClaimFlowClaimResult, type ClaimFlowResult, type ClaimFlowSigner, type ClaimFlowState, type ClaimTransactionInput, type DistributionCommitInput, type DistributionFlowCommitResult, type DistributionFlowResult, type DistributionFlowSigner, type DistributionFlowSignerInput, type DistributionFlowState, type DistributionTransactionInput, type DistributionsQueryParams, type RecipientComposerApi, type RecipientComposerRow, type RecipientComposerState, type RecipientRow, type SyncClient, SyncProvider, type SyncProviderProps, useClaimFlow, useClaimHistory, useClaimTransaction, useClaimableDistributions, useCommitClaim, useCommitDistribution, useDistribution, useDistributionFlow, useDistributionTransaction, useDistributions, useRecipientComposer, useSyncClient };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { UseQueryOptions, UseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
4
|
-
import { F as Fetcher, g as ListDistributionsResponse, K as SyncReactError, a as Distribution, B as BuildDistributionTransactionRequest, k as DistributionTransactionPayload, q as CommitDistributionSignatureInput, p as CommitDistributionResponse, v as ClaimableResponse, x as ClaimHistoryResponse, r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse } from '../api-
|
|
4
|
+
import { F as Fetcher, g as ListDistributionsResponse, K as SyncReactError, a as Distribution, B as BuildDistributionTransactionRequest, k as DistributionTransactionPayload, q as CommitDistributionSignatureInput, p as CommitDistributionResponse, v as ClaimableResponse, x as ClaimHistoryResponse, r as BuildClaimTransactionRequest, s as BuildClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse } from '../api-C0dGK-PK.js';
|
|
5
5
|
|
|
6
6
|
interface SyncContextValue {
|
|
7
7
|
basePath: string;
|
|
@@ -79,5 +79,33 @@ interface ClaimFlowResult {
|
|
|
79
79
|
reset: () => void;
|
|
80
80
|
}
|
|
81
81
|
declare function useClaimFlow(distributionId: string | null | undefined): ClaimFlowResult;
|
|
82
|
+
interface RecipientComposerRow {
|
|
83
|
+
id: string;
|
|
84
|
+
address: string;
|
|
85
|
+
amount: string;
|
|
86
|
+
}
|
|
87
|
+
type RecipientRow = RecipientComposerRow;
|
|
88
|
+
interface RecipientComposerState {
|
|
89
|
+
rows: RecipientComposerRow[];
|
|
90
|
+
totals: {
|
|
91
|
+
count: number;
|
|
92
|
+
totalAmount: number;
|
|
93
|
+
normalized: Array<{
|
|
94
|
+
id: string;
|
|
95
|
+
address: string;
|
|
96
|
+
amount: number;
|
|
97
|
+
shareBps: number;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
interface RecipientComposerApi {
|
|
102
|
+
state: RecipientComposerState;
|
|
103
|
+
addRow: () => void;
|
|
104
|
+
removeRow: (id: string) => void;
|
|
105
|
+
updateRow: (id: string, patch: Partial<Omit<RecipientComposerRow, "id">>) => void;
|
|
106
|
+
replaceRows: (rows: Array<Pick<RecipientComposerRow, "address" | "amount">>) => void;
|
|
107
|
+
clearRows: () => void;
|
|
108
|
+
}
|
|
109
|
+
declare function useRecipientComposer(initial?: Array<Pick<RecipientComposerRow, "address" | "amount">>): RecipientComposerApi;
|
|
82
110
|
|
|
83
|
-
export { type ClaimCommitInput, type ClaimFlowClaimResult, type ClaimFlowResult, type ClaimFlowSigner, type ClaimFlowState, type ClaimTransactionInput, type DistributionCommitInput, type DistributionFlowCommitResult, type DistributionFlowResult, type DistributionFlowSigner, type DistributionFlowSignerInput, type DistributionFlowState, type DistributionTransactionInput, type DistributionsQueryParams, type SyncClient, SyncProvider, type SyncProviderProps, useClaimFlow, useClaimHistory, useClaimTransaction, useClaimableDistributions, useCommitClaim, useCommitDistribution, useDistribution, useDistributionFlow, useDistributionTransaction, useDistributions, useSyncClient };
|
|
111
|
+
export { type ClaimCommitInput, type ClaimFlowClaimResult, type ClaimFlowResult, type ClaimFlowSigner, type ClaimFlowState, type ClaimTransactionInput, type DistributionCommitInput, type DistributionFlowCommitResult, type DistributionFlowResult, type DistributionFlowSigner, type DistributionFlowSignerInput, type DistributionFlowState, type DistributionTransactionInput, type DistributionsQueryParams, type RecipientComposerApi, type RecipientComposerRow, type RecipientComposerState, type RecipientRow, type SyncClient, SyncProvider, type SyncProviderProps, useClaimFlow, useClaimHistory, useClaimTransaction, useClaimableDistributions, useCommitClaim, useCommitDistribution, useDistribution, useDistributionFlow, useDistributionTransaction, useDistributions, useRecipientComposer, useSyncClient };
|
package/dist/react/index.js
CHANGED
|
@@ -60,6 +60,7 @@ __export(react_exports, {
|
|
|
60
60
|
useDistributionFlow: () => useDistributionFlow,
|
|
61
61
|
useDistributionTransaction: () => useDistributionTransaction,
|
|
62
62
|
useDistributions: () => useDistributions,
|
|
63
|
+
useRecipientComposer: () => useRecipientComposer,
|
|
63
64
|
useSyncClient: () => useSyncClient
|
|
64
65
|
});
|
|
65
66
|
module.exports = __toCommonJS(react_exports);
|
|
@@ -472,6 +473,65 @@ function buildDistributionsPath(params) {
|
|
|
472
473
|
const qs = search.toString();
|
|
473
474
|
return qs ? `/distributions/me?${qs}` : "/distributions/me";
|
|
474
475
|
}
|
|
476
|
+
function createRecipientRowId() {
|
|
477
|
+
return `recipient-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
478
|
+
}
|
|
479
|
+
function hydrateRecipientRow(partial) {
|
|
480
|
+
var _a2, _b2;
|
|
481
|
+
return {
|
|
482
|
+
id: createRecipientRowId(),
|
|
483
|
+
address: (_a2 = partial == null ? void 0 : partial.address) != null ? _a2 : "",
|
|
484
|
+
amount: (_b2 = partial == null ? void 0 : partial.amount) != null ? _b2 : ""
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
function useRecipientComposer(initial = []) {
|
|
488
|
+
const [rows, setRows] = (0, import_react.useState)(() => {
|
|
489
|
+
if (initial.length === 0) return [hydrateRecipientRow()];
|
|
490
|
+
return initial.map((row) => hydrateRecipientRow(row));
|
|
491
|
+
});
|
|
492
|
+
const addRow = (0, import_react.useCallback)(() => {
|
|
493
|
+
setRows((current) => [...current, hydrateRecipientRow()]);
|
|
494
|
+
}, []);
|
|
495
|
+
const removeRow = (0, import_react.useCallback)((id) => {
|
|
496
|
+
setRows((current) => {
|
|
497
|
+
if (current.length <= 1) return [hydrateRecipientRow()];
|
|
498
|
+
return current.filter((row) => row.id !== id);
|
|
499
|
+
});
|
|
500
|
+
}, []);
|
|
501
|
+
const updateRow = (0, import_react.useCallback)((id, patch) => {
|
|
502
|
+
setRows((current) => current.map((row) => row.id === id ? __spreadValues(__spreadValues({}, row), patch) : row));
|
|
503
|
+
}, []);
|
|
504
|
+
const replaceRows = (0, import_react.useCallback)((incoming) => {
|
|
505
|
+
if (!incoming.length) {
|
|
506
|
+
setRows([hydrateRecipientRow()]);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
setRows(incoming.map((row) => hydrateRecipientRow(row)));
|
|
510
|
+
}, []);
|
|
511
|
+
const clearRows = (0, import_react.useCallback)(() => {
|
|
512
|
+
setRows([hydrateRecipientRow()]);
|
|
513
|
+
}, []);
|
|
514
|
+
const totals = (0, import_react.useMemo)(() => {
|
|
515
|
+
const normalized = rows.map((row) => ({ id: row.id, address: row.address.trim(), amount: Number(row.amount) || 0 }));
|
|
516
|
+
const totalAmount = normalized.reduce((sum, row) => sum + Math.max(0, row.amount), 0);
|
|
517
|
+
const withShare = normalized.map((row) => __spreadProps(__spreadValues({}, row), {
|
|
518
|
+
shareBps: totalAmount > 0 ? Math.round(Math.max(0, row.amount) / totalAmount * 1e4) : 0
|
|
519
|
+
}));
|
|
520
|
+
return {
|
|
521
|
+
count: rows.length,
|
|
522
|
+
totalAmount,
|
|
523
|
+
normalized: withShare
|
|
524
|
+
};
|
|
525
|
+
}, [rows]);
|
|
526
|
+
return {
|
|
527
|
+
state: { rows, totals },
|
|
528
|
+
addRow,
|
|
529
|
+
removeRow,
|
|
530
|
+
updateRow,
|
|
531
|
+
replaceRows,
|
|
532
|
+
clearRows
|
|
533
|
+
};
|
|
534
|
+
}
|
|
475
535
|
// Annotate the CommonJS export names for ESM import in node:
|
|
476
536
|
0 && (module.exports = {
|
|
477
537
|
SyncProvider,
|
|
@@ -485,5 +545,6 @@ function buildDistributionsPath(params) {
|
|
|
485
545
|
useDistributionFlow,
|
|
486
546
|
useDistributionTransaction,
|
|
487
547
|
useDistributions,
|
|
548
|
+
useRecipientComposer,
|
|
488
549
|
useSyncClient
|
|
489
550
|
});
|
package/dist/react/index.mjs
CHANGED
|
@@ -252,6 +252,65 @@ function buildDistributionsPath(params) {
|
|
|
252
252
|
const qs = search.toString();
|
|
253
253
|
return qs ? `/distributions/me?${qs}` : "/distributions/me";
|
|
254
254
|
}
|
|
255
|
+
function createRecipientRowId() {
|
|
256
|
+
return `recipient-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
257
|
+
}
|
|
258
|
+
function hydrateRecipientRow(partial) {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
return {
|
|
261
|
+
id: createRecipientRowId(),
|
|
262
|
+
address: (_a = partial == null ? void 0 : partial.address) != null ? _a : "",
|
|
263
|
+
amount: (_b = partial == null ? void 0 : partial.amount) != null ? _b : ""
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function useRecipientComposer(initial = []) {
|
|
267
|
+
const [rows, setRows] = useState(() => {
|
|
268
|
+
if (initial.length === 0) return [hydrateRecipientRow()];
|
|
269
|
+
return initial.map((row) => hydrateRecipientRow(row));
|
|
270
|
+
});
|
|
271
|
+
const addRow = useCallback(() => {
|
|
272
|
+
setRows((current) => [...current, hydrateRecipientRow()]);
|
|
273
|
+
}, []);
|
|
274
|
+
const removeRow = useCallback((id) => {
|
|
275
|
+
setRows((current) => {
|
|
276
|
+
if (current.length <= 1) return [hydrateRecipientRow()];
|
|
277
|
+
return current.filter((row) => row.id !== id);
|
|
278
|
+
});
|
|
279
|
+
}, []);
|
|
280
|
+
const updateRow = useCallback((id, patch) => {
|
|
281
|
+
setRows((current) => current.map((row) => row.id === id ? __spreadValues(__spreadValues({}, row), patch) : row));
|
|
282
|
+
}, []);
|
|
283
|
+
const replaceRows = useCallback((incoming) => {
|
|
284
|
+
if (!incoming.length) {
|
|
285
|
+
setRows([hydrateRecipientRow()]);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
setRows(incoming.map((row) => hydrateRecipientRow(row)));
|
|
289
|
+
}, []);
|
|
290
|
+
const clearRows = useCallback(() => {
|
|
291
|
+
setRows([hydrateRecipientRow()]);
|
|
292
|
+
}, []);
|
|
293
|
+
const totals = useMemo(() => {
|
|
294
|
+
const normalized = rows.map((row) => ({ id: row.id, address: row.address.trim(), amount: Number(row.amount) || 0 }));
|
|
295
|
+
const totalAmount = normalized.reduce((sum, row) => sum + Math.max(0, row.amount), 0);
|
|
296
|
+
const withShare = normalized.map((row) => __spreadProps(__spreadValues({}, row), {
|
|
297
|
+
shareBps: totalAmount > 0 ? Math.round(Math.max(0, row.amount) / totalAmount * 1e4) : 0
|
|
298
|
+
}));
|
|
299
|
+
return {
|
|
300
|
+
count: rows.length,
|
|
301
|
+
totalAmount,
|
|
302
|
+
normalized: withShare
|
|
303
|
+
};
|
|
304
|
+
}, [rows]);
|
|
305
|
+
return {
|
|
306
|
+
state: { rows, totals },
|
|
307
|
+
addRow,
|
|
308
|
+
removeRow,
|
|
309
|
+
updateRow,
|
|
310
|
+
replaceRows,
|
|
311
|
+
clearRows
|
|
312
|
+
};
|
|
313
|
+
}
|
|
255
314
|
export {
|
|
256
315
|
SyncProvider,
|
|
257
316
|
useClaimFlow,
|
|
@@ -264,5 +323,6 @@ export {
|
|
|
264
323
|
useDistributionFlow,
|
|
265
324
|
useDistributionTransaction,
|
|
266
325
|
useDistributions,
|
|
326
|
+
useRecipientComposer,
|
|
267
327
|
useSyncClient
|
|
268
328
|
};
|
package/dist/server/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as ListDistributionsRequest, g as ListDistributionsResponse, l as CreateDistributionRequest, k as DistributionTransactionPayload, o as CommitDistributionRequest, p as CommitDistributionResponse, r as BuildClaimTransactionRequest, d as ClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse, v as ClaimableResponse, a as Distribution, x as ClaimHistoryResponse, H as HealthResponse } from '../api-
|
|
1
|
+
import { L as ListDistributionsRequest, g as ListDistributionsResponse, l as CreateDistributionRequest, k as DistributionTransactionPayload, o as CommitDistributionRequest, p as CommitDistributionResponse, r as BuildClaimTransactionRequest, d as ClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse, v as ClaimableResponse, a as Distribution, x as ClaimHistoryResponse, H as HealthResponse } from '../api-C0dGK-PK.mjs';
|
|
2
2
|
|
|
3
3
|
type QueryInit = string | URLSearchParams | Record<string, string | number | boolean | null | undefined>;
|
|
4
4
|
type HeaderInjector = () => Promise<HeadersInit> | HeadersInit;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as ListDistributionsRequest, g as ListDistributionsResponse, l as CreateDistributionRequest, k as DistributionTransactionPayload, o as CommitDistributionRequest, p as CommitDistributionResponse, r as BuildClaimTransactionRequest, d as ClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse, v as ClaimableResponse, a as Distribution, x as ClaimHistoryResponse, H as HealthResponse } from '../api-
|
|
1
|
+
import { L as ListDistributionsRequest, g as ListDistributionsResponse, l as CreateDistributionRequest, k as DistributionTransactionPayload, o as CommitDistributionRequest, p as CommitDistributionResponse, r as BuildClaimTransactionRequest, d as ClaimTransactionResponse, t as CommitClaimRequest, u as CommitClaimResponse, v as ClaimableResponse, a as Distribution, x as ClaimHistoryResponse, H as HealthResponse } from '../api-C0dGK-PK.js';
|
|
2
2
|
|
|
3
3
|
type QueryInit = string | URLSearchParams | Record<string, string | number | boolean | null | undefined>;
|
|
4
4
|
type HeaderInjector = () => Promise<HeadersInit> | HeadersInit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fractalshq/sync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Fractals Sync SDK: shared types, server client, React hooks, and widgets",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"sdk",
|
|
52
52
|
"fractals"
|
|
53
53
|
],
|
|
54
|
-
"author": "Fractals <
|
|
55
|
-
"license": "
|
|
54
|
+
"author": "Fractals <max@fractals.fun>",
|
|
55
|
+
"license": "MIT",
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@fractalshq/auth-core": "^0.1.9",
|
|
58
58
|
"@fractalshq/jito-distributor-sdk": "^1.0.7",
|