stablevoy 1.3.0 → 1.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0
4
+
5
+ - `Store.payoutAddresses`: the account's payout wallets per network family (`evm`, `tron`), null when not set. Read only; they are changed in the dashboard with a wallet signature. Needs the API that sends the field (November 2026); an older answer without it is refused as an unexpected response.
6
+ - `StablevoyConnect.exchangeApp()` redeems the code an app on the merchant's own computer got from the dashboard (the Stablevoy MCP server's login) for one API key per approved store. Never retried, since the code works once.
7
+
8
+ ## 1.4.0
9
+
10
+ - `Store` carries `evmPayoutStatus` (`plain`, `acknowledged`, `unacknowledged`, `unchecked`, or null without an EVM payout wallet, values in `EVM_PAYOUT_STATUS`) and `evmNetworksBlocked`: the enabled EVM networks new invoices leave out while the EVM payout wallet is not confirmed in the dashboard. `evmPayoutNeedsReview(store)` tells it.
11
+ - `canAcceptPayments(store)` also counts the blocked EVM networks, so it is false for a store whose only networks are blocked.
12
+ - `ApiError.PAYOUT_ADDRESS_UNACKNOWLEDGED` names the error code an invoice gets when the EVM payout wallet is not confirmed and the store has no other network.
13
+ - New webhook type `store.payout_attention`: the EVM payout wallet of the account became unconfirmed, or is fine again. It carries no invoice; the data has `store` and `payout` (status, blocked networks, dashboard link).
14
+
3
15
  ## 1.3.0
4
16
 
5
17
  - New webhook type `invoice.payment_flagged`: a payment of an invoice that is already paid, overpaid or paid late was flagged by sanctions screening. The invoice keeps its status; the flagged payment is in the event data under `payment`.
