@phala/pay 0.8.2 → 0.9.0
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 +33 -58
- package/THIRD_PARTY_NOTICES +25 -0
- package/dist/chains.d.ts +2 -0
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +11 -2
- package/dist/chains.js.map +1 -1
- package/dist/checkout.d.ts +4 -2
- package/dist/checkout.d.ts.map +1 -1
- package/dist/checkout.js +18 -3
- package/dist/checkout.js.map +1 -1
- package/dist/deposit-address.js +2 -2
- package/dist/deposit-address.js.map +1 -1
- package/dist/icon-names.d.ts +7 -0
- package/dist/icon-names.d.ts.map +1 -0
- package/dist/icon-names.js +15 -0
- package/dist/icon-names.js.map +1 -0
- package/dist/icon-svg.d.ts +6 -0
- package/dist/icon-svg.d.ts.map +1 -0
- package/dist/icon-svg.js +13 -0
- package/dist/icon-svg.js.map +1 -0
- package/dist/icons.d.ts +5 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +27 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/request.d.ts +2 -0
- package/dist/request.d.ts.map +1 -1
- package/dist/request.js +7 -0
- package/dist/request.js.map +1 -1
- package/dist/shared/checkout-params.d.ts +7 -0
- package/dist/shared/checkout-params.d.ts.map +1 -0
- package/dist/shared/checkout-params.js +2 -0
- package/dist/shared/checkout-params.js.map +1 -0
- package/package.json +18 -31
- package/src/chains.ts +12 -2
- package/src/checkout.ts +21 -4
- package/src/deposit-address.ts +2 -2
- package/src/generated/openapi.d.ts +9482 -0
- package/src/icon-names.ts +20 -0
- package/src/icon-svg.ts +13 -0
- package/src/icons.ts +30 -0
- package/src/index.ts +6 -2
- package/src/request.ts +7 -0
- package/src/shared/checkout-params.ts +6 -0
- package/dist/react/Checkout.d.ts +0 -43
- package/dist/react/Checkout.d.ts.map +0 -1
- package/dist/react/Checkout.js +0 -193
- package/dist/react/Checkout.js.map +0 -1
- package/dist/react/DepositAddress.d.ts +0 -32
- package/dist/react/DepositAddress.d.ts.map +0 -1
- package/dist/react/DepositAddress.js +0 -131
- package/dist/react/DepositAddress.js.map +0 -1
- package/dist/react/Field.d.ts +0 -7
- package/dist/react/Field.d.ts.map +0 -1
- package/dist/react/Field.js +0 -21
- package/dist/react/Field.js.map +0 -1
- package/dist/react/QrCode.d.ts +0 -8
- package/dist/react/QrCode.d.ts.map +0 -1
- package/dist/react/QrCode.js +0 -20
- package/dist/react/QrCode.js.map +0 -1
- package/dist/react/appearance.d.ts +0 -5
- package/dist/react/appearance.d.ts.map +0 -1
- package/dist/react/appearance.js +0 -2
- package/dist/react/appearance.js.map +0 -1
- package/dist/react/index.d.ts +0 -5
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -5
- package/dist/react/index.js.map +0 -1
- package/dist/react/useCheckout.d.ts +0 -9
- package/dist/react/useCheckout.d.ts.map +0 -1
- package/dist/react/useCheckout.js +0 -32
- package/dist/react/useCheckout.js.map +0 -1
- package/dist/server/addresses.d.ts +0 -78
- package/dist/server/addresses.d.ts.map +0 -1
- package/dist/server/addresses.js +0 -118
- package/dist/server/addresses.js.map +0 -1
- package/dist/server/index.d.ts +0 -12
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -12
- package/dist/server/index.js.map +0 -1
- package/dist/server/sweeps.d.ts +0 -78
- package/dist/server/sweeps.d.ts.map +0 -1
- package/dist/server/sweeps.js +0 -117
- package/dist/server/sweeps.js.map +0 -1
- package/dist/server/webhook.d.ts +0 -61
- package/dist/server/webhook.d.ts.map +0 -1
- package/dist/server/webhook.js +0 -154
- package/dist/server/webhook.js.map +0 -1
- package/src/css.d.ts +0 -1
- package/src/react/Checkout.tsx +0 -469
- package/src/react/DepositAddress.tsx +0 -239
- package/src/react/Field.tsx +0 -46
- package/src/react/QrCode.tsx +0 -39
- package/src/react/appearance.ts +0 -4
- package/src/react/index.ts +0 -6
- package/src/react/useCheckout.ts +0 -58
- package/src/server/addresses.ts +0 -223
- package/src/server/index.ts +0 -38
- package/src/server/sweeps.ts +0 -197
- package/src/server/webhook.ts +0 -208
- package/src/styles.css +0 -76
package/README.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# @phala/pay
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Python SDK (`phala-pay`) and fulfils from the signed `deposit.credited` webhook.
|
|
3
|
+
Framework-free browser core for Phala Pay checkout sessions, retrieval helpers, wallets, payment URIs, icons, formatting, and public types. React components are published separately as [`@phala/pay-react`](../js-react).
|
|
4
|
+
|
|
5
|
+
It is the browser half of the flow; your backend creates the quote with the Node or Python merchant SDK and fulfils from the signed `deposit.credited` webhook.
|
|
7
6
|
|
|
8
7
|
## Install
|
|
9
8
|
|
|
@@ -11,10 +10,13 @@ Python SDK (`phala-pay`) and fulfils from the signed `deposit.credited` webhook.
|
|
|
11
10
|
npm install @phala/pay viem
|
|
12
11
|
```
|
|
13
12
|
|
|
13
|
+
For React components, install `@phala/pay-react` alongside `react` and `react-dom`; this package
|
|
14
|
+
itself has no React peer dependency.
|
|
15
|
+
|
|
14
16
|
`@phala/pay` shares the service's version: pin the one equal to your operator's service version
|
|
15
17
|
([compatibility](../../docs/integration.md#compatibility)).
|
|
16
18
|
|
|
17
|
-
Peer
|
|
19
|
+
Peer dependency: `viem` 2. Browser wallets are
|
|
18
20
|
found with EIP-6963 through [mipd](https://github.com/wevm/mipd), wagmi's discovery store (with a
|
|
19
21
|
`window.ethereum` fallback for wallets that do not announce themselves). If your page already
|
|
20
22
|
connects a wallet with wagmi, RainbowKit, ConnectKit, or AppKit, pass it in instead; see
|
|
@@ -30,8 +32,8 @@ connects a wallet with wagmi, RainbowKit, ConnectKit, or AppKit, pass it in inst
|
|
|
30
32
|
|
|
31
33
|
```tsx
|
|
32
34
|
"use client";
|
|
33
|
-
import { Checkout } from "@phala/pay
|
|
34
|
-
import "@phala/pay/styles.css";
|
|
35
|
+
import { Checkout } from "@phala/pay-react";
|
|
36
|
+
import "@phala/pay-react/styles.css";
|
|
35
37
|
|
|
36
38
|
export function TopUp(props: {
|
|
37
39
|
clientSecret: string;
|
|
@@ -74,9 +76,9 @@ mode".
|
|
|
74
76
|
| `confirming` | Payment at the route's confirmation (two blocks on Ethereum), being valued and screened |
|
|
75
77
|
| `credited` | What was credited, typically `typical_credit_seconds` after paying; `onSuccess(quote)` is called once |
|
|
76
78
|
| `rejected` | Will not be credited; the payer contacts support |
|
|
77
|
-
| `reversed` |
|
|
79
|
+
| `reversed` | A reorganization before finality replaced the credited payment |
|
|
78
80
|
| `expired`, `canceled` | The address is hidden; `onExpire` is called once |
|
|
79
|
-
| `error` |
|
|
81
|
+
| `error` | Invalid client secret or address mismatch; nothing to pay |
|
|
80
82
|
|
|
81
83
|
`onChange(state)` is called once per status change with `{ status, quote, error }`, like Stripe
|
|
82
84
|
Elements' `onChange`, for example to hide your own "new payment" control while a payment is
|
|
@@ -114,7 +116,7 @@ ConnectKit, and AppKit, that is `useWalletClient()`:
|
|
|
114
116
|
|
|
115
117
|
```tsx
|
|
116
118
|
"use client";
|
|
117
|
-
import { Checkout } from "@phala/pay
|
|
119
|
+
import { Checkout } from "@phala/pay-react";
|
|
118
120
|
import { useWalletClient } from "wagmi";
|
|
119
121
|
|
|
120
122
|
export function TopUp(props: { clientSecret: string; expectedAddress: string }) {
|
|
@@ -144,7 +146,7 @@ arrives" copy; where a network's address differs (another treasury), it shows th
|
|
|
144
146
|
Credit the customer from the `deposit.credited` webhook.
|
|
145
147
|
|
|
146
148
|
```tsx
|
|
147
|
-
import { DepositAddress } from "@phala/pay
|
|
149
|
+
import { DepositAddress } from "@phala/pay-react";
|
|
148
150
|
|
|
149
151
|
<DepositAddress
|
|
150
152
|
depositAddress={{ address, networks }}
|
|
@@ -193,13 +195,19 @@ on Sepolia and about 7 seconds on Base Sepolia"); until the view is loaded it na
|
|
|
193
195
|
Import the static stylesheet once in your application entry point:
|
|
194
196
|
|
|
195
197
|
```ts
|
|
196
|
-
import "@phala/pay/styles.css";
|
|
198
|
+
import "@phala/pay-react/styles.css";
|
|
197
199
|
```
|
|
198
200
|
|
|
199
201
|
Set these CSS custom properties in your own stylesheet, after the SDK stylesheet, using a
|
|
200
202
|
selector such as `.pp-root[data-theme]`. For a light primary color, set a dark
|
|
201
203
|
`--pp-accessible-color-on-color-primary` so the button label stays readable.
|
|
202
204
|
|
|
205
|
+
For a frameless host dialog, set `--pp-root-border: 0`, `--pp-root-padding: 0`,
|
|
206
|
+
`--pp-root-max-width: none`, and `--pp-root-background: transparent` on the component or its
|
|
207
|
+
ancestor. Defaults remain `1px solid var(--pp-color-border)`, `20px`, `440px`, and
|
|
208
|
+
`var(--pp-color-background)`. Checkout opens QR code when no browser wallet is discovered;
|
|
209
|
+
the Wallet tab remains available.
|
|
210
|
+
|
|
203
211
|
```css
|
|
204
212
|
.pp-root[data-theme] {
|
|
205
213
|
--pp-color-primary: #cdfa50;
|
|
@@ -208,6 +216,11 @@ selector such as `.pp-root[data-theme]`. For a light primary color, set a dark
|
|
|
208
216
|
}
|
|
209
217
|
```
|
|
210
218
|
|
|
219
|
+
To map your own light/dark tokens on `.pp-root`, omit `appearance.theme` and load your mapping
|
|
220
|
+
after the SDK stylesheet. Passing `theme: "dark"` sets `data-theme="dark"`, whose SDK selector
|
|
221
|
+
`.pp-root[data-theme="dark"]` overrides a plain `.pp-root` mapping. If you also pass the dark
|
|
222
|
+
theme, target `.pp-root[data-theme="dark"]` (or `.pp-root[data-theme]`) in your mapping.
|
|
223
|
+
|
|
211
224
|
### Content Security Policy
|
|
212
225
|
|
|
213
226
|
The components inject no style elements or style attributes. Serve the bundled CSS from your
|
|
@@ -256,55 +269,17 @@ quote's `payment_uri`, after checking that it pays exactly `amount_atomic` to `a
|
|
|
256
269
|
holding less of the token than that sends nothing: `WalletError` with `code`
|
|
257
270
|
`insufficient_balance`.
|
|
258
271
|
|
|
259
|
-
##
|
|
260
|
-
|
|
261
|
-
`@phala/pay/server` is for your backend and takes no API key (call the API itself with a
|
|
262
|
-
restricted key, `ppay_rk_…`, from the backend only, never the browser):
|
|
272
|
+
## React components
|
|
263
273
|
|
|
264
|
-
|
|
265
|
-
import { constructEvent, flushTransactions, safeBatch, verifyQuoteAddress } from "@phala/pay/server";
|
|
266
|
-
|
|
267
|
-
// Your pins, configured on your server and never read from the service. The address is derived
|
|
268
|
-
// from your treasury, not the quote's: a mismatch throws AddressMismatchError, and in live mode a
|
|
269
|
-
// chain without a pinned treasury fails closed.
|
|
270
|
-
const pins = { account: "acct_…", factory: FACTORY, implementation: IMPLEMENTATION, treasuries: { 1: TREASURY } };
|
|
271
|
-
const expectedAddress = verifyQuoteAddress(pins, quote); // pass it to <Checkout expectedAddress>
|
|
272
|
-
|
|
273
|
-
// Standard Webhooks v1a (ed25519, WebCrypto: Node 20+, Deno, Bun, edge runtimes). Fails closed
|
|
274
|
-
// unless the signature verifies with a pinned key and the event is your account's in this mode.
|
|
275
|
-
// WEBHOOK_PUBLIC_KEYS: your account's keys in this mode, `whpk_…`, pinned from GET /v1/attestation.
|
|
276
|
-
const event = await constructEvent(rawBody, request.headers, WEBHOOK_PUBLIC_KEYS, {
|
|
277
|
-
expectedAccount: "acct_…",
|
|
278
|
-
expectedLivemode: false,
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
// Sweeping, offline: forwarders from GET /v1/forwarders?sweepable=<token>.
|
|
282
|
-
const calls = flushTransactions(forwarders, PHA);
|
|
283
|
-
const batchFile = safeBatch(1, TREASURY_SAFE, calls); // Safe Transaction Builder JSON
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
`verifyDepositAddress(pins, address)` checks every network of a deposit address the same way.
|
|
287
|
-
`quoteAddress`, `depositAddress`, `forwarderAddress`, `quoteSalt`, and `depositAddressSalt`
|
|
288
|
-
recompute an address offline from a treasury you pass, as the Python SDK does.
|
|
289
|
-
|
|
290
|
-
## Development
|
|
274
|
+
Install `@phala/pay-react` for `Checkout`, `DepositAddress`, hooks, icons, and styles:
|
|
291
275
|
|
|
292
276
|
```sh
|
|
293
|
-
|
|
294
|
-
pnpm run check # typecheck, lint, unit tests, build
|
|
295
|
-
pnpm run e2e # Playwright against Anvil; needs Foundry (anvil, forge) on PATH
|
|
296
|
-
pnpm run e2e:docker # the same, with Chromium from Playwright's image (as CI runs it)
|
|
277
|
+
npm install @phala/pay-react react react-dom @phala/pay viem
|
|
297
278
|
```
|
|
298
279
|
|
|
299
|
-
|
|
300
|
-
EIP-6963 wallet backed by the node (and again through a viem `WalletClient` passed as
|
|
301
|
-
`walletClient`), then decode the QR code and exercise the manual details.
|
|
302
|
-
|
|
303
|
-
## Releases
|
|
280
|
+
Import components from `@phala/pay-react` and styles from `@phala/pay-react/styles.css`. The server client and offline helpers are in `@phala/pay-server`; see its [README](../js-server/README.md).
|
|
304
281
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
[
|
|
309
|
-
[its releases before v0.5.0](https://github.com/Phala-Network/phala-pay/blob/main/sdk/js/CHANGELOG.md),
|
|
310
|
-
versioned on their own, stay in `sdk/js`.
|
|
282
|
+
The checkout session retains its last known status and quote during temporary network/5xx outages
|
|
283
|
+
and exposes `reconnecting: true` with no permanent error. Polling resumes with bounded backoff and
|
|
284
|
+
Retry-After; a successful refresh clears the reconnecting state. Invalid-secret and address-mismatch
|
|
285
|
+
handling remains unchanged. See [planned upgrades](../../docs/integration.md#planned-upgrades-and-reconnecting).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
web3icons (@web3icons/core@4.0.57)
|
|
2
|
+
https://github.com/0xa3k5/web3icons
|
|
3
|
+
Vendored branded token and network SVGs.
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2024 0xa3k5
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
package/dist/chains.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Chain } from "viem";
|
|
2
|
+
/** Icon family stored with the chain registry, including testnets. */
|
|
3
|
+
export declare function networkIconName(chainId: number): "ethereum" | "base" | undefined;
|
|
2
4
|
export declare function knownChain(chainId: number): Chain | undefined;
|
|
3
5
|
/** A human name for the network, for example `Sepolia`. */
|
|
4
6
|
export declare function networkName(chainId: number): string;
|
package/dist/chains.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAWlC,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAEhF;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE7D;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGhF"}
|
package/dist/chains.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { base, baseSepolia, mainnet, sepolia } from "viem/chains";
|
|
2
2
|
/** Chains a wallet can be asked to add; any other chain must already be in the wallet. */
|
|
3
|
-
const CHAINS = [
|
|
3
|
+
const CHAINS = [
|
|
4
|
+
{ chain: mainnet, icon: "ethereum" },
|
|
5
|
+
{ chain: sepolia, icon: "ethereum" },
|
|
6
|
+
{ chain: base, icon: "base" },
|
|
7
|
+
{ chain: baseSepolia, icon: "base" },
|
|
8
|
+
];
|
|
9
|
+
/** Icon family stored with the chain registry, including testnets. */
|
|
10
|
+
export function networkIconName(chainId) {
|
|
11
|
+
return CHAINS.find(({ chain }) => chain.id === chainId)?.icon;
|
|
12
|
+
}
|
|
4
13
|
export function knownChain(chainId) {
|
|
5
|
-
return CHAINS.find((chain) => chain.id === chainId);
|
|
14
|
+
return CHAINS.find(({ chain }) => chain.id === chainId)?.chain;
|
|
6
15
|
}
|
|
7
16
|
/** A human name for the network, for example `Sepolia`. */
|
|
8
17
|
export function networkName(chainId) {
|
package/dist/chains.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.js","sourceRoot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AE,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC;IAClE,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,OAAO,IAAI,EAAE,CAAC;AACvE,CAAC"}
|
package/dist/checkout.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { type ClientQuote } from "./quote.js";
|
|
|
13
13
|
* backend expects (`address_mismatch`): nothing is shown to pay.
|
|
14
14
|
*/
|
|
15
15
|
export type CheckoutStatus = "loading" | "waiting" | "seen" | "confirming" | "credited" | "rejected" | "reversed" | "expired" | "canceled" | "error";
|
|
16
|
-
export type CheckoutErrorCode = "invalid_client_secret" | "address_mismatch" | "rate_limited" | "network_error" | "invalid_response" | "api_error";
|
|
16
|
+
export type CheckoutErrorCode = "invalid_client_secret" | "address_mismatch" | "rate_limited" | "network_error" | "service_unavailable" | "invalid_response" | "api_error";
|
|
17
17
|
export interface CheckoutErrorOptions extends ErrorOptions {
|
|
18
18
|
/** The failed response's `Request-Id`, `req_…`, to quote to support. */
|
|
19
19
|
requestId?: string;
|
|
@@ -38,8 +38,10 @@ export declare function responseError(response: Response, notFound: string): Che
|
|
|
38
38
|
export declare function pollDelay(interval: number, failures: number, error: CheckoutError | null): number;
|
|
39
39
|
export interface CheckoutState {
|
|
40
40
|
status: CheckoutStatus;
|
|
41
|
+
/** The last known view is retained while polling reconnects after a temporary outage. */
|
|
42
|
+
reconnecting?: boolean;
|
|
41
43
|
quote: ClientQuote | null;
|
|
42
|
-
/**
|
|
44
|
+
/** Permanent/validation failure details; temporary outages use `reconnecting` instead. */
|
|
43
45
|
error: CheckoutError | null;
|
|
44
46
|
}
|
|
45
47
|
export interface CheckoutOptions {
|
package/dist/checkout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6C,KAAK,WAAW,EAAE,M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AAM,CAAC,EAAE,WAAW,CAAC;IACrB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,IAAI,aAAa,CAAC;IAC1B,gFAAgF;IAChF,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAChE,uDAAuD;IACvD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,mDAAmD;IACnD,OAAO,IAAI,IAAI,CAAC;CACjB;AAKD,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CA8BvF;AASD,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAWrF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CA4HxE"}
|
package/dist/checkout.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requestSignal } from "./request.js";
|
|
1
|
+
import { requestSignal, trimTrailingSlashes } from "./request.js";
|
|
2
2
|
import { getAddress, isAddress, isAddressEqual } from "viem";
|
|
3
3
|
import { parseClientQuote, quoteIdFromClientSecret } from "./quote.js";
|
|
4
4
|
export class CheckoutError extends Error {
|
|
@@ -25,6 +25,13 @@ export function responseError(response, notFound) {
|
|
|
25
25
|
if (response.status === 404) {
|
|
26
26
|
return new CheckoutError("invalid_client_secret", notFound, requestId);
|
|
27
27
|
}
|
|
28
|
+
if (response.status >= 500) {
|
|
29
|
+
const seconds = Number(response.headers.get("retry-after"));
|
|
30
|
+
return new CheckoutError("service_unavailable", "the payment service is temporarily unavailable", {
|
|
31
|
+
...requestId,
|
|
32
|
+
...(Number.isFinite(seconds) && seconds > 0 ? { retryAfter: seconds } : {}),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
28
35
|
if (response.status === 429) {
|
|
29
36
|
const seconds = Number(response.headers.get("retry-after"));
|
|
30
37
|
return new CheckoutError("rate_limited", "too many status requests", {
|
|
@@ -49,7 +56,7 @@ const MAX_BACKOFF = 30_000;
|
|
|
49
56
|
export async function retrieveQuote(options) {
|
|
50
57
|
const quoteId = quoteIdFromClientSecret(options.clientSecret);
|
|
51
58
|
const expected = expectedAddress(options.expectedAddress);
|
|
52
|
-
const base = options.apiBase
|
|
59
|
+
const base = trimTrailingSlashes(options.apiBase);
|
|
53
60
|
const url = `${base}/v1/quotes/${quoteId}?client_secret=${encodeURIComponent(options.clientSecret)}`;
|
|
54
61
|
const fetchImpl = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
55
62
|
// A simple GET with no custom headers, so the browser sends no CORS preflight.
|
|
@@ -113,10 +120,12 @@ export function createCheckout(options) {
|
|
|
113
120
|
let state = { status: "loading", quote: null, error: null };
|
|
114
121
|
let timer;
|
|
115
122
|
let failures = 0;
|
|
123
|
+
let lastFailure = null;
|
|
116
124
|
let destroyed = false;
|
|
117
125
|
let inFlight;
|
|
118
126
|
function setState(next) {
|
|
119
127
|
if (next.status === state.status &&
|
|
128
|
+
next.reconnecting === state.reconnecting &&
|
|
120
129
|
next.error === state.error &&
|
|
121
130
|
JSON.stringify(next.quote) === JSON.stringify(state.quote)) {
|
|
122
131
|
return;
|
|
@@ -144,6 +153,7 @@ export function createCheckout(options) {
|
|
|
144
153
|
return;
|
|
145
154
|
}
|
|
146
155
|
failures = 0;
|
|
156
|
+
lastFailure = null;
|
|
147
157
|
setState({ status: checkoutStatus(quote, now() / 1000), quote, error: null });
|
|
148
158
|
}
|
|
149
159
|
catch (cause) {
|
|
@@ -154,6 +164,7 @@ export function createCheckout(options) {
|
|
|
154
164
|
? cause
|
|
155
165
|
: new CheckoutError("network_error", "could not reach the payment service", { cause });
|
|
156
166
|
failures += 1;
|
|
167
|
+
lastFailure = error;
|
|
157
168
|
const quote = state.quote;
|
|
158
169
|
if (error.code === "address_mismatch") {
|
|
159
170
|
// Fail closed: forget the quote, so nothing about its address is shown.
|
|
@@ -162,6 +173,10 @@ export function createCheckout(options) {
|
|
|
162
173
|
else if (error.code === "invalid_client_secret") {
|
|
163
174
|
setState({ status: "error", quote, error });
|
|
164
175
|
}
|
|
176
|
+
else if (error.code === "network_error" || error.code === "service_unavailable") {
|
|
177
|
+
// Do not infer expiry or discard the payer's view while chain progress is unknown.
|
|
178
|
+
setState({ status: state.status, quote, error: null, reconnecting: true });
|
|
179
|
+
}
|
|
165
180
|
else {
|
|
166
181
|
setState({
|
|
167
182
|
status: quote === null ? state.status : checkoutStatus(quote, now() / 1000),
|
|
@@ -184,7 +199,7 @@ export function createCheckout(options) {
|
|
|
184
199
|
if (finished()) {
|
|
185
200
|
return;
|
|
186
201
|
}
|
|
187
|
-
const delay = pollDelay(interval, failures,
|
|
202
|
+
const delay = pollDelay(interval, failures, lastFailure);
|
|
188
203
|
timer = setTimeout(() => {
|
|
189
204
|
void refresh().then(schedule);
|
|
190
205
|
}, delay);
|
package/dist/checkout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../src/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC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,CAAC,CAAC;QACJ,CAAC;QACD,OAAO;QACP,OAAO;YACL,SAAS,GAAG,IAAI,CAAC;YACjB,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/deposit-address.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requestSignal } from "./request.js";
|
|
1
|
+
import { requestSignal, trimTrailingSlashes } from "./request.js";
|
|
2
2
|
import { CheckoutError, responseError } from "./checkout.js";
|
|
3
3
|
const PAYMENT_STATUSES = ["seen", "confirming", "credited", "rejected", "reversed"];
|
|
4
4
|
/** Returns the deposit address a client secret belongs to (`da_…_secret_…`), or throws. */
|
|
@@ -15,7 +15,7 @@ export function depositAddressIdFromClientSecret(clientSecret) {
|
|
|
15
15
|
*/
|
|
16
16
|
export async function retrieveDepositAddress(options) {
|
|
17
17
|
const id = depositAddressIdFromClientSecret(options.clientSecret);
|
|
18
|
-
const base = options.apiBase
|
|
18
|
+
const base = trimTrailingSlashes(options.apiBase);
|
|
19
19
|
const url = `${base}/v1/deposit_addresses/${id}?client_secret=${encodeURIComponent(options.clientSecret)}`;
|
|
20
20
|
const fetchImpl = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
21
21
|
// A simple GET with no custom headers, so the browser sends no CORS preflight.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit-address.js","sourceRoot":"","sources":["../src/deposit-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"deposit-address.js","sourceRoot":"","sources":["../src/deposit-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CA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AM,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAChE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EACnC,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,wDAAwD,CAAC,CAAC;IAChF,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAyC;QACjD,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAW;QACjC,KAAK;QACL,QAAQ,EAAE,QAAyB;QACnC,aAAa,EAAE,CAAC,CAAC,eAAe,CAAC;QACjC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;QACrB,aAAa,EAAE,aAA8B;QAC7C,OAAO,EAAE,CAAC,CAAC,SAAS,CAAW;KAChC,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAgC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ICON_SVG } from "./icon-svg.js";
|
|
2
|
+
export type IconName = keyof typeof ICON_SVG;
|
|
3
|
+
/** Case-insensitive token symbol; unrecognized symbols use a neutral monogram. */
|
|
4
|
+
export declare function assetIconName(asset: string): IconName | undefined;
|
|
5
|
+
/** First character for a neutral fallback, including an empty-symbol placeholder. */
|
|
6
|
+
export declare function iconMonogram(label: string): string;
|
|
7
|
+
//# sourceMappingURL=icon-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-names.d.ts","sourceRoot":"","sources":["../src/icon-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,QAAQ,CAAC;AAE7C,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAQjE;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Case-insensitive token symbol; unrecognized symbols use a neutral monogram. */
|
|
2
|
+
export function assetIconName(asset) {
|
|
3
|
+
switch (asset.trim().toLowerCase()) {
|
|
4
|
+
case "usdc": return "usdc";
|
|
5
|
+
case "usdt": return "usdt";
|
|
6
|
+
case "pha": return "pha";
|
|
7
|
+
case "eth": return "eth";
|
|
8
|
+
default: return undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/** First character for a neutral fallback, including an empty-symbol placeholder. */
|
|
12
|
+
export function iconMonogram(label) {
|
|
13
|
+
return Array.from(label.trim())[0]?.toUpperCase() ?? "?";
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=icon-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-names.js","sourceRoot":"","sources":["../src/icon-names.ts"],"names":[],"mappings":"AAIA,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QACnC,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC;QAC3B,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC;QAC3B,KAAK,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC;QACzB,KAAK,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC;QACzB,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,GAAG,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Generated from @web3icons/core@4.0.57 by scripts/generate-icons.mjs.
|
|
2
|
+
* SPDX-License-Identifier: MIT; Copyright (c) 2024 0xa3k5.
|
|
3
|
+
* See THIRD_PARTY_NOTICES for the full license. Do not edit.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ICON_SVG: Record<"usdc" | "usdt" | "pha" | "eth" | "ethereum" | "base", string>;
|
|
6
|
+
//# sourceMappingURL=icon-svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-svg.d.ts","sourceRoot":"","sources":["../src/icon-svg.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,EAAE,MAAM,CAO1F,CAAC"}
|
package/dist/icon-svg.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Generated from @web3icons/core@4.0.57 by scripts/generate-icons.mjs.
|
|
2
|
+
* SPDX-License-Identifier: MIT; Copyright (c) 2024 0xa3k5.
|
|
3
|
+
* See THIRD_PARTY_NOTICES for the full license. Do not edit.
|
|
4
|
+
*/
|
|
5
|
+
export const ICON_SVG = {
|
|
6
|
+
usdc: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fill=\"#0B53BF\" d=\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18\"/><path fill=\"#fff\" d=\"M13.62 5.45v1.159a5.64 5.64 0 0 1 4.005 5.394 5.64 5.64 0 0 1-4.005 5.394v1.16a6.74 6.74 0 0 0 5.13-6.554 6.74 6.74 0 0 0-5.13-6.553m-7.245 6.553a5.64 5.64 0 0 1 4.005-5.394V5.45a6.74 6.74 0 0 0-5.13 6.553 6.74 6.74 0 0 0 5.13 6.553v-1.159a5.63 5.63 0 0 1-4.005-5.394\"/><path fill=\"#fff\" d=\"M14.419 13.258c0-2.301-3.606-1.356-3.606-2.627 0-.456.366-.748 1.063-.748.833 0 1.12.405 1.21.95h1.147c-.102-1.024-.69-1.67-1.67-1.863v-.904h-1.125v.872c-1.075.137-1.75.762-1.75 1.693 0 2.312 3.611 1.445 3.611 2.694 0 .472-.455.787-1.226.787-1.007 0-1.339-.444-1.462-1.057H9.49c.073 1.122.764 1.823 1.947 1.999v.886h1.125v-.875c1.153-.149 1.856-.82 1.856-1.807\"/></svg>",
|
|
7
|
+
usdt: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fill=\"#009393\" d=\"m12 19.2-9-8.88L6.433 4.8h11.134L21 10.32zm.9-8.1v-1.098c1.62.08 3.132.396 3.6.805-.544.477-2.493.824-4.5.824s-3.956-.347-4.5-.824c.463-.41 1.98-.72 3.6-.81V11.1zm-5.4-.297v.661c.463.41 1.975.72 3.6.81V14.7h1.8v-2.43c1.62-.081 3.136-.396 3.6-.806v-1.318c-.464-.41-1.98-.725-3.6-.81V8.4h2.7V7.05H8.4V8.4h2.7v.936c-1.625.085-3.137.4-3.6.81z\"/></svg>",
|
|
8
|
+
pha: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#252525\"/><path fill=\"#D1FF52\" fill-rule=\"evenodd\" d=\"M3 3h14.143v3.857H21V12h-3.857V6.857H6.857V12H3zm3.857 12.857h10.286V12H6.857zm0 0V21H3v-5.143z\" clip-rule=\"evenodd\"/></svg>",
|
|
9
|
+
eth: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fill=\"#8FFCF3\" d=\"M12 3v6.65l5.625 2.516z\"/><path fill=\"#CABCF8\" d=\"m12 3-5.625 9.166L12 9.651z\"/><path fill=\"#CBA7F5\" d=\"M12 16.477v4.522l5.625-7.784z\"/><path fill=\"#74A0F3\" d=\"M12 21v-4.523l-5.625-3.262z\"/><path fill=\"#CBA7F5\" d=\"m12 15.43 5.625-3.263L12 9.65z\"/><path fill=\"#74A0F3\" d=\"M6.375 12.167 12 15.429V9.651z\"/><path fill=\"#202699\" fill-rule=\"evenodd\" d=\"m12 15.429-5.625-3.263L12 3l5.625 9.166zM6.749 11.9l5.16-8.41v6.115zm-.077.23 5.238-2.327v5.364zm5.418-2.327v5.364l5.233-3.038zm0-.198 5.16 2.295-5.16-8.41z\" clip-rule=\"evenodd\"/><path fill=\"#202699\" fill-rule=\"evenodd\" d=\"M12 16.406 6.375 13.21 12 21l5.625-7.79zm-4.995-2.633 4.905 2.79v4.005zm5.085 2.79v4.005l4.905-6.795z\" clip-rule=\"evenodd\"/></svg>",
|
|
10
|
+
ethereum: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fill=\"#8FFCF3\" d=\"M12 3v6.651l5.625 2.516z\"/><path fill=\"#CABCF8\" d=\"m12 3-5.625 9.166L12 9.653z\"/><path fill=\"#CBA7F5\" d=\"M12 16.478V21l5.625-7.784z\"/><path fill=\"#74A0F3\" d=\"M12 21v-4.522l-5.625-3.262z\"/><path fill=\"#CBA7F5\" d=\"m12 15.43 5.625-3.263L12 9.652z\"/><path fill=\"#74A0F3\" d=\"M6.375 12.167 12 15.43V9.652z\"/><path fill=\"#202699\" fill-rule=\"evenodd\" d=\"m12 15.43-5.625-3.263L12 3l5.624 9.166zm-5.252-3.528 5.161-8.41v6.114zm-.077.229 5.238-2.327v5.364zm5.418-2.327v5.364l5.234-3.037zm0-.198 5.161 2.296-5.161-8.41z\" clip-rule=\"evenodd\"/><path fill=\"#202699\" fill-rule=\"evenodd\" d=\"m12 16.406-5.625-3.195L12 21l5.624-7.79zm-4.995-2.633 4.904 2.79v4.005zm5.084 2.79v4.005l4.905-6.795z\" clip-rule=\"evenodd\"/></svg>",
|
|
11
|
+
base: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path fill=\"#00F\" d=\"M3 4.706c0-.585 0-.877.11-1.101.106-.215.28-.39.496-.495C3.83 3 4.122 3 4.706 3h14.588c.585 0 .876 0 1.101.11.215.105.389.28.494.495.111.225.111.517.111 1.101v14.588c0 .585 0 .876-.11 1.101-.106.215-.28.389-.495.494-.225.111-.517.111-1.101.111H4.706c-.585 0-.876 0-1.101-.11a1.08 1.08 0 0 1-.494-.495C3 20.17 3 19.878 3 19.294z\"/></svg>",
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=icon-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-svg.js","sourceRoot":"","sources":["../src/icon-svg.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAA0E;IAC7F,IAAI,EAAE,o3BAAo3B;IAC13B,IAAI,EAAE,ufAAuf;IAC7f,GAAG,EAAE,uWAAuW;IAC5W,GAAG,EAAE,63BAA63B;IACl4B,QAAQ,EAAE,g4BAAg4B;IAC14B,IAAI,EAAE,yeAAye;CAChf,CAAC"}
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Decorative inline SVG markup; testnets reuse their mainnet family artwork. */
|
|
2
|
+
export declare function networkIcon(chainId: number): string;
|
|
3
|
+
/** Decorative inline SVG markup; keep the asset name visible beside it. */
|
|
4
|
+
export declare function assetIcon(asset: string): string;
|
|
5
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAkBA,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/C"}
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { networkName, networkIconName } from "./chains.js";
|
|
2
|
+
import { ICON_SVG } from "./icon-svg.js";
|
|
3
|
+
import { assetIconName, iconMonogram } from "./icon-names.js";
|
|
4
|
+
function fallback(label) {
|
|
5
|
+
const letter = iconMonogram(label).replace(/[&<>"']/g, (character) => {
|
|
6
|
+
switch (character) {
|
|
7
|
+
case "&": return "&";
|
|
8
|
+
case "<": return "<";
|
|
9
|
+
case ">": return ">";
|
|
10
|
+
case '"': return """;
|
|
11
|
+
default: return "'";
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="11" fill="currentColor" opacity="0.12"/><text x="12" y="16" text-anchor="middle" font-family="sans-serif" font-size="12" fill="currentColor">${letter}</text></svg>`;
|
|
15
|
+
}
|
|
16
|
+
/** Decorative inline SVG markup; testnets reuse their mainnet family artwork. */
|
|
17
|
+
export function networkIcon(chainId) {
|
|
18
|
+
const name = networkIconName(chainId);
|
|
19
|
+
const svg = name === undefined ? fallback(networkName(chainId)) : ICON_SVG[name];
|
|
20
|
+
return svg;
|
|
21
|
+
}
|
|
22
|
+
/** Decorative inline SVG markup; keep the asset name visible beside it. */
|
|
23
|
+
export function assetIcon(asset) {
|
|
24
|
+
const name = assetIconName(asset);
|
|
25
|
+
return name === undefined ? fallback(asset) : ICON_SVG[name];
|
|
26
|
+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C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export { CheckoutError, checkoutStatus, createCheckout, retrieveQuote, type CheckoutErrorCode, type CheckoutErrorOptions, type CheckoutOptions, type CheckoutSession, type CheckoutState, type CheckoutStatus, type RetrieveQuoteOptions, } from "./checkout.js";
|
|
1
|
+
export { CheckoutError, checkoutStatus, pollDelay, createCheckout, retrieveQuote, type CheckoutErrorCode, type CheckoutErrorOptions, type CheckoutOptions, type CheckoutSession, type CheckoutState, type CheckoutStatus, type RetrieveQuoteOptions, } from "./checkout.js";
|
|
2
2
|
export { PhalaPay, type PhalaPayOptions } from "./client.js";
|
|
3
3
|
export { depositAddressIdFromClientSecret, parseClientDepositAddress, retrieveDepositAddress, type ClientDepositAddress, type ClientDepositAddressNetwork, type DepositAddressPayment, type RetrieveDepositAddressOptions, } from "./deposit-address.js";
|
|
4
|
-
export { knownChain, networkName, transactionUrl } from "./chains.js";
|
|
5
|
-
export { formatAmount, formatCountdown, formatTokenAmount, tokenAmount } from "./format.js";
|
|
4
|
+
export { knownChain, networkName, transactionUrl, networkIconName } from "./chains.js";
|
|
5
|
+
export { formatAmount, formatCountdown, formatMinorAmount, formatTokenAmount, formatWait, tokenAmount } from "./format.js";
|
|
6
6
|
export { depositAddressTransfer, parseTransferUri, quoteTransfer, type DepositAddressAsset, type DepositAddressDetails, type DepositAddressNetwork, type TokenTransfer, type TransferRequest, } from "./payment.js";
|
|
7
7
|
export { parseClientQuote, quoteIdFromClientSecret, type ClientQuote } from "./quote.js";
|
|
8
|
+
export { assetIconName, iconMonogram, type IconName } from "./icon-names.js";
|
|
8
9
|
export { INJECTED_WALLET_UUID, WalletError, payWithWallet, watchWallets, type EthereumProvider, type Wallet, type WalletErrorCode, type WalletInfo, } from "./wallet.js";
|
|
10
|
+
export { networkIcon, assetIcon } from "./icons.js";
|
|
11
|
+
export type { CheckoutParams } from "./shared/checkout-params.js";
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,GACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,GACnC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export { CheckoutError, checkoutStatus, createCheckout, retrieveQuote, } from "./checkout.js";
|
|
1
|
+
export { CheckoutError, checkoutStatus, pollDelay, createCheckout, retrieveQuote, } from "./checkout.js";
|
|
2
2
|
export { PhalaPay } from "./client.js";
|
|
3
3
|
export { depositAddressIdFromClientSecret, parseClientDepositAddress, retrieveDepositAddress, } from "./deposit-address.js";
|
|
4
|
-
export { knownChain, networkName, transactionUrl } from "./chains.js";
|
|
5
|
-
export { formatAmount, formatCountdown, formatTokenAmount, tokenAmount } from "./format.js";
|
|
4
|
+
export { knownChain, networkName, transactionUrl, networkIconName } from "./chains.js";
|
|
5
|
+
export { formatAmount, formatCountdown, formatMinorAmount, formatTokenAmount, formatWait, tokenAmount } from "./format.js";
|
|
6
6
|
export { depositAddressTransfer, parseTransferUri, quoteTransfer, } from "./payment.js";
|
|
7
7
|
export { parseClientQuote, quoteIdFromClientSecret } from "./quote.js";
|
|
8
|
+
export { assetIconName, iconMonogram } from "./icon-names.js";
|
|
8
9
|
export { INJECTED_WALLET_UUID, WalletError, payWithWallet, watchWallets, } from "./wallet.js";
|
|
10
|
+
export { networkIcon, assetIcon } from "./icons.js";
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,GAQd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAwB,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,sBAAsB,GAKvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,GAQd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAwB,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,sBAAsB,GAKvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,GAMd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAoB,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,YAAY,GAKb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/request.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export declare function requestSignal(options: {
|
|
|
3
3
|
signal?: AbortSignal;
|
|
4
4
|
requestTimeout?: number;
|
|
5
5
|
}): AbortSignal;
|
|
6
|
+
/** `apiBase` without trailing slashes, in linear time (a `/\/+$/` regex is quadratic). */
|
|
7
|
+
export declare function trimTrailingSlashes(apiBase: string): string;
|
|
6
8
|
//# sourceMappingURL=request.d.ts.map
|
package/dist/request.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,WAAW,CAGd"}
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,WAAW,CAGd;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI3D"}
|