@andco/protocol 0.0.15 → 0.1.0-ti.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.
Files changed (61) hide show
  1. package/dist/authorization-preparation.d.ts +1 -1
  2. package/dist/errors.d.ts +1 -1
  3. package/dist/errors.js +1 -1
  4. package/dist/intent-input.d.ts +67 -54
  5. package/dist/intent-input.d.ts.map +1 -1
  6. package/dist/intent-input.js +39 -23
  7. package/dist/intent-status.d.ts +5 -6
  8. package/dist/intent-status.d.ts.map +1 -1
  9. package/dist/intent-status.js +12 -7
  10. package/dist/miniapp-manifest.d.ts +2 -2
  11. package/dist/miniapp-manifest.js +1 -1
  12. package/dist/native-intent.d.ts +12 -12
  13. package/dist/native-intent.d.ts.map +1 -1
  14. package/dist/native-intent.js +7 -4
  15. package/dist/rar/account-matchers.d.ts +10 -10
  16. package/dist/rar/account-matchers.js +2 -2
  17. package/dist/rar/bank.d.ts +284 -12
  18. package/dist/rar/bank.d.ts.map +1 -1
  19. package/dist/rar/bank.js +42 -4
  20. package/dist/rar/catalog.d.ts +130 -5
  21. package/dist/rar/catalog.d.ts.map +1 -1
  22. package/dist/rar/json-schemas.generated.d.ts.map +1 -1
  23. package/dist/rar/json-schemas.generated.js +372 -4
  24. package/dist/rar/money.d.ts +1 -1
  25. package/dist/rar/money.js +1 -1
  26. package/dist/rar/subject-data.d.ts +1 -1
  27. package/dist/rar/subject-data.js +1 -1
  28. package/dist/rest/accounts.d.ts +3 -3
  29. package/dist/rest/accounts.js +1 -1
  30. package/dist/rest/catalog.d.ts +3 -3
  31. package/dist/rest/catalog.js +2 -2
  32. package/dist/rest/contract.d.ts +561 -302
  33. package/dist/rest/contract.d.ts.map +1 -1
  34. package/dist/rest/contract.js +6 -2
  35. package/dist/rest/identity.d.ts +22 -22
  36. package/dist/rest/identity.d.ts.map +1 -1
  37. package/dist/rest/identity.js +4 -4
  38. package/dist/rest/intents.d.ts +301 -142
  39. package/dist/rest/intents.d.ts.map +1 -1
  40. package/dist/rest/intents.js +66 -52
  41. package/dist/rest/signatures.d.ts +19 -5
  42. package/dist/rest/signatures.d.ts.map +1 -1
  43. package/dist/rest/signatures.js +47 -5
  44. package/dist/rest/transfers.d.ts +738 -362
  45. package/dist/rest/transfers.d.ts.map +1 -1
  46. package/dist/rest/transfers.js +71 -44
  47. package/dist/signing.d.ts +6 -2
  48. package/dist/signing.d.ts.map +1 -1
  49. package/dist/signing.js +2 -1
  50. package/dist/transfer.d.ts +101 -65
  51. package/dist/transfer.d.ts.map +1 -1
  52. package/dist/transfer.js +69 -43
  53. package/dist/transport/financial-events.d.ts +64 -13
  54. package/dist/transport/financial-events.d.ts.map +1 -1
  55. package/dist/transport/financial-events.js +34 -0
  56. package/dist/transport/generated/oauth-api.d.ts +352 -88
  57. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  58. package/dist/transport/intents.d.ts +6 -6
  59. package/dist/transport/intents.d.ts.map +1 -1
  60. package/dist/transport/rest.d.ts +4 -4
  61. package/package.json +1 -1
