@andco/protocol 0.1.0-ti.2 → 0.1.0-ti.3
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/intent-input.d.ts +2 -12
- package/dist/intent-input.d.ts.map +1 -1
- package/dist/intent-input.js +2 -12
- package/dist/rest/contract.d.ts +11 -11
- package/dist/rest/intents.d.ts +1 -71
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +3 -23
- package/dist/rest/signatures.d.ts +10 -9
- package/dist/rest/signatures.d.ts.map +1 -1
- package/dist/rest/signatures.js +11 -10
- package/dist/rest/transfers.d.ts +16 -16
- package/dist/rest/transfers.d.ts.map +1 -1
- package/dist/rest/transfers.js +6 -6
- package/dist/transfer.d.ts +10 -10
- package/dist/transfer.d.ts.map +1 -1
- package/dist/transfer.js +10 -9
- package/dist/transport/generated/oauth-api.d.ts +13 -29
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/intents.d.ts +9 -1
- package/dist/transport/intents.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/rest/transfers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { InvalidCursor } from "./accounts.js";
|
|
3
3
|
import { InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, PayloadTooLarge, ServerError, TemporarilyUnavailable, UnsupportedMediaType, UnsupportedVersion } from "./common.js";
|
|
4
|
-
import { AmountOutOfGrant,
|
|
4
|
+
import { AmountOutOfGrant, BankConnectionUnavailable, BankRefused, BankRejected, BankReviewRequired, ExpiredSignedInstruction, IdempotencyConflict, IdempotencyKeyNotAllowed, InsufficientFunds, IntentInteractionRequired, InvalidDestination, InvalidSignedInstruction, InvalidSource, NotImplemented, TransferSenderIdentityUnavailable } from "./intents.js";
|
|
5
5
|
import { SIGNED_TRANSFER_MEDIA_TYPE } from "./signatures.js";
|
|
6
6
|
export { SIGNED_TRANSFER_MEDIA_TYPE };
|
|
7
7
|
declare const SenderMismatch_base: (abstract new (data: {}, message?: string, hint?: string) => {
|
|
@@ -120,8 +120,8 @@ export declare const Transfer: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
|
120
120
|
national_id: string | null;
|
|
121
121
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
122
122
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
123
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
124
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
123
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
124
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
125
125
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
126
126
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
127
127
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -236,8 +236,8 @@ export declare const createTransfer: import("@orpc/contract").ProcedureContractB
|
|
|
236
236
|
national_id: string | null;
|
|
237
237
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
238
238
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
239
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
240
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
239
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
240
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
241
241
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
242
242
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
243
243
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -271,7 +271,7 @@ export declare const createTransfer: import("@orpc/contract").ProcedureContractB
|
|
|
271
271
|
jti: string | null;
|
|
272
272
|
transaction_id: string | null;
|
|
273
273
|
created_at: string;
|
|
274
|
-
}, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof
|
|
274
|
+
}, "A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent.">]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof SenderMismatch, typeof TransferSenderIdentityUnavailable, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof BankConnectionUnavailable, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
|
|
275
275
|
/** Reads one Transfer the Grant may read. */
|
|
276
276
|
export declare const getTransfer: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
277
277
|
readonly transfer_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
@@ -334,8 +334,8 @@ export declare const getTransfer: import("@orpc/contract").ProcedureContractBuil
|
|
|
334
334
|
national_id: string | null;
|
|
335
335
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
336
336
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
337
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
338
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
337
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
338
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
339
339
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
340
340
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
341
341
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -436,8 +436,8 @@ export declare const TransferPage: v.SchemaWithPipe<readonly [v.StrictObjectSche
|
|
|
436
436
|
national_id: string | null;
|
|
437
437
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
438
438
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
439
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
440
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
439
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
440
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
441
441
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
442
442
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
443
443
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -592,8 +592,8 @@ export declare const listTransfers: import("@orpc/contract").ProcedureContractBu
|
|
|
592
592
|
national_id: string | null;
|
|
593
593
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
594
594
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
595
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
596
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
595
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
596
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
597
597
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
598
598
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
599
599
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -744,8 +744,8 @@ export declare const TransferListPage: v.SchemaWithPipe<readonly [v.StrictObject
|
|
|
744
744
|
national_id: string | null;
|
|
745
745
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
746
746
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
747
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
748
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
747
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
748
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
749
749
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
750
750
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
751
751
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -899,8 +899,8 @@ export declare const listAccountTransfers: import("@orpc/contract").ProcedureCon
|
|
|
899
899
|
national_id: string | null;
|
|
900
900
|
}, "The Receptor: the account the money lands on and its holder.">]>;
|
|
901
901
|
readonly comment: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.">]>;
|
|
902
|
-
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
903
|
-
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer
|
|
902
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).">]>;
|
|
903
|
+
readonly jti: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>, undefined>, v.DescriptionAction<string | null, "The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.">]>;
|
|
904
904
|
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.">]>;
|
|
905
905
|
readonly created_at: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.DescriptionAction<string, "When the Transfer came to exist.">]>;
|
|
906
906
|
}, undefined>, v.DescriptionAction<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../src/rest/transfers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAO7B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAIL,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,e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;;;;;;;YAG5B,CAAC;AAEF,8CAA8C;AAC9C,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtE,qEAAqE;AACrE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0PAiCN,CAAC"}
|
package/dist/rest/transfers.js
CHANGED
|
@@ -5,7 +5,7 @@ import { InvalidCursor } from "./accounts.js";
|
|
|
5
5
|
import { AndcoAPIError, errors } from "./api-error.js";
|
|
6
6
|
import { connection, cursorlessConnection, ForwardPageQuery, InsufficientAuthorization, InvalidIdentifier, InvalidOrigin, InvalidRequest, InvalidToken, NotFound, PayloadTooLarge, ServerError, TemporarilyUnavailable, UnsupportedMediaType, UnsupportedVersion, } from "./common.js";
|
|
7
7
|
import { http } from "./http.js";
|
|
8
|
-
import { AmountOutOfGrant,
|
|
8
|
+
import { AmountOutOfGrant, BankConnectionUnavailable, BankRefused, BankRejected, BankReviewRequired, ExpiredSignedInstruction, IdempotencyConflict, IdempotencyKeyNotAllowed, InsufficientFunds, IntentInteractionRequired, InvalidDestination, InvalidSignedInstruction, InvalidSource, NotImplemented, TransferSenderIdentityUnavailable, } from "./intents.js";
|
|
9
9
|
import { SIGNED_TRANSFER_MEDIA_TYPE } from "./signatures.js";
|
|
10
10
|
export { SIGNED_TRANSFER_MEDIA_TYPE };
|
|
11
11
|
const uuid = /* @__PURE__ */ v.pipe(v.string(), v.uuid());
|
|
@@ -66,8 +66,8 @@ export const Transfer = /* @__PURE__ */ v.pipe(v.strictObject({
|
|
|
66
66
|
sender: v.pipe(TransferPartySchema, v.description("The Remitente: the account the money leaves and its holder.")),
|
|
67
67
|
receiver: v.pipe(TransferPartySchema, v.description("The Receptor: the account the money lands on and its holder.")),
|
|
68
68
|
comment: v.pipe(v.nullable(v.string()), v.description("The Nota de operación, at most 60 bytes of UTF-8, or null when there is none.")),
|
|
69
|
-
intent_id: v.pipe(v.nullable(uuid), v.description("The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
70
|
-
jti: v.pipe(v.nullable(SignedTransferJtiSchema), v.description("The `jti` of the signed transfer
|
|
69
|
+
intent_id: v.pipe(v.nullable(uuid), v.description("The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request).")),
|
|
70
|
+
jti: v.pipe(v.nullable(SignedTransferJtiSchema), v.description("The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one.")),
|
|
71
71
|
transaction_id: v.pipe(v.nullable(v.string()), v.description("The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id.")),
|
|
72
72
|
created_at: v.pipe(dateTime, v.description("When the Transfer came to exist.")),
|
|
73
73
|
}), v.description("A Transfer, with one shape for every origin. `sender` and `receiver` have the same fields, and `amount` and `currency` sit on the Transfer. It has no `approved` and no deadline: the decision belongs to the Intent."));
|
|
@@ -78,12 +78,12 @@ export const createTransfer = /* @__PURE__ */ oc
|
|
|
78
78
|
method: "POST",
|
|
79
79
|
path: "/transfers",
|
|
80
80
|
summary: "Submit a signed transfer",
|
|
81
|
-
description: "Submits one Transfer as a Signed Instruction: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization sent as `application/jose+json`, whose payload is `SignedTransferClaims`. Every value the operation uses comes from the verified claims; the envelope is kept unchanged. Any other `Content-Type` answers `415 unsupported_media_type`, and an `Idempotency-Key` header `400 idempotency_key_not_allowed`: the `jti` is the idempotency-key.\n\
|
|
81
|
+
description: "Submits one Transfer as a Signed Instruction: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization sent as `application/jose+json`, whose payload is `SignedTransferClaims`. Every value the operation uses comes from the verified claims; the envelope is kept unchanged. Any other `Content-Type` answers `415 unsupported_media_type`, and an `Idempotency-Key` header `400 idempotency_key_not_allowed`: the `jti` is the idempotency-key.\n\nThis route is the approval: the claims carry no `approved` (an envelope that still carries it is refused with `invalid_claims`), and submitting here approves the transfer now, so the Transfer exists as soon as it is submitted, with no decision to wait for. To have a member of the holder decide first in AndCo (dual control), send the same kind of envelope to `POST /intents` instead.\n\nBefore anything is stored: the token's Grant must hold `bank_transfer` `create` (`403 insufficient_authorization`). The envelope must have its shape and at least one signature, each with a protected header of `typ` `transfer.v1+jwt` (`400 invalid_signed_instruction` with `reason` `malformed_assertion` and its `issues`, or `missing_signature`). Every signature must verify, each with a key of a person who may sign for the holder, the Grant's subject (a key belongs to a person, who registers it in her own settings): `unknown_key` (a `kid` that is no key of such a person, a key of another person included), `revoked_key`, `expired_key`, `unusable_key`, `disallowed_algorithm` or `invalid_signature`. `unusable_key` means that the key is registered, but AndCo could not load it to check this signature: its person registers a new key and revokes this one, then you sign again. The claims must be `SignedTransferClaims` (`invalid_claims` with `issues`; the `jti` must be a UUID in lowercase) and `iss` the presenting client (`wrong_issuer`); an `exp` that passed answers `401 expired_signed_instruction`, and the `exp` of a new `jti` less than 15 minutes after the submission `400 invalid_signed_instruction` with `reason` `expiration_too_soon` (nothing is stored), so sign with an `exp` at least 15 minutes ahead (`bank-sdk` signs 30 minutes ahead). The floor applies only to a new `jti`: the same instruction sent again (same `jti`, same content) is never refused for it, however little of its `exp` is left, and answers or releases the same Transfer as before. That is how a stored Transfer is released after `409 interaction_required` or `503 temporarily_unavailable`. A client that lost the answer can also read the Transfer with `GET /transfers?jti=`, which finds it even after its `exp`. The `sender` must be an AndCo account of the holder that the Grant's `sources` cover (`422 invalid_source`, found by its `account_number`) and must match it (`422 sender_mismatch`; `422 transfer_sender_identity_unavailable` while AndCo knows no RUT for the holder). The Grant's `destinations` must cover the `receiver` (`422 invalid_destination`) and its limits the amount (`422 amount_out_of_grant`). The signed transfer needs `bank_transfer` `approve` within its maximum: `403 insufficient_authorization` otherwise, never a transfer that waits silently.\n\nThe same `jti` with the same claims answers the same Transfer and never moves money twice; the same `jti` with any other content, `exp` included, answers `409 idempotency_conflict`. To sign again with a new `exp`, use a new `jti`.\n\n`unsynced_key`: a key that signed the transfer is not active for transfers yet. The person who registered it activates it in her settings, with one AndCo verification. Then send the same envelope again.\n\nA transfer between two accounts of the same holder works where AndCo serves that rail (otherwise `501 not_implemented` with `code: own_account_transfer_not_implemented`): it is released at once with nobody present and answers `processing` or `succeeded`, or the release's refusals of `POST /intents/{intent_id}/approve` (`409 interaction_required` with `bank_connection_*` when the web session that acts for the holder needs its person; sending the same instruction again once they acted releases it). A transfer that leaves its holder answers `501 not_implemented` with `code: signed_outgoing_transfer_not_implemented` while AndCo does not serve that rail, and nothing is created; otherwise it is sent at once with nobody present: no web AndPass and no SMS code, because the signature itself authorizes it. It is still screened. It answers `processing` once AndCo accepts it, and later `succeeded`; it answers `failed` with its `status_detail` when the screening refuses it (`fraud_rejected`), when the signature is refused (`unknown_key`, `revoked_key`, `invalid_signature`, `expired_signed_instruction`, `sender_mismatch`) or when the bank refuses the request (`bank_refused`). A signature that needs a proof only a person can give fails too: send the same transfer as an Intent that a person confirms. On either rail, a key that signed it and is revoked or expired when the Transfer executes fails it with `expired_key` or `revoked_key`, even if the key was valid at submission, and nothing is sent; so does a key AndCo no longer holds, with `unknown_key`, for one that leaves its holder. While no final answer is known it reads `processing`: read it later with `GET /transfers/{transfer_id}`, or send the same envelope again, which never moves money twice. `503 temporarily_unavailable` means it was stored and not sent, because the sender account already had two transfer evaluations in the last minute (the `message` says until when): send the same envelope again after that. `409 interaction_required` with `bank_connection_*` means the web session that acts for the holder needs its person, and nothing was created.",
|
|
82
82
|
successStatus: 201,
|
|
83
83
|
successDescription: "The Transfer submitted, or the same one from a repeated instruction",
|
|
84
84
|
spec: servedAsSignedTransfer,
|
|
85
85
|
}))
|
|
86
|
-
.errors(errors(InvalidRequest, IdempotencyKeyNotAllowed,
|
|
86
|
+
.errors(errors(InvalidRequest, IdempotencyKeyNotAllowed, InvalidSignedInstruction, InvalidToken, ExpiredSignedInstruction, InvalidOrigin, InsufficientAuthorization, UnsupportedVersion, ServerError, IdempotencyConflict, IntentInteractionRequired, PayloadTooLarge, UnsupportedMediaType, SenderMismatch, TransferSenderIdentityUnavailable, AmountOutOfGrant, InvalidSource, InvalidDestination, BankConnectionUnavailable, BankRefused, InsufficientFunds, BankRejected, BankReviewRequired, NotImplemented, TemporarilyUnavailable))
|
|
87
87
|
.input(SignedTransferEnvelopeSchema)
|
|
88
88
|
.output(Transfer);
|
|
89
89
|
/** Reads one Transfer the Grant may read. */
|
|
@@ -112,7 +112,7 @@ export const listTransfers = /* @__PURE__ */ oc
|
|
|
112
112
|
method: "GET",
|
|
113
113
|
path: "/transfers",
|
|
114
114
|
summary: "Find a Transfer by the jti of its signed instruction",
|
|
115
|
-
description: "It finds one Transfer by the `jti` of the signed transfer
|
|
115
|
+
description: "It finds one Transfer by the `jti` of the signed transfer that submitted it through `POST /transfers`, and `jti` is required (`400 invalid_request` when it is missing or is not a UUID in lowercase). The answer is a collection of zero or one Transfer, with the reach of `GET /transfers/{transfer_id}`. A `jti` belongs to the client and the Grant's subject, across the client's Grants: a `jti` that another client or another subject used finds nothing, and so does the `jti` of a signed Intent, which stays on the Intent even after it is approved. The collection is empty in those cases, so no answer tells them apart. It finds a Transfer whose `exp` has passed, which is its purpose: after a lost answer to `POST /transfers`, read by `jti` before signing again. To list the Transfers of an account, use `GET /accounts/{bank_account_id}/transfers`.",
|
|
116
116
|
successDescription: "The Transfers found: zero or one",
|
|
117
117
|
}))
|
|
118
118
|
.errors(errors(InvalidRequest, InvalidToken, InvalidOrigin, UnsupportedVersion, ServerError, TemporarilyUnavailable))
|
package/dist/transfer.d.ts
CHANGED
|
@@ -182,19 +182,21 @@ export type TransferParty = v.InferOutput<typeof TransferPartySchema>;
|
|
|
182
182
|
export declare const SignedTransferJtiSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>;
|
|
183
183
|
/**
|
|
184
184
|
* The claims of a signed transfer, version 2: `sender`, `receiver` and `comment`, signed, plus the
|
|
185
|
-
* envelope (`iss`, `aud`, `jti`, `exp`)
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
185
|
+
* envelope (`iss`, `aud`, `jti`, `exp`). `metadata` is the signer's own data, kept as it arrives and
|
|
186
|
+
* read by nothing that decides; there is no `expires_at`, `iat` or `nbf`, because the deadline is
|
|
187
|
+
* `exp`. The API verifies the signature and executes the payload as signed, so nothing here names an
|
|
188
|
+
* Account Key or an AndCo account id, and an unknown claim is refused.
|
|
189
189
|
*
|
|
190
190
|
* - `jti` is a lowercase UUID: it names the Transfer and is its idempotency-key.
|
|
191
191
|
* - `exp` bounds execution, and is part of what the `jti` names.
|
|
192
|
-
* - `approved
|
|
193
|
-
* `
|
|
192
|
+
* - There is no `approved`: the approval travels outside the signature, and the route decides it.
|
|
193
|
+
* `POST /transfers` sends the transfer now (the Grant needs `bank_transfer` `approve`); `POST /intents`
|
|
194
|
+
* makes it an Intent that waits for a member's approval in AndCo until `min(exp, 24 h)`, and on
|
|
195
|
+
* approval AndCo sends this same signed instruction. Claims that carry `approved` are refused.
|
|
194
196
|
*
|
|
195
197
|
* @example
|
|
196
198
|
* const claims: SignedTransferClaims = {
|
|
197
|
-
* iss: clientId, aud: "https://api.andco.com", jti: crypto.randomUUID(), exp: 1795000000,
|
|
199
|
+
* iss: clientId, aud: "https://api.andco.com", jti: crypto.randomUUID(), exp: 1795000000,
|
|
198
200
|
* sender, receiver, comment: "Factura 42",
|
|
199
201
|
* };
|
|
200
202
|
*/
|
|
@@ -203,7 +205,6 @@ export declare const SignedTransferClaimsSchema: v.SchemaWithPipe<readonly [v.St
|
|
|
203
205
|
readonly aud: v.LiteralSchema<"https://api.andco.com", undefined>;
|
|
204
206
|
readonly jti: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>, v.RegexAction<string, "jti must be a lowercase UUID">, v.DescriptionAction<string, "A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict.">]>;
|
|
205
207
|
readonly exp: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.DescriptionAction<number, "Unix seconds after which the transfer is refused.">]>;
|
|
206
|
-
readonly approved: v.SchemaWithPipe<readonly [v.BooleanSchema<undefined>, v.DescriptionAction<boolean, "`true` orders the transfer sent as soon as it is submitted, which needs `bank_transfer` `approve` in the Grant.">]>;
|
|
207
208
|
readonly sender: v.SchemaWithPipe<readonly [v.VariantSchema<"country", [v.StrictObjectSchema<{
|
|
208
209
|
country: v.LiteralSchema<"CL", undefined>;
|
|
209
210
|
bank_code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.DescriptionAction<string, "The bank's four-digit code, as `GET /catalogs/banks` lists it. AndCo is `0739`.">]>;
|
|
@@ -253,7 +254,6 @@ export declare const SignedTransferClaimsSchema: v.SchemaWithPipe<readonly [v.St
|
|
|
253
254
|
aud: "https://api.andco.com";
|
|
254
255
|
jti: string;
|
|
255
256
|
exp: number;
|
|
256
|
-
approved: boolean;
|
|
257
257
|
sender: {
|
|
258
258
|
country: "CL";
|
|
259
259
|
bank_code: string;
|
|
@@ -279,7 +279,7 @@ export declare const SignedTransferClaimsSchema: v.SchemaWithPipe<readonly [v.St
|
|
|
279
279
|
metadata?: {
|
|
280
280
|
[x: string]: unknown;
|
|
281
281
|
} | undefined;
|
|
282
|
-
}, "The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti
|
|
282
|
+
}, "The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti` and `exp`. There is no `approved`: the route decides it (`POST /transfers` sends the transfer now, `POST /intents` makes it an Intent that waits for a decision). Strict: an unknown claim (`approved` included), country or document is refused, nothing names an Account Key or an AndCo account id, and the only deadline is `exp`.">]>;
|
|
283
283
|
/** The claims of a signed transfer, version 2. */
|
|
284
284
|
export type SignedTransferClaims = v.InferOutput<typeof SignedTransferClaimsSchema>;
|
|
285
285
|
/** The most bytes of a transfer's comment, counted in UTF-8. */
|
package/dist/transfer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../src/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,KAAK,KAAK,EAAsB,KAAK,WAAW,EAAkB,MAAM,aAAa,CAAC;AAE/F;;;GAGG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,0MAI1B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCrB,CAAC;AAEX,mCAAmC;AACnC,eAAO,MAAM,mBAAmB,aAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,sVAQvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,qNAGrC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAkClF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;gPAKhC,CAAC;AAEF,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE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E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEpF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;8NAoBxC,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAaxF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,sBAAsB,GAAG,KAAK,EAAE,CAetF;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAE/F"}
|
package/dist/transfer.js
CHANGED
|
@@ -152,19 +152,21 @@ export const TransferPartySchema = /* @__PURE__ */ v.pipe(v.strictObject({
|
|
|
152
152
|
export const SignedTransferJtiSchema = /* @__PURE__ */ v.pipe(v.string(), v.uuid(), v.regex(/^[0-9a-f-]{36}$/, "jti must be a lowercase UUID"), v.description("A UUID in lowercase. It names the Transfer: it is its idempotency-key. The same `jti` with other content is a conflict."));
|
|
153
153
|
/**
|
|
154
154
|
* The claims of a signed transfer, version 2: `sender`, `receiver` and `comment`, signed, plus the
|
|
155
|
-
* envelope (`iss`, `aud`, `jti`, `exp`)
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
155
|
+
* envelope (`iss`, `aud`, `jti`, `exp`). `metadata` is the signer's own data, kept as it arrives and
|
|
156
|
+
* read by nothing that decides; there is no `expires_at`, `iat` or `nbf`, because the deadline is
|
|
157
|
+
* `exp`. The API verifies the signature and executes the payload as signed, so nothing here names an
|
|
158
|
+
* Account Key or an AndCo account id, and an unknown claim is refused.
|
|
159
159
|
*
|
|
160
160
|
* - `jti` is a lowercase UUID: it names the Transfer and is its idempotency-key.
|
|
161
161
|
* - `exp` bounds execution, and is part of what the `jti` names.
|
|
162
|
-
* - `approved
|
|
163
|
-
* `
|
|
162
|
+
* - There is no `approved`: the approval travels outside the signature, and the route decides it.
|
|
163
|
+
* `POST /transfers` sends the transfer now (the Grant needs `bank_transfer` `approve`); `POST /intents`
|
|
164
|
+
* makes it an Intent that waits for a member's approval in AndCo until `min(exp, 24 h)`, and on
|
|
165
|
+
* approval AndCo sends this same signed instruction. Claims that carry `approved` are refused.
|
|
164
166
|
*
|
|
165
167
|
* @example
|
|
166
168
|
* const claims: SignedTransferClaims = {
|
|
167
|
-
* iss: clientId, aud: "https://api.andco.com", jti: crypto.randomUUID(), exp: 1795000000,
|
|
169
|
+
* iss: clientId, aud: "https://api.andco.com", jti: crypto.randomUUID(), exp: 1795000000,
|
|
168
170
|
* sender, receiver, comment: "Factura 42",
|
|
169
171
|
* };
|
|
170
172
|
*/
|
|
@@ -173,12 +175,11 @@ export const SignedTransferClaimsSchema = /* @__PURE__ */ v.pipe(v.strictObject(
|
|
|
173
175
|
aud: v.literal(ANDCO_API_ORIGIN),
|
|
174
176
|
jti: SignedTransferJtiSchema,
|
|
175
177
|
exp: v.pipe(v.number(), v.integer(), v.description("Unix seconds after which the transfer is refused.")),
|
|
176
|
-
approved: v.pipe(v.boolean(), v.description("`true` orders the transfer sent as soon as it is submitted, which needs `bank_transfer` `approve` in the Grant.")),
|
|
177
178
|
sender: TransferSenderSchema,
|
|
178
179
|
receiver: TransferReceiverSchema,
|
|
179
180
|
comment: v.pipe(v.optional(v.string()), v.description("What both sides read next to the movement.")),
|
|
180
181
|
metadata: v.pipe(v.optional(v.record(v.string(), v.unknown())), v.description("The signer's own data, signed and kept as it arrives. Nothing reads it to decide anything.")),
|
|
181
|
-
}), v.description("The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti
|
|
182
|
+
}), v.description("The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti` and `exp`. There is no `approved`: the route decides it (`POST /transfers` sends the transfer now, `POST /intents` makes it an Intent that waits for a decision). Strict: an unknown claim (`approved` included), country or document is refused, nothing names an Account Key or an AndCo account id, and the only deadline is `exp`."));
|
|
182
183
|
/** The most bytes of a transfer's comment, counted in UTF-8. */
|
|
183
184
|
export const TRANSFER_COMMENT_MAX_BYTES = 60;
|
|
184
185
|
/**
|
|
@@ -174,7 +174,7 @@ export interface paths {
|
|
|
174
174
|
put?: never;
|
|
175
175
|
/**
|
|
176
176
|
* Create an intent under the exact OAuth Grant
|
|
177
|
-
* @description The same creation has three representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. An `application/jose+json` body is a signed transfer
|
|
177
|
+
* @description The same creation has three representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. An `application/jose+json` body is a signed transfer: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization, whose payload is `SignedTransferClaims` (no `approved`: this route is the request, `POST /transfers` the submission). It creates a transfer Intent that waits for a member of the holder to approve it in AndCo (dual control) and answers a TransferIntent with `transfer_id` null. The Intent waits until it is decided or until its deadline, `min(exp, 24 hours after its creation)`, passes; on approval AndCo sends that same signed instruction to the bank, so the Transfer is the one the signature describes. It is verified as `POST /transfers` verifies a signed transfer, with the same rules for the `jti` (a UUID in lowercase, and the only idempotency-key), `exp`, the keys, the `sender` and the `receiver`; the `unusable_key` reason means that the key is registered, but AndCo could not load it to check this signature, so its person registers a new key and revokes this one, then you sign again. A repeat of the same envelope answers the same Intent, and another body under the same `jti` answers `409 idempotency_conflict`. A signed account opening or closure with `approved: true` stays accepted here and is born approved. A string body sent as anything but `application/jwt` answers `415 unsupported_media_type`. A Signed Instruction that does not verify answers `400 invalid_signed_instruction` with its `reason`, and one whose `exp` passed `401 expired_signed_instruction`. A signed account Intent is born approved when the signing client's Grant holds the family's `approve` action (`bank_account`); otherwise it waits, like a proposal, for the person on the hosted screen or for `POST /intents/{intent_id}/approve` by a Grant that holds it. Opening and closing an account fail synchronously with `403 account_key_out_of_grant` when the account_key is outside the Grant's `accounts` patterns and with `409 account_key_taken` when the account_key names an account of the subject (always for a closed one; otherwise unless `upsert`). The new account's number arrives in the `account_opening.succeeded` event as `account: { id, accountKey, number, name }`. Once the request is valid and authorized (a malformed body is still `400 invalid_request` and a Grant without the permission still `403 insufficient_authorization`), an opening and a `bank_transfer` proposal between two accounts of the same holder work where the bank serves them: the answer is `201` with the Intent `requires_action` and its `authorization_url`, or, for a signed account Intent whose signer also holds the family's `approve`, the Intent born `approved`. A transfer that `bank_own_account_transfer` covers is released at once instead (below). Where the deployment's bank does not serve one, the same request answers `501 not_implemented` with `code: account_opening_not_implemented` or `code: own_account_transfer_not_implemented`; a closure always answers `501 not_implemented` with `code: account_closure_not_implemented`. Nothing is created in those cases. A subject without a bank connection to a company cannot open an account: `422 bank_connection_unavailable` with the `intent_id`. A signed account Intent born approved answers the refusals of `POST /intents/{intent_id}/approve`.
|
|
178
178
|
*
|
|
179
179
|
* A `transfer` proposal needs `bank_transfer` `create` or `bank_own_account_transfer` `create`. When the Grant holds `bank_own_account_transfer` `create` whose `accounts` cover the named `sender` and `receiver` (two different active accounts of the Grant's subject) and the amount is not `editable`, the answer is a TransferIntent born `approved` with `transfer_id` set: nobody decides it, and it is released at once with nobody present. Its outcome lives on the Transfer, which reads `processing` and then `succeeded` or `failed`, never on the Intent. The same `Idempotency-Key` never names both kinds of transfer (`409 idempotency_conflict`). Any other transfer is a `bank_transfer` proposal, bounded by that detail alone. A Grant that holds no `bank_transfer` `create` refuses what `bank_own_account_transfer` does not cover with nothing created: `422 destination_not_own_account` when the `receiver` is missing or is not an account of the subject, `422 invalid_source` when the `sender` is missing, unusable or outside `accounts`, `422 invalid_destination` when the `receiver` cannot receive (closed, another currency, the `sender` itself) or is outside `accounts`, and `400 invalid_request` with the detail `transfer_amount_not_editable` for an editable amount. Where the deployment's bank does not serve transfers between own accounts, `501 not_implemented` with `code: own_account_transfer_not_implemented`. If the release cannot go on because only a person can, the answer is `409 interaction_required` before anything is stored. If it fails after the Transfer was stored, the same request sent again releases that Transfer again and answers the same Intent. An approved Intent has no client cancel.
|
|
180
180
|
*/
|
|
@@ -194,7 +194,7 @@ export interface paths {
|
|
|
194
194
|
};
|
|
195
195
|
/**
|
|
196
196
|
* Find a Transfer by the jti of its signed instruction
|
|
197
|
-
* @description It finds one Transfer by the `jti` of the signed transfer
|
|
197
|
+
* @description It finds one Transfer by the `jti` of the signed transfer that submitted it through `POST /transfers`, and `jti` is required (`400 invalid_request` when it is missing or is not a UUID in lowercase). The answer is a collection of zero or one Transfer, with the reach of `GET /transfers/{transfer_id}`. A `jti` belongs to the client and the Grant's subject, across the client's Grants: a `jti` that another client or another subject used finds nothing, and so does the `jti` of a signed Intent, which stays on the Intent even after it is approved. The collection is empty in those cases, so no answer tells them apart. It finds a Transfer whose `exp` has passed, which is its purpose: after a lost answer to `POST /transfers`, read by `jti` before signing again. To list the Transfers of an account, use `GET /accounts/{bank_account_id}/transfers`.
|
|
198
198
|
*/
|
|
199
199
|
get: operations["listTransfers"];
|
|
200
200
|
put?: never;
|
|
@@ -202,13 +202,13 @@ export interface paths {
|
|
|
202
202
|
* Submit a signed transfer
|
|
203
203
|
* @description Submits one Transfer as a Signed Instruction: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization sent as `application/jose+json`, whose payload is `SignedTransferClaims`. Every value the operation uses comes from the verified claims; the envelope is kept unchanged. Any other `Content-Type` answers `415 unsupported_media_type`, and an `Idempotency-Key` header `400 idempotency_key_not_allowed`: the `jti` is the idempotency-key.
|
|
204
204
|
*
|
|
205
|
-
*
|
|
205
|
+
* This route is the approval: the claims carry no `approved` (an envelope that still carries it is refused with `invalid_claims`), and submitting here approves the transfer now, so the Transfer exists as soon as it is submitted, with no decision to wait for. To have a member of the holder decide first in AndCo (dual control), send the same kind of envelope to `POST /intents` instead.
|
|
206
206
|
*
|
|
207
|
-
* Before anything is stored: the token's Grant must hold `bank_transfer` `create` (`403 insufficient_authorization`). The envelope must have its shape and at least one signature, each with a protected header of `typ` `transfer.v1+jwt` (`400 invalid_signed_instruction` with `reason` `malformed_assertion` and its `issues`, or `missing_signature`). Every signature must verify, each with a key
|
|
207
|
+
* Before anything is stored: the token's Grant must hold `bank_transfer` `create` (`403 insufficient_authorization`). The envelope must have its shape and at least one signature, each with a protected header of `typ` `transfer.v1+jwt` (`400 invalid_signed_instruction` with `reason` `malformed_assertion` and its `issues`, or `missing_signature`). Every signature must verify, each with a key of a person who may sign for the holder, the Grant's subject (a key belongs to a person, who registers it in her own settings): `unknown_key` (a `kid` that is no key of such a person, a key of another person included), `revoked_key`, `expired_key`, `unusable_key`, `disallowed_algorithm` or `invalid_signature`. `unusable_key` means that the key is registered, but AndCo could not load it to check this signature: its person registers a new key and revokes this one, then you sign again. The claims must be `SignedTransferClaims` (`invalid_claims` with `issues`; the `jti` must be a UUID in lowercase) and `iss` the presenting client (`wrong_issuer`); an `exp` that passed answers `401 expired_signed_instruction`, and the `exp` of a new `jti` less than 15 minutes after the submission `400 invalid_signed_instruction` with `reason` `expiration_too_soon` (nothing is stored), so sign with an `exp` at least 15 minutes ahead (`bank-sdk` signs 30 minutes ahead). The floor applies only to a new `jti`: the same instruction sent again (same `jti`, same content) is never refused for it, however little of its `exp` is left, and answers or releases the same Transfer as before. That is how a stored Transfer is released after `409 interaction_required` or `503 temporarily_unavailable`. A client that lost the answer can also read the Transfer with `GET /transfers?jti=`, which finds it even after its `exp`. The `sender` must be an AndCo account of the holder that the Grant's `sources` cover (`422 invalid_source`, found by its `account_number`) and must match it (`422 sender_mismatch`; `422 transfer_sender_identity_unavailable` while AndCo knows no RUT for the holder). The Grant's `destinations` must cover the `receiver` (`422 invalid_destination`) and its limits the amount (`422 amount_out_of_grant`). The signed transfer needs `bank_transfer` `approve` within its maximum: `403 insufficient_authorization` otherwise, never a transfer that waits silently.
|
|
208
208
|
*
|
|
209
209
|
* The same `jti` with the same claims answers the same Transfer and never moves money twice; the same `jti` with any other content, `exp` included, answers `409 idempotency_conflict`. To sign again with a new `exp`, use a new `jti`.
|
|
210
210
|
*
|
|
211
|
-
*
|
|
211
|
+
* `unsynced_key`: a key that signed the transfer is not active for transfers yet. The person who registered it activates it in her settings, with one AndCo verification. Then send the same envelope again.
|
|
212
212
|
*
|
|
213
213
|
* A transfer between two accounts of the same holder works where AndCo serves that rail (otherwise `501 not_implemented` with `code: own_account_transfer_not_implemented`): it is released at once with nobody present and answers `processing` or `succeeded`, or the release's refusals of `POST /intents/{intent_id}/approve` (`409 interaction_required` with `bank_connection_*` when the web session that acts for the holder needs its person; sending the same instruction again once they acted releases it). A transfer that leaves its holder answers `501 not_implemented` with `code: signed_outgoing_transfer_not_implemented` while AndCo does not serve that rail, and nothing is created; otherwise it is sent at once with nobody present: no web AndPass and no SMS code, because the signature itself authorizes it. It is still screened. It answers `processing` once AndCo accepts it, and later `succeeded`; it answers `failed` with its `status_detail` when the screening refuses it (`fraud_rejected`), when the signature is refused (`unknown_key`, `revoked_key`, `invalid_signature`, `expired_signed_instruction`, `sender_mismatch`) or when the bank refuses the request (`bank_refused`). A signature that needs a proof only a person can give fails too: send the same transfer as an Intent that a person confirms. On either rail, a key that signed it and is revoked or expired when the Transfer executes fails it with `expired_key` or `revoked_key`, even if the key was valid at submission, and nothing is sent; so does a key AndCo no longer holds, with `unknown_key`, for one that leaves its holder. While no final answer is known it reads `processing`: read it later with `GET /transfers/{transfer_id}`, or send the same envelope again, which never moves money twice. `503 temporarily_unavailable` means it was stored and not sent, because the sender account already had two transfer evaluations in the last minute (the `message` says until when): send the same envelope again after that. `409 interaction_required` with `bank_connection_*` means the web session that acts for the holder needs its person, and nothing was created.
|
|
214
214
|
*/
|
|
@@ -563,8 +563,8 @@ export interface paths {
|
|
|
563
563
|
get?: never;
|
|
564
564
|
put?: never;
|
|
565
565
|
/**
|
|
566
|
-
* Verify a Signed Instruction against the
|
|
567
|
-
* @description Verifies the assertion's signature, `kid`, algorithm, issuer, audience and expiration against the Signing Keys the
|
|
566
|
+
* Verify a Signed Instruction against the keys of a person who may sign for the Grant's holder, without acting on it
|
|
567
|
+
* @description Verifies the assertion's signature, `kid`, algorithm, issuer, audience and expiration against the Signing Keys of a person who may sign for the Grant's holder (a key belongs to a person, who registers it in her own settings), and returns its verified claims untouched. Acts on nothing: this is the smallest surface that exercises signing end to end, so an integrator can confirm that the key registered for it, the `kid` its SDK derived and the claims it signs all line up before any of them is submitted to create, execute or approve an Intent. Requires only a valid OAuth bearer token, no scope or authorization detail.
|
|
568
568
|
*/
|
|
569
569
|
post: operations["verifySignature"];
|
|
570
570
|
delete?: never;
|
|
@@ -1346,7 +1346,7 @@ export interface components {
|
|
|
1346
1346
|
currency: "CLP";
|
|
1347
1347
|
value: string;
|
|
1348
1348
|
};
|
|
1349
|
-
/** @description The verified `kid`, algorithm and claims of a Signed Instruction that verified against the
|
|
1349
|
+
/** @description The verified `kid`, algorithm and claims of a Signed Instruction that verified against the keys of a person who may sign for the Grant's holder. `claims` is the decoded JWT payload as signed -- this operation checks only `exp` and `jti` structurally and otherwise passes every claim through untouched, so it never narrows to one Intent family's claim schema. */
|
|
1350
1350
|
SignedInstructionVerification: {
|
|
1351
1351
|
/** @description RFC 7638 JWK Thumbprint of the Signing Key that verified the assertion. */
|
|
1352
1352
|
key_id: string;
|
|
@@ -1356,7 +1356,7 @@ export interface components {
|
|
|
1356
1356
|
[key: string]: unknown;
|
|
1357
1357
|
};
|
|
1358
1358
|
};
|
|
1359
|
-
/** @description The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti
|
|
1359
|
+
/** @description The claims of a signed transfer (`typ` `transfer.v1+jwt`): `sender`, `receiver` and `comment` (with an optional `metadata`) plus `iss`, `aud`, `jti` and `exp`. There is no `approved`: the route decides it (`POST /transfers` sends the transfer now, `POST /intents` makes it an Intent that waits for a decision). Strict: an unknown claim (`approved` included), country or document is refused, nothing names an Account Key or an AndCo account id, and the only deadline is `exp`. */
|
|
1360
1360
|
SignedTransferClaims: {
|
|
1361
1361
|
/** @description The signing Project's `client_id`. */
|
|
1362
1362
|
iss: string;
|
|
@@ -1369,8 +1369,6 @@ export interface components {
|
|
|
1369
1369
|
jti: string;
|
|
1370
1370
|
/** @description Unix seconds after which the transfer is refused. */
|
|
1371
1371
|
exp: number;
|
|
1372
|
-
/** @description `true` orders the transfer sent as soon as it is submitted, which needs `bank_transfer` `approve` in the Grant. */
|
|
1373
|
-
approved: boolean;
|
|
1374
1372
|
sender: components["schemas"]["TransferSender"];
|
|
1375
1373
|
receiver: components["schemas"]["TransferReceiver"];
|
|
1376
1374
|
/** @description What both sides read next to the movement. */
|
|
@@ -1472,9 +1470,9 @@ export interface components {
|
|
|
1472
1470
|
};
|
|
1473
1471
|
/** @description The Nota de operación, at most 60 bytes of UTF-8, or null when there is none. */
|
|
1474
1472
|
comment: string | null;
|
|
1475
|
-
/** @description The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer
|
|
1473
|
+
/** @description The Intent this Transfer came from. Null for origin `emisor` (no request came first) and for a signed transfer submitted through `POST /transfers` (approved when it was submitted, so there was no request). */
|
|
1476
1474
|
intent_id: string | null;
|
|
1477
|
-
/** @description The `jti` of the signed transfer
|
|
1475
|
+
/** @description The `jti` of the signed transfer that submitted it through `POST /transfers`, a UUID in lowercase. Null for any other Transfer: the `jti` of a signed Intent stays on the Intent, even after it is approved. `GET /transfers?jti=` finds only a Transfer that has one. */
|
|
1478
1476
|
jti: string | null;
|
|
1479
1477
|
/** @description The ledger id of the debit once the Transfer succeeded, else null. A Movement carries the same id. */
|
|
1480
1478
|
transaction_id: string | null;
|
|
@@ -3975,7 +3973,7 @@ export interface operations {
|
|
|
3975
3973
|
"application/json": components["schemas"]["Intent"];
|
|
3976
3974
|
};
|
|
3977
3975
|
};
|
|
3978
|
-
/** @description `invalid_request`, `idempotency_key_not_allowed`, `
|
|
3976
|
+
/** @description `invalid_request`, `idempotency_key_not_allowed`, `invalid_signed_instruction` */
|
|
3979
3977
|
400: {
|
|
3980
3978
|
headers: {
|
|
3981
3979
|
[name: string]: unknown;
|
|
@@ -4003,13 +4001,6 @@ export interface operations {
|
|
|
4003
4001
|
message?: string;
|
|
4004
4002
|
/** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
|
|
4005
4003
|
hint?: string;
|
|
4006
|
-
} | {
|
|
4007
|
-
/** @constant */
|
|
4008
|
-
error: "approved_use_transfers";
|
|
4009
|
-
/** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
|
|
4010
|
-
message?: string;
|
|
4011
|
-
/** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
|
|
4012
|
-
hint?: string;
|
|
4013
4004
|
} | {
|
|
4014
4005
|
/** @constant */
|
|
4015
4006
|
error: "invalid_signed_instruction";
|
|
@@ -4667,7 +4658,7 @@ export interface operations {
|
|
|
4667
4658
|
"application/json": components["schemas"]["Transfer"];
|
|
4668
4659
|
};
|
|
4669
4660
|
};
|
|
4670
|
-
/** @description `invalid_request`, `idempotency_key_not_allowed`, `
|
|
4661
|
+
/** @description `invalid_request`, `idempotency_key_not_allowed`, `invalid_signed_instruction` */
|
|
4671
4662
|
400: {
|
|
4672
4663
|
headers: {
|
|
4673
4664
|
[name: string]: unknown;
|
|
@@ -4695,13 +4686,6 @@ export interface operations {
|
|
|
4695
4686
|
message?: string;
|
|
4696
4687
|
/** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
|
|
4697
4688
|
hint?: string;
|
|
4698
|
-
} | {
|
|
4699
|
-
/** @constant */
|
|
4700
|
-
error: "approval_required_use_intents";
|
|
4701
|
-
/** @description An English sentence for the developer reading a log. Never branch on it and never show it to a person. */
|
|
4702
|
-
message?: string;
|
|
4703
|
-
/** @description When present, an English sentence suggesting to the developer what to do about the error. Never branch on it and never show it to a person. */
|
|
4704
|
-
hint?: string;
|
|
4705
4689
|
} | {
|
|
4706
4690
|
/** @constant */
|
|
4707
4691
|
error: "invalid_signed_instruction";
|