@andco/protocol 0.0.3 → 0.0.4

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 (113) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +33 -3
  3. package/dist/api-errors.d.ts +109 -0
  4. package/dist/api-errors.d.ts.map +1 -0
  5. package/dist/api-errors.js +111 -0
  6. package/dist/authorization-preparation.d.ts +52 -543
  7. package/dist/authorization-preparation.d.ts.map +1 -1
  8. package/dist/authorization-preparation.js +19 -42
  9. package/dist/authorization.d.ts +64 -22
  10. package/dist/authorization.d.ts.map +1 -1
  11. package/dist/authorization.js +136 -55
  12. package/dist/consent.d.ts +5 -8
  13. package/dist/consent.d.ts.map +1 -1
  14. package/dist/consent.js +5 -62
  15. package/dist/constants.d.ts +19 -3
  16. package/dist/constants.d.ts.map +1 -1
  17. package/dist/constants.js +19 -3
  18. package/dist/errors.d.ts +156 -58
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +176 -57
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +4 -4
  24. package/dist/intent-input.d.ts +1010 -279
  25. package/dist/intent-input.d.ts.map +1 -1
  26. package/dist/intent-input.js +268 -40
  27. package/dist/messages/error.d.ts +1 -2
  28. package/dist/messages/error.d.ts.map +1 -1
  29. package/dist/messages/error.js +5 -2
  30. package/dist/messages/index.d.ts +1 -1
  31. package/dist/native-copy.d.ts +23 -2
  32. package/dist/native-copy.d.ts.map +1 -1
  33. package/dist/native-copy.js +42 -98
  34. package/dist/native-intent.d.ts +126 -75
  35. package/dist/native-intent.d.ts.map +1 -1
  36. package/dist/native-intent.js +140 -48
  37. package/dist/rar/account-matchers.d.ts +579 -0
  38. package/dist/rar/account-matchers.d.ts.map +1 -0
  39. package/dist/rar/account-matchers.js +480 -0
  40. package/dist/rar/bank.d.ts +1549 -0
  41. package/dist/rar/bank.d.ts.map +1 -0
  42. package/dist/rar/bank.js +379 -0
  43. package/dist/rar/catalog.d.ts +1155 -0
  44. package/dist/rar/catalog.d.ts.map +1 -0
  45. package/dist/rar/catalog.js +175 -0
  46. package/dist/rar/detail.d.ts +39 -0
  47. package/dist/rar/detail.d.ts.map +1 -0
  48. package/dist/rar/detail.js +44 -0
  49. package/dist/rar/index.d.ts +9 -0
  50. package/dist/rar/index.d.ts.map +1 -0
  51. package/dist/rar/index.js +8 -0
  52. package/dist/rar/money.d.ts +58 -0
  53. package/dist/rar/money.d.ts.map +1 -0
  54. package/dist/rar/money.js +61 -0
  55. package/dist/rar/project-users.d.ts +43 -0
  56. package/dist/rar/project-users.d.ts.map +1 -0
  57. package/dist/rar/project-users.js +63 -0
  58. package/dist/rar/subject-data.d.ts +170 -0
  59. package/dist/rar/subject-data.d.ts.map +1 -0
  60. package/dist/rar/subject-data.js +127 -0
  61. package/dist/rar/subject.d.ts +166 -0
  62. package/dist/rar/subject.d.ts.map +1 -0
  63. package/dist/rar/subject.js +119 -0
  64. package/dist/scopes.d.ts +5 -30
  65. package/dist/scopes.d.ts.map +1 -1
  66. package/dist/scopes.js +0 -13
  67. package/dist/service-grants.d.ts +44 -0
  68. package/dist/service-grants.d.ts.map +1 -0
  69. package/dist/service-grants.js +45 -0
  70. package/dist/signing.d.ts +56 -0
  71. package/dist/signing.d.ts.map +1 -0
  72. package/dist/signing.js +233 -0
  73. package/dist/transport/financial-events.d.ts +90 -35
  74. package/dist/transport/financial-events.d.ts.map +1 -1
  75. package/dist/transport/financial-events.js +7 -1
  76. package/dist/transport/generated/oauth-api.d.ts +908 -440
  77. package/dist/transport/generated/oauth-api.d.ts.map +1 -1
  78. package/dist/transport/index.d.ts +0 -1
  79. package/dist/transport/index.d.ts.map +1 -1
  80. package/dist/transport/index.js +0 -1
  81. package/dist/transport/intents.d.ts +155 -23
  82. package/dist/transport/intents.d.ts.map +1 -1
  83. package/dist/transport/intents.js +192 -59
  84. package/dist/transport/rest.d.ts +18 -8
  85. package/dist/transport/rest.d.ts.map +1 -1
  86. package/dist/transport/rest.js +1 -1
  87. package/dist/urls.d.ts.map +1 -1
  88. package/dist/urls.js +1 -1
  89. package/dist/userinfo.d.ts +10 -1
  90. package/dist/userinfo.d.ts.map +1 -1
  91. package/dist/userinfo.js +10 -1
  92. package/dist/utils.d.ts +15 -0
  93. package/dist/utils.d.ts.map +1 -1
  94. package/dist/utils.js +31 -0
  95. package/dist/webhooks.d.ts +154 -0
  96. package/dist/webhooks.d.ts.map +1 -0
  97. package/dist/webhooks.js +249 -0
  98. package/package.json +18 -1
  99. package/dist/automatic-charge.d.ts +0 -314
  100. package/dist/automatic-charge.d.ts.map +0 -1
  101. package/dist/automatic-charge.js +0 -126
  102. package/dist/bank-account-authorization.d.ts +0 -6
  103. package/dist/bank-account-authorization.d.ts.map +0 -1
  104. package/dist/bank-account-authorization.js +0 -13
  105. package/dist/transport/webhooks.d.ts +0 -27
  106. package/dist/transport/webhooks.d.ts.map +0 -1
  107. package/dist/transport/webhooks.js +0 -68
  108. package/dist/webhook-input.d.ts +0 -22
  109. package/dist/webhook-input.d.ts.map +0 -1
  110. package/dist/webhook-input.js +0 -11
  111. package/dist/webhook-signature.d.ts +0 -54
  112. package/dist/webhook-signature.d.ts.map +0 -1
  113. package/dist/webhook-signature.js +0 -74
