@cosmosapp/pay_sdk 2.1.0 → 2.2.1
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/CHANGELOG.md +19 -0
- package/README.md +12 -2
- package/dist/{chunk-NK5EHEKJ.js → chunk-OVFDKC5Z.js} +3 -3
- package/dist/{chunk-NK5EHEKJ.js.map → chunk-OVFDKC5Z.js.map} +1 -1
- package/dist/{cosmosProvider-CFASjnd5.d.cts → cosmosProvider-DTz0Y8xZ.d.cts} +2 -1
- package/dist/{cosmosProvider-CFASjnd5.d.ts → cosmosProvider-DTz0Y8xZ.d.ts} +2 -1
- package/dist/index.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/{intent-input-8rZfCrQ0.d.cts → intent-input-GiCgpAWR.d.cts} +24 -6
- package/dist/{intent-input-8rZfCrQ0.d.ts → intent-input-GiCgpAWR.d.ts} +24 -6
- package/dist/swk/index.d.cts +4 -3
- package/dist/swk/index.d.ts +4 -3
- package/dist/web/index.cjs +1 -1
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +7 -5
- package/dist/web/index.d.ts +7 -5
- package/dist/web/index.js +2 -2
- package/llms/05-payment-intents.md +19 -6
- package/llms/llms-full.txt +19 -6
- package/package.json +19 -12
package/dist/web/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { c0 as WalletId, aB as PaymentIntentData } from '../intent-input-GiCgpAWR.cjs';
|
|
2
|
+
import { CreatePayPaymentIntentOptions, CreateTxPaymentIntentOptions, ValidationOutcomeData } from '../index.cjs';
|
|
3
|
+
export { bh as AddressBook, bi as AddressRef, bp as AssetDefinition, bq as AssetRef, br as Assets, bx as CosmosPayAPIError, by as CosmosPayRequestError, bX as ResolvableIntentInput, bY as ResolvedAsset, b$ as TestnetAssets, c1 as Wallets, c4 as addresses, c5 as assertAddress, c6 as defineAsset, c7 as isAddress, c8 as isContractAddress, c9 as isMuxedAddress, ca as isNativeAsset, cb as isStellarAddress, cc as resolveAddress, cd as resolveAsset, ce as resolveIntentBody } from '../intent-input-GiCgpAWR.cjs';
|
|
4
|
+
import { C as CosmosProviderOptions, a as CosmosWalletProvider } from '../cosmosProvider-DTz0Y8xZ.cjs';
|
|
5
|
+
export { i as injectedProvider, l as loadHostedProvider, r as resetProviderCache, b as resolveProvider } from '../cosmosProvider-DTz0Y8xZ.cjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Types for the browser ("web client") side of the SDK.
|
|
@@ -800,4 +801,5 @@ declare class WebREST {
|
|
|
800
801
|
request<T>(method: string, path: string, options?: WebRequestOptions): Promise<T>;
|
|
801
802
|
}
|
|
802
803
|
|
|
803
|
-
export { AlbedoAdapter,
|
|
804
|
+
export { AlbedoAdapter, CosmosPayWebError, CosmosProviderOptions, CosmosWalletAdapter, CosmosWalletProvider, FreighterAdapter, HORIZON_URLS, IntentError, LobstrAdapter, PASSPHRASES, PaymentIntentData, RabetAdapter, StellarSdkRequiredError, WalletError, WalletId, WalletNotFoundError, WalletRegistry, WebClient, WebREST, XBullAdapter, buildPaymentXdr, classifyNetwork, defaultAdapters, isPassphrase, isSep7Uri, loadStellarSdk, normalizeIntent, parseSep7, postToCallback, resolveNetwork, submitToHorizon, transactionHash };
|
|
805
|
+
export type { BuildPaymentInput, ConnectResult, InjectedWallets, NetworkConfig, NormalizedIntent, PayOptions, PayResult, PayableInput, ResolveNetworkInput, Sep7Request, SignParams, StellarNetwork, StellarSdkLike, WalletAdapter, WalletInfo, WebClientOptions, WebRESTOptions, WebRequestOptions };
|
package/dist/web/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { c0 as WalletId, aB as PaymentIntentData } from '../intent-input-GiCgpAWR.js';
|
|
2
|
+
import { CreatePayPaymentIntentOptions, CreateTxPaymentIntentOptions, ValidationOutcomeData } from '../index.js';
|
|
3
|
+
export { bh as AddressBook, bi as AddressRef, bp as AssetDefinition, bq as AssetRef, br as Assets, bx as CosmosPayAPIError, by as CosmosPayRequestError, bX as ResolvableIntentInput, bY as ResolvedAsset, b$ as TestnetAssets, c1 as Wallets, c4 as addresses, c5 as assertAddress, c6 as defineAsset, c7 as isAddress, c8 as isContractAddress, c9 as isMuxedAddress, ca as isNativeAsset, cb as isStellarAddress, cc as resolveAddress, cd as resolveAsset, ce as resolveIntentBody } from '../intent-input-GiCgpAWR.js';
|
|
4
|
+
import { C as CosmosProviderOptions, a as CosmosWalletProvider } from '../cosmosProvider-DTz0Y8xZ.js';
|
|
5
|
+
export { i as injectedProvider, l as loadHostedProvider, r as resetProviderCache, b as resolveProvider } from '../cosmosProvider-DTz0Y8xZ.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Types for the browser ("web client") side of the SDK.
|
|
@@ -800,4 +801,5 @@ declare class WebREST {
|
|
|
800
801
|
request<T>(method: string, path: string, options?: WebRequestOptions): Promise<T>;
|
|
801
802
|
}
|
|
802
803
|
|
|
803
|
-
export { AlbedoAdapter,
|
|
804
|
+
export { AlbedoAdapter, CosmosPayWebError, CosmosProviderOptions, CosmosWalletAdapter, CosmosWalletProvider, FreighterAdapter, HORIZON_URLS, IntentError, LobstrAdapter, PASSPHRASES, PaymentIntentData, RabetAdapter, StellarSdkRequiredError, WalletError, WalletId, WalletNotFoundError, WalletRegistry, WebClient, WebREST, XBullAdapter, buildPaymentXdr, classifyNetwork, defaultAdapters, isPassphrase, isSep7Uri, loadStellarSdk, normalizeIntent, parseSep7, postToCallback, resolveNetwork, submitToHorizon, transactionHash };
|
|
805
|
+
export type { BuildPaymentInput, ConnectResult, InjectedWallets, NetworkConfig, NormalizedIntent, PayOptions, PayResult, PayableInput, ResolveNetworkInput, Sep7Request, SignParams, StellarNetwork, StellarSdkLike, WalletAdapter, WalletInfo, WebClientOptions, WebRESTOptions, WebRequestOptions };
|
package/dist/web/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { version, CosmosPayAPIError, CosmosPayRequestError, DEFAULT_BASE_URL, resolveIntentBody } from '../chunk-
|
|
2
|
-
export { AddressBook, Assets, CosmosPayAPIError, CosmosPayRequestError, TestnetAssets, Wallets, addresses, assertAddress, defineAsset, isAddress, isContractAddress, isMuxedAddress, isNativeAsset, isStellarAddress, resolveAddress, resolveAsset, resolveIntentBody } from '../chunk-
|
|
1
|
+
import { version, CosmosPayAPIError, CosmosPayRequestError, DEFAULT_BASE_URL, resolveIntentBody } from '../chunk-OVFDKC5Z.js';
|
|
2
|
+
export { AddressBook, Assets, CosmosPayAPIError, CosmosPayRequestError, TestnetAssets, Wallets, addresses, assertAddress, defineAsset, isAddress, isContractAddress, isMuxedAddress, isNativeAsset, isStellarAddress, resolveAddress, resolveAsset, resolveIntentBody } from '../chunk-OVFDKC5Z.js';
|
|
3
3
|
import { injectedProvider, resolveProvider } from '../chunk-AYVWYEOK.js';
|
|
4
4
|
export { injectedProvider, loadHostedProvider, resetProviderCache, resolveProvider } from '../chunk-AYVWYEOK.js';
|
|
5
5
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# Payment intents
|
|
2
2
|
|
|
3
|
-
`client.paymentIntents` — Stellar
|
|
3
|
+
`client.paymentIntents` — payment intents on Stellar, Solana and Monad. Two kinds:
|
|
4
4
|
|
|
5
5
|
- **`pay` intent** — no source. The payer's wallet picks the source account.
|
|
6
|
-
Produces a `web+stellar:pay?...`
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Produces a payment link + QR (no XDR): `web+stellar:pay?...` on Stellar (the default),
|
|
7
|
+
a Solana Pay link with `chain: 'solana'`, an EIP-681 link with `chain: 'monad'`.
|
|
8
|
+
- **`tx` intent** — source known (Stellar only). Produces an unsigned XDR +
|
|
9
|
+
`web+stellar:tx?...` URI + QR.
|
|
9
10
|
|
|
10
11
|
## Create
|
|
11
12
|
|
|
@@ -28,6 +29,16 @@ const pay = await client.paymentIntents.createPay({
|
|
|
28
29
|
callback: 'url:https://...', // optional SEP-7 callback for the signed XDR
|
|
29
30
|
});
|
|
30
31
|
|
|
32
|
+
// pay on Solana or Monad: name the chain; the destination is an address on that chain
|
|
33
|
+
const sol = await client.paymentIntents.createPay({
|
|
34
|
+
chain: 'solana', // 'stellar' (default) | 'solana' | 'monad'
|
|
35
|
+
destination: '7xKX...', // Solana address (Monad: 0x...)
|
|
36
|
+
amount: '25', // required on Monad
|
|
37
|
+
assetCode: 'USDC', // a token by code + issuer (SPL mint / ERC-20 contract)
|
|
38
|
+
assetIssuer: 'EPjF...Dt1v',
|
|
39
|
+
});
|
|
40
|
+
console.log(sol.chain, sol.uri); // 'solana', 'solana:...'
|
|
41
|
+
|
|
31
42
|
// tx (source known)
|
|
32
43
|
const tx = await client.paymentIntents.createTx({
|
|
33
44
|
source: 'G...PAYER', // required (extra vs pay)
|
|
@@ -47,6 +58,8 @@ const intent = await client.paymentIntents.fetch('pi_123');
|
|
|
47
58
|
|
|
48
59
|
const page = await client.paymentIntents.list({
|
|
49
60
|
status: 'SUCCEEDED', // optional filter (PaymentIntentStatus)
|
|
61
|
+
chain: 'solana', // optional: 'stellar' | 'solana' | 'monad'
|
|
62
|
+
createdFrom: new Date('2026-11-01'), // optional: created at or after (Date or ISO 8601)
|
|
50
63
|
take: 50, // page size, max 100, default 20
|
|
51
64
|
skip: 0, // offset
|
|
52
65
|
});
|
|
@@ -76,8 +89,8 @@ server-side, and fires the webhook.
|
|
|
76
89
|
|
|
77
90
|
## Structure accessors (on a `PaymentIntent`)
|
|
78
91
|
|
|
79
|
-
`id`, `kind`, `status`, `network`, `source`, `destination`, `amount`, `asset`,
|
|
92
|
+
`id`, `kind`, `status`, `chain`, `network`, `source`, `destination`, `amount`, `asset`,
|
|
80
93
|
`assetIssuer`, `memo`, `msg`, `callback`, `xdr`, `uri`, `qr`, `txHash`,
|
|
81
94
|
`reference`, `createdAt`, `updatedAt`. Helpers: `isTx`, `isPay`, `isSucceeded`,
|
|
82
|
-
`isPending`, `assetLabel` (`'XLM'`
|
|
95
|
+
`isPending`, `assetLabel` (the chain's coin for native: `'XLM'`, `'SOL'` or `'MON'`). Methods: `fetch()`, `edit()`,
|
|
83
96
|
`validate(txHash)`, `cancel()`, `delete()`, `toJSON()`.
|
package/llms/llms-full.txt
CHANGED
|
@@ -260,12 +260,13 @@ e.g. `intent.isPay`, `intent.assetLabel`, `await intent.validate(txHash)`,
|
|
|
260
260
|
|
|
261
261
|
# Payment intents
|
|
262
262
|
|
|
263
|
-
`client.paymentIntents` — Stellar
|
|
263
|
+
`client.paymentIntents` — payment intents on Stellar, Solana and Monad. Two kinds:
|
|
264
264
|
|
|
265
265
|
- **`pay` intent** — no source. The payer's wallet picks the source account.
|
|
266
|
-
Produces a `web+stellar:pay?...`
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
Produces a payment link + QR (no XDR): `web+stellar:pay?...` on Stellar (the default),
|
|
267
|
+
a Solana Pay link with `chain: 'solana'`, an EIP-681 link with `chain: 'monad'`.
|
|
268
|
+
- **`tx` intent** — source known (Stellar only). Produces an unsigned XDR +
|
|
269
|
+
`web+stellar:tx?...` URI + QR.
|
|
269
270
|
|
|
270
271
|
## Create
|
|
271
272
|
|
|
@@ -288,6 +289,16 @@ const pay = await client.paymentIntents.createPay({
|
|
|
288
289
|
callback: 'url:https://...', // optional SEP-7 callback for the signed XDR
|
|
289
290
|
});
|
|
290
291
|
|
|
292
|
+
// pay on Solana or Monad: name the chain; the destination is an address on that chain
|
|
293
|
+
const sol = await client.paymentIntents.createPay({
|
|
294
|
+
chain: 'solana', // 'stellar' (default) | 'solana' | 'monad'
|
|
295
|
+
destination: '7xKX...', // Solana address (Monad: 0x...)
|
|
296
|
+
amount: '25', // required on Monad
|
|
297
|
+
assetCode: 'USDC', // a token by code + issuer (SPL mint / ERC-20 contract)
|
|
298
|
+
assetIssuer: 'EPjF...Dt1v',
|
|
299
|
+
});
|
|
300
|
+
console.log(sol.chain, sol.uri); // 'solana', 'solana:...'
|
|
301
|
+
|
|
291
302
|
// tx (source known)
|
|
292
303
|
const tx = await client.paymentIntents.createTx({
|
|
293
304
|
source: 'G...PAYER', // required (extra vs pay)
|
|
@@ -307,6 +318,8 @@ const intent = await client.paymentIntents.fetch('pi_123');
|
|
|
307
318
|
|
|
308
319
|
const page = await client.paymentIntents.list({
|
|
309
320
|
status: 'SUCCEEDED', // optional filter (PaymentIntentStatus)
|
|
321
|
+
chain: 'solana', // optional: 'stellar' | 'solana' | 'monad'
|
|
322
|
+
createdFrom: new Date('2026-11-01'), // optional: created at or after (Date or ISO 8601)
|
|
310
323
|
take: 50, // page size, max 100, default 20
|
|
311
324
|
skip: 0, // offset
|
|
312
325
|
});
|
|
@@ -336,10 +349,10 @@ server-side, and fires the webhook.
|
|
|
336
349
|
|
|
337
350
|
## Structure accessors (on a `PaymentIntent`)
|
|
338
351
|
|
|
339
|
-
`id`, `kind`, `status`, `network`, `source`, `destination`, `amount`, `asset`,
|
|
352
|
+
`id`, `kind`, `status`, `chain`, `network`, `source`, `destination`, `amount`, `asset`,
|
|
340
353
|
`assetIssuer`, `memo`, `msg`, `callback`, `xdr`, `uri`, `qr`, `txHash`,
|
|
341
354
|
`reference`, `createdAt`, `updatedAt`. Helpers: `isTx`, `isPay`, `isSucceeded`,
|
|
342
|
-
`isPending`, `assetLabel` (`'XLM'`
|
|
355
|
+
`isPending`, `assetLabel` (the chain's coin for native: `'XLM'`, `'SOL'` or `'MON'`). Methods: `fetch()`, `edit()`,
|
|
343
356
|
`validate(txHash)`, `cancel()`, `delete()`, `toJSON()`.
|
|
344
357
|
|
|
345
358
|
---
|
package/package.json
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmosapp/pay_sdk",
|
|
3
|
-
"version": "2.1
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.2.1",
|
|
4
|
+
"description": "Official SDK for Cosmos Pay, the stablecoin payments API for Stellar, Solana and Monad: payment intents and checkout, webhooks, swaps (same-chain and cross-chain), fiat ramps, products and customers. Payment links on all three (SEP-7, Solana Pay, EIP-681). Includes a browser client for Stellar wallets.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"cosmos",
|
|
7
6
|
"cosmos-pay",
|
|
8
|
-
"
|
|
9
|
-
"sep-7",
|
|
7
|
+
"cosmos",
|
|
10
8
|
"payments",
|
|
9
|
+
"stablecoin",
|
|
10
|
+
"usdc",
|
|
11
|
+
"crypto-payments",
|
|
12
|
+
"payment-api",
|
|
13
|
+
"payment-links",
|
|
14
|
+
"checkout",
|
|
11
15
|
"payment-intents",
|
|
12
16
|
"webhooks",
|
|
17
|
+
"swaps",
|
|
18
|
+
"cross-chain",
|
|
19
|
+
"stellar",
|
|
20
|
+
"solana",
|
|
21
|
+
"monad",
|
|
22
|
+
"sep-7",
|
|
13
23
|
"sdk",
|
|
14
|
-
"api",
|
|
15
|
-
"client",
|
|
16
24
|
"typescript",
|
|
17
25
|
"wallet",
|
|
18
26
|
"freighter",
|
|
19
27
|
"xbull",
|
|
20
28
|
"albedo",
|
|
21
29
|
"rabet",
|
|
22
|
-
"lobstr"
|
|
23
|
-
"browser"
|
|
30
|
+
"lobstr"
|
|
24
31
|
],
|
|
25
32
|
"license": "Apache-2.0",
|
|
26
33
|
"author": "Cosmos Pay",
|
|
@@ -31,7 +38,7 @@
|
|
|
31
38
|
"bugs": {
|
|
32
39
|
"url": "https://github.com/CosmosPay/CosmosJS_SDK/issues"
|
|
33
40
|
},
|
|
34
|
-
"homepage": "https://
|
|
41
|
+
"homepage": "https://dev.cosmospay.lat/docs/sdk/server/overview",
|
|
35
42
|
"type": "module",
|
|
36
43
|
"main": "./dist/index.cjs",
|
|
37
44
|
"module": "./dist/index.js",
|
|
@@ -95,10 +102,10 @@
|
|
|
95
102
|
"openapi:check": "node scripts/sync-openapi.mjs --check"
|
|
96
103
|
},
|
|
97
104
|
"devDependencies": {
|
|
98
|
-
"@types/node": "^26.6.
|
|
105
|
+
"@types/node": "^26.6.5",
|
|
99
106
|
"rimraf": "^6.1.3",
|
|
100
107
|
"semver": "^7.8.5",
|
|
101
|
-
"tsup": "^
|
|
108
|
+
"tsup": "^9.0.0",
|
|
102
109
|
"typescript": "^5.9.3"
|
|
103
110
|
},
|
|
104
111
|
"peerDependencies": {
|