@peable.to/contracts 5.6.0 → 6.1.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.
@@ -22,6 +22,10 @@ const shared_1 = require("./shared");
22
22
  const sessionFields = {
23
23
  id: zod_1.z.string(),
24
24
  object: zod_1.z.literal('checkout_session'),
25
+ contact_collection: zod_1.z
26
+ .enum(checkout_1.CHECKOUT_CONTACT_COLLECTIONS)
27
+ .optional()
28
+ .describe('Contact policy fixed by the merchant at creation. Absent means email. merchant_account delegates contact and notifications to the merchant account channel; it does not assert a Peable-verified identity.'),
25
29
  livemode: primitives_1.livemode,
26
30
  mode: zod_1.z.enum(checkout_1.CHECKOUT_SESSION_MODES),
27
31
  status: zod_1.z.enum(checkout_1.CHECKOUT_SESSION_STATUSES),
@@ -291,6 +295,10 @@ exports.createCheckoutSessionParams = zod_1.z
291
295
  .optional()
292
296
  .describe('`cus_…`; mutually exclusive with `customer_email`.'),
293
297
  customer_email: shared_1.checkoutEmailParam.optional(),
298
+ contact_collection: zod_1.z
299
+ .enum(checkout_1.CHECKOUT_CONTACT_COLLECTIONS)
300
+ .optional()
301
+ .describe('Defaults to email. merchant_account delegates contact and payment notifications to the merchant, which must have its own authenticated account channel. This is not identity verification by Peable. Payers cannot change this policy.'),
294
302
  customer_creation: zod_1.z
295
303
  .enum(checkout_1.CHECKOUT_CUSTOMER_CREATIONS)
296
304
  .optional()
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.socialRoutes = exports.enrichSchema = exports.enrichParams = exports.socialPaymentsSchema = exports.socialPaymentSchema = exports.socialPaymentsQuery = exports.socialReceiveCursorSchema = exports.socialReceiveCursorQuery = exports.socialNextAddressSchema = exports.socialNextAddressParams = exports.socialPaymentSourceParams = exports.enrichmentResultSchema = exports.socialPaymentSourceSchema = void 0;
3
+ exports.socialRoutes = exports.enrichSchema = exports.enrichParams = exports.socialPaymentsSchema = exports.socialPaymentSchema = exports.socialPaymentsQuery = exports.socialReceiveAddressesSchema = exports.socialReceiveAddressSchema = exports.socialReceiveAddressesQuery = exports.socialReceiveCursorSchema = exports.socialReceiveCursorQuery = exports.socialNextAddressSchema = exports.socialNextAddressParams = exports.socialPaymentSourceParams = exports.enrichmentResultSchema = exports.socialPaymentSourceSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const objects_1 = require("../../common/objects");
6
+ const params_1 = require("../../common/params");
7
+ /** The highest BIP32 non-hardened child index, `int4`'s ceiling (`schema/valueSets.ts`). */
8
+ const MAX_DERIVATION_INDEX = 2147483647;
6
9
  const primitives_1 = require("../../common/primitives");
7
10
  const route_1 = require("../../route");
8
11
  const payments_1 = require("../../vocabulary/payments");
@@ -86,10 +89,10 @@ exports.socialNextAddressSchema = (0, objects_1.defineComponent)('SocialNextAddr
86
89
  const networkQuery = zod_1.z.object({ network: primitives_1.network });
87
90
  exports.socialReceiveCursorQuery = networkQuery;
88
91
  /**
89
- * Lets the caller's device resync its watch window: every `next_address`
90
- * advances a monotonic index whether or not it is ever paid, so a burst of
91
- * reservations can outrun a device that widens only on payment. Watch
92
- * `0..reserved_through + gap`.
92
+ * The caller's cursor and keys. The addresses to watch are
93
+ * `GET /v1/social/me/receive_addresses` (ADR 0021 D9, amended 2026-11-06);
94
+ * `reserved_through` only says how far the cursor went, and the device
95
+ * compares its key with `account_identity_public_key`.
93
96
  */
94
97
  exports.socialReceiveCursorSchema = (0, objects_1.defineComponent)('SocialReceiveCursor', zod_1.z
95
98
  .object({
@@ -108,6 +111,58 @@ exports.socialReceiveCursorSchema = (0, objects_1.defineComponent)('SocialReceiv
108
111
  .describe("The caller's CURRENT identity public key: their DID's `#key-1`, read from Oxy at request time (never cached), as lowercase hex of the key exactly as the DID publishes it (`publicKeyHex`, the compressed secp256k1 key) — the same encoding as `identity_public_key`. Compare the device's key with THIS, not with `identity_public_key`, which only says what the last reservation used. `null` for a keyless (custodial) account."),
109
112
  })
110
113
  .strict());
114
+ /**
115
+ * The caller's receive addresses after a sync cursor (ADR 0021 D9, amended
116
+ * 2026-11-06). `after` is the `sync_cursor` of the previous answer, `0` (the
117
+ * default) from the start.
118
+ */
119
+ exports.socialReceiveAddressesQuery = zod_1.z
120
+ .object({
121
+ network: primitives_1.network,
122
+ after: (0, params_1.queryInteger)({ min: 0, max: MAX_DERIVATION_INDEX })
123
+ .optional()
124
+ .describe('The `sync_cursor` of the previous page or sync; absent (or `0`) lists from the first address.'),
125
+ limit: (0, params_1.queryInteger)({ min: 1, max: payments_1.SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX })
126
+ .optional()
127
+ .describe(`At most this many addresses (default ${payments_1.SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT}); a page exceeds it only by addresses sharing its last index.`),
128
+ })
129
+ .strict();
130
+ /**
131
+ * One FairCoin address the gateway handed out in the caller's Peable wallet —
132
+ * for a payment (merchant, seller, invoice, raw intent, one output of a split
133
+ * payment) or an `@username` request — under ANY key the account has had.
134
+ * Addresses are never reused: each is a fresh index of the account's one
135
+ * cursor (ADR 0002, ADR 0021 D5, D9).
136
+ */
137
+ exports.socialReceiveAddressSchema = (0, objects_1.defineComponent)('SocialReceiveAddress', zod_1.z
138
+ .object({
139
+ address: zod_1.z.string().describe('The FairCoin address.'),
140
+ derivation_index: zod_1.z
141
+ .number()
142
+ .int()
143
+ .positive()
144
+ .describe("Its index in the account's social-receive tree (`deriveSocialReceiveAddress(key, index)`); index 0, the stable default address, is never handed out."),
145
+ identity_public_key: zod_1.z
146
+ .string()
147
+ .nullable()
148
+ .describe("The identity public key the address was derived from, in the encoding of the cursor's `identity_public_key` (lowercase hex of the DID `#key-1` bytes). It may be a key the account has since replaced. `null` only for an address handed out before keys were recorded."),
149
+ network: primitives_1.network,
150
+ created: primitives_1.unixSeconds.describe('When the address was handed out.'),
151
+ })
152
+ .strict());
153
+ exports.socialReceiveAddressesSchema = (0, objects_1.defineComponent)('SocialReceiveAddresses', zod_1.z
154
+ .object({
155
+ addresses: zod_1.z
156
+ .array(exports.socialReceiveAddressSchema)
157
+ .describe('In ascending `derivation_index`, each address once.'),
158
+ has_more: zod_1.z.boolean().describe('More addresses follow `sync_cursor`: ask again with it.'),
159
+ sync_cursor: zod_1.z
160
+ .number()
161
+ .int()
162
+ .nonnegative()
163
+ .describe('Pass as `after` to continue — the highest `derivation_index` in this page, or `after` when the page is empty. Monotonic: an address handed out later always has a higher index, so a wallet that stored it misses nothing by asking from it.'),
164
+ })
165
+ .strict());
111
166
  exports.socialPaymentsQuery = networkQuery;
112
167
  /**
113
168
  * One social payment as the CALLER saw it — the address-free view, and the
@@ -148,7 +203,7 @@ exports.socialRoutes = [
148
203
  path: '/v1/social/{username}/next_address',
149
204
  tag: 'Social payments',
150
205
  summary: 'Reserve an address to pay a person',
151
- description: "A fresh address of the recipient's, derived from their Oxy identity key. Limited per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one whose wallet watches no further address (every index below its watched bound is taken) 503 `faircoin_receive_tree_full`; paying yourself is refused.",
206
+ description: "A fresh address of the recipient's, derived from their Oxy identity key — or the one this sender already holds and has not paid. Limited per sender and per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one handed too many fresh `@username` addresses in the last day 503 `faircoin_capacity_reached`; paying yourself is refused.",
152
207
  auth: 'user',
153
208
  params: { username: 'The recipient’s Oxy username.' },
154
209
  body: exports.socialNextAddressParams,
@@ -165,6 +220,17 @@ exports.socialRoutes = [
165
220
  query: exports.socialReceiveCursorQuery,
166
221
  response: exports.socialReceiveCursorSchema,
167
222
  }),
223
+ (0, route_1.defineRoute)({
224
+ operationId: 'listSocialReceiveAddresses',
225
+ method: 'get',
226
+ path: '/v1/social/me/receive_addresses',
227
+ tag: 'Social payments',
228
+ summary: "List the caller's receive addresses",
229
+ description: "Every FairCoin address handed out in the caller's Peable wallet on `network` — payments and `@username` alike, under every key the account has had — after `after`, in ascending index, for whoever the session acts as (an organization's, when acting as it). The wallet watches exactly this set (ADR 0021 D9). Read-only.",
230
+ auth: 'user',
231
+ query: exports.socialReceiveAddressesQuery,
232
+ response: exports.socialReceiveAddressesSchema,
233
+ }),
168
234
  (0, route_1.defineRoute)({
169
235
  operationId: 'listSocialPayments',
170
236
  method: 'get',
@@ -4,7 +4,7 @@
4
4
  // the wallet import them without the schemas (`@peable.to/contracts/vocabulary`,
5
5
  // re-exported by `@peable.to/shared-types`).
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.PAYMENT_LINK_LIMITS = exports.CHECKOUT_SESSION_ID_TEMPLATE = exports.CHECKOUT_LIMITS = exports.CHECKOUT_TAX_ID_TYPES = exports.CHECKOUT_CUSTOM_FIELD_TYPES = exports.CHECKOUT_BILLING_ADDRESS_COLLECTIONS = exports.CHECKOUT_CUSTOMER_CREATIONS = exports.CHECKOUT_SUBMIT_TYPES = exports.CHECKOUT_RTL_LOCALES = exports.CHECKOUT_LOCALES = exports.CHECKOUT_UI_MODES = exports.CHECKOUT_PAYMENT_STATUSES = exports.CHECKOUT_SESSION_STATUSES = exports.CHECKOUT_SESSION_MODES = exports.FAIRCOIN_UNAVAILABLE_REASONS = void 0;
7
+ exports.CHECKOUT_CONTACT_COLLECTIONS = exports.PAYMENT_LINK_LIMITS = exports.CHECKOUT_SESSION_ID_TEMPLATE = exports.CHECKOUT_LIMITS = exports.CHECKOUT_TAX_ID_TYPES = exports.CHECKOUT_CUSTOM_FIELD_TYPES = exports.CHECKOUT_BILLING_ADDRESS_COLLECTIONS = exports.CHECKOUT_CUSTOMER_CREATIONS = exports.CHECKOUT_SUBMIT_TYPES = exports.CHECKOUT_RTL_LOCALES = exports.CHECKOUT_LOCALES = exports.CHECKOUT_UI_MODES = exports.CHECKOUT_PAYMENT_STATUSES = exports.CHECKOUT_SESSION_STATUSES = exports.CHECKOUT_SESSION_MODES = exports.FAIRCOIN_UNAVAILABLE_REASONS = void 0;
8
8
  exports.checkoutLocaleDirection = checkoutLocaleDirection;
9
9
  /**
10
10
  * Why FairCoin cannot be paid with on an order right now (ADR 0021). It is
@@ -102,3 +102,5 @@ exports.PAYMENT_LINK_LIMITS = Object.freeze({
102
102
  lineItemsMax: 20,
103
103
  customMessageMax: 500,
104
104
  });
105
+ /** Who owns contact collection for a service-created checkout session. */
106
+ exports.CHECKOUT_CONTACT_COLLECTIONS = ['email', 'merchant_account'];
@@ -134,8 +134,7 @@ exports.ERROR_CODE_DESCRIPTIONS = {
134
134
  faircoin_price_unavailable: 'No fresh FairCoin price exists right now, so this order cannot be quoted in FAIR. The other payment methods still work; try FairCoin again shortly.',
135
135
  faircoin_wallet_missing: "The Peable wallet that receives this payment (the merchant owner's, or the seller's) isn't set up yet, so it cannot be paid in FairCoin. The other payment methods still work.",
136
136
  faircoin_network_closed: 'FairCoin payments on this network are not open on this deployment yet. The other payment methods still work.',
137
- faircoin_capacity_reached: 'Too many FairCoin payments to this recipient are waiting to be paid right now, so no new FairCoin address can be handed out. The other payment methods still work; try FairCoin again shortly.',
138
- faircoin_receive_tree_full: "Every FairCoin address the recipient's Peable wallet watches has been handed out, so no new one can be derived for them. Nothing was reserved.",
137
+ faircoin_capacity_reached: 'Too many FairCoin addresses of this recipient were handed out in the last day without being paid, so no new one is handed out right now. Nothing was reserved. The other payment methods still work; try FairCoin again later.',
139
138
  faircoin_amount_too_small: "One seller's share of this order is below the smallest amount the FairCoin network relays, so it cannot be paid in FairCoin. The other payment methods still work.",
140
139
  credit_note_exceeds_invoice: "The credit note's amount exceeds what the invoice can still credit.",
141
140
  test_clock_unexpected_state: 'The test clock is advancing; wait until it is ready.',
@@ -38,4 +38,3 @@ __exportStar(require("./identity"), exports);
38
38
  __exportStar(require("./merchants"), exports);
39
39
  __exportStar(require("./paymentMethodConfigurations"), exports);
40
40
  __exportStar(require("./realtime"), exports);
41
- __exportStar(require("./receiveTree"), exports);
@@ -4,7 +4,7 @@
4
4
  // contracts are built from. Zod-free, so the wallet and the shared types read
5
5
  // them without bundling a schema.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SIMULATED_FAIRCOIN_OUTCOMES = exports.ENRICH_MAX_ADDRESSES = exports.ENRICHMENT_KINDS = exports.SOCIAL_PAYMENT_DIRECTIONS = exports.SOCIAL_SOURCE_REF_MAX_LENGTH = exports.SOCIAL_SOURCE_APP_MAX_LENGTH = exports.SETUP_INTENT_CANCELLATION_REASONS = exports.SETUP_INTENT_USAGES = exports.SETUP_INTENT_STATUSES = exports.DISPUTE_EVIDENCE_TEXT_MAX = exports.DISPUTE_FILE_EVIDENCE_FIELDS = exports.DISPUTE_TEXT_EVIDENCE_FIELDS = exports.DISPUTE_REASONS = exports.DISPUTE_STATUSES = exports.SETTLEMENT_STATUSES = exports.REFUND_ORIGINS = exports.REFUND_REASONS = exports.REFUND_STATUSES = exports.CLIENT_ACTION_KINDS = exports.PAYMENT_ERROR_TYPES = exports.PAYMENT_METHOD_TYPES = exports.CARD_RAIL_PAYMENT_METHOD_TYPES = exports.PAYMENT_INTENT_SETUP_FUTURE_USAGES = exports.PAYMENT_INTENT_CAPTURE_METHODS = exports.MERCHANT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_STATUSES = exports.PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = exports.PAYMENT_INTENT_RAILS = void 0;
7
+ exports.SIMULATED_FAIRCOIN_OUTCOMES = exports.SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX = exports.SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT = exports.ENRICH_MAX_ADDRESSES = exports.ENRICHMENT_KINDS = exports.SOCIAL_PAYMENT_DIRECTIONS = exports.SOCIAL_SOURCE_REF_MAX_LENGTH = exports.SOCIAL_SOURCE_APP_MAX_LENGTH = exports.SETUP_INTENT_CANCELLATION_REASONS = exports.SETUP_INTENT_USAGES = exports.SETUP_INTENT_STATUSES = exports.DISPUTE_EVIDENCE_TEXT_MAX = exports.DISPUTE_FILE_EVIDENCE_FIELDS = exports.DISPUTE_TEXT_EVIDENCE_FIELDS = exports.DISPUTE_REASONS = exports.DISPUTE_STATUSES = exports.SETTLEMENT_STATUSES = exports.REFUND_ORIGINS = exports.REFUND_REASONS = exports.REFUND_STATUSES = exports.CLIENT_ACTION_KINDS = exports.PAYMENT_ERROR_TYPES = exports.PAYMENT_METHOD_TYPES = exports.CARD_RAIL_PAYMENT_METHOD_TYPES = exports.PAYMENT_INTENT_SETUP_FUTURE_USAGES = exports.PAYMENT_INTENT_CAPTURE_METHODS = exports.MERCHANT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_STATUSES = exports.PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = exports.PAYMENT_INTENT_RAILS = void 0;
8
8
  /**
9
9
  * Which rail moves the money (ADR 0001 D1). On the INTENT, not on the merchant:
10
10
  * one merchant takes both, and the rail decides which fields mean anything.
@@ -13,8 +13,8 @@ exports.PAYMENT_INTENT_RAILS = ['faircoin', 'card'];
13
13
  /**
14
14
  * The longest a PaymentIntent created through the API may stay payable before
15
15
  * it expires (`expires_in_seconds`): 24 hours. A FairCoin payment holds a
16
- * reserved address in the recipient's wallet for as long as it is payable, so
17
- * an unbounded expiry is an address nobody can ever recycle (ADR 0021 D9).
16
+ * reserved address in the recipient's wallet for as long as it is payable, and
17
+ * the recipient's bound on unpaid addresses looks back over a day (ADR 0021 D9).
18
18
  */
19
19
  exports.PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = 24 * 60 * 60;
20
20
  /**
@@ -200,6 +200,12 @@ exports.SOCIAL_PAYMENT_DIRECTIONS = ['sent', 'received'];
200
200
  exports.ENRICHMENT_KINDS = ['merchant', 'user', 'unknown'];
201
201
  /** How many addresses one `POST /v1/enrich` resolves (and one social history lists). */
202
202
  exports.ENRICH_MAX_ADDRESSES = 50;
203
+ /**
204
+ * One page of `GET /v1/social/me/receive_addresses` (ADR 0021 D9, amended
205
+ * 2026-11-06): the default and the most a wallet may ask for at once.
206
+ */
207
+ exports.SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT = 500;
208
+ exports.SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX = 1000;
203
209
  // ---------------------------------------------------------------------------
204
210
  // Test helpers
205
211
  // ---------------------------------------------------------------------------
@@ -7,7 +7,7 @@ import { defineComponent, defineObject, expandable } from '../../common/objects.
7
7
  import { expandOnlyQuery, expandParam, listQuery, metadataCreateParam, metadataUpdateParam, } from '../../common/params.js';
8
8
  import { amount, currency, livemode, metadata, network, unixSeconds, } from '../../common/primitives.js';
9
9
  import { defineRoute } from '../../route.js';
10
- import { CHECKOUT_CUSTOMER_CREATIONS, CHECKOUT_LIMITS, CHECKOUT_LOCALES, CHECKOUT_PAYMENT_STATUSES, CHECKOUT_SESSION_MODES, CHECKOUT_SESSION_STATUSES, CHECKOUT_SUBMIT_TYPES, CHECKOUT_TAX_ID_TYPES, CHECKOUT_UI_MODES, FAIRCOIN_UNAVAILABLE_REASONS, } from '../../vocabulary/checkout.js';
10
+ import { CHECKOUT_CUSTOMER_CREATIONS, CHECKOUT_CONTACT_COLLECTIONS, CHECKOUT_LIMITS, CHECKOUT_LOCALES, CHECKOUT_PAYMENT_STATUSES, CHECKOUT_SESSION_MODES, CHECKOUT_SESSION_STATUSES, CHECKOUT_SUBMIT_TYPES, CHECKOUT_TAX_ID_TYPES, CHECKOUT_UI_MODES, FAIRCOIN_UNAVAILABLE_REASONS, } from '../../vocabulary/checkout.js';
11
11
  import { adjustableIssues, adjustableQuantityParam, amountParam, checkoutAutomaticTaxSchema, checkoutBrandingSchema, checkoutConsentSchema, checkoutCustomerDetailsSchema, checkoutDiscountSchema, checkoutIdParam, checkoutLineItemSchema, checkoutShippingDetailsSchema, checkoutTotalDetailsSchema, collectionParams, collectionResponseFields, countryCodeParam, checkoutEmailParam, localeParam, merchantDisplaySchema, quantityParam, railSchema, redirectUrlParam, } from './shared.js';
12
12
  /**
13
13
  * Checkout Sessions (`cs_…`, Orbit Phase 3) — Stripe Checkout's session model:
@@ -19,6 +19,10 @@ import { adjustableIssues, adjustableQuantityParam, amountParam, checkoutAutomat
19
19
  const sessionFields = {
20
20
  id: z.string(),
21
21
  object: z.literal('checkout_session'),
22
+ contact_collection: z
23
+ .enum(CHECKOUT_CONTACT_COLLECTIONS)
24
+ .optional()
25
+ .describe('Contact policy fixed by the merchant at creation. Absent means email. merchant_account delegates contact and notifications to the merchant account channel; it does not assert a Peable-verified identity.'),
22
26
  livemode,
23
27
  mode: z.enum(CHECKOUT_SESSION_MODES),
24
28
  status: z.enum(CHECKOUT_SESSION_STATUSES),
@@ -288,6 +292,10 @@ export const createCheckoutSessionParams = z
288
292
  .optional()
289
293
  .describe('`cus_…`; mutually exclusive with `customer_email`.'),
290
294
  customer_email: checkoutEmailParam.optional(),
295
+ contact_collection: z
296
+ .enum(CHECKOUT_CONTACT_COLLECTIONS)
297
+ .optional()
298
+ .describe('Defaults to email. merchant_account delegates contact and payment notifications to the merchant, which must have its own authenticated account channel. This is not identity verification by Peable. Payers cannot change this policy.'),
291
299
  customer_creation: z
292
300
  .enum(CHECKOUT_CUSTOMER_CREATIONS)
293
301
  .optional()
@@ -1,8 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { defineComponent } from '../../common/objects.js';
3
+ import { queryInteger } from '../../common/params.js';
4
+ /** The highest BIP32 non-hardened child index, `int4`'s ceiling (`schema/valueSets.ts`). */
5
+ const MAX_DERIVATION_INDEX = 2147483647;
3
6
  import { network, unixSeconds } from '../../common/primitives.js';
4
7
  import { defineRoute } from '../../route.js';
5
- import { ENRICH_MAX_ADDRESSES, ENRICHMENT_KINDS, SOCIAL_PAYMENT_DIRECTIONS, SOCIAL_SOURCE_APP_MAX_LENGTH, SOCIAL_SOURCE_REF_MAX_LENGTH, } from '../../vocabulary/payments.js';
8
+ import { ENRICH_MAX_ADDRESSES, ENRICHMENT_KINDS, SOCIAL_PAYMENT_DIRECTIONS, SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT, SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX, SOCIAL_SOURCE_APP_MAX_LENGTH, SOCIAL_SOURCE_REF_MAX_LENGTH, } from '../../vocabulary/payments.js';
6
9
  /**
7
10
  * Social payments (pay a person by `@username`) and transaction enrichment —
8
11
  * the wallet's routes, called with the person's own Oxy session. Display-only
@@ -83,10 +86,10 @@ export const socialNextAddressSchema = defineComponent('SocialNextAddress', z
83
86
  const networkQuery = z.object({ network });
84
87
  export const socialReceiveCursorQuery = networkQuery;
85
88
  /**
86
- * Lets the caller's device resync its watch window: every `next_address`
87
- * advances a monotonic index whether or not it is ever paid, so a burst of
88
- * reservations can outrun a device that widens only on payment. Watch
89
- * `0..reserved_through + gap`.
89
+ * The caller's cursor and keys. The addresses to watch are
90
+ * `GET /v1/social/me/receive_addresses` (ADR 0021 D9, amended 2026-11-06);
91
+ * `reserved_through` only says how far the cursor went, and the device
92
+ * compares its key with `account_identity_public_key`.
90
93
  */
91
94
  export const socialReceiveCursorSchema = defineComponent('SocialReceiveCursor', z
92
95
  .object({
@@ -105,6 +108,58 @@ export const socialReceiveCursorSchema = defineComponent('SocialReceiveCursor',
105
108
  .describe("The caller's CURRENT identity public key: their DID's `#key-1`, read from Oxy at request time (never cached), as lowercase hex of the key exactly as the DID publishes it (`publicKeyHex`, the compressed secp256k1 key) — the same encoding as `identity_public_key`. Compare the device's key with THIS, not with `identity_public_key`, which only says what the last reservation used. `null` for a keyless (custodial) account."),
106
109
  })
107
110
  .strict());
111
+ /**
112
+ * The caller's receive addresses after a sync cursor (ADR 0021 D9, amended
113
+ * 2026-11-06). `after` is the `sync_cursor` of the previous answer, `0` (the
114
+ * default) from the start.
115
+ */
116
+ export const socialReceiveAddressesQuery = z
117
+ .object({
118
+ network,
119
+ after: queryInteger({ min: 0, max: MAX_DERIVATION_INDEX })
120
+ .optional()
121
+ .describe('The `sync_cursor` of the previous page or sync; absent (or `0`) lists from the first address.'),
122
+ limit: queryInteger({ min: 1, max: SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX })
123
+ .optional()
124
+ .describe(`At most this many addresses (default ${SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT}); a page exceeds it only by addresses sharing its last index.`),
125
+ })
126
+ .strict();
127
+ /**
128
+ * One FairCoin address the gateway handed out in the caller's Peable wallet —
129
+ * for a payment (merchant, seller, invoice, raw intent, one output of a split
130
+ * payment) or an `@username` request — under ANY key the account has had.
131
+ * Addresses are never reused: each is a fresh index of the account's one
132
+ * cursor (ADR 0002, ADR 0021 D5, D9).
133
+ */
134
+ export const socialReceiveAddressSchema = defineComponent('SocialReceiveAddress', z
135
+ .object({
136
+ address: z.string().describe('The FairCoin address.'),
137
+ derivation_index: z
138
+ .number()
139
+ .int()
140
+ .positive()
141
+ .describe("Its index in the account's social-receive tree (`deriveSocialReceiveAddress(key, index)`); index 0, the stable default address, is never handed out."),
142
+ identity_public_key: z
143
+ .string()
144
+ .nullable()
145
+ .describe("The identity public key the address was derived from, in the encoding of the cursor's `identity_public_key` (lowercase hex of the DID `#key-1` bytes). It may be a key the account has since replaced. `null` only for an address handed out before keys were recorded."),
146
+ network,
147
+ created: unixSeconds.describe('When the address was handed out.'),
148
+ })
149
+ .strict());
150
+ export const socialReceiveAddressesSchema = defineComponent('SocialReceiveAddresses', z
151
+ .object({
152
+ addresses: z
153
+ .array(socialReceiveAddressSchema)
154
+ .describe('In ascending `derivation_index`, each address once.'),
155
+ has_more: z.boolean().describe('More addresses follow `sync_cursor`: ask again with it.'),
156
+ sync_cursor: z
157
+ .number()
158
+ .int()
159
+ .nonnegative()
160
+ .describe('Pass as `after` to continue — the highest `derivation_index` in this page, or `after` when the page is empty. Monotonic: an address handed out later always has a higher index, so a wallet that stored it misses nothing by asking from it.'),
161
+ })
162
+ .strict());
108
163
  export const socialPaymentsQuery = networkQuery;
109
164
  /**
110
165
  * One social payment as the CALLER saw it — the address-free view, and the
@@ -145,7 +200,7 @@ export const socialRoutes = [
145
200
  path: '/v1/social/{username}/next_address',
146
201
  tag: 'Social payments',
147
202
  summary: 'Reserve an address to pay a person',
148
- description: "A fresh address of the recipient's, derived from their Oxy identity key. Limited per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one whose wallet watches no further address (every index below its watched bound is taken) 503 `faircoin_receive_tree_full`; paying yourself is refused.",
203
+ description: "A fresh address of the recipient's, derived from their Oxy identity key — or the one this sender already holds and has not paid. Limited per sender and per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one handed too many fresh `@username` addresses in the last day 503 `faircoin_capacity_reached`; paying yourself is refused.",
149
204
  auth: 'user',
150
205
  params: { username: 'The recipient’s Oxy username.' },
151
206
  body: socialNextAddressParams,
@@ -162,6 +217,17 @@ export const socialRoutes = [
162
217
  query: socialReceiveCursorQuery,
163
218
  response: socialReceiveCursorSchema,
164
219
  }),
220
+ defineRoute({
221
+ operationId: 'listSocialReceiveAddresses',
222
+ method: 'get',
223
+ path: '/v1/social/me/receive_addresses',
224
+ tag: 'Social payments',
225
+ summary: "List the caller's receive addresses",
226
+ description: "Every FairCoin address handed out in the caller's Peable wallet on `network` — payments and `@username` alike, under every key the account has had — after `after`, in ascending index, for whoever the session acts as (an organization's, when acting as it). The wallet watches exactly this set (ADR 0021 D9). Read-only.",
227
+ auth: 'user',
228
+ query: socialReceiveAddressesQuery,
229
+ response: socialReceiveAddressesSchema,
230
+ }),
165
231
  defineRoute({
166
232
  operationId: 'listSocialPayments',
167
233
  method: 'get',
@@ -98,3 +98,5 @@ export const PAYMENT_LINK_LIMITS = Object.freeze({
98
98
  lineItemsMax: 20,
99
99
  customMessageMax: 500,
100
100
  });
101
+ /** Who owns contact collection for a service-created checkout session. */
102
+ export const CHECKOUT_CONTACT_COLLECTIONS = ['email', 'merchant_account'];
@@ -129,8 +129,7 @@ export const ERROR_CODE_DESCRIPTIONS = {
129
129
  faircoin_price_unavailable: 'No fresh FairCoin price exists right now, so this order cannot be quoted in FAIR. The other payment methods still work; try FairCoin again shortly.',
130
130
  faircoin_wallet_missing: "The Peable wallet that receives this payment (the merchant owner's, or the seller's) isn't set up yet, so it cannot be paid in FairCoin. The other payment methods still work.",
131
131
  faircoin_network_closed: 'FairCoin payments on this network are not open on this deployment yet. The other payment methods still work.',
132
- faircoin_capacity_reached: 'Too many FairCoin payments to this recipient are waiting to be paid right now, so no new FairCoin address can be handed out. The other payment methods still work; try FairCoin again shortly.',
133
- faircoin_receive_tree_full: "Every FairCoin address the recipient's Peable wallet watches has been handed out, so no new one can be derived for them. Nothing was reserved.",
132
+ faircoin_capacity_reached: 'Too many FairCoin addresses of this recipient were handed out in the last day without being paid, so no new one is handed out right now. Nothing was reserved. The other payment methods still work; try FairCoin again later.',
134
133
  faircoin_amount_too_small: "One seller's share of this order is below the smallest amount the FairCoin network relays, so it cannot be paid in FairCoin. The other payment methods still work.",
135
134
  credit_note_exceeds_invoice: "The credit note's amount exceeds what the invoice can still credit.",
136
135
  test_clock_unexpected_state: 'The test clock is advancing; wait until it is ready.',
@@ -22,4 +22,3 @@ export * from './identity.js';
22
22
  export * from './merchants.js';
23
23
  export * from './paymentMethodConfigurations.js';
24
24
  export * from './realtime.js';
25
- export * from './receiveTree.js';
@@ -10,8 +10,8 @@ export const PAYMENT_INTENT_RAILS = ['faircoin', 'card'];
10
10
  /**
11
11
  * The longest a PaymentIntent created through the API may stay payable before
12
12
  * it expires (`expires_in_seconds`): 24 hours. A FairCoin payment holds a
13
- * reserved address in the recipient's wallet for as long as it is payable, so
14
- * an unbounded expiry is an address nobody can ever recycle (ADR 0021 D9).
13
+ * reserved address in the recipient's wallet for as long as it is payable, and
14
+ * the recipient's bound on unpaid addresses looks back over a day (ADR 0021 D9).
15
15
  */
16
16
  export const PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = 24 * 60 * 60;
17
17
  /**
@@ -197,6 +197,12 @@ export const SOCIAL_PAYMENT_DIRECTIONS = ['sent', 'received'];
197
197
  export const ENRICHMENT_KINDS = ['merchant', 'user', 'unknown'];
198
198
  /** How many addresses one `POST /v1/enrich` resolves (and one social history lists). */
199
199
  export const ENRICH_MAX_ADDRESSES = 50;
200
+ /**
201
+ * One page of `GET /v1/social/me/receive_addresses` (ADR 0021 D9, amended
202
+ * 2026-11-06): the default and the most a wallet may ask for at once.
203
+ */
204
+ export const SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT = 500;
205
+ export const SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX = 1000;
200
206
  // ---------------------------------------------------------------------------
201
207
  // Test helpers
202
208
  // ---------------------------------------------------------------------------
@@ -113,6 +113,10 @@ export declare const checkoutSessionSchema: z.ZodObject<{
113
113
  }, z.core.$strict>>;
114
114
  id: z.ZodString;
115
115
  object: z.ZodLiteral<"checkout_session">;
116
+ contact_collection: z.ZodOptional<z.ZodEnum<{
117
+ email: "email";
118
+ merchant_account: "merchant_account";
119
+ }>>;
116
120
  livemode: z.ZodBoolean;
117
121
  mode: z.ZodEnum<{
118
122
  subscription: "subscription";
@@ -398,6 +402,10 @@ export declare const checkoutSessionPublicSchema: z.ZodObject<{
398
402
  }, z.core.$strict>>;
399
403
  id: z.ZodString;
400
404
  object: z.ZodLiteral<"checkout_session">;
405
+ contact_collection: z.ZodOptional<z.ZodEnum<{
406
+ email: "email";
407
+ merchant_account: "merchant_account";
408
+ }>>;
401
409
  livemode: z.ZodBoolean;
402
410
  mode: z.ZodEnum<{
403
411
  subscription: "subscription";
@@ -753,6 +761,10 @@ export declare const createCheckoutSessionParams: z.ZodObject<{
753
761
  allow_promotion_codes: z.ZodOptional<z.ZodBoolean>;
754
762
  customer: z.ZodOptional<z.ZodString>;
755
763
  customer_email: z.ZodOptional<z.ZodString>;
764
+ contact_collection: z.ZodOptional<z.ZodEnum<{
765
+ email: "email";
766
+ merchant_account: "merchant_account";
767
+ }>>;
756
768
  customer_creation: z.ZodOptional<z.ZodEnum<{
757
769
  always: "always";
758
770
  if_required: "if_required";
@@ -1072,6 +1084,10 @@ export declare const checkoutSessionRoutes: readonly [{
1072
1084
  allow_promotion_codes: z.ZodOptional<z.ZodBoolean>;
1073
1085
  customer: z.ZodOptional<z.ZodString>;
1074
1086
  customer_email: z.ZodOptional<z.ZodString>;
1087
+ contact_collection: z.ZodOptional<z.ZodEnum<{
1088
+ email: "email";
1089
+ merchant_account: "merchant_account";
1090
+ }>>;
1075
1091
  customer_creation: z.ZodOptional<z.ZodEnum<{
1076
1092
  always: "always";
1077
1093
  if_required: "if_required";
@@ -1189,6 +1205,10 @@ export declare const checkoutSessionRoutes: readonly [{
1189
1205
  }, z.core.$strict>>;
1190
1206
  id: z.ZodString;
1191
1207
  object: z.ZodLiteral<"checkout_session">;
1208
+ contact_collection: z.ZodOptional<z.ZodEnum<{
1209
+ email: "email";
1210
+ merchant_account: "merchant_account";
1211
+ }>>;
1192
1212
  livemode: z.ZodBoolean;
1193
1213
  mode: z.ZodEnum<{
1194
1214
  subscription: "subscription";
@@ -1426,6 +1446,10 @@ export declare const checkoutSessionRoutes: readonly [{
1426
1446
  }, z.core.$strict>>;
1427
1447
  id: z.ZodString;
1428
1448
  object: z.ZodLiteral<"checkout_session">;
1449
+ contact_collection: z.ZodOptional<z.ZodEnum<{
1450
+ email: "email";
1451
+ merchant_account: "merchant_account";
1452
+ }>>;
1429
1453
  livemode: z.ZodBoolean;
1430
1454
  mode: z.ZodEnum<{
1431
1455
  subscription: "subscription";
@@ -1644,6 +1668,10 @@ export declare const checkoutSessionRoutes: readonly [{
1644
1668
  }, z.core.$strict>>;
1645
1669
  id: z.ZodString;
1646
1670
  object: z.ZodLiteral<"checkout_session">;
1671
+ contact_collection: z.ZodOptional<z.ZodEnum<{
1672
+ email: "email";
1673
+ merchant_account: "merchant_account";
1674
+ }>>;
1647
1675
  livemode: z.ZodBoolean;
1648
1676
  mode: z.ZodEnum<{
1649
1677
  subscription: "subscription";
@@ -1862,6 +1890,10 @@ export declare const checkoutSessionRoutes: readonly [{
1862
1890
  }, z.core.$strict>>;
1863
1891
  id: z.ZodString;
1864
1892
  object: z.ZodLiteral<"checkout_session">;
1893
+ contact_collection: z.ZodOptional<z.ZodEnum<{
1894
+ email: "email";
1895
+ merchant_account: "merchant_account";
1896
+ }>>;
1865
1897
  livemode: z.ZodBoolean;
1866
1898
  mode: z.ZodEnum<{
1867
1899
  subscription: "subscription";
@@ -2079,6 +2111,10 @@ export declare const checkoutSessionRoutes: readonly [{
2079
2111
  }, z.core.$strict>>;
2080
2112
  id: z.ZodString;
2081
2113
  object: z.ZodLiteral<"checkout_session">;
2114
+ contact_collection: z.ZodOptional<z.ZodEnum<{
2115
+ email: "email";
2116
+ merchant_account: "merchant_account";
2117
+ }>>;
2082
2118
  livemode: z.ZodBoolean;
2083
2119
  mode: z.ZodEnum<{
2084
2120
  subscription: "subscription";
@@ -2436,6 +2472,10 @@ export declare const checkoutSessionRoutes: readonly [{
2436
2472
  }, z.core.$strict>>;
2437
2473
  id: z.ZodString;
2438
2474
  object: z.ZodLiteral<"checkout_session">;
2475
+ contact_collection: z.ZodOptional<z.ZodEnum<{
2476
+ email: "email";
2477
+ merchant_account: "merchant_account";
2478
+ }>>;
2439
2479
  livemode: z.ZodBoolean;
2440
2480
  mode: z.ZodEnum<{
2441
2481
  subscription: "subscription";
@@ -2770,6 +2810,10 @@ export declare const checkoutSessionRoutes: readonly [{
2770
2810
  }, z.core.$strict>>;
2771
2811
  id: z.ZodString;
2772
2812
  object: z.ZodLiteral<"checkout_session">;
2813
+ contact_collection: z.ZodOptional<z.ZodEnum<{
2814
+ email: "email";
2815
+ merchant_account: "merchant_account";
2816
+ }>>;
2773
2817
  livemode: z.ZodBoolean;
2774
2818
  mode: z.ZodEnum<{
2775
2819
  subscription: "subscription";
@@ -3078,6 +3122,10 @@ export declare const checkoutSessionRoutes: readonly [{
3078
3122
  }, z.core.$strict>>;
3079
3123
  id: z.ZodString;
3080
3124
  object: z.ZodLiteral<"checkout_session">;
3125
+ contact_collection: z.ZodOptional<z.ZodEnum<{
3126
+ email: "email";
3127
+ merchant_account: "merchant_account";
3128
+ }>>;
3081
3129
  livemode: z.ZodBoolean;
3082
3130
  mode: z.ZodEnum<{
3083
3131
  subscription: "subscription";
@@ -3292,6 +3340,10 @@ export declare const checkoutSessionRoutes: readonly [{
3292
3340
  }, z.core.$strict>>;
3293
3341
  id: z.ZodString;
3294
3342
  object: z.ZodLiteral<"checkout_session">;
3343
+ contact_collection: z.ZodOptional<z.ZodEnum<{
3344
+ email: "email";
3345
+ merchant_account: "merchant_account";
3346
+ }>>;
3295
3347
  livemode: z.ZodBoolean;
3296
3348
  mode: z.ZodEnum<{
3297
3349
  subscription: "subscription";
@@ -184,6 +184,10 @@ export declare const checkoutRoutes: readonly [{
184
184
  allow_promotion_codes: import("zod").ZodOptional<import("zod").ZodBoolean>;
185
185
  customer: import("zod").ZodOptional<import("zod").ZodString>;
186
186
  customer_email: import("zod").ZodOptional<import("zod").ZodString>;
187
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
188
+ email: "email";
189
+ merchant_account: "merchant_account";
190
+ }>>;
187
191
  customer_creation: import("zod").ZodOptional<import("zod").ZodEnum<{
188
192
  always: "always";
189
193
  if_required: "if_required";
@@ -301,6 +305,10 @@ export declare const checkoutRoutes: readonly [{
301
305
  }, import("zod/v4/core").$strict>>;
302
306
  id: import("zod").ZodString;
303
307
  object: import("zod").ZodLiteral<"checkout_session">;
308
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
309
+ email: "email";
310
+ merchant_account: "merchant_account";
311
+ }>>;
304
312
  livemode: import("zod").ZodBoolean;
305
313
  mode: import("zod").ZodEnum<{
306
314
  subscription: "subscription";
@@ -538,6 +546,10 @@ export declare const checkoutRoutes: readonly [{
538
546
  }, import("zod/v4/core").$strict>>;
539
547
  id: import("zod").ZodString;
540
548
  object: import("zod").ZodLiteral<"checkout_session">;
549
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
550
+ email: "email";
551
+ merchant_account: "merchant_account";
552
+ }>>;
541
553
  livemode: import("zod").ZodBoolean;
542
554
  mode: import("zod").ZodEnum<{
543
555
  subscription: "subscription";
@@ -756,6 +768,10 @@ export declare const checkoutRoutes: readonly [{
756
768
  }, import("zod/v4/core").$strict>>;
757
769
  id: import("zod").ZodString;
758
770
  object: import("zod").ZodLiteral<"checkout_session">;
771
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
772
+ email: "email";
773
+ merchant_account: "merchant_account";
774
+ }>>;
759
775
  livemode: import("zod").ZodBoolean;
760
776
  mode: import("zod").ZodEnum<{
761
777
  subscription: "subscription";
@@ -974,6 +990,10 @@ export declare const checkoutRoutes: readonly [{
974
990
  }, import("zod/v4/core").$strict>>;
975
991
  id: import("zod").ZodString;
976
992
  object: import("zod").ZodLiteral<"checkout_session">;
993
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
994
+ email: "email";
995
+ merchant_account: "merchant_account";
996
+ }>>;
977
997
  livemode: import("zod").ZodBoolean;
978
998
  mode: import("zod").ZodEnum<{
979
999
  subscription: "subscription";
@@ -1191,6 +1211,10 @@ export declare const checkoutRoutes: readonly [{
1191
1211
  }, import("zod/v4/core").$strict>>;
1192
1212
  id: import("zod").ZodString;
1193
1213
  object: import("zod").ZodLiteral<"checkout_session">;
1214
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
1215
+ email: "email";
1216
+ merchant_account: "merchant_account";
1217
+ }>>;
1194
1218
  livemode: import("zod").ZodBoolean;
1195
1219
  mode: import("zod").ZodEnum<{
1196
1220
  subscription: "subscription";
@@ -1548,6 +1572,10 @@ export declare const checkoutRoutes: readonly [{
1548
1572
  }, import("zod/v4/core").$strict>>;
1549
1573
  id: import("zod").ZodString;
1550
1574
  object: import("zod").ZodLiteral<"checkout_session">;
1575
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
1576
+ email: "email";
1577
+ merchant_account: "merchant_account";
1578
+ }>>;
1551
1579
  livemode: import("zod").ZodBoolean;
1552
1580
  mode: import("zod").ZodEnum<{
1553
1581
  subscription: "subscription";
@@ -1882,6 +1910,10 @@ export declare const checkoutRoutes: readonly [{
1882
1910
  }, import("zod/v4/core").$strict>>;
1883
1911
  id: import("zod").ZodString;
1884
1912
  object: import("zod").ZodLiteral<"checkout_session">;
1913
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
1914
+ email: "email";
1915
+ merchant_account: "merchant_account";
1916
+ }>>;
1885
1917
  livemode: import("zod").ZodBoolean;
1886
1918
  mode: import("zod").ZodEnum<{
1887
1919
  subscription: "subscription";
@@ -2190,6 +2222,10 @@ export declare const checkoutRoutes: readonly [{
2190
2222
  }, import("zod/v4/core").$strict>>;
2191
2223
  id: import("zod").ZodString;
2192
2224
  object: import("zod").ZodLiteral<"checkout_session">;
2225
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
2226
+ email: "email";
2227
+ merchant_account: "merchant_account";
2228
+ }>>;
2193
2229
  livemode: import("zod").ZodBoolean;
2194
2230
  mode: import("zod").ZodEnum<{
2195
2231
  subscription: "subscription";
@@ -2404,6 +2440,10 @@ export declare const checkoutRoutes: readonly [{
2404
2440
  }, import("zod/v4/core").$strict>>;
2405
2441
  id: import("zod").ZodString;
2406
2442
  object: import("zod").ZodLiteral<"checkout_session">;
2443
+ contact_collection: import("zod").ZodOptional<import("zod").ZodEnum<{
2444
+ email: "email";
2445
+ merchant_account: "merchant_account";
2446
+ }>>;
2407
2447
  livemode: import("zod").ZodBoolean;
2408
2448
  mode: import("zod").ZodEnum<{
2409
2449
  subscription: "subscription";
@@ -3712,7 +3712,7 @@ export declare const paymentsRoutes: readonly [{
3712
3712
  readonly path: "/v1/social/{username}/next_address";
3713
3713
  readonly tag: "Social payments";
3714
3714
  readonly summary: "Reserve an address to pay a person";
3715
- readonly description: "A fresh address of the recipient's, derived from their Oxy identity key. Limited per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one whose wallet watches no further address (every index below its watched bound is taken) 503 `faircoin_receive_tree_full`; paying yourself is refused.";
3715
+ readonly description: "A fresh address of the recipient's, derived from their Oxy identity key — or the one this sender already holds and has not paid. Limited per sender and per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one handed too many fresh `@username` addresses in the last day 503 `faircoin_capacity_reached`; paying yourself is refused.";
3716
3716
  readonly auth: "user";
3717
3717
  readonly params: {
3718
3718
  readonly username: "The recipient’s Oxy username.";
@@ -3750,6 +3750,36 @@ export declare const paymentsRoutes: readonly [{
3750
3750
  identity_public_key: import("zod").ZodNullable<import("zod").ZodString>;
3751
3751
  account_identity_public_key: import("zod").ZodNullable<import("zod").ZodString>;
3752
3752
  }, import("zod/v4/core").$strict>;
3753
+ }, {
3754
+ readonly operationId: "listSocialReceiveAddresses";
3755
+ readonly method: "get";
3756
+ readonly path: "/v1/social/me/receive_addresses";
3757
+ readonly tag: "Social payments";
3758
+ readonly summary: "List the caller's receive addresses";
3759
+ readonly description: "Every FairCoin address handed out in the caller's Peable wallet on `network` — payments and `@username` alike, under every key the account has had — after `after`, in ascending index, for whoever the session acts as (an organization's, when acting as it). The wallet watches exactly this set (ADR 0021 D9). Read-only.";
3760
+ readonly auth: "user";
3761
+ readonly query: import("zod").ZodObject<{
3762
+ network: import("zod").ZodEnum<{
3763
+ mainnet: "mainnet";
3764
+ testnet: "testnet";
3765
+ }>;
3766
+ after: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodPipe<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>, import("zod").ZodTransform<number, string | number>>, import("zod").ZodNumber>>;
3767
+ limit: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodPipe<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>, import("zod").ZodTransform<number, string | number>>, import("zod").ZodNumber>>;
3768
+ }, import("zod/v4/core").$strict>;
3769
+ readonly response: import("zod").ZodObject<{
3770
+ addresses: import("zod").ZodArray<import("zod").ZodObject<{
3771
+ address: import("zod").ZodString;
3772
+ derivation_index: import("zod").ZodNumber;
3773
+ identity_public_key: import("zod").ZodNullable<import("zod").ZodString>;
3774
+ network: import("zod").ZodEnum<{
3775
+ mainnet: "mainnet";
3776
+ testnet: "testnet";
3777
+ }>;
3778
+ created: import("zod").ZodNumber;
3779
+ }, import("zod/v4/core").$strict>>;
3780
+ has_more: import("zod").ZodBoolean;
3781
+ sync_cursor: import("zod").ZodNumber;
3782
+ }, import("zod/v4/core").$strict>;
3753
3783
  }, {
3754
3784
  readonly operationId: "listSocialPayments";
3755
3785
  readonly method: "get";
@@ -68,10 +68,10 @@ export declare const socialReceiveCursorQuery: z.ZodObject<{
68
68
  }, z.core.$strip>;
69
69
  export type SocialReceiveCursorParams = z.input<typeof socialReceiveCursorQuery>;
70
70
  /**
71
- * Lets the caller's device resync its watch window: every `next_address`
72
- * advances a monotonic index whether or not it is ever paid, so a burst of
73
- * reservations can outrun a device that widens only on payment. Watch
74
- * `0..reserved_through + gap`.
71
+ * The caller's cursor and keys. The addresses to watch are
72
+ * `GET /v1/social/me/receive_addresses` (ADR 0021 D9, amended 2026-11-06);
73
+ * `reserved_through` only says how far the cursor went, and the device
74
+ * compares its key with `account_identity_public_key`.
75
75
  */
76
76
  export declare const socialReceiveCursorSchema: z.ZodObject<{
77
77
  reserved_through: z.ZodNumber;
@@ -79,6 +79,53 @@ export declare const socialReceiveCursorSchema: z.ZodObject<{
79
79
  account_identity_public_key: z.ZodNullable<z.ZodString>;
80
80
  }, z.core.$strict>;
81
81
  export type SocialReceiveCursorResponse = z.output<typeof socialReceiveCursorSchema>;
82
+ /**
83
+ * The caller's receive addresses after a sync cursor (ADR 0021 D9, amended
84
+ * 2026-11-06). `after` is the `sync_cursor` of the previous answer, `0` (the
85
+ * default) from the start.
86
+ */
87
+ export declare const socialReceiveAddressesQuery: z.ZodObject<{
88
+ network: z.ZodEnum<{
89
+ mainnet: "mainnet";
90
+ testnet: "testnet";
91
+ }>;
92
+ after: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
93
+ limit: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
94
+ }, z.core.$strict>;
95
+ export type SocialReceiveAddressesParams = z.input<typeof socialReceiveAddressesQuery>;
96
+ /**
97
+ * One FairCoin address the gateway handed out in the caller's Peable wallet —
98
+ * for a payment (merchant, seller, invoice, raw intent, one output of a split
99
+ * payment) or an `@username` request — under ANY key the account has had.
100
+ * Addresses are never reused: each is a fresh index of the account's one
101
+ * cursor (ADR 0002, ADR 0021 D5, D9).
102
+ */
103
+ export declare const socialReceiveAddressSchema: z.ZodObject<{
104
+ address: z.ZodString;
105
+ derivation_index: z.ZodNumber;
106
+ identity_public_key: z.ZodNullable<z.ZodString>;
107
+ network: z.ZodEnum<{
108
+ mainnet: "mainnet";
109
+ testnet: "testnet";
110
+ }>;
111
+ created: z.ZodNumber;
112
+ }, z.core.$strict>;
113
+ export type SocialReceiveAddress = z.output<typeof socialReceiveAddressSchema>;
114
+ export declare const socialReceiveAddressesSchema: z.ZodObject<{
115
+ addresses: z.ZodArray<z.ZodObject<{
116
+ address: z.ZodString;
117
+ derivation_index: z.ZodNumber;
118
+ identity_public_key: z.ZodNullable<z.ZodString>;
119
+ network: z.ZodEnum<{
120
+ mainnet: "mainnet";
121
+ testnet: "testnet";
122
+ }>;
123
+ created: z.ZodNumber;
124
+ }, z.core.$strict>>;
125
+ has_more: z.ZodBoolean;
126
+ sync_cursor: z.ZodNumber;
127
+ }, z.core.$strict>;
128
+ export type SocialReceiveAddressesResponse = z.output<typeof socialReceiveAddressesSchema>;
82
129
  export declare const socialPaymentsQuery: z.ZodObject<{
83
130
  network: z.ZodEnum<{
84
131
  mainnet: "mainnet";
@@ -166,7 +213,7 @@ export declare const socialRoutes: readonly [{
166
213
  readonly path: "/v1/social/{username}/next_address";
167
214
  readonly tag: "Social payments";
168
215
  readonly summary: "Reserve an address to pay a person";
169
- readonly description: "A fresh address of the recipient's, derived from their Oxy identity key. Limited per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one whose wallet watches no further address (every index below its watched bound is taken) 503 `faircoin_receive_tree_full`; paying yourself is refused.";
216
+ readonly description: "A fresh address of the recipient's, derived from their Oxy identity key — or the one this sender already holds and has not paid. Limited per sender and per (sender, recipient) pair; a recipient without an identity answers 409 `keyless_recipient`, and one handed too many fresh `@username` addresses in the last day 503 `faircoin_capacity_reached`; paying yourself is refused.";
170
217
  readonly auth: "user";
171
218
  readonly params: {
172
219
  readonly username: "The recipient’s Oxy username.";
@@ -204,6 +251,36 @@ export declare const socialRoutes: readonly [{
204
251
  identity_public_key: z.ZodNullable<z.ZodString>;
205
252
  account_identity_public_key: z.ZodNullable<z.ZodString>;
206
253
  }, z.core.$strict>;
254
+ }, {
255
+ readonly operationId: "listSocialReceiveAddresses";
256
+ readonly method: "get";
257
+ readonly path: "/v1/social/me/receive_addresses";
258
+ readonly tag: "Social payments";
259
+ readonly summary: "List the caller's receive addresses";
260
+ readonly description: "Every FairCoin address handed out in the caller's Peable wallet on `network` — payments and `@username` alike, under every key the account has had — after `after`, in ascending index, for whoever the session acts as (an organization's, when acting as it). The wallet watches exactly this set (ADR 0021 D9). Read-only.";
261
+ readonly auth: "user";
262
+ readonly query: z.ZodObject<{
263
+ network: z.ZodEnum<{
264
+ mainnet: "mainnet";
265
+ testnet: "testnet";
266
+ }>;
267
+ after: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
268
+ limit: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>>;
269
+ }, z.core.$strict>;
270
+ readonly response: z.ZodObject<{
271
+ addresses: z.ZodArray<z.ZodObject<{
272
+ address: z.ZodString;
273
+ derivation_index: z.ZodNumber;
274
+ identity_public_key: z.ZodNullable<z.ZodString>;
275
+ network: z.ZodEnum<{
276
+ mainnet: "mainnet";
277
+ testnet: "testnet";
278
+ }>;
279
+ created: z.ZodNumber;
280
+ }, z.core.$strict>>;
281
+ has_more: z.ZodBoolean;
282
+ sync_cursor: z.ZodNumber;
283
+ }, z.core.$strict>;
207
284
  }, {
208
285
  readonly operationId: "listSocialPayments";
209
286
  readonly method: "get";
@@ -75,3 +75,6 @@ export declare const PAYMENT_LINK_LIMITS: Readonly<{
75
75
  lineItemsMax: 20;
76
76
  customMessageMax: 500;
77
77
  }>;
78
+ /** Who owns contact collection for a service-created checkout session. */
79
+ export declare const CHECKOUT_CONTACT_COLLECTIONS: readonly ["email", "merchant_account"];
80
+ export type CheckoutContactCollection = (typeof CHECKOUT_CONTACT_COLLECTIONS)[number];
@@ -108,8 +108,7 @@ export declare const ERROR_CODE_DESCRIPTIONS: {
108
108
  readonly faircoin_price_unavailable: "No fresh FairCoin price exists right now, so this order cannot be quoted in FAIR. The other payment methods still work; try FairCoin again shortly.";
109
109
  readonly faircoin_wallet_missing: "The Peable wallet that receives this payment (the merchant owner's, or the seller's) isn't set up yet, so it cannot be paid in FairCoin. The other payment methods still work.";
110
110
  readonly faircoin_network_closed: "FairCoin payments on this network are not open on this deployment yet. The other payment methods still work.";
111
- readonly faircoin_capacity_reached: "Too many FairCoin payments to this recipient are waiting to be paid right now, so no new FairCoin address can be handed out. The other payment methods still work; try FairCoin again shortly.";
112
- readonly faircoin_receive_tree_full: "Every FairCoin address the recipient's Peable wallet watches has been handed out, so no new one can be derived for them. Nothing was reserved.";
111
+ readonly faircoin_capacity_reached: "Too many FairCoin addresses of this recipient were handed out in the last day without being paid, so no new one is handed out right now. Nothing was reserved. The other payment methods still work; try FairCoin again later.";
113
112
  readonly faircoin_amount_too_small: "One seller's share of this order is below the smallest amount the FairCoin network relays, so it cannot be paid in FairCoin. The other payment methods still work.";
114
113
  readonly credit_note_exceeds_invoice: "The credit note's amount exceeds what the invoice can still credit.";
115
114
  readonly test_clock_unexpected_state: "The test clock is advancing; wait until it is ready.";
@@ -18,4 +18,3 @@ export * from './identity';
18
18
  export * from './merchants';
19
19
  export * from './paymentMethodConfigurations';
20
20
  export * from './realtime';
21
- export * from './receiveTree';
@@ -7,8 +7,8 @@ export type PaymentIntentRail = (typeof PAYMENT_INTENT_RAILS)[number];
7
7
  /**
8
8
  * The longest a PaymentIntent created through the API may stay payable before
9
9
  * it expires (`expires_in_seconds`): 24 hours. A FairCoin payment holds a
10
- * reserved address in the recipient's wallet for as long as it is payable, so
11
- * an unbounded expiry is an address nobody can ever recycle (ADR 0021 D9).
10
+ * reserved address in the recipient's wallet for as long as it is payable, and
11
+ * the recipient's bound on unpaid addresses looks back over a day (ADR 0021 D9).
12
12
  */
13
13
  export declare const PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS: number;
14
14
  /**
@@ -122,6 +122,12 @@ export declare const ENRICHMENT_KINDS: readonly ["merchant", "user", "unknown"];
122
122
  export type EnrichmentKind = (typeof ENRICHMENT_KINDS)[number];
123
123
  /** How many addresses one `POST /v1/enrich` resolves (and one social history lists). */
124
124
  export declare const ENRICH_MAX_ADDRESSES = 50;
125
+ /**
126
+ * One page of `GET /v1/social/me/receive_addresses` (ADR 0021 D9, amended
127
+ * 2026-11-06): the default and the most a wallet may ask for at once.
128
+ */
129
+ export declare const SOCIAL_RECEIVE_ADDRESSES_PAGE_DEFAULT = 500;
130
+ export declare const SOCIAL_RECEIVE_ADDRESSES_PAGE_MAX = 1000;
125
131
  /**
126
132
  * What `simulate_faircoin_payment` pretends the payer did: `settled` paid the
127
133
  * full amount (`processing` → `succeeded`); `underpaid` sent less
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peable.to/contracts",
3
- "version": "5.6.0",
3
+ "version": "6.1.0",
4
4
  "description": "The Peable wire, declared once: Zod contracts of every public route, the OpenAPI 3.1 generator and the closed value sets (ADR 0014 D5).",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,44 +0,0 @@
1
- "use strict";
2
- /**
3
- * The size of a recipient's FairCoin receive tree (ADR 0021 D9, amended
4
- * 2026-11-06) — ONE answer, read by the gateway that hands out indices and by
5
- * the Peable wallet that watches them.
6
- *
7
- * Every FairCoin address the gateway reserves for an account — a merchant
8
- * payment, a marketplace seller's, an invoice's, `@username` — is index `i` of
9
- * that account's identity tree (ADR 0002, ADR 0021 D5). The wallet watches a
10
- * contiguous window, indices `0 .. SOCIAL_RECEIVE_MAX_WATCHED - 1`, reaching
11
- * {@link SOCIAL_RECEIVE_GAP_LIMIT} past the highest index reserved
12
- * (`planSocialReceiveWindow` in `packages/frontend/src/wallet/social-receive.ts`),
13
- * and stops offering `@username` once that reach would pass its bound. So an
14
- * index is reserved only when the wallet, after reserving it, still reaches
15
- * the gap above it inside its bound:
16
- *
17
- * index + SOCIAL_RECEIVE_GAP_LIMIT <= SOCIAL_RECEIVE_MAX_WATCHED - 1
18
- * index < SOCIAL_RECEIVE_INDEX_LIMIT
19
- *
20
- * The gateway refuses to mint `index >= SOCIAL_RECEIVE_INDEX_LIMIT` (in the
21
- * reservation's own statement), so every address it hands out is inside the
22
- * window the wallet watches. Zod-free and dependency-free: the wallet bundles
23
- * this module alone (`@peable.to/contracts/vocabulary/receiveTree`).
24
- */
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.SOCIAL_RECEIVE_NEARLY_FULL_REMAINING = exports.SOCIAL_RECEIVE_INDEX_LIMIT = exports.SOCIAL_RECEIVE_GAP_LIMIT = exports.SOCIAL_RECEIVE_MAX_WATCHED = void 0;
27
- /** The most indices the wallet watches: `0 .. SOCIAL_RECEIVE_MAX_WATCHED - 1`. */
28
- exports.SOCIAL_RECEIVE_MAX_WATCHED = 2000;
29
- /**
30
- * How many unused addresses the wallet watches beyond the highest index used
31
- * or reserved — the FairCoin BIP44 external-chain gap limit.
32
- */
33
- exports.SOCIAL_RECEIVE_GAP_LIMIT = 20;
34
- /**
35
- * The first index the gateway never mints (exclusive bound): `1 980`. Every
36
- * minted index `i` satisfies `i < SOCIAL_RECEIVE_INDEX_LIMIT`, i.e.
37
- * `i + SOCIAL_RECEIVE_GAP_LIMIT <= SOCIAL_RECEIVE_MAX_WATCHED - 1`.
38
- */
39
- exports.SOCIAL_RECEIVE_INDEX_LIMIT = exports.SOCIAL_RECEIVE_MAX_WATCHED - exports.SOCIAL_RECEIVE_GAP_LIMIT;
40
- /**
41
- * How close to {@link SOCIAL_RECEIVE_INDEX_LIMIT} a tree is "nearly full":
42
- * Orbit warns the owners once fewer fresh indices than this are left.
43
- */
44
- exports.SOCIAL_RECEIVE_NEARLY_FULL_REMAINING = 200;
@@ -1,41 +0,0 @@
1
- /**
2
- * The size of a recipient's FairCoin receive tree (ADR 0021 D9, amended
3
- * 2026-11-06) — ONE answer, read by the gateway that hands out indices and by
4
- * the Peable wallet that watches them.
5
- *
6
- * Every FairCoin address the gateway reserves for an account — a merchant
7
- * payment, a marketplace seller's, an invoice's, `@username` — is index `i` of
8
- * that account's identity tree (ADR 0002, ADR 0021 D5). The wallet watches a
9
- * contiguous window, indices `0 .. SOCIAL_RECEIVE_MAX_WATCHED - 1`, reaching
10
- * {@link SOCIAL_RECEIVE_GAP_LIMIT} past the highest index reserved
11
- * (`planSocialReceiveWindow` in `packages/frontend/src/wallet/social-receive.ts`),
12
- * and stops offering `@username` once that reach would pass its bound. So an
13
- * index is reserved only when the wallet, after reserving it, still reaches
14
- * the gap above it inside its bound:
15
- *
16
- * index + SOCIAL_RECEIVE_GAP_LIMIT <= SOCIAL_RECEIVE_MAX_WATCHED - 1
17
- * index < SOCIAL_RECEIVE_INDEX_LIMIT
18
- *
19
- * The gateway refuses to mint `index >= SOCIAL_RECEIVE_INDEX_LIMIT` (in the
20
- * reservation's own statement), so every address it hands out is inside the
21
- * window the wallet watches. Zod-free and dependency-free: the wallet bundles
22
- * this module alone (`@peable.to/contracts/vocabulary/receiveTree`).
23
- */
24
- /** The most indices the wallet watches: `0 .. SOCIAL_RECEIVE_MAX_WATCHED - 1`. */
25
- export const SOCIAL_RECEIVE_MAX_WATCHED = 2000;
26
- /**
27
- * How many unused addresses the wallet watches beyond the highest index used
28
- * or reserved — the FairCoin BIP44 external-chain gap limit.
29
- */
30
- export const SOCIAL_RECEIVE_GAP_LIMIT = 20;
31
- /**
32
- * The first index the gateway never mints (exclusive bound): `1 980`. Every
33
- * minted index `i` satisfies `i < SOCIAL_RECEIVE_INDEX_LIMIT`, i.e.
34
- * `i + SOCIAL_RECEIVE_GAP_LIMIT <= SOCIAL_RECEIVE_MAX_WATCHED - 1`.
35
- */
36
- export const SOCIAL_RECEIVE_INDEX_LIMIT = SOCIAL_RECEIVE_MAX_WATCHED - SOCIAL_RECEIVE_GAP_LIMIT;
37
- /**
38
- * How close to {@link SOCIAL_RECEIVE_INDEX_LIMIT} a tree is "nearly full":
39
- * Orbit warns the owners once fewer fresh indices than this are left.
40
- */
41
- export const SOCIAL_RECEIVE_NEARLY_FULL_REMAINING = 200;
@@ -1,41 +0,0 @@
1
- /**
2
- * The size of a recipient's FairCoin receive tree (ADR 0021 D9, amended
3
- * 2026-11-06) — ONE answer, read by the gateway that hands out indices and by
4
- * the Peable wallet that watches them.
5
- *
6
- * Every FairCoin address the gateway reserves for an account — a merchant
7
- * payment, a marketplace seller's, an invoice's, `@username` — is index `i` of
8
- * that account's identity tree (ADR 0002, ADR 0021 D5). The wallet watches a
9
- * contiguous window, indices `0 .. SOCIAL_RECEIVE_MAX_WATCHED - 1`, reaching
10
- * {@link SOCIAL_RECEIVE_GAP_LIMIT} past the highest index reserved
11
- * (`planSocialReceiveWindow` in `packages/frontend/src/wallet/social-receive.ts`),
12
- * and stops offering `@username` once that reach would pass its bound. So an
13
- * index is reserved only when the wallet, after reserving it, still reaches
14
- * the gap above it inside its bound:
15
- *
16
- * index + SOCIAL_RECEIVE_GAP_LIMIT <= SOCIAL_RECEIVE_MAX_WATCHED - 1
17
- * index < SOCIAL_RECEIVE_INDEX_LIMIT
18
- *
19
- * The gateway refuses to mint `index >= SOCIAL_RECEIVE_INDEX_LIMIT` (in the
20
- * reservation's own statement), so every address it hands out is inside the
21
- * window the wallet watches. Zod-free and dependency-free: the wallet bundles
22
- * this module alone (`@peable.to/contracts/vocabulary/receiveTree`).
23
- */
24
- /** The most indices the wallet watches: `0 .. SOCIAL_RECEIVE_MAX_WATCHED - 1`. */
25
- export declare const SOCIAL_RECEIVE_MAX_WATCHED = 2000;
26
- /**
27
- * How many unused addresses the wallet watches beyond the highest index used
28
- * or reserved — the FairCoin BIP44 external-chain gap limit.
29
- */
30
- export declare const SOCIAL_RECEIVE_GAP_LIMIT = 20;
31
- /**
32
- * The first index the gateway never mints (exclusive bound): `1 980`. Every
33
- * minted index `i` satisfies `i < SOCIAL_RECEIVE_INDEX_LIMIT`, i.e.
34
- * `i + SOCIAL_RECEIVE_GAP_LIMIT <= SOCIAL_RECEIVE_MAX_WATCHED - 1`.
35
- */
36
- export declare const SOCIAL_RECEIVE_INDEX_LIMIT: number;
37
- /**
38
- * How close to {@link SOCIAL_RECEIVE_INDEX_LIMIT} a tree is "nearly full":
39
- * Orbit warns the owners once fewer fresh indices than this are left.
40
- */
41
- export declare const SOCIAL_RECEIVE_NEARLY_FULL_REMAINING = 200;