@@ -1,17 +1,38 @@
1
1
  import * as v from "valibot";
2
- import { WithdrawalConfirmationSchema } from "./intent-input.js";
3
- import { ANDCO_NATIVE_TEXT as t } from "./native-copy.js";
2
+ import { TransferConfirmationSchema } from "./intent-input.js";
3
+ import { ANDCO_NATIVE_INTENT_TYPE_COPY, ANDCO_NATIVE_TEXT as t } from "./native-copy.js";
4
+ import { MONEY_PATTERN, MoneyOrZeroSchema } from "./rar/money.js";
4
5
  import { SafeURL } from "./urls.js";
5
6
  const text = /* @__PURE__ */ v.string();
6
- const money = /* @__PURE__ */ v.pipe(text, v.regex(/^[0-9]+$/));
7
+ // Every amount Platform presents here, credited totals and pending targets included, may
8
+ // legitimately be zero -- "no credited amount yet" is a real, tested state, not an error. Being
9
+ // permissive about zero where zero cannot occur costs nothing; being strict where it does occur
10
+ // would reject Platform's own output before it reaches the screen, which Platform treats as its own
11
+ // bug. The defect this scalar had to fix was the missing digit ceiling, not the admission of zero.
12
+ const money = MoneyOrZeroSchema;
13
+ // Amounts the native command channel transmits (never zero, matching the previous v.number()
14
+ // commands' v.minValue(1)) share the same digit ceiling as every other money value that travels
15
+ // through the protocol, instead of a second regex written by hand.
16
+ const transmittedAmount = /* @__PURE__ */ v.pipe(text, v.regex(new RegExp(MONEY_PATTERN)));
7
17
  const uuid = /* @__PURE__ */ v.pipe(text, v.uuid());
