@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.
Files changed (74) hide show
  1. package/README.md +453 -0
  2. package/dist/catalog.d.ts +112 -0
  3. package/dist/catalog.d.ts.map +1 -0
  4. package/dist/catalog.js +210 -0
  5. package/dist/catalog.js.map +1 -0
  6. package/dist/components/CheckoutForm.d.ts +86 -0
  7. package/dist/components/CheckoutForm.d.ts.map +1 -0
  8. package/dist/components/CheckoutForm.js +332 -0
  9. package/dist/components/CheckoutForm.js.map +1 -0
  10. package/dist/components/HostedCheckout.d.ts +57 -0
  11. package/dist/components/HostedCheckout.d.ts.map +1 -0
  12. package/dist/components/HostedCheckout.js +414 -0
  13. package/dist/components/HostedCheckout.js.map +1 -0
  14. package/dist/components/PaymentButton.d.ts +80 -0
  15. package/dist/components/PaymentButton.d.ts.map +1 -0
  16. package/dist/components/PaymentButton.js +210 -0
  17. package/dist/components/PaymentButton.js.map +1 -0
  18. package/dist/components/RotateProvider.d.ts +115 -0
  19. package/dist/components/RotateProvider.d.ts.map +1 -0
  20. package/dist/components/RotateProvider.js +264 -0
  21. package/dist/components/RotateProvider.js.map +1 -0
  22. package/dist/components/index.d.ts +17 -0
  23. package/dist/components/index.d.ts.map +1 -0
  24. package/dist/components/index.js +27 -0
  25. package/dist/components/index.js.map +1 -0
  26. package/dist/embed.d.ts +85 -0
  27. package/dist/embed.d.ts.map +1 -0
  28. package/dist/embed.js +313 -0
  29. package/dist/embed.js.map +1 -0
  30. package/dist/hooks.d.ts +156 -0
  31. package/dist/hooks.d.ts.map +1 -0
  32. package/dist/hooks.js +280 -0
  33. package/dist/hooks.js.map +1 -0
  34. package/dist/idl/rotate_connect.json +2572 -0
  35. package/dist/index.d.ts +505 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +1197 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/marketplace.d.ts +257 -0
  40. package/dist/marketplace.d.ts.map +1 -0
  41. package/dist/marketplace.js +433 -0
  42. package/dist/marketplace.js.map +1 -0
  43. package/dist/platform.d.ts +234 -0
  44. package/dist/platform.d.ts.map +1 -0
  45. package/dist/platform.js +268 -0
  46. package/dist/platform.js.map +1 -0
  47. package/dist/react.d.ts +140 -0
  48. package/dist/react.d.ts.map +1 -0
  49. package/dist/react.js +429 -0
  50. package/dist/react.js.map +1 -0
  51. package/dist/store.d.ts +213 -0
  52. package/dist/store.d.ts.map +1 -0
  53. package/dist/store.js +404 -0
  54. package/dist/store.js.map +1 -0
  55. package/dist/webhooks.d.ts +149 -0
  56. package/dist/webhooks.d.ts.map +1 -0
  57. package/dist/webhooks.js +371 -0
  58. package/dist/webhooks.js.map +1 -0
  59. package/package.json +114 -0
  60. package/src/catalog.ts +299 -0
  61. package/src/components/CheckoutForm.tsx +608 -0
  62. package/src/components/HostedCheckout.tsx +675 -0
  63. package/src/components/PaymentButton.tsx +348 -0
  64. package/src/components/RotateProvider.tsx +370 -0
  65. package/src/components/index.ts +26 -0
  66. package/src/embed.ts +408 -0
  67. package/src/hooks.ts +518 -0
  68. package/src/idl/rotate_connect.json +2572 -0
  69. package/src/index.ts +1538 -0
  70. package/src/marketplace.ts +642 -0
  71. package/src/platform.ts +403 -0
  72. package/src/react.ts +459 -0
  73. package/src/store.ts +577 -0
  74. package/src/webhooks.ts +506 -0
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Rotate Platform Manager — Merchant Onboarding & Platform Administration
3
+ *
4
+ * A high-level SDK layer for platform operators to onboard merchants,
5
+ * manage their accounts, and monitor platform-wide activity.
6
+ *
7
+ * The platform admin wallet is the signer — merchants don't need to
8
+ * interact with the SDK directly. The platform creates merchant accounts
9
+ * on their behalf, and merchants just receive payments to their wallet.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { RotateSDK, RotatePlatformManager } from '@rotateprotocol/sdk';
14
+ *
15
+ * const sdk = new RotateSDK({ connection, wallet });
16
+ *
17
+ * // Create a platform first (one-time setup)
18
+ * const { platformId } = await sdk.createPlatform({ feeBps: 500, wallet: adminWallet });
19
+ *
20
+ * // Then use the manager for ongoing operations
21
+ * const platform = new RotatePlatformManager(sdk, { platformId });
22
+ *
23
+ * // Onboard a single merchant
24
+ * const merchant = await platform.onboardMerchant({
25
+ * wallet: new PublicKey('merchant-wallet-address'),
26
+ * name: 'Coffee Shop',
27
+ * });
28
+ * console.log(`Merchant created: #${merchant.merchantId}`);
29
+ *
30
+ * // Bulk onboard merchants
31
+ * const results = await platform.onboardMerchants([
32
+ * { wallet: walletA, name: 'Store A' },
33
+ * { wallet: walletB, name: 'Store B' },
34
+ * { wallet: walletC, name: 'Store C' },
35
+ * ]);
36
+ *
37
+ * // Get all merchants on the platform
38
+ * const merchants = await platform.getMerchants();
39
+ *
40
+ * // Get platform stats
41
+ * const stats = await platform.getStats();
42
+ * console.log(`Total merchants: ${stats.merchantCount}`);
43
+ * console.log(`Fee revenue: $${stats.feeRevenue.toFixed(2)}`);
44
+ * ```
45
+ *
46
+ * @packageDocumentation
47
+ */
48
+ import { PublicKey } from '@solana/web3.js';
49
+ import RotateSDK, { Platform } from './index';
50
+ /** Configuration for the platform manager */
51
+ export interface PlatformManagerConfig {
52
+ /** Your platform ID (from createPlatform) */
53
+ platformId: number;
54
+ }
55
+ /** Input for onboarding a single merchant */
56
+ export interface OnboardMerchantInput {
57
+ /** The merchant's Solana wallet address (where they receive payments) */
58
+ wallet: PublicKey;
59
+ /** Optional display name for the merchant (stored locally, not on-chain) */
60
+ name?: string;
61
+ /** Optional metadata (e.g. email, store URL, category) */
62
+ metadata?: Record<string, string>;
63
+ }
64
+ /** Result of onboarding a merchant */
65
+ export interface OnboardMerchantResult {
66
+ /** The assigned on-chain merchant ID */
67
+ merchantId: number;
68
+ /** Transaction signature */
69
+ tx: string;
70
+ /** The merchant's wallet address */
71
+ wallet: PublicKey;
72
+ /** Display name (if provided) */
73
+ name?: string;
74
+ /** Metadata (if provided) */
75
+ metadata?: Record<string, string>;
76
+ }
77
+ /** Result of a bulk onboarding operation */
78
+ export interface BulkOnboardResult {
79
+ /** Successfully onboarded merchants */
80
+ succeeded: OnboardMerchantResult[];
81
+ /** Failed onboardings */
82
+ failed: Array<{
83
+ input: OnboardMerchantInput;
84
+ error: string;
85
+ }>;
86
+ }
87
+ /** Merchant info with on-chain and local data */
88
+ export interface MerchantInfo {
89
+ /** On-chain merchant ID */
90
+ merchantId: number;
91
+ /** Platform ID this merchant belongs to */
92
+ platformId: number;
93
+ /** Merchant wallet address */
94
+ wallet: PublicKey;
95
+ /** Whether the merchant is active */
96
+ active: boolean;
97
+ /** Display name (local only) */
98
+ name?: string;
99
+ /** Metadata (local only) */
100
+ metadata?: Record<string, string>;
101
+ }
102
+ /** Platform-wide statistics */
103
+ export interface PlatformStats {
104
+ /** Platform ID */
105
+ platformId: number;
106
+ /** Platform fee in basis points */
107
+ feeBps: number;
108
+ /** Platform fee as percentage string (e.g. "5.0%") */
109
+ feePercent: string;
110
+ /** Total merchants on the platform */
111
+ merchantCount: number;
112
+ /** Platform admin wallet */
113
+ adminWallet: PublicKey;
114
+ /** Platform payment wallet */
115
+ paymentWallet: PublicKey;
116
+ /** Whether the platform is active */
117
+ active: boolean;
118
+ /** Total payment links created (across all merchants tracked locally) */
119
+ totalLinks: number;
120
+ /** Total volume (USD) across tracked merchants */
121
+ totalVolume: number;
122
+ /** Estimated platform fee revenue */
123
+ feeRevenue: number;
124
+ /** Protocol fee (always 3%) */
125
+ protocolFeeBps: number;
126
+ }
127
+ export declare class RotatePlatformManager {
128
+ private sdk;
129
+ private platformId;
130
+ /** Local merchant directory (name + metadata). Persists only in memory. */
131
+ private merchantDirectory;
132
+ constructor(sdk: RotateSDK, config: PlatformManagerConfig);
133
+ /**
134
+ * Onboard a single merchant onto the platform.
135
+ *
136
+ * The platform admin's wallet signs the transaction and pays the account
137
+ * creation fee (~0.001 SOL). The merchant just needs a wallet address.
138
+ *
139
+ * @param input - Merchant wallet and optional name/metadata
140
+ * @returns The created merchant's ID, tx, and details
141
+ */
142
+ onboardMerchant(input: OnboardMerchantInput): Promise<OnboardMerchantResult>;
143
+ /**
144
+ * Bulk onboard multiple merchants in sequence.
145
+ *
146
+ * Each merchant gets its own transaction. If one fails, the rest continue.
147
+ * Returns both succeeded and failed results so the caller can handle retries.
148
+ *
149
+ * @param inputs - Array of merchant onboarding inputs
150
+ * @param options - Optional configuration
151
+ * @returns Succeeded and failed results
152
+ */
153
+ onboardMerchants(inputs: OnboardMerchantInput[], options?: {
154
+ /** Called after each merchant (for progress tracking) */
155
+ onProgress?: (completed: number, total: number, latest: OnboardMerchantResult | null) => void;
156
+ /** Stop on first failure */
157
+ stopOnError?: boolean;
158
+ }): Promise<BulkOnboardResult>;
159
+ /**
160
+ * Get on-chain info for a specific merchant.
161
+ */
162
+ getMerchant(merchantId: number): Promise<MerchantInfo | null>;
163
+ /**
164
+ * Fetch all merchants belonging to this platform.
165
+ *
166
+ * Uses `getProgramAccounts` with a `memcmp` filter on `platform_id`
167
+ * for efficient single-RPC retrieval instead of scanning every merchant
168
+ * PDA sequentially.
169
+ *
170
+ * @param options - Optional filters
171
+ * @returns Array of merchant info
172
+ */
173
+ getMerchants(options?: {
174
+ /** Only return active merchants */
175
+ activeOnly?: boolean;
176
+ /** Maximum number of merchants to return */
177
+ limit?: number;
178
+ }): Promise<MerchantInfo[]>;
179
+ /**
180
+ * Update the local directory entry for a merchant (name/metadata).
181
+ * Does NOT modify on-chain data.
182
+ */
183
+ setMerchantInfo(merchantId: number, info: {
184
+ name?: string;
185
+ metadata?: Record<string, string>;
186
+ }): void;
187
+ /**
188
+ * Get the on-chain platform account data.
189
+ */
190
+ getPlatform(): Promise<Platform | null>;
191
+ /**
192
+ * Update platform fee rate and/or active status.
193
+ * Only the platform admin wallet can call this.
194
+ *
195
+ * @param feeBps - New fee in basis points (0-600)
196
+ * @param active - Whether the platform is active
197
+ * @param newWallet - Optional new wallet for fee collection (defaults to current)
198
+ */
199
+ updatePlatform(feeBps: number, active?: boolean, newWallet?: PublicKey): Promise<string>;
200
+ /**
201
+ * Get platform-wide statistics.
202
+ *
203
+ * Uses `getProgramAccounts` for efficient merchant counting instead of
204
+ * scanning every merchant ID sequentially.
205
+ */
206
+ getStats(): Promise<PlatformStats>;
207
+ /**
208
+ * Generate a checkout URL for a merchant's payment link.
209
+ */
210
+ getCheckoutUrl(linkId: number): string;
211
+ /**
212
+ * Get the platform ID.
213
+ */
214
+ getPlatformId(): number;
215
+ /**
216
+ * Export the local merchant directory as JSON.
217
+ * Use this to persist merchant names/metadata to your database.
218
+ */
219
+ exportDirectory(): Array<{
220
+ merchantId: number;
221
+ name?: string;
222
+ metadata?: Record<string, string>;
223
+ }>;
224
+ /**
225
+ * Import a previously exported merchant directory.
226
+ */
227
+ importDirectory(entries: Array<{
228
+ merchantId: number;
229
+ name?: string;
230
+ metadata?: Record<string, string>;
231
+ }>): void;
232
+ }
233
+ export default RotatePlatformManager;
234
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,EAAE,EAEhB,QAAQ,EAGT,MAAM,SAAS,CAAC;AAIjB,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,MAAM,EAAE,SAAS,CAAC;IAClB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,sCAAsC;AACtC,MAAM,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M,CAAC,CAAA;KAAE,GAAG,IAAI;IAUrG;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAI7C;;;;;;;OAOG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,OAAc,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IAYpG;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,aAAa,CAAC;IAwBxC;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAItC;;OAEG;IACH,aAAa,IAAI,MAAM;IAMvB;;;OAGG;IACH,eAAe,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IAQlG;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,GAAG,IAAI;CAQhH;AAID,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ /**
3
+ * Rotate Platform Manager — Merchant Onboarding & Platform Administration
4
+ *
5
+ * A high-level SDK layer for platform operators to onboard merchants,
6
+ * manage their accounts, and monitor platform-wide activity.
7
+ *
8
+ * The platform admin wallet is the signer — merchants don't need to
9
+ * interact with the SDK directly. The platform creates merchant accounts
10
+ * on their behalf, and merchants just receive payments to their wallet.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { RotateSDK, RotatePlatformManager } from '@rotateprotocol/sdk';
15
+ *
16
+ * const sdk = new RotateSDK({ connection, wallet });
17
+ *
18
+ * // Create a platform first (one-time setup)
19
+ * const { platformId } = await sdk.createPlatform({ feeBps: 500, wallet: adminWallet });
20
+ *
21
+ * // Then use the manager for ongoing operations
22
+ * const platform = new RotatePlatformManager(sdk, { platformId });
23
+ *
24
+ * // Onboard a single merchant
25
+ * const merchant = await platform.onboardMerchant({
26
+ * wallet: new PublicKey('merchant-wallet-address'),
27
+ * name: 'Coffee Shop',
28
+ * });
29
+ * console.log(`Merchant created: #${merchant.merchantId}`);
30
+ *
31
+ * // Bulk onboard merchants
32
+ * const results = await platform.onboardMerchants([
33
+ * { wallet: walletA, name: 'Store A' },
34
+ * { wallet: walletB, name: 'Store B' },
35
+ * { wallet: walletC, name: 'Store C' },
36
+ * ]);
37
+ *
38
+ * // Get all merchants on the platform
39
+ * const merchants = await platform.getMerchants();
40
+ *
41
+ * // Get platform stats
42
+ * const stats = await platform.getStats();
43
+ * console.log(`Total merchants: ${stats.merchantCount}`);
44
+ * console.log(`Fee revenue: $${stats.feeRevenue.toFixed(2)}`);
45
+ * ```
46
+ *
47
+ * @packageDocumentation
48
+ */
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.RotatePlatformManager = void 0;
51
+ const index_1 = require("./index");
52
+ // ==================== PLATFORM MANAGER ====================
53
+ class RotatePlatformManager {
54
+ constructor(sdk, config) {
55
+ /** Local merchant directory (name + metadata). Persists only in memory. */
56
+ this.merchantDirectory = new Map();
57
+ this.sdk = sdk;
58
+ this.platformId = config.platformId;
59
+ }
60
+ // ==================== MERCHANT ONBOARDING ====================
61
+ /**
62
+ * Onboard a single merchant onto the platform.
63
+ *
64
+ * The platform admin's wallet signs the transaction and pays the account
65
+ * creation fee (~0.001 SOL). The merchant just needs a wallet address.
66
+ *
67
+ * @param input - Merchant wallet and optional name/metadata
68
+ * @returns The created merchant's ID, tx, and details
69
+ */
70
+ async onboardMerchant(input) {
71
+ const { tx, merchantId } = await this.sdk.createMerchant({
72
+ platformId: this.platformId,
73
+ wallet: input.wallet,
74
+ });
75
+ // Store local directory info
76
+ if (input.name || input.metadata) {
77
+ this.merchantDirectory.set(merchantId, {
78
+ name: input.name,
79
+ metadata: input.metadata,
80
+ });
81
+ }
82
+ return {
83
+ merchantId,
84
+ tx,
85
+ wallet: input.wallet,
86
+ name: input.name,
87
+ metadata: input.metadata,
88
+ };
89
+ }
90
+ /**
91
+ * Bulk onboard multiple merchants in sequence.
92
+ *
93
+ * Each merchant gets its own transaction. If one fails, the rest continue.
94
+ * Returns both succeeded and failed results so the caller can handle retries.
95
+ *
96
+ * @param inputs - Array of merchant onboarding inputs
97
+ * @param options - Optional configuration
98
+ * @returns Succeeded and failed results
99
+ */
100
+ async onboardMerchants(inputs, options) {
101
+ const succeeded = [];
102
+ const failed = [];
103
+ for (let i = 0; i < inputs.length; i++) {
104
+ try {
105
+ const result = await this.onboardMerchant(inputs[i]);
106
+ succeeded.push(result);
107
+ options?.onProgress?.(i + 1, inputs.length, result);
108
+ }
109
+ catch (err) {
110
+ const errorMsg = err?.message || String(err);
111
+ failed.push({ input: inputs[i], error: errorMsg });
112
+ options?.onProgress?.(i + 1, inputs.length, null);
113
+ if (options?.stopOnError)
114
+ break;
115
+ }
116
+ }
117
+ return { succeeded, failed };
118
+ }
119
+ // ==================== MERCHANT MANAGEMENT ====================
120
+ /**
121
+ * Get on-chain info for a specific merchant.
122
+ */
123
+ async getMerchant(merchantId) {
124
+ const merchant = await this.sdk.getMerchant(merchantId);
125
+ if (!merchant)
126
+ return null;
127
+ const local = this.merchantDirectory.get(merchantId);
128
+ return {
129
+ merchantId: merchant.id,
130
+ platformId: merchant.platformId,
131
+ wallet: merchant.wallet,
132
+ active: merchant.active,
133
+ name: local?.name,
134
+ metadata: local?.metadata,
135
+ };
136
+ }
137
+ /**
138
+ * Fetch all merchants belonging to this platform.
139
+ *
140
+ * Uses `getProgramAccounts` with a `memcmp` filter on `platform_id`
141
+ * for efficient single-RPC retrieval instead of scanning every merchant
142
+ * PDA sequentially.
143
+ *
144
+ * @param options - Optional filters
145
+ * @returns Array of merchant info
146
+ */
147
+ async getMerchants(options) {
148
+ const onChainMerchants = await this.sdk.getMerchantsByPlatform(this.platformId, options?.activeOnly ?? false);
149
+ let results = onChainMerchants.map((merchant) => {
150
+ const local = this.merchantDirectory.get(merchant.id);
151
+ return {
152
+ merchantId: merchant.id,
153
+ platformId: merchant.platformId,
154
+ wallet: merchant.wallet,
155
+ active: merchant.active,
156
+ name: local?.name,
157
+ metadata: local?.metadata,
158
+ };
159
+ });
160
+ if (options?.limit) {
161
+ results = results.slice(0, options.limit);
162
+ }
163
+ return results;
164
+ }
165
+ /**
166
+ * Update the local directory entry for a merchant (name/metadata).
167
+ * Does NOT modify on-chain data.
168
+ */
169
+ setMerchantInfo(merchantId, info) {
170
+ const existing = this.merchantDirectory.get(merchantId) || {};
171
+ this.merchantDirectory.set(merchantId, {
172
+ name: info.name ?? existing.name,
173
+ metadata: info.metadata ?? existing.metadata,
174
+ });
175
+ }
176
+ // ==================== PLATFORM INFO ====================
177
+ /**
178
+ * Get the on-chain platform account data.
179
+ */
180
+ async getPlatform() {
181
+ return this.sdk.getPlatform(this.platformId);
182
+ }
183
+ /**
184
+ * Update platform fee rate and/or active status.
185
+ * Only the platform admin wallet can call this.
186
+ *
187
+ * @param feeBps - New fee in basis points (0-600)
188
+ * @param active - Whether the platform is active
189
+ * @param newWallet - Optional new wallet for fee collection (defaults to current)
190
+ */
191
+ async updatePlatform(feeBps, active = true, newWallet) {
192
+ const platform = await this.getPlatform();
193
+ if (!platform)
194
+ throw new Error(`Platform #${this.platformId} not found`);
195
+ return this.sdk.updatePlatform({
196
+ platformId: this.platformId,
197
+ feeBps,
198
+ active,
199
+ newWallet: newWallet || platform.wallet,
200
+ });
201
+ }
202
+ /**
203
+ * Get platform-wide statistics.
204
+ *
205
+ * Uses `getProgramAccounts` for efficient merchant counting instead of
206
+ * scanning every merchant ID sequentially.
207
+ */
208
+ async getStats() {
209
+ const platform = await this.getPlatform();
210
+ if (!platform)
211
+ throw new Error(`Platform #${this.platformId} not found`);
212
+ // Single RPC call to get all merchants on this platform
213
+ const merchants = await this.sdk.getMerchantsByPlatform(this.platformId);
214
+ return {
215
+ platformId: this.platformId,
216
+ feeBps: platform.feeBps,
217
+ feePercent: (platform.feeBps / 100).toFixed(1) + '%',
218
+ merchantCount: merchants.length,
219
+ adminWallet: platform.admin,
220
+ paymentWallet: platform.wallet,
221
+ active: platform.active,
222
+ totalLinks: 0, // Would require scanning all links; 0 as placeholder
223
+ totalVolume: 0,
224
+ feeRevenue: 0,
225
+ protocolFeeBps: index_1.PROTOCOL_FEE_BPS,
226
+ };
227
+ }
228
+ // ==================== CONVENIENCE METHODS ====================
229
+ /**
230
+ * Generate a checkout URL for a merchant's payment link.
231
+ */
232
+ getCheckoutUrl(linkId) {
233
+ return this.sdk.getPaymentUrl(linkId);
234
+ }
235
+ /**
236
+ * Get the platform ID.
237
+ */
238
+ getPlatformId() {
239
+ return this.platformId;
240
+ }
241
+ // ==================== DIRECTORY PERSISTENCE ====================
242
+ /**
243
+ * Export the local merchant directory as JSON.
244
+ * Use this to persist merchant names/metadata to your database.
245
+ */
246
+ exportDirectory() {
247
+ const entries = [];
248
+ for (const [merchantId, info] of this.merchantDirectory) {
249
+ entries.push({ merchantId, ...info });
250
+ }
251
+ return entries;
252
+ }
253
+ /**
254
+ * Import a previously exported merchant directory.
255
+ */
256
+ importDirectory(entries) {
257
+ for (const entry of entries) {
258
+ this.merchantDirectory.set(entry.merchantId, {
259
+ name: entry.name,
260
+ metadata: entry.metadata,
261
+ });
262
+ }
263
+ }
264
+ }
265
+ exports.RotatePlatformManager = RotatePlatformManager;
266
+ // ==================== EXPORTS ====================
267
+ exports.default = RotatePlatformManager;
268
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;;;AAGH,mCAKi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ACb,cAAc,EAAE,wBAAgB;SACjC,CAAC;IACJ,CAAC;IAED,gEAAgE;IAEhE;;OAEG;IACH,cAAc,CAAC,MAAc;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,kEAAkE;IAElE;;;OAGG;IACH,eAAe;QACb,MAAM,OAAO,GAAoF,EAAE,CAAC;QACpG,KAAK,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACxD,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,OAAwF;QACtG,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE;gBAC3C,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;aACzB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA/PD,sDA+PC;AAED,oDAAoD;AAEpD,kBAAe,qBAAqB,CAAC"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Rotate Protocol React Hooks
3
+ *
4
+ * React hooks for easy integration with Solana wallet adapters.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ import { PublicKey } from '@solana/web3.js';
9
+ import RotateSDK, { PaymentLink, Platform, Merchant, Protocol, calculateFees, generateSampleId, isValidId, getLinkDescription, MEMO_PROGRAM_ID, Network, MIN_RANDOM_ID, MAX_RANDOM_ID } from './index';
10
+ export interface UseRotateOptions {
11
+ network?: Network;
12
+ rpcEndpoint?: string;
13
+ }
14
+ export interface PaymentStatus {
15
+ linkId: number;
16
+ status: PaymentLink['status'];
17
+ amountPaid: bigint;
18
+ amountTotal: bigint;
19
+ isPaid: boolean;
20
+ isExpired: boolean;
21
+ }
22
+ /**
23
+ * Main hook for Rotate Protocol
24
+ */
25
+ export declare function useRotate(options?: UseRotateOptions): {
26
+ sdk: RotateSDK;
27
+ protocol: Protocol | null;
28
+ loading: boolean;
29
+ error: string | null;
30
+ connected: boolean;
31
+ publicKey: PublicKey | null;
32
+ signTransaction: (<T extends import("@solana/web3.js").Transaction | import("@solana/web3.js").VersionedTransaction>(transaction: T) => Promise<T>) | undefined;
33
+ };
34
+ /**
35
+ * Hook for working with a specific payment link
36
+ */
37
+ export declare function usePaymentLink(linkId: number, options?: UseRotateOptions): {
38
+ link: PaymentLink | null;
39
+ status: PaymentStatus | null;
40
+ loading: boolean;
41
+ error: string | null;
42
+ refresh: () => Promise<void>;
43
+ startPolling: (intervalMs?: number) => void;
44
+ stopPolling: () => void;
45
+ isPolling: boolean;
46
+ paymentUrl: string;
47
+ };
48
+ /**
49
+ * Hook for merchant operations
50
+ */
51
+ export declare function useMerchant(merchantId: number, options?: UseRotateOptions): {
52
+ merchant: Merchant | null;
53
+ platform: Platform | null;
54
+ loading: boolean;
55
+ error: string | null;
56
+ getFees: (amountUsd: number) => {
57
+ amount: number;
58
+ protocolFee: number;
59
+ platformFee: number;
60
+ totalFees: number;
61
+ buyerFeeShare: number;
62
+ sellerFeeShare: number;
63
+ buyerPays: number;
64
+ merchantReceives: number;
65
+ };
66
+ };
67
+ /**
68
+ * Hook for SOL price.
69
+ * `priceApiUrl` can be overridden to use a custom price feed (default: CoinGecko).
70
+ */
71
+ export declare function useSolPrice(refreshIntervalMs?: number, priceApiUrl?: string): {
72
+ price: number | null;
73
+ loading: boolean;
74
+ refresh: () => Promise<void>;
75
+ usdToSol: (usd: number) => number | null;
76
+ solToUsd: (sol: number) => number | null;
77
+ };
78
+ /**
79
+ * Hook for token balances
80
+ */
81
+ export declare function useTokenBalances(options?: UseRotateOptions): {
82
+ balances: {
83
+ sol: number;
84
+ usdc: number;
85
+ usdt: number;
86
+ };
87
+ loading: boolean;
88
+ refresh: () => Promise<void>;
89
+ hasEnough: (amount: number, currency: "SOL" | "USDC" | "USDT") => boolean;
90
+ };
91
+ /**
92
+ * Complete payment flow hook
93
+ */
94
+ export declare function usePaymentFlow(linkId: number, options?: UseRotateOptions): {
95
+ link: PaymentLink | null;
96
+ status: PaymentStatus | null;
97
+ connected: boolean;
98
+ publicKey: PublicKey | null;
99
+ selectedCurrency: "SOL" | "USDC" | "USDT";
100
+ setSelectedCurrency: import("react").Dispatch<import("react").SetStateAction<"SOL" | "USDC" | "USDT">>;
101
+ amountInCurrency: number | null;
102
+ canPay: boolean;
103
+ paying: boolean;
104
+ paymentError: string | null;
105
+ refresh: () => Promise<void>;
106
+ startPolling: (intervalMs?: number) => void;
107
+ stopPolling: () => void;
108
+ balances: {
109
+ sol: number;
110
+ usdc: number;
111
+ usdt: number;
112
+ };
113
+ solPrice: number | null;
114
+ };
115
+ /**
116
+ * Hook for creating platforms and merchants with random IDs
117
+ */
118
+ export declare function useCreateEntities(options?: UseRotateOptions): {
119
+ createPlatform: (feeBps: number, wallet: PublicKey) => Promise<{
120
+ tx: string;
121
+ platformId: number;
122
+ }>;
123
+ createMerchant: (platformId: number, wallet: PublicKey) => Promise<{
124
+ tx: string;
125
+ merchantId: number;
126
+ }>;
127
+ creating: boolean;
128
+ error: string | null;
129
+ generateSampleId: typeof generateSampleId;
130
+ isValidId: typeof isValidId;
131
+ MIN_RANDOM_ID: number;
132
+ MAX_RANDOM_ID: number;
133
+ };
134
+ export { useProducts, useCart, useMarketplace, useMarketplaceCart } from './hooks';
135
+ export type { UseProductsReturn, UseCartReturn, UseMarketplaceReturn, UseMarketplaceCartReturn } from './hooks';
136
+ export { RotateSDK, calculateFees, generateSampleId, isValidId, getLinkDescription, MEMO_PROGRAM_ID, MIN_RANDOM_ID, MAX_RANDOM_ID, };
137
+ export { RotateStore, RotateCart } from './store';
138
+ export { RotateMarketplace, MarketplaceCart } from './marketplace';
139
+ export { RotatePlatformManager } from './platform';
140
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,EAAE,EAChB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,OAAO,EACP,aAAa,EACb,aAAa,EACd,MAAM,SAAS,CAAC;AAIjB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACpB;AAID;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB;;;;;;;;EAuCvD;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;;;;;;gCA4B7B,MAAM;;;;EAqCrD;AAID;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;;;;;yBA2BpC,MAAM;;;;;;;;;;EAW/C;AAID;;;GAGG;AACH,wBAAgB,WAAW,CACzB,iBAAiB,GAAE,MAAc,EACjC,WAAW,GAAE,MAAqF;;;;oBAuB/D,MAAM;oBAKN,MAAM;EAY1C;AAID;;GAEG;AACH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