@andco/protocol 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +2 -2
  2. package/dist/api-errors.d.ts +9 -9
  3. package/dist/api-errors.js +9 -9
  4. package/dist/authorization-preparation.js +2 -2
  5. package/dist/authorization.d.ts +1 -1
  6. package/dist/authorization.js +1 -1
  7. package/dist/consent.d.ts +2 -2
  8. package/dist/consent.js +2 -2
  9. package/dist/errors.d.ts +9 -9
  10. package/dist/errors.js +9 -9
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/intent-input.d.ts +431 -872
  15. package/dist/intent-input.d.ts.map +1 -1
  16. package/dist/intent-input.js +142 -121
  17. package/dist/miniapp-manifest.d.ts +1 -1
  18. package/dist/native-intent.d.ts +82 -68
  19. package/dist/native-intent.d.ts.map +1 -1
  20. package/dist/native-intent.js +134 -84
  21. package/dist/native.d.ts +1 -1
  22. package/dist/rar/account-matchers.d.ts +35 -30
  23. package/dist/rar/account-matchers.d.ts.map +1 -1
  24. package/dist/rar/account-matchers.js +27 -21
  25. package/dist/rar/bank.d.ts +81 -81
  26. package/dist/rar/bank.js +1 -1
  27. package/dist/rar/catalog.d.ts +48 -48
  28. package/dist/rar/catalog.js +6 -6
  29. package/dist/rar/detail.d.ts +1 -1
  30. package/dist/rar/detail.js +1 -1
  31. package/dist/rar/json-schemas.generated.d.ts +1 -1
  32. package/dist/rar/json-schemas.generated.d.ts.map +1 -1
  33. package/dist/rar/json-schemas.generated.js +25 -21
  34. package/dist/rar/subject-data.d.ts +1 -1
  35. package/dist/rar/subject-data.js +1 -1
  36. package/dist/rar/subject.d.ts +1 -1
  37. package/dist/rar/subject.js +1 -1
  38. package/dist/rest/accounts.d.ts +28 -28
  39. package/dist/rest/accounts.d.ts.map +1 -1
  40. package/dist/rest/accounts.js +22 -22
  41. package/dist/rest/api-error.d.ts +1 -1
  42. package/dist/rest/api-error.js +1 -1
  43. package/dist/rest/catalog.d.ts +3 -3
  44. package/dist/rest/catalog.js +2 -2
  45. package/dist/rest/common.d.ts +3 -3
  46. package/dist/rest/common.js +3 -3
  47. package/dist/rest/contract.d.ts +905 -528
  48. package/dist/rest/contract.d.ts.map +1 -1
  49. package/dist/rest/contract.js +17 -5
  50. package/dist/rest/events.d.ts +1 -1
  51. package/dist/rest/events.d.ts.map +1 -1
  52. package/dist/rest/events.js +2 -2
  53. package/dist/rest/identity.d.ts +22 -22
  54. package/dist/rest/identity.js +5 -5
  55. package/dist/rest/index.d.ts +1 -0
  56. package/dist/rest/index.d.ts.map +1 -1
  57. package/dist/rest/index.js +1 -0
  58. package/dist/rest/intents.d.ts +787 -716
  59. package/dist/rest/intents.d.ts.map +1 -1
  60. package/dist/rest/intents.js +62 -53
  61. package/dist/rest/signatures.d.ts +11 -5
  62. package/dist/rest/signatures.d.ts.map +1 -1
  63. package/dist/rest/signatures.js +10 -0
  64. package/dist/rest/transfers.d.ts +612 -0
  65. package/dist/rest/transfers.d.ts.map +1 -0
  66. package/dist/rest/transfers.js +115 -0
  67. package/dist/scopes.d.ts +1 -1
  68. package/dist/signing.d.ts +12 -2
  69. package/dist/signing.d.ts.map +1 -1
  70. package/dist/signing.js +6 -0
  71. package/dist/transfer.d.ts +363 -0
  72. package/dist/transfer.d.ts.map +1 -0
  73. package/dist/transfer.js +287 -0
  74. package/dist/transport/financial-events.d.ts +21 -17
  75. package/dist/transport/financial-events.d.ts.map +1 -1
  76. package/dist/transport/generated/oauth-api.d.ts +1017 -194
  77. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  78. package/dist/transport/intents.d.ts +28 -12
  79. package/dist/transport/intents.d.ts.map +1 -1
  80. package/dist/transport/intents.js +1 -1
  81. package/dist/transport/rest.d.ts +4 -4
  82. package/dist/urls.d.ts +2 -2
  83. package/dist/urls.js +3 -3
  84. package/dist/userinfo.d.ts +2 -2
  85. package/dist/userinfo.js +2 -2
  86. package/dist/webhooks.d.ts +16 -16
  87. package/dist/webhooks.js +14 -14
  88. package/dist/window-features.d.ts +2 -2
  89. package/dist/window-features.js +2 -2
  90. package/package.json +2 -2