8
- const account = /* @__PURE__ */ v.object({
9
- account_holder_id: text,
10
- account_holder_name: text,
11
- account_kind: v.picklist(["checking", "debit", "savings"]),
12
- account_number: text,
18
+ const accountType = /* @__PURE__ */ v.picklist(["checking", "debit", "savings"]);
19
+ /** One Andco account, by Account Alias or by identifier, in the matcher vocabulary of a request. */
20
+ const aliasAccount = /* @__PURE__ */ v.object({ type: v.literal("alias"), alias: text });
21
+ const idAccount = /* @__PURE__ */ v.object({ type: v.literal("account"), id: uuid });
22
+ /**
23
+ * An account at another bank, the only destination a person may still correct on a screen.
24
+ *
25
+ * An Andco account named by Alias or identifier already denotes exactly one account, so there is
26
+ * nothing on the screen to correct: it is never editable.
27
+ */
28
+ const editableDestination = /* @__PURE__ */ v.object({
29
+ type: v.literal("external"),
13
30
  bank_id: text,
14
- country: v.literal("CL"),
31
+ account_type: accountType,
32
+ account_id: text,
33
+ holder_id: text,
34
+ holder_name: text,
35
+ editable: v.boolean(),
15
36
  });
16
37
  const base = {
17
38
  id: uuid,
@@ -27,11 +48,12 @@ const base = {
27
48
  "failed",
28
49
  "failed.insufficient_funds",
29
50
  "cancelled",
51
+ "rejected",
30
52
  "expired",
31
53
  ]),
32
- amount: v.object({ currency: v.literal("CLP"), suggested: money, editable: v.boolean() }),
54
+ amount: v.object({ currency: v.literal("CLP"), value: money, editable: v.boolean() }),
33
55
  fee: v.object({ currency: v.literal("CLP"), amount: money }),
34
- note: v.optional(v.object({ suggested: text, editable: v.boolean() })),
56
+ note: v.optional(v.object({ value: text, editable: v.boolean() })),
35
57
  expires_at: v.nullable(text),
36
58
  server_time: text,
37
59
  can_confirm: v.boolean(),
@@ -44,7 +66,14 @@ export const AndCoNativeIntentPreparationSchema = /* @__PURE__ */ v.object({
44
66
  ...base,
45
67
  type: v.literal("deposit"),
46
68
  amount: v.nullable(v.object({ ...base.amount.entries, confirmed: v.nullable(money), frozen_at: v.nullable(text) })),
47
- destination: v.object({ ...account.entries, bank_account_id: uuid }),
69
+ destination: v.object({
70
+ type: v.literal("account"),
71
+ id: uuid,
72
+ number: text,
73
+ account_type: accountType,
74
+ holder_id: v.nullable(text),
75
+ holder_name: text,
76
+ }),
48
77
  progress: v.object({ credited: money, remaining: v.nullable(money) }),
49
78
  closure: v.nullable(v.object({ closed_at: text, total: money })),
50
79
  completion: v.nullable(v.object({ completed_at: text, total: money })),
@@ -61,11 +90,19 @@ export const AndCoNativeIntentPreparationSchema = /* @__PURE__ */ v.object({
61
90
  currency: v.literal("CLP"),
62
91
  })),
63
92
  }),
93
+ // Money leaving an account towards a destination. `amount` is what the transfer orders and
94
+ // `settled` what it moved, null until it succeeded: a Host that reconciles reads `settled`.
64
95
  v.object({
65
96
  ...base,
66
- type: v.literal("withdrawal"),
67
- beneficiary: v.object({ ...account.entries, editable: v.boolean() }),
68
- source: v.optional(v.union([v.object({ bank_account_id: uuid }), account])),
97
+ type: v.literal("transfer"),
98
+ settled: v.nullable(v.object({ currency: v.literal("CLP"), value: money, at: text })),
99
+ signed: v.boolean(),
100
+ destination: v.variant("type", [
101
+ v.object({ ...aliasAccount.entries, editable: v.literal(false) }),
102
+ v.object({ ...idAccount.entries, editable: v.literal(false) }),
103
+ editableDestination,
104
+ ]),
105
+ source: v.nullable(v.variant("type", [aliasAccount, idAccount])),
69
106
  }),
70
107
  ]),
71
108
  sources: v.array(v.object({ id: uuid, number: text, name: v.nullable(text) })),
