@stellar-snaps/sdk 0.3.0 → 0.3.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/README.md CHANGED
@@ -14,6 +14,22 @@ npm install @stellar-snaps/sdk
14
14
  pnpm add @stellar-snaps/sdk
15
15
  ```
16
16
 
17
+ **Peer dependencies** (install if you use transaction building or Freighter):
18
+ `@stellar/freighter-api`, `@stellar/stellar-sdk`
19
+
20
+ ## How it works
21
+
22
+ - **Shareable Snap API** (`createSnap`, `getSnap`, `listSnaps`, `deleteSnap`)
23
+ Calls the Stellar Snaps web app at `https://stellar-snaps.vercel.app` by default. Snaps are stored there; you get back shareable URLs (e.g. `https://stellar-snaps.vercel.app/s/abc123`). Works in **Node.js** and **browser** (CORS is enabled on the API). Use `baseUrl` to point at your own deployment.
24
+
25
+ - **SEP-0007 URIs** (`createPaymentSnap`, `createTransactionSnap`, `parseSnapUri`)
26
+ Pure logic, no network. Build or parse `web+stellar:...` payment/transaction links.
27
+
28
+ - **Transactions & Freighter** (`buildPaymentTransaction`, `signWithFreighter`, `submitTransaction`, etc.)
29
+ Run in a **browser** with the [Freighter](https://www.freighter.app/) extension installed. Uses `@stellar/freighter-api` and `@stellar/stellar-sdk`.
30
+
31
+ So: install the package, use the Shareable Snap API from any environment; use Freighter-related APIs only in a browser with Freighter installed.
32
+
17
33
  ## Quick Start
18
34
 
19
35
  ### 1. Create a Payment Link
@@ -79,7 +95,46 @@ if (result.successful) {
79
95
  }
80
96
  ```
81
97
 
82
- ### 4. Host Your Own Snap Endpoints
98
+ ### 4. Create Shareable Snaps (Web App API)
99
+
100
+ Create, fetch, list, and delete database-backed snaps—same behavior as the web dashboard. Uses `https://stellar-snaps.vercel.app` by default.
101
+
102
+ ```typescript
103
+ import { createSnap, getSnap, listSnaps, deleteSnap } from '@stellar-snaps/sdk';
104
+
105
+ // Create a snap (stores on server, returns shareable URL)
106
+ const { url, snap } = await createSnap({
107
+ creator: 'GCNZMNUTQ5UMQ5QL0FUAW3CUADWB...',
108
+ title: 'Buy me a coffee',
109
+ destination: 'GCNZMNUTQ5UMQ5QL0FUAW3CUADWB...',
110
+ amount: '5',
111
+ network: 'testnet',
112
+ });
113
+ console.log(url);
114
+ // => https://stellar-snaps.vercel.app/s/u8oYHLhl
115
+
116
+ // Fetch a snap by ID
117
+ const fetchedSnap = await getSnap('u8oYHLhl');
118
+
119
+ // List all snaps for a creator
120
+ const snaps = await listSnaps('GCNZMNUTQ5UMQ5QL0FUAW3CUADWB...');
121
+
122
+ // Delete a snap (requires creator address)
123
+ await deleteSnap('u8oYHLhl', 'GCNZMNUTQ5UMQ5QL0FUAW3CUADWB...');
124
+ ```
125
+
126
+ Use `baseUrl` to point at your own Stellar Snaps instance:
127
+
128
+ ```typescript
129
+ const { url } = await createSnap({
130
+ creator: 'G...',
131
+ title: 'Test',
132
+ destination: 'G...',
133
+ baseUrl: 'https://your-stellar-snaps.vercel.app',
134
+ });
135
+ ```
136
+
137
+ ### 5. Host Your Own Snap Endpoints
83
138
 
84
139
  Create a discovery file to enable the browser extension to find your snaps:
85
140
 
@@ -99,6 +154,77 @@ const discovery = createDiscoveryFile({
99
154
 
100
155
  ## API Reference
101
156
 
157
+ ### Shareable Snap API (Web App)
158
+
159
+ These functions mirror the Stellar Snaps web app API. Use them to create and manage snaps that are stored on a server and get shareable URLs.
160
+
161
+ #### `createSnap(options)`
162
+
163
+ Creates a snap on the server and returns the shareable URL.
164
+
165
+ ```typescript
166
+ interface CreateSnapOptions {
167
+ creator: string; // Creator's Stellar address (required)
168
+ title: string; // Display title (required)
169
+ destination: string; // Payment destination (required)
170
+ description?: string;
171
+ amount?: string; // Omit for open amount
172
+ assetCode?: string; // Default: 'XLM'
173
+ assetIssuer?: string; // Required for non-XLM
174
+ memo?: string;
175
+ memoType?: MemoType;
176
+ network?: 'public' | 'testnet'; // Default: 'testnet'
177
+ imageUrl?: string;
178
+ baseUrl?: string; // Default: 'https://stellar-snaps.vercel.app'
179
+ }
180
+
181
+ interface CreateSnapResult {
182
+ id: string;
183
+ url: string; // Full shareable URL
184
+ snap: Snap;
185
+ }
186
+ ```
187
+
188
+ #### `getSnap(id, options?)`
189
+
190
+ Fetches a snap by ID. Uses `GET /api/snap/[id]`.
191
+
192
+ - **Throws** `SnapNotFoundError` if the snap does not exist.
193
+ - **Throws** `SnapApiError` on other API errors.
194
+
195
+ #### `listSnaps(creator, options?)`
196
+
197
+ Lists all snaps for a creator. Uses `GET /api/snaps?creator=...`.
198
+
199
+ #### `deleteSnap(id, creator, options?)`
200
+
201
+ Deletes a snap. Requires the creator's address (ownership). Uses `DELETE /api/snaps?id=...&creator=...`.
202
+
203
+ - **Throws** `SnapNotFoundError` if the snap does not exist.
204
+ - **Throws** `SnapUnauthorizedError` if the creator does not own the snap.
205
+ - **Throws** `SnapApiError` on other API errors.
206
+
207
+ #### `Snap` type
208
+
209
+ ```typescript
210
+ interface Snap {
211
+ id: string;
212
+ creator?: string; // Omitted in GET /api/snap/[id] response
213
+ title: string;
214
+ description?: string | null;
215
+ destination: string;
216
+ amount?: string | null;
217
+ assetCode: string;
218
+ assetIssuer?: string | null;
219
+ memo?: string | null;
220
+ memoType?: string;
221
+ network: string;
222
+ imageUrl?: string | null;
223
+ createdAt?: string;
224
+ updatedAt?: string;
225
+ }
226
+ ```
227
+
102
228
  ### SEP-0007 URI Functions
103
229
 
104
230
  #### `createPaymentSnap(options)`
@@ -260,6 +386,9 @@ All errors extend `StellarSnapError` with a `code` property for programmatic han
260
386
  - `InvalidAmountError` - Invalid amount
261
387
  - `InvalidAssetError` - Invalid asset configuration
262
388
  - `InvalidUriError` - Invalid SEP-0007 URI
389
+ - `SnapNotFoundError` - Snap not found (404 from API)
390
+ - `SnapUnauthorizedError` - Not authorized to perform action (e.g. delete another user's snap)
391
+ - `SnapApiError` - Stellar Snaps API returned an error (includes optional `statusCode`)
263
392
 
264
393
  ```typescript
265
394
  try {
@@ -269,6 +398,14 @@ try {
269
398
  console.log(error.code); // 'INVALID_ADDRESS'
270
399
  }
271
400
  }
401
+
402
+ try {
403
+ const snap = await getSnap('missing-id');
404
+ } catch (error) {
405
+ if (error instanceof SnapNotFoundError) {
406
+ console.log(error.code); // 'SNAP_NOT_FOUND'
407
+ }
408
+ }
272
409
  ```
273
410
 
274
411
  ### Constants
package/dist/index.d.mts CHANGED
@@ -1,11 +1,29 @@
1
1
  import * as StellarSdk from '@stellar/stellar-sdk';
2
2
 
3
3
  /**
4
- * Create Shareable Snap
4
+ * Shareable Snap API
5
5
  *
6
- * Creates a snap on a Stellar Snaps server and returns the shareable URL.
7
- * This is different from createPaymentSnap which only creates SEP-0007 URIs.
6
+ * Functions that mirror the Stellar Snaps web app API. Create, fetch, list,
7
+ * and delete database-backed snaps so developers get the same behavior as
8
+ * the dashboard. Uses https://stellar-snaps.vercel.app by default.
8
9
  */
10
+ /** Snap as returned by the web app API (GET /api/snap/[id] omits creator; list/create include it). */
11
+ interface Snap$1 {
12
+ id: string;
13
+ creator?: string;
14
+ title: string;
15
+ description?: string | null;
16
+ destination: string;
17
+ amount?: string | null;
18
+ assetCode: string;
19
+ assetIssuer?: string | null;
20
+ memo?: string | null;
21
+ memoType?: string;
22
+ network: string;
23
+ imageUrl?: string | null;
24
+ createdAt?: string;
25
+ updatedAt?: string;
26
+ }
9
27
  interface CreateSnapOptions {
10
28
  /** Creator's Stellar address (required) */
11
29
  creator: string;
@@ -29,30 +47,16 @@ interface CreateSnapOptions {
29
47
  network?: 'public' | 'testnet';
30
48
  /** Optional image URL for the snap */
31
49
  imageUrl?: string;
32
- /** Stellar Snaps server URL (default: 'https://stellarsnaps.com') */
33
- serverUrl?: string;
50
+ /** Stellar Snaps server base URL (default: 'https://stellar-snaps.vercel.app') */
51
+ baseUrl?: string;
34
52
  }
35
53
  interface CreateSnapResult {
36
54
  /** The created snap ID */
37
55
  id: string;
38
- /** Full shareable URL */
56
+ /** Full shareable URL (e.g. https://stellar-snaps.vercel.app/s/abc123) */
39
57
  url: string;
40
- /** The snap data as stored */
41
- snap: {
42
- id: string;
43
- creator: string;
44
- title: string;
45
- description?: string;
46
- destination: string;
47
- amount?: string;
48
- assetCode: string;
49
- assetIssuer?: string;
50
- memo?: string;
51
- memoType: string;
52
- network: string;
53
- imageUrl?: string;
54
- createdAt: string;
55
- };
58
+ /** The snap data as returned by the API */
59
+ snap: Snap$1;
56
60
  }
57
61
  /**
58
62
  * Creates a shareable snap on a Stellar Snaps server.
@@ -64,52 +68,38 @@ interface CreateSnapResult {
64
68
  * title: 'Coffee Payment',
65
69
  * destination: 'GDEST...',
66
70
  * amount: '5',
67
- * serverUrl: 'https://your-stellar-snaps-instance.com'
71
+ * baseUrl: 'https://stellar-snaps.vercel.app'
68
72
  * });
69
- *
70
73
  * console.log(result.url);
71
- * // https://your-stellar-snaps-instance.com/s/nk1VNcxo
74
+ * // https://stellar-snaps.vercel.app/s/abc12345
72
75
  * ```
73
76
  */
74
77
  declare function createSnap(options: CreateSnapOptions): Promise<CreateSnapResult>;
75
78
  /**
76
- * Fetches an existing snap by ID from a Stellar Snaps server.
79
+ * Fetches a snap by ID from the Stellar Snaps server.
80
+ * Uses GET /api/snap/[id] (singular path, same as web app).
77
81
  *
78
- * @example
79
- * ```typescript
80
- * const snap = await getSnap('nk1VNcxo', {
81
- * serverUrl: 'https://your-stellar-snaps-instance.com'
82
- * });
83
- * ```
82
+ * @throws SnapNotFoundError if the snap does not exist
83
+ * @throws SnapApiError if the request fails
84
84
  */
85
85
  declare function getSnap(id: string, options?: {
86
- serverUrl?: string;
87
- }): Promise<CreateSnapResult['snap'] | null>;
86
+ baseUrl?: string;
87
+ }): Promise<Snap$1>;
88
88
  /**
89
- * Lists snaps created by a specific address.
90
- *
91
- * @example
92
- * ```typescript
93
- * const snaps = await listSnaps('GCREATOR...', {
94
- * serverUrl: 'https://your-stellar-snaps-instance.com'
95
- * });
96
- * ```
89
+ * Lists snaps created by a specific address (GET /api/snaps?creator=...).
97
90
  */
98
91
  declare function listSnaps(creator: string, options?: {
99
- serverUrl?: string;
100
- }): Promise<CreateSnapResult['snap'][]>;
92
+ baseUrl?: string;
93
+ }): Promise<Snap$1[]>;
101
94
  /**
102
- * Deletes a snap by ID.
95
+ * Deletes a snap by ID. Requires the creator's address (same as web app: DELETE /api/snaps?id=...&creator=...).
103
96
  *
104
- * @example
105
- * ```typescript
106
- * await deleteSnap('nk1VNcxo', {
107
- * serverUrl: 'https://your-stellar-snaps-instance.com'
108
- * });
109
- * ```
97
+ * @throws SnapNotFoundError if the snap does not exist
98
+ * @throws SnapUnauthorizedError if the creator does not own the snap
99
+ * @throws SnapApiError if the request fails
110
100
  */
111
- declare function deleteSnap(id: string, options?: {
112
- serverUrl?: string;
101
+ declare function deleteSnap(id: string, creator: string, options?: {
102
+ baseUrl?: string;
113
103
  }): Promise<void>;
114
104
 
115
105
  /**
@@ -1169,5 +1159,24 @@ declare class InvalidAssetError extends StellarSnapError {
1169
1159
  declare class InvalidUriError extends StellarSnapError {
1170
1160
  constructor(message: string);
1171
1161
  }
1162
+ /**
1163
+ * Thrown when a snap is not found (404 from API).
1164
+ */
1165
+ declare class SnapNotFoundError extends StellarSnapError {
1166
+ constructor(snapId: string);
1167
+ }
1168
+ /**
1169
+ * Thrown when the caller is not authorized to perform the action (e.g. delete another user's snap).
1170
+ */
1171
+ declare class SnapUnauthorizedError extends StellarSnapError {
1172
+ constructor(message?: string);
1173
+ }
1174
+ /**
1175
+ * Thrown when the Stellar Snaps API returns an error.
1176
+ */
1177
+ declare class SnapApiError extends StellarSnapError {
1178
+ statusCode?: number | undefined;
1179
+ constructor(message: string, statusCode?: number | undefined);
1180
+ }
1172
1181
 
1173
- export { type ApiResponse, type BuildPaymentOptions, CACHE_HEADERS, CORS_HEADERS, type CreateDiscoveryFileOptions, type CreateSnapInput, type CreateSnapOptions, type CreateSnapResult, type DiscoveryFile, type DiscoveryRule, type DomainEntry, type DomainStatus, EXPLORER_URLS, type ExplorerType, type FreighterConnectionResult, HORIZON_URLS, InvalidAddressError, InvalidAmountError, InvalidAssetError, InvalidUriError, type MemoType, type MetaTags, NETWORK_PASSPHRASES, type Network, POSTGRES_SCHEMA, type ParsedSnap, type PaymentSnapOptions, type PaymentSnapResult, type RateLimitBucket, type Registry, type ResolvedUrl, SHORTENER_DOMAINS, SQLITE_SCHEMA, type Snap, type SnapMetadata, StellarSnapError, type TransactionSnapOptions, type TransactionSnapResult, type TransactionSubmitResult, type UpdateSnapInput, addDomain, buildPaymentTransaction, buildUrl, connectFreighter, createAsset, createDiscoveryFile, createPaymentSnap, createRateLimiter, createRegistry, createSnap, createSnapObject, createTransactionSnap, deleteSnap, errorResponse, extractDomain, extractPath, extractSnapId, generateJsonLd, generateMetaTags, generateSnapId, getAccountUrl, getAssetUrl, getBlockedDomains, getDomainStatus, getFreighterNetwork, getOperationUrl, getSnap, getTransactionUrl, getVerifiedDomains, isDomainBlocked, isDomainVerified, isFreighterConnected, isShortenerUrl, isValidAmount, isValidAssetCode, isValidSnapId, isValidStellarAddress, listSnaps, matchUrlToRule, metaTagsToHtml, parseAddress, parseQueryParams, parseSnapUri, removeDomain, resolveUrl, resolveUrls, signWithFreighter, submitTransaction, successResponse, validateDiscoveryFile, validateRegistry, validateRequired, validateSnapInput };
1182
+ export { type ApiResponse, type BuildPaymentOptions, CACHE_HEADERS, CORS_HEADERS, type CreateDiscoveryFileOptions, type CreateSnapInput, type CreateSnapOptions, type CreateSnapResult, type DiscoveryFile, type DiscoveryRule, type DomainEntry, type DomainStatus, EXPLORER_URLS, type ExplorerType, type FreighterConnectionResult, HORIZON_URLS, InvalidAddressError, InvalidAmountError, InvalidAssetError, InvalidUriError, type MemoType, type MetaTags, NETWORK_PASSPHRASES, type Network, POSTGRES_SCHEMA, type ParsedSnap, type PaymentSnapOptions, type PaymentSnapResult, type RateLimitBucket, type Registry, type ResolvedUrl, SHORTENER_DOMAINS, SQLITE_SCHEMA, type Snap$1 as Snap, SnapApiError, type SnapMetadata, SnapNotFoundError, type Snap as SnapRecord, SnapUnauthorizedError, StellarSnapError, type TransactionSnapOptions, type TransactionSnapResult, type TransactionSubmitResult, type UpdateSnapInput, addDomain, buildPaymentTransaction, buildUrl, connectFreighter, createAsset, createDiscoveryFile, createPaymentSnap, createRateLimiter, createRegistry, createSnap, createSnapObject, createTransactionSnap, deleteSnap, errorResponse, extractDomain, extractPath, extractSnapId, generateJsonLd, generateMetaTags, generateSnapId, getAccountUrl, getAssetUrl, getBlockedDomains, getDomainStatus, getFreighterNetwork, getOperationUrl, getSnap, getTransactionUrl, getVerifiedDomains, isDomainBlocked, isDomainVerified, isFreighterConnected, isShortenerUrl, isValidAmount, isValidAssetCode, isValidSnapId, isValidStellarAddress, listSnaps, matchUrlToRule, metaTagsToHtml, parseAddress, parseQueryParams, parseSnapUri, removeDomain, resolveUrl, resolveUrls, signWithFreighter, submitTransaction, successResponse, validateDiscoveryFile, validateRegistry, validateRequired, validateSnapInput };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,29 @@
1
1
  import * as StellarSdk from '@stellar/stellar-sdk';
2
2
 
3
3
  /**
4
- * Create Shareable Snap
4
+ * Shareable Snap API
5
5
  *
6
- * Creates a snap on a Stellar Snaps server and returns the shareable URL.
7
- * This is different from createPaymentSnap which only creates SEP-0007 URIs.
6
+ * Functions that mirror the Stellar Snaps web app API. Create, fetch, list,
7
+ * and delete database-backed snaps so developers get the same behavior as
8
+ * the dashboard. Uses https://stellar-snaps.vercel.app by default.
8
9
  */
10
+ /** Snap as returned by the web app API (GET /api/snap/[id] omits creator; list/create include it). */
11
+ interface Snap$1 {
12
+ id: string;
13
+ creator?: string;
14
+ title: string;
15
+ description?: string | null;
16
+ destination: string;
17
+ amount?: string | null;
18
+ assetCode: string;
19
+ assetIssuer?: string | null;
20
+ memo?: string | null;
21
+ memoType?: string;
22
+ network: string;
23
+ imageUrl?: string | null;
24
+ createdAt?: string;
25
+ updatedAt?: string;
26
+ }
9
27
  interface CreateSnapOptions {
10
28
  /** Creator's Stellar address (required) */
11
29
  creator: string;
@@ -29,30 +47,16 @@ interface CreateSnapOptions {
29
47
  network?: 'public' | 'testnet';
30
48
  /** Optional image URL for the snap */
31
49
  imageUrl?: string;
32
- /** Stellar Snaps server URL (default: 'https://stellarsnaps.com') */
33
- serverUrl?: string;
50
+ /** Stellar Snaps server base URL (default: 'https://stellar-snaps.vercel.app') */
51
+ baseUrl?: string;
34
52
  }
35
53
  interface CreateSnapResult {
36
54
  /** The created snap ID */
37
55
  id: string;
38
- /** Full shareable URL */
56
+ /** Full shareable URL (e.g. https://stellar-snaps.vercel.app/s/abc123) */
39
57
  url: string;
40
- /** The snap data as stored */
41
- snap: {
42
- id: string;
43
- creator: string;
44
- title: string;
45
- description?: string;
46
- destination: string;
47
- amount?: string;
48
- assetCode: string;
49
- assetIssuer?: string;
50
- memo?: string;
51
- memoType: string;
52
- network: string;
53
- imageUrl?: string;
54
- createdAt: string;
55
- };
58
+ /** The snap data as returned by the API */
59
+ snap: Snap$1;
56
60
  }
57
61
  /**
58
62
  * Creates a shareable snap on a Stellar Snaps server.
@@ -64,52 +68,38 @@ interface CreateSnapResult {
64
68
  * title: 'Coffee Payment',
65
69
  * destination: 'GDEST...',
66
70
  * amount: '5',
67
- * serverUrl: 'https://your-stellar-snaps-instance.com'
71
+ * baseUrl: 'https://stellar-snaps.vercel.app'
68
72
  * });
69
- *
70
73
  * console.log(result.url);
71
- * // https://your-stellar-snaps-instance.com/s/nk1VNcxo
74
+ * // https://stellar-snaps.vercel.app/s/abc12345
72
75
  * ```
73
76
  */
74
77
  declare function createSnap(options: CreateSnapOptions): Promise<CreateSnapResult>;
75
78
  /**
76
- * Fetches an existing snap by ID from a Stellar Snaps server.
79
+ * Fetches a snap by ID from the Stellar Snaps server.
80
+ * Uses GET /api/snap/[id] (singular path, same as web app).
77
81
  *
78
- * @example
79
- * ```typescript
80
- * const snap = await getSnap('nk1VNcxo', {
81
- * serverUrl: 'https://your-stellar-snaps-instance.com'
82
- * });
83
- * ```
82
+ * @throws SnapNotFoundError if the snap does not exist
83
+ * @throws SnapApiError if the request fails
84
84
  */
85
85
  declare function getSnap(id: string, options?: {
86
- serverUrl?: string;
87
- }): Promise<CreateSnapResult['snap'] | null>;
86
+ baseUrl?: string;
87
+ }): Promise<Snap$1>;
88
88
  /**
89
- * Lists snaps created by a specific address.
90
- *
91
- * @example
92
- * ```typescript
93
- * const snaps = await listSnaps('GCREATOR...', {
94
- * serverUrl: 'https://your-stellar-snaps-instance.com'
95
- * });
96
- * ```
89
+ * Lists snaps created by a specific address (GET /api/snaps?creator=...).
97
90
  */
98
91
  declare function listSnaps(creator: string, options?: {
99
- serverUrl?: string;
100
- }): Promise<CreateSnapResult['snap'][]>;
92
+ baseUrl?: string;
93
+ }): Promise<Snap$1[]>;
101
94
  /**
102
- * Deletes a snap by ID.
95
+ * Deletes a snap by ID. Requires the creator's address (same as web app: DELETE /api/snaps?id=...&creator=...).
103
96
  *
104
- * @example
105
- * ```typescript
106
- * await deleteSnap('nk1VNcxo', {
107
- * serverUrl: 'https://your-stellar-snaps-instance.com'
108
- * });
109
- * ```
97
+ * @throws SnapNotFoundError if the snap does not exist
98
+ * @throws SnapUnauthorizedError if the creator does not own the snap
99
+ * @throws SnapApiError if the request fails
110
100
  */
