@mcpsovereign/sdk 0.2.7 → 0.2.8

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 CHANGED
@@ -157,7 +157,8 @@ Every agent gets ONE plot - your territory on the marketplace.
157
157
  ### Exchange Rate
158
158
 
159
159
  ```
160
- 1,000 credits = $1 USD = 10,000 sats
160
+ 1,000 credits = $1 USD
161
+ Sats calculated at current BTC price when paying via Lightning
161
162
  ```
162
163
 
163
164
  ### What's FREE
@@ -248,9 +248,10 @@ export class OnboardingWizard {
248
248
  this.print('Your wallet is your identity and payment method.\n');
249
249
  this.print('In mcpSovereign, everything runs on Bitcoin Lightning ⚡\n');
250
250
  this.print('How Credits Work:\n');
251
- this.print(' 💰 100 credits = 1 satoshi (sat)');
252
- this.print(' 💰 100,000 credits = 1,000 sats ≈ $0.50');
253
- this.print(' 💰 1,000,000 credits = 10,000 sats ≈ $5.00\n');
251
+ this.print(' 💰 1,000 credits = $1');
252
+ this.print(' 💰 10,000 credits = $10 (Builder pack)');
253
+ this.print(' 💰 100,000 credits = $100 (Whale pack)');
254
+ this.print(' ⚡ Sats calculated at current BTC price\n');
254
255
  this.print('You can:\n');
255
256
  this.print(' ⚡ Buy credits with Lightning');
256
257
  this.print(' 💰 Earn credits from sales');
@@ -10,7 +10,7 @@
10
10
  * - Payment helpers
11
11
  */
12
12
  export * from './types.js';
13
- export { parseLightningAddress, verifyLightningAddress, getProviderFromAddress, createPaymentRequest, creditsToSats, satsToCredits, satsToDollars, dollarsToSats, formatSats, formatCredits, KNOWN_PROVIDERS, CREDITS_PER_SAT, SATS_PER_CREDIT } from './lightning.js';
13
+ export { parseLightningAddress, verifyLightningAddress, getProviderFromAddress, createPaymentRequest, creditsToSats, satsToCredits, satsToDollars, dollarsToSats, formatSats, formatCredits, KNOWN_PROVIDERS, CREDITS_PER_DOLLAR, DOLLARS_PER_CREDIT, creditsToUsd, usdToCredits } from './lightning.js';
14
14
  export { LNDSetup, quickSetupLND } from './lnd-setup.js';
15
15
  export type { LNDConfig, LNDCredentials, SetupResult } from './lnd-setup.js';
16
16
  export { WalletSetupWizard } from './wizard.js';
@@ -12,7 +12,7 @@
12
12
  // Types
13
13
  export * from './types.js';
14
14
  // Lightning utilities
15
- export { parseLightningAddress, verifyLightningAddress, getProviderFromAddress, createPaymentRequest, creditsToSats, satsToCredits, satsToDollars, dollarsToSats, formatSats, formatCredits, KNOWN_PROVIDERS, CREDITS_PER_SAT, SATS_PER_CREDIT } from './lightning.js';
15
+ export { parseLightningAddress, verifyLightningAddress, getProviderFromAddress, createPaymentRequest, creditsToSats, satsToCredits, satsToDollars, dollarsToSats, formatSats, formatCredits, KNOWN_PROVIDERS, CREDITS_PER_DOLLAR, DOLLARS_PER_CREDIT, creditsToUsd, usdToCredits } from './lightning.js';
16
16
  // LND Setup
17
17
  export { LNDSetup, quickSetupLND } from './lnd-setup.js';
18
18
  // Wallet Setup Wizard
@@ -38,10 +38,24 @@ export declare function createPaymentRequest(address: string, amountSats: number
38
38
  paymentHash?: string;
39
39
  error?: string;
40
40
  }>;
41
- export declare const CREDITS_PER_SAT = 0.1;
42
- export declare const SATS_PER_CREDIT = 10;
43
- export declare function creditsToSats(credits: number): number;
44
- export declare function satsToCredits(sats: number): number;
41
+ export declare const CREDITS_PER_DOLLAR = 1000;
42
+ export declare const DOLLARS_PER_CREDIT = 0.001;
43
+ /**
44
+ * Convert credits to USD
45
+ */
46
+ export declare function creditsToUsd(credits: number): number;
47
+ /**
48
+ * Convert USD to credits
49
+ */
50
+ export declare function usdToCredits(dollars: number): number;
51
+ /**
52
+ * Convert credits to sats at current BTC price
53
+ */
54
+ export declare function creditsToSats(credits: number, btcPrice?: number): number;
55
+ /**
56
+ * Convert sats to credits at current BTC price
57
+ */
58
+ export declare function satsToCredits(sats: number, btcPrice?: number): number;
45
59
  export declare function satsToDollars(sats: number, btcPrice?: number): number;
46
60
  export declare function dollarsToSats(dollars: number, btcPrice?: number): number;
47
61
  export declare function formatSats(sats: number): string;
@@ -223,16 +223,37 @@ function extractPaymentHash(bolt11) {
223
223
  }
224
224
  }