@@ -103,22 +140,26 @@ export const AndCoNativeIntentCommandSchema = /* @__PURE__ */ v.variant("action"
103
140
  action: v.literal("fund_deposit"),
104
141
  commandId: v.optional(uuid),
105
142
  sourceAccountId: uuid,
106
- amount: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(Number.MAX_SAFE_INTEGER)),
143
+ amount: transmittedAmount,
107
144
  note: v.optional(v.pipe(text, v.maxLength(140))),
108
145
  }),
146
+ // One command confirms money movement, whichever of the two forms carries it: what the person
147
+ // decides -- which account it leaves from, how much, where it lands and under what reference -- is
148
+ // the same question in both. Its members are the confirmation schema's own, so a value that is not
149
+ // editable has no separate shape here to be injected through.
109
150
  v.strictObject({
110
- action: v.literal("confirm_withdrawal"),
111
- sourceAccountId: WithdrawalConfirmationSchema.entries.source_account_id,
112
- amount: WithdrawalConfirmationSchema.entries.amount,
113
- beneficiary: WithdrawalConfirmationSchema.entries.beneficiary,
114
- note: WithdrawalConfirmationSchema.entries.note,
151
+ action: v.literal("confirm_transfer"),
152
+ sourceAccountId: TransferConfirmationSchema.entries.source_account_id,
153
+ amount: TransferConfirmationSchema.entries.amount,
154
+ destination: TransferConfirmationSchema.entries.destination,
155
+ note: TransferConfirmationSchema.entries.note,
115
156
  }),
116
157
  v.strictObject({ action: v.literal("fund_development_deposit") }),
117
158
  v.strictObject({ action: v.literal("close_deposit") }),
118
159
  v.strictObject({
119
160
  action: v.literal("confirm_deposit_target"),
120
- amount: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(Number.MAX_SAFE_INTEGER)),
121
- expectedTarget: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(Number.MAX_SAFE_INTEGER)),
161
+ amount: transmittedAmount,
162
+ expectedTarget: transmittedAmount,
122
163
  }),
