@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 +2 -1
- package/dist/onboarding/wizard.js +4 -3
- package/dist/wallet/index.d.ts +1 -1
- package/dist/wallet/index.js +1 -1
- package/dist/wallet/lightning.d.ts +18 -4
- package/dist/wallet/lightning.js +29 -8
- package/dist/wallet/wizard.js +5 -3
- package/package.json +1 -1
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
|
|
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(' 💰
|
|
252
|
-
this.print(' 💰
|
|
253
|
-
this.print(' 💰
|
|
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');
|
package/dist/wallet/index.d.ts
CHANGED
|
@@ -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,
|
|
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';
|
package/dist/wallet/index.js
CHANGED
|
@@ -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,
|
|
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
|
|
42
|
-
export declare const
|
|
43
|
-
|
|
44
|
-
|
|
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;
|
package/dist/wallet/lightning.js
CHANGED
|
@@ -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
|
|
229
|
-
|
|
230
|
-
export const
|
|
231
|
-
export
|
|
232
|
-
|
|
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
|
-
|
|
235
|
-
|
|
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
|
package/dist/wallet/wizard.js
CHANGED
|
@@ -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(' 💰
|
|
375
|
-
this.print(' 💰
|
|
376
|
-
this.print(' 💰
|
|
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
|
}
|