@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
@@ -1,11 +1,9 @@
1
1
  import * as v from "valibot";
2
+ import { InvalidCursor } from "./accounts.js";
2
3
  import { InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, PayloadTooLarge, ServerError, TemporarilyUnavailable, UnsupportedMediaType, UnsupportedVersion } from "./common.js";
3
- import { AmountOutOfGrant, BankConnectionUnavailable, BankRefused, BankRejected, BankReviewRequired, ExpiredSignedInstruction, IdempotencyConflict, IdempotencyKeyNotAllowed, InsufficientFunds, IntentInteractionRequired, InvalidDestination, InvalidSignedInstruction, InvalidSource, NotImplemented, TransferSenderIdentityUnavailable } from "./intents.js";
4
- /**
5
- * The media type a signed transfer travels as: a JWS in the General JSON Serialization (RFC 7515
6
- * §7.2.1), the {@link SignedTransferEnvelopeSchema} itself.
7
- */
8
- export declare const SIGNED_TRANSFER_MEDIA_TYPE = "application/jose+json";
4
+ import { AmountOutOfGrant, ApprovalRequiredUseIntents, BankConnectionUnavailable, BankRefused, BankRejected, BankReviewRequired, ExpiredSignedInstruction, IdempotencyConflict, IdempotencyKeyNotAllowed, InsufficientFunds, IntentInteractionRequired, InvalidDestination, InvalidSignedInstruction, InvalidSource, NotImplemented, TransferSenderIdentityUnavailable } from "./intents.js";
5
+ import { SIGNED_TRANSFER_MEDIA_TYPE } from "./signatures.js";
6
+ export { SIGNED_TRANSFER_MEDIA_TYPE };
9
7
  declare const SenderMismatch_base: (abstract new (data: {}, message?: string, hint?: string) => {
10
8
  readonly error: "sender_mismatch";
11
9
  readonly hint?: string;
@@ -36,111 +34,131 @@ declare const SenderMismatch_base: (abstract new (data: {}, message?: string, hi
36
34
  /**
37
35
  * The signed `sender` is not the account it names: its `country` is `CL`, its `bank_code` AndCo's
38
36
  * (`0739`), its `account_type` the account's own and its `national_id` the RUT of the account's
39
- * holder, compared as normalized RUTs. Its `name` is never compared. The core runs the same check
40
- * when it executes; the API runs it first so that the mistake fails before anything is stored.
37
+ * holder, compared as normalized RUTs. Its `name` is never compared. The API runs this check
38
+ * before anything is stored, so the mistake fails early.
41
39
  */
42
40
  export declare class SenderMismatch extends /* @__PURE__ */ SenderMismatch_base {
43
41
  constructor(message?: string);
44
42
  }
43
+ /**
44
+ * Where a Transfer stands. `requires_action`: the person still owes the bank a step. `processing`: the
45
+ * bank holds the transfer and has not answered for good. `succeeded`, `failed` and `cancelled` are final.
46
+ * There is no `rejected`: a rejection ends an Intent, and a rejected Intent has no Transfer.
47
+ */
48
+ export declare const TransferStatus: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
49
+ /** Where a Transfer stands. */
50
+ export type TransferStatus = v.InferOutput<typeof TransferStatus>;
45
51
  /**
46
52
  * A Transfer: the movement of an amount from a Remitente (`sender`) to a Receptor (`receiver`), as
47
- * AndCo represents it (ADR 0093). One signature uploads one Transfer, named by its `jti`.
48
- *
49
- * `sender`, `receiver` and `comment` are what was signed, in Core's vocabulary and as they were
50
- * signed: what was signed never changes. `status` is where the Transfer stands, in the words an
51
- * Intent uses; `core_status` is the core's own word for its transfer, for the record only.
53
+ * AndCo represents it. It has one shape for every origin: a Project's Intent (`oauth`), a person in
54
+ * the AndCo web app (`platform`), or the issuer's own channels, for example its mobile app
55
+ * (`emisor`). A Transfer exists after its approval.
52
56
  *
53
57
  * @example
54
58
  * const transfer: Transfer = {
55
- * object: "transfer", id, jti, status: "succeeded", core_status: "confirmed", approved: true,
56
- * sender, receiver, comment: "Factura 42", created_at, expires_at,
59
+ * object: "transfer", id, status: "succeeded", status_detail: "confirmed", origin: "oauth",
60
+ * amount: 500000, currency: "CLP", sender, receiver, comment: "Factura 42",
61
+ * intent_id, jti: null, transaction_id: "88213", created_at,
57
62
  * };
58
63
  */
59
64
  export declare const Transfer: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
60
65
  readonly object: v.LiteralSchema<"transfer", undefined>;
61
66
  readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
62
- readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The `jti` of the Signed Instruction that uploaded it. Sending the same instruction again answers this same Transfer.">]>;
63
- readonly status: v.SchemaWithPipe<readonly [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.">]>, 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", "Where the Transfer stands, in the words an Intent uses (`IntentStatus`): decide on the base, never on the whole value. A signed transfer that is not approved is `requires_action` until a Grant with `bank_transfer` `approve` or a person approves it. A transfer between two accounts of the same holder is `processing.confirmed` from its release until AndCo answers for good, then `succeeded` or `failed.<code>`.">]>;
64
- readonly core_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | null, "The core bancario's own word for its transfer (`requested`, `confirmed`, `rejected_insufficient_funds`, …), for the record. Null while AndCo has not read one. Never branch on it: a word the core adds later appears here as it is, and `status` is what to decide on.">]>;
65
- readonly approved: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "The signed `approved`: whether the instruction ordered the transfer sent as soon as it was uploaded.">]>;
66
- readonly sender: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
67
- country: v.LiteralSchema<"CL", undefined>;
68
- 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`.">]>;
69
- 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).">]>;
70
- account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
71
- name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
72
- national_kind_id: v.LiteralSchema<"RUT", undefined>;
73
- national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
74
- }, undefined>], undefined>, v.DescriptionAction<{
75
- country: "CL";
67
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
68
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
69
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
70
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
71
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
72
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
73
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
74
+ 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`.">]>;
75
+ 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).">]>;
76
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
77
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
78
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
79
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
80
+ }, undefined>, v.DescriptionAction<{
81
+ country: string;
76
82
  bank_code: string;
77
83
  account_type: "10" | "20" | "40";
78
84
  account_number: string;
79
- name: string;
80
- national_kind_id: "RUT";
81
- national_id: string;
82
- }, "The Remitente, as Core's `sender`: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. Core checks the country, the bank (`0739`), the account's own type and the holder's RUT; it stores `name` as it arrives.">]>;
83
- readonly receiver: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
84
- readonly amount: 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`.">]>;
85
- readonly currency: v.LiteralSchema<"CLP", undefined>;
86
- readonly email: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Where Core notifies the Receptor.">]>;
87
- readonly country: v.LiteralSchema<"CL", undefined>;
88
- 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`.">]>;
89
- 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).">]>;
85
+ name: string | null;
86
+ national_kind_id: string | null;
87
+ national_id: string | null;
88
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
89
+ country: string;
90
+ bank_code: string;
91
+ account_type: "10" | "20" | "40";
92
+ account_number: string;
93
+ name: string | null;
94
+ national_kind_id: string | null;
95
+ national_id: string | null;
96
+ }, "The Remitente: the account the money leaves and its holder.">]>;
97
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
98
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
99
+ 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`.">]>;
100
+ 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).">]>;
90
101
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
91
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
92
- readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
93
- readonly national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
94
- }, undefined>], undefined>, v.DescriptionAction<{
95
- amount: number;
96
- currency: "CLP";
97
- email?: string | undefined;
98
- country: "CL";
102
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
103
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
104
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
105
+ }, undefined>, v.DescriptionAction<{
106
+ country: string;
99
107
  bank_code: string;
100
108
  account_type: "10" | "20" | "40";
101
109
  account_number: string;
102
- name: string;
103
- national_kind_id: "RUT";
104
- national_id: string;
105
- }, "The Receptor, as Core's `receiver`: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared.">]>;
106
- readonly comment: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | undefined, "The signed comment, when there is one.">]>;
107
- readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer was uploaded.">]>;
108
- readonly expires_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's deadline: the signature's `exp`. A transfer still waiting for its approval at this instant expires.">]>;
110
+ name: string | null;
111
+ national_kind_id: string | null;
112
+ national_id: string | null;
113
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
114
+ country: string;
115
+ bank_code: string;
116
+ account_type: "10" | "20" | "40";
117
+ account_number: string;
118
+ name: string | null;
119
+ national_kind_id: string | null;
120
+ national_id: string | null;
121
+ }, "The Receptor: the account the money lands on and its holder.">]>;
122
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
123
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
124
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
125
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
126
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
109
127
  }, undefined>, v.DescriptionAction<{
110
128
  object: "transfer";
111
129
  id: string;
112
- jti: string;
113
- 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";
114
- core_status: string | null;
115
- approved: boolean;
130
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
131
+ status_detail: string | null;
132
+ origin: "oauth" | "platform" | "emisor";
133
+ amount: number;
134
+ currency: "CLP";
116
135
  sender: {
117
- country: "CL";
136
+ country: string;
118
137
  bank_code: string;
119
138
  account_type: "10" | "20" | "40";
120
139
  account_number: string;
121
- name: string;
122
- national_kind_id: "RUT";
123
- national_id: string;
140
+ name: string | null;
141
+ national_kind_id: string | null;
142
+ national_id: string | null;
124
143
  };
125
144
  receiver: {
126
- amount: number;
127
- currency: "CLP";
128
- email?: string | undefined;
129
- country: "CL";
145
+ country: string;
130
146
  bank_code: string;
131
147
  account_type: "10" | "20" | "40";
132
148
  account_number: string;
133
- name: string;
134
- national_kind_id: "RUT";
135
- national_id: string;
149
+ name: string | null;
150
+ national_kind_id: string | null;
151
+ national_id: string | null;
136
152
  };
137
- comment?: string | undefined;
153
+ comment: string | null;
154
+ intent_id: string | null;
155
+ jti: string | null;
156
+ transaction_id: string | null;
138
157
  created_at: string;
139
- expires_at: string;
140
- }, "A Transfer uploaded as a Signed Instruction (ADR 0093), in Core's vocabulary: `sender`, `receiver` (with the amount, an integer in the minor unit of the currency) and `comment` exactly as signed. `status` is where it stands; `core_status` the core's own word, for the record.">]>;
141
- /** A Transfer uploaded as a Signed Instruction. */
158
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>;
159
+ /** A Transfer. */
142
160
  export type Transfer = v.InferOutput<typeof Transfer>;
143
- /** Uploads a signed transfer: one General JSON JWS (`application/jose+json`), one Transfer. */
161
+ /** Submits a signed transfer: one General JSON JWS (`application/jose+json`), one Transfer. */
144
162
  export declare const createTransfer: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
145
163
  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`).">]>;