@@ -34,6 +34,76 @@ declare const IdempotencyKeyNotAllowed_base: (abstract new (data: {}, message?:
34
34
  export declare class IdempotencyKeyNotAllowed extends /* @__PURE__ */ IdempotencyKeyNotAllowed_base {
35
35
  constructor(message?: string);
36
36
  }
37
+ declare const ApprovalRequiredUseIntents_base: (abstract new (data: {}, message?: string, hint?: string) => {
38
+ readonly error: "approval_required_use_intents";
39
+ readonly hint?: string;
40
+ readonly data: {};
41
+ name: string;
42
+ message: string;
43
+ stack?: string;
44
+ cause?: unknown;
45
+ }) & {
46
+ readonly error: "approval_required_use_intents";
47
+ readonly status: 400;
48
+ readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{}, undefined>, v.DescriptionAction<{}, "`POST /transfers` takes only a signed transfer with `approved: true`. Send one with `approved: false` to `POST /intents`.">]>;
49
+ define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): (abstract new (data: v.InferOutput<Data>, message?: string, hint?: string) => {
50
+ readonly error: Code;
51
+ readonly hint?: string;
52
+ readonly data: v.InferOutput<Data>;
53
+ name: string;
54
+ message: string;
55
+ stack?: string;
56
+ cause?: unknown;
57
+ }) & {
58
+ readonly error: Code;
59
+ readonly status: Status;
60
+ readonly data: Data;
61
+ define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
62
+ };
63
+ };
64
+ /**
65
+ * A signed transfer with `approved: false` arrived at `POST /transfers`. That door takes a transfer
66
+ * its own signature approved. A signed transfer that waits for a decision is an Intent: send it to
67
+ * `POST /intents`. Nothing was recorded.
68
+ */
69
+ export declare class ApprovalRequiredUseIntents extends /* @__PURE__ */ ApprovalRequiredUseIntents_base {
70
+ constructor(message?: string);
71
+ }
72
+ declare const ApprovedUseTransfers_base: (abstract new (data: {}, message?: string, hint?: string) => {
73
+ readonly error: "approved_use_transfers";
74
+ readonly hint?: string;
75
+ readonly data: {};
76
+ name: string;
77
+ message: string;
78
+ stack?: string;
79
+ cause?: unknown;
80
+ }) & {
81
+ readonly error: "approved_use_transfers";
82
+ readonly status: 400;
83
+ readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{}, undefined>, v.DescriptionAction<{}, "`POST /intents` takes a signed transfer only with `approved: false`. Send one with `approved: true` to `POST /transfers`.">]>;
84
+ define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): (abstract new (data: v.InferOutput<Data>, message?: string, hint?: string) => {
85
+ readonly error: Code;
86
+ readonly hint?: string;
87
+ readonly data: v.InferOutput<Data>;
88
+ name: string;
89
+ message: string;
90
+ stack?: string;
91
+ cause?: unknown;
92
+ }) & {
93
+ readonly error: Code;
94
+ readonly status: Status;
95
+ readonly data: Data;
96
+ define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
97
+ };
98
+ };
99
+ /**
100
+ * A signed transfer with `approved: true` arrived at `POST /intents`. Its signature is the approval,
101
+ * so no decision is left to wait for: send it to `POST /transfers`. A signed account opening or
102
+ * closure with `approved: true` stays accepted here. Nothing was recorded.
103
+ */
104
+ export declare class ApprovedUseTransfers extends /* @__PURE__ */ ApprovedUseTransfers_base {
105
+ constructor(message?: string);
106
+ }
37
107
  declare const InvalidSignedInstruction_base: (abstract new (data: {
38
108
  reason: "malformed_assertion" | "missing_signature" | "missing_key_id" | "disallowed_algorithm" | "unknown_key" | "revoked_key" | "expired_key" | "unusable_key" | "unsynced_key" | "invalid_signature" | "premature_assertion" | "missing_expiration" | "expiration_too_soon" | "missing_instruction_id" | "missing_claim" | "wrong_audience" | "wrong_issuer" | "verification_failed" | "invalid_claims";
39
109
  issues?: {
@@ -976,7 +1046,7 @@ declare const BankRefused_base: (abstract new (intentId?: string, message?: stri
976
1046
  define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
977
1047
  };
978
1048
  };
979
- /** AndCo or its ledger refused the request before accepting it; no money moved. */
1049
+ /** AndCo refused the request before accepting it; no money moved. */
980
1050
  export declare class BankRefused extends /* @__PURE__ */ BankRefused_base {
981
1051
  }
982
1052
  declare const InsufficientFunds_base: (abstract new (intentId?: string, message?: string) => {
@@ -1048,7 +1118,7 @@ declare const BankRejected_base: (abstract new (intentId?: string, message?: str
1048
1118
  define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
1049
1119
  };
1050
1120
  };
1051
- /** The ledger refused an entry and nothing stays moved. */
1121
+ /** AndCo rejected the movement and nothing stays moved. */
1052
1122
  export declare class BankRejected extends /* @__PURE__ */ BankRejected_base {
1053
1123
  }
1054
1124
  declare const BankReviewRequired_base: (abstract new (intentId?: string, message?: string) => {
@@ -1138,10 +1208,11 @@ export declare class NotImplemented extends /* @__PURE__ */ NotImplemented_base
1138
1208
  constructor(data: NotImplemented["data"], message?: string, hint?: string);
1139
1209
  }
1140
1210
  /**
1141
- * `<base>[.<detail>]`: where an Intent stands. Decide on the base with `INTENT_STATUS_BASE` and
1211
+ * `<base>[.<detail>]`: where an Intent stands in its decision. An Intent ends at its decision: it has
1212
+ * no `processing`, `succeeded` or `failed` status. Decide on the base with `INTENT_STATUS_BASE` and
1142
1213
  * `IS_INTENT_TERMINAL_STATUS`, never on the whole value.
1143
1214
  */
1144
- export declare const IntentStatus: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
1215
+ export declare const IntentStatus: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
1145
1216
  /** Where an Intent stands, as `<base>[.<detail>]`. */
1146
1217
  export type IntentStatus = v.InferOutput<typeof IntentStatus>;
1147
1218
  /** The AndCo account a deposit lands on, with what a payer at another bank types to pay into it. */
@@ -1198,7 +1269,7 @@ export declare const DepositTransaction: v.StrictObjectSchema<{
1198
1269
  /** Authoritative Project-facing state of a deposit. */
1199
1270
  export declare const DepositIntent: v.ObjectSchema<{
1200
1271
  readonly type: v.LiteralSchema<"deposit", undefined>;
1201
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
1272
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
1202
1273
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1203
1274
  readonly closure: v.NullableSchema<v.ObjectSchema<{
1204
1275
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -1289,9 +1360,9 @@ export type DepositIntent = v.InferOutput<typeof DepositIntent>;
1289
1360
  /** The amount a transfer orders, as it is answered. */
1290
1361
  export declare const TransferAmount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1291
1362
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1292
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
1363
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
1293
1364
  readonly editable: v.BooleanSchema<undefined>;
1294
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
1365
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
1295
1366
  }, undefined>, v.DescriptionAction<{
1296
1367
  currency: "CLP";
1297
1368
  value: number;
@@ -1301,7 +1372,7 @@ export declare const TransferAmount: v.SchemaWithPipe<readonly [v.StrictObjectSc
1301
1372
  /** The money a transfer actually moved and when it settled. */
1302
1373
  export declare const TransferSettlement: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1303
1374
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1304
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
1375
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
1305
1376
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
1306
1377
  }, undefined>, v.DescriptionAction<{
1307
1378
  currency: "CLP";
@@ -1311,7 +1382,8 @@ export declare const TransferSettlement: v.SchemaWithPipe<readonly [v.StrictObje
1311
1382
  /** Authoritative Project-facing state of a transfer. */
1312
1383
  export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1313
1384
  readonly type: v.LiteralSchema<"transfer", undefined>;
1314
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
1385
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
1386
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
1315
1387
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
1316
1388
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1317
1389
  type: v.LiteralSchema<"account_key", undefined>;
@@ -1350,8 +1422,8 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1350
1422
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
1351
1423
  readonly type: v.LiteralSchema<"external", undefined>;
1352
1424
  readonly country: v.LiteralSchema<"CL", undefined>;
1353
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
1354
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
1425
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
1426
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
1355
1427
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
1356
1428
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
1357
1429
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -1399,12 +1471,12 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1399
1471
  }, undefined>, v.DescriptionAction<{
1400
1472
  value: string;
1401
1473
  editable: boolean;
1402
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
1474
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
1403
1475
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1404
1476
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1405
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
1477
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
1406
1478
  readonly editable: v.BooleanSchema<undefined>;
1407
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
1479
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
1408
1480
  }, undefined>, v.DescriptionAction<{
1409
1481
  currency: "CLP";
1410
1482
  value: number;
@@ -1413,7 +1485,7 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1413
1485
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
1414
1486
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1415
1487
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1416
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
1488
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
1417
1489
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
1418
1490
  }, undefined>, v.DescriptionAction<{
1419
1491
  currency: "CLP";
@@ -1424,7 +1496,7 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1424
1496
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1425
1497
  readonly amount: v.LiteralSchema<"0", undefined>;
1426
1498
  }, undefined>;
1427
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
1499
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
1428
1500
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
1429
1501
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
1430
1502
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -1435,7 +1507,8 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1435
1507
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1436
1508
  }, undefined>, v.DescriptionAction<{
1437
1509
  type: "transfer";
1438
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
1510
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
1511
+ transfer_id: string | null;
1439
1512
  signed: boolean;
1440
1513
  sender: {
1441
1514
  type: "account_key";
@@ -1482,7 +1555,7 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1482
1555
  currency: "CLP";
1483
1556
  amount: "0";
1484
1557
  };
1485
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
1558
+ interaction_reason?: "source_account_required" | undefined;
1486
1559
  expires_at: string | null;
1487
1560
  expires_in_seconds: number | null;
1488
1561
  id: string;
@@ -1493,13 +1566,15 @@ export declare const TransferIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1493
1566
  server_time: string;
1494
1567
  created_at: string;
1495
1568
  authorization_url: string;
1496
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>;
1569
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>;
1497
1570
  /** Authoritative Project-facing state of a transfer. */
1498
1571
  export type TransferIntent = v.InferOutput<typeof TransferIntent>;
1499
1572
  /** Authoritative Project-facing state of an account opening. */
1500
1573
  export declare const AccountOpeningIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1501
1574
  readonly type: v.LiteralSchema<"account_opening", undefined>;
1502
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
1575
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
1576
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
1577
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
1503
1578
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
1504
1579
  readonly account: v.StrictObjectSchema<{
1505
1580
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -1524,7 +1599,9 @@ export declare const AccountOpeningIntent: v.SchemaWithPipe<readonly [v.ObjectSc
1524
1599
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1525
1600
  }, undefined>, v.DescriptionAction<{
1526
1601
  type: "account_opening";
1527
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
1602
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
1603
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
1604
+ account_opening_status_detail: string | null;
1528
1605
  signed: boolean;
1529
1606
  account: {
1530
1607
  accountKey: string;
@@ -1546,13 +1623,15 @@ export declare const AccountOpeningIntent: v.SchemaWithPipe<readonly [v.ObjectSc
1546
1623
  server_time: string;
1547
1624
  created_at: string;
1548
1625
  authorization_url: string;
1549
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>;
1626
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>;
1550
1627
  /** Authoritative Project-facing state of an account opening. */
1551
1628
  export type AccountOpeningIntent = v.InferOutput<typeof AccountOpeningIntent>;
1552
1629
  /** Authoritative Project-facing state of an account closure. */
1553
1630
  export declare const AccountClosureIntent: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1554
1631
  readonly type: v.LiteralSchema<"account_closure", undefined>;
1555
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
1632
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
1633
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
1634
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
1556
1635
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
1557
1636
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1558
1637
  type: v.LiteralSchema<"account_key", undefined>;
@@ -1591,7 +1670,9 @@ export declare const AccountClosureIntent: v.SchemaWithPipe<readonly [v.ObjectSc
1591
1670
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1592
1671
  }, undefined>, v.DescriptionAction<{
1593
1672
  type: "account_closure";
1594
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
1673
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
1674
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
1675
+ account_closure_status_detail: string | null;
1595
1676
  signed: boolean;
1596
1677
  account: {
1597
1678
  type: "account_key";
@@ -1621,7 +1702,7 @@ export type AccountClosureIntent = v.InferOutput<typeof AccountClosureIntent>;
1621
1702
  /** One Intent, of any type, as the Project that created it reads it. */
1622
1703
  export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1623
1704
  readonly type: v.LiteralSchema<"deposit", undefined>;
1624
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
1705
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
1625
1706
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1626
1707
  readonly closure: v.NullableSchema<v.ObjectSchema<{
1627
1708
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -1708,7 +1789,8 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1708
1789
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1709
1790
  }, undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
1710
1791
  readonly type: v.LiteralSchema<"transfer", undefined>;
1711
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
1792
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
1793
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
1712
1794
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
1713
1795
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1714
1796
  type: v.LiteralSchema<"account_key", undefined>;
@@ -1747,8 +1829,8 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1747
1829
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
1748
1830
  readonly type: v.LiteralSchema<"external", undefined>;
1749
1831
  readonly country: v.LiteralSchema<"CL", undefined>;
1750
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
1751
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
1832
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
1833
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
1752
1834
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
1753
1835
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
1754
1836
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -1796,12 +1878,12 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1796
1878
  }, undefined>, v.DescriptionAction<{
1797
1879
  value: string;
1798
1880
  editable: boolean;
1799
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
1881
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
1800
1882
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1801
1883
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1802
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
1884
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
1803
1885
  readonly editable: v.BooleanSchema<undefined>;
1804
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
1886
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
1805
1887
  }, undefined>, v.DescriptionAction<{
1806
1888
  currency: "CLP";
1807
1889
  value: number;
@@ -1810,7 +1892,7 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1810
1892
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
1811
1893
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1812
1894
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1813
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
1895
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
1814
1896
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
1815
1897
  }, undefined>, v.DescriptionAction<{
1816
1898
  currency: "CLP";
@@ -1821,7 +1903,7 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1821
1903
  readonly currency: v.LiteralSchema<"CLP", undefined>;
1822
1904
  readonly amount: v.LiteralSchema<"0", undefined>;
1823
1905
  }, undefined>;
1824
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
1906
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
1825
1907
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
1826
1908
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
1827
1909
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -1832,7 +1914,8 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1832
1914
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1833
1915
  }, undefined>, v.DescriptionAction<{
1834
1916
  type: "transfer";
1835
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
1917
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
1918
+ transfer_id: string | null;
1836
1919
  signed: boolean;
1837
1920
  sender: {
1838
1921
  type: "account_key";
@@ -1879,7 +1962,7 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1879
1962
  currency: "CLP";
1880
1963
  amount: "0";
1881
1964
  };
1882
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
1965
+ interaction_reason?: "source_account_required" | undefined;
1883
1966
  expires_at: string | null;
1884
1967
  expires_in_seconds: number | null;
1885
1968
  id: string;
@@ -1890,9 +1973,11 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1890
1973
  server_time: string;
1891
1974
  created_at: string;
1892
1975
  authorization_url: string;
1893
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
1976
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
1894
1977
  readonly type: v.LiteralSchema<"account_opening", undefined>;
1895
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
1978
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
1979
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
1980
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
1896
1981
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
1897
1982
  readonly account: v.StrictObjectSchema<{
1898
1983
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -1917,7 +2002,9 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1917
2002
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1918
2003
  }, undefined>, v.DescriptionAction<{
1919
2004
  type: "account_opening";
1920
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
2005
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
2006
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
2007
+ account_opening_status_detail: string | null;
1921
2008
  signed: boolean;
1922
2009
  account: {
1923
2010
  accountKey: string;
@@ -1939,9 +2026,11 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1939
2026
  server_time: string;
1940
2027
  created_at: string;
1941
2028
  authorization_url: string;
1942
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
2029
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
1943
2030
  readonly type: v.LiteralSchema<"account_closure", undefined>;
1944
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
2031
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
2032
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
2033
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
1945
2034
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
1946
2035
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1947
2036
  type: v.LiteralSchema<"account_key", undefined>;
@@ -1980,7 +2069,9 @@ export declare const Intent: v.VariantSchema<"type", [v.ObjectSchema<{
1980
2069
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
1981
2070
  }, undefined>, v.DescriptionAction<{
1982
2071
  type: "account_closure";
1983
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
2072
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
2073
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
2074
+ account_closure_status_detail: string | null;
1984
2075
  signed: boolean;
1985
2076
  account: {
1986
2077
  type: "account_key";
@@ -2022,7 +2113,7 @@ export type DepositCloseResult = v.InferOutput<typeof DepositCloseResult>;
2022
2113
  /** Creates an Intent from a proposal (`application/json`) or from a Signed Instruction (`application/jwt`). */
2023
2114
  export declare const createIntent: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
2024
2115
  readonly headers: v.ObjectSchema<{
2025
- readonly "idempotency-key": v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Required with `application/json`, and refused with `application/jwt`, which answers `400 idempotency_key_not_allowed` when it arrives beside a signature: the idempotency key of a Signed Instruction is its own `jti`, and two candidates for one key is exactly the ambiguity that gets read the wrong way round. OpenAPI cannot make a header conditional on the media type, so it is published as optional rather than demanding what the server refuses.">]>;
2116
+ readonly "idempotency-key": v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Required with `application/json`, and refused with `application/jwt` and `application/jose+json`, which answer `400 idempotency_key_not_allowed` when it arrives beside a signature: the idempotency key of a Signed Instruction is its own `jti`, and two candidates for one key is exactly the ambiguity that gets read the wrong way round. OpenAPI cannot make a header conditional on the media type, so it is published as optional rather than demanding what the server refuses.">]>;
2026
2117
  }, undefined>;
2027
2118
  readonly body: v.UnionSchema<[v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
2028
2119
  readonly type: v.LiteralSchema<"deposit", undefined>;
@@ -2169,13 +2260,13 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2169
2260
  readonly type: v.LiteralSchema<"transfer", undefined>;
2170
2261
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2171
2262
  readonly currency: v.LiteralSchema<"CLP", undefined>;
2172
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
2263
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
2173
2264
  readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
2174
2265
  }, undefined>, v.DescriptionAction<{
2175
2266
  currency: "CLP";
2176
2267
  value: number;
2177
2268
  editable: boolean;
2178
- }, "The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647 (int4, as Core stores it). `editable: true` lets the person who confirms set the amount on AndCo's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
2269
+ }, "The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `editable: true` lets the person who confirms set the amount on AndCo's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
2179
2270
  readonly sender: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2180
2271
  type: v.LiteralSchema<"account_key", undefined>;
2181
2272
  accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -2213,8 +2304,8 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2213
2304
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
2214
2305
  readonly type: v.LiteralSchema<"external", undefined>;
2215
2306
  readonly country: v.LiteralSchema<"CL", undefined>;
2216
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
2217
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
2307
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
2308
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
2218
2309
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
2219
2310
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
2220
2311
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -2262,7 +2353,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2262
2353
  }, undefined>, v.DescriptionAction<{
2263
2354
  value: string;
2264
2355
  editable: boolean;
2265
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
2356
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
2266
2357
  } & {
2267
2358
  readonly expires_in: v.StringSchema<undefined>;
2268
2359
  readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
@@ -2271,13 +2362,13 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2271
2362
  readonly type: v.LiteralSchema<"transfer", undefined>;
2272
2363
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2273
2364
  readonly currency: v.LiteralSchema<"CLP", undefined>;
2274
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
2365
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
2275
2366
  readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
2276
2367
  }, undefined>, v.DescriptionAction<{
2277
2368
  currency: "CLP";
2278
2369
  value: number;
2279
2370
  editable: boolean;
2280
- }, "The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647 (int4, as Core stores it). `editable: true` lets the person who confirms set the amount on AndCo's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
2371
+ }, "The amount a transfer proposes: `value` is an integer in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `editable: true` lets the person who confirms set the amount on AndCo's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
2281
2372
  readonly sender: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2282
2373
  type: v.LiteralSchema<"account_key", undefined>;
2283
2374
  accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -2315,8 +2406,8 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2315
2406
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
2316
2407
  readonly type: v.LiteralSchema<"external", undefined>;
2317
2408
  readonly country: v.LiteralSchema<"CL", undefined>;
2318
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
2319
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
2409
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
2410
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
2320
2411
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
2321
2412
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
2322
2413
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -2364,7 +2455,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2364
2455
  }, undefined>, v.DescriptionAction<{
2365
2456
  value: string;
2366
2457
  editable: boolean;
2367
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
2458
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
2368
2459
  } & {
2369
2460
  readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
2370
2461
  readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -2452,7 +2543,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2452
2543
  } | undefined;
2453
2544
  expires_in?: undefined;
2454
2545
  expires_at: string | null;
2455
- }, "The `application/json` half of creating a transfer: an Intent born waiting for an Approval, in Core's vocabulary (ADR 0093): `sender`, `receiver`, an integer `amount.value` and a `comment` of at most 60 bytes. A null `sender` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `receiver` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A Receptor the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. A Receptor at a bank is named in Core's vocabulary (`IntentAccountExternal`). A signed transfer is not an Intent: it is uploaded to `POST /transfers` as a `SignedTransferEnvelope`.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
2546
+ }, "The `application/json` half of creating a transfer: an Intent born waiting for an Approval, in the transfer vocabulary of the API: `sender`, `receiver`, an integer `amount.value` and a `comment` of at most 60 bytes. A null `sender` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `receiver` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A Receptor the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. A Receptor at a bank is named in the transfer vocabulary of the API (`IntentAccountExternal`). A signed transfer is not an Intent: it is submitted to `POST /transfers` as a `SignedTransferEnvelope`.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
2456
2547
  readonly type: v.LiteralSchema<"account_opening", undefined>;
2457
2548
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
2458
2549
  readonly name: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "The display label the account opens with. Mutable afterwards, and read by no permission.">]>;
@@ -2612,10 +2703,28 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2612
2703
  };
2613
2704
  expires_in?: undefined;
2614
2705
  expires_at: string;
2615
- }, "The `application/json` half of closing a cuenta digital: an Intent born waiting for an Approval. `/accounts` has no `DELETE` because everything that changes an account happens through an Intent. It carries no amount, no source and no destination -- only a reference to the account it closes.">]>], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, string>, v.MetadataAction<string, Record<string, unknown>>]>], undefined>;
2706
+ }, "The `application/json` half of closing a cuenta digital: an Intent born waiting for an Approval. `/accounts` has no `DELETE` because everything that changes an account happens through an Intent. It carries no amount, no source and no destination -- only a reference to the account it closes.">]>], undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, string>, v.MetadataAction<string, Record<string, unknown>>]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2707
+ readonly payload: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "The base64url of the JSON claims (`SignedTransferClaims`).">]>;
2708
+ readonly signatures: v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
2709
+ readonly protected: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "The base64url of the JSON protected header (`SignedTransferHeader`).">]>;
2710
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
2711
+ }, undefined>, undefined>, v.MinLengthAction<{
2712
+ protected: string;
2713
+ signature: string;
2714
+ }[], 1, undefined>, v.DescriptionAction<{
2715
+ protected: string;
2716
+ signature: string;
2717
+ }[], "At least one signature over the same payload; every one is verified.">]>;
2718
+ }, undefined>, v.DescriptionAction<{
2719
+ payload: string;
2720
+ signatures: {
2721
+ protected: string;
2722
+ signature: string;
2723
+ }[];
2724
+ }, "A signed transfer: a JWS in the General JSON Serialization (RFC 7515 §7.2.1), with one `payload` and at least one signature, each with a protected header of `typ` `transfer.v1+jwt`. Sent as `application/jose+json`.">]>], undefined>;
2616
2725
  }, undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