@@ -1,15 +1,19 @@
1
1
  import * as v from "valibot";
2
2
  import { type Issue, type ParseResult } from "./issues.js";
3
- /** Authenticated Host presentation; bank commands and account ownership remain on Platform. */
3
+ /** Authenticated Host presentation; commands to AndCo and account ownership remain on Platform. */
4
4
  export declare const AndCoNativeIntentPreparationSchema: v.ObjectSchema<{
5
5
  readonly intent: v.VariantSchema<"type", [v.ObjectSchema<{
6
6
  readonly type: v.LiteralSchema<"deposit", undefined>;
7
7
  readonly amount: v.NullableSchema<v.ObjectSchema<{
8
- readonly confirmed: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
9
- readonly frozen_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
10
8
  readonly currency: v.LiteralSchema<"CLP", undefined>;
11
9
  readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
12
10
  readonly editable: v.BooleanSchema<undefined>;
11
+ readonly confirmed: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
12
+ readonly frozen_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
13
+ }, undefined>, undefined>;
14
+ readonly note: v.OptionalSchema<v.ObjectSchema<{
15
+ readonly value: v.StringSchema<undefined>;
16
+ readonly editable: v.BooleanSchema<undefined>;
13
17
  }, undefined>, undefined>;
14
18
  readonly destination: v.ObjectSchema<{
15
19
  readonly type: v.LiteralSchema<"account", undefined>;
@@ -46,15 +50,11 @@ export declare const AndCoNativeIntentPreparationSchema: v.ObjectSchema<{
46
50
  readonly currency: v.LiteralSchema<"CLP", undefined>;
47
51
  }, undefined>, undefined>;
48
52
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
49
- readonly status: v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "completed", "closed", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>;
53
+ readonly status: v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "completed", "closed", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>;
50
54
  readonly fee: v.ObjectSchema<{
51
55
  readonly currency: v.LiteralSchema<"CLP", undefined>;
52
56
  readonly amount: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
53
57
  }, undefined>;
54
- readonly note: v.OptionalSchema<v.ObjectSchema<{
55
- readonly value: v.StringSchema<undefined>;
56
- readonly editable: v.BooleanSchema<undefined>;
57
- }, undefined>, undefined>;
58
58
  readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
59
59
  readonly server_time: v.StringSchema<undefined>;
60
60
  readonly can_confirm: v.BooleanSchema<undefined>;
@@ -65,19 +65,23 @@ export declare const AndCoNativeIntentPreparationSchema: v.ObjectSchema<{
65
65
  }, undefined>, v.ObjectSchema<{
66
66
  readonly type: v.LiteralSchema<"transfer", undefined>;
67
67
  readonly amount: v.ObjectSchema<{
68
- readonly confirmed: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
69
68
  readonly currency: v.LiteralSchema<"CLP", undefined>;
70
- readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
69
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
71
70
  readonly editable: v.BooleanSchema<undefined>;
71
+ readonly confirmed: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>;
72
72
  }, undefined>;
73
+ readonly comment: v.OptionalSchema<v.ObjectSchema<{
74
+ readonly value: v.StringSchema<undefined>;
75
+ readonly editable: v.BooleanSchema<undefined>;
76
+ }, undefined>, undefined>;
73
77
  readonly settled: v.NullableSchema<v.ObjectSchema<{
74
78
  readonly currency: v.LiteralSchema<"CLP", undefined>;
75
- readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
79
+ readonly value: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>;
76
80
  readonly at: v.StringSchema<undefined>;
77
81
  }, undefined>, undefined>;
78
82
  readonly signed: v.BooleanSchema<undefined>;
79
83
  readonly interaction_reason: v.OptionalSchema<v.PicklistSchema<["bank_verification_required", "source_account_required"], undefined>, undefined>;
80
- readonly destination: v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
84
+ readonly receiver: v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
81
85
  readonly editable: v.LiteralSchema<false, undefined>;
82
86
  readonly type: v.LiteralSchema<"account_key", undefined>;
83
87
  readonly accountKey: v.StringSchema<undefined>;
@@ -88,13 +92,15 @@ export declare const AndCoNativeIntentPreparationSchema: v.ObjectSchema<{
88
92
  }, undefined>, v.ObjectSchema<{
89
93
  readonly editable: v.LiteralSchema<false, undefined>;
90
94
  readonly type: v.LiteralSchema<"external", undefined>;
91
- readonly bank_id: v.StringSchema<undefined>;
92
- readonly account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
93
- readonly account_id: v.StringSchema<undefined>;
94
- readonly holder_id: v.StringSchema<undefined>;
95
- readonly holder_name: v.StringSchema<undefined>;
95
+ readonly country: v.LiteralSchema<"CL", undefined>;
96
+ readonly bank_code: v.StringSchema<undefined>;
97
+ readonly account_type: v.PicklistSchema<["10", "20", "40"], undefined>;
98
+ readonly account_number: v.StringSchema<undefined>;
99
+ readonly name: v.StringSchema<undefined>;
100
+ readonly national_kind_id: v.LiteralSchema<"RUT", undefined>;
101
+ readonly national_id: v.StringSchema<undefined>;
96
102
  }, undefined>], undefined>, undefined>;
97
- readonly source: v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
103
+ readonly sender: v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
98
104
  readonly type: v.LiteralSchema<"account_key", undefined>;
99
105
  readonly accountKey: v.StringSchema<undefined>;
100
106
  }, undefined>, v.ObjectSchema<{
@@ -102,15 +108,11 @@ export declare const AndCoNativeIntentPreparationSchema: v.ObjectSchema<{
102
108
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
103
109
  }, undefined>], undefined>, undefined>;
104
110
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
105
- readonly status: v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "completed", "closed", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>;
111
+ readonly status: v.PicklistSchema<["requires_action", "processing.confirmed", "processing.settling", "processing.reversing", "processing.reconciling", "processing.opening", "processing.closing", "succeeded", "completed", "closed", "failed", "failed.insufficient_funds", "failed.fraud_rejected", "failed.bank_refused", "failed.bank_rejected", "failed.bank_review_required", "failed.own_account_transfer_not_implemented", "failed.bank_challenge_required", "failed.unknown_key", "failed.revoked_key", "failed.expired_key", "failed.invalid_signature", "failed.expired_signed_instruction", "failed.sender_mismatch", "failed.bank_authorization_denied", "failed.bank_holder_without_account", "failed.bank_account_limit_reached", "failed.account_opening_not_implemented", "failed.bank_core_unavailable", "failed.bank_account_save_failed", "failed.bank_connection_unavailable", "failed.bank_account_quota_exceeded", "failed.account_key_taken", "failed.bank_account_not_found", "failed.bank_account_balance_not_zero", "cancelled", "cancelled.grant_revoked", "cancelled.grant_expired", "rejected", "expired"], undefined>;
106
112
  readonly fee: v.ObjectSchema<{
107
113
  readonly currency: v.LiteralSchema<"CLP", undefined>;
108
114
  readonly amount: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
109
115
  }, undefined>;
110
- readonly note: v.OptionalSchema<v.ObjectSchema<{
111
- readonly value: v.StringSchema<undefined>;
112
- readonly editable: v.BooleanSchema<undefined>;
113
- }, undefined>, undefined>;
114
116
  readonly expires_at: v.NullableSchema<v.StringSchema<undefined>, undefined>;
115
117
  readonly server_time: v.StringSchema<undefined>;
116
118
  readonly can_confirm: v.BooleanSchema<undefined>;
@@ -168,17 +170,19 @@ export declare const AndCoNativeIntentCommandSchema: v.VariantSchema<"action", [
168
170
  readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 140, undefined>]>, undefined>;
169
171
  }, undefined>, v.StrictObjectSchema<{
170
172
  readonly action: v.LiteralSchema<"confirm_transfer", undefined>;
171
- readonly sourceAccountId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
172
- readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
173
- readonly destination: v.OptionalSchema<v.StrictObjectSchema<{
173
+ readonly senderAccountId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>;
174
+ readonly amount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>, v.DescriptionAction<number, "An integer in the minor unit of the currency (CLP: whole pesos), from 1 to 2147483647, because Core stores it as int4. A larger one is refused with `max_value`.">]>, undefined>;
175
+ readonly receiver: v.OptionalSchema<v.StrictObjectSchema<{
174
176
  type: v.LiteralSchema<"external", undefined>;
175
- bank_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
176
- account_type: v.PicklistSchema<["checking", "debit", "savings"], undefined>;
177
- account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
178
- holder_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
179
- 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`).">]>;
177
+ country: v.LiteralSchema<"CL", undefined>;
178
+ bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code in Core's catalog. Andco is `0739`.">]>;
179
+ account_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["10", "20", "40"], undefined>, v.DescriptionAction<"10" | "20" | "40", "Core's account type code: `\"10\"` savings, `\"20\"` checking, `\"40\"` debit (cuenta vista).">]>;
180
+ account_number: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>]>;
181
+ 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`).">]>;
182
+ national_kind_id: v.LiteralSchema<"RUT", undefined>;
183
+ national_id: 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 holder's RUT.">]>;
180
184
  }, undefined>, undefined>;
181
- readonly note: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
185
+ readonly comment: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
182
186
  }, undefined>, v.StrictObjectSchema<{
183
187
  readonly action: v.LiteralSchema<"close_deposit", undefined>;
184
188
  }, undefined>, v.StrictObjectSchema<{
@@ -194,8 +198,8 @@ export declare const AndCoNativeIntentCommandSchema: v.VariantSchema<"action", [
194
198
  }, undefined>], undefined>;
195
199
  export type AndCoNativeIntentCommand = v.InferOutput<typeof AndCoNativeIntentCommandSchema>;
196
200
  /**
197
- * The rules of a command that its shape does not say: a confirmed transfer's note is at most
198
- * `NOTE_MAX_LENGTH` code points (`note_too_long`) and its destination's holder name at most
201
+ * The rules of a command that its shape does not say: a confirmed transfer's comment is at most
202
+ * 60 bytes of UTF-8 (`comment_too_long`) and its receiver's holder name at most
199
203
  * `HOLDER_NAME_MAX_LENGTH` (`holder_name_too_long`), and `assign_deposit_credits` selects each
200
204
  * movement once (`duplicate_movement`, at the repeated entry).
201
205
  *
@@ -239,12 +243,16 @@ export declare function requestAndCoNativeIntent(options: {
239
243
  intent: {
240
244
  type: "deposit";
241
245
  amount: {
242
- confirmed: string | null;
243
- frozen_at: string | null;
244
246
  currency: "CLP";
245
247
  value: string;
246
248
  editable: boolean;
249
+ confirmed: string | null;
250
+ frozen_at: string | null;
247
251
  } | null;
252
+ note?: {
253
+ value: string;
254
+ editable: boolean;
255
+ } | undefined;
248
256
  destination: {
249
257
  type: "account";
250
258
  id: string;
@@ -280,15 +288,11 @@ export declare function requestAndCoNativeIntent(options: {
280
288
  currency: "CLP";
281
289
  }[];
282
290
  id: string;
283
- status: "completed" | "succeeded" | "closed" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
291
+ status: "completed" | "succeeded" | "closed" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
284
292
  fee: {
285
293
  currency: "CLP";
286
294
  amount: string;
287
295
  };
288
- note?: {
289
- value: string;
290
- editable: boolean;
291
- } | undefined;
292
296
  expires_at: string | null;
293
297
  server_time: string;
294
298
  can_confirm: boolean;
@@ -299,19 +303,23 @@ export declare function requestAndCoNativeIntent(options: {
299
303
  } | {
300
304
  type: "transfer";
301
305
  amount: {
302
- confirmed: string | null;
303
306
  currency: "CLP";
304
- value: string;
307
+ value: number;
305
308
  editable: boolean;
309
+ confirmed: number | null;
306
310
  };
311
+ comment?: {
312
+ value: string;
313
+ editable: boolean;
314
+ } | undefined;
307
315
  settled: {
308
316
  currency: "CLP";
309
- value: string;
317
+ value: number;
310
318
  at: string;
311
319
  } | null;
312
320
  signed: boolean;
313
321
  interaction_reason?: "bank_verification_required" | "source_account_required" | undefined;
314
- destination: {
322
+ receiver: {
315
323
  editable: false;
316
324
  type: "account_key";
317
325
  accountKey: string;
@@ -322,13 +330,15 @@ export declare function requestAndCoNativeIntent(options: {
322
330
  } | {
323
331
  editable: false;
324
332
  type: "external";
325
- bank_id: string;
326
- account_type: "checking" | "debit" | "savings";
327
- account_id: string;
328
- holder_id: string;
329
- holder_name: string;
333
+ country: "CL";
334
+ bank_code: string;
335
+ account_type: "10" | "20" | "40";
336
+ account_number: string;
337
+ name: string;
338
+ national_kind_id: "RUT";
339
+ national_id: string;
330
340
  } | null;
331
- source: {
341
+ sender: {
332
342
  type: "account_key";
333
343
  accountKey: string;
334
344
  } | {
@@ -336,15 +346,11 @@ export declare function requestAndCoNativeIntent(options: {
336
346
  id: string;
337
347
  } | null;
338
348
  id: string;
339
- status: "completed" | "succeeded" | "closed" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
349
+ status: "completed" | "succeeded" | "closed" | "failed" | "cancelled" | "rejected" | "expired" | "requires_action" | "processing.confirmed" | "processing.settling" | "processing.reversing" | "processing.reconciling" | "processing.opening" | "processing.closing" | "failed.insufficient_funds" | "failed.fraud_rejected" | "failed.bank_refused" | "failed.bank_rejected" | "failed.bank_review_required" | "failed.own_account_transfer_not_implemented" | "failed.bank_challenge_required" | "failed.unknown_key" | "failed.revoked_key" | "failed.expired_key" | "failed.invalid_signature" | "failed.expired_signed_instruction" | "failed.sender_mismatch" | "failed.bank_authorization_denied" | "failed.bank_holder_without_account" | "failed.bank_account_limit_reached" | "failed.account_opening_not_implemented" | "failed.bank_core_unavailable" | "failed.bank_account_save_failed" | "failed.bank_connection_unavailable" | "failed.bank_account_quota_exceeded" | "failed.account_key_taken" | "failed.bank_account_not_found" | "failed.bank_account_balance_not_zero" | "cancelled.grant_revoked" | "cancelled.grant_expired";
340
350
  fee: {
341
351
  currency: "CLP";
342
352
  amount: string;
343
353
  };
344
- note?: {
345
- value: string;
346
- editable: boolean;
347
- } | undefined;
348
354
  expires_at: string | null;
349
355
  server_time: string;
350
356
  can_confirm: boolean;
@@ -426,24 +432,32 @@ export declare function ANDCO_NATIVE_INTENT_VIEW(data: AndCoNativeIntentPreparat
426
432
  canSubmit: boolean;
427
433
  };
428
434
  /**
429
- * Where the money lands, as the person writes it on a screen when the Intent left it to her: another
430
- * bank's account, field by field, with every field empty until she writes it. `bank_id` is one of the
431
- * preparation's `banks`. It is `null` in an {@link AndCoNativeIntentForm} when the Intent named its
432
- * destination, because a named destination is shown, never edited.
435
+ * Where the money lands, as the person writes it on a screen when the Intent left it to her: a
436
+ * Receptor at a bank in Core's vocabulary, field by field, with every field she writes empty until
437
+ * she writes it. `bank_code` is the `id` of one of the preparation's `banks`, and `account_type` is
438
+ * Core's code (`"10"` savings, `"20"` checking, `"40"` debit). The country and the kind of document
439
+ * are fixed: Chile and the RUT are the only ones. It is `null` in an {@link AndCoNativeIntentForm}
440
+ * when the Intent named its receiver, because a named receiver is shown, never edited.
433
441
  */
434
- export type AndCoNativeIntentDestination = {
435
- bank_id: string;
436
- account_type: "checking" | "debit" | "savings" | "";
437
- account_id: string;
438
- holder_id: string;
439
- holder_name: string;
442
+ export type AndCoNativeIntentReceiver = {
443
+ country: "CL";
444
+ bank_code: string;
445
+ account_type: "10" | "20" | "40" | "";
446
+ account_number: string;
447
+ name: string;
448
+ national_kind_id: "RUT";
449
+ national_id: string;
440
450
  };
441
- /** User-edited values, separate from the durable financial state. */
451
+ /**
452
+ * User-edited values, separate from the durable financial state. `source` is the account the money
453
+ * leaves (a transfer's sender, or the account that funds a deposit), `amount` the text the person
454
+ * typed, and `note` a deposit's note or a transfer's comment.
455
+ */
442
456
  export type AndCoNativeIntentForm = {
443
457
  source: string;
444
458
  amount: string;
445
459
  note: string;
446
- destination: AndCoNativeIntentDestination | null;
460
+ receiver: AndCoNativeIntentReceiver | null;
447
461
  };
448
462
  /** Restores accepted command values; otherwise defaults only an unambiguous source. */
449
463
  export declare function ANDCO_NATIVE_INTENT_FORM(data: AndCoNativeIntentPreparation, retry?: AndCoNativeIntentCommand): AndCoNativeIntentForm;
@@ -1 +1 @@
1
- {"version":3,"file":"native-intent.d.ts","sourceRoot":"","sources":["../src/native-intent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,OAAO,EAAmB,KAAK,KAAK,EAAY,KAAK,WAAW,EAAkB,MAAM,aAAa,CAAC;AAoFtG,+FAA+F;AAC/F,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAgG7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kCA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