146
164
  readonly signatures: v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
@@ -152,7 +170,7 @@ export declare const createTransfer: import("@orpc/contract").ProcedureContractB
152
170
  }[], 1, undefined>, v.DescriptionAction<{
153
171
  protected: string;
154
172
  signature: string;
155
- }[], "At least one signature over the same payload; the core verifies every one.">]>;
173
+ }[], "At least one signature over the same payload; every one is verified.">]>;
156
174
  }, undefined>, v.DescriptionAction<{
157
175
  payload: string;
158
176
  signatures: {
@@ -162,173 +180,199 @@ export declare const createTransfer: import("@orpc/contract").ProcedureContractB
162
180
  }, "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`.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
163
181
  readonly object: v.LiteralSchema<"transfer", undefined>;
164
182
  readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
165
- readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The `jti` of the Signed Instruction that uploaded it. Sending the same instruction again answers this same Transfer.">]>;
166
- readonly status: v.SchemaWithPipe<readonly [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.">]>, 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", "Where the Transfer stands, in the words an Intent uses (`IntentStatus`): decide on the base, never on the whole value. A signed transfer that is not approved is `requires_action` until a Grant with `bank_transfer` `approve` or a person approves it. A transfer between two accounts of the same holder is `processing.confirmed` from its release until AndCo answers for good, then `succeeded` or `failed.<code>`.">]>;
167
- readonly core_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | null, "The core bancario's own word for its transfer (`requested`, `confirmed`, `rejected_insufficient_funds`, …), for the record. Null while AndCo has not read one. Never branch on it: a word the core adds later appears here as it is, and `status` is what to decide on.">]>;
168
- readonly approved: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "The signed `approved`: whether the instruction ordered the transfer sent as soon as it was uploaded.">]>;
169
- readonly sender: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
170
- country: v.LiteralSchema<"CL", undefined>;
171
- 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`.">]>;
172
- 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).">]>;
173
- account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
174
- name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
175
- national_kind_id: v.LiteralSchema<"RUT", undefined>;
176
- national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
177
- }, undefined>], undefined>, v.DescriptionAction<{
178
- country: "CL";
183
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
184
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
185
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
186
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
187
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
188
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
189
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
190
+ 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`.">]>;
191
+ 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).">]>;
192
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
193
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
194
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
195
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
196
+ }, undefined>, v.DescriptionAction<{
197
+ country: string;
179
198
  bank_code: string;
180
199
  account_type: "10" | "20" | "40";
181
200
  account_number: string;
182
- name: string;
183
- national_kind_id: "RUT";
184
- national_id: string;
185
- }, "The Remitente, as Core's `sender`: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. Core checks the country, the bank (`0739`), the account's own type and the holder's RUT; it stores `name` as it arrives.">]>;
186
- readonly receiver: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
187
- readonly amount: 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`.">]>;
188
- readonly currency: v.LiteralSchema<"CLP", undefined>;
189
- readonly email: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Where Core notifies the Receptor.">]>;
190
- readonly country: v.LiteralSchema<"CL", undefined>;
191
- 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`.">]>;
192
- 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).">]>;
201
+ name: string | null;
202
+ national_kind_id: string | null;
203
+ national_id: string | null;
204
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
205
+ country: string;
206
+ bank_code: string;
207
+ account_type: "10" | "20" | "40";
208
+ account_number: string;
209
+ name: string | null;
210
+ national_kind_id: string | null;
211
+ national_id: string | null;
212
+ }, "The Remitente: the account the money leaves and its holder.">]>;
213
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
214
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
215
+ 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`.">]>;
216
+ 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).">]>;
193
217
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
194
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
195
- readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
196
- readonly national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
197
- }, undefined>], undefined>, v.DescriptionAction<{
198
- amount: number;
199
- currency: "CLP";
200
- email?: string | undefined;
201
- country: "CL";
218
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
219
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
220
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
221
+ }, undefined>, v.DescriptionAction<{
222
+ country: string;
202
223
  bank_code: string;
203
224
  account_type: "10" | "20" | "40";
204
225
  account_number: string;
205
- name: string;
206
- national_kind_id: "RUT";
207
- national_id: string;
208
- }, "The Receptor, as Core's `receiver`: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared.">]>;
209
- readonly comment: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | undefined, "The signed comment, when there is one.">]>;
210
- readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer was uploaded.">]>;
211
- readonly expires_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's deadline: the signature's `exp`. A transfer still waiting for its approval at this instant expires.">]>;
226
+ name: string | null;
227
+ national_kind_id: string | null;
228
+ national_id: string | null;
229
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
230
+ country: string;
231
+ bank_code: string;
232
+ account_type: "10" | "20" | "40";
233
+ account_number: string;
234
+ name: string | null;
235
+ national_kind_id: string | null;
236
+ national_id: string | null;
237
+ }, "The Receptor: the account the money lands on and its holder.">]>;
238
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
239
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
240
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
241
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
242
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
212
243
  }, undefined>, v.DescriptionAction<{
213
244
  object: "transfer";
214
245
  id: string;
215
- jti: string;
216
- 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";
217
- core_status: string | null;
218
- approved: boolean;
246
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
247
+ status_detail: string | null;
248
+ origin: "oauth" | "platform" | "emisor";
249
+ amount: number;
250
+ currency: "CLP";
219
251
  sender: {
220
- country: "CL";
252
+ country: string;
221
253
  bank_code: string;
222
254
  account_type: "10" | "20" | "40";
223
255
  account_number: string;
224
- name: string;
225
- national_kind_id: "RUT";
226
- national_id: string;
256
+ name: string | null;
257
+ national_kind_id: string | null;
258
+ national_id: string | null;
227
259
  };
228
260
  receiver: {
229
- amount: number;
230
- currency: "CLP";
231
- email?: string | undefined;
232
- country: "CL";
261
+ country: string;
233
262
  bank_code: string;
234
263
  account_type: "10" | "20" | "40";
235
264
  account_number: string;
236
- name: string;
237
- national_kind_id: "RUT";
238
- national_id: string;
265
+ name: string | null;
266
+ national_kind_id: string | null;
267
+ national_id: string | null;
239
268
  };
240
- comment?: string | undefined;
269
+ comment: string | null;
270
+ intent_id: string | null;
271
+ jti: string | null;
272
+ transaction_id: string | null;
241
273
  created_at: string;
242
- expires_at: string;
243
- }, "A Transfer uploaded as a Signed Instruction (ADR 0093), in Core's vocabulary: `sender`, `receiver` (with the amount, an integer in the minor unit of the currency) and `comment` exactly as signed. `status` is where it stands; `core_status` the core's own word, for the record.">]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof SenderMismatch, typeof TransferSenderIdentityUnavailable, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof BankConnectionUnavailable, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
244
- /** Reads one Transfer uploaded under the same exact OAuth Grant. */
274
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof ApprovalRequiredUseIntents, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof SenderMismatch, typeof TransferSenderIdentityUnavailable, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof BankConnectionUnavailable, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
275
+ /** Reads one Transfer the Grant may read. */
245
276
  export declare const getTransfer: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
246
277
  readonly transfer_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
247
278
  }, undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
248
279
  readonly object: v.LiteralSchema<"transfer", undefined>;
249
280
  readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
250
- readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The `jti` of the Signed Instruction that uploaded it. Sending the same instruction again answers this same Transfer.">]>;
251
- readonly status: v.SchemaWithPipe<readonly [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.">]>, 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", "Where the Transfer stands, in the words an Intent uses (`IntentStatus`): decide on the base, never on the whole value. A signed transfer that is not approved is `requires_action` until a Grant with `bank_transfer` `approve` or a person approves it. A transfer between two accounts of the same holder is `processing.confirmed` from its release until AndCo answers for good, then `succeeded` or `failed.<code>`.">]>;
252
- readonly core_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | null, "The core bancario's own word for its transfer (`requested`, `confirmed`, `rejected_insufficient_funds`, …), for the record. Null while AndCo has not read one. Never branch on it: a word the core adds later appears here as it is, and `status` is what to decide on.">]>;
253
- readonly approved: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "The signed `approved`: whether the instruction ordered the transfer sent as soon as it was uploaded.">]>;
254
- readonly sender: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
255
- country: v.LiteralSchema<"CL", undefined>;
256
- 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`.">]>;
257
- 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).">]>;
258
- account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
259
- name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
260
- national_kind_id: v.LiteralSchema<"RUT", undefined>;
261
- national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
262
- }, undefined>], undefined>, v.DescriptionAction<{
263
- country: "CL";
281
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
282
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
283
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
284
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
285
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
286
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
287
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
288
+ 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`.">]>;
289
+ 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).">]>;
290
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
291
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
292
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
293
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
294
+ }, undefined>, v.DescriptionAction<{
295
+ country: string;
264
296
  bank_code: string;
265
297
  account_type: "10" | "20" | "40";
266
298
  account_number: string;
267
- name: string;
268
- national_kind_id: "RUT";
269
- national_id: string;
270
- }, "The Remitente, as Core's `sender`: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. Core checks the country, the bank (`0739`), the account's own type and the holder's RUT; it stores `name` as it arrives.">]>;
271
- readonly receiver: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
272
- readonly amount: 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`.">]>;
273
- readonly currency: v.LiteralSchema<"CLP", undefined>;
274
- readonly email: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Where Core notifies the Receptor.">]>;
275
- readonly country: v.LiteralSchema<"CL", undefined>;
276
- 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`.">]>;
277
- 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).">]>;
299
+ name: string | null;
300
+ national_kind_id: string | null;
301
+ national_id: string | null;
302
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
303
+ country: string;
304
+ bank_code: string;
305
+ account_type: "10" | "20" | "40";
306
+ account_number: string;
307
+ name: string | null;
308
+ national_kind_id: string | null;
309
+ national_id: string | null;
310
+ }, "The Remitente: the account the money leaves and its holder.">]>;
311
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
312
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
313
+ 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`.">]>;
314
+ 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).">]>;
278
315
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
279
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
280
- readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
281
- readonly national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
282
- }, undefined>], undefined>, v.DescriptionAction<{
283
- amount: number;
284
- currency: "CLP";
285
- email?: string | undefined;
286
- country: "CL";
316
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
317
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
318
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
319
+ }, undefined>, v.DescriptionAction<{
320
+ country: string;
287
321
  bank_code: string;
288
322
  account_type: "10" | "20" | "40";
289
323
  account_number: string;
290
- name: string;
291
- national_kind_id: "RUT";
292
- national_id: string;
293
- }, "The Receptor, as Core's `receiver`: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared.">]>;
294
- readonly comment: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | undefined, "The signed comment, when there is one.">]>;
295
- readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer was uploaded.">]>;
296
- readonly expires_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's deadline: the signature's `exp`. A transfer still waiting for its approval at this instant expires.">]>;
324
+ name: string | null;
325
+ national_kind_id: string | null;
326
+ national_id: string | null;
327
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
328
+ country: string;
329
+ bank_code: string;
330
+ account_type: "10" | "20" | "40";
331
+ account_number: string;
332
+ name: string | null;
333
+ national_kind_id: string | null;
334
+ national_id: string | null;
335
+ }, "The Receptor: the account the money lands on and its holder.">]>;
336
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
337
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
338
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
339
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
340
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
297
341
  }, undefined>, v.DescriptionAction<{
298
342
  object: "transfer";
299
343
  id: string;
300
- jti: string;
301
- 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";
302
- core_status: string | null;
303
- approved: boolean;
344
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
345
+ status_detail: string | null;
346
+ origin: "oauth" | "platform" | "emisor";
347
+ amount: number;
348
+ currency: "CLP";
304
349
  sender: {
305
- country: "CL";
350
+ country: string;
306
351
  bank_code: string;
307
352
  account_type: "10" | "20" | "40";
308
353
  account_number: string;
309
- name: string;
310
- national_kind_id: "RUT";
311
- national_id: string;
354
+ name: string | null;
355
+ national_kind_id: string | null;
356
+ national_id: string | null;
312
357
  };
313
358
  receiver: {
314
- amount: number;
315
- currency: "CLP";
316
- email?: string | undefined;
317
- country: "CL";
359
+ country: string;
318
360
  bank_code: string;
319
361
  account_type: "10" | "20" | "40";
320
362
  account_number: string;
321
- name: string;
322
- national_kind_id: "RUT";
323
- national_id: string;
363
+ name: string | null;
364
+ national_kind_id: string | null;
365
+ national_id: string | null;
324
366
  };
325
- comment?: string | undefined;
367
+ comment: string | null;
368
+ intent_id: string | null;
369
+ jti: string | null;
370
+ transaction_id: string | null;
326
371
  created_at: string;
327
- expires_at: string;
328
- }, "A Transfer uploaded as a Signed Instruction (ADR 0093), in Core's vocabulary: `sender`, `receiver` (with the amount, an integer in the minor unit of the currency) and `comment` exactly as signed. `status` is where it stands; `core_status` the core's own word, for the record.">]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidIdentifier, typeof InvalidToken, typeof InvalidOrigin, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof TemporarilyUnavailable]>>;
372
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidIdentifier, typeof InvalidToken, typeof InvalidOrigin, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof TemporarilyUnavailable]>>;
329
373
  /**
330
- * A page of Transfers. Today the only way to get one is `GET /transfers?jti=`, so it holds zero or one
331
- * edge; a full listing can come later in the same shape.
374
+ * A page of Transfers found by `jti`: zero or one edge, and no cursor on it. The list of an account
375
+ * has its own page, {@link TransferListPage}.
332
376
  */