2617
2726
  readonly type: v.LiteralSchema<"deposit", undefined>;
2618
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
2727
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
2619
2728
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
2620
2729
  readonly closure: v.NullableSchema<v.ObjectSchema<{
2621
2730
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -2702,7 +2811,8 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2702
2811
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
2703
2812
  }, undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
2704
2813
  readonly type: v.LiteralSchema<"transfer", undefined>;
2705
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
2814
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
2815
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
2706
2816
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
2707
2817
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2708
2818
  type: v.LiteralSchema<"account_key", undefined>;
@@ -2741,8 +2851,8 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2741
2851
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
2742
2852
  readonly type: v.LiteralSchema<"external", undefined>;
2743
2853
  readonly country: v.LiteralSchema<"CL", undefined>;
2744
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
2745
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
2854
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
2855
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
2746
2856
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
2747
2857
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
2748
2858
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -2790,12 +2900,12 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2790
2900
  }, undefined>, v.DescriptionAction<{
2791
2901
  value: string;
2792
2902
  editable: boolean;
2793
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
2903
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
2794
2904
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2795
2905
  readonly currency: v.LiteralSchema<"CLP", undefined>;
2796
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
2906
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
2797
2907
  readonly editable: v.BooleanSchema<undefined>;
2798
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
2908
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
2799
2909
  }, undefined>, v.DescriptionAction<{
2800
2910
  currency: "CLP";
2801
2911
  value: number;
@@ -2804,7 +2914,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2804
2914
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
2805
2915
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2806
2916
  readonly currency: v.LiteralSchema<"CLP", undefined>;
2807
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
2917
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
2808
2918
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
2809
2919
  }, undefined>, v.DescriptionAction<{
2810
2920
  currency: "CLP";
@@ -2815,7 +2925,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2815
2925
  readonly currency: v.LiteralSchema<"CLP", undefined>;
2816
2926
  readonly amount: v.LiteralSchema<"0", undefined>;
2817
2927
  }, undefined>;