package/README.md CHANGED
@@ -54,10 +54,10 @@ for await (const invoice of stablevoy.invoices.all({ source: InvoiceSourceFilter
54
54
 
55
55
  ## Check the store before going live
56
56
 
57
- Invoices need a payout wallet for at least one network the store accepts; without one every invoice is refused with `payout_address_not_set`. Read the store of the key to find out in advance, and tell the merchant about networks buyers will not be offered:
57
+ Invoices need a payout wallet for at least one network the store accepts; without one every invoice is refused with `payout_address_not_set`. An EVM payout wallet that is a smart contract wallet or an EIP-7702 delegation must be confirmed in the dashboard, and confirmed again when it changes; until then new invoices leave out the EVM networks, and a store with nothing else is refused with `payout_address_unacknowledged`. Read the store of the key to find out in advance, and tell the merchant about networks buyers will not be offered:
58
58
 
59
59
  ```ts
60
- import { canAcceptPayments } from 'stablevoy';
60
+ import { canAcceptPayments, evmPayoutNeedsReview } from 'stablevoy';
61
61
 
62
62
  const store = await stablevoy.stores.current();
63
63
  if (!canAcceptPayments(store)) {
@@ -66,6 +66,10 @@ if (!canAcceptPayments(store)) {
66
66
  if (store.networksWithoutPayout.length > 0) {
67
67
  // These enabled networks have no payout wallet, so buyers do not see them.
68
68
  }
69
+ console.log(store.payoutAddresses); // { evm: '0x...', tron: null }: where payouts go, read only
70
+ if (evmPayoutNeedsReview(store)) {
71
+ // The EVM payout wallet is not confirmed: store.evmNetworksBlocked are not offered until the merchant reviews it in the dashboard.
72
+ }
69
73
  ```
70
74
 
71
75
  ## Connect a shop in one click
@@ -87,7 +91,7 @@ await stablevoy.stores.revokeCurrentKey();
87
91
 
88
92
  ## Verify webhooks
89
93
 
90
- Stablevoy posts an event to your webhook URL when an invoice is paid, overpaid, underpaid, expired, paid late or put on hold. One more, `invoice.payment_flagged`, comes when a later transfer to an invoice that is already paid is flagged by sanctions screening: the invoice keeps its paid status, so this event is not a new payment; the flagged transfer is in `event.data.payment`. Check the signature before you trust it, using the signing secret shown when you set the webhook in the dashboard. Pass the raw body, exactly as received: a body parsed to JSON and serialised again no longer matches the signature.
94
+ Stablevoy posts an event to your webhook URL when an invoice is paid, overpaid, underpaid, expired, paid late or put on hold. One more, `invoice.payment_flagged`, comes when a later transfer to an invoice that is already paid is flagged by sanctions screening: the invoice keeps its paid status, so this event is not a new payment; the flagged transfer is in `event.data.payment`. Another, `store.payout_attention`, comes when the EVM payout wallet of the account becomes unconfirmed and again when it is fine: it carries no invoice, `event.data.payout` has the new `status`, the `blockedNetworks` and a `dashboardUrl`; read `stablevoy.stores.current()` again for the current state. Check the signature before you trust it, using the signing secret shown when you set the webhook in the dashboard. Pass the raw body, exactly as received: a body parsed to JSON and serialised again no longer matches the signature.
91
95
 
92
96
  Express:
93
97
 
@@ -1,6 +1,7 @@
1
1
  import type { ConnectionOptions } from './ConnectionOptions.js';
2
2
  import type { Transport } from './http/Transport.js';
3
3
  import { type ConnectedStore } from './model/ConnectedStore.js';
4
+ import { type ConnectedApp } from './model/ConnectedApp.js';
4
5
  /** A connect code to redeem: the code from the callback, the PKCE verifier kept for it, and the shop's own URL. */
5
6
  export interface ExchangeInput {
6
7
  readonly code: string;
@@ -8,6 +9,11 @@ export interface ExchangeInput {
8
9
  /** The same URL the shop sent when the connection was started. */
9
10
  readonly site: string;
10
11
  }
12
+ /** An app connect code to redeem: the code from the loopback callback and the PKCE verifier kept for it. */
13
+ export interface ExchangeAppInput {
14
+ readonly code: string;
15
+ readonly codeVerifier: string;
16
+ }
11
17
  /**
12
18
  * One-click connect: the shop sends the merchant to the Stablevoy dashboard with a PKCE challenge, gets a code back on its
13
19
  * callback and redeems it here for its API key and webhook secret. Needs no API key, since the shop has none yet.
@@ -21,5 +27,10 @@ export declare class StablevoyConnect {
21
27
  * A refusal (invalid_connect_code, store_linked_to_other_site, store_connected_other_platform) is an ApiError with that code.
22
28
  */
23
29
  exchange(input: ExchangeInput): Promise<ConnectedStore>;
30
+ /**
31
+ * Redeems the code an app on the merchant's own computer got on its loopback address (npx stablevoy-mcp login): one new
32
+ * API key per approved store. It works once, so this call is never retried. A refusal is an ApiError invalid_connect_code.
33
+ */
34
+ exchangeApp(input: ExchangeAppInput): Promise<ConnectedApp>;
24
35
  }
25
36
  //# sourceMappingURL=StablevoyConnect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StablevoyConnect.d.ts","sourceRoot":"","sources":["../src/StablevoyConnect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB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Aa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAEjD,MAAM,CAAC,MAAM,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB;IAIhE;;;OAGG;IACG,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAK7D;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;CAIlE"}
@@ -1,5 +1,6 @@
1
1
  import { createFetchTransport } from './http/createFetchTransport.js';
2
2
  import { parseConnectedStore } from './model/ConnectedStore.js';
3
+ import { parseConnectedApp } from './model/ConnectedApp.js';
3
4
  import { Fields } from './model/Fields.js';
4
5
  /**
5
6
  * One-click connect: the shop sends the merchant to the Stablevoy dashboard with a PKCE challenge, gets a code back on its
@@ -21,5 +22,13 @@ export class StablevoyConnect {
21
22
  const body = { code: input.code, codeVerifier: input.codeVerifier, site: input.site };
22
23
  return parseConnectedStore(Fields.of(await this.transport.post('/v1/connect/exchange', body), 'connected'));
23
24
  }
25
+ /**
26
+ * Redeems the code an app on the merchant's own computer got on its loopback address (npx stablevoy-mcp login): one new
27
+ * API key per approved store. It works once, so this call is never retried. A refusal is an ApiError invalid_connect_code.
28
+ */
29
+ async exchangeApp(input) {
30
+ const body = { code: input.code, codeVerifier: input.codeVerifier };
31
+ return parseConnectedApp(Fields.of(await this.transport.post('/v1/connect/app-exchange', body), 'connected'));
32
+ }
24
33
  }
25
34
  //# sourceMappingURL=StablevoyConnect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StablevoyConnect.js","sourceRoot":"","sources":["../src/StablevoyConnect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAuB,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAU3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AAI,EAAE,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;QACtF,OAAO,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAC9G,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,KAAuB;QACvC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;QACpE,OAAO,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,0BAA0B,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAChH,CAAC;CACF"}
@@ -19,6 +19,11 @@ export interface ApiErrorDetails {
19
19
  export declare class ApiError extends StablevoyError {
20
20
  /** No enabled network of the store has a payout wallet; canAcceptPayments(store) tells it in advance. */
21
21
  static readonly PAYOUT_ADDRESS_NOT_SET = "payout_address_not_set";
22
+ /**
23
+ * The EVM payout wallet is not confirmed in the dashboard (or changed since) and the store has no other network to offer;
24
+ * evmPayoutNeedsReview(store) and canAcceptPayments(store) tell it in advance.
25
+ */
26
+ static readonly PAYOUT_ADDRESS_UNACKNOWLEDGED = "payout_address_unacknowledged";
22
27
  readonly status: number;
23
28
  readonly code: string;
24
29
  readonly detail: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiError.d.ts","sourceRoot":"","sources":["../../src/errors/ApiError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,M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,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,cAAc;IAC1C,yGAAyG;IACzG,MAAM,CAAC,QAAQ,CAAC,sBAAsB,4BAA4B;IAClE;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,6BAA6B,mCAAmC;IAEhF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,sHAAsH;IACtH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;gBAE1B,OAAO,EAAE,eAAe;CAUrC"}
@@ -6,6 +6,11 @@ import { StablevoyError } from './StablevoyError.js';
6
6
  export class ApiError extends StablevoyError {
7
7
  /** No enabled network of the store has a payout wallet; canAcceptPayments(store) tells it in advance. */
8
8
  static PAYOUT_ADDRESS_NOT_SET = 'payout_address_not_set';
9
+ /**
10
+ * The EVM payout wallet is not confirmed in the dashboard (or changed since) and the store has no other network to offer;
11
+ * evmPayoutNeedsReview(store) and canAcceptPayments(store) tell it in advance.
12
+ */
13
+ static PAYOUT_ADDRESS_UNACKNOWLEDGED = 'payout_address_unacknowledged';
9
14
  status;
10
15
  code;
11
16
  detail;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiError.js","sourceRoot":"","sources":["../../src/errors/ApiError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAiBrD;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,cAAc;IAC1C,yGAAyG;IACzG,MAAM,CAAU,sBAAsB,GAAG,wBAAwB,CAAC;IAEzD,MAAM,CAAS;IACf,IAAI,CAAS;IACb,MAAM,CAAS;IACf,IAAI,CAAgB;IAC7B,2CAA2C;IAClC,MAAM,CAA0B;IACzC,8DAA8D;IACrD,iBAAiB,CAAgB;IAC1C,sHAAsH;IAC7G,aAAa,CAAgB;IAEtC,YAAY,OAAwB;QAClC,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,UAAU,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACnD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC"}
1
+ {"version":3,"file":"ApiError.js","sourceRoot":"","sources":["../../src/errors/ApiError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAiBrD;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,cAAc;IAC1C,yGAAyG;IACzG,MAAM,CAAU,sBAAsB,GAAG,wBAAwB,CAAC;IAClE;;;OAGG;IACH,MAAM,CAAU,6BAA6B,GAAG,+BAA+B,CAAC;IAEvE,MAAM,CAAS;IACf,IAAI,CAAS;IACb,MAAM,CAAS;IACf,IAAI,CAAgB;IAC7B,2CAA2C;IAClC,MAAM,CAA0B;IACzC,8DAA8D;IACrD,iBAAiB,CAAgB;IAC1C,sHAAsH;IAC7G,aAAa,CAAgB;IAEtC,YAAY,OAAwB;QAClC,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,UAAU,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACnD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export { Stablevoy, type StablevoyOptions } from './Stablevoy.js';
2
- export { StablevoyConnect, type ExchangeInput } from './StablevoyConnect.js';
2
+ export { StablevoyConnect, type ExchangeAppInput, type ExchangeInput } from './StablevoyConnect.js';
3
3
  export type { ConnectionOptions } from './ConnectionOptions.js';
4
4
  export type { ConnectedStore } from './model/ConnectedStore.js';
5
+ export type { ConnectedApp, ConnectedAppStore } from './model/ConnectedApp.js';
5
6
  export { VERSION } from './version.js';
6
7
  export { RetryPolicy } from './http/RetryPolicy.js';
7
8
  export type { Sleep } from './http/Sleep.js';
@@ -12,8 +13,8 @@ export { Platform } from './resources/Platform.js';
12
13
  export { InvoiceStatus, isPaidStatus } from './model/InvoiceStatus.js';
13
14
  export { InvoiceSourceFilter, InvoiceSourceKind, type InvoiceSource } from './model/InvoiceSource.js';
14
15
  export type { CreateInvoiceInput, CreatedInvoice, DepositAddress, Invoice, InvoicePage, Payment } from './model/Invoice.js';
15
- export type { Limits, Network, Pricing, Store, Token } from './model/Platform.js';
16
- export { canAcceptPayments } from './model/Platform.js';
16
+ export type { Limits, Network, PayoutAddresses, Pricing, Store, Token } from './model/Platform.js';
17
+ export { canAcceptPayments, evmPayoutNeedsReview, EVM_PAYOUT_STATUS } from './model/Platform.js';
17
18
  export { WebhookVerifier, type WebhookVerifierOptions } from './webhook/WebhookVerifier.js';
18
19
  export type { WebhookEvent } from './webhook/WebhookEvent.js';
19
20
  export type { Clock } from './time/Clock.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAA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B,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ export { Stores } from './resources/Stores.js';
7
7
  export { Platform } from './resources/Platform.js';
8
8
  export { InvoiceStatus, isPaidStatus } from './model/InvoiceStatus.js';
9
9
  export { InvoiceSourceFilter, InvoiceSourceKind } from './model/InvoiceSource.js';
10
- export { canAcceptPayments } from './model/Platform.js';
10
+ export { canAcceptPayments, evmPayoutNeedsReview, EVM_PAYOUT_STATUS } from './model/Platform.js';
11
11
  export { WebhookVerifier } from './webhook/WebhookVerifier.js';
12
12
  export { StablevoyError } from './errors/StablevoyError.js';
13
13
  export { ApiError } from './errors/Api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cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Fields } from './Fields.js';
2
+ /** One store an app on the merchant's computer was approved for, with its new API key. */
3
+ export interface ConnectedAppStore {
4
+ readonly storeId: string;
5
+ readonly storeName: string;
6
+ readonly apiKey: string;
7
+ }
8
+ /** What a redeemed app connect code gives: one API key per approved store, in the order they were approved. */
9
+ export interface ConnectedApp {
10
+ readonly stores: readonly ConnectedAppStore[];
11
+ }
12
+ export declare function parseConnectedApp(f: Fields): ConnectedApp;
13
+ //# sourceMappingURL=ConnectedApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectedApp.d.ts","sourceRoot":"","sources":["../../src/model/ConnectedApp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,0FAA0F;AAC1F,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,+GAA+G;AAC/G,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC/C;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAQzD"}
@@ -0,0 +1,13 @@
1
+ import { UnexpectedResponseError } from '../errors/UnexpectedResponseError.js';
2
+ export function parseConnectedApp(f) {
3
+ const stores = f.objects('stores', (s) => {
4
+ const apiKey = s.string('apiKey');
5
+ if (!/^sk_(live|test)_/.test(apiKey))
6
+ throw new UnexpectedResponseError(`${s.pathOf('apiKey')} is not an API key (sk_live_ or sk_test_)`);
7
+ return { storeId: s.string('id'), storeName: s.string('name'), apiKey };
8
+ });
9
+ if (stores.length === 0)
10
+ throw new UnexpectedResponseError(`${f.pathOf('stores')} is empty`);
11
+ return { stores };
12
+ }
13
+ //# sourceMappingURL=ConnectedApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectedApp.js","sourceRoot":"","sources":["../../src/model/ConnectedApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAe/E,MAAM,UAAU,iBAAiB,CAAC,CAAS;IACzC,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;QACvC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,uBAAuB,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,2CAA2C,CAAC,CAAC;QAC1I,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,uBAAuB,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC7F,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
@@ -1,4 +1,11 @@
1
1
  import type { Fields } from './Fields.js';
2
+ /** Values of Store.evmPayoutStatus. */
3
+ export declare const EVM_PAYOUT_STATUS: {
4
+ readonly PLAIN: "plain";
5
+ readonly ACKNOWLEDGED: "acknowledged";
6
+ readonly UNACKNOWLEDGED: "unacknowledged";
7
+ readonly UNCHECKED: "unchecked";
8
+ };
2
9
  /** The store the API key belongs to. */
3
10
  export interface Store {
4
11
  readonly id: string;
@@ -16,13 +23,35 @@ export interface Store {
16
23
  readonly createdAt: Date;
17
24
  /** The plugin connected to the store in one click ('woocommerce', 'edd', 'whmcs'), or null. */
18
25
  readonly connectedPlatform: string | null;
26
+ /**
27
+ * The EVM payout wallet as last read on every EVM network: plain (a regular wallet), acknowledged (a smart contract wallet
28
+ * or EIP-7702 delegation the merchant confirmed), unacknowledged (not confirmed, or changed since: the EVM networks are
29
+ * left out of new invoices until the merchant reviews it in the dashboard), unchecked (not read yet), or null when the
30
+ * account has no EVM payout wallet.
31
+ */
32
+ readonly evmPayoutStatus: string | null;
33
+ /** Enabled EVM networks new invoices leave out because evmPayoutStatus is unacknowledged; empty otherwise. */
34
+ readonly evmNetworksBlocked: readonly string[];
35
+ /** The account's payout wallets per network family, null when not set. Read only: they change in the dashboard with a wallet signature. */
36
+ readonly payoutAddresses: PayoutAddresses;
37
+ }
38
+ export interface PayoutAddresses {
39
+ readonly evm: string | null;
40
+ readonly tron: string | null;
19
41
  }
20
42
  export declare function parseStore(f: Fields): Store;
21
43
  /**
22
- * False when no enabled network has a payout wallet: every invoice would be refused with payout_address_not_set. Check it
23
- * before offering the payment method, and show the merchant networksWithoutPayout when it is not empty.
44
+ * False when no enabled network can be paid: none has a payout wallet (invoices are refused with payout_address_not_set),
45
+ * or the only ones left are EVM networks blocked by an unconfirmed EVM payout wallet (payout_address_unacknowledged). Check
46
+ * it before offering the payment method, and show the merchant networksWithoutPayout and evmNetworksBlocked when they are
47
+ * not empty.
24
48
  */
25
49
  export declare function canAcceptPayments(store: Store): boolean;
50
+ /**
51
+ * True while the EVM payout wallet is not confirmed in the Stablevoy dashboard: show the merchant evmNetworksBlocked and
52
+ * send them to the dashboard. A store.payout_attention webhook tells when this changes.
53
+ */
54
+ export declare function evmPayoutNeedsReview(store: Store): boolean;
26
55
  /** The smallest and largest invoice the platform accepts, in US cents. */
27
56
  export interface Limits {
28
57
  readonly minInvoiceUsdCents: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Platform.d.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GAAG,IAAI,CAAC;IAChD,uEAAuE;IACvE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAe/C"}
@@ -1,3 +1,10 @@
1
+ /** Values of Store.evmPayoutStatus. */
2
+ export const EVM_PAYOUT_STATUS = {
3
+ PLAIN: 'plain',
4
+ ACKNOWLEDGED: 'acknowledged',
5
+ UNACKNOWLEDGED: 'unacknowledged',
6
+ UNCHECKED: 'unchecked',
7
+ };
1
8
  export function parseStore(f) {
2
9
  return {
3
10
  id: f.string('id'),
@@ -12,14 +19,29 @@ export function parseStore(f) {
12
19
  defaultReturnUrl: f.nullableString('defaultReturnUrl'),
13
20
  createdAt: f.date('createdAt'),
14
21
  connectedPlatform: f.nullableString('connectedPlatform'),
22
+ evmPayoutStatus: f.nullableString('evmPayoutStatus'),
23
+ evmNetworksBlocked: f.strings('evmNetworksBlocked'),
24
+ payoutAddresses: parsePayoutAddresses(f.object('payoutAddresses')),
15
25
  };
16
26
  }
27
+ function parsePayoutAddresses(f) {
28
+ return { evm: f.nullableString('evm'), tron: f.nullableString('tron') };
29
+ }
17
30
  /**
18
- * False when no enabled network has a payout wallet: every invoice would be refused with payout_address_not_set. Check it
19
- * before offering the payment method, and show the merchant networksWithoutPayout when it is not empty.
31
+ * False when no enabled network can be paid: none has a payout wallet (invoices are refused with payout_address_not_set),
32
+ * or the only ones left are EVM networks blocked by an unconfirmed EVM payout wallet (payout_address_unacknowledged). Check
33
+ * it before offering the payment method, and show the merchant networksWithoutPayout and evmNetworksBlocked when they are
34
+ * not empty.
20
35
  */
21
36
  export function canAcceptPayments(store) {
22
- return store.enabledNetworks.some((key) => !store.networksWithoutPayout.includes(key));
37
+ return store.enabledNetworks.some((key) => !store.networksWithoutPayout.includes(key) && !store.evmNetworksBlocked.includes(key));
38
+ }
39
+ /**
40
+ * True while the EVM payout wallet is not confirmed in the Stablevoy dashboard: show the merchant evmNetworksBlocked and
41
+ * send them to the dashboard. A store.payout_attention webhook tells when this changes.
42
+ */
43
+ export function evmPayoutNeedsReview(store) {
44
+ return store.evmPayoutStatus === EVM_PAYOUT_STATUS.UNACKNOWLEDGED;
23
45
  }
24
46
  export function parseLimits(f) {
25
47
  return { minInvoiceUsdCents: f.int('minInvoiceUsdCents'), maxInvoiceUsdCents: f.int('maxInvoiceUsdCents') };
@@ -1 +1 @@
1
- {"version":3,"file":"Platform.js","sourceRoot":"","sources":["../../src/model/Platform.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QAClB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC1B,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAC7C,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;QACzD,kBAAkB,EAAE,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC;QACvD,kBAAkB,EAAE,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC;QACvD,UAAU,EAAE,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC;QAC1C,UAAU,EAAE,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC;QAC1C,gBAAgB,EAAE,CAAC,CAAC,cAAc,CAAC,kBAAkB,CAAC;QACtD,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QAC9B,iBAAiB,EAAE,CAAC,CAAC,cAAc,CAAC,mBAAmB,CAAC;KACzD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAY;IAC5C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AAG,CAAC,WAAW,CAAC,EAAE,CAAC;AACrH,CAAC;AA2BD,MAAM,UAAU,YAAY,CAAC,CAAS;IACpC,OAAO;QACL,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QACpB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACpC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC1B,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;QACzB,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;QACrC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QAClC,cAAc,EAAE,CAAC,CAAC,cAAc,CAAC,gBAAgB,CAAC;QAClD,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC;QAC5C,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC/H,uBAAuB,EAAE,CAAC,CAAC,cAAc,CAAC,yBAAyB,CAAC;QACpE,kBAAkB,EAAE,CAAC,CAAC,cAAc,CAAC,oBAAoB,CAAC;QAC1D,MAAM,EAAE,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;KACnC,CAAC;AACJ,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.3.0";
1
+ export declare const VERSION = "1.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.3.0';
1
+ export const VERSION = '1.5.0';
2
2
  //# sourceMappingURL=version.js.map
@@ -2,9 +2,11 @@ import type { Fields } from '../model/Fields.js';
2
2
  import { type Invoice } from '../model/Invoice.js';
3
3
  /**
4
4
  * A verified webhook. Types: invoice.paid, invoice.overpaid, invoice.underpaid, invoice.expired, invoice.paid_late,
5
- * invoice.on_hold, invoice.payment_flagged and webhook.test. invoice.payment_flagged: a payment of a settled invoice was
6
- * flagged by screening; the invoice keeps its status and `data.payment` holds the payment. Deliveries can repeat: use `id`
7
- * to process each event once.
5
+ * invoice.on_hold, invoice.payment_flagged, store.payout_attention and webhook.test. invoice.payment_flagged: a payment of a
6
+ * settled invoice was flagged by screening; the invoice keeps its status and `data.payment` holds the payment.
7
+ * store.payout_attention: the EVM payout wallet of the account became unconfirmed or is fine again; `invoice` is null and
8
+ * `data.payout` holds status, blockedNetworks and dashboardUrl. Read stores.current() again for the current state.
9
+ * Deliveries can repeat: use `id` to process each event once.
8
10
  */
9
11
  export interface WebhookEvent {
10
12
  readonly id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookEvent.d.ts","sourceRoot":"","sources":["../../src/webhook/WebhookEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAClD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAIzD"}
1
+ {"version":3,"file":"WebhookEvent.d.ts","sourceRoot":"","sources":["../../src/webhook/WebhookEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAClD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAIzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebhookEvent.js","sourceRoot":"","sources":["../../src/webhook/WebhookEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAgB,MAAM,qBAAqB,CAAC;AAkBjE,MAAM,UAAU,iBAAiB,CAAC,CAAS;IACzC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AAC5K,CAAC"}
1
+ {"version":3,"file":"WebhookEvent.js","sourceRoot":"","sources":["../../src/webhook/WebhookEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAgB,MAAM,qBAAqB,CAAC;AAoBjE,MAAM,UAAU,iBAAiB,CAAC,CAAS;IACzC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;AAC5K,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stablevoy",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Node.js and TypeScript client for the Stablevoy API: non-custodial USDT and USDC payments, invoices and signed webhooks.",
5
5
  "keywords": [
6
6
  "stablevoy",