333
377
  export declare const TransferPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
334
378
  readonly edges: v.ArraySchema<v.StrictObjectSchema<{
@@ -336,85 +380,98 @@ export declare const TransferPage: v.SchemaWithPipe<readonly [v.StrictObjectSche
336
380
  readonly node: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
337
381
  readonly object: v.LiteralSchema<"transfer", undefined>;
338
382
  readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
339
- readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The `jti` of the Signed Instruction that uploaded it. Sending the same instruction again answers this same Transfer.">]>;
340
- readonly status: v.SchemaWithPipe<readonly [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.">]>, 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", "Where the Transfer stands, in the words an Intent uses (`IntentStatus`): decide on the base, never on the whole value. A signed transfer that is not approved is `requires_action` until a Grant with `bank_transfer` `approve` or a person approves it. A transfer between two accounts of the same holder is `processing.confirmed` from its release until AndCo answers for good, then `succeeded` or `failed.<code>`.">]>;
341
- readonly core_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | null, "The core bancario's own word for its transfer (`requested`, `confirmed`, `rejected_insufficient_funds`, …), for the record. Null while AndCo has not read one. Never branch on it: a word the core adds later appears here as it is, and `status` is what to decide on.">]>;
342
- readonly approved: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "The signed `approved`: whether the instruction ordered the transfer sent as soon as it was uploaded.">]>;
343
- readonly sender: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
344
- country: v.LiteralSchema<"CL", undefined>;
345
- 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`.">]>;
346
- 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).">]>;
347
- account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
348
- name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
349
- national_kind_id: v.LiteralSchema<"RUT", undefined>;
350
- national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
351
- }, undefined>], undefined>, v.DescriptionAction<{
352
- country: "CL";
353
- bank_code: string;
354
- account_type: "10" | "20" | "40";
355
- account_number: string;
356
- name: string;
357
- national_kind_id: "RUT";
358
- national_id: string;
359
- }, "The Remitente, as Core's `sender`: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. Core checks the country, the bank (`0739`), the account's own type and the holder's RUT; it stores `name` as it arrives.">]>;
360
- readonly receiver: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
361
- readonly amount: 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`.">]>;
362
- readonly currency: v.LiteralSchema<"CLP", undefined>;
363
- readonly email: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Where Core notifies the Receptor.">]>;
364
- readonly country: v.LiteralSchema<"CL", undefined>;
365
- 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`.">]>;
366
- 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).">]>;
383
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
384
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
385
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
386
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
387
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
388
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
389
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
390
+ 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`.">]>;
391
+ 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).">]>;
392
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
393
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
394
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
395
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
396
+ }, undefined>, v.DescriptionAction<{
397
+ country: string;
398
+ bank_code: string;
399
+ account_type: "10" | "20" | "40";
400
+ account_number: string;
401
+ name: string | null;
402
+ national_kind_id: string | null;
403
+ national_id: string | null;
404
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
405
+ country: string;
406
+ bank_code: string;
407
+ account_type: "10" | "20" | "40";
408
+ account_number: string;
409
+ name: string | null;
410
+ national_kind_id: string | null;
411
+ national_id: string | null;
412
+ }, "The Remitente: the account the money leaves and its holder.">]>;
413
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
414
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
415
+ 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`.">]>;
416
+ 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).">]>;
367
417
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
368
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
369
- readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
370
- readonly national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
371
- }, undefined>], undefined>, v.DescriptionAction<{
372
- amount: number;
373
- currency: "CLP";
374
- email?: string | undefined;
375
- country: "CL";
376
- bank_code: string;
377
- account_type: "10" | "20" | "40";
378
- account_number: string;
379
- name: string;
380
- national_kind_id: "RUT";
381
- national_id: string;
382
- }, "The Receptor, as Core's `receiver`: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared.">]>;
383
- readonly comment: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | undefined, "The signed comment, when there is one.">]>;
384
- readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer was uploaded.">]>;
385
- readonly expires_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's deadline: the signature's `exp`. A transfer still waiting for its approval at this instant expires.">]>;
418
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
419
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
420
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
421
+ }, undefined>, v.DescriptionAction<{
422
+ country: string;
423
+ bank_code: string;
424
+ account_type: "10" | "20" | "40";
425
+ account_number: string;
426
+ name: string | null;
427
+ national_kind_id: string | null;
428
+ national_id: string | null;
429
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
430
+ country: string;
431
+ bank_code: string;
432
+ account_type: "10" | "20" | "40";
433
+ account_number: string;
434
+ name: string | null;
435
+ national_kind_id: string | null;
436
+ national_id: string | null;
437
+ }, "The Receptor: the account the money lands on and its holder.">]>;
438
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
439
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
440
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
441
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
442
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
386
443
  }, undefined>, v.DescriptionAction<{
387
444
  object: "transfer";
388
445
  id: string;
389
- jti: string;
390
- 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";
391
- core_status: string | null;
392
- approved: boolean;
446
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
447
+ status_detail: string | null;
448
+ origin: "oauth" | "platform" | "emisor";
449
+ amount: number;
450
+ currency: "CLP";
393
451
  sender: {
394
- country: "CL";
452
+ country: string;
395
453
  bank_code: string;
396
454
  account_type: "10" | "20" | "40";
397
455
  account_number: string;
398
- name: string;
399
- national_kind_id: "RUT";
400
- national_id: string;
456
+ name: string | null;
457
+ national_kind_id: string | null;
458
+ national_id: string | null;
401
459
  };
402
460
  receiver: {
403
- amount: number;
404
- currency: "CLP";
405
- email?: string | undefined;
406
- country: "CL";
461
+ country: string;
407
462
  bank_code: string;
408
463
  account_type: "10" | "20" | "40";
409
464
  account_number: string;
410
- name: string;
411
- national_kind_id: "RUT";
412
- national_id: string;
465
+ name: string | null;
466
+ national_kind_id: string | null;
467
+ national_id: string | null;
413
468
  };
414
- comment?: string | undefined;
469
+ comment: string | null;
470
+ intent_id: string | null;
471
+ jti: string | null;
472
+ transaction_id: string | null;
415
473
  created_at: string;
416
- expires_at: string;
417
- }, "A Transfer uploaded as a Signed Instruction (ADR 0093), in Core's vocabulary: `sender`, `receiver` (with the amount, an integer in the minor unit of the currency) and `comment` exactly as signed. `status` is where it stands; `core_status` the core's own word, for the record.">]>;
474
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>;
418
475
  }, undefined>, undefined>;
419
476
  readonly pageInfo: v.StrictObjectSchema<{
420
477
  readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -428,34 +485,34 @@ export declare const TransferPage: v.SchemaWithPipe<readonly [v.StrictObjectSche
428
485
  node: {
429
486
  object: "transfer";
430
487
  id: string;
431
- jti: string;
432
- 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";
433
- core_status: string | null;
434
- approved: boolean;
488
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
489
+ status_detail: string | null;
490
+ origin: "oauth" | "platform" | "emisor";
491
+ amount: number;
492
+ currency: "CLP";
435
493
  sender: {
436
- country: "CL";
494
+ country: string;
437
495
  bank_code: string;
438
496
  account_type: "10" | "20" | "40";
439
497
  account_number: string;
440
- name: string;
441
- national_kind_id: "RUT";
442
- national_id: string;
498
+ name: string | null;
499
+ national_kind_id: string | null;
500
+ national_id: string | null;
443
501
  };
444
502
  receiver: {
445
- amount: number;
446
- currency: "CLP";
447
- email?: string | undefined;
448
- country: "CL";
503
+ country: string;
449
504
  bank_code: string;
450
505
  account_type: "10" | "20" | "40";
451
506
  account_number: string;
452
- name: string;
453
- national_kind_id: "RUT";
454
- national_id: string;
507
+ name: string | null;
508
+ national_kind_id: string | null;
509
+ national_id: string | null;
455
510
  };
456
- comment?: string | undefined;
511
+ comment: string | null;
512
+ intent_id: string | null;
513
+ jti: string | null;
514
+ transaction_id: string | null;
457
515
  created_at: string;
458
- expires_at: string;
459
516
  };
460
517
  }[];
461
518
  pageInfo: {
@@ -465,99 +522,112 @@ export declare const TransferPage: v.SchemaWithPipe<readonly [v.StrictObjectSche
465
522
  hasNextPage: boolean;
466
523
  };
467
524
  }, string>]>;
468
- /** A page of Transfers. */
525
+ /** A page of Transfers found by `jti`. */
469
526
  export type TransferPage = v.InferOutput<typeof TransferPage>;
470
527
  /**
471
- * Finds the Transfer that a `jti` names, under the same exact OAuth Grant: for a client that lost the
472
- * answer to `POST /transfers` and whose `exp` has passed.
528
+ * Finds the Transfer that a `jti` names: for a client that lost the answer to `POST /transfers` and
529
+ * whose `exp` has passed.
473
530
  */
474
531
  export declare const listTransfers: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
475
- readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The `jti` of the Signed Instruction that uploaded the Transfer.">]>;
532
+ readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, v.DescriptionAction<string, "The `jti` of the signed transfer that submitted the Transfer, a UUID in lowercase.">]>;
476
533
  }, undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
477
534
  readonly edges: v.ArraySchema<v.StrictObjectSchema<{
478
535
  readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
479
536
  readonly node: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
480
537
  readonly object: v.LiteralSchema<"transfer", undefined>;
481
538
  readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
482
- readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The `jti` of the Signed Instruction that uploaded it. Sending the same instruction again answers this same Transfer.">]>;
483
- readonly status: v.SchemaWithPipe<readonly [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.">]>, 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", "Where the Transfer stands, in the words an Intent uses (`IntentStatus`): decide on the base, never on the whole value. A signed transfer that is not approved is `requires_action` until a Grant with `bank_transfer` `approve` or a person approves it. A transfer between two accounts of the same holder is `processing.confirmed` from its release until AndCo answers for good, then `succeeded` or `failed.<code>`.">]>;
484
- readonly core_status: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | null, "The core bancario's own word for its transfer (`requested`, `confirmed`, `rejected_insufficient_funds`, …), for the record. Null while AndCo has not read one. Never branch on it: a word the core adds later appears here as it is, and `status` is what to decide on.">]>;
485
- readonly approved: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "The signed `approved`: whether the instruction ordered the transfer sent as soon as it was uploaded.">]>;
486
- readonly sender: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
487
- country: v.LiteralSchema<"CL", undefined>;
488
- 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`.">]>;
489
- 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).">]>;
490
- account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
491
- name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
492
- national_kind_id: v.LiteralSchema<"RUT", undefined>;
493
- national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
494
- }, undefined>], undefined>, v.DescriptionAction<{
495
- country: "CL";
496
- bank_code: string;
497
- account_type: "10" | "20" | "40";
498
- account_number: string;
499
- name: string;
500
- national_kind_id: "RUT";
501
- national_id: string;
502
- }, "The Remitente, as Core's `sender`: the account the money leaves and its holder. `country` and `national_kind_id` are always declared. Core checks the country, the bank (`0739`), the account's own type and the holder's RUT; it stores `name` as it arrives.">]>;
503
- readonly receiver: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
504
- readonly amount: 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`.">]>;
505
- readonly currency: v.LiteralSchema<"CLP", undefined>;
506
- readonly email: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "Where Core notifies the Receptor.">]>;
507
- readonly country: v.LiteralSchema<"CL", undefined>;
508
- 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`.">]>;
509
- 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).">]>;
539
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
540
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
541
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
542
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
543
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
544
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
545
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
546
+ 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`.">]>;
547
+ 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).">]>;
548
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
549
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
550
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
551
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
552
+ }, undefined>, v.DescriptionAction<{
553
+ country: string;
554
+ bank_code: string;
555
+ account_type: "10" | "20" | "40";
556
+ account_number: string;
557
+ name: string | null;
558
+ national_kind_id: string | null;
559
+ national_id: string | null;
560
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
561
+ country: string;
562
+ bank_code: string;
563
+ account_type: "10" | "20" | "40";
564
+ account_number: string;
565
+ name: string | null;
566
+ national_kind_id: string | null;
567
+ national_id: string | null;
568
+ }, "The Remitente: the account the money leaves and its holder.">]>;
569
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
570
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
571
+ 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`.">]>;
572
+ 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).">]>;
510
573
  readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