2818
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
2928
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
2819
2929
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
2820
2930
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
2821
2931
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -2826,7 +2936,8 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2826
2936
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
2827
2937
  }, undefined>, v.DescriptionAction<{
2828
2938
  type: "transfer";
2829
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
2939
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
2940
+ transfer_id: string | null;
2830
2941
  signed: boolean;
2831
2942
  sender: {
2832
2943
  type: "account_key";
@@ -2873,7 +2984,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2873
2984
  currency: "CLP";
2874
2985
  amount: "0";
2875
2986
  };
2876
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
2987
+ interaction_reason?: "source_account_required" | undefined;
2877
2988
  expires_at: string | null;
2878
2989
  expires_in_seconds: number | null;
2879
2990
  id: string;
@@ -2884,9 +2995,11 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2884
2995
  server_time: string;
2885
2996
  created_at: string;
2886
2997
  authorization_url: string;
2887
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
2998
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
2888
2999
  readonly type: v.LiteralSchema<"account_opening", undefined>;
2889
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3000
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3001
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
3002
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
2890
3003
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
2891
3004
  readonly account: v.StrictObjectSchema<{
2892
3005
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -2911,7 +3024,9 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2911
3024
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
2912
3025
  }, undefined>, v.DescriptionAction<{
2913
3026
  type: "account_opening";
2914
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3027
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3028
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
3029
+ account_opening_status_detail: string | null;
2915
3030
  signed: boolean;
2916
3031
  account: {
2917
3032
  accountKey: string;
@@ -2933,9 +3048,11 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2933
3048
  server_time: string;
2934
3049
  created_at: string;
2935
3050
  authorization_url: string;
2936
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3051
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
2937
3052
  readonly type: v.LiteralSchema<"account_closure", undefined>;
2938
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3053
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3054
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
3055
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
2939
3056
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
2940
3057
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
2941
3058
  type: v.LiteralSchema<"account_key", undefined>;
@@ -2974,7 +3091,9 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2974
3091
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
2975
3092
  }, undefined>, v.DescriptionAction<{
2976
3093
  type: "account_closure";
2977
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3094
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3095
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
3096
+ account_closure_status_detail: string | null;
2978
3097
  signed: boolean;
2979
3098
  account: {
2980
3099
  type: "account_key";
@@ -2998,13 +3117,13 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
2998
3117
  server_time: string;
2999
3118
  created_at: string;
3000
3119
  authorization_url: string;
3001
- }, "Authoritative Project-facing state of an account closure. It carries no amount and no fee.">]>], undefined>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof AccountKeyOutOfGrant, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof AccountKeyTaken, typeof BankAccountQuotaExceeded, typeof InvalidIntentState, typeof IntentExpired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof DepositAmountOutOfBounds, typeof DepositDestinationAmbiguous, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof TransferSenderIdentityUnavailable, typeof UnsupportedBank, typeof BankConnectionUnavailable, typeof BankAccountNumberMissing, typeof BankAuthorizationDenied, typeof BankHolderWithoutAccount, typeof BankAccountLimitReached, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
3120
+ }, "Authoritative Project-facing state of an account closure. It carries no amount and no fee.">]>], undefined>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof ApprovedUseTransfers, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof AccountKeyOutOfGrant, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof AccountKeyTaken, typeof BankAccountQuotaExceeded, typeof InvalidIntentState, typeof IntentExpired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof DepositAmountOutOfBounds, typeof DepositDestinationAmbiguous, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof TransferSenderIdentityUnavailable, typeof UnsupportedBank, typeof BankConnectionUnavailable, typeof BankAccountNumberMissing, typeof BankAuthorizationDenied, typeof BankHolderWithoutAccount, typeof BankAccountLimitReached, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
3002
3121
  /** Reads one Intent created under the same exact OAuth Grant. */