111
- declare function deleteSnap(id: string, options?: {
112
- serverUrl?: string;
101
+ declare function deleteSnap(id: string, creator: string, options?: {
102
+ baseUrl?: string;
113
103
  }): Promise<void>;
114
104
 
115
105
  /**
@@ -1169,5 +1159,24 @@ declare class InvalidAssetError extends StellarSnapError {
1169
1159
  declare class InvalidUriError extends StellarSnapError {
1170
1160
  constructor(message: string);
1171
1161
  }
1162
+ /**
1163
+ * Thrown when a snap is not found (404 from API).
1164
+ */
1165
+ declare class SnapNotFoundError extends StellarSnapError {
1166
+ constructor(snapId: string);
1167
+ }
1168
+ /**
1169
+ * Thrown when the caller is not authorized to perform the action (e.g. delete another user's snap).
1170
+ */
1171
+ declare class SnapUnauthorizedError extends StellarSnapError {
1172
+ constructor(message?: string);
1173
+ }
1174
+ /**
1175
+ * Thrown when the Stellar Snaps API returns an error.
1176
+ */
1177
+ declare class SnapApiError extends StellarSnapError {
1178
+ statusCode?: number | undefined;
1179
+ constructor(message: string, statusCode?: number | undefined);
1180
+ }
1172
1181
 
1173
- export { type ApiResponse, type BuildPaymentOptions, CACHE_HEADERS, CORS_HEADERS, type CreateDiscoveryFileOptions, type CreateSnapInput, type CreateSnapOptions, type CreateSnapResult, type DiscoveryFile, type DiscoveryRule, type DomainEntry, type DomainStatus, EXPLORER_URLS, type ExplorerType, type FreighterConnectionResult, HORIZON_URLS, InvalidAddressError, InvalidAmountError, InvalidAssetError, InvalidUriError, type MemoType, type MetaTags, NETWORK_PASSPHRASES, type Network, POSTGRES_SCHEMA, type ParsedSnap, type PaymentSnapOptions, type PaymentSnapResult, type RateLimitBucket, type Registry, type ResolvedUrl, SHORTENER_DOMAINS, SQLITE_SCHEMA, type Snap, type SnapMetadata, StellarSnapError, type TransactionSnapOptions, type TransactionSnapResult, type TransactionSubmitResult, type UpdateSnapInput, addDomain, buildPaymentTransaction, buildUrl, connectFreighter, createAsset, createDiscoveryFile, createPaymentSnap, createRateLimiter, createRegistry, createSnap, createSnapObject, createTransactionSnap, deleteSnap, errorResponse, extractDomain, extractPath, extractSnapId, generateJsonLd, generateMetaTags, generateSnapId, getAccountUrl, getAssetUrl, getBlockedDomains, getDomainStatus, getFreighterNetwork, getOperationUrl, getSnap, getTransactionUrl, getVerifiedDomains, isDomainBlocked, isDomainVerified, isFreighterConnected, isShortenerUrl, isValidAmount, isValidAssetCode, isValidSnapId, isValidStellarAddress, listSnaps, matchUrlToRule, metaTagsToHtml, parseAddress, parseQueryParams, parseSnapUri, removeDomain, resolveUrl, resolveUrls, signWithFreighter, submitTransaction, successResponse, validateDiscoveryFile, validateRegistry, validateRequired, validateSnapInput };
1182
+ export { type ApiResponse, type BuildPaymentOptions, CACHE_HEADERS, CORS_HEADERS, type CreateDiscoveryFileOptions, type CreateSnapInput, type CreateSnapOptions, type CreateSnapResult, type DiscoveryFile, type DiscoveryRule, type DomainEntry, type DomainStatus, EXPLORER_URLS, type ExplorerType, type FreighterConnectionResult, HORIZON_URLS, InvalidAddressError, InvalidAmountError, InvalidAssetError, InvalidUriError, type MemoType, type MetaTags, NETWORK_PASSPHRASES, type Network, POSTGRES_SCHEMA, type ParsedSnap, type PaymentSnapOptions, type PaymentSnapResult, type RateLimitBucket, type Registry, type ResolvedUrl, SHORTENER_DOMAINS, SQLITE_SCHEMA, type Snap$1 as Snap, SnapApiError, type SnapMetadata, SnapNotFoundError, type Snap as SnapRecord, SnapUnauthorizedError, StellarSnapError, type TransactionSnapOptions, type TransactionSnapResult, type TransactionSubmitResult, type UpdateSnapInput, addDomain, buildPaymentTransaction, buildUrl, connectFreighter, createAsset, createDiscoveryFile, createPaymentSnap, createRateLimiter, createRegistry, createSnap, createSnapObject, createTransactionSnap, deleteSnap, errorResponse, extractDomain, extractPath, extractSnapId, generateJsonLd, generateMetaTags, generateSnapId, getAccountUrl, getAssetUrl, getBlockedDomains, getDomainStatus, getFreighterNetwork, getOperationUrl, getSnap, getTransactionUrl, getVerifiedDomains, isDomainBlocked, isDomainVerified, isFreighterConnected, isShortenerUrl, isValidAmount, isValidAssetCode, isValidSnapId, isValidStellarAddress, listSnaps, matchUrlToRule, metaTagsToHtml, parseAddress, parseQueryParams, parseSnapUri, removeDomain, resolveUrl, resolveUrls, signWithFreighter, submitTransaction, successResponse, validateDiscoveryFile, validateRegistry, validateRequired, validateSnapInput };