@andco/protocol 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-errors.d.ts +5 -128
- package/dist/api-errors.d.ts.map +1 -1
- package/dist/api-errors.js +5 -131
- package/dist/authorization-preparation.d.ts +3 -3
- package/dist/authorization-preparation.d.ts.map +1 -1
- package/dist/authorization-preparation.js +4 -0
- package/dist/authorization.js +2 -2
- package/dist/errors.d.ts +111 -16
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +124 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/intent-input.d.ts +1791 -725
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +325 -157
- package/dist/issues.d.ts +62 -0
- package/dist/issues.d.ts.map +1 -0
- package/dist/issues.js +61 -0
- package/dist/messages/index.d.ts +2 -2
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/messages/index.js +10 -3
- package/dist/messages/set-preferences.d.ts +13 -1
- package/dist/messages/set-preferences.d.ts.map +1 -1
- package/dist/messages/set-preferences.js +31 -9
- package/dist/miniapp-manifest.d.ts +2 -2
- package/dist/miniapp-manifest.d.ts.map +1 -1
- package/dist/miniapp-manifest.js +1 -1
- package/dist/native-intent.d.ts +48 -28
- package/dist/native-intent.d.ts.map +1 -1
- package/dist/native-intent.js +76 -24
- package/dist/pagination.d.ts +37 -31
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +72 -24
- package/dist/rar/account-matchers.d.ts +47 -240
- package/dist/rar/account-matchers.d.ts.map +1 -1
- package/dist/rar/account-matchers.js +52 -131
- package/dist/rar/bank.d.ts +280 -392
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +68 -137
- package/dist/rar/catalog.d.ts +305 -288
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +69 -29
- package/dist/rar/detail.d.ts +15 -32
- package/dist/rar/detail.d.ts.map +1 -1
- package/dist/rar/detail.js +14 -34
- package/dist/rar/index.d.ts +2 -1
- package/dist/rar/index.d.ts.map +1 -1
- package/dist/rar/index.js +2 -1
- package/dist/rar/json-schemas.generated.d.ts +4 -0
- package/dist/rar/json-schemas.generated.d.ts.map +1 -0
- package/dist/rar/json-schemas.generated.js +3570 -0
- package/dist/rar/money.d.ts +5 -5
- package/dist/rar/money.d.ts.map +1 -1
- package/dist/rar/money.js +5 -5
- package/dist/rar/project-users.d.ts +40 -14
- package/dist/rar/project-users.d.ts.map +1 -1
- package/dist/rar/project-users.js +20 -23
- package/dist/rar/subject-data.d.ts +96 -48
- package/dist/rar/subject-data.d.ts.map +1 -1
- package/dist/rar/subject-data.js +61 -34
- package/dist/rar/subject.d.ts +18 -85
- package/dist/rar/subject.d.ts.map +1 -1
- package/dist/rar/subject.js +23 -51
- package/dist/rest/accounts.d.ts +347 -0
- package/dist/rest/accounts.d.ts.map +1 -0
- package/dist/rest/accounts.js +108 -0
- package/dist/rest/addresses.d.ts +581 -0
- package/dist/rest/addresses.d.ts.map +1 -0
- package/dist/rest/addresses.js +190 -0
- package/dist/rest/api-error.d.ts +104 -0
- package/dist/rest/api-error.d.ts.map +1 -0
- package/dist/rest/api-error.js +103 -0
- package/dist/rest/authorization.d.ts +123 -0
- package/dist/rest/authorization.d.ts.map +1 -0
- package/dist/rest/authorization.js +62 -0
- package/dist/rest/catalog.d.ts +199 -0
- package/dist/rest/catalog.d.ts.map +1 -0
- package/dist/rest/catalog.js +63 -0
- package/dist/rest/common.d.ts +637 -0
- package/dist/rest/common.d.ts.map +1 -0
- package/dist/rest/common.js +172 -0
- package/dist/rest/contract.d.ts +3480 -0
- package/dist/rest/contract.d.ts.map +1 -0
- package/dist/rest/contract.js +120 -0
- package/dist/rest/events.d.ts +145 -0
- package/dist/rest/events.d.ts.map +1 -0
- package/dist/rest/events.js +42 -0
- package/dist/rest/http.d.ts +49 -0
- package/dist/rest/http.d.ts.map +1 -0
- package/dist/rest/http.js +25 -0
- package/dist/rest/identity.d.ts +627 -0
- package/dist/rest/identity.d.ts.map +1 -0
- package/dist/rest/identity.js +128 -0
- package/dist/rest/index.d.ts +14 -0
- package/dist/rest/index.d.ts.map +1 -0
- package/dist/rest/index.js +13 -0
- package/dist/rest/intents.d.ts +4556 -0
- package/dist/rest/intents.d.ts.map +1 -0
- package/dist/rest/intents.js +551 -0
- package/dist/rest/signatures.d.ts +110 -0
- package/dist/rest/signatures.d.ts.map +1 -0
- package/dist/rest/signatures.js +113 -0
- package/dist/rest/subjects.d.ts +14 -0
- package/dist/rest/subjects.d.ts.map +1 -0
- package/dist/rest/subjects.js +22 -0
- package/dist/service-grants.d.ts +2 -2
- package/dist/service-grants.d.ts.map +1 -1
- package/dist/service-grants.js +1 -1
- package/dist/transport/generated/oauth-api.d.ts +5547 -1448
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +9 -134
- package/dist/transport/intents.d.ts.map +1 -1
- package/dist/transport/intents.js +21 -405
- package/dist/transport/rest.d.ts +15 -5
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/userinfo.d.ts +22 -9
- package/dist/userinfo.d.ts.map +1 -1
- package/dist/userinfo.js +17 -12
- package/package.json +13 -2
package/dist/intent-input.d.ts
CHANGED
|
@@ -1,4 +1,95 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
+
import { type Issue, type ParseResult } from "./issues.js";
|
|
3
|
+
/**
|
|
4
|
+
* The amount a deposit asks for: `value` is the number, and `editable: true` lets the payer change
|
|
5
|
+
* it on the screen. It is never what moved; an answered Intent says that apart (`progress.credited`).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const amount = { currency: "CLP", value: "40000", editable: true };
|
|
9
|
+
*/
|
|
10
|
+
export declare const IntentAmountSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
11
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
12
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
13
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
14
|
+
}, undefined>, v.DescriptionAction<{
|
|
15
|
+
currency: "CLP";
|
|
16
|
+
value: string;
|
|
17
|
+
editable: boolean;
|
|
18
|
+
}, "The amount a deposit asks for. `editable: true` lets the payer change it on the screen. It is never what moved: a deposit answers that in `progress.credited`.">]>;
|
|
19
|
+
/**
|
|
20
|
+
* The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on
|
|
21
|
+
* Andco's confirmation screen, and `value` is the initial proposal shown there; the server checks it
|
|
22
|
+
* against the Grant's `transactions.minimum` and `transactions.maximum` and the available balance.
|
|
23
|
+
* Without `editable` (or with `false`) the amount is locked. What moved is `settled`.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const amount = { currency: "CLP", value: "40000", editable: true };
|
|
27
|
+
*/
|
|
28
|
+
export declare const TransferAmountProposalSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
29
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
30
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
31
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
32
|
+
}, undefined>, v.DescriptionAction<{
|
|
33
|
+
currency: "CLP";
|
|
34
|
+
value: string;
|
|
35
|
+
editable: boolean;
|
|
36
|
+
}, "The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
|
|
37
|
+
/**
|
|
38
|
+
* The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing
|
|
39
|
+
* left for a person to change, so there is no `editable`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const SignedAmountSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
42
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
43
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
44
|
+
}, undefined>, v.DescriptionAction<{
|
|
45
|
+
currency: "CLP";
|
|
46
|
+
value: string;
|
|
47
|
+
}, "The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change.">]>;
|
|
48
|
+
/**
|
|
49
|
+
* The bank reference a request asks for. `editable: true` lets the person who confirms change it.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* const note = { value: "Factura 42", editable: true };
|
|
53
|
+
*/
|
|
54
|
+
export declare const IntentNoteSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
55
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
56
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
57
|
+
}, undefined>, v.DescriptionAction<{
|
|
58
|
+
value: string;
|
|
59
|
+
editable: boolean;
|
|
60
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>;
|
|
61
|
+
/** One Andco account of the Grant's subject, named by its Account Key. */
|
|
62
|
+
export declare const IntentAccountKeySchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
63
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
64
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
65
|
+
}, undefined>, v.DescriptionAction<{
|
|
66
|
+
type: "account_key";
|
|
67
|
+
accountKey: string;
|
|
68
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>;
|
|
69
|
+
/** One Andco account, named by its identifier. */
|
|
70
|
+
export declare const IntentAccountIdSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
71
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
72
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
73
|
+
}, undefined>, v.DescriptionAction<{
|
|
74
|
+
type: "account";
|
|
75
|
+
id: string;
|
|
76
|
+
}, "One Andco account, named by its identifier.">]>;
|
|
77
|
+
/** One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix. */
|
|
78
|
+
export declare const IntentAccountExternalSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
79
|
+
type: v.LiteralSchema<"external", undefined>;
|
|
80
|
+
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
81
|
+
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
82
|
+
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
83
|
+
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
84
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
85
|
+
}, undefined>, v.DescriptionAction<{
|
|
86
|
+
type: "external";
|
|
87
|
+
bank_id: string;
|
|
88
|
+
account_type: "checking" | "debit" | "savings";
|
|
89
|
+
account_id: string;
|
|
90
|
+
holder_id: string;
|
|
91
|
+
holder_name: string;
|
|
92
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>;
|
|
2
93
|
/**
|
|
3
94
|
* One Andco account of the Grant's subject, named by Account Key or by identifier: where a
|
|
4
95
|
* transfer's money leaves from, where a deposit lands, and the account a closure closes.
|
|
@@ -6,102 +97,346 @@ import * as v from "valibot";
|
|
|
6
97
|
* @example
|
|
7
98
|
* const account: IntentAccount = { type: "account_key", accountKey: "ventas" };
|
|
8
99
|
*/
|
|
9
|
-
declare const
|
|
100
|
+
export declare const IntentAccountSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
10
101
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
11
102
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
12
|
-
}, undefined>, v.
|
|
103
|
+
}, undefined>, v.DescriptionAction<{
|
|
104
|
+
type: "account_key";
|
|
105
|
+
accountKey: string;
|
|
106
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
13
107
|
type: v.LiteralSchema<"account", undefined>;
|
|
14
108
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
15
|
-
}, undefined
|
|
109
|
+
}, undefined>, v.DescriptionAction<{
|
|
110
|
+
type: "account";
|
|
111
|
+
id: string;
|
|
112
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
113
|
+
type: "account_key";
|
|
114
|
+
accountKey: string;
|
|
115
|
+
} | {
|
|
116
|
+
type: "account";
|
|
117
|
+
id: string;
|
|
118
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
119
|
+
declare const andcoAccount: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
120
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
121
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
122
|
+
}, undefined>, v.DescriptionAction<{
|
|
123
|
+
type: "account_key";
|
|
124
|
+
accountKey: string;
|
|
125
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
126
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
127
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
128
|
+
}, undefined>, v.DescriptionAction<{
|
|
129
|
+
type: "account";
|
|
130
|
+
id: string;
|
|
131
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
132
|
+
type: "account_key";
|
|
133
|
+
accountKey: string;
|
|
134
|
+
} | {
|
|
135
|
+
type: "account";
|
|
136
|
+
id: string;
|
|
137
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
16
138
|
/** One Andco account named by Account Key or by identifier, exactly as an Intent carries it. */
|
|
17
139
|
export type IntentAccount = v.InferOutput<typeof andcoAccount>;
|
|
18
140
|
/** Where a signed transfer's money lands: nothing on this path is left for a person to complete. */
|
|
19
|
-
declare const
|
|
141
|
+
export declare const TransferDestinationSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
20
142
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
21
143
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
22
|
-
}, undefined>, v.
|
|
144
|
+
}, undefined>, v.DescriptionAction<{
|
|
145
|
+
type: "account_key";
|
|
146
|
+
accountKey: string;
|
|
147
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
23
148
|
type: v.LiteralSchema<"account", undefined>;
|
|
24
149
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
25
|
-
}, undefined>, v.
|
|
150
|
+
}, undefined>, v.DescriptionAction<{
|
|
151
|
+
type: "account";
|
|
152
|
+
id: string;
|
|
153
|
+
}, "One Andco account, named by its identifier.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
26
154
|
type: v.LiteralSchema<"external", undefined>;
|
|
27
155
|
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
28
156
|
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
29
157
|
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
30
158
|
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
31
|
-
holder_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.
|
|
32
|
-
}, undefined
|
|
159
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
160
|
+
}, undefined>, v.DescriptionAction<{
|
|
161
|
+
type: "external";
|
|
162
|
+
bank_id: string;
|
|
163
|
+
account_type: "checking" | "debit" | "savings";
|
|
164
|
+
account_id: string;
|
|
165
|
+
holder_id: string;
|
|
166
|
+
holder_name: string;
|
|
167
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>], undefined>, v.DescriptionAction<{
|
|
168
|
+
type: "account_key";
|
|
169
|
+
accountKey: string;
|
|
170
|
+
} | {
|
|
171
|
+
type: "account";
|
|
172
|
+
id: string;
|
|
173
|
+
} | {
|
|
174
|
+
type: "external";
|
|
175
|
+
bank_id: string;
|
|
176
|
+
account_type: "checking" | "debit" | "savings";
|
|
177
|
+
account_id: string;
|
|
178
|
+
holder_id: string;
|
|
179
|
+
holder_name: string;
|
|
180
|
+
}, "Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank.">]>;
|
|
181
|
+
declare const signedTransferDestination: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
182
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
183
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
184
|
+
}, undefined>, v.DescriptionAction<{
|
|
185
|
+
type: "account_key";
|
|
186
|
+
accountKey: string;
|
|
187
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
188
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
189
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
190
|
+
}, undefined>, v.DescriptionAction<{
|
|
191
|
+
type: "account";
|
|
192
|
+
id: string;
|
|
193
|
+
}, "One Andco account, named by its identifier.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
194
|
+
type: v.LiteralSchema<"external", undefined>;
|
|
195
|
+
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
196
|
+
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
197
|
+
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
198
|
+
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
199
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
200
|
+
}, undefined>, v.DescriptionAction<{
|
|
201
|
+
type: "external";
|
|
202
|
+
bank_id: string;
|
|
203
|
+
account_type: "checking" | "debit" | "savings";
|
|
204
|
+
account_id: string;
|
|
205
|
+
holder_id: string;
|
|
206
|
+
holder_name: string;
|
|
207
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>], undefined>, v.DescriptionAction<{
|
|
208
|
+
type: "account_key";
|
|
209
|
+
accountKey: string;
|
|
210
|
+
} | {
|
|
211
|
+
type: "account";
|
|
212
|
+
id: string;
|
|
213
|
+
} | {
|
|
214
|
+
type: "external";
|
|
215
|
+
bank_id: string;
|
|
216
|
+
account_type: "checking" | "debit" | "savings";
|
|
217
|
+
account_id: string;
|
|
218
|
+
holder_id: string;
|
|
219
|
+
holder_name: string;
|
|
220
|
+
}, "Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank.">]>;
|
|
221
|
+
export declare const TransferDestinationProposalSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
222
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
223
|
+
readonly type: v.LiteralSchema<"account_key", undefined>;
|
|
224
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
225
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
226
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
227
|
+
readonly type: v.LiteralSchema<"account", undefined>;
|
|
228
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
229
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
230
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
231
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
232
|
+
readonly bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
233
|
+
readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
234
|
+
readonly account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
235
|
+
readonly holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
236
|
+
readonly holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
237
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
238
|
+
editable: false;
|
|
239
|
+
type: "account_key";
|
|
240
|
+
accountKey: string;
|
|
241
|
+
} | {
|
|
242
|
+
editable: false;
|
|
243
|
+
type: "account";
|
|
244
|
+
id: string;
|
|
245
|
+
} | {
|
|
246
|
+
editable: false;
|
|
247
|
+
type: "external";
|
|
248
|
+
bank_id: string;
|
|
249
|
+
account_type: "checking" | "debit" | "savings";
|
|
250
|
+
account_id: string;
|
|
251
|
+
holder_id: string;
|
|
252
|
+
holder_name: string;
|
|
253
|
+
}, "Where a transfer's money lands when it is named, in the request and in the answered Intent alike. A named destination is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `destination: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a destination the person completed on the screen, which is locked once she confirms.">]>;
|
|
33
254
|
/** One account a transfer names, exactly as a signed instruction carries it. */
|
|
34
255
|
export type TransferAccount = v.InferOutput<typeof signedTransferDestination>;
|
|
35
256
|
/** Validates fixed-duration syntax without anchoring it to a changing clock. */
|
|
36
257
|
export declare function isIntentDuration(value: string): boolean;
|
|
37
258
|
/** Validates a real ISO calendar datetime with a timezone; past dates remain valid for idempotent replay. */
|
|
38
259
|
export declare function isIntentDeadline(value: string): boolean;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
* This is the `application/json` half of the creation contract: an Intent born waiting for an
|
|
43
|
-
* Approval, where a `null` means a person will choose. The `application/jwt` half is
|
|
44
|
-
* {@link SignedIntentSchema}, and the two are separate schemas rather than one with optional fields
|
|
45
|
-
* on purpose — when signed and unsigned members share an object, something eventually reads the
|
|
46
|
-
* wrong ones.
|
|
47
|
-
*
|
|
48
|
-
* `transfer` is the only way money movement is expressed: money leaving an account towards a
|
|
49
|
-
* `destination`, both named in the `bank_transfer` matcher vocabulary (`account_key`, `account`,
|
|
50
|
-
* `external`). A null `source` is the confirmation screen's source picker; the destination is always
|
|
51
|
-
* locked there (`editable: true` is refused), and so is the amount unless it says `editable: true`, in
|
|
52
|
-
* which case the person sets it. Who may approve the Intent without a person belongs to the Grant, never to
|
|
53
|
-
* the operation itself.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* safeParseIntentCreate({
|
|
57
|
-
* type: "transfer", expires_in: "30 minutes", source: null,
|
|
58
|
-
* destination: { type: "account_key", accountKey: "proveedores" },
|
|
59
|
-
* amount: { currency: "CLP", value: "40000" },
|
|
60
|
-
* note: { value: "Factura 42", editable: true },
|
|
61
|
-
* });
|
|
62
|
-
*
|
|
63
|
-
* `account_opening` is here for the same reason money movement is: everything with banking
|
|
64
|
-
* consequence happens through an Intent, so `/accounts` has no `POST`. It carries no amount, no
|
|
65
|
-
* source and no destination — only the name the account will answer to, and whether naming one that
|
|
66
|
-
* already exists is an error or a request for the account that is already there.
|
|
67
|
-
*/
|
|
68
|
-
export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
260
|
+
/** A proposal to collect money into an account of the Grant's subject. See {@link IntentCreateSchema}. */
|
|
261
|
+
export declare const DepositIntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
69
262
|
readonly type: v.LiteralSchema<"deposit", undefined>;
|
|
70
|
-
readonly destination: v.OptionalSchema<v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
263
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
71
264
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
72
265
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
73
|
-
}, undefined>, v.
|
|
266
|
+
}, undefined>, v.DescriptionAction<{
|
|
267
|
+
type: "account_key";
|
|
268
|
+
accountKey: string;
|
|
269
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
74
270
|
type: v.LiteralSchema<"account", undefined>;
|
|
75
271
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
76
|
-
}, undefined
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
272
|
+
}, undefined>, v.DescriptionAction<{
|
|
273
|
+
type: "account";
|
|
274
|
+
id: string;
|
|
275
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
276
|
+
type: "account_key";
|
|
277
|
+
accountKey: string;
|
|
278
|
+
} | {
|
|
279
|
+
type: "account";
|
|
280
|
+
id: string;
|
|
281
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, v.DescriptionAction<{
|
|
282
|
+
type: "account_key";
|
|
283
|
+
accountKey: string;
|
|
284
|
+
} | {
|
|
285
|
+
type: "account";
|
|
286
|
+
id: string;
|
|
287
|
+
} | undefined, "The account of the Grant's subject the money lands on. Omitted, the Grant's `bank_deposit` destinations must admit exactly one active account, or the request fails with `deposit_destination_ambiguous`; named, it must be one of them, or the request fails with `invalid_destination`.">]>;
|
|
288
|
+
readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
289
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
290
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
291
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
292
|
+
}, undefined>, v.DescriptionAction<{
|
|
293
|
+
currency: "CLP";
|
|
294
|
+
value: string;
|
|
295
|
+
editable: boolean;
|
|
296
|
+
}, "The amount a deposit asks for. `editable: true` lets the payer change it on the screen. It is never what moved: a deposit answers that in `progress.credited`.">]>, undefined>;
|
|
297
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
298
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
299
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
300
|
+
}, undefined>, v.DescriptionAction<{
|
|
301
|
+
value: string;
|
|
302
|
+
editable: boolean;
|
|
303
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
88
304
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
305
|
+
} & {
|
|
306
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
307
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
89
308
|
}, undefined>, v.StrictObjectSchema<{
|
|
309
|
+
readonly type: v.LiteralSchema<"deposit", undefined>;
|
|
310
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
311
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
312
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
313
|
+
}, undefined>, v.DescriptionAction<{
|
|
314
|
+
type: "account_key";
|
|
315
|
+
accountKey: string;
|
|
316
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
317
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
318
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
319
|
+
}, undefined>, v.DescriptionAction<{
|
|
320
|
+
type: "account";
|
|
321
|
+
id: string;
|
|
322
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
323
|
+
type: "account_key";
|
|
324
|
+
accountKey: string;
|
|
325
|
+
} | {
|
|
326
|
+
type: "account";
|
|
327
|
+
id: string;
|
|
328
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, v.DescriptionAction<{
|
|
329
|
+
type: "account_key";
|
|
330
|
+
accountKey: string;
|
|
331
|
+
} | {
|
|
332
|
+
type: "account";
|
|
333
|
+
id: string;
|
|
334
|
+
} | undefined, "The account of the Grant's subject the money lands on. Omitted, the Grant's `bank_deposit` destinations must admit exactly one active account, or the request fails with `deposit_destination_ambiguous`; named, it must be one of them, or the request fails with `invalid_destination`.">]>;
|
|
335
|
+
readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
336
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
337
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
338
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
339
|
+
}, undefined>, v.DescriptionAction<{
|
|
340
|
+
currency: "CLP";
|
|
341
|
+
value: string;
|
|
342
|
+
editable: boolean;
|
|
343
|
+
}, "The amount a deposit asks for. `editable: true` lets the payer change it on the screen. It is never what moved: a deposit answers that in `progress.credited`.">]>, undefined>;
|
|
344
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
345
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
346
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
347
|
+
}, undefined>, v.DescriptionAction<{
|
|
348
|
+
value: string;
|
|
349
|
+
editable: boolean;
|
|
350
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
351
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
352
|
+
} & {
|
|
353
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
354
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
355
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
356
|
+
type: "deposit";
|
|
357
|
+
destination?: {
|
|
358
|
+
type: "account_key";
|
|
359
|
+
accountKey: string;
|
|
360
|
+
} | {
|
|
361
|
+
type: "account";
|
|
362
|
+
id: string;
|
|
363
|
+
} | undefined;
|
|
364
|
+
amount?: {
|
|
365
|
+
currency: "CLP";
|
|
366
|
+
value: string;
|
|
367
|
+
editable: boolean;
|
|
368
|
+
} | undefined;
|
|
369
|
+
note?: {
|
|
370
|
+
value: string;
|
|
371
|
+
editable: boolean;
|
|
372
|
+
} | undefined;
|
|
373
|
+
metadata: {
|
|
374
|
+
[x: string]: unknown;
|
|
375
|
+
};
|
|
376
|
+
expires_in: string;
|
|
377
|
+
expires_at?: undefined;
|
|
378
|
+
} | {
|
|
379
|
+
type: "deposit";
|
|
380
|
+
destination?: {
|
|
381
|
+
type: "account_key";
|
|
382
|
+
accountKey: string;
|
|
383
|
+
} | {
|
|
384
|
+
type: "account";
|
|
385
|
+
id: string;
|
|
386
|
+
} | undefined;
|
|
387
|
+
amount?: {
|
|
388
|
+
currency: "CLP";
|
|
389
|
+
value: string;
|
|
390
|
+
editable: boolean;
|
|
391
|
+
} | undefined;
|
|
392
|
+
note?: {
|
|
393
|
+
value: string;
|
|
394
|
+
editable: boolean;
|
|
395
|
+
} | undefined;
|
|
396
|
+
metadata: {
|
|
397
|
+
[x: string]: unknown;
|
|
398
|
+
};
|
|
399
|
+
expires_in?: undefined;
|
|
400
|
+
expires_at: string | null;
|
|
401
|
+
}, "The `application/json` half of collecting money into an account of the Grant's subject: an Intent born waiting for a payer. Exactly one of `expires_in` and `expires_at`; `expires_at: null` (never expires) only when `amount` is omitted.">]>;
|
|
402
|
+
/** A proposal to move money, born waiting for an Approval. See {@link IntentCreateSchema}. */
|
|
403
|
+
export declare const TransferIntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
90
404
|
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
91
|
-
readonly
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
405
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
406
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
407
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
408
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
409
|
+
}, undefined>, v.DescriptionAction<{
|
|
410
|
+
currency: "CLP";
|
|
411
|
+
value: string;
|
|
412
|
+
editable: boolean;
|
|
413
|
+
}, "The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
|
|
414
|
+
readonly source: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
98
415
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
99
416
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
100
|
-
}, undefined>, v.
|
|
417
|
+
}, undefined>, v.DescriptionAction<{
|
|
418
|
+
type: "account_key";
|
|
419
|
+
accountKey: string;
|
|
420
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
101
421
|
type: v.LiteralSchema<"account", undefined>;
|
|
102
422
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
103
|
-
}, undefined
|
|
104
|
-
|
|
423
|
+
}, undefined>, v.DescriptionAction<{
|
|
424
|
+
type: "account";
|
|
425
|
+
id: string;
|
|
426
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
427
|
+
type: "account_key";
|
|
428
|
+
accountKey: string;
|
|
429
|
+
} | {
|
|
430
|
+
type: "account";
|
|
431
|
+
id: string;
|
|
432
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, null>, v.DescriptionAction<{
|
|
433
|
+
type: "account_key";
|
|
434
|
+
accountKey: string;
|
|
435
|
+
} | {
|
|
436
|
+
type: "account";
|
|
437
|
+
id: string;
|
|
438
|
+
} | null, "The Andco account the money leaves. Null leaves that choice to a person on a screen.">]>;
|
|
439
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
105
440
|
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
106
441
|
readonly type: v.LiteralSchema<"account_key", undefined>;
|
|
107
442
|
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -116,58 +451,178 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
116
451
|
readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
117
452
|
readonly account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
118
453
|
readonly holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
119
|
-
readonly holder_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.
|
|
120
|
-
}, undefined>], undefined
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
454
|
+
readonly holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
455
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
456
|
+
editable: false;
|
|
457
|
+
type: "account_key";
|
|
458
|
+
accountKey: string;
|
|
459
|
+
} | {
|
|
460
|
+
editable: false;
|
|
461
|
+
type: "account";
|
|
462
|
+
id: string;
|
|
463
|
+
} | {
|
|
464
|
+
editable: false;
|
|
465
|
+
type: "external";
|
|
466
|
+
bank_id: string;
|
|
467
|
+
account_type: "checking" | "debit" | "savings";
|
|
468
|
+
account_id: string;
|
|
469
|
+
holder_id: string;
|
|
470
|
+
holder_name: string;
|
|
471
|
+
}, "Where a transfer's money lands when it is named, in the request and in the answered Intent alike. A named destination is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `destination: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a destination the person completed on the screen, which is locked once she confirms.">]>, undefined>, null>, v.DescriptionAction<{
|
|
472
|
+
editable: false;
|
|
473
|
+
type: "account_key";
|
|
474
|
+
accountKey: string;
|
|
475
|
+
} | {
|
|
476
|
+
editable: false;
|
|
477
|
+
type: "account";
|
|
478
|
+
id: string;
|
|
479
|
+
} | {
|
|
480
|
+
editable: false;
|
|
481
|
+
type: "external";
|
|
482
|
+
bank_id: string;
|
|
483
|
+
account_type: "checking" | "debit" | "savings";
|
|
484
|
+
account_id: string;
|
|
485
|
+
holder_id: string;
|
|
486
|
+
holder_name: string;
|
|
487
|
+
} | null, "Where the money lands. Null leaves it to a person on the screen, within the Grant's destinations.">]>;
|
|
488
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
489
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
490
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
491
|
+
}, undefined>, v.DescriptionAction<{
|
|
492
|
+
value: string;
|
|
493
|
+
editable: boolean;
|
|
494
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
138
495
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
496
|
+
} & {
|
|
497
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
498
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
139
499
|
}, undefined>, v.StrictObjectSchema<{
|
|
140
|
-
readonly type: v.LiteralSchema<"
|
|
141
|
-
readonly
|
|
500
|
+
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
501
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
502
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
503
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
504
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
505
|
+
}, undefined>, v.DescriptionAction<{
|
|
506
|
+
currency: "CLP";
|
|
507
|
+
value: string;
|
|
508
|
+
editable: boolean;
|
|
509
|
+
}, "The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
|
|
510
|
+
readonly source: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
142
511
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
143
512
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
144
|
-
}, undefined>, v.
|
|
513
|
+
}, undefined>, v.DescriptionAction<{
|
|
514
|
+
type: "account_key";
|
|
515
|
+
accountKey: string;
|
|
516
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
145
517
|
type: v.LiteralSchema<"account", undefined>;
|
|
146
518
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
147
|
-
}, undefined
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.CheckAction<string, "note_too_long">]>;
|
|
152
|
-
readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
153
|
-
}, undefined>, undefined>;
|
|
154
|
-
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
155
|
-
}, undefined>], undefined>, v.CheckAction<{
|
|
156
|
-
type: "deposit";
|
|
157
|
-
destination?: {
|
|
519
|
+
}, undefined>, v.DescriptionAction<{
|
|
520
|
+
type: "account";
|
|
521
|
+
id: string;
|
|
522
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
158
523
|
type: "account_key";
|
|
159
524
|
accountKey: string;
|
|
160
525
|
} | {
|
|
161
526
|
type: "account";
|
|
162
527
|
id: string;
|
|
163
|
-
}
|
|
164
|
-
|
|
528
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, null>, v.DescriptionAction<{
|
|
529
|
+
type: "account_key";
|
|
530
|
+
accountKey: string;
|
|
531
|
+
} | {
|
|
532
|
+
type: "account";
|
|
533
|
+
id: string;
|
|
534
|
+
} | null, "The Andco account the money leaves. Null leaves that choice to a person on a screen.">]>;
|
|
535
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
536
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
537
|
+
readonly type: v.LiteralSchema<"account_key", undefined>;
|
|
538
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
539
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
540
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
541
|
+
readonly type: v.LiteralSchema<"account", undefined>;
|
|
542
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
543
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
544
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
545
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
546
|
+
readonly bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
547
|
+
readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
548
|
+
readonly account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
549
|
+
readonly holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
550
|
+
readonly holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
551
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
552
|
+
editable: false;
|
|
553
|
+
type: "account_key";
|
|
554
|
+
accountKey: string;
|
|
555
|
+
} | {
|
|
556
|
+
editable: false;
|
|
557
|
+
type: "account";
|
|
558
|
+
id: string;
|
|
559
|
+
} | {
|
|
560
|
+
editable: false;
|
|
561
|
+
type: "external";
|
|
562
|
+
bank_id: string;
|
|
563
|
+
account_type: "checking" | "debit" | "savings";
|
|
564
|
+
account_id: string;
|
|
565
|
+
holder_id: string;
|
|
566
|
+
holder_name: string;
|
|
567
|
+
}, "Where a transfer's money lands when it is named, in the request and in the answered Intent alike. A named destination is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `destination: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a destination the person completed on the screen, which is locked once she confirms.">]>, undefined>, null>, v.DescriptionAction<{
|
|
568
|
+
editable: false;
|
|
569
|
+
type: "account_key";
|
|
570
|
+
accountKey: string;
|
|
571
|
+
} | {
|
|
572
|
+
editable: false;
|
|
573
|
+
type: "account";
|
|
574
|
+
id: string;
|
|
575
|
+
} | {
|
|
576
|
+
editable: false;
|
|
577
|
+
type: "external";
|
|
578
|
+
bank_id: string;
|
|
579
|
+
account_type: "checking" | "debit" | "savings";
|
|
580
|
+
account_id: string;
|
|
581
|
+
holder_id: string;
|
|
582
|
+
holder_name: string;
|
|
583
|
+
} | null, "Where the money lands. Null leaves it to a person on the screen, within the Grant's destinations.">]>;
|
|
584
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
585
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
586
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
587
|
+
}, undefined>, v.DescriptionAction<{
|
|
588
|
+
value: string;
|
|
589
|
+
editable: boolean;
|
|
590
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
591
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
592
|
+
} & {
|
|
593
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
594
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
595
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
596
|
+
type: "transfer";
|
|
597
|
+
amount: {
|
|
165
598
|
currency: "CLP";
|
|
166
599
|
value: string;
|
|
167
600
|
editable: boolean;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
601
|
+
};
|
|
602
|
+
source: {
|
|
603
|
+
type: "account_key";
|
|
604
|
+
accountKey: string;
|
|
605
|
+
} | {
|
|
606
|
+
type: "account";
|
|
607
|
+
id: string;
|
|
608
|
+
} | null;
|
|
609
|
+
destination: {
|
|
610
|
+
editable: false;
|
|
611
|
+
type: "account_key";
|
|
612
|
+
accountKey: string;
|
|
613
|
+
} | {
|
|
614
|
+
editable: false;
|
|
615
|
+
type: "account";
|
|
616
|
+
id: string;
|
|
617
|
+
} | {
|
|
618
|
+
editable: false;
|
|
619
|
+
type: "external";
|
|
620
|
+
bank_id: string;
|
|
621
|
+
account_type: "checking" | "debit" | "savings";
|
|
622
|
+
account_id: string;
|
|
623
|
+
holder_id: string;
|
|
624
|
+
holder_name: string;
|
|
625
|
+
} | null;
|
|
171
626
|
note?: {
|
|
172
627
|
value: string;
|
|
173
628
|
editable: boolean;
|
|
@@ -175,9 +630,10 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
175
630
|
metadata: {
|
|
176
631
|
[x: string]: unknown;
|
|
177
632
|
};
|
|
633
|
+
expires_in: string;
|
|
634
|
+
expires_at?: undefined;
|
|
178
635
|
} | {
|
|
179
636
|
type: "transfer";
|
|
180
|
-
expires_at?: string | null | undefined;
|
|
181
637
|
amount: {
|
|
182
638
|
currency: "CLP";
|
|
183
639
|
value: string;
|
|
@@ -206,8 +662,55 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
206
662
|
account_id: string;
|
|
207
663
|
holder_id: string;
|
|
208
664
|
holder_name: string;
|
|
665
|
+
} | null;
|
|
666
|
+
note?: {
|
|
667
|
+
value: string;
|
|
668
|
+
editable: boolean;
|
|
669
|
+
} | undefined;
|
|
670
|
+
metadata: {
|
|
671
|
+
[x: string]: unknown;
|
|
209
672
|
};
|
|
210
|
-
expires_in?:
|
|
673
|
+
expires_in?: undefined;
|
|
674
|
+
expires_at: string | null;
|
|
675
|
+
}, "The `application/json` half of creating a transfer: an Intent born waiting for an Approval. A null `source` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `destination` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A destination the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. The `application/jwt` half is `SignedTransferIntentClaims`, and the two are separate schemas rather than one with optional fields on purpose: when signed and unsigned members share an object, something eventually reads the wrong ones.">]>;
|
|
676
|
+
/** A proposal to open a Cuenta Vista, born waiting for an Approval. See {@link IntentCreateSchema}. */
|
|
677
|
+
export declare const AccountOpeningIntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
678
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
679
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
680
|
+
readonly name: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "The display label the account opens with. Mutable afterwards, and read by no permission.">]>;
|
|
681
|
+
readonly upsert: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Whether naming an AccountKey that already exists answers with that account instead of failing. It defaults to false, so one name never quietly becomes two accounts.">]>;
|
|
682
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
683
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
684
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
685
|
+
}, undefined>, v.DescriptionAction<{
|
|
686
|
+
value: string;
|
|
687
|
+
editable: boolean;
|
|
688
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
689
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
690
|
+
} & {
|
|
691
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
692
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
693
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
694
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
695
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
696
|
+
readonly name: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "The display label the account opens with. Mutable afterwards, and read by no permission.">]>;
|
|
697
|
+
readonly upsert: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Whether naming an AccountKey that already exists answers with that account instead of failing. It defaults to false, so one name never quietly becomes two accounts.">]>;
|
|
698
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
699
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
700
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
701
|
+
}, undefined>, v.DescriptionAction<{
|
|
702
|
+
value: string;
|
|
703
|
+
editable: boolean;
|
|
704
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
705
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
706
|
+
} & {
|
|
707
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
708
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
709
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
710
|
+
type: "account_opening";
|
|
711
|
+
accountKey: string;
|
|
712
|
+
name?: string | undefined;
|
|
713
|
+
upsert: boolean;
|
|
211
714
|
note?: {
|
|
212
715
|
value: string;
|
|
213
716
|
editable: boolean;
|
|
@@ -215,13 +718,13 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
215
718
|
metadata: {
|
|
216
719
|
[x: string]: unknown;
|
|
217
720
|
};
|
|
721
|
+
expires_in: string;
|
|
722
|
+
expires_at?: undefined;
|
|
218
723
|
} | {
|
|
219
724
|
type: "account_opening";
|
|
220
|
-
expires_at?: string | null | undefined;
|
|
221
725
|
accountKey: string;
|
|
222
726
|
name?: string | undefined;
|
|
223
727
|
upsert: boolean;
|
|
224
|
-
expires_in?: string | undefined;
|
|
225
728
|
note?: {
|
|
226
729
|
value: string;
|
|
227
730
|
editable: boolean;
|
|
@@ -229,6 +732,92 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
229
732
|
metadata: {
|
|
230
733
|
[x: string]: unknown;
|
|
231
734
|
};
|
|
735
|
+
expires_in?: undefined;
|
|
736
|
+
expires_at: string | null;
|
|
737
|
+
}, "The `application/json` half of opening a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `POST` because everything with banking consequence happens through an Intent, and an opening carries no amount, no source and no destination -- only the name the account will answer to. Opening is asynchronous: the answer is the Intent and its status, and the Número de Cuenta arrives on the account's event stream.">]>;
|
|
738
|
+
/** A proposal to close a Cuenta Vista, born waiting for an Approval. See {@link IntentCreateSchema}. */
|
|
739
|
+
export declare const AccountClosureIntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
740
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
741
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
742
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
743
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
744
|
+
}, undefined>, v.DescriptionAction<{
|
|
745
|
+
type: "account_key";
|
|
746
|
+
accountKey: string;
|
|
747
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
748
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
749
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
750
|
+
}, undefined>, v.DescriptionAction<{
|
|
751
|
+
type: "account";
|
|
752
|
+
id: string;
|
|
753
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
754
|
+
type: "account_key";
|
|
755
|
+
accountKey: string;
|
|
756
|
+
} | {
|
|
757
|
+
type: "account";
|
|
758
|
+
id: string;
|
|
759
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
760
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
761
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
762
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
763
|
+
}, undefined>, v.DescriptionAction<{
|
|
764
|
+
value: string;
|
|
765
|
+
editable: boolean;
|
|
766
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
767
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
768
|
+
} & {
|
|
769
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
770
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
771
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
772
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
773
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
774
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
775
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
776
|
+
}, undefined>, v.DescriptionAction<{
|
|
777
|
+
type: "account_key";
|
|
778
|
+
accountKey: string;
|
|
779
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
780
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
781
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
782
|
+
}, undefined>, v.DescriptionAction<{
|
|
783
|
+
type: "account";
|
|
784
|
+
id: string;
|
|
785
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
786
|
+
type: "account_key";
|
|
787
|
+
accountKey: string;
|
|
788
|
+
} | {
|
|
789
|
+
type: "account";
|
|
790
|
+
id: string;
|
|
791
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
792
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
793
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
794
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
795
|
+
}, undefined>, v.DescriptionAction<{
|
|
796
|
+
value: string;
|
|
797
|
+
editable: boolean;
|
|
798
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
799
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
800
|
+
} & {
|
|
801
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
802
|
+
readonly expires_at: v.StringSchema<undefined>;
|
|
803
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
804
|
+
type: "account_closure";
|
|
805
|
+
account: {
|
|
806
|
+
type: "account_key";
|
|
807
|
+
accountKey: string;
|
|
808
|
+
} | {
|
|
809
|
+
type: "account";
|
|
810
|
+
id: string;
|
|
811
|
+
};
|
|
812
|
+
note?: {
|
|
813
|
+
value: string;
|
|
814
|
+
editable: boolean;
|
|
815
|
+
} | undefined;
|
|
816
|
+
metadata: {
|
|
817
|
+
[x: string]: unknown;
|
|
818
|
+
};
|
|
819
|
+
expires_in: string;
|
|
820
|
+
expires_at?: undefined;
|
|
232
821
|
} | {
|
|
233
822
|
type: "account_closure";
|
|
234
823
|
account: {
|
|
@@ -238,8 +827,6 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
238
827
|
type: "account";
|
|
239
828
|
id: string;
|
|
240
829
|
};
|
|
241
|
-
expires_in?: string | undefined;
|
|
242
|
-
expires_at?: string | undefined;
|
|
243
830
|
note?: {
|
|
244
831
|
value: string;
|
|
245
832
|
editable: boolean;
|
|
@@ -247,94 +834,156 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
247
834
|
metadata: {
|
|
248
835
|
[x: string]: unknown;
|
|
249
836
|
};
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
837
|
+
expires_in?: undefined;
|
|
838
|
+
expires_at: string;
|
|
839
|
+
}, "The `application/json` half of closing a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `DELETE` because everything with banking consequence happens through an Intent. It carries no amount, no source and no destination -- only a reference to the account it closes.">]>;
|
|
840
|
+
/**
|
|
841
|
+
* Public creation validation shared by the API and SDK. SQL resolves deadlines and enforces authorization.
|
|
842
|
+
*
|
|
843
|
+
* This is the `application/json` half of the creation contract: an Intent born waiting for an
|
|
844
|
+
* Approval, where a `null` means a person will choose. The `application/jwt` half is
|
|
845
|
+
* {@link SignedIntentSchema}, and the two are separate schemas rather than one with optional fields
|
|
846
|
+
* on purpose — when signed and unsigned members share an object, something eventually reads the
|
|
847
|
+
* wrong ones.
|
|
848
|
+
*
|
|
849
|
+
* `transfer` is the only way money movement is expressed: money leaving an account towards a
|
|
850
|
+
* `destination`, both named in the `bank_transfer` matcher vocabulary (`account_key`, `account`,
|
|
851
|
+
* `external`). A null `source` is the confirmation screen's source picker, and a null `destination` is
|
|
852
|
+
* the screen's destination form: the person completes where the money goes (another bank's account, or
|
|
853
|
+
* another Andco customer's), and the server checks what she wrote against the Grant's `destinations`
|
|
854
|
+
* when she confirms. Both are the screen's when omitted. A destination the request does name is locked
|
|
855
|
+
* there (`editable: true` is refused), and so is the amount unless it says `editable: true`, in which
|
|
856
|
+
* case the person sets it. Who may approve the Intent without a person belongs to the Grant, never to
|
|
857
|
+
* the operation itself.
|
|
858
|
+
*
|
|
859
|
+
* @example
|
|
860
|
+
* parseIntentInput({
|
|
861
|
+
* type: "transfer", expires_in: "30 minutes", source: null,
|
|
862
|
+
* destination: { type: "account_key", accountKey: "proveedores" },
|
|
863
|
+
* amount: { currency: "CLP", value: "40000" },
|
|
864
|
+
* note: { value: "Factura 42", editable: true },
|
|
865
|
+
* });
|
|
866
|
+
*
|
|
867
|
+
* @example
|
|
868
|
+
* // The person picks both accounts on Andco's confirmation screen.
|
|
869
|
+
* parseIntentInput({
|
|
870
|
+
* type: "transfer", expires_in: "30 minutes", source: null, destination: null,
|
|
871
|
+
* amount: { currency: "CLP", value: "40000", editable: true },
|
|
872
|
+
* });
|
|
873
|
+
*
|
|
874
|
+
* `account_opening` is here for the same reason money movement is: everything with banking
|
|
875
|
+
* consequence happens through an Intent, so `/accounts` has no `POST`. It carries no amount, no
|
|
876
|
+
* source and no destination — only the name the account will answer to, and whether naming one that
|
|
877
|
+
* already exists is an error or a request for the account that is already there.
|
|
878
|
+
*/
|
|
879
|
+
export declare const IntentCreateSchema: v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
880
|
+
readonly type: v.LiteralSchema<"deposit", undefined>;
|
|
881
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
882
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
883
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
884
|
+
}, undefined>, v.DescriptionAction<{
|
|
885
|
+
type: "account_key";
|
|
886
|
+
accountKey: string;
|
|
887
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
888
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
889
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
890
|
+
}, undefined>, v.DescriptionAction<{
|
|
891
|
+
type: "account";
|
|
892
|
+
id: string;
|
|
893
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
253
894
|
type: "account_key";
|
|
254
895
|
accountKey: string;
|
|
255
896
|
} | {
|
|
256
897
|
type: "account";
|
|
257
898
|
id: string;
|
|
258
|
-
}
|
|
259
|
-
|
|
899
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, v.DescriptionAction<{
|
|
900
|
+
type: "account_key";
|
|
901
|
+
accountKey: string;
|
|
902
|
+
} | {
|
|
903
|
+
type: "account";
|
|
904
|
+
id: string;
|
|
905
|
+
} | undefined, "The account of the Grant's subject the money lands on. Omitted, the Grant's `bank_deposit` destinations must admit exactly one active account, or the request fails with `deposit_destination_ambiguous`; named, it must be one of them, or the request fails with `invalid_destination`.">]>;
|
|
906
|
+
readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
907
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
908
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
909
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
910
|
+
}, undefined>, v.DescriptionAction<{
|
|
260
911
|
currency: "CLP";
|
|
261
912
|
value: string;
|
|
262
913
|
editable: boolean;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
editable: boolean;
|
|
269
|
-
} | undefined;
|
|
270
|
-
metadata: {
|
|
271
|
-
[x: string]: unknown;
|
|
272
|
-
};
|
|
273
|
-
} | {
|
|
274
|
-
type: "transfer";
|
|
275
|
-
expires_at?: string | null | undefined;
|
|
276
|
-
amount: {
|
|
277
|
-
currency: "CLP";
|
|
914
|
+
}, "The amount a deposit asks for. `editable: true` lets the payer change it on the screen. It is never what moved: a deposit answers that in `progress.credited`.">]>, undefined>;
|
|
915
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
916
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
917
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
918
|
+
}, undefined>, v.DescriptionAction<{
|
|
278
919
|
value: string;
|
|
279
920
|
editable: boolean;
|
|
280
|
-
};
|
|
281
|
-
|
|
921
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
922
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
923
|
+
} & {
|
|
924
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
925
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
926
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
927
|
+
readonly type: v.LiteralSchema<"deposit", undefined>;
|
|
928
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
929
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
930
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
931
|
+
}, undefined>, v.DescriptionAction<{
|
|
282
932
|
type: "account_key";
|
|
283
933
|
accountKey: string;
|
|
284
|
-
}
|
|
934
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
935
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
936
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
937
|
+
}, undefined>, v.DescriptionAction<{
|
|
285
938
|
type: "account";
|
|
286
939
|
id: string;
|
|
287
|
-
}
|
|
288
|
-
destination: {
|
|
289
|
-
editable: false;
|
|
940
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
290
941
|
type: "account_key";
|
|
291
942
|
accountKey: string;
|
|
292
943
|
} | {
|
|
293
|
-
editable: false;
|
|
294
944
|
type: "account";
|
|
295
945
|
id: string;
|
|
946
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, v.DescriptionAction<{
|
|
947
|
+
type: "account_key";
|
|
948
|
+
accountKey: string;
|
|
296
949
|
} | {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
note?: {
|
|
950
|
+
type: "account";
|
|
951
|
+
id: string;
|
|
952
|
+
} | undefined, "The account of the Grant's subject the money lands on. Omitted, the Grant's `bank_deposit` destinations must admit exactly one active account, or the request fails with `deposit_destination_ambiguous`; named, it must be one of them, or the request fails with `invalid_destination`.">]>;
|
|
953
|
+
readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
954
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
955
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
956
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
957
|
+
}, undefined>, v.DescriptionAction<{
|
|
958
|
+
currency: "CLP";
|
|
307
959
|
value: string;
|
|
308
960
|
editable: boolean;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
type: "account_opening";
|
|
315
|
-
expires_at?: string | null | undefined;
|
|
316
|
-
accountKey: string;
|
|
317
|
-
name?: string | undefined;
|
|
318
|
-
upsert: boolean;
|
|
319
|
-
expires_in?: string | undefined;
|
|
320
|
-
note?: {
|
|
961
|
+
}, "The amount a deposit asks for. `editable: true` lets the payer change it on the screen. It is never what moved: a deposit answers that in `progress.credited`.">]>, undefined>;
|
|
962
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
963
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
964
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
965
|
+
}, undefined>, v.DescriptionAction<{
|
|
321
966
|
value: string;
|
|
322
967
|
editable: boolean;
|
|
323
|
-
}
|
|
324
|
-
metadata: {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
968
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
969
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
970
|
+
} & {
|
|
971
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
972
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
973
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
974
|
+
type: "deposit";
|
|
975
|
+
destination?: {
|
|
330
976
|
type: "account_key";
|
|
331
977
|
accountKey: string;
|
|
332
978
|
} | {
|
|
333
979
|
type: "account";
|
|
334
980
|
id: string;
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
|
|
981
|
+
} | undefined;
|
|
982
|
+
amount?: {
|
|
983
|
+
currency: "CLP";
|
|
984
|
+
value: string;
|
|
985
|
+
editable: boolean;
|
|
986
|
+
} | undefined;
|
|
338
987
|
note?: {
|
|
339
988
|
value: string;
|
|
340
989
|
editable: boolean;
|
|
@@ -342,7 +991,9 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
342
991
|
metadata: {
|
|
343
992
|
[x: string]: unknown;
|
|
344
993
|
};
|
|
345
|
-
|
|
994
|
+
expires_in: string;
|
|
995
|
+
expires_at?: undefined;
|
|
996
|
+
} | {
|
|
346
997
|
type: "deposit";
|
|
347
998
|
destination?: {
|
|
348
999
|
type: "account_key";
|
|
@@ -356,8 +1007,6 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
356
1007
|
value: string;
|
|
357
1008
|
editable: boolean;
|
|
358
1009
|
} | undefined;
|
|
359
|
-
expires_at?: string | null | undefined;
|
|
360
|
-
expires_in?: string | undefined;
|
|
361
1010
|
note?: {
|
|
362
1011
|
value: string;
|
|
363
1012
|
editable: boolean;
|
|
@@ -365,22 +1014,61 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
365
1014
|
metadata: {
|
|
366
1015
|
[x: string]: unknown;
|
|
367
1016
|
};
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
1017
|
+
expires_in?: undefined;
|
|
1018
|
+
expires_at: string | null;
|
|
1019
|
+
}, "The `application/json` half of collecting money into an account of the Grant's subject: an Intent born waiting for a payer. Exactly one of `expires_in` and `expires_at`; `expires_at: null` (never expires) only when `amount` is omitted.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
1020
|
+
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
1021
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1022
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
1023
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1024
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1025
|
+
}, undefined>, v.DescriptionAction<{
|
|
372
1026
|
currency: "CLP";
|
|
373
1027
|
value: string;
|
|
374
1028
|
editable: boolean;
|
|
375
|
-
};
|
|
376
|
-
source: {
|
|
1029
|
+
}, "The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
|
|
1030
|
+
readonly source: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1031
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1032
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1033
|
+
}, undefined>, v.DescriptionAction<{
|
|
1034
|
+
type: "account_key";
|
|
1035
|
+
accountKey: string;
|
|
1036
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1037
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1038
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1039
|
+
}, undefined>, v.DescriptionAction<{
|
|
1040
|
+
type: "account";
|
|
1041
|
+
id: string;
|
|
1042
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
377
1043
|
type: "account_key";
|
|
378
1044
|
accountKey: string;
|
|
379
1045
|
} | {
|
|
380
1046
|
type: "account";
|
|
381
1047
|
id: string;
|
|
382
|
-
}
|
|
383
|
-
|
|
1048
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, null>, v.DescriptionAction<{
|
|
1049
|
+
type: "account_key";
|
|
1050
|
+
accountKey: string;
|
|
1051
|
+
} | {
|
|
1052
|
+
type: "account";
|
|
1053
|
+
id: string;
|
|
1054
|
+
} | null, "The Andco account the money leaves. Null leaves that choice to a person on a screen.">]>;
|
|
1055
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
1056
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
1057
|
+
readonly type: v.LiteralSchema<"account_key", undefined>;
|
|
1058
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1059
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1060
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
1061
|
+
readonly type: v.LiteralSchema<"account", undefined>;
|
|
1062
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1063
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1064
|
+
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
1065
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
1066
|
+
readonly bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1067
|
+
readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
1068
|
+
readonly account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1069
|
+
readonly holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1070
|
+
readonly holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
1071
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
384
1072
|
editable: false;
|
|
385
1073
|
type: "account_key";
|
|
386
1074
|
accountKey: string;
|
|
@@ -396,88 +1084,71 @@ export declare const IntentCreateSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
396
1084
|
account_id: string;
|
|
397
1085
|
holder_id: string;
|
|
398
1086
|
holder_name: string;
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
note?: {
|
|
402
|
-
value: string;
|
|
403
|
-
editable: boolean;
|
|
404
|
-
} | undefined;
|
|
405
|
-
metadata: {
|
|
406
|
-
[x: string]: unknown;
|
|
407
|
-
};
|
|
408
|
-
} | {
|
|
409
|
-
type: "account_opening";
|
|
410
|
-
expires_at?: string | null | undefined;
|
|
411
|
-
accountKey: string;
|
|
412
|
-
name?: string | undefined;
|
|
413
|
-
upsert: boolean;
|
|
414
|
-
expires_in?: string | undefined;
|
|
415
|
-
note?: {
|
|
416
|
-
value: string;
|
|
417
|
-
editable: boolean;
|
|
418
|
-
} | undefined;
|
|
419
|
-
metadata: {
|
|
420
|
-
[x: string]: unknown;
|
|
421
|
-
};
|
|
422
|
-
} | {
|
|
423
|
-
type: "account_closure";
|
|
424
|
-
account: {
|
|
1087
|
+
}, "Where a transfer's money lands when it is named, in the request and in the answered Intent alike. A named destination is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `destination: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a destination the person completed on the screen, which is locked once she confirms.">]>, undefined>, null>, v.DescriptionAction<{
|
|
1088
|
+
editable: false;
|
|
425
1089
|
type: "account_key";
|
|
426
1090
|
accountKey: string;
|
|
427
1091
|
} | {
|
|
1092
|
+
editable: false;
|
|
428
1093
|
type: "account";
|
|
429
1094
|
id: string;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
1095
|
+
} | {
|
|
1096
|
+
editable: false;
|
|
1097
|
+
type: "external";
|
|
1098
|
+
bank_id: string;
|
|
1099
|
+
account_type: "checking" | "debit" | "savings";
|
|
1100
|
+
account_id: string;
|
|
1101
|
+
holder_id: string;
|
|
1102
|
+
holder_name: string;
|
|
1103
|
+
} | null, "Where the money lands. Null leaves it to a person on the screen, within the Grant's destinations.">]>;
|
|
1104
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1105
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
1106
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1107
|
+
}, undefined>, v.DescriptionAction<{
|
|
434
1108
|
value: string;
|
|
435
1109
|
editable: boolean;
|
|
436
|
-
}
|
|
437
|
-
metadata: {
|
|
438
|
-
[x: string]: unknown;
|
|
439
|
-
};
|
|
440
|
-
}, "metadata_too_large">]>;
|
|
441
|
-
/** Validated Intent creation payload inferred from the public schema. */
|
|
442
|
-
export type IntentCreate = v.InferOutput<typeof IntentCreateSchema>;
|
|
443
|
-
/** Returns validation issues without throwing across the HTTP boundary. */
|
|
444
|
-
export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
445
|
-
readonly type: v.LiteralSchema<"deposit", undefined>;
|
|
446
|
-
readonly destination: v.OptionalSchema<v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
447
|
-
type: v.LiteralSchema<"account_key", undefined>;
|
|
448
|
-
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
449
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
450
|
-
type: v.LiteralSchema<"account", undefined>;
|
|
451
|
-
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
452
|
-
}, undefined>], undefined>, undefined>;
|
|
453
|
-
readonly amount: v.OptionalSchema<v.StrictObjectSchema<{
|
|
454
|
-
currency: v.LiteralSchema<"CLP", undefined>;
|
|
455
|
-
value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.CheckAction<string, undefined>]>;
|
|
456
|
-
editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
457
|
-
}, undefined>, undefined>;
|
|
458
|
-
readonly expires_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_datetime">]>, undefined>, undefined>;
|
|
459
|
-
readonly expires_in: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_interval">]>, undefined>;
|
|
460
|
-
readonly note: v.OptionalSchema<v.StrictObjectSchema<{
|
|
461
|
-
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.CheckAction<string, "note_too_long">]>;
|
|
462
|
-
readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
463
|
-
}, undefined>, undefined>;
|
|
1110
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
464
1111
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1112
|
+
} & {
|
|
1113
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
1114
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
465
1115
|
}, undefined>, v.StrictObjectSchema<{
|
|
466
1116
|
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
467
|
-
readonly
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
1117
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1118
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
1119
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1120
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1121
|
+
}, undefined>, v.DescriptionAction<{
|
|
1122
|
+
currency: "CLP";
|
|
1123
|
+
value: string;
|
|
1124
|
+
editable: boolean;
|
|
1125
|
+
}, "The amount a transfer proposes. `editable: true` lets the person who confirms set the amount on Andco's confirmation screen, and `value` is the initial proposal shown there; the amount must fall within the Grant's `transactions.minimum` and `transactions.maximum` and not exceed the available balance. Without `editable` (or with `false`) the amount is locked. What moved is `settled`.">]>;
|
|
1126
|
+
readonly source: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
474
1127
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
475
1128
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
476
|
-
}, undefined>, v.
|
|
1129
|
+
}, undefined>, v.DescriptionAction<{
|
|
1130
|
+
type: "account_key";
|
|
1131
|
+
accountKey: string;
|
|
1132
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
477
1133
|
type: v.LiteralSchema<"account", undefined>;
|
|
478
1134
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
479
|
-
}, undefined
|
|
480
|
-
|
|
1135
|
+
}, undefined>, v.DescriptionAction<{
|
|
1136
|
+
type: "account";
|
|
1137
|
+
id: string;
|
|
1138
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
1139
|
+
type: "account_key";
|
|
1140
|
+
accountKey: string;
|
|
1141
|
+
} | {
|
|
1142
|
+
type: "account";
|
|
1143
|
+
id: string;
|
|
1144
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>, undefined>, null>, v.DescriptionAction<{
|
|
1145
|
+
type: "account_key";
|
|
1146
|
+
accountKey: string;
|
|
1147
|
+
} | {
|
|
1148
|
+
type: "account";
|
|
1149
|
+
id: string;
|
|
1150
|
+
} | null, "The Andco account the money leaves. Null leaves that choice to a person on a screen.">]>;
|
|
1151
|
+
readonly destination: v.SchemaWithPipe<readonly [v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
481
1152
|
readonly editable: v.OptionalSchema<v.LiteralSchema<false, undefined>, false>;
|
|
482
1153
|
readonly type: v.LiteralSchema<"account_key", undefined>;
|
|
483
1154
|
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
@@ -492,81 +1163,24 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
492
1163
|
readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
493
1164
|
readonly account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
494
1165
|
readonly holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
495
|
-
readonly holder_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.
|
|
496
|
-
}, undefined>], undefined
|
|
497
|
-
|
|
498
|
-
readonly note: v.OptionalSchema<v.StrictObjectSchema<{
|
|
499
|
-
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.CheckAction<string, "note_too_long">]>;
|
|
500
|
-
readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
501
|
-
}, undefined>, undefined>;
|
|
502
|
-
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
503
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
504
|
-
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
505
|
-
readonly expires_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_datetime">]>, undefined>, undefined>;
|
|
506
|
-
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
507
|
-
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, undefined>;
|
|
508
|
-
readonly upsert: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
509
|
-
readonly expires_in: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_interval">]>, undefined>;
|
|
510
|
-
readonly note: v.OptionalSchema<v.StrictObjectSchema<{
|
|
511
|
-
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.CheckAction<string, "note_too_long">]>;
|
|
512
|
-
readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
513
|
-
}, undefined>, undefined>;
|
|
514
|
-
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
515
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
516
|
-
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
517
|
-
readonly account: v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
518
|
-
type: v.LiteralSchema<"account_key", undefined>;
|
|
519
|
-
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
520
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
521
|
-
type: v.LiteralSchema<"account", undefined>;
|
|
522
|
-
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
523
|
-
}, undefined>], undefined>;
|
|
524
|
-
readonly expires_in: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_interval">]>, undefined>;
|
|
525
|
-
readonly expires_at: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_datetime">]>, undefined>;
|
|
526
|
-
readonly note: v.OptionalSchema<v.StrictObjectSchema<{
|
|
527
|
-
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.CheckAction<string, "note_too_long">]>;
|
|
528
|
-
readonly editable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
529
|
-
}, undefined>, undefined>;
|
|
530
|
-
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
531
|
-
}, undefined>], undefined>, v.CheckAction<{
|
|
532
|
-
type: "deposit";
|
|
533
|
-
destination?: {
|
|
1166
|
+
readonly holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
1167
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
1168
|
+
editable: false;
|
|
534
1169
|
type: "account_key";
|
|
535
1170
|
accountKey: string;
|
|
536
1171
|
} | {
|
|
1172
|
+
editable: false;
|
|
537
1173
|
type: "account";
|
|
538
1174
|
id: string;
|
|
539
|
-
} | undefined;
|
|
540
|
-
amount?: {
|
|
541
|
-
currency: "CLP";
|
|
542
|
-
value: string;
|
|
543
|
-
editable: boolean;
|
|
544
|
-
} | undefined;
|
|
545
|
-
expires_at?: string | null | undefined;
|
|
546
|
-
expires_in?: string | undefined;
|
|
547
|
-
note?: {
|
|
548
|
-
value: string;
|
|
549
|
-
editable: boolean;
|
|
550
|
-
} | undefined;
|
|
551
|
-
metadata: {
|
|
552
|
-
[x: string]: unknown;
|
|
553
|
-
};
|
|
554
|
-
} | {
|
|
555
|
-
type: "transfer";
|
|
556
|
-
expires_at?: string | null | undefined;
|
|
557
|
-
amount: {
|
|
558
|
-
currency: "CLP";
|
|
559
|
-
value: string;
|
|
560
|
-
editable: boolean;
|
|
561
|
-
};
|
|
562
|
-
source: {
|
|
563
|
-
type: "account_key";
|
|
564
|
-
accountKey: string;
|
|
565
1175
|
} | {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
1176
|
+
editable: false;
|
|
1177
|
+
type: "external";
|
|
1178
|
+
bank_id: string;
|
|
1179
|
+
account_type: "checking" | "debit" | "savings";
|
|
1180
|
+
account_id: string;
|
|
1181
|
+
holder_id: string;
|
|
1182
|
+
holder_name: string;
|
|
1183
|
+
}, "Where a transfer's money lands when it is named, in the request and in the answered Intent alike. A named destination is always locked on the confirmation screen: `editable` only admits `false`, and `editable: true` fails at creation with `invalid_request`. To let the person choose where the money goes, the request says `destination: null` instead (`TransferIntentCreate`). Defaults to false in a request; an answered Intent always states it, including a destination the person completed on the screen, which is locked once she confirms.">]>, undefined>, null>, v.DescriptionAction<{
|
|
570
1184
|
editable: false;
|
|
571
1185
|
type: "account_key";
|
|
572
1186
|
accountKey: string;
|
|
@@ -582,63 +1196,49 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
582
1196
|
account_id: string;
|
|
583
1197
|
holder_id: string;
|
|
584
1198
|
holder_name: string;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
|
|
1199
|
+
} | null, "Where the money lands. Null leaves it to a person on the screen, within the Grant's destinations.">]>;
|
|
1200
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1201
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
1202
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1203
|
+
}, undefined>, v.DescriptionAction<{
|
|
588
1204
|
value: string;
|
|
589
1205
|
editable: boolean;
|
|
590
|
-
}
|
|
591
|
-
metadata: {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
upsert: boolean;
|
|
600
|
-
expires_in?: string | undefined;
|
|
601
|
-
note?: {
|
|
1206
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
1207
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1208
|
+
} & {
|
|
1209
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1210
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1211
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
1212
|
+
type: "transfer";
|
|
1213
|
+
amount: {
|
|
1214
|
+
currency: "CLP";
|
|
602
1215
|
value: string;
|
|
603
1216
|
editable: boolean;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
[x: string]: unknown;
|
|
607
|
-
};
|
|
608
|
-
} | {
|
|
609
|
-
type: "account_closure";
|
|
610
|
-
account: {
|
|
1217
|
+
};
|
|
1218
|
+
source: {
|
|
611
1219
|
type: "account_key";
|
|
612
1220
|
accountKey: string;
|
|
613
1221
|
} | {
|
|
614
1222
|
type: "account";
|
|
615
1223
|
id: string;
|
|
616
|
-
};
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
note?: {
|
|
620
|
-
value: string;
|
|
621
|
-
editable: boolean;
|
|
622
|
-
} | undefined;
|
|
623
|
-
metadata: {
|
|
624
|
-
[x: string]: unknown;
|
|
625
|
-
};
|
|
626
|
-
}, "exactly_one_expiration_required">, v.CheckAction<{
|
|
627
|
-
type: "deposit";
|
|
628
|
-
destination?: {
|
|
1224
|
+
} | null;
|
|
1225
|
+
destination: {
|
|
1226
|
+
editable: false;
|
|
629
1227
|
type: "account_key";
|
|
630
1228
|
accountKey: string;
|
|
631
1229
|
} | {
|
|
1230
|
+
editable: false;
|
|
632
1231
|
type: "account";
|
|
633
1232
|
id: string;
|
|
634
|
-
} |
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
1233
|
+
} | {
|
|
1234
|
+
editable: false;
|
|
1235
|
+
type: "external";
|
|
1236
|
+
bank_id: string;
|
|
1237
|
+
account_type: "checking" | "debit" | "savings";
|
|
1238
|
+
account_id: string;
|
|
1239
|
+
holder_id: string;
|
|
1240
|
+
holder_name: string;
|
|
1241
|
+
} | null;
|
|
642
1242
|
note?: {
|
|
643
1243
|
value: string;
|
|
644
1244
|
editable: boolean;
|
|
@@ -646,9 +1246,10 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
646
1246
|
metadata: {
|
|
647
1247
|
[x: string]: unknown;
|
|
648
1248
|
};
|
|
1249
|
+
expires_in: string;
|
|
1250
|
+
expires_at?: undefined;
|
|
649
1251
|
} | {
|
|
650
1252
|
type: "transfer";
|
|
651
|
-
expires_at?: string | null | undefined;
|
|
652
1253
|
amount: {
|
|
653
1254
|
currency: "CLP";
|
|
654
1255
|
value: string;
|
|
@@ -677,8 +1278,7 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
677
1278
|
account_id: string;
|
|
678
1279
|
holder_id: string;
|
|
679
1280
|
holder_name: string;
|
|
680
|
-
};
|
|
681
|
-
expires_in?: string | undefined;
|
|
1281
|
+
} | null;
|
|
682
1282
|
note?: {
|
|
683
1283
|
value: string;
|
|
684
1284
|
editable: boolean;
|
|
@@ -686,13 +1286,45 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
686
1286
|
metadata: {
|
|
687
1287
|
[x: string]: unknown;
|
|
688
1288
|
};
|
|
689
|
-
|
|
1289
|
+
expires_in?: undefined;
|
|
1290
|
+
expires_at: string | null;
|
|
1291
|
+
}, "The `application/json` half of creating a transfer: an Intent born waiting for an Approval. A null `source` is the confirmation screen, where a person picks the account the money leaves from among the Grant's sources, and a null `destination` is the screen too: the person completes where the money goes (the bank, the type and number of the account, and its holder's RUT and name), and the server checks what she wrote against the Grant's `destinations` when she confirms, refusing one outside them with `invalid_destination`. Both default to null when omitted. A destination the request names is locked on the screen (`editable: true` is an `invalid_request`), and the amount is too unless `amount.editable` is true, in which case the person sets it. The `application/jwt` half is `SignedTransferIntentClaims`, and the two are separate schemas rather than one with optional fields on purpose: when signed and unsigned members share an object, something eventually reads the wrong ones.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
1292
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
1293
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1294
|
+
readonly name: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "The display label the account opens with. Mutable afterwards, and read by no permission.">]>;
|
|
1295
|
+
readonly upsert: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Whether naming an AccountKey that already exists answers with that account instead of failing. It defaults to false, so one name never quietly becomes two accounts.">]>;
|
|
1296
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1297
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
1298
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1299
|
+
}, undefined>, v.DescriptionAction<{
|
|
1300
|
+
value: string;
|
|
1301
|
+
editable: boolean;
|
|
1302
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
1303
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1304
|
+
} & {
|
|
1305
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
1306
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1307
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1308
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
1309
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1310
|
+
readonly name: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "The display label the account opens with. Mutable afterwards, and read by no permission.">]>;
|
|
1311
|
+
readonly upsert: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Whether naming an AccountKey that already exists answers with that account instead of failing. It defaults to false, so one name never quietly becomes two accounts.">]>;
|
|
1312
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1313
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
1314
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1315
|
+
}, undefined>, v.DescriptionAction<{
|
|
1316
|
+
value: string;
|
|
1317
|
+
editable: boolean;
|
|
1318
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
1319
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1320
|
+
} & {
|
|
1321
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1322
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1323
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
690
1324
|
type: "account_opening";
|
|
691
|
-
expires_at?: string | null | undefined;
|
|
692
1325
|
accountKey: string;
|
|
693
1326
|
name?: string | undefined;
|
|
694
1327
|
upsert: boolean;
|
|
695
|
-
expires_in?: string | undefined;
|
|
696
1328
|
note?: {
|
|
697
1329
|
value: string;
|
|
698
1330
|
editable: boolean;
|
|
@@ -700,17 +1332,13 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
700
1332
|
metadata: {
|
|
701
1333
|
[x: string]: unknown;
|
|
702
1334
|
};
|
|
1335
|
+
expires_in: string;
|
|
1336
|
+
expires_at?: undefined;
|
|
703
1337
|
} | {
|
|
704
|
-
type: "
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
} | {
|
|
709
|
-
type: "account";
|
|
710
|
-
id: string;
|
|
711
|
-
};
|
|
712
|
-
expires_in?: string | undefined;
|
|
713
|
-
expires_at?: string | undefined;
|
|
1338
|
+
type: "account_opening";
|
|
1339
|
+
accountKey: string;
|
|
1340
|
+
name?: string | undefined;
|
|
1341
|
+
upsert: boolean;
|
|
714
1342
|
note?: {
|
|
715
1343
|
value: string;
|
|
716
1344
|
editable: boolean;
|
|
@@ -718,76 +1346,81 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
718
1346
|
metadata: {
|
|
719
1347
|
[x: string]: unknown;
|
|
720
1348
|
};
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1349
|
+
expires_in?: undefined;
|
|
1350
|
+
expires_at: string | null;
|
|
1351
|
+
}, "The `application/json` half of opening a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `POST` because everything with banking consequence happens through an Intent, and an opening carries no amount, no source and no destination -- only the name the account will answer to. Opening is asynchronous: the answer is the Intent and its status, and the Número de Cuenta arrives on the account's event stream.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
1352
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
1353
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1354
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1355
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1356
|
+
}, undefined>, v.DescriptionAction<{
|
|
1357
|
+
type: "account_key";
|
|
1358
|
+
accountKey: string;
|
|
1359
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1360
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1361
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1362
|
+
}, undefined>, v.DescriptionAction<{
|
|
1363
|
+
type: "account";
|
|
1364
|
+
id: string;
|
|
1365
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
724
1366
|
type: "account_key";
|
|
725
1367
|
accountKey: string;
|
|
726
1368
|
} | {
|
|
727
1369
|
type: "account";
|
|
728
1370
|
id: string;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
} | undefined;
|
|
735
|
-
expires_at?: string | null | undefined;
|
|
736
|
-
expires_in?: string | undefined;
|
|
737
|
-
note?: {
|
|
738
|
-
value: string;
|
|
739
|
-
editable: boolean;
|
|
740
|
-
} | undefined;
|
|
741
|
-
metadata: {
|
|
742
|
-
[x: string]: unknown;
|
|
743
|
-
};
|
|
744
|
-
} | {
|
|
745
|
-
type: "transfer";
|
|
746
|
-
expires_at?: string | null | undefined;
|
|
747
|
-
amount: {
|
|
748
|
-
currency: "CLP";
|
|
1371
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1372
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1373
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
1374
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1375
|
+
}, undefined>, v.DescriptionAction<{
|
|
749
1376
|
value: string;
|
|
750
1377
|
editable: boolean;
|
|
751
|
-
};
|
|
752
|
-
|
|
1378
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
1379
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1380
|
+
} & {
|
|
1381
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
1382
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1383
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1384
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
1385
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1386
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1387
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1388
|
+
}, undefined>, v.DescriptionAction<{
|
|
753
1389
|
type: "account_key";
|
|
754
1390
|
accountKey: string;
|
|
755
|
-
}
|
|
1391
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1392
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1393
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1394
|
+
}, undefined>, v.DescriptionAction<{
|
|
756
1395
|
type: "account";
|
|
757
1396
|
id: string;
|
|
758
|
-
}
|
|
759
|
-
destination: {
|
|
760
|
-
editable: false;
|
|
1397
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
761
1398
|
type: "account_key";
|
|
762
1399
|
accountKey: string;
|
|
763
1400
|
} | {
|
|
764
|
-
editable: false;
|
|
765
1401
|
type: "account";
|
|
766
1402
|
id: string;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
account_id: string;
|
|
773
|
-
holder_id: string;
|
|
774
|
-
holder_name: string;
|
|
775
|
-
};
|
|
776
|
-
expires_in?: string | undefined;
|
|
777
|
-
note?: {
|
|
1403
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1404
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1405
|
+
readonly value: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.DescriptionAction<string, "Trimmed bank reference. An empty reference is allowed.">]>;
|
|
1406
|
+
readonly editable: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BooleanSchema<undefined>, false>, v.DescriptionAction<boolean, "Defaults to false when omitted.">]>;
|
|
1407
|
+
}, undefined>, v.DescriptionAction<{
|
|
778
1408
|
value: string;
|
|
779
1409
|
editable: boolean;
|
|
780
|
-
}
|
|
781
|
-
metadata: {
|
|
782
|
-
|
|
1410
|
+
}, "The bank reference a request asks for. `editable: true` lets the person who confirms change it; each bank operation freezes its own final note at confirmation.">]>, undefined>;
|
|
1411
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1412
|
+
} & {
|
|
1413
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1414
|
+
readonly expires_at: v.StringSchema<undefined>;
|
|
1415
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
1416
|
+
type: "account_closure";
|
|
1417
|
+
account: {
|
|
1418
|
+
type: "account_key";
|
|
1419
|
+
accountKey: string;
|
|
1420
|
+
} | {
|
|
1421
|
+
type: "account";
|
|
1422
|
+
id: string;
|
|
783
1423
|
};
|
|
784
|
-
} | {
|
|
785
|
-
type: "account_opening";
|
|
786
|
-
expires_at?: string | null | undefined;
|
|
787
|
-
accountKey: string;
|
|
788
|
-
name?: string | undefined;
|
|
789
|
-
upsert: boolean;
|
|
790
|
-
expires_in?: string | undefined;
|
|
791
1424
|
note?: {
|
|
792
1425
|
value: string;
|
|
793
1426
|
editable: boolean;
|
|
@@ -795,6 +1428,8 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
795
1428
|
metadata: {
|
|
796
1429
|
[x: string]: unknown;
|
|
797
1430
|
};
|
|
1431
|
+
expires_in: string;
|
|
1432
|
+
expires_at?: undefined;
|
|
798
1433
|
} | {
|
|
799
1434
|
type: "account_closure";
|
|
800
1435
|
account: {
|
|
@@ -804,8 +1439,6 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
804
1439
|
type: "account";
|
|
805
1440
|
id: string;
|
|
806
1441
|
};
|
|
807
|
-
expires_in?: string | undefined;
|
|
808
|
-
expires_at?: string | undefined;
|
|
809
1442
|
note?: {
|
|
810
1443
|
value: string;
|
|
811
1444
|
editable: boolean;
|
|
@@ -813,109 +1446,215 @@ export declare function safeParseIntentCreate(input: unknown): v.SafeParseResult
|
|
|
813
1446
|
metadata: {
|
|
814
1447
|
[x: string]: unknown;
|
|
815
1448
|
};
|
|
816
|
-
|
|
1449
|
+
expires_in?: undefined;
|
|
1450
|
+
expires_at: string;
|
|
1451
|
+
}, "The `application/json` half of closing a Cuenta Vista: an Intent born waiting for an Approval. `/accounts` has no `DELETE` because everything with banking consequence happens through an Intent. It carries no amount, no source and no destination -- only a reference to the account it closes.">]>], undefined>;
|
|
1452
|
+
/** Validated Intent creation payload inferred from the public schema. */
|
|
1453
|
+
export type IntentCreate = v.InferOutput<typeof IntentCreateSchema>;
|
|
1454
|
+
/** The longest note, in Unicode code points: what PostgreSQL and JSON Schema's `maxLength` count. */
|
|
1455
|
+
export declare const NOTE_MAX_LENGTH = 140;
|
|
1456
|
+
/** The longest reason of a Cancellation or a Rejection, in Unicode code points. */
|
|
1457
|
+
export declare const REASON_MAX_LENGTH = 280;
|
|
1458
|
+
/** The longest name of an account, in Unicode code points. */
|
|
1459
|
+
export declare const ACCOUNT_NAME_MAX_LENGTH = 80;
|
|
1460
|
+
/** The longest name of an external account's holder, in Unicode code points. */
|
|
1461
|
+
export declare const HOLDER_NAME_MAX_LENGTH = 256;
|
|
1462
|
+
/** The largest `metadata`, in characters of its JSON. */
|
|
1463
|
+
export declare const METADATA_MAX_LENGTH = 16384;
|
|
817
1464
|
/**
|
|
818
|
-
* The
|
|
1465
|
+
* The rules of an Intent proposal that JSON Schema does not say, over an input that already has its
|
|
1466
|
+
* shape ({@link IntentCreateSchema}). Each issue carries its public code in `type`:
|
|
819
1467
|
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
* `
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
* instruction may be *submitted*; the Intent expiration bounds how long the Intent may be approved
|
|
830
|
-
* and executed. They are different deadlines, and because every value a signed transfer uses has to
|
|
831
|
-
* come from inside the signature, the second one cannot arrive in a header or a query string.
|
|
1468
|
+
* - `invalid_expiration_interval`: `expires_in` is not a whole number of seconds, minutes, hours or days.
|
|
1469
|
+
* - `invalid_expiration_datetime`: `expires_at` is not a real calendar datetime with a timezone.
|
|
1470
|
+
* - `note_too_long`: the note has more than {@link NOTE_MAX_LENGTH} code points.
|
|
1471
|
+
* - `name_too_long`: an account opening's `name` has more than {@link ACCOUNT_NAME_MAX_LENGTH} code points.
|
|
1472
|
+
* - `holder_name_too_long`: an external destination's `holder_name` has more than
|
|
1473
|
+
* {@link HOLDER_NAME_MAX_LENGTH} code points.
|
|
1474
|
+
* - `passive_deposit_requires_no_target`: a deposit that never expires names an amount; only a
|
|
1475
|
+
* deposit with a target must expire.
|
|
1476
|
+
* - `metadata_too_large`: `metadata` is longer than {@link METADATA_MAX_LENGTH} characters of JSON.
|
|
832
1477
|
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
835
|
-
*
|
|
836
|
-
|
|
837
|
-
|
|
1478
|
+
* @example
|
|
1479
|
+
* const shaped = v.safeParse(IntentCreateSchema, input);
|
|
1480
|
+
* if (shaped.success) console.log(intentInputIssues(shaped.output).map((issue) => issue.type));
|
|
1481
|
+
*/
|
|
1482
|
+
export declare function intentInputIssues(input: IntentCreate): Issue[];
|
|
1483
|
+
/**
|
|
1484
|
+
* Parses an Intent proposal: its shape ({@link IntentCreateSchema}) and then its rules
|
|
1485
|
+
* ({@link intentInputIssues}). The server does the same, so an application only needs this to
|
|
1486
|
+
* answer a form before sending; the SDK sends without it.
|
|
838
1487
|
*
|
|
839
1488
|
* @example
|
|
840
|
-
* const
|
|
841
|
-
*
|
|
1489
|
+
* const parsed = parseIntentInput({
|
|
1490
|
+
* type: "transfer", expires_in: "30 minutes", source: null,
|
|
1491
|
+
* destination: { type: "account_key", accountKey: "proveedores" },
|
|
1492
|
+
* amount: { currency: "CLP", value: "40000" },
|
|
1493
|
+
* note: { value: "Factura 42", editable: true },
|
|
1494
|
+
* });
|
|
1495
|
+
* if (!parsed.success) console.log(parsed.issues.map((issue) => issue.type)); // e.g. ["note_too_long"]
|
|
842
1496
|
*/
|
|
843
|
-
export declare
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
readonly jti: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
847
|
-
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
848
|
-
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
849
|
-
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1497
|
+
export declare function parseIntentInput(input: unknown): ParseResult<IntentCreate>;
|
|
1498
|
+
/** The verified claims of a Signed Instruction that moves money. See {@link SignedIntentSchema}. */
|
|
1499
|
+
export declare const SignedTransferIntentClaimsSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
850
1500
|
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
851
|
-
readonly source: v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
1501
|
+
readonly source: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
852
1502
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
853
1503
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
854
|
-
}, undefined>, v.
|
|
1504
|
+
}, undefined>, v.DescriptionAction<{
|
|
1505
|
+
type: "account_key";
|
|
1506
|
+
accountKey: string;
|
|
1507
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
855
1508
|
type: v.LiteralSchema<"account", undefined>;
|
|
856
1509
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
857
|
-
}, undefined
|
|
858
|
-
|
|
1510
|
+
}, undefined>, v.DescriptionAction<{
|
|
1511
|
+
type: "account";
|
|
1512
|
+
id: string;
|
|
1513
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
1514
|
+
type: "account_key";
|
|
1515
|
+
accountKey: string;
|
|
1516
|
+
} | {
|
|
1517
|
+
type: "account";
|
|
1518
|
+
id: string;
|
|
1519
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1520
|
+
readonly destination: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
859
1521
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
860
1522
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
861
|
-
}, undefined>, v.
|
|
1523
|
+
}, undefined>, v.DescriptionAction<{
|
|
1524
|
+
type: "account_key";
|
|
1525
|
+
accountKey: string;
|
|
1526
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
862
1527
|
type: v.LiteralSchema<"account", undefined>;
|
|
863
1528
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
864
|
-
}, undefined>, v.
|
|
1529
|
+
}, undefined>, v.DescriptionAction<{
|
|
1530
|
+
type: "account";
|
|
1531
|
+
id: string;
|
|
1532
|
+
}, "One Andco account, named by its identifier.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
865
1533
|
type: v.LiteralSchema<"external", undefined>;
|
|
866
1534
|
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
867
1535
|
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
868
1536
|
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
869
1537
|
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
870
|
-
holder_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.
|
|
871
|
-
}, undefined
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1538
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
1539
|
+
}, undefined>, v.DescriptionAction<{
|
|
1540
|
+
type: "external";
|
|
1541
|
+
bank_id: string;
|
|
1542
|
+
account_type: "checking" | "debit" | "savings";
|
|
1543
|
+
account_id: string;
|
|
1544
|
+
holder_id: string;
|
|
1545
|
+
holder_name: string;
|
|
1546
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>], undefined>, v.DescriptionAction<{
|
|
1547
|
+
type: "account_key";
|
|
1548
|
+
accountKey: string;
|
|
1549
|
+
} | {
|
|
1550
|
+
type: "account";
|
|
1551
|
+
id: string;
|
|
1552
|
+
} | {
|
|
1553
|
+
type: "external";
|
|
1554
|
+
bank_id: string;
|
|
1555
|
+
account_type: "checking" | "debit" | "savings";
|
|
1556
|
+
account_id: string;
|
|
1557
|
+
holder_id: string;
|
|
1558
|
+
holder_name: string;
|
|
1559
|
+
}, "Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank.">]>;
|
|
1560
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1561
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
1562
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1563
|
+
}, undefined>, v.DescriptionAction<{
|
|
1564
|
+
currency: "CLP";
|
|
1565
|
+
value: string;
|
|
1566
|
+
}, "The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change.">]>;
|
|
1567
|
+
readonly note: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.DescriptionAction<string | undefined, "A plain bank reference; a Signed Instruction proposes nothing.">]>;
|
|
881
1568
|
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
882
1569
|
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
883
|
-
readonly jti: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1570
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
884
1571
|
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
885
1572
|
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
886
1573
|
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
887
|
-
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
888
|
-
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
889
|
-
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 80, undefined>]>, undefined>;
|
|
890
|
-
readonly upsert: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
891
|
-
readonly expires_in: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_interval">]>, undefined>;
|
|
892
|
-
readonly expires_at: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_datetime">]>, undefined>, undefined>;
|
|
893
1574
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1575
|
+
} & {
|
|
1576
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
1577
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
894
1578
|
}, undefined>, v.StrictObjectSchema<{
|
|
1579
|
+
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
1580
|
+
readonly source: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1581
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1582
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1583
|
+
}, undefined>, v.DescriptionAction<{
|
|
1584
|
+
type: "account_key";
|
|
1585
|
+
accountKey: string;
|
|
1586
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1587
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1588
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1589
|
+
}, undefined>, v.DescriptionAction<{
|
|
1590
|
+
type: "account";
|
|
1591
|
+
id: string;
|
|
1592
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
1593
|
+
type: "account_key";
|
|
1594
|
+
accountKey: string;
|
|
1595
|
+
} | {
|
|
1596
|
+
type: "account";
|
|
1597
|
+
id: string;
|
|
1598
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1599
|
+
readonly destination: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1600
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1601
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1602
|
+
}, undefined>, v.DescriptionAction<{
|
|
1603
|
+
type: "account_key";
|
|
1604
|
+
accountKey: string;
|
|
1605
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1606
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1607
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1608
|
+
}, undefined>, v.DescriptionAction<{
|
|
1609
|
+
type: "account";
|
|
1610
|
+
id: string;
|
|
1611
|
+
}, "One Andco account, named by its identifier.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1612
|
+
type: v.LiteralSchema<"external", undefined>;
|
|
1613
|
+
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1614
|
+
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
1615
|
+
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1616
|
+
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1617
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
1618
|
+
}, undefined>, v.DescriptionAction<{
|
|
1619
|
+
type: "external";
|
|
1620
|
+
bank_id: string;
|
|
1621
|
+
account_type: "checking" | "debit" | "savings";
|
|
1622
|
+
account_id: string;
|
|
1623
|
+
holder_id: string;
|
|
1624
|
+
holder_name: string;
|
|
1625
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>], undefined>, v.DescriptionAction<{
|
|
1626
|
+
type: "account_key";
|
|
1627
|
+
accountKey: string;
|
|
1628
|
+
} | {
|
|
1629
|
+
type: "account";
|
|
1630
|
+
id: string;
|
|
1631
|
+
} | {
|
|
1632
|
+
type: "external";
|
|
1633
|
+
bank_id: string;
|
|
1634
|
+
account_type: "checking" | "debit" | "savings";
|
|
1635
|
+
account_id: string;
|
|
1636
|
+
holder_id: string;
|
|
1637
|
+
holder_name: string;
|
|
1638
|
+
}, "Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank.">]>;
|
|
1639
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1640
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
1641
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1642
|
+
}, undefined>, v.DescriptionAction<{
|
|
1643
|
+
currency: "CLP";
|
|
1644
|
+
value: string;
|
|
1645
|
+
}, "The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change.">]>;
|
|
1646
|
+
readonly note: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.DescriptionAction<string | undefined, "A plain bank reference; a Signed Instruction proposes nothing.">]>;
|
|
895
1647
|
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
896
1648
|
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
897
|
-
readonly jti: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1649
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
898
1650
|
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
899
1651
|
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
900
1652
|
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
901
|
-
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
902
|
-
readonly account: v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
903
|
-
type: v.LiteralSchema<"account_key", undefined>;
|
|
904
|
-
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
905
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
906
|
-
type: v.LiteralSchema<"account", undefined>;
|
|
907
|
-
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
908
|
-
}, undefined>], undefined>;
|
|
909
|
-
readonly expires_in: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_interval">]>, undefined>;
|
|
910
|
-
readonly expires_at: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_datetime">]>, undefined>;
|
|
911
1653
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
exp: number;
|
|
917
|
-
iat?: number | undefined;
|
|
918
|
-
nbf?: number | undefined;
|
|
1654
|
+
} & {
|
|
1655
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1656
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1657
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
919
1658
|
type: "transfer";
|
|
920
1659
|
source: {
|
|
921
1660
|
type: "account_key";
|
|
@@ -942,55 +1681,19 @@ export declare const SignedIntentSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
942
1681
|
currency: "CLP";
|
|
943
1682
|
value: string;
|
|
944
1683
|
};
|
|
945
|
-
expires_in?: string | undefined;
|
|
946
|
-
expires_at?: string | null | undefined;
|
|
947
1684
|
note?: string | undefined;
|
|
948
|
-
metadata: {
|
|
949
|
-
[x: string]: unknown;
|
|
950
|
-
};
|
|
951
|
-
} | {
|
|
952
1685
|
iss: string;
|
|
953
1686
|
aud: "https://api.andco.com";
|
|
954
1687
|
jti: string;
|
|
955
1688
|
exp: number;
|
|
956
1689
|
iat?: number | undefined;
|
|
957
1690
|
nbf?: number | undefined;
|
|
958
|
-
type: "account_opening";
|
|
959
|
-
accountKey: string;
|
|
960
|
-
name?: string | undefined;
|
|
961
|
-
upsert: boolean;
|
|
962
|
-
expires_in?: string | undefined;
|
|
963
|
-
expires_at?: string | null | undefined;
|
|
964
1691
|
metadata: {
|
|
965
1692
|
[x: string]: unknown;
|
|
966
1693
|
};
|
|
1694
|
+
expires_in: string;
|
|
1695
|
+
expires_at?: undefined;
|
|
967
1696
|
} | {
|
|
968
|
-
iss: string;
|
|
969
|
-
aud: "https://api.andco.com";
|
|
970
|
-
jti: string;
|
|
971
|
-
exp: number;
|
|
972
|
-
iat?: number | undefined;
|
|
973
|
-
nbf?: number | undefined;
|
|
974
|
-
type: "account_closure";
|
|
975
|
-
account: {
|
|
976
|
-
type: "account_key";
|
|
977
|
-
accountKey: string;
|
|
978
|
-
} | {
|
|
979
|
-
type: "account";
|
|
980
|
-
id: string;
|
|
981
|
-
};
|
|
982
|
-
expires_in?: string | undefined;
|
|
983
|
-
expires_at?: string | undefined;
|
|
984
|
-
metadata: {
|
|
985
|
-
[x: string]: unknown;
|
|
986
|
-
};
|
|
987
|
-
}, "exactly_one_expiration_required">, v.CheckAction<{
|
|
988
|
-
iss: string;
|
|
989
|
-
aud: "https://api.andco.com";
|
|
990
|
-
jti: string;
|
|
991
|
-
exp: number;
|
|
992
|
-
iat?: number | undefined;
|
|
993
|
-
nbf?: number | undefined;
|
|
994
1697
|
type: "transfer";
|
|
995
1698
|
source: {
|
|
996
1699
|
type: "account_key";
|
|
@@ -1017,35 +1720,167 @@ export declare const SignedIntentSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
1017
1720
|
currency: "CLP";
|
|
1018
1721
|
value: string;
|
|
1019
1722
|
};
|
|
1020
|
-
expires_in?: string | undefined;
|
|
1021
|
-
expires_at?: string | null | undefined;
|
|
1022
1723
|
note?: string | undefined;
|
|
1724
|
+
iss: string;
|
|
1725
|
+
aud: "https://api.andco.com";
|
|
1726
|
+
jti: string;
|
|
1727
|
+
exp: number;
|
|
1728
|
+
iat?: number | undefined;
|
|
1729
|
+
nbf?: number | undefined;
|
|
1023
1730
|
metadata: {
|
|
1024
1731
|
[x: string]: unknown;
|
|
1025
1732
|
};
|
|
1026
|
-
|
|
1733
|
+
expires_in?: undefined;
|
|
1734
|
+
expires_at: string | null;
|
|
1735
|
+
}, "The verified claims of a Signed Instruction, sent to the same endpoint as `application/jwt`. Nothing here is optional that the transfer needs and nothing here is editable: an instruction that does not say where the money comes from or where it goes is not signable, so `source` and `destination` are required (and neither may be `null`: there is no screen on this path to complete it) and the amount carries no `editable`. `note` is a plain reference for the same reason -- there is no screen on this path, so there is nobody to propose it to. When a signature is present, every value the transfer uses comes from these claims and none from the envelope carrying them. `exp` bounds how long the instruction may be submitted; `expires_in` or `expires_at` bounds how long the Intent may be approved and executed. They are different deadlines.">]>;
|
|
1736
|
+
/** The verified claims of a Signed Instruction that opens an account. See {@link SignedIntentSchema}. */
|
|
1737
|
+
export declare const SignedAccountOpeningIntentClaimsSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
1738
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
1739
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1740
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
1741
|
+
readonly upsert: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1742
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1743
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
1744
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
1745
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
1746
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1747
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1748
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1749
|
+
} & {
|
|
1750
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
1751
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1752
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1753
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
1754
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1755
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
1756
|
+
readonly upsert: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
1757
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1758
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
1759
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
1760
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
1761
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1762
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1763
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1764
|
+
} & {
|
|
1765
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1766
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1767
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
1768
|
+
type: "account_opening";
|
|
1769
|
+
accountKey: string;
|
|
1770
|
+
name?: string | undefined;
|
|
1771
|
+
upsert: boolean;
|
|
1027
1772
|
iss: string;
|
|
1028
1773
|
aud: "https://api.andco.com";
|
|
1029
1774
|
jti: string;
|
|
1030
1775
|
exp: number;
|
|
1031
1776
|
iat?: number | undefined;
|
|
1032
1777
|
nbf?: number | undefined;
|
|
1778
|
+
metadata: {
|
|
1779
|
+
[x: string]: unknown;
|
|
1780
|
+
};
|
|
1781
|
+
expires_in: string;
|
|
1782
|
+
expires_at?: undefined;
|
|
1783
|
+
} | {
|
|
1033
1784
|
type: "account_opening";
|
|
1034
1785
|
accountKey: string;
|
|
1035
1786
|
name?: string | undefined;
|
|
1036
1787
|
upsert: boolean;
|
|
1037
|
-
|
|
1038
|
-
|
|
1788
|
+
iss: string;
|
|
1789
|
+
aud: "https://api.andco.com";
|
|
1790
|
+
jti: string;
|
|
1791
|
+
exp: number;
|
|
1792
|
+
iat?: number | undefined;
|
|
1793
|
+
nbf?: number | undefined;
|
|
1039
1794
|
metadata: {
|
|
1040
1795
|
[x: string]: unknown;
|
|
1041
1796
|
};
|
|
1042
|
-
|
|
1797
|
+
expires_in?: undefined;
|
|
1798
|
+
expires_at: string | null;
|
|
1799
|
+
}, "The verified claims of a Signed Instruction that opens an account. `upsert` lives here and nowhere else: it decides whether naming an AccountKey that already exists is a refusal or a request for the account already carrying it, which is a difference in what the instruction *orders*. Carried as a transport option, anybody holding the signed instruction could flip it, and what executed would not be what was signed.">]>;
|
|
1800
|
+
/** The verified claims of a Signed Instruction that closes an account. See {@link SignedIntentSchema}. */
|
|
1801
|
+
export declare const SignedAccountClosureIntentClaimsSchema: v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
1802
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
1803
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1804
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1805
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1806
|
+
}, undefined>, v.DescriptionAction<{
|
|
1807
|
+
type: "account_key";
|
|
1808
|
+
accountKey: string;
|
|
1809
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1810
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1811
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1812
|
+
}, undefined>, v.DescriptionAction<{
|
|
1813
|
+
type: "account";
|
|
1814
|
+
id: string;
|
|
1815
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
1816
|
+
type: "account_key";
|
|
1817
|
+
accountKey: string;
|
|
1818
|
+
} | {
|
|
1819
|
+
type: "account";
|
|
1820
|
+
id: string;
|
|
1821
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1822
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1823
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
1824
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
1825
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
1826
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1827
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1828
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1829
|
+
} & {
|
|
1830
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
1831
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1832
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1833
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
1834
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1835
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1836
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1837
|
+
}, undefined>, v.DescriptionAction<{
|
|
1838
|
+
type: "account_key";
|
|
1839
|
+
accountKey: string;
|
|
1840
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1841
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1842
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1843
|
+
}, undefined>, v.DescriptionAction<{
|
|
1844
|
+
type: "account";
|
|
1845
|
+
id: string;
|
|
1846
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
1847
|
+
type: "account_key";
|
|
1848
|
+
accountKey: string;
|
|
1849
|
+
} | {
|
|
1850
|
+
type: "account";
|
|
1851
|
+
id: string;
|
|
1852
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1853
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1854
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
1855
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
1856
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
1857
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1858
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1859
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1860
|
+
} & {
|
|
1861
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
1862
|
+
readonly expires_at: v.StringSchema<undefined>;
|
|
1863
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
1864
|
+
type: "account_closure";
|
|
1865
|
+
account: {
|
|
1866
|
+
type: "account_key";
|
|
1867
|
+
accountKey: string;
|
|
1868
|
+
} | {
|
|
1869
|
+
type: "account";
|
|
1870
|
+
id: string;
|
|
1871
|
+
};
|
|
1043
1872
|
iss: string;
|
|
1044
1873
|
aud: "https://api.andco.com";
|
|
1045
1874
|
jti: string;
|
|
1046
1875
|
exp: number;
|
|
1047
1876
|
iat?: number | undefined;
|
|
1048
1877
|
nbf?: number | undefined;
|
|
1878
|
+
metadata: {
|
|
1879
|
+
[x: string]: unknown;
|
|
1880
|
+
};
|
|
1881
|
+
expires_in: string;
|
|
1882
|
+
expires_at?: undefined;
|
|
1883
|
+
} | {
|
|
1049
1884
|
type: "account_closure";
|
|
1050
1885
|
account: {
|
|
1051
1886
|
type: "account_key";
|
|
@@ -1054,157 +1889,204 @@ export declare const SignedIntentSchema: v.SchemaWithPipe<readonly [v.VariantSch
|
|
|
1054
1889
|
type: "account";
|
|
1055
1890
|
id: string;
|
|
1056
1891
|
};
|
|
1057
|
-
|
|
1058
|
-
|
|
1892
|
+
iss: string;
|
|
1893
|
+
aud: "https://api.andco.com";
|
|
1894
|
+
jti: string;
|
|
1895
|
+
exp: number;
|
|
1896
|
+
iat?: number | undefined;
|
|
1897
|
+
nbf?: number | undefined;
|
|
1059
1898
|
metadata: {
|
|
1060
1899
|
[x: string]: unknown;
|
|
1061
1900
|
};
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1901
|
+
expires_in?: undefined;
|
|
1902
|
+
expires_at: string;
|
|
1903
|
+
}, "The verified claims of a Signed Instruction that closes an account. `account` is required and never editable: an instruction that does not say which account it closes is not signable.">]>;
|
|
1065
1904
|
/**
|
|
1066
|
-
*
|
|
1067
|
-
* A Cancellation is the creator withdrawing its own request: only the client that created the
|
|
1068
|
-
* Intent may cancel it. An approver declining it is a Rejection ({@link IntentRejectionSchema}).
|
|
1905
|
+
* The verified claims of a Signed Instruction: the `application/jwt` half of the same creation.
|
|
1069
1906
|
*
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
}, undefined>;
|
|
1076
|
-
/** A required reason, 1–280 characters, naming why an Intent was cancelled. */
|
|
1077
|
-
export type IntentCancellation = v.InferOutput<typeof IntentCancellationSchema>;
|
|
1078
|
-
/** Returns validation issues for a cancellation reason without throwing across the HTTP boundary. */
|
|
1079
|
-
export declare function safeParseIntentCancellation(input: unknown): v.SafeParseResult<v.StrictObjectSchema<{
|
|
1080
|
-
readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.CheckAction<string, "reason_too_long">]>;
|
|
1081
|
-
}, undefined>>;
|
|
1082
|
-
/**
|
|
1083
|
-
* Rejecting names why. A Rejection is an approver declining an Intent with a Grant holding the
|
|
1084
|
-
* family's `reject` action (`bank_transfer` for a transfer); the audit keeps it apart from a
|
|
1085
|
-
* Cancellation, which is the creator withdrawing its own request.
|
|
1907
|
+
* Nothing here is optional that the transfer needs and nothing here is editable. An instruction that
|
|
1908
|
+
* does not say where the money comes from or where it goes is not signable, so `source` and
|
|
1909
|
+
* `destination` are required (a `null` for either is refused: there is no screen on this path to
|
|
1910
|
+
* complete it) and the amount carries no `editable`. `note` is a plain reference for the same reason:
|
|
1911
|
+
* there is nobody to propose it to.
|
|
1086
1912
|
*
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
*/
|
|
1090
|
-
export declare const IntentRejectionSchema: v.StrictObjectSchema<{
|
|
1091
|
-
readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.CheckAction<string, "reason_too_long">]>;
|
|
1092
|
-
}, undefined>;
|
|
1093
|
-
/** A required reason, 1–280 characters, naming why an approver rejected an Intent. */
|
|
1094
|
-
export type IntentRejection = v.InferOutput<typeof IntentRejectionSchema>;
|
|
1095
|
-
/** Returns validation issues for a rejection reason without throwing across the HTTP boundary. */
|
|
1096
|
-
export declare function safeParseIntentRejection(input: unknown): v.SafeParseResult<v.StrictObjectSchema<{
|
|
1097
|
-
readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.CheckAction<string, "reason_too_long">]>;
|
|
1098
|
-
}, undefined>>;
|
|
1099
|
-
/**
|
|
1100
|
-
* Error codes an Intent's Approval lifecycle answers with, beyond the generic transport codes.
|
|
1913
|
+
* There is no `org_id`: the subject is the one of the Grant behind the access token that submits the
|
|
1914
|
+
* instruction, and nothing inside the signature may name another.
|
|
1101
1915
|
*
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1104
|
-
*
|
|
1916
|
+
* The expiration is present on this side too, and it is not `exp`. `exp` bounds how long the
|
|
1917
|
+
* instruction may be *submitted*; the Intent expiration bounds how long the Intent may be approved
|
|
1918
|
+
* and executed. They are different deadlines, and because every value a signed transfer uses has to
|
|
1919
|
+
* come from inside the signature, the second one cannot arrive in a header or a query string.
|
|
1920
|
+
*
|
|
1921
|
+
* `account_opening` is signed on the same terms, and `upsert` is the reason it matters here. The
|
|
1922
|
+
* flag decides whether naming an Account Key that already exists is a refusal or a request for the
|
|
1923
|
+
* account already carrying it, which is a difference in what the instruction *orders*. Carried as a
|
|
1924
|
+
* transport option — a header, a query parameter, a field beside the assertion — anybody holding the
|
|
1925
|
+
* signed instruction could flip it, and the order executed would not be the order signed.
|
|
1926
|
+
*
|
|
1927
|
+
* @example
|
|
1928
|
+
* const claims = parseSignedIntentInput(verification.claims);
|
|
1929
|
+
* if (claims.success && claims.output.type === "transfer") console.log(claims.output.jti, claims.output.amount.value);
|
|
1105
1930
|
*/
|
|
1106
|
-
export declare const
|
|
1107
|
-
|
|
1108
|
-
readonly
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1931
|
+
export declare const SignedIntentSchema: v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
1932
|
+
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
1933
|
+
readonly source: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1934
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1935
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1936
|
+
}, undefined>, v.DescriptionAction<{
|
|
1937
|
+
type: "account_key";
|
|
1938
|
+
accountKey: string;
|
|
1939
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1940
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1941
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1942
|
+
}, undefined>, v.DescriptionAction<{
|
|
1943
|
+
type: "account";
|
|
1944
|
+
id: string;
|
|
1945
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
1946
|
+
type: "account_key";
|
|
1947
|
+
accountKey: string;
|
|
1948
|
+
} | {
|
|
1949
|
+
type: "account";
|
|
1950
|
+
id: string;
|
|
1951
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
1952
|
+
readonly destination: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1953
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
1954
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1955
|
+
}, undefined>, v.DescriptionAction<{
|
|
1956
|
+
type: "account_key";
|
|
1957
|
+
accountKey: string;
|
|
1958
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1959
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
1960
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1961
|
+
}, undefined>, v.DescriptionAction<{
|
|
1962
|
+
type: "account";
|
|
1963
|
+
id: string;
|
|
1964
|
+
}, "One Andco account, named by its identifier.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1965
|
+
type: v.LiteralSchema<"external", undefined>;
|
|
1966
|
+
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1967
|
+
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
1968
|
+
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1969
|
+
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1970
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
1971
|
+
}, undefined>, v.DescriptionAction<{
|
|
1972
|
+
type: "external";
|
|
1973
|
+
bank_id: string;
|
|
1974
|
+
account_type: "checking" | "debit" | "savings";
|
|
1975
|
+
account_id: string;
|
|
1976
|
+
holder_id: string;
|
|
1977
|
+
holder_name: string;
|
|
1978
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>], undefined>, v.DescriptionAction<{
|
|
1979
|
+
type: "account_key";
|
|
1980
|
+
accountKey: string;
|
|
1981
|
+
} | {
|
|
1982
|
+
type: "account";
|
|
1983
|
+
id: string;
|
|
1984
|
+
} | {
|
|
1985
|
+
type: "external";
|
|
1986
|
+
bank_id: string;
|
|
1987
|
+
account_type: "checking" | "debit" | "savings";
|
|
1988
|
+
account_id: string;
|
|
1989
|
+
holder_id: string;
|
|
1990
|
+
holder_name: string;
|
|
1991
|
+
}, "Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank.">]>;
|
|
1992
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1993
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
1994
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1995
|
+
}, undefined>, v.DescriptionAction<{
|
|
1996
|
+
currency: "CLP";
|
|
1997
|
+
value: string;
|
|
1998
|
+
}, "The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change.">]>;
|
|
1999
|
+
readonly note: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.DescriptionAction<string | undefined, "A plain bank reference; a Signed Instruction proposes nothing.">]>;
|
|
1133
2000
|
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1134
2001
|
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
1135
|
-
readonly jti: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
2002
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
1136
2003
|
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
1137
2004
|
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1138
2005
|
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2006
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
2007
|
+
} & {
|
|
2008
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
2009
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2010
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
1139
2011
|
readonly type: v.LiteralSchema<"transfer", undefined>;
|
|
1140
|
-
readonly source: v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
2012
|
+
readonly source: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1141
2013
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
1142
2014
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1143
|
-
}, undefined>, v.
|
|
2015
|
+
}, undefined>, v.DescriptionAction<{
|
|
2016
|
+
type: "account_key";
|
|
2017
|
+
accountKey: string;
|
|
2018
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1144
2019
|
type: v.LiteralSchema<"account", undefined>;
|
|
1145
2020
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1146
|
-
}, undefined
|
|
1147
|
-
|
|
2021
|
+
}, undefined>, v.DescriptionAction<{
|
|
2022
|
+
type: "account";
|
|
2023
|
+
id: string;
|
|
2024
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
2025
|
+
type: "account_key";
|
|
2026
|
+
accountKey: string;
|
|
2027
|
+
} | {
|
|
2028
|
+
type: "account";
|
|
2029
|
+
id: string;
|
|
2030
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
2031
|
+
readonly destination: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1148
2032
|
type: v.LiteralSchema<"account_key", undefined>;
|
|
1149
2033
|
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1150
|
-
}, undefined>, v.
|
|
2034
|
+
}, undefined>, v.DescriptionAction<{
|
|
2035
|
+
type: "account_key";
|
|
2036
|
+
accountKey: string;
|
|
2037
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1151
2038
|
type: v.LiteralSchema<"account", undefined>;
|
|
1152
2039
|
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1153
|
-
}, undefined>, v.
|
|
2040
|
+
}, undefined>, v.DescriptionAction<{
|
|
2041
|
+
type: "account";
|
|
2042
|
+
id: string;
|
|
2043
|
+
}, "One Andco account, named by its identifier.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1154
2044
|
type: v.LiteralSchema<"external", undefined>;
|
|
1155
2045
|
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1156
2046
|
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
1157
2047
|
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1158
2048
|
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1159
|
-
holder_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.
|
|
1160
|
-
}, undefined
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
readonly
|
|
1182
|
-
|
|
1183
|
-
|
|
2049
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
2050
|
+
}, undefined>, v.DescriptionAction<{
|
|
2051
|
+
type: "external";
|
|
2052
|
+
bank_id: string;
|
|
2053
|
+
account_type: "checking" | "debit" | "savings";
|
|
2054
|
+
account_id: string;
|
|
2055
|
+
holder_id: string;
|
|
2056
|
+
holder_name: string;
|
|
2057
|
+
}, "One account at another Chilean bank, with every field a `bank_transfer` `external` matcher can fix, so the Grant's destinations are asked about exactly this account.">]>], undefined>, v.DescriptionAction<{
|
|
2058
|
+
type: "account_key";
|
|
2059
|
+
accountKey: string;
|
|
2060
|
+
} | {
|
|
2061
|
+
type: "account";
|
|
2062
|
+
id: string;
|
|
2063
|
+
} | {
|
|
2064
|
+
type: "external";
|
|
2065
|
+
bank_id: string;
|
|
2066
|
+
account_type: "checking" | "debit" | "savings";
|
|
2067
|
+
account_id: string;
|
|
2068
|
+
holder_id: string;
|
|
2069
|
+
holder_name: string;
|
|
2070
|
+
}, "Where a signed transfer's money lands, in the `bank_transfer` matcher vocabulary: an Andco account by AccountKey or identifier, or an account at another Chilean bank.">]>;
|
|
2071
|
+
readonly amount: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
2072
|
+
readonly currency: v.LiteralSchema<"CLP", undefined>;
|
|
2073
|
+
readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
2074
|
+
}, undefined>, v.DescriptionAction<{
|
|
2075
|
+
currency: "CLP";
|
|
2076
|
+
value: string;
|
|
2077
|
+
}, "The amount a Signed Instruction orders: the same `{ currency, value }` as a request, with nothing left for a person to change.">]>;
|
|
2078
|
+
readonly note: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.DescriptionAction<string | undefined, "A plain bank reference; a Signed Instruction proposes nothing.">]>;
|
|
1184
2079
|
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1185
2080
|
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
1186
|
-
readonly jti: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
2081
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
1187
2082
|
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
1188
2083
|
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1189
2084
|
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
1190
|
-
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
1191
|
-
readonly account: v.VariantSchema<"type", [v.StrictObjectSchema<{
|
|
1192
|
-
type: v.LiteralSchema<"account_key", undefined>;
|
|
1193
|
-
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1194
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
1195
|
-
type: v.LiteralSchema<"account", undefined>;
|
|
1196
|
-
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1197
|
-
}, undefined>], undefined>;
|
|
1198
|
-
readonly expires_in: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_interval">]>, undefined>;
|
|
1199
|
-
readonly expires_at: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "invalid_expiration_datetime">]>, undefined>;
|
|
1200
2085
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
exp: number;
|
|
1206
|
-
iat?: number | undefined;
|
|
1207
|
-
nbf?: number | undefined;
|
|
2086
|
+
} & {
|
|
2087
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2088
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
2089
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
1208
2090
|
type: "transfer";
|
|
1209
2091
|
source: {
|
|
1210
2092
|
type: "account_key";
|
|
@@ -1231,55 +2113,19 @@ export declare function safeParseSignedIntent(input: unknown): v.SafeParseResult
|
|
|
1231
2113
|
currency: "CLP";
|
|
1232
2114
|
value: string;
|
|
1233
2115
|
};
|
|
1234
|
-
expires_in?: string | undefined;
|
|
1235
|
-
expires_at?: string | null | undefined;
|
|
1236
2116
|
note?: string | undefined;
|
|
1237
|
-
metadata: {
|
|
1238
|
-
[x: string]: unknown;
|
|
1239
|
-
};
|
|
1240
|
-
} | {
|
|
1241
2117
|
iss: string;
|
|
1242
2118
|
aud: "https://api.andco.com";
|
|
1243
2119
|
jti: string;
|
|
1244
2120
|
exp: number;
|
|
1245
2121
|
iat?: number | undefined;
|
|
1246
2122
|
nbf?: number | undefined;
|
|
1247
|
-
type: "account_opening";
|
|
1248
|
-
accountKey: string;
|
|
1249
|
-
name?: string | undefined;
|
|
1250
|
-
upsert: boolean;
|
|
1251
|
-
expires_in?: string | undefined;
|
|
1252
|
-
expires_at?: string | null | undefined;
|
|
1253
2123
|
metadata: {
|
|
1254
2124
|
[x: string]: unknown;
|
|
1255
2125
|
};
|
|
2126
|
+
expires_in: string;
|
|
2127
|
+
expires_at?: undefined;
|
|
1256
2128
|
} | {
|
|
1257
|
-
iss: string;
|
|
1258
|
-
aud: "https://api.andco.com";
|
|
1259
|
-
jti: string;
|
|
1260
|
-
exp: number;
|
|
1261
|
-
iat?: number | undefined;
|
|
1262
|
-
nbf?: number | undefined;
|
|
1263
|
-
type: "account_closure";
|
|
1264
|
-
account: {
|
|
1265
|
-
type: "account_key";
|
|
1266
|
-
accountKey: string;
|
|
1267
|
-
} | {
|
|
1268
|
-
type: "account";
|
|
1269
|
-
id: string;
|
|
1270
|
-
};
|
|
1271
|
-
expires_in?: string | undefined;
|
|
1272
|
-
expires_at?: string | undefined;
|
|
1273
|
-
metadata: {
|
|
1274
|
-
[x: string]: unknown;
|
|
1275
|
-
};
|
|
1276
|
-
}, "exactly_one_expiration_required">, v.CheckAction<{
|
|
1277
|
-
iss: string;
|
|
1278
|
-
aud: "https://api.andco.com";
|
|
1279
|
-
jti: string;
|
|
1280
|
-
exp: number;
|
|
1281
|
-
iat?: number | undefined;
|
|
1282
|
-
nbf?: number | undefined;
|
|
1283
2129
|
type: "transfer";
|
|
1284
2130
|
source: {
|
|
1285
2131
|
type: "account_key";
|
|
@@ -1306,35 +2152,163 @@ export declare function safeParseSignedIntent(input: unknown): v.SafeParseResult
|
|
|
1306
2152
|
currency: "CLP";
|
|
1307
2153
|
value: string;
|
|
1308
2154
|
};
|
|
1309
|
-
expires_in?: string | undefined;
|
|
1310
|
-
expires_at?: string | null | undefined;
|
|
1311
2155
|
note?: string | undefined;
|
|
2156
|
+
iss: string;
|
|
2157
|
+
aud: "https://api.andco.com";
|
|
2158
|
+
jti: string;
|
|
2159
|
+
exp: number;
|
|
2160
|
+
iat?: number | undefined;
|
|
2161
|
+
nbf?: number | undefined;
|
|
1312
2162
|
metadata: {
|
|
1313
2163
|
[x: string]: unknown;
|
|
1314
2164
|
};
|
|
1315
|
-
|
|
2165
|
+
expires_in?: undefined;
|
|
2166
|
+
expires_at: string | null;
|
|
2167
|
+
}, "The verified claims of a Signed Instruction, sent to the same endpoint as `application/jwt`. Nothing here is optional that the transfer needs and nothing here is editable: an instruction that does not say where the money comes from or where it goes is not signable, so `source` and `destination` are required (and neither may be `null`: there is no screen on this path to complete it) and the amount carries no `editable`. `note` is a plain reference for the same reason -- there is no screen on this path, so there is nobody to propose it to. When a signature is present, every value the transfer uses comes from these claims and none from the envelope carrying them. `exp` bounds how long the instruction may be submitted; `expires_in` or `expires_at` bounds how long the Intent may be approved and executed. They are different deadlines.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
2168
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
2169
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
2170
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
2171
|
+
readonly upsert: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
2172
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
2173
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
2174
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
2175
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
2176
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2177
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2178
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
2179
|
+
} & {
|
|
2180
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
2181
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2182
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
2183
|
+
readonly type: v.LiteralSchema<"account_opening", undefined>;
|
|
2184
|
+
readonly accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
2185
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
2186
|
+
readonly upsert: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
2187
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
2188
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
2189
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
2190
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
2191
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2192
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2193
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
2194
|
+
} & {
|
|
2195
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2196
|
+
readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
2197
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
2198
|
+
type: "account_opening";
|
|
2199
|
+
accountKey: string;
|
|
2200
|
+
name?: string | undefined;
|
|
2201
|
+
upsert: boolean;
|
|
1316
2202
|
iss: string;
|
|
1317
2203
|
aud: "https://api.andco.com";
|
|
1318
2204
|
jti: string;
|
|
1319
2205
|
exp: number;
|
|
1320
2206
|
iat?: number | undefined;
|
|
1321
2207
|
nbf?: number | undefined;
|
|
2208
|
+
metadata: {
|
|
2209
|
+
[x: string]: unknown;
|
|
2210
|
+
};
|
|
2211
|
+
expires_in: string;
|
|
2212
|
+
expires_at?: undefined;
|
|
2213
|
+
} | {
|
|
1322
2214
|
type: "account_opening";
|
|
1323
2215
|
accountKey: string;
|
|
1324
2216
|
name?: string | undefined;
|
|
1325
2217
|
upsert: boolean;
|
|
1326
|
-
|
|
1327
|
-
|
|
2218
|
+
iss: string;
|
|
2219
|
+
aud: "https://api.andco.com";
|
|
2220
|
+
jti: string;
|
|
2221
|
+
exp: number;
|
|
2222
|
+
iat?: number | undefined;
|
|
2223
|
+
nbf?: number | undefined;
|
|
1328
2224
|
metadata: {
|
|
1329
2225
|
[x: string]: unknown;
|
|
1330
2226
|
};
|
|
1331
|
-
|
|
2227
|
+
expires_in?: undefined;
|
|
2228
|
+
expires_at: string | null;
|
|
2229
|
+
}, "The verified claims of a Signed Instruction that opens an account. `upsert` lives here and nowhere else: it decides whether naming an AccountKey that already exists is a refusal or a request for the account already carrying it, which is a difference in what the instruction *orders*. Carried as a transport option, anybody holding the signed instruction could flip it, and what executed would not be what was signed.">]>, v.SchemaWithPipe<readonly [v.VariantSchema<"expires_in", [v.StrictObjectSchema<{
|
|
2230
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
2231
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
2232
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
2233
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
2234
|
+
}, undefined>, v.DescriptionAction<{
|
|
2235
|
+
type: "account_key";
|
|
2236
|
+
accountKey: string;
|
|
2237
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
2238
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
2239
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
2240
|
+
}, undefined>, v.DescriptionAction<{
|
|
2241
|
+
type: "account";
|
|
2242
|
+
id: string;
|
|
2243
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
2244
|
+
type: "account_key";
|
|
2245
|
+
accountKey: string;
|
|
2246
|
+
} | {
|
|
2247
|
+
type: "account";
|
|
2248
|
+
id: string;
|
|
2249
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
2250
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
2251
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
2252
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
2253
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
2254
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2255
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2256
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
2257
|
+
} & {
|
|
2258
|
+
readonly expires_in: v.StringSchema<undefined>;
|
|
2259
|
+
readonly expires_at: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2260
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
2261
|
+
readonly type: v.LiteralSchema<"account_closure", undefined>;
|
|
2262
|
+
readonly account: v.SchemaWithPipe<readonly [v.VariantSchema<"type", [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
2263
|
+
type: v.LiteralSchema<"account_key", undefined>;
|
|
2264
|
+
accountKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
2265
|
+
}, undefined>, v.DescriptionAction<{
|
|
2266
|
+
type: "account_key";
|
|
2267
|
+
accountKey: string;
|
|
2268
|
+
}, "One Andco account of the Grant's subject, named by its Account Key.">]>, v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
2269
|
+
type: v.LiteralSchema<"account", undefined>;
|
|
2270
|
+
id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
2271
|
+
}, undefined>, v.DescriptionAction<{
|
|
2272
|
+
type: "account";
|
|
2273
|
+
id: string;
|
|
2274
|
+
}, "One Andco account, named by its identifier.">]>], undefined>, v.DescriptionAction<{
|
|
2275
|
+
type: "account_key";
|
|
2276
|
+
accountKey: string;
|
|
2277
|
+
} | {
|
|
2278
|
+
type: "account";
|
|
2279
|
+
id: string;
|
|
2280
|
+
}, "One Andco account of the Grant's subject, in the account matcher vocabulary: by Account Key (`{ type: \"account_key\", accountKey }`) or by identifier (`{ type: \"account\", id }`). It is where a transfer's money leaves from, where a deposit lands and the account a closure closes. An AccountKey is answered back as an AccountKey: it resolves to an account at execution.">]>;
|
|
2281
|
+
readonly iss: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
2282
|
+
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
2283
|
+
readonly jti: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>, v.DescriptionAction<string, "The idempotency key, inside the signature, reused verbatim when retrying.">]>;
|
|
2284
|
+
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
|
|
2285
|
+
readonly iat: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2286
|
+
readonly nbf: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
|
|
2287
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, {}>;
|
|
2288
|
+
} & {
|
|
2289
|
+
readonly expires_in: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2290
|
+
readonly expires_at: v.StringSchema<undefined>;
|
|
2291
|
+
}, undefined>], undefined>, v.DescriptionAction<{
|
|
2292
|
+
type: "account_closure";
|
|
2293
|
+
account: {
|
|
2294
|
+
type: "account_key";
|
|
2295
|
+
accountKey: string;
|
|
2296
|
+
} | {
|
|
2297
|
+
type: "account";
|
|
2298
|
+
id: string;
|
|
2299
|
+
};
|
|
1332
2300
|
iss: string;
|
|
1333
2301
|
aud: "https://api.andco.com";
|
|
1334
2302
|
jti: string;
|
|
1335
2303
|
exp: number;
|
|
1336
2304
|
iat?: number | undefined;
|
|
1337
2305
|
nbf?: number | undefined;
|
|
2306
|
+
metadata: {
|
|
2307
|
+
[x: string]: unknown;
|
|
2308
|
+
};
|
|
2309
|
+
expires_in: string;
|
|
2310
|
+
expires_at?: undefined;
|
|
2311
|
+
} | {
|
|
1338
2312
|
type: "account_closure";
|
|
1339
2313
|
account: {
|
|
1340
2314
|
type: "account_key";
|
|
@@ -1343,12 +2317,106 @@ export declare function safeParseSignedIntent(input: unknown): v.SafeParseResult
|
|
|
1343
2317
|
type: "account";
|
|
1344
2318
|
id: string;
|
|
1345
2319
|
};
|
|
1346
|
-
|
|
1347
|
-
|
|
2320
|
+
iss: string;
|
|
2321
|
+
aud: "https://api.andco.com";
|
|
2322
|
+
jti: string;
|
|
2323
|
+
exp: number;
|
|
2324
|
+
iat?: number | undefined;
|
|
2325
|
+
nbf?: number | undefined;
|
|
1348
2326
|
metadata: {
|
|
1349
2327
|
[x: string]: unknown;
|
|
1350
2328
|
};
|
|
1351
|
-
|
|
2329
|
+
expires_in?: undefined;
|
|
2330
|
+
expires_at: string;
|
|
2331
|
+
}, "The verified claims of a Signed Instruction that closes an account. `account` is required and never editable: an instruction that does not say which account it closes is not signable.">]>], undefined>;
|
|
2332
|
+
/** Validated signed Intent claims; schema parsing alone does not verify a signature. */
|
|
2333
|
+
export type SignedIntent = v.InferOutput<typeof SignedIntentSchema>;
|
|
2334
|
+
/**
|
|
2335
|
+
* The rules of a Signed Instruction's claims that JSON Schema does not say, over claims that already
|
|
2336
|
+
* have their shape ({@link SignedIntentSchema}): `invalid_expiration_interval`,
|
|
2337
|
+
* `invalid_expiration_datetime`, `note_too_long`, `name_too_long`, `holder_name_too_long` and
|
|
2338
|
+
* `metadata_too_large`, as in
|
|
2339
|
+
* {@link intentInputIssues}.
|
|
2340
|
+
*/
|
|
2341
|
+
export declare function signedIntentInputIssues(input: SignedIntent): Issue[];
|
|
2342
|
+
/**
|
|
2343
|
+
* Parses the verified claims of a Signed Instruction: their shape ({@link SignedIntentSchema}) and
|
|
2344
|
+
* then their rules ({@link signedIntentInputIssues}). Parsing never verifies a signature.
|
|
2345
|
+
*
|
|
2346
|
+
* @example
|
|
2347
|
+
* const claims = parseSignedIntentInput(verification.claims);
|
|
2348
|
+
* if (!claims.success) console.log(claims.issues.map((issue) => issue.type));
|
|
2349
|
+
*/
|
|
2350
|
+
export declare function parseSignedIntentInput(input: unknown): ParseResult<SignedIntent>;
|
|
2351
|
+
/**
|
|
2352
|
+
* The rule of a Cancellation's or a Rejection's reason that JSON Schema does not say in code points
|
|
2353
|
+
* the way the server counts them: `reason_too_long`, past {@link REASON_MAX_LENGTH}.
|
|
2354
|
+
*/
|
|
2355
|
+
export declare function intentDecisionIssues(input: {
|
|
2356
|
+
readonly reason: string;
|
|
2357
|
+
}): Issue[];
|
|
2358
|
+
/**
|
|
2359
|
+
* Cancelling names why, because an Intent that vanished without a reason is an unexplained gap.
|
|
2360
|
+
* A Cancellation is the creator withdrawing its own request: only the client that created the
|
|
2361
|
+
* Intent may cancel it. An approver declining it is a Rejection ({@link IntentRejectionSchema}).
|
|
2362
|
+
*
|
|
2363
|
+
* @example
|
|
2364
|
+
* parseIntentCancellation({ reason: "rejected_by_erp" });
|
|
2365
|
+
*/
|
|
2366
|
+
export declare const IntentCancellationSchema: v.StrictObjectSchema<{
|
|
2367
|
+
readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
2368
|
+
}, undefined>;
|
|
2369
|
+
/** A required reason, 1–280 code points, naming why an Intent was cancelled. */
|
|
2370
|
+
export type IntentCancellation = v.InferOutput<typeof IntentCancellationSchema>;
|
|
2371
|
+
/** Parses a cancellation: its shape and then {@link intentDecisionIssues}. */
|
|
2372
|
+
export declare function parseIntentCancellation(input: unknown): ParseResult<IntentCancellation>;
|
|
2373
|
+
/**
|
|
2374
|
+
* Rejecting names why. A Rejection is an approver declining an Intent with a Grant holding the
|
|
2375
|
+
* family's `reject` action (`bank_transfer` for a transfer); the audit keeps it apart from a
|
|
2376
|
+
* Cancellation, which is the creator withdrawing its own request.
|
|
2377
|
+
*
|
|
2378
|
+
* @example
|
|
2379
|
+
* parseIntentRejection({ reason: "duplicated_invoice" });
|
|
2380
|
+
*/
|
|
2381
|
+
export declare const IntentRejectionSchema: v.StrictObjectSchema<{
|
|
2382
|
+
readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
2383
|
+
}, undefined>;
|
|
2384
|
+
/** A required reason, 1–280 code points, naming why an approver rejected an Intent. */
|
|
2385
|
+
export type IntentRejection = v.InferOutput<typeof IntentRejectionSchema>;
|
|
2386
|
+
/** Parses a rejection: its shape and then {@link intentDecisionIssues}. */
|
|
2387
|
+
export declare function parseIntentRejection(input: unknown): ParseResult<IntentRejection>;
|
|
2388
|
+
/**
|
|
2389
|
+
* Error codes an Intent's Approval lifecycle answers with, beyond the generic transport codes.
|
|
2390
|
+
*
|
|
2391
|
+
* A cancellation or an approval may observe an Intent whose deadline to be approved and executed
|
|
2392
|
+
* has already passed; `intent_expired` names that failure so a caller can distinguish it from an
|
|
2393
|
+
* ordinary rejection.
|
|
2394
|
+
*/
|
|
2395
|
+
export declare const ANDCO_INTENT_ERROR_CODES: {
|
|
2396
|
+
/** The Intent's deadline to be approved and executed has already passed. */
|
|
2397
|
+
readonly INTENT_EXPIRED: "intent_expired";
|
|
2398
|
+
/**
|
|
2399
|
+
* Closing an account is not built yet. Answered as `not_implemented` (501) with this `code`, by the
|
|
2400
|
+
* SDK before any request and by the server at Intent creation, whatever the Grant holds.
|
|
2401
|
+
*/
|
|
2402
|
+
readonly ACCOUNT_CLOSURE_NOT_IMPLEMENTED: "account_closure_not_implemented";
|
|
2403
|
+
/**
|
|
2404
|
+
* Opening an additional account by Account Key works where the bank serves it. Where it does not,
|
|
2405
|
+
* the server answers `not_implemented` (501) with this stable `code`: at Intent creation, once the
|
|
2406
|
+
* request is valid and the Grant holds `bank_account` `create` (otherwise `400` or `403` come
|
|
2407
|
+
* first) and nothing is created, and at approval, with the `intent_id`, leaving the Intent as it
|
|
2408
|
+
* was. The SDK always sends the request.
|
|
2409
|
+
*/
|
|
2410
|
+
readonly ACCOUNT_OPENING_NOT_IMPLEMENTED: "account_opening_not_implemented";
|
|
2411
|
+
/**
|
|
2412
|
+
* A transfer between two accounts of the same holder (the destination is an Account Key or an
|
|
2413
|
+
* Andco account of the Grant's subject) works where the bank serves it. Where it does not, the
|
|
2414
|
+
* server answers `not_implemented` (501) with this stable `code`: at Intent creation, with
|
|
2415
|
+
* nothing created, and at approval, with the `intent_id`. A transfer to another bank or to
|
|
2416
|
+
* another Andco customer is not affected.
|
|
2417
|
+
*/
|
|
2418
|
+
readonly OWN_ACCOUNT_TRANSFER_NOT_IMPLEMENTED: "own_account_transfer_not_implemented";
|
|
2419
|
+
};
|
|
1352
2420
|
/**
|
|
1353
2421
|
* Identifies recognized unsupported Intents without silently dropping their extra instructions: an
|
|
1354
2422
|
* account closure, and payment shapes that carry several destinations, allocations or instructions.
|
|
@@ -1359,38 +2427,36 @@ export declare function unsupportedIntentShape(input: unknown): string | undefin
|
|
|
1359
2427
|
*
|
|
1360
2428
|
* Every member but `intent_id` is optional because nothing here is necessarily editable: a screen
|
|
1361
2429
|
* sends only what the Intent left open, and a value that was frozen has nowhere to arrive from.
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
* when the Intent was created with `amount.editable: true`.
|
|
2430
|
+
* `destination` is the one the person completes when the Intent was created with `destination: null`,
|
|
2431
|
+
* and is required then; a transfer that named its destination takes none. `amount` is accepted only
|
|
2432
|
+
* when the Intent was created with `amount.editable: true`. The server checks the destination against
|
|
2433
|
+
* the Grant's `destinations` and refuses one outside them with `invalid_destination`.
|
|
1365
2434
|
*/
|
|
1366
2435
|
export declare const TransferConfirmationSchema: v.StrictObjectSchema<{
|
|
1367
2436
|
readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
1368
2437
|
readonly source_account_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
1369
|
-
readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.
|
|
2438
|
+
readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
1370
2439
|
readonly destination: v.OptionalSchema<v.StrictObjectSchema<{
|
|
1371
2440
|
type: v.LiteralSchema<"external", undefined>;
|
|
1372
2441
|
bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1373
2442
|
account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
|
|
1374
2443
|
account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1375
2444
|
holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
|
|
1376
|
-
holder_name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.
|
|
2445
|
+
holder_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.DescriptionAction<string, "The holder's name, at most 256 code points (`holder_name_too_long`).">]>;
|
|
1377
2446
|
}, undefined>, undefined>;
|
|
1378
|
-
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction
|
|
2447
|
+
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
1379
2448
|
}, undefined>;
|
|
1380
|
-
/**
|
|
1381
|
-
export
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
}, undefined>, undefined>;
|
|
1393
|
-
readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.CheckAction<string, "note_too_long">]>, undefined>;
|
|
1394
|
-
}, undefined>>;
|
|
2449
|
+
/** Validated confirmation fields inferred from {@link TransferConfirmationSchema}. */
|
|
2450
|
+
export type TransferConfirmation = v.InferOutput<typeof TransferConfirmationSchema>;
|
|
2451
|
+
/**
|
|
2452
|
+
* The rules of a confirmation that JSON Schema does not say in code points: `note_too_long`, past
|
|
2453
|
+
* {@link NOTE_MAX_LENGTH}, and `holder_name_too_long`, past {@link HOLDER_NAME_MAX_LENGTH}.
|
|
2454
|
+
*/
|
|
2455
|
+
export declare function transferConfirmationIssues(input: Pick<TransferConfirmation, "note" | "destination">): Issue[];
|
|
2456
|
+
/**
|
|
2457
|
+
* Parses proposed confirmation fields: their shape and then {@link transferConfirmationIssues}. The
|
|
2458
|
+
* server enforces editability.
|
|
2459
|
+
*/
|
|
2460
|
+
export declare function parseTransferConfirmation(input: unknown): ParseResult<TransferConfirmation>;
|
|
1395
2461
|
export {};
|
|
1396
2462
|
//# sourceMappingURL=intent-input.d.ts.map
|