3003
3122
  export declare const getIntent: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
3004
3123
  readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
3005
3124
  }, undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
3006
3125
  readonly type: v.LiteralSchema<"deposit", undefined>;
3007
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
3126
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
3008
3127
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3009
3128
  readonly closure: v.NullableSchema<v.ObjectSchema<{
3010
3129
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -3091,7 +3210,8 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3091
3210
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3092
3211
  }, undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3093
3212
  readonly type: v.LiteralSchema<"transfer", undefined>;
3094
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3213
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3214
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
3095
3215
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3096
3216
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3097
3217
  type: v.LiteralSchema<"account_key", undefined>;
@@ -3130,8 +3250,8 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3130
3250
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
3131
3251
  readonly type: v.LiteralSchema<"external", undefined>;
3132
3252
  readonly country: v.LiteralSchema<"CL", undefined>;
3133
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
3134
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
3253
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
3254
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
3135
3255
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
3136
3256
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
3137
3257
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -3179,12 +3299,12 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3179
3299
  }, undefined>, v.DescriptionAction<{
3180
3300
  value: string;
3181
3301
  editable: boolean;
3182
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
3302
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
3183
3303
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3184
3304
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3185
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
3305
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
3186
3306
  readonly editable: v.BooleanSchema<undefined>;
3187
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
3307
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
3188
3308
  }, undefined>, v.DescriptionAction<{
3189
3309
  currency: "CLP";
3190
3310
  value: number;
@@ -3193,7 +3313,7 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3193
3313
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
3194
3314
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3195
3315
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3196
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
3316
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
3197
3317
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
3198
3318
  }, undefined>, v.DescriptionAction<{
3199
3319
  currency: "CLP";
@@ -3204,7 +3324,7 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3204
3324
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3205
3325
  readonly amount: v.LiteralSchema<"0", undefined>;
3206
3326
  }, undefined>;
