@pokewallet/sdk 0.0.0-stage → 0.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PokeWallet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # @pokewallet/sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Install with `npm install @pokewallet/sdk`. The [root README](../../README.md#2-install) has the quickstart, the full method table and the MCP server.
4
+
5
+ Official TypeScript SDK for the [PokeWallet API](https://pokewallet.io): Pokémon, One Piece and ten more card games, with TCGPlayer and CardMarket prices. Zero runtime dependencies, ESM and CJS, Node 18+ (also Workers and browsers: it only needs `fetch`).
6
+
7
+ ```ts
8
+ import { PokeWallet } from '@pokewallet/sdk'
9
+
10
+ // Key format: pk_live_xxx. Keep it in the environment, never in source control.
11
+ const pw = new PokeWallet({ apiKey: process.env.POKEWALLET_API_KEY })
12
+
13
+ const page = await pw.pokemon.search('charizard', { limit: 10 })
14
+ const op01 = await pw.onepiece.set('OP01')
15
+ for await (const card of pw.games.mtg.setCards('FRA')) console.log(card.name)
16
+ ```
17
+
18
+ Pokémon, One Piece and the ten games (`pw.games.mtg`, `pw.games.ygo`, ...) share one interface: `search`, `searchAll`, `card`, `sets`, `set`, `setCards`, `prices`, `statistics`, `completionValue`, `trending`, `topCards`. Pokémon adds `priceHistory`.
19
+
20
+ - **Typed errors:** `AuthError`, `PlanRequiredError` (`redeemUrl` / `upgradeUrl`), `FeatureNotEnabledError`, `RateLimitError` (`limits`), `AmbiguousSetError` (`matches`), `NotFoundError`, `UnavailableError`, `ValidationError`.
21
+ - **Retries:** only on 429 (when `Retry-After` is present, within `retryAfterCapSeconds`, default 30, and no quota window is exhausted) and on 503 (up to `maxRetries`, default 2). Never on other 4xx or 5xx. `fetch`, `timeoutMs` and `sleep` are injectable.
22
+ - **Validation:** `limit` and `page` are checked before the request is sent.
23
+ - **Normalization:** prices are `number | null`; set identifiers are exposed as `setId` / `setCode`; every object keeps the server value in `raw`. Ambiguous set answers (200, 300 and 409 on the wire) all raise `AmbiguousSetError`.
24
+ - **Key safety:** the key is held in a private field and shown as `pk_***` by `JSON.stringify`, `util.inspect` and errors.
25
+ - **Images:** `imageUrl(id)` only builds the URL. The image routes need the `X-API-Key` header, so the URL cannot be used directly in an `<img>` tag.
26
+
27
+ The key is read from the `apiKey` option or the `POKEWALLET_API_KEY` environment variable. The client can be created without one: `health()` and `listGames()` are public and work without a key (the `X-API-Key` header is sent only when a key is set); every other call throws `ValidationError` before any request is made. Every request carries `User-Agent: pokewallet-sdk-ts/<version>`.
28
+
29
+ Attribution: if you show data obtained through the PokeWallet API, SDKs or MCP server to other people, credit PokéWallet with visible text "Data by PokéWallet" (or "Powered by PokéWallet") linking to <https://pokewallet.io>; private use needs no attribution. See the [Terms of Use](https://pokewallet.io/terms-conditions). This concerns the data and the service; the MIT license of the code is separate.