@0to1pay/server-sdk 3.1.0 → 3.1.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.
Files changed (2) hide show
  1. package/README.md +10 -9
  2. package/package.json +14 -2
package/README.md CHANGED
@@ -1,27 +1,28 @@
1
- # 0to1Pay Server SDK
1
+ # 0to1pay Server SDK
2
2
 
3
- Node.js 22.20.0 or newer. Install the SDK from npm or use the verified tarball in your merchant backend.
3
+ Accept USDC or USDT directly in a merchant wallet and verify onchain payment before granting access. The hosted beta serves **Base Sepolia USDC, Ethereum Sepolia USDC and TRON Nile USDT**. Install on your Node.js server (22.20.0+).
4
4
 
5
5
  ```sh
6
- npm install @0to1pay/server-sdk@3.1.0
6
+ npm install @0to1pay/server-sdk
7
7
  ```
8
8
 
9
- ```sh
10
- npm install ./0to1pay-server-sdk-3.1.0.tgz
11
- ```
9
+ **Build a working checkout.** The [Next.js Base USDC guide](https://0to1pay.com/guides/nextjs-base-usdc) walks through a 0.01 test USDC order, wallet authorization, transfer proof, signed webhook and PostgreSQL access pass. [Open the hosted demo](https://0to1pay.com/demo/base-usdc) · [Download the complete runnable example](https://0to1pay.com/examples/nextjs-base-usdc.zip).
12
10
 
13
- On a deployment with public signup enabled, open `/merchant` on the Web origin provided by your platform operator. Sign in to **My workspace**, select a project and issue a scoped Sandbox key from **API keys**. On a restricted deployment, get a test project and server key from the platform operator. Set the HTTPS API origin and scoped key in your app's backend environment.
11
+ [Sign in to the merchant dashboard](https://pay.0to1pay.com/merchant), create a project, and issue a test server key. Use the public API origin `https://api.0to1pay.com` and keep the key in your backend environment.
14
12
 
15
13
  ```ts
16
14
  import { ZeroToOnePayClient } from '@0to1pay/server-sdk';
17
15
 
18
16
  const client = new ZeroToOnePayClient({
19
- origin: process.env.ZERO_TO_ONE_PAY_ORIGIN!,
17
+ origin: 'https://api.0to1pay.com',
20
18
  apiKey: process.env.ZERO_TO_ONE_PAY_API_KEY!,
21
19
  });
22
- const { data } = await client.call('listPayments', { query: { limit: 1 } });
20
+ const { data } = await client.call('listChainAssets', {});
21
+ const baseUsdc = data.find(asset => asset.network_id === 'eip155:84532' && asset.symbol === 'USDC');
23
22
  ```
24
23
 
24
+ For integration tools and coding assistants, start with the [Markdown quickstart](https://0to1pay.com/guides/nextjs-base-usdc.md), [public OpenAPI JSON](https://api.0to1pay.com/openapi.json), [API reference](https://0to1pay.com/docs), and [SDK reference](https://0to1pay.com/sdk).
25
+
25
26
  Use `call` for the full merchant API. Use the same idempotency key when retrying a mutation for the same logical request. The client validates requests and responses against the bundled OpenAPI contract. The hosted API also serves the contract at `/openapi.json`. Keep the scoped key on your server and route browser actions through your merchant backend.
26
27
 
27
28
  ## Create a stablecoin checkout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0to1pay/server-sdk",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Server-only 0to1Pay client for direct on-chain stablecoin checkout and fulfillment",
@@ -30,5 +30,17 @@
30
30
  "ajv": "8.20.0",
31
31
  "ajv-formats": "3.0.1",
32
32
  "yaml": "2.9.1"
33
- }
33
+ },
34
+ "homepage": "https://0to1pay.com/sdk",
35
+ "keywords": [
36
+ "stablecoin-payments",
37
+ "usdc",
38
+ "usdt",
39
+ "base",
40
+ "ethereum",
41
+ "tron",
42
+ "nextjs",
43
+ "webhooks",
44
+ "checkout"
45
+ ]
34
46
  }