3207
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
3327
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
3208
3328
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
3209
3329
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
3210
3330
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -3215,7 +3335,8 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3215
3335
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3216
3336
  }, undefined>, v.DescriptionAction<{
3217
3337
  type: "transfer";
3218
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3338
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3339
+ transfer_id: string | null;
3219
3340
  signed: boolean;
3220
3341
  sender: {
3221
3342
  type: "account_key";
@@ -3262,7 +3383,7 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3262
3383
  currency: "CLP";
3263
3384
  amount: "0";
3264
3385
  };
3265
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
3386
+ interaction_reason?: "source_account_required" | undefined;
3266
3387
  expires_at: string | null;
3267
3388
  expires_in_seconds: number | null;
3268
3389
  id: string;
@@ -3273,9 +3394,11 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3273
3394
  server_time: string;
3274
3395
  created_at: string;
3275
3396
  authorization_url: string;
3276
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3397
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3277
3398
  readonly type: v.LiteralSchema<"account_opening", undefined>;
3278
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3399
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3400
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
3401
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
3279
3402
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3280
3403
  readonly account: v.StrictObjectSchema<{
3281
3404
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -3300,7 +3423,9 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3300
3423
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3301
3424
  }, undefined>, v.DescriptionAction<{
3302
3425
  type: "account_opening";
3303
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3426
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3427
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
3428
+ account_opening_status_detail: string | null;
3304
3429
  signed: boolean;
3305
3430
  account: {
3306
3431
  accountKey: string;
@@ -3322,9 +3447,11 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3322
3447
  server_time: string;
3323
3448
  created_at: string;
3324
3449
  authorization_url: string;
3325
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3450
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3326
3451
  readonly type: v.LiteralSchema<"account_closure", undefined>;
3327
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3452
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3453
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
3454
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
3328
3455
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3329
3456
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3330
3457
  type: v.LiteralSchema<"account_key", undefined>;
@@ -3363,7 +3490,9 @@ export declare const getIntent: import("@orpc/contract").ProcedureContractBuilde
3363
3490
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3364
3491
  }, undefined>, v.DescriptionAction<{
3365
3492
  type: "account_closure";
3366
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3493
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3494
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
3495
+ account_closure_status_detail: string | null;
3367
3496
  signed: boolean;
3368
3497
  account: {
3369
3498
  type: "account_key";
@@ -3405,7 +3534,7 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3405
3534
  readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
3406
3535
  }, undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
3407
3536
  readonly type: v.LiteralSchema<"deposit", undefined>;
3408
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
3537
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
3409
3538
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3410
3539
  readonly closure: v.NullableSchema<v.ObjectSchema<{
3411
3540
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -3492,7 +3621,8 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3492
3621
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3493
3622
  }, undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3494
3623
  readonly type: v.LiteralSchema<"transfer", undefined>;
3495
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3624
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3625
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
3496
3626
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3497
3627
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3498
3628
  type: v.LiteralSchema<"account_key", undefined>;
@@ -3531,8 +3661,8 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3531
3661
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
3532
3662
  readonly type: v.LiteralSchema<"external", undefined>;
3533
3663
  readonly country: v.LiteralSchema<"CL", undefined>;
3534
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
3535
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
3664
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
3665
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
3536
3666
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
3537
3667
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
3538
3668
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -3580,12 +3710,12 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3580
3710
  }, undefined>, v.DescriptionAction<{
3581
3711
  value: string;
3582
3712
  editable: boolean;
3583
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
3713
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
3584
3714
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3585
3715
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3586
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
3716
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
3587
3717
  readonly editable: v.BooleanSchema<undefined>;
3588
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
3718
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
3589
3719
  }, undefined>, v.DescriptionAction<{
3590
3720
  currency: "CLP";
3591
3721
  value: number;
@@ -3594,7 +3724,7 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3594
3724
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
3595
3725
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3596
3726
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3597
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
3727
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
3598
3728
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
3599
3729
  }, undefined>, v.DescriptionAction<{
3600
3730
  currency: "CLP";
@@ -3605,7 +3735,7 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3605
3735
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3606
3736
  readonly amount: v.LiteralSchema<"0", undefined>;
3607
3737
  }, undefined>;
3608
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
3738
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
3609
3739
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
3610
3740
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
3611
3741
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -3616,7 +3746,8 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3616
3746
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3617
3747
  }, undefined>, v.DescriptionAction<{
3618
3748
  type: "transfer";
3619
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3749
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3750
+ transfer_id: string | null;
3620
3751
  signed: boolean;
3621
3752
  sender: {
3622
3753
  type: "account_key";
@@ -3663,7 +3794,7 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3663
3794
  currency: "CLP";
3664
3795
  amount: "0";
3665
3796
  };
3666
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
3797
+ interaction_reason?: "source_account_required" | undefined;
3667
3798
  expires_at: string | null;
3668
3799
  expires_in_seconds: number | null;
3669
3800
  id: string;
@@ -3674,9 +3805,11 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3674
3805
  server_time: string;
3675
3806
  created_at: string;
3676
3807
  authorization_url: string;
3677
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3808
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3678
3809
  readonly type: v.LiteralSchema<"account_opening", undefined>;
3679
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3810
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3811
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
3812
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
3680
3813
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3681
3814
  readonly account: v.StrictObjectSchema<{
3682
3815
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -3701,7 +3834,9 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3701
3834
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3702
3835
  }, undefined>, v.DescriptionAction<{
3703
3836
  type: "account_opening";
3704
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3837
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3838
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
3839
+ account_opening_status_detail: string | null;
3705
3840
  signed: boolean;
3706
3841
  account: {
3707
3842
  accountKey: string;
@@ -3723,9 +3858,11 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3723
3858
  server_time: string;
3724
3859
  created_at: string;
3725
3860
  authorization_url: string;
3726
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3861
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3727
3862
  readonly type: v.LiteralSchema<"account_closure", undefined>;
3728
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
3863
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
3864
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
3865
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
3729
3866
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3730
3867
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3731
3868
  type: v.LiteralSchema<"account_key", undefined>;
@@ -3764,7 +3901,9 @@ export declare const approveIntent: import("@orpc/contract").ProcedureContractBu
3764
3901
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3765
3902
  }, undefined>, v.DescriptionAction<{
3766
3903
  type: "account_closure";
3767
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
3904
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
3905
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
3906
+ account_closure_status_detail: string | null;
3768
3907
  signed: boolean;
3769
3908
  account: {
3770
3909
  type: "account_key";
@@ -3795,11 +3934,11 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
3795
3934
  readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
3796
3935
  }, undefined>;
3797
3936
  readonly body: v.StrictObjectSchema<{
3798
- readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
3937
+ readonly reason: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3799
3938
  }, undefined>;
3800
3939
  }, undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
3801
3940
  readonly type: v.LiteralSchema<"deposit", undefined>;
3802
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
3941
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
3803
3942
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3804
3943
  readonly closure: v.NullableSchema<v.ObjectSchema<{
3805
3944
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -3886,7 +4025,8 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
3886
4025
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
3887
4026
  }, undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
3888
4027
  readonly type: v.LiteralSchema<"transfer", undefined>;
3889
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
4028
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
4029
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
3890
4030
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
3891
4031
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3892
4032
  type: v.LiteralSchema<"account_key", undefined>;
@@ -3925,8 +4065,8 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
3925
4065
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
3926
4066
  readonly type: v.LiteralSchema<"external", undefined>;
3927
4067
  readonly country: v.LiteralSchema<"CL", undefined>;
3928
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
3929
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
4068
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
4069
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
3930
4070
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
3931
4071
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
3932
4072
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -3974,12 +4114,12 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
3974
4114
  }, undefined>, v.DescriptionAction<{
3975
4115
  value: string;
3976
4116
  editable: boolean;
3977
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
4117
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
3978
4118
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3979
4119
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3980
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
4120
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
3981
4121
  readonly editable: v.BooleanSchema<undefined>;
3982
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
4122
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
3983
4123
  }, undefined>, v.DescriptionAction<{
3984
4124
  currency: "CLP";
3985
4125
  value: number;
@@ -3988,7 +4128,7 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
3988
4128
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
3989
4129
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
3990
4130
  readonly currency: v.LiteralSchema<"CLP", undefined>;
3991
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
4131
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
3992
4132
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
3993
4133
  }, undefined>, v.DescriptionAction<{
3994
4134
  currency: "CLP";
@@ -3999,7 +4139,7 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
3999
4139
  readonly currency: v.LiteralSchema<"CLP", undefined>;
4000
4140
  readonly amount: v.LiteralSchema<"0", undefined>;
4001
4141
  }, undefined>;
4002
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
4142
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
4003
4143
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
4004
4144
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
4005
4145
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -4010,7 +4150,8 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
4010
4150
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4011
4151
  }, undefined>, v.DescriptionAction<{
4012
4152
  type: "transfer";
4013
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
4153
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
4154
+ transfer_id: string | null;
4014
4155
  signed: boolean;
4015
4156
  sender: {
4016
4157
  type: "account_key";
@@ -4057,7 +4198,7 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
4057
4198
  currency: "CLP";
4058
4199
  amount: "0";
4059
4200
  };
4060
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
4201
+ interaction_reason?: "source_account_required" | undefined;
4061
4202
  expires_at: string | null;
4062
4203
  expires_in_seconds: number | null;
4063
4204
  id: string;
@@ -4068,9 +4209,11 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
4068
4209
  server_time: string;
4069
4210
  created_at: string;
4070
4211
  authorization_url: string;
4071
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4212
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4072
4213
  readonly type: v.LiteralSchema<"account_opening", undefined>;
4073
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
4214
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
4215
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
4216
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
4074
4217
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
4075
4218
  readonly account: v.StrictObjectSchema<{
4076
4219
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -4095,7 +4238,9 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
4095
4238
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4096
4239
  }, undefined>, v.DescriptionAction<{
4097
4240
  type: "account_opening";
4098
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
4241
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
4242
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
4243
+ account_opening_status_detail: string | null;
4099
4244
  signed: boolean;
4100
4245
  account: {
4101
4246
  accountKey: string;
@@ -4117,9 +4262,11 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
4117
4262
  server_time: string;
4118
4263
  created_at: string;
4119
4264
  authorization_url: string;
4120
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4265
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4121
4266
  readonly type: v.LiteralSchema<"account_closure", undefined>;
4122
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
4267
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
4268
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
4269
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
4123
4270
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
4124
4271
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
4125
4272
  type: v.LiteralSchema<"account_key", undefined>;
@@ -4158,7 +4305,9 @@ export declare const rejectIntent: import("@orpc/contract").ProcedureContractBui
4158
4305
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4159
4306
  }, undefined>, v.DescriptionAction<{
4160
4307
  type: "account_closure";
4161
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
4308
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
4309
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
4310
+ account_closure_status_detail: string | null;
4162
4311
  signed: boolean;
4163
4312
  account: {
4164
4313
  type: "account_key";
@@ -4189,11 +4338,11 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4189
4338
  readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
4190
4339
  }, undefined>;
4191
4340
  readonly body: v.StrictObjectSchema<{
4192
- readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
4341
+ readonly reason: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4193
4342
  }, undefined>;
4194
4343
  }, undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
4195
4344
  readonly type: v.LiteralSchema<"deposit", undefined>;
4196
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "failed"], undefined>, v.DescriptionAction<"completed" | "closed" | "failed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
4345
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "completed", "closed", "expired", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired"], undefined>, v.DescriptionAction<"completed" | "closed" | "cancelled" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. Read the base, what precedes the first dot, to know whether the Deposit can still change: `requires_action` can, every other base is final. A Grant that ends cancels its waiting Deposits with a detail.">]>;
4197
4346
  readonly attribution_version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4198
4347
  readonly closure: v.NullableSchema<v.ObjectSchema<{
4199
4348
  readonly closed_at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
@@ -4280,7 +4429,8 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4280
4429
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4281
4430
  }, undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4282
4431
  readonly type: v.LiteralSchema<"transfer", undefined>;
4283
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
4432
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
4433
+ readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that exists after the Intent is approved: read it with `GET /transfers/{transfer_id}`. Null while the Intent waits, and for ever when it ends rejected, cancelled or expired, because no Transfer exists then.">]>;
4284
4434
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
4285
4435
  readonly sender: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
4286
4436
  type: v.LiteralSchema<"account_key", undefined>;
@@ -4319,8 +4469,8 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4319
4469
  readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
4320
4470
  readonly type: v.LiteralSchema<"external", undefined>;
4321
4471
  readonly country: v.LiteralSchema<"CL", undefined>;
4322
- readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
4323
- readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
4472
+ readonly bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
4473
+ readonly account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "The account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
4324
4474
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
4325
4475
  readonly name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
4326
4476
  readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
@@ -4368,12 +4518,12 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4368
4518
  }, undefined>, v.DescriptionAction<{
4369
4519
  value: string;
4370
4520
  editable: boolean;
4371
- }, "The comment a transfer asks for, as Core's `comment`: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
4521
+ }, "The comment a transfer asks for: at most 60 bytes of UTF-8 (`comment_too_long`). `editable: true` lets the person who confirms change it; the comment freezes at confirmation.">]>, undefined>;
4372
4522
  readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
