@rotateprotocol/sdk 1.0.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 +453 -0
- package/dist/catalog.d.ts +112 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +210 -0
- package/dist/catalog.js.map +1 -0
- package/dist/components/CheckoutForm.d.ts +86 -0
- package/dist/components/CheckoutForm.d.ts.map +1 -0
- package/dist/components/CheckoutForm.js +332 -0
- package/dist/components/CheckoutForm.js.map +1 -0
- package/dist/components/HostedCheckout.d.ts +57 -0
- package/dist/components/HostedCheckout.d.ts.map +1 -0
- package/dist/components/HostedCheckout.js +414 -0
- package/dist/components/HostedCheckout.js.map +1 -0
- package/dist/components/PaymentButton.d.ts +80 -0
- package/dist/components/PaymentButton.d.ts.map +1 -0
- package/dist/components/PaymentButton.js +210 -0
- package/dist/components/PaymentButton.js.map +1 -0
- package/dist/components/RotateProvider.d.ts +115 -0
- package/dist/components/RotateProvider.d.ts.map +1 -0
- package/dist/components/RotateProvider.js +264 -0
- package/dist/components/RotateProvider.js.map +1 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +27 -0
- package/dist/components/index.js.map +1 -0
- package/dist/embed.d.ts +85 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +313 -0
- package/dist/embed.js.map +1 -0
- package/dist/hooks.d.ts +156 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +280 -0
- package/dist/hooks.js.map +1 -0
- package/dist/idl/rotate_connect.json +2572 -0
- package/dist/index.d.ts +505 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1197 -0
- package/dist/index.js.map +1 -0
- package/dist/marketplace.d.ts +257 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/marketplace.js +433 -0
- package/dist/marketplace.js.map +1 -0
- package/dist/platform.d.ts +234 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +268 -0
- package/dist/platform.js.map +1 -0
- package/dist/react.d.ts +140 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +429 -0
- package/dist/react.js.map +1 -0
- package/dist/store.d.ts +213 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +404 -0
- package/dist/store.js.map +1 -0
- package/dist/webhooks.d.ts +149 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +371 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +114 -0
- package/src/catalog.ts +299 -0
- package/src/components/CheckoutForm.tsx +608 -0
- package/src/components/HostedCheckout.tsx +675 -0
- package/src/components/PaymentButton.tsx +348 -0
- package/src/components/RotateProvider.tsx +370 -0
- package/src/components/index.ts +26 -0
- package/src/embed.ts +408 -0
- package/src/hooks.ts +518 -0
- package/src/idl/rotate_connect.json +2572 -0
- package/src/index.ts +1538 -0
- package/src/marketplace.ts +642 -0
- package/src/platform.ts +403 -0
- package/src/react.ts +459 -0
- package/src/store.ts +577 -0
- package/src/webhooks.ts +506 -0
package/dist/react.js
ADDED
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Rotate Protocol React Hooks
|
|
4
|
+
*
|
|
5
|
+
* React hooks for easy integration with Solana wallet adapters.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.RotatePlatformManager = exports.MarketplaceCart = exports.RotateMarketplace = exports.RotateCart = exports.RotateStore = exports.MAX_RANDOM_ID = exports.MIN_RANDOM_ID = exports.MEMO_PROGRAM_ID = exports.getLinkDescription = exports.isValidId = exports.generateSampleId = exports.calculateFees = exports.RotateSDK = exports.useMarketplaceCart = exports.useMarketplace = exports.useCart = exports.useProducts = void 0;
|
|
44
|
+
exports.useRotate = useRotate;
|
|
45
|
+
exports.usePaymentLink = usePaymentLink;
|
|
46
|
+
exports.useMerchant = useMerchant;
|
|
47
|
+
exports.useSolPrice = useSolPrice;
|
|
48
|
+
exports.useTokenBalances = useTokenBalances;
|
|
49
|
+
exports.usePaymentFlow = usePaymentFlow;
|
|
50
|
+
exports.useCreateEntities = useCreateEntities;
|
|
51
|
+
const react_1 = require("react");
|
|
52
|
+
const wallet_adapter_react_1 = require("@solana/wallet-adapter-react");
|
|
53
|
+
const index_1 = __importStar(require("./index"));
|
|
54
|
+
exports.RotateSDK = index_1.default;
|
|
55
|
+
Object.defineProperty(exports, "calculateFees", { enumerable: true, get: function () { return index_1.calculateFees; } });
|
|
56
|
+
Object.defineProperty(exports, "generateSampleId", { enumerable: true, get: function () { return index_1.generateSampleId; } });
|
|
57
|
+
Object.defineProperty(exports, "isValidId", { enumerable: true, get: function () { return index_1.isValidId; } });
|
|
58
|
+
Object.defineProperty(exports, "getLinkDescription", { enumerable: true, get: function () { return index_1.getLinkDescription; } });
|
|
59
|
+
Object.defineProperty(exports, "MEMO_PROGRAM_ID", { enumerable: true, get: function () { return index_1.MEMO_PROGRAM_ID; } });
|
|
60
|
+
Object.defineProperty(exports, "MIN_RANDOM_ID", { enumerable: true, get: function () { return index_1.MIN_RANDOM_ID; } });
|
|
61
|
+
Object.defineProperty(exports, "MAX_RANDOM_ID", { enumerable: true, get: function () { return index_1.MAX_RANDOM_ID; } });
|
|
62
|
+
// ==================== MAIN HOOK ====================
|
|
63
|
+
/**
|
|
64
|
+
* Main hook for Rotate Protocol
|
|
65
|
+
*/
|
|
66
|
+
function useRotate(options = {}) {
|
|
67
|
+
const { connection } = (0, wallet_adapter_react_1.useConnection)();
|
|
68
|
+
const wallet = (0, wallet_adapter_react_1.useWallet)();
|
|
69
|
+
const sdk = (0, react_1.useMemo)(() => {
|
|
70
|
+
return new index_1.default({
|
|
71
|
+
network: options.network || 'mainnet-beta',
|
|
72
|
+
rpcEndpoint: options.rpcEndpoint,
|
|
73
|
+
});
|
|
74
|
+
}, [options.network, options.rpcEndpoint]);
|
|
75
|
+
const [protocol, setProtocol] = (0, react_1.useState)(null);
|
|
76
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
77
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
78
|
+
// Load protocol on mount
|
|
79
|
+
(0, react_1.useEffect)(() => {
|
|
80
|
+
async function load() {
|
|
81
|
+
try {
|
|
82
|
+
const data = await sdk.getProtocol();
|
|
83
|
+
setProtocol(data);
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
setError(e.message);
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
setLoading(false);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
load();
|
|
93
|
+
}, [sdk]);
|
|
94
|
+
return {
|
|
95
|
+
sdk,
|
|
96
|
+
protocol,
|
|
97
|
+
loading,
|
|
98
|
+
error,
|
|
99
|
+
connected: wallet.connected,
|
|
100
|
+
publicKey: wallet.publicKey,
|
|
101
|
+
signTransaction: wallet.signTransaction,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
// ==================== PAYMENT LINK HOOK ====================
|
|
105
|
+
/**
|
|
106
|
+
* Hook for working with a specific payment link
|
|
107
|
+
*/
|
|
108
|
+
function usePaymentLink(linkId, options = {}) {
|
|
109
|
+
const { sdk } = useRotate(options);
|
|
110
|
+
const [link, setLink] = (0, react_1.useState)(null);
|
|
111
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
112
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
113
|
+
// Load link data
|
|
114
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
115
|
+
setLoading(true);
|
|
116
|
+
try {
|
|
117
|
+
const data = await sdk.getPaymentLink(linkId);
|
|
118
|
+
setLink(data);
|
|
119
|
+
setError(null);
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
setError(e.message);
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
setLoading(false);
|
|
126
|
+
}
|
|
127
|
+
}, [sdk, linkId]);
|
|
128
|
+
(0, react_1.useEffect)(() => {
|
|
129
|
+
refresh();
|
|
130
|
+
}, [refresh]);
|
|
131
|
+
// Poll for updates
|
|
132
|
+
const [polling, setPolling] = (0, react_1.useState)(false);
|
|
133
|
+
const pollIntervalRef = (0, react_1.useRef)(2000);
|
|
134
|
+
const startPolling = (0, react_1.useCallback)((intervalMs = 2000) => {
|
|
135
|
+
pollIntervalRef.current = intervalMs;
|
|
136
|
+
setPolling(true);
|
|
137
|
+
}, []);
|
|
138
|
+
const stopPolling = (0, react_1.useCallback)(() => {
|
|
139
|
+
setPolling(false);
|
|
140
|
+
}, []);
|
|
141
|
+
(0, react_1.useEffect)(() => {
|
|
142
|
+
if (!polling)
|
|
143
|
+
return;
|
|
144
|
+
const interval = setInterval(refresh, pollIntervalRef.current);
|
|
145
|
+
return () => clearInterval(interval);
|
|
146
|
+
}, [polling, refresh]);
|
|
147
|
+
// Status helpers
|
|
148
|
+
const status = link ? {
|
|
149
|
+
linkId: link.id,
|
|
150
|
+
status: link.status,
|
|
151
|
+
amountPaid: link.amountPaid,
|
|
152
|
+
amountTotal: link.amount,
|
|
153
|
+
isPaid: link.status === 'Paid',
|
|
154
|
+
isExpired: link.expiresAt > 0 && Date.now() / 1000 > link.expiresAt,
|
|
155
|
+
} : null;
|
|
156
|
+
return {
|
|
157
|
+
link,
|
|
158
|
+
status,
|
|
159
|
+
loading,
|
|
160
|
+
error,
|
|
161
|
+
refresh,
|
|
162
|
+
startPolling,
|
|
163
|
+
stopPolling,
|
|
164
|
+
isPolling: polling,
|
|
165
|
+
paymentUrl: sdk.getPaymentUrl(linkId),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
// ==================== MERCHANT HOOK ====================
|
|
169
|
+
/**
|
|
170
|
+
* Hook for merchant operations
|
|
171
|
+
*/
|
|
172
|
+
function useMerchant(merchantId, options = {}) {
|
|
173
|
+
const { sdk } = useRotate(options);
|
|
174
|
+
const [merchant, setMerchant] = (0, react_1.useState)(null);
|
|
175
|
+
const [platform, setPlatform] = (0, react_1.useState)(null);
|
|
176
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
177
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
178
|
+
(0, react_1.useEffect)(() => {
|
|
179
|
+
async function load() {
|
|
180
|
+
try {
|
|
181
|
+
const merchantData = await sdk.getMerchant(merchantId);
|
|
182
|
+
setMerchant(merchantData);
|
|
183
|
+
if (merchantData) {
|
|
184
|
+
const platformData = await sdk.getPlatform(merchantData.platformId);
|
|
185
|
+
setPlatform(platformData);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
catch (e) {
|
|
189
|
+
setError(e.message);
|
|
190
|
+
}
|
|
191
|
+
finally {
|
|
192
|
+
setLoading(false);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
load();
|
|
196
|
+
}, [sdk, merchantId]);
|
|
197
|
+
// Calculate fees helper
|
|
198
|
+
const getFees = (0, react_1.useCallback)((amountUsd) => {
|
|
199
|
+
return (0, index_1.calculateFees)(amountUsd, platform?.feeBps || 0);
|
|
200
|
+
}, [platform]);
|
|
201
|
+
return {
|
|
202
|
+
merchant,
|
|
203
|
+
platform,
|
|
204
|
+
loading,
|
|
205
|
+
error,
|
|
206
|
+
getFees,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// ==================== SOL PRICE HOOK ====================
|
|
210
|
+
/**
|
|
211
|
+
* Hook for SOL price.
|
|
212
|
+
* `priceApiUrl` can be overridden to use a custom price feed (default: CoinGecko).
|
|
213
|
+
*/
|
|
214
|
+
function useSolPrice(refreshIntervalMs = 30000, priceApiUrl = 'https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd') {
|
|
215
|
+
const [price, setPrice] = (0, react_1.useState)(null);
|
|
216
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
217
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
218
|
+
try {
|
|
219
|
+
const response = await fetch(priceApiUrl);
|
|
220
|
+
const data = await response.json();
|
|
221
|
+
setPrice(data.solana?.usd || null);
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// Ignore errors
|
|
225
|
+
}
|
|
226
|
+
finally {
|
|
227
|
+
setLoading(false);
|
|
228
|
+
}
|
|
229
|
+
}, [priceApiUrl]);
|
|
230
|
+
(0, react_1.useEffect)(() => {
|
|
231
|
+
refresh();
|
|
232
|
+
const interval = setInterval(refresh, refreshIntervalMs);
|
|
233
|
+
return () => clearInterval(interval);
|
|
234
|
+
}, [refresh, refreshIntervalMs]);
|
|
235
|
+
const usdToSol = (0, react_1.useCallback)((usd) => {
|
|
236
|
+
if (!price)
|
|
237
|
+
return null;
|
|
238
|
+
return usd / price;
|
|
239
|
+
}, [price]);
|
|
240
|
+
const solToUsd = (0, react_1.useCallback)((sol) => {
|
|
241
|
+
if (!price)
|
|
242
|
+
return null;
|
|
243
|
+
return sol * price;
|
|
244
|
+
}, [price]);
|
|
245
|
+
return {
|
|
246
|
+
price,
|
|
247
|
+
loading,
|
|
248
|
+
refresh,
|
|
249
|
+
usdToSol,
|
|
250
|
+
solToUsd,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
// ==================== TOKEN BALANCE HOOK ====================
|
|
254
|
+
/**
|
|
255
|
+
* Hook for token balances
|
|
256
|
+
*/
|
|
257
|
+
function useTokenBalances(options = {}) {
|
|
258
|
+
const { sdk } = useRotate(options);
|
|
259
|
+
const { publicKey, connected } = (0, wallet_adapter_react_1.useWallet)();
|
|
260
|
+
const { connection } = (0, wallet_adapter_react_1.useConnection)();
|
|
261
|
+
const [balances, setBalances] = (0, react_1.useState)({ sol: 0, usdc: 0, usdt: 0 });
|
|
262
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
263
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
264
|
+
if (!publicKey)
|
|
265
|
+
return;
|
|
266
|
+
setLoading(true);
|
|
267
|
+
try {
|
|
268
|
+
const [solBalance, usdcBalance, usdtBalance] = await Promise.all([
|
|
269
|
+
connection.getBalance(publicKey),
|
|
270
|
+
sdk.getTokenBalance(publicKey, 'USDC'),
|
|
271
|
+
sdk.getTokenBalance(publicKey, 'USDT'),
|
|
272
|
+
]);
|
|
273
|
+
setBalances({
|
|
274
|
+
sol: solBalance / 1e9,
|
|
275
|
+
usdc: usdcBalance,
|
|
276
|
+
usdt: usdtBalance,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
// Ignore errors
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
setLoading(false);
|
|
284
|
+
}
|
|
285
|
+
}, [connection, publicKey, sdk]);
|
|
286
|
+
(0, react_1.useEffect)(() => {
|
|
287
|
+
if (connected && publicKey) {
|
|
288
|
+
refresh();
|
|
289
|
+
}
|
|
290
|
+
}, [connected, publicKey, refresh]);
|
|
291
|
+
return {
|
|
292
|
+
balances,
|
|
293
|
+
loading,
|
|
294
|
+
refresh,
|
|
295
|
+
hasEnough: (amount, currency) => {
|
|
296
|
+
const balance = currency === 'SOL' ? balances.sol :
|
|
297
|
+
currency === 'USDC' ? balances.usdc :
|
|
298
|
+
balances.usdt;
|
|
299
|
+
return balance >= amount;
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
// ==================== PAYMENT FLOW HOOK ====================
|
|
304
|
+
/**
|
|
305
|
+
* Complete payment flow hook
|
|
306
|
+
*/
|
|
307
|
+
function usePaymentFlow(linkId, options = {}) {
|
|
308
|
+
const { sdk, connected, publicKey } = useRotate(options);
|
|
309
|
+
const { link, status, refresh, startPolling, stopPolling } = usePaymentLink(linkId, options);
|
|
310
|
+
const { price: solPrice } = useSolPrice();
|
|
311
|
+
const { balances } = useTokenBalances(options);
|
|
312
|
+
const [selectedCurrency, setSelectedCurrency] = (0, react_1.useState)('USDC');
|
|
313
|
+
const [paying, setPaying] = (0, react_1.useState)(false);
|
|
314
|
+
const [paymentError, setPaymentError] = (0, react_1.useState)(null);
|
|
315
|
+
// Calculate amount in selected currency, accounting for link token type
|
|
316
|
+
const amountInCurrency = (0, react_1.useMemo)(() => {
|
|
317
|
+
if (!link)
|
|
318
|
+
return null;
|
|
319
|
+
// SOL-denominated links store lamports (9 decimals)
|
|
320
|
+
if (link.tokenType === 'Sol') {
|
|
321
|
+
return Number(link.amount) / 1000000000;
|
|
322
|
+
}
|
|
323
|
+
// USD / USDC / USDT links store micro-units (6 decimals)
|
|
324
|
+
const amountUsd = Number(link.amount) / 1000000;
|
|
325
|
+
if (selectedCurrency === 'SOL' && solPrice) {
|
|
326
|
+
return amountUsd / solPrice;
|
|
327
|
+
}
|
|
328
|
+
// USDC/USDT are 1:1 with USD
|
|
329
|
+
return amountUsd;
|
|
330
|
+
}, [link, selectedCurrency, solPrice]);
|
|
331
|
+
// Check if user can pay
|
|
332
|
+
const canPay = (0, react_1.useMemo)(() => {
|
|
333
|
+
if (!connected || !link || !amountInCurrency)
|
|
334
|
+
return false;
|
|
335
|
+
if (link.status !== 'Pending' && link.status !== 'PartiallyPaid')
|
|
336
|
+
return false;
|
|
337
|
+
const balance = selectedCurrency === 'SOL' ? balances.sol :
|
|
338
|
+
selectedCurrency === 'USDC' ? balances.usdc :
|
|
339
|
+
balances.usdt;
|
|
340
|
+
return balance >= amountInCurrency;
|
|
341
|
+
}, [connected, link, amountInCurrency, selectedCurrency, balances]);
|
|
342
|
+
return {
|
|
343
|
+
link,
|
|
344
|
+
status,
|
|
345
|
+
connected,
|
|
346
|
+
publicKey,
|
|
347
|
+
selectedCurrency,
|
|
348
|
+
setSelectedCurrency,
|
|
349
|
+
amountInCurrency,
|
|
350
|
+
canPay,
|
|
351
|
+
paying,
|
|
352
|
+
paymentError,
|
|
353
|
+
refresh,
|
|
354
|
+
startPolling,
|
|
355
|
+
stopPolling,
|
|
356
|
+
balances,
|
|
357
|
+
solPrice,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
// ==================== PLATFORM/MERCHANT CREATION HOOK ====================
|
|
361
|
+
/**
|
|
362
|
+
* Hook for creating platforms and merchants with random IDs
|
|
363
|
+
*/
|
|
364
|
+
function useCreateEntities(options = {}) {
|
|
365
|
+
const { sdk, connected, publicKey } = useRotate(options);
|
|
366
|
+
const [creating, setCreating] = (0, react_1.useState)(false);
|
|
367
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
368
|
+
const createPlatform = (0, react_1.useCallback)(async (feeBps, wallet) => {
|
|
369
|
+
if (!connected)
|
|
370
|
+
throw new Error('Wallet not connected');
|
|
371
|
+
setCreating(true);
|
|
372
|
+
setError(null);
|
|
373
|
+
try {
|
|
374
|
+
const result = await sdk.createPlatform({ feeBps, wallet });
|
|
375
|
+
return result;
|
|
376
|
+
}
|
|
377
|
+
catch (e) {
|
|
378
|
+
setError(e.message);
|
|
379
|
+
throw e;
|
|
380
|
+
}
|
|
381
|
+
finally {
|
|
382
|
+
setCreating(false);
|
|
383
|
+
}
|
|
384
|
+
}, [sdk, connected]);
|
|
385
|
+
const createMerchant = (0, react_1.useCallback)(async (platformId, wallet) => {
|
|
386
|
+
if (!connected)
|
|
387
|
+
throw new Error('Wallet not connected');
|
|
388
|
+
setCreating(true);
|
|
389
|
+
setError(null);
|
|
390
|
+
try {
|
|
391
|
+
const result = await sdk.createMerchant({ platformId, wallet });
|
|
392
|
+
return result;
|
|
393
|
+
}
|
|
394
|
+
catch (e) {
|
|
395
|
+
setError(e.message);
|
|
396
|
+
throw e;
|
|
397
|
+
}
|
|
398
|
+
finally {
|
|
399
|
+
setCreating(false);
|
|
400
|
+
}
|
|
401
|
+
}, [sdk, connected]);
|
|
402
|
+
return {
|
|
403
|
+
createPlatform,
|
|
404
|
+
createMerchant,
|
|
405
|
+
creating,
|
|
406
|
+
error,
|
|
407
|
+
generateSampleId: index_1.generateSampleId,
|
|
408
|
+
isValidId: index_1.isValidId,
|
|
409
|
+
MIN_RANDOM_ID: index_1.MIN_RANDOM_ID,
|
|
410
|
+
MAX_RANDOM_ID: index_1.MAX_RANDOM_ID,
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
// ==================== STORE & MARKETPLACE HOOKS ====================
|
|
414
|
+
// Re-export from hooks module for convenience
|
|
415
|
+
var hooks_1 = require("./hooks");
|
|
416
|
+
Object.defineProperty(exports, "useProducts", { enumerable: true, get: function () { return hooks_1.useProducts; } });
|
|
417
|
+
Object.defineProperty(exports, "useCart", { enumerable: true, get: function () { return hooks_1.useCart; } });
|
|
418
|
+
Object.defineProperty(exports, "useMarketplace", { enumerable: true, get: function () { return hooks_1.useMarketplace; } });
|
|
419
|
+
Object.defineProperty(exports, "useMarketplaceCart", { enumerable: true, get: function () { return hooks_1.useMarketplaceCart; } });
|
|
420
|
+
// Re-export store, marketplace & platform classes
|
|
421
|
+
var store_1 = require("./store");
|
|
422
|
+
Object.defineProperty(exports, "RotateStore", { enumerable: true, get: function () { return store_1.RotateStore; } });
|
|
423
|
+
Object.defineProperty(exports, "RotateCart", { enumerable: true, get: function () { return store_1.RotateCart; } });
|
|
424
|
+
var marketplace_1 = require("./marketplace");
|
|
425
|
+
Object.defineProperty(exports, "RotateMarketplace", { enumerable: true, get: function () { return marketplace_1.RotateMarketplace; } });
|
|
426
|
+
Object.defineProperty(exports, "MarketplaceCart", { enumerable: true, get: function () { return marketplace_1.MarketplaceCart; } });
|
|
427
|
+
var platform_1 = require("./platform");
|
|
428
|
+
Object.defineProperty(exports, "RotatePlatformManager", { enumerable: true, get: function () { return platform_1.RotatePlatformManager; } });
|
|
429
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCH,8BAuCC;AAOD,wCAiEC;AAOD,kCAsCC;AAQD,kCA0CC;AAOD,4CAoDC;AAOD,wCA2DC;AAOD,8CAiDC;AA1aD,iCAA0E;AAC1E,uEAAwE;AAExE,iDAaiB;AAqaf,oBAlbK,eAAS,CAkbL;AACT,8FA9aA,qBAAa,OA8aA;AACb,iGA9aA,wBAAgB,OA8aA;AAChB,0FA9aA,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,EAAT,iBAAS;QACT,aAAa,EAAb,qBAAa;QACb,aAAa,EAAb,qBAAa;KACd,CAAC;AACJ,CAAC;AAED,sEAAsE;AAEtE,8CAA8C;AAC9C,iCAAmF;AAA1E,oGAAA,WAAW,OAAA;AAAE,gGAAA,OAAO,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAgBjE,kDAAkD;AAClD,iCAAkD;AAAzC,oGAAA,WAAW,OAAA;AAAE,mGAAA,UAAU,OAAA;AAChC,6CAAmE;AAA1D,gHAAA,iBAAiB,OAAA;AAAE,8GAAA,eAAe,OAAA;AAC3C,uCAAmD;AAA1C,iHAAA,qBAAqB,OAAA"}
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rotate Store — Product Catalog, Cart & Checkout
|
|
3
|
+
*
|
|
4
|
+
* A complete store layer that sits on top of the Rotate Protocol.
|
|
5
|
+
* Products and cart state are managed client-side / in your database;
|
|
6
|
+
* only the final payment touches the blockchain.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const store = new RotateStore(sdk, {
|
|
11
|
+
* merchantId: 1000000,
|
|
12
|
+
* platformId: 1000000,
|
|
13
|
+
* currency: 'USD',
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* store.addProduct({ id: 'tshirt-01', name: 'Logo Tee', price: 29.99, inventory: 100 });
|
|
17
|
+
* store.addProduct({ id: 'hoodie-01', name: 'Zip Hoodie', price: 59.99, inventory: 50 });
|
|
18
|
+
*
|
|
19
|
+
* const cart = store.createCart();
|
|
20
|
+
* cart.addItem('tshirt-01', 2);
|
|
21
|
+
* cart.addItem('hoodie-01', 1);
|
|
22
|
+
*
|
|
23
|
+
* const session = await cart.checkout(); // creates on-chain payment link
|
|
24
|
+
* console.log(session.linkId, session.paymentUrl);
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
*/
|
|
29
|
+
import RotateSDK from './index';
|
|
30
|
+
import { BaseProduct, BaseProductInput, Discount, DiscountInput } from './catalog';
|
|
31
|
+
export type Currency = 'SOL' | 'USDC' | 'USDT' | 'USD';
|
|
32
|
+
/** A product in the catalog */
|
|
33
|
+
export interface Product extends BaseProduct {
|
|
34
|
+
}
|
|
35
|
+
export interface ProductInput extends BaseProductInput {
|
|
36
|
+
}
|
|
37
|
+
/** A line item in a cart */
|
|
38
|
+
export interface LineItem {
|
|
39
|
+
product: Product;
|
|
40
|
+
quantity: number;
|
|
41
|
+
/** Per-item price override (for dynamic pricing / discounts) */
|
|
42
|
+
unitPrice: number;
|
|
43
|
+
}
|
|
44
|
+
export type { Discount, DiscountInput } from './catalog';
|
|
45
|
+
/** Cart totals breakdown */
|
|
46
|
+
export interface CartTotals {
|
|
47
|
+
/** Number of unique items */
|
|
48
|
+
itemCount: number;
|
|
49
|
+
/** Total quantity across all items */
|
|
50
|
+
totalQuantity: number;
|
|
51
|
+
/** Subtotal before discounts and fees */
|
|
52
|
+
subtotal: number;
|
|
53
|
+
/** Total discount amount */
|
|
54
|
+
discountAmount: number;
|
|
55
|
+
/** Subtotal after discounts, before fees */
|
|
56
|
+
afterDiscount: number;
|
|
57
|
+
/** Buyer's fee share (protocol + platform) */
|
|
58
|
+
fees: number;
|
|
59
|
+
/** Grand total the buyer pays */
|
|
60
|
+
total: number;
|
|
61
|
+
/** What the merchant receives after seller-side fee deduction */
|
|
62
|
+
merchantReceives: number;
|
|
63
|
+
/** Line-by-line breakdown */
|
|
64
|
+
lines: Array<{
|
|
65
|
+
productId: string;
|
|
66
|
+
name: string;
|
|
67
|
+
quantity: number;
|
|
68
|
+
unitPrice: number;
|
|
69
|
+
lineTotal: number;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
/** Result of a checkout */
|
|
73
|
+
export interface CheckoutResult {
|
|
74
|
+
/** On-chain link ID */
|
|
75
|
+
linkId: number;
|
|
76
|
+
/** Transaction signature */
|
|
77
|
+
tx: string;
|
|
78
|
+
/** Payment URL */
|
|
79
|
+
paymentUrl: string;
|
|
80
|
+
/** QR code URL */
|
|
81
|
+
qrCodeUrl: string;
|
|
82
|
+
/** Cart totals at time of checkout */
|
|
83
|
+
totals: CartTotals;
|
|
84
|
+
/** Order reference */
|
|
85
|
+
orderRef: string;
|
|
86
|
+
/** Created timestamp */
|
|
87
|
+
createdAt: number;
|
|
88
|
+
}
|
|
89
|
+
/** Batch link creation result */
|
|
90
|
+
export interface BatchLinkResult {
|
|
91
|
+
productId: string;
|
|
92
|
+
linkId: number;
|
|
93
|
+
tx: string;
|
|
94
|
+
paymentUrl: string;
|
|
95
|
+
}
|
|
96
|
+
/** Store configuration */
|
|
97
|
+
export interface StoreConfig {
|
|
98
|
+
merchantId: number;
|
|
99
|
+
platformId: number;
|
|
100
|
+
/** Default currency for the store */
|
|
101
|
+
currency?: Currency;
|
|
102
|
+
/** Allow tips on checkout */
|
|
103
|
+
allowTips?: boolean;
|
|
104
|
+
/** Default link expiration in seconds (0 = never, default: 300 = 5min) */
|
|
105
|
+
defaultExpiresIn?: number;
|
|
106
|
+
/** Platform fee BPS for fee calculations */
|
|
107
|
+
platformFeeBps?: number;
|
|
108
|
+
}
|
|
109
|
+
export declare class RotateStore {
|
|
110
|
+
private sdk;
|
|
111
|
+
private config;
|
|
112
|
+
/** @internal Shared catalog logic */
|
|
113
|
+
private catalog;
|
|
114
|
+
constructor(sdk: RotateSDK, config: StoreConfig);
|
|
115
|
+
addProduct(input: ProductInput): Product;
|
|
116
|
+
addProducts(inputs: ProductInput[]): Product[];
|
|
117
|
+
updateProduct(id: string, updates: Partial<ProductInput>): Product;
|
|
118
|
+
removeProduct(id: string): boolean;
|
|
119
|
+
getProduct(id: string): Product | undefined;
|
|
120
|
+
getProducts(filter?: {
|
|
121
|
+
category?: string;
|
|
122
|
+
active?: boolean;
|
|
123
|
+
search?: string;
|
|
124
|
+
minPrice?: number;
|
|
125
|
+
maxPrice?: number;
|
|
126
|
+
sortBy?: 'name' | 'price' | 'createdAt';
|
|
127
|
+
sortOrder?: 'asc' | 'desc';
|
|
128
|
+
limit?: number;
|
|
129
|
+
offset?: number;
|
|
130
|
+
}): Product[];
|
|
131
|
+
getCategories(): string[];
|
|
132
|
+
get productCount(): number;
|
|
133
|
+
isInStock(productId: string, quantity?: number): boolean;
|
|
134
|
+
reserveInventory(productId: string, quantity: number): void;
|
|
135
|
+
releaseInventory(productId: string, quantity: number): void;
|
|
136
|
+
addDiscount(input: DiscountInput): Discount;
|
|
137
|
+
getDiscount(code: string): Discount | undefined;
|
|
138
|
+
isDiscountValid(code: string, subtotal: number): boolean;
|
|
139
|
+
useDiscount(code: string): void;
|
|
140
|
+
/** Create a new shopping cart */
|
|
141
|
+
createCart(): RotateCart;
|
|
142
|
+
/**
|
|
143
|
+
* Create payment links for every active product in the catalog.
|
|
144
|
+
* Useful for generating a "Buy Now" link per product upfront.
|
|
145
|
+
* Processes sequentially to respect Solana transaction ordering.
|
|
146
|
+
*/
|
|
147
|
+
createLinksForAllProducts(options?: {
|
|
148
|
+
expiresIn?: number;
|
|
149
|
+
productIds?: string[];
|
|
150
|
+
concurrency?: number;
|
|
151
|
+
}): Promise<BatchLinkResult[]>;
|
|
152
|
+
/** Export the full catalog as JSON (for persistence / API) */
|
|
153
|
+
exportCatalog(): {
|
|
154
|
+
products: Product[];
|
|
155
|
+
discounts: Discount[];
|
|
156
|
+
};
|
|
157
|
+
/** Import a catalog from JSON */
|
|
158
|
+
importCatalog(data: {
|
|
159
|
+
products: Product[];
|
|
160
|
+
discounts?: Discount[];
|
|
161
|
+
}): void;
|
|
162
|
+
}
|
|
163
|
+
export declare class RotateCart {
|
|
164
|
+
private store;
|
|
165
|
+
private sdk;
|
|
166
|
+
private config;
|
|
167
|
+
private items;
|
|
168
|
+
private appliedDiscounts;
|
|
169
|
+
private _metadata;
|
|
170
|
+
/** @internal */
|
|
171
|
+
constructor(store: RotateStore, sdk: RotateSDK, config: Required<StoreConfig>);
|
|
172
|
+
/** Add a product to the cart */
|
|
173
|
+
addItem(productId: string, quantity?: number): LineItem;
|
|
174
|
+
/** Set exact quantity for a product */
|
|
175
|
+
setItemQuantity(productId: string, quantity: number): LineItem | null;
|
|
176
|
+
/** Remove a product from the cart entirely */
|
|
177
|
+
removeItem(productId: string): boolean;
|
|
178
|
+
/** Clear all items */
|
|
179
|
+
clear(): void;
|
|
180
|
+
/** Get all line items */
|
|
181
|
+
getItems(): LineItem[];
|
|
182
|
+
/** Check if cart is empty */
|
|
183
|
+
get isEmpty(): boolean;
|
|
184
|
+
/** Apply a discount code */
|
|
185
|
+
applyDiscount(code: string): boolean;
|
|
186
|
+
/** Remove a discount code */
|
|
187
|
+
removeDiscount(code: string): boolean;
|
|
188
|
+
/** Attach metadata to the order (customer email, shipping address, notes, etc.) */
|
|
189
|
+
setMetadata(key: string, value: string): void;
|
|
190
|
+
getMetadata(): Record<string, string>;
|
|
191
|
+
private calculateSubtotal;
|
|
192
|
+
private calculateDiscountAmount;
|
|
193
|
+
/** Calculate full cart totals */
|
|
194
|
+
getTotals(): CartTotals;
|
|
195
|
+
/**
|
|
196
|
+
* Finalize the cart and create an on-chain payment link.
|
|
197
|
+
* Returns everything needed to present the payment to the buyer.
|
|
198
|
+
*/
|
|
199
|
+
checkout(options?: {
|
|
200
|
+
/** Override expiration (seconds from now, 0 = no expiry) */
|
|
201
|
+
expiresIn?: number;
|
|
202
|
+
/** Override currency */
|
|
203
|
+
currency?: Currency;
|
|
204
|
+
/** Override tips flag */
|
|
205
|
+
allowTips?: boolean;
|
|
206
|
+
/** Custom order reference (default: auto-generated) */
|
|
207
|
+
orderRef?: string;
|
|
208
|
+
/** Custom description (default: auto-generated from cart items) */
|
|
209
|
+
description?: string;
|
|
210
|
+
}): Promise<CheckoutResult>;
|
|
211
|
+
}
|
|
212
|
+
export default RotateStore;
|
|
213
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 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