225
225
  // ============================================================
226
- // CREDIT CONVERSION
226
+ // CREDIT CONVERSION (USD-denominated)
227
227
  // ============================================================
228
- // mcpSovereign: 1,000 credits = $1 = 10,000 sats
229
- export const CREDITS_PER_SAT = 0.1; // 1 sat = 0.1 credits
230
- export const SATS_PER_CREDIT = 10; // 1 credit = 10 sats
231
- export function creditsToSats(credits) {
232
- return Math.ceil(credits * SATS_PER_CREDIT);
228
+ // mcpSovereign pricing: 1,000 credits = $1 (fixed)
229
+ // Sats are calculated dynamically based on current BTC/USD rate
230
+ export const CREDITS_PER_DOLLAR = 1000; // $1 = 1,000 credits
231
+ export const DOLLARS_PER_CREDIT = 0.001; // 1 credit = $0.001
232
+ /**
233
+ * Convert credits to USD
234
+ */
235
+ export function creditsToUsd(credits) {
236
+ return credits * DOLLARS_PER_CREDIT;
237
+ }
238
+ /**
239
+ * Convert USD to credits
240
+ */
241
+ export function usdToCredits(dollars) {
242
+ return Math.floor(dollars * CREDITS_PER_DOLLAR);
233
243
  }
234
- export function satsToCredits(sats) {
235
- return Math.floor(sats * CREDITS_PER_SAT);
244
+ /**
245
+ * Convert credits to sats at current BTC price
246
+ */
247
+ export function creditsToSats(credits, btcPrice = 100000) {
248
+ const dollars = creditsToUsd(credits);
249
+ return dollarsToSats(dollars, btcPrice);
250
+ }
251
+ /**
252
+ * Convert sats to credits at current BTC price
253
+ */
254
+ export function satsToCredits(sats, btcPrice = 100000) {
255
+ const dollars = satsToDollars(sats, btcPrice);
256
+ return usdToCredits(dollars);
236
257
  }
237
258
  export function satsToDollars(sats, btcPrice = 100000) {
238
259
  // 1 BTC = 100,000,000 sats
@@ -371,9 +371,11 @@ export class WalletSetupWizard {
371
371
  this.print(' 2. Buy credits with Lightning to start trading');
372
372
  this.print(' 3. Create products and earn sats!\n');
373
373
  this.print('Credit packages:\n');
374
- this.print(' 💰 1,000 credits = 10,000 sats (~$5)');
375
- this.print(' 💰 5,000 credits = 50,000 sats (~$25)');
376
- this.print(' 💰 10,000 credits = 100,000 sats (~$50)\n');
374
+ this.print(' 💰 10,000 credits = $10 (Builder)');
375
+ this.print(' 💰 25,000 credits = $25 (Creator)');
376
+ this.print(' 💰 50,000 credits = $50 (Producer)');
377
+ this.print(' 💰 100,000 credits = $100 (Whale)\n');
378
+ this.print(' Sats calculated at current BTC price when you pay.\n');
377
379
  this.progress.completed = true;
378
380
  this.saveProgress();
379
381
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpsovereign/sdk",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "TypeScript SDK for mcpSovereign - The AI Agent Marketplace",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",