4373
4523
  readonly currency: v.LiteralSchema<"CLP", undefined>;
4374
- readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
4524
+ readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, v.DescriptionAction<number, "Immutable amount from the creation request, in the minor unit of the currency.">]>;
4375
4525
  readonly editable: v.BooleanSchema<undefined>;
4376
- readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
4526
+ readonly confirmed: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>, undefined>, v.DescriptionAction<number | null, "The amount the person confirmed, null until then; it is what moves. For a transfer that is not editable it is `value`, set when the person confirms. Always within the Grant's `transactions.minimum` and `transactions.maximum`, when it has them.">]>;
4377
4527
  }, undefined>, v.DescriptionAction<{
4378
4528
  currency: "CLP";
4379
4529
  value: number;
@@ -4382,7 +4532,7 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4382
4532
  }, "The amount a transfer orders, as it is answered: integers in the minor unit of the currency (CLP: whole pesos), at most 2147483647. `value` is the request's proposal and never changes; `confirmed` is the amount the person confirmed, null until they confirm, and it is what moves. It is never proof that money moved; read `settled` for that.">]>;
4383
4533
  readonly settled: v.NullableSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
4384
4534
  readonly currency: v.LiteralSchema<"CLP", undefined>;
4385
- readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
4535
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647. A larger one is refused with `max_value`.">]>;
4386
4536
  readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
4387
4537
  }, undefined>, v.DescriptionAction<{
4388
4538
  currency: "CLP";
@@ -4393,7 +4543,7 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4393
4543
  readonly currency: v.LiteralSchema<"CLP", undefined>;
4394
4544
  readonly amount: v.LiteralSchema<"0", undefined>;
4395
4545
  }, undefined>;
4396
- readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>, v.DescriptionAction<"bank_verification_required" | "source_account_required" | undefined, "Present on every read of the Intent (GET, list, creation answers and signed-instruction answers) while it is `requires_action` and only a person can release it; absent when a credential may release it, and absent once the Intent is no longer `requires_action`. The same two words `409 interaction_required` gives as `reason` when a credential tries `POST /intents/{intent_id}/approve`. `bank_verification_required`: the transfer leaves its holder's own accounts and AndCo asks the person to authorize it at `authorization_url` with their web AndPass and an SMS code; the Intent becomes `processing.confirmed` only when AndCo accepts it. A transfer created with `receiver: null` reads this way until the person completes it, because what she writes there always leaves her accounts. `source_account_required`: the person still picks the account the money leaves from.">]>;
4546
+ readonly interaction_reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["source_account_required"], undefined>, undefined>, v.DescriptionAction<"source_account_required" | undefined, "Present on every read of the Intent while it is `requires_action` and only a person can complete it; absent once the Intent is no longer `requires_action`. `source_account_required`: the person still picks the account the money leaves from. A step that the bank asks after the approval, for example a verification with the web AndPass and an SMS code, belongs to the Transfer and is not an Intent reason.">]>;
4397
4547
  readonly expires_at: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The deadline to approve and execute the Intent. `null`: the Intent never expires.">]>;
4398
4548
  readonly expires_in_seconds: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, v.DescriptionAction<number | null, "Remaining actionable lifetime at server_time; zero for finite terminal Intents, `null` when the Intent never expires.">]>;
4399
4549
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
@@ -4404,7 +4554,8 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4404
4554
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4405
4555
  }, undefined>, v.DescriptionAction<{
4406
4556
  type: "transfer";
4407
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
4557
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
4558
+ transfer_id: string | null;
4408
4559
  signed: boolean;
4409
4560
  sender: {
4410
4561
  type: "account_key";
@@ -4451,7 +4602,7 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4451
4602
  currency: "CLP";
4452
4603
  amount: "0";
4453
4604
  };
4454
- interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
4605
+ interaction_reason?: "source_account_required" | undefined;
4455
4606
  expires_at: string | null;
4456
4607
  expires_in_seconds: number | null;
4457
4608
  id: string;
@@ -4462,9 +4613,11 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4462
4613
  server_time: string;
4463
4614
  created_at: string;
4464
4615
  authorization_url: string;
4465
- }, "Authoritative Project-facing state of a transfer, in Core's vocabulary (ADR 0093). `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request, `amount.confirmed` the amount the person confirmed (null until then; it is what moves) and `settled` what it moved: reconciliation reads `settled`, which stays null until the money moved. `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4616
+ }, "Authoritative Project-facing state of a transfer request, in the transfer vocabulary of the API. The Intent is the request for a decision and ends at it: once it is `approved` it names its Transfer in `transfer_id`, and the money is followed on the Transfer. `sender` and `receiver` answer in the same matcher vocabulary as the request, and `comment` is the request's comment. `amount.value` is the proposal of the request and `amount.confirmed` the amount the person confirmed (null until then; it is what moves). `transfer.confirmed` and the events after it report the confirmed amount.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4466
4617
  readonly type: v.LiteralSchema<"account_opening", undefined>;
4467
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
4618
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
4619
+ readonly account_opening_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
4620
+ readonly account_opening_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
4468
4621
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
4469
4622
  readonly account: v.StrictObjectSchema<{
4470
4623
  readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
@@ -4489,7 +4642,9 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4489
4642
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4490
4643
  }, undefined>, v.DescriptionAction<{
4491
4644
  type: "account_opening";
4492
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
4645
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
4646
+ account_opening_status: "succeeded" | "failed" | "processing" | null;
4647
+ account_opening_status_detail: string | null;
4493
4648
  signed: boolean;
4494
4649
  account: {
4495
4650
  accountKey: string;
@@ -4511,9 +4666,11 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4511
4666
  server_time: string;
4512
4667
  created_at: string;
4513
4668
  authorization_url: string;
4514
- }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until the core assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4669
+ }, "Authoritative Project-facing state of an account opening. It carries no amount and no fee: an opening moves no money. Opening is asynchronous, so `account.bank_account_id` is absent until AndCo assigns the Número de Cuenta, which arrives on the account's own event stream rather than in this response.">]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
4515
4670
  readonly type: v.LiteralSchema<"account_closure", undefined>;
