@ramp-kit/mcp 0.1.1 → 0.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,MAAM,uGAOT,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5C,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CA2LtC,CAAC"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,MAAM,uGAOT,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5C,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAkNtC,CAAC"}
package/dist/docs.js CHANGED
@@ -64,7 +64,8 @@ const provider = new EtherfuseProvider({ apiKey, environment: "sandbox" });
64
64
  const org = await provider.getOrganization(); // customerId
65
65
  const accounts = await provider.listBankAccounts(); // pick compliant one
66
66
  provider.setBankAccount(accounts.find(a => a.compliant)!.bankAccountId);
67
- await provider.registerWallet(walletAddress, "stellar"); // one-time, required
67
+ // Wallet registration is automatic since 0.1.3: createOrder self-heals
68
+ // "Wallet not found" by registering (idempotent) and retrying once.
68
69
 
69
70
  const assets = await provider.listAssets("stellar", { currency: "brl" });
70
71
  const quote = await provider.getQuote({ direction: "onramp",
@@ -76,16 +77,36 @@ await provider.simulateFiatReceived(order.id); // sandbox only
76
77
  // poll provider.getOrder(order.id) until "settled"
77
78
  \`\`\`
78
79
 
80
+ ## Offramp (crypto → fiat, "BRL out")
81
+ \`\`\`ts
82
+ const quote = await provider.getQuote({ direction: 'offramp',
83
+ fiatCurrency: 'BRL', assetIdentifier: usdc.identifier,
84
+ network: 'stellar', sourceAmount: '5',
85
+ customerId: org.id, walletAddress });
86
+ const order = await provider.createOrder(quote);
87
+ // order.unsignedTx appears async → status awaiting_signature; sign it:
88
+ await signAndSubmit(order.unsignedTx, walletSigner, stellarConfigFor('sandbox'));
89
+ // tx_too_late → provider.regenerateTx(order.id) and retry
90
+ \`\`\`
91
+
79
92
  ## React widget
80
93
  \`\`\`tsx
81
94
  import { RampWidget } from "@ramp-kit/react";
95
+ // Buy flow:
82
96
  <RampWidget provider={provider} customerId={org.id} fiatCurrency="BRL"
83
97
  network="stellar" walletAddress={wallet} assets={assets} />
98
+ // Sell flow adds: direction="offramp", signer={walletSignCallback},
99
+ // stellarConfig={stellarConfigFor(env)} — includes in-widget Sign & send
100
+ // with automatic tx regeneration, and Stellar Expert proof links.
84
101
  \`\`\`
85
102
 
103
+ Wallet UX pattern (see apps/demo): connect the user's wallet via Freighter
104
+ (@stellar/freighter-api) — request access, verify network matches, sign via
105
+ extension. Never collect secret keys in app UIs.
106
+
86
107
  Key rules: quotes expire (Etherfuse: 2 min) — check \`expiresAt\`; never
87
- hardcode asset identifiers — always discover via listAssets(); wallets must
88
- be registered before their first order.`,
108
+ hardcode asset identifiers — always discover via listAssets(); wallet
109
+ registration is automatic on first order (self-heal + retry in the SDK).`,
89
110
  "sandbox-setup": `# Etherfuse sandbox setup (one time, ~10 minutes)
90
111
 
91
112
  1. Create an account at https://sandbox.etherfuse.com
@@ -171,8 +192,10 @@ new EtherfuseProvider({ apiKey: "", baseUrl: "https://api.myapp.com/etherfuse" }
171
192
  troubleshooting: `# Troubleshooting (verified against the real sandbox)
172
193
 
173
194
  - "Wallet not found or not authorized" on POST /ramp/order → the wallet was
174
- never registered. Call provider.registerWallet(publicKey, "stellar")
175
- (claimOwnership=true lets a KYB-approved org skip per-wallet KYC).
195
+ never registered. @ramp-kit/core ≥0.1.3 self-heals this automatically
196
+ (registers + retries once); on older versions or raw HTTP, call
197
+ provider.registerWallet(publicKey, "stellar") (claimOwnership=true lets a
198
+ KYB-approved org skip per-wallet KYC).
176
199
  - "Bank account is not compliant with KYC requirements" → the selected bank
177
200
  account's compliant flag is false. MXN accounts registered via API await
178
201
  async approval; dashboard-created BRL/PIX accounts are compliant
package/dist/docs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,UAAU;IACV,YAAY;IACZ,eAAe;IACf,cAAc;IACd,YAAY;IACZ,iBAAiB;CACT,CAAC;AAIX,MAAM,CAAC,MAAM,IAAI,GAA0B;IACzC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDA4BoC;IAE9C,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCA6C0B;IAEtC,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;qCAuBkB;IAEnC,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDA4ByC;IAEvD,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFA4BoE;IAEhF,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;yEAuBsD;CACxE,CAAC"}
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,UAAU;IACV,YAAY;IACZ,eAAe;IACf,cAAc;IACd,YAAY;IACZ,iBAAiB;CACT,CAAC;AAIX,MAAM,CAAC,MAAM,IAAI,GAA0B;IACzC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDA4BoC;IAE9C,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEAkE2D;IAEvE,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;qCAuBkB;IAEnC,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDA4ByC;IAEvD,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFA4BoE;IAEhF,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;yEAyBsD;CACxE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramp-kit/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server for the LATAM Ramp Kit: lets AI agents explore providers, fetch live ramp quotes, create sandbox orders, simulate PIX/SPEI deposits and inspect Stellar wallets — plus built-in documentation tools covering usage, architecture and the path to production",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@modelcontextprotocol/sdk": "^1.12.0",
18
18
  "zod": "^3.23.0",
19
- "@ramp-kit/core": "0.1.2"
19
+ "@ramp-kit/core": "0.1.3"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/node": "^22.0.0",