123
164
  v.strictObject({
124
165
  action: v.literal("assign_deposit_credits"),
@@ -215,6 +256,7 @@ export class AndCoNativeIntentSession {
215
256
  constructor(load) {
216
257
  this.load = load;
217
258
  }
259
+ /** Observes snapshot changes and returns a function that removes the listener. */
218
260
  subscribe(listener) {
219
261
  this.listeners.add(listener);
220
262
  return () => {
@@ -228,6 +270,7 @@ export class AndCoNativeIntentSession {
228
270
  for (const listener of this.listeners)
229
271
  listener();
230
272
  }
273
+ /** Refreshes the snapshot and starts polling; failures are exposed through `snapshot.error`. */
231
274
  async refresh() {
232
275
  if (this.disposed || this.snapshot.pending)
233
276
  return;
@@ -256,6 +299,7 @@ export class AndCoNativeIntentSession {
256
299
  this.reading = undefined;
257
300
  }
258
301
  }
302
+ /** Sends one command, retaining uncertain writes for a retry with the same command identity. */
259
303
  async submit(command) {
260
304
  if (this.disposed || this.snapshot.pending)
261
305
  return;
@@ -280,7 +324,7 @@ export class AndCoNativeIntentSession {
280
324
  ...this.snapshot,
281
325
  pending: false,
282
326
  retryCommand: this.snapshot.retryCommand ??
283
- ((submitted.action === "fund_deposit" || submitted.action === "confirm_withdrawal") &&
327
+ ((submitted.action === "fund_deposit" || submitted.action === "confirm_transfer") &&
284
328
  !(error instanceof NativeIntentRequestError && error.status < 500)
285
329
  ? submitted
286
330
  : undefined),
@@ -291,6 +335,7 @@ export class AndCoNativeIntentSession {
291
335
  if (!this.disposed && !this.snapshot.error)
292
336
  this.timer = setTimeout(() => void this.refresh(), 2000);
293
337
  }
338
+ /** Stops polling and notifications without cancelling the financial operation. */
294
339
  dispose() {
295
340
  this.disposed = true;
296
341
  clearTimeout(this.timer);
@@ -303,7 +348,7 @@ export function ANDCO_NATIVE_INTENT_VIEW(data, now = Date.now(), observedAt = no
303
348
  const remaining = intent.expires_at === null
304
349
  ? null
305
350
  : Math.max(0, Date.parse(intent.expires_at) - Date.parse(intent.server_time) - (now - observedAt));
306
- const terminal = ["succeeded", "completed", "closed", "cancelled", "expired"].includes(intent.status) ||
351
+ const terminal = ["succeeded", "completed", "closed", "cancelled", "rejected", "expired"].includes(intent.status) ||
307
352
  intent.status.startsWith("failed");
308
353
  const expired = intent.status === "expired" || (intent.status === "requires_action" && remaining === 0);
309
354
  const processing = intent.status.startsWith("processing.");
@@ -320,7 +365,7 @@ export function ANDCO_NATIVE_INTENT_VIEW(data, now = Date.now(), observedAt = no
320
365
  (intent.type === "deposit" ||
321
366
  (!processing && intent.can_confirm) ||
322
367
  (intent.status === "processing.confirmed" && data.retryable)),
323
- title: intent.type === "deposit" ? t("Realizar un depósito") : t("Confirmar retiro"),
368
+ title: t(ANDCO_NATIVE_INTENT_TYPE_COPY[intent.type].title),
324
369
  status: ["succeeded", "completed"].includes(intent.status)
325
370
  ? t("Operación completada")
326
371
  : expired
@@ -332,60 +377,107 @@ export function ANDCO_NATIVE_INTENT_VIEW(data, now = Date.now(), observedAt = no
332
377
  : t("Revisa los datos antes de continuar"),
333
378
  };
334
379
  }
380
+ /**
381
+ * Where the money lands when it is another bank's account, or `null` when a screen cannot correct
382
+ * it: an Andco account named by Alias or identifier already denotes exactly one account.
383
+ */
384
+ function proposedDestination(intent) {
385
+ if (intent.type === "transfer" && intent.destination.type === "external")
386
+ return intent.destination;
387
+ return null;
388
+ }
389
+ /**
390
+ * The lines a native sheet shows for where the money lands, so both renderers read one answer: a
391
+ * deposit's account as a payer at another bank types it, a transfer's Andco account by Alias or by
392
+ * identifier, or another bank's account as the form holds it (a person's corrections included).
393
+ * `null` when the Intent names no destination.
394
+ *
395
+ * @example
396
+ * const lines = ANDCO_NATIVE_INTENT_DESTINATION_LINES(data, form); // ["Cuenta proveedores"]
397
+ */
398
+ export function ANDCO_NATIVE_INTENT_DESTINATION_LINES(data, form, locale) {
399
+ const intent = data.intent;
400
+ const kind = (type) => t({ checking: "Corriente", debit: "Vista", savings: "Ahorro" }[type], {}, locale);
401
+ if (intent.type === "deposit") {
402
+ const account = intent.destination;
403
+ return [
404
+ account.holder_name,
405
+ ...(account.holder_id ? [account.holder_id] : []),
406
+ "Andco",
407
+ `${kind(account.account_type)} · ${account.number}`,
408
+ ];
409
+ }
410
+ const destination = intent.destination;
411
+ if (destination.type === "alias")
412
+ return [t("Cuenta {{alias}}", { alias: destination.alias }, locale)];
413
+ if (destination.type === "account")
414
+ return [t("Cuenta Andco {{id}}", { id: destination.id.slice(-8) }, locale)];
415
+ const external = form?.destination ?? destination;
416
+ return [
417
+ external.holder_name,
418
+ external.holder_id,
419
+ external.bank_id,
420
+ `${kind(external.account_type)} · ${external.account_id}`,
421
+ ];
422
+ }
335
423
  /** Restores accepted command values; otherwise defaults only an unambiguous source. */
336
424
  export function ANDCO_NATIVE_INTENT_FORM(data, retry) {
337
425
  const intent = data.intent;
338
426
  if (retry?.action === "fund_deposit")
339
- return { source: retry.sourceAccountId, amount: String(retry.amount), note: retry.note ?? "", beneficiary: null };
340
- const withdrawalRetry = retry?.action === "confirm_withdrawal" ? retry : undefined;
427
+ return { source: retry.sourceAccountId, amount: String(retry.amount), note: retry.note ?? "", destination: null };
428
+ const transferRetry = retry?.action === "confirm_transfer" ? retry : undefined;
429
+ const destination = proposedDestination(intent);
341
430
  return {
342
- source: withdrawalRetry?.sourceAccountId ??
431
+ source: transferRetry?.sourceAccountId ??
343
432
  data.funding?.pendingSourceId ??
344
- (intent.type === "withdrawal" && intent.source && "bank_account_id" in intent.source
345
- ? intent.source.bank_account_id
433
+ (intent.type !== "deposit" && intent.source?.type === "account"
434
+ ? intent.source.id
346
435
  : data.sources.length === 1
347
436
  ? data.sources[0]?.id
348
437
  : undefined) ??
349
438
  "",
350
- amount: withdrawalRetry?.amount ??
439
+ amount: transferRetry?.amount ??
351
440
  data.funding?.pendingAmount ??
352
- (intent.type === "deposit" ? (intent.progress.remaining ?? "") : intent.amount.suggested),
353
- note: withdrawalRetry?.note ?? data.funding?.pendingNote ?? data.confirmedNote ?? intent.note?.suggested ?? "",
354
- beneficiary: intent.type === "withdrawal" ? { ...intent.beneficiary, ...withdrawalRetry?.beneficiary } : null,
441
+ (intent.type === "deposit" ? (intent.progress.remaining ?? "") : intent.amount.value),
442
+ note: transferRetry?.note ?? data.funding?.pendingNote ?? data.confirmedNote ?? intent.note?.value ?? "",
443
+ destination: destination ? { ...destination, ...transferRetry?.destination } : null,
355
444
  };
356
445
  }
357
- /** Builds an explicit command without resending editable values on a frozen withdrawal. */
446
+ /** Builds an explicit command without resending frozen or non-editable values of a money movement. */
358
447
  export function ANDCO_NATIVE_INTENT_COMMAND(data, form) {
359
448
  const intent = data.intent;
360
449
  const frozen = intent.status.startsWith("processing.");
361
- const beneficiary = form.beneficiary;
450
+ // Editability is read from the Intent the server sent and never from the form, so a screen that
451
+ // holds an edited value cannot turn a frozen amount, destination or note into a confirmed one.
452
+ const proposed = proposedDestination(intent);
453
+ const destination = form.destination;
362
454
  return v.parse(AndCoNativeIntentCommandSchema, intent.type === "deposit"
363
455
  ? {
364
456
  action: "fund_deposit",
365
457
  sourceAccountId: form.source,
366
- amount: Number(data.funding?.pendingAmount ?? intent.progress.remaining ?? form.amount),
458
+ amount: data.funding?.pendingAmount ?? intent.progress.remaining ?? form.amount,
367
459
  note: form.note,
368
460
  }
369
461
  : {
370
- action: "confirm_withdrawal",
462
+ action: "confirm_transfer",
371
463
  sourceAccountId: form.source || undefined,
372
- note: frozen ? undefined : form.note,
464
+ note: !frozen && intent.note?.editable ? form.note : undefined,
373
465
  amount: !frozen && intent.amount.editable ? form.amount : undefined,
374
- beneficiary: !frozen && intent.beneficiary.editable && beneficiary
466
+ destination: !frozen && proposed?.editable && destination
375
467
  ? {
376
- country: beneficiary.country,
377
- bank_id: beneficiary.bank_id,
378
- account_kind: beneficiary.account_kind,
379
- account_number: beneficiary.account_number,
380
- account_holder_id: beneficiary.account_holder_id,
381
- account_holder_name: beneficiary.account_holder_name,
468
+ type: "external",
469
+ bank_id: destination.bank_id,
470
+ account_type: destination.account_type,
471
+ account_id: destination.account_id,
472
+ holder_id: destination.holder_id,
473
+ holder_name: destination.holder_name,
382
474
  }
383
475
  : undefined,
384
476
  });
385
477
  }
386
478
  /** Validates the proposed command while preserving an already accepted deposit's frozen amount. */
387
479
  export function ANDCO_NATIVE_INTENT_FORM_VALID(data, form) {
388
- if (data.intent.type === "withdrawal" && data.sourceEditable && !form.source)
480
+ if (data.intent.type !== "deposit" && data.sourceEditable && !form.source)
389
481
  return false;
390
482
  try {
391
483
  const command = ANDCO_NATIVE_INTENT_COMMAND(data, form);