4516
- readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `processing`, `succeeded`, `failed`, `cancelled`, `rejected` or `expired`, and it is what tells whether the Intent can still change: `requires_action` and `processing` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that; an exhaustive `switch` over the enum below stops being exhaustive the first time a detail is added.\n\nWhere an Intent stands. `failed` says why, and whether money moved. A transfer that leaves its holder's own accounts (to another bank or to another AndCo customer) is `requires_action` from creation for as long as a person still owes the bank a proof, and every read of it carries `interaction_reason: bank_verification_required`; pressing Confirm, typing the web AndPass or typing the SMS code does not change its status. It becomes `processing.confirmed`, and `transfer.confirmed` is published once, when AndCo accepts the transfer; from then on nobody has to do anything and the outcome arrives as `succeeded` or `failed.bank_rejected`. A challenge the person abandons, lets run out or exhausts with wrong answers leaves the Intent `requires_action` (the person confirms again and gets a new code) until its own expiry, `expired`. A transfer between two accounts of the same holder has no challenge: it is `processing.confirmed` from its release, while the server asks the bank again under the same key. In both, `processing.confirmed` means that AndCo holds the command and nobody has to do anything. `processing.settling`, `processing.reversing` and `processing.reconciling` are not emitted. While the bank has been asked and its answer is not yet known (normally one request) the Intent still reads `requires_action`, does not read `expired` even if its deadline passes, and `cancel` and `reject` answer `409 invalid_intent_state`. Transfers: `failed.fraud_rejected` (the bank's fraud engine refused it before accepting, straight from `requires_action`), `failed.bank_refused` (the bank or its ledger refused the request, before accepting it when the transfer leaves its holder; for a transfer between own accounts, for example, the destination is not an active account of the same holder), `failed.bank_rejected` (the bank accepted it and the receiving bank, or the ledger, rejected it; the debit is undone by the bank), `failed.bank_review_required` (a transfer between own accounts AndCo stopped half way or gave no usable answer for a day: money may have left the source account without reaching the destination, the bank must review it, and it is never retried under a new Intent) and `failed.own_account_transfer_not_implemented` (the bank does not serve transfers between own accounts). A signed Transfer that leaves its holder (`POST /transfers`, ADR 0092) is never confirmed by a person: it also fails with `failed.bank_challenge_required` (the bank's fraud engine asked for a challenge nobody answers for a signature; send the same transfer as an Intent a person confirms) or with the core's refusal of its signature, in the words the upload uses: `failed.unknown_key` (the core holds no such key), `failed.revoked_key`, `failed.invalid_signature`, `failed.expired_signed_instruction` (its `exp` passed before the core executed it) and `failed.sender_mismatch`. A signed Transfer on either rail also fails, before anything is sent, when a key that signed it is no longer usable as it executes, even if it was at upload: `failed.revoked_key`, `failed.expired_key`, or `failed.unknown_key` (no Project of the holder has it any more, or, for one that leaves its holder, the core no longer holds it). In `failed.fraud_rejected`, `failed.bank_refused`, `failed.own_account_transfer_not_implemented`, `failed.bank_challenge_required`, `failed.expired_key` and the core's refusals of a signature no money moved; in `failed.bank_rejected` nothing stays moved. Account openings: `failed.bank_authorization_denied` (the bank does not let that person open accounts for that company), `failed.bank_holder_without_account`, `failed.bank_account_limit_reached`, `failed.bank_connection_unavailable` (no bank connection to a company), `failed.account_opening_not_implemented` (the bank does not serve openings), `failed.bank_core_unavailable`, `failed.bank_account_save_failed`, `failed.bank_account_quota_exceeded` (the holder already has as many accounts as allowed) and `failed.account_key_taken`. An opening that failed opened no account in any of them. Closures, which are not served today: `failed.bank_account_not_found` and `failed.bank_account_balance_not_zero`.\n\n`failed.<code>` names the reason. The list holds every code AndCo records, and it may grow: a `failed.` value outside this list is a failure like any other.">]>;
4671
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "approved", "rejected", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "cancelled.migration", "expired", "completed", "closed"], undefined>, v.DescriptionAction<"completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration", "`<base>[.<detail>]`. The base, what precedes the first dot, is one of `requires_action`, `approved`, `rejected`, `cancelled`, `expired`, and, for a deposit only, `completed` and `closed`. It tells whether the Intent can still change: `requires_action` can, every other base is final. Decide on the base, never on the whole value, so that a detail added later is not misread. In TypeScript, `INTENT_STATUS_BASE` and `IS_INTENT_TERMINAL_STATUS` from `@andco/protocol` do exactly that.\n\nAn Intent is the request for a decision, and it ends at that decision. `requires_action`: nobody has decided yet. `approved`: a person or a credential approved it; that is the end of the Intent, and the operation it asked for goes on elsewhere. `rejected`: an approver declined it. `cancelled`: the Project that created it withdrew it, or its Grant ended (`cancelled.grant_revoked`, `cancelled.grant_expired`), or a data migration of AndCo cancelled it (`cancelled.migration`, a transfer Intent that was already past its approval in a development or staging environment: no Transfer exists for it). `expired`: nobody decided before its deadline. A deposit has no approval: it ends `completed` when it collected its amount, or `closed`.\n\nThe outcome of an approved Intent is not here. An approved transfer Intent names its Transfer in `transfer_id`, and the Transfer carries `status` and `status_detail` (`processing`, `succeeded`, `failed`, `cancelled`). An approved account opening or closure carries its outcome beside `approved`, in `account_opening_status` or `account_closure_status` (`processing`, `succeeded` or `failed`) with the detail that says why.">]>;
4672
+ readonly account_closure_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.PicklistSchema<["processing", "succeeded", "failed"], undefined>, undefined>, v.DescriptionAction<"succeeded" | "failed" | "processing" | null, "The outcome of the account closure once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent." | "The outcome of the account opening once the Intent is `approved`: `processing` from the approval until AndCo answers, then `succeeded` or `failed`. Null while the Intent has no decision, and for ever when it ends rejected, cancelled or expired. The Intent stays `approved` in every case: a refusal does not revive it, and a new try is a new Intent.">]>;
4673
+ readonly account_closure_status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "Why the closure failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the closure failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_authorization_denied`, `bank_holder_without_account`, `bank_account_limit_reached`, `account_opening_not_implemented`, `bank_core_unavailable`, `bank_account_save_failed`, `bank_connection_unavailable`, `bank_account_quota_exceeded` and `account_key_taken`. The vocabulary is open: a word added later appears here as it is, so decide on the status." | "Why the opening failed, null when it did not: `bank_account_not_found` and `bank_account_balance_not_zero`. The vocabulary is open: a word added later appears here as it is, so decide on the status.">]>;
4517
4674
  readonly signed: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "Whether a Signed Instruction created this Intent rather than a plain request.">]>;
4518
4675
  readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
4519
4676
  type: v.LiteralSchema<"account_key", undefined>;
@@ -4552,7 +4709,9 @@ export declare const cancelIntent: import("@orpc/contract").ProcedureContractBui
4552
4709
  readonly authorization_url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
4553
4710
  }, undefined>, v.DescriptionAction<{
4554
4711
  type: "account_closure";
4555
- status: "succeeded" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
4712
+ status: "completed" | "approved" | "closed" | "cancelled" | "rejected" | "expired" | "requires_action" | "cancelled.grant_revoked" | "cancelled.grant_expired" | "cancelled.migration";
4713
+ account_closure_status: "succeeded" | "failed" | "processing" | null;
4714
+ account_closure_status_detail: string | null;
4556
4715
  signed: boolean;
4557
4716
  account: {
4558
4717
  type: "account_key";