TrackTransaction interface
This commit is contained in:
parent
8e8bada643
commit
bfc7b20100
@ -1807,6 +1807,69 @@ export const codecForDepositSuccess = (): Codec<DepositSuccess> =>
|
|||||||
.property("transaction_base_url", codecOptional(codecForString()))
|
.property("transaction_base_url", codecOptional(codecForString()))
|
||||||
.build("DepositSuccess");
|
.build("DepositSuccess");
|
||||||
|
|
||||||
|
export interface TrackTransactionWired {
|
||||||
|
// Raw wire transfer identifier of the deposit.
|
||||||
|
wtid: Base32String;
|
||||||
|
|
||||||
|
// When was the wire transfer given to the bank.
|
||||||
|
execution_time: TalerProtocolTimestamp;
|
||||||
|
|
||||||
|
// The contribution of this coin to the total (without fees)
|
||||||
|
coin_contribution: AmountString;
|
||||||
|
|
||||||
|
// Binary-only Signature_ with purpose TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE
|
||||||
|
// over a TALER_ConfirmWirePS
|
||||||
|
// whereby the exchange affirms the successful wire transfer.
|
||||||
|
exchange_sig: EddsaSignatureString;
|
||||||
|
|
||||||
|
// Public EdDSA key of the exchange that was used to generate the signature.
|
||||||
|
// Should match one of the exchange's signing keys from /keys. Again given
|
||||||
|
// explicitly as the client might otherwise be confused by clock skew as to
|
||||||
|
// which signing key was used.
|
||||||
|
exchange_pub: EddsaPublicKeyString;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const codecForTackTransactionWired = (): Codec<TrackTransactionWired> =>
|
||||||
|
buildCodecForObject<TrackTransactionWired>()
|
||||||
|
.property("wtid", codecForString())
|
||||||
|
.property("execution_time", codecForTimestamp)
|
||||||
|
.property("coin_contribution", codecForAmountString())
|
||||||
|
.property("exchange_sig", codecForString())
|
||||||
|
.property("exchange_pub", codecForString())
|
||||||
|
.build("TackTransactionWired");
|
||||||
|
|
||||||
|
interface TrackTransactionAccepted {
|
||||||
|
// Legitimization target that the merchant should
|
||||||
|
// use to check for its KYC status using
|
||||||
|
// the /kyc-check/$REQUIREMENT_ROW/... endpoint.
|
||||||
|
// Optional, not present if the deposit has not
|
||||||
|
// yet been aggregated to the point that a KYC
|
||||||
|
// need has been evaluated.
|
||||||
|
requirement_row?: number;
|
||||||
|
|
||||||
|
// True if the KYC check for the merchant has been
|
||||||
|
// satisfied. False does not mean that KYC
|
||||||
|
// is strictly needed, unless also a
|
||||||
|
// legitimization_uuid is provided.
|
||||||
|
kyc_ok: boolean;
|
||||||
|
|
||||||
|
// Time by which the exchange currently thinks the deposit will be executed.
|
||||||
|
// Actual execution may be later if the KYC check is not satisfied by then.
|
||||||
|
execution_time: TalerProtocolTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const codecForTackTransactionAccepted =
|
||||||
|
(): Codec<TrackTransactionAccepted> =>
|
||||||
|
buildCodecForObject<TrackTransactionAccepted>()
|
||||||
|
.property("requirement_row", codecOptional(codecForNumber()))
|
||||||
|
.property("kyc_ok", codecForBoolean())
|
||||||
|
.property("execution_time", codecForTimestamp)
|
||||||
|
.build("TackTransactionAccepted");
|
||||||
|
|
||||||
|
export type TrackTransaction =
|
||||||
|
| ({ type: "accepted" } & TrackTransactionAccepted)
|
||||||
|
| ({ type: "wired" } & TrackTransactionWired);
|
||||||
|
|
||||||
export interface PurseDeposit {
|
export interface PurseDeposit {
|
||||||
/**
|
/**
|
||||||
* Amount to be deposited, can be a fraction of the
|
* Amount to be deposited, can be a fraction of the
|
||||||
|
@ -548,6 +548,8 @@ export interface TransactionDeposit extends TransactionCommon {
|
|||||||
amountEffective: AmountString;
|
amountEffective: AmountString;
|
||||||
|
|
||||||
wireTransferDeadline: TalerProtocolTimestamp;
|
wireTransferDeadline: TalerProtocolTimestamp;
|
||||||
|
|
||||||
|
wireTransferProgress: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TransactionByIdRequest {
|
export interface TransactionByIdRequest {
|
||||||
|
@ -63,6 +63,7 @@ import {
|
|||||||
ExchangeAuditor,
|
ExchangeAuditor,
|
||||||
UnblindedSignature,
|
UnblindedSignature,
|
||||||
codecForPeerContractTerms,
|
codecForPeerContractTerms,
|
||||||
|
TrackTransaction,
|
||||||
} from "./taler-types.js";
|
} from "./taler-types.js";
|
||||||
import {
|
import {
|
||||||
AbsoluteTime,
|
AbsoluteTime,
|
||||||
@ -1624,8 +1625,7 @@ export interface AbortTransactionRequest {
|
|||||||
forceImmediateAbort?: boolean;
|
forceImmediateAbort?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const codecForAbortTransaction =
|
export const codecForAbortTransaction = (): Codec<AbortTransactionRequest> =>
|
||||||
(): Codec<AbortTransactionRequest> =>
|
|
||||||
buildCodecForObject<AbortTransactionRequest>()
|
buildCodecForObject<AbortTransactionRequest>()
|
||||||
.property("transactionId", codecForString())
|
.property("transactionId", codecForString())
|
||||||
.property("forceImmediateAbort", codecOptional(codecForBoolean()))
|
.property("forceImmediateAbort", codecOptional(codecForBoolean()))
|
||||||
@ -1685,10 +1685,7 @@ export interface TrackDepositGroupRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TrackDepositGroupResponse {
|
export interface TrackDepositGroupResponse {
|
||||||
responses: {
|
responses: TrackTransaction[];
|
||||||
status: number;
|
|
||||||
body: any;
|
|
||||||
}[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const codecForTrackDepositGroupRequest =
|
export const codecForTrackDepositGroupRequest =
|
||||||
|
Loading…
Reference in New Issue
Block a user