511
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The holder's name. Core stores it as it arrives and never compares it.">]>;
512
- readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
513
- readonly national_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The holder's RUT. Core compares it as a normalized RUT.">]>;
514
- }, undefined>], undefined>, v.DescriptionAction<{
515
- amount: number;
516
- currency: "CLP";
517
- email?: string | undefined;
518
- country: "CL";
519
- bank_code: string;
520
- account_type: "10" | "20" | "40";
521
- account_number: string;
522
- name: string;
523
- national_kind_id: "RUT";
524
- national_id: string;
525
- }, "The Receptor, as Core's `receiver`: the account the money lands on, its holder, and the amount, an integer in the minor unit of the currency. `country` and `national_kind_id` are always declared.">]>;
526
- readonly comment: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | undefined, "The signed comment, when there is one.">]>;
527
- readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer was uploaded.">]>;
528
- readonly expires_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's deadline: the signature's `exp`. A transfer still waiting for its approval at this instant expires.">]>;
574
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
575
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
576
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
577
+ }, undefined>, v.DescriptionAction<{
578
+ country: string;
579
+ bank_code: string;
580
+ account_type: "10" | "20" | "40";
581
+ account_number: string;
582
+ name: string | null;
583
+ national_kind_id: string | null;
584
+ national_id: string | null;
585
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
586
+ country: string;
587
+ bank_code: string;
588
+ account_type: "10" | "20" | "40";
589
+ account_number: string;
590
+ name: string | null;
591
+ national_kind_id: string | null;
592
+ national_id: string | null;
593
+ }, "The Receptor: the account the money lands on and its holder.">]>;
594
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
595
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
596
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
597
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
598
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
529
599
  }, undefined>, v.DescriptionAction<{
530
600
  object: "transfer";
531
601
  id: string;
532
- jti: string;
533
- 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";
534
- core_status: string | null;
535
- approved: boolean;
602
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
603
+ status_detail: string | null;
604
+ origin: "oauth" | "platform" | "emisor";
605
+ amount: number;
606
+ currency: "CLP";
536
607
  sender: {
537
- country: "CL";
608
+ country: string;
538
609
  bank_code: string;
539
610
  account_type: "10" | "20" | "40";
540
611
  account_number: string;
541
- name: string;
542
- national_kind_id: "RUT";
543
- national_id: string;
612
+ name: string | null;
613
+ national_kind_id: string | null;
614
+ national_id: string | null;
544
615
  };
545
616
  receiver: {
546
- amount: number;
547
- currency: "CLP";
548
- email?: string | undefined;
549
- country: "CL";
617
+ country: string;
550
618
  bank_code: string;
551
619
  account_type: "10" | "20" | "40";
552
620
  account_number: string;
553
- name: string;
554
- national_kind_id: "RUT";
555
- national_id: string;
621
+ name: string | null;
622
+ national_kind_id: string | null;
623
+ national_id: string | null;
556
624
  };
557
- comment?: string | undefined;
625
+ comment: string | null;
626
+ intent_id: string | null;
627
+ jti: string | null;
628
+ transaction_id: string | null;
558
629
  created_at: string;
559
- expires_at: string;
560
- }, "A Transfer uploaded as a Signed Instruction (ADR 0093), in Core's vocabulary: `sender`, `receiver` (with the amount, an integer in the minor unit of the currency) and `comment` exactly as signed. `status` is where it stands; `core_status` the core's own word, for the record.">]>;
630
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>;
561
631
  }, undefined>, undefined>;
562
632
  readonly pageInfo: v.StrictObjectSchema<{
563
633
  readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -571,34 +641,34 @@ export declare const listTransfers: import("@orpc/contract").ProcedureContractBu
571
641
  node: {
572
642
  object: "transfer";
573
643
  id: string;
574
- jti: string;
575
- 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";
576
- core_status: string | null;
577
- approved: boolean;
644
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
645
+ status_detail: string | null;
646
+ origin: "oauth" | "platform" | "emisor";
647
+ amount: number;
648
+ currency: "CLP";
578
649
  sender: {
579
- country: "CL";
650
+ country: string;
580
651
  bank_code: string;
581
652
  account_type: "10" | "20" | "40";
582
653
  account_number: string;
583
- name: string;
584
- national_kind_id: "RUT";
585
- national_id: string;
654
+ name: string | null;
655
+ national_kind_id: string | null;
656
+ national_id: string | null;
586
657
  };
587
658
  receiver: {
588
- amount: number;
589
- currency: "CLP";
590
- email?: string | undefined;
591
- country: "CL";
659
+ country: string;
592
660
  bank_code: string;
593
661
  account_type: "10" | "20" | "40";
594
662
  account_number: string;
595
- name: string;
596
- national_kind_id: "RUT";
597
- national_id: string;
663
+ name: string | null;
664
+ national_kind_id: string | null;
665
+ national_id: string | null;
598
666
  };
599
- comment?: string | undefined;
667
+ comment: string | null;
668
+ intent_id: string | null;
669
+ jti: string | null;
670
+ transaction_id: string | null;
600
671
  created_at: string;
601
- expires_at: string;
602
672
  };
603
673
  }[];
604
674
  pageInfo: {
@@ -608,5 +678,311 @@ export declare const listTransfers: import("@orpc/contract").ProcedureContractBu
608
678
  hasNextPage: boolean;
609
679
  };
610
680
  }, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof InvalidToken, typeof InvalidOrigin, typeof UnsupportedVersion, typeof ServerError, typeof TemporarilyUnavailable]>>;
611
- export {};
681
+ /**
682
+ * A page of the Transfers of one account, newest first, with a cursor on each edge. The cursor
683
+ * encodes the order key, so it stays stable when new Transfers arrive.
684
+ */
685
+ export declare const TransferListPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
686
+ readonly edges: v.ArraySchema<v.StrictObjectSchema<{
687
+ readonly cursor: v.StringSchema<undefined>;
688
+ readonly node: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
689
+ readonly object: v.LiteralSchema<"transfer", undefined>;
690
+ readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
691
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
692
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
693
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
694
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
695
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
696
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
697
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
698
+ 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`.">]>;
699
+ 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).">]>;
700
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
701
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
702
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
703
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
704
+ }, undefined>, v.DescriptionAction<{
705
+ country: string;
706
+ bank_code: string;
707
+ account_type: "10" | "20" | "40";
708
+ account_number: string;
709
+ name: string | null;
710
+ national_kind_id: string | null;
711
+ national_id: string | null;
712
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
713
+ country: string;
714
+ bank_code: string;
715
+ account_type: "10" | "20" | "40";
716
+ account_number: string;
717
+ name: string | null;
718
+ national_kind_id: string | null;
719
+ national_id: string | null;
720
+ }, "The Remitente: the account the money leaves and its holder.">]>;
721
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
722
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
723
+ 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`.">]>;
724
+ 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).">]>;
725
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
726
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
727
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
728
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
729
+ }, undefined>, v.DescriptionAction<{
730
+ country: string;
731
+ bank_code: string;
732
+ account_type: "10" | "20" | "40";
733
+ account_number: string;
734
+ name: string | null;
735
+ national_kind_id: string | null;
736
+ national_id: string | null;
737
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
738
+ country: string;
739
+ bank_code: string;
740
+ account_type: "10" | "20" | "40";
741
+ account_number: string;
742
+ name: string | null;
743
+ national_kind_id: string | null;
744
+ national_id: string | null;
745
+ }, "The Receptor: the account the money lands on and its holder.">]>;
746
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
747
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
748
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
749
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
750
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
751
+ }, undefined>, v.DescriptionAction<{
752
+ object: "transfer";
753
+ id: string;
754
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
755
+ status_detail: string | null;
756
+ origin: "oauth" | "platform" | "emisor";
757
+ amount: number;
758
+ currency: "CLP";
759
+ sender: {
760
+ country: string;
761
+ bank_code: string;
762
+ account_type: "10" | "20" | "40";
763
+ account_number: string;
764
+ name: string | null;
765
+ national_kind_id: string | null;
766
+ national_id: string | null;
767
+ };
768
+ receiver: {
769
+ country: string;
770
+ bank_code: string;
771
+ account_type: "10" | "20" | "40";
772
+ account_number: string;
773
+ name: string | null;
774
+ national_kind_id: string | null;
775
+ national_id: string | null;
776
+ };
777
+ comment: string | null;
778
+ intent_id: string | null;
779
+ jti: string | null;
780
+ transaction_id: string | null;
781
+ created_at: string;
782
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>;
783
+ }, undefined>, undefined>;
784
+ readonly pageInfo: v.StrictObjectSchema<{
785
+ readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
786
+ readonly endCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
787
+ readonly hasPreviousPage: v.BooleanSchema<undefined>;
788
+ readonly hasNextPage: v.BooleanSchema<undefined>;
789
+ }, undefined>;
790
+ }, undefined>, v.DescriptionAction<{
791
+ edges: {
792
+ cursor: string;
793
+ node: {
794
+ object: "transfer";
795
+ id: string;
796
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
797
+ status_detail: string | null;
798
+ origin: "oauth" | "platform" | "emisor";
799
+ amount: number;
800
+ currency: "CLP";
801
+ sender: {
802
+ country: string;
803
+ bank_code: string;
804
+ account_type: "10" | "20" | "40";
805
+ account_number: string;
806
+ name: string | null;
807
+ national_kind_id: string | null;
808
+ national_id: string | null;
809
+ };
810
+ receiver: {
811
+ country: string;
812
+ bank_code: string;
813
+ account_type: "10" | "20" | "40";
814
+ account_number: string;
815
+ name: string | null;
816
+ national_kind_id: string | null;
817
+ national_id: string | null;
818
+ };
819
+ comment: string | null;
820
+ intent_id: string | null;
821
+ jti: string | null;
822
+ transaction_id: string | null;
823
+ created_at: string;
824
+ };
825
+ }[];
826
+ pageInfo: {
827
+ startCursor: string | null;
828
+ endCursor: string | null;
829
+ hasPreviousPage: boolean;
830
+ hasNextPage: boolean;
831
+ };
832
+ }, string>]>;
833
+ /** A page of the Transfers of one account. */
834
+ export type TransferListPage = v.InferOutput<typeof TransferListPage>;
835
+ /** Lists the Transfers whose sender is one account, newest first. */
836
+ export declare const listAccountTransfers: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
837
+ readonly after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
838
+ readonly first: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
839
+ readonly bank_account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account's identifier (a UUID) or its Account Key.">]>;
840
+ }, undefined>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
841
+ readonly edges: v.ArraySchema<v.StrictObjectSchema<{
842
+ readonly cursor: v.StringSchema<undefined>;
843
+ readonly node: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
844
+ readonly object: v.LiteralSchema<"transfer", undefined>;
845
+ readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, v.DescriptionAction<string, "The Transfer's own id: what `GET /transfers/{transfer_id}` reads.">]>;
846
+ readonly status: v.SchemaWithPipe<readonly [v.PicklistSchema<["requires_action", "processing", "succeeded", "failed", "cancelled"], undefined>, v.DescriptionAction<"succeeded" | "failed" | "cancelled" | "requires_action" | "processing", "Where the Transfer stands: `requires_action` while the person still owes the bank a step, `processing` while the bank holds it and has not answered for good, then `succeeded`, `failed` or `cancelled`, which are final. `status_detail` says why. There is no `rejected` Transfer: a rejection ends an Intent, and a rejected Intent has no Transfer.">]>;
847
+ readonly status_detail: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The word that says why, null when the status has none: `bank_refused` for a `failed` Transfer the bank refused for sure, `expired` for a `cancelled` one whose deadline passed, `grant_revoked` or `grant_expired` for one whose Grant ended. The vocabulary is open: a detail added later appears here as it is, so decide on `status`.">]>;
848
+ readonly origin: v.SchemaWithPipe<readonly [v.PicklistSchema<["oauth", "platform", "emisor"], undefined>, v.DescriptionAction<"oauth" | "platform" | "emisor", "Who made it: `oauth`, a Project through the API; `platform`, a person in the AndCo web app; `emisor`, a person in the issuer's own channels, for example its mobile app.">]>;
849
+ readonly amount: 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, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647.">]>;
850
+ readonly currency: v.LiteralSchema<"CLP", undefined>;
851
+ readonly sender: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
852
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
853
+ 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`.">]>;
854
+ 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).">]>;
855
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
856
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
857
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
858
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
859
+ }, undefined>, v.DescriptionAction<{
860
+ country: string;
861
+ bank_code: string;
862
+ account_type: "10" | "20" | "40";
863
+ account_number: string;
864
+ name: string | null;
865
+ national_kind_id: string | null;
866
+ national_id: string | null;
867
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
868
+ country: string;
869
+ bank_code: string;
870
+ account_type: "10" | "20" | "40";
871
+ account_number: string;
872
+ name: string | null;
873
+ national_kind_id: string | null;
874
+ national_id: string | null;
875
+ }, "The Remitente: the account the money leaves and its holder.">]>;
876
+ readonly receiver: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
877
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.DescriptionAction<string, "The country of the account, for example `CL`.">]>;
878
+ 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`.">]>;
879
+ 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).">]>;
880
+ readonly account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account number, as its bank writes it.">]>;
881
+ readonly name: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's name, or null when it is not known.">]>;
882
+ readonly national_kind_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The kind of the holder's document, for example `RUT`, or null when it is not known.">]>;
883
+ readonly national_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The holder's document number, or null when it is not known.">]>;
884
+ }, undefined>, v.DescriptionAction<{
885
+ country: string;
886
+ bank_code: string;
887
+ account_type: "10" | "20" | "40";
888
+ account_number: string;
889
+ name: string | null;
890
+ national_kind_id: string | null;
891
+ national_id: string | null;
892
+ }, "One side of a Transfer: the account and its holder, with the same seven fields for the Remitente and the Receptor. The amount is on the Transfer.">]>, v.DescriptionAction<{
893
+ country: string;
894
+ bank_code: string;
895
+ account_type: "10" | "20" | "40";
896
+ account_number: string;
897
+ name: string | null;
898
+ national_kind_id: string | null;
899
+ national_id: string | null;
900
+ }, "The Receptor: the account the money lands on and its holder.">]>;
901
+ readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
902
+ readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer with `approved: true` (its signature approved it, so there was no request).">]>;
903
+ readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer with `approved: true` that submitted it, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
904
+ readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
905
+ readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
906
+ }, undefined>, v.DescriptionAction<{
907
+ object: "transfer";
908
+ id: string;
909
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
910
+ status_detail: string | null;
911
+ origin: "oauth" | "platform" | "emisor";
912
+ amount: number;
913
+ currency: "CLP";
914
+ sender: {
915
+ country: string;
916
+ bank_code: string;
917
+ account_type: "10" | "20" | "40";
918
+ account_number: string;
919
+ name: string | null;
920
+ national_kind_id: string | null;
921
+ national_id: string | null;
922
+ };
923
+ receiver: {
924
+ country: string;
925
+ bank_code: string;
926
+ account_type: "10" | "20" | "40";
927
+ account_number: string;
928
+ name: string | null;
929
+ national_kind_id: string | null;
930
+ national_id: string | null;
931
+ };
932
+ comment: string | null;
933
+ intent_id: string | null;
934
+ jti: string | null;
935
+ transaction_id: string | null;
936
+ created_at: string;
937
+ }, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>;
938
+ }, undefined>, undefined>;
939
+ readonly pageInfo: v.StrictObjectSchema<{
940
+ readonly startCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
941
+ readonly endCursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
942
+ readonly hasPreviousPage: v.BooleanSchema<undefined>;
943
+ readonly hasNextPage: v.BooleanSchema<undefined>;
944
+ }, undefined>;
945
+ }, undefined>, v.DescriptionAction<{
946
+ edges: {
947
+ cursor: string;
948
+ node: {
949
+ object: "transfer";
950
+ id: string;
951
+ status: "succeeded" | "failed" | "cancelled" | "requires_action" | "processing";
952
+ status_detail: string | null;
953
+ origin: "oauth" | "platform" | "emisor";
954
+ amount: number;
955
+ currency: "CLP";
956
+ sender: {
957
+ country: string;
958
+ bank_code: string;
959
+ account_type: "10" | "20" | "40";
960
+ account_number: string;
961
+ name: string | null;
962
+ national_kind_id: string | null;
963
+ national_id: string | null;
964
+ };
965
+ receiver: {
966
+ country: string;
967
+ bank_code: string;
968
+ account_type: "10" | "20" | "40";
969
+ account_number: string;
970
+ name: string | null;
971
+ national_kind_id: string | null;
972
+ national_id: string | null;
973
+ };
974
+ comment: string | null;
975
+ intent_id: string | null;
976
+ jti: string | null;
977
+ transaction_id: string | null;
978
+ created_at: string;
979
+ };
980
+ }[];
981
+ pageInfo: {
982
+ startCursor: string | null;
983
+ endCursor: string | null;
984
+ hasPreviousPage: boolean;
985
+ hasNextPage: boolean;
986
+ };
987
+ }, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof InvalidCursor, typeof InvalidToken, typeof InvalidOrigin, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof TemporarilyUnavailable]>>;
612
988
  //# sourceMappingURL=transfers.d.ts.map