@daimo/sdk 1.8.0-beta.0 → 1.8.1
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/README.md +17 -0
- package/dist/client/createDaimoClient.d.ts +9 -1
- package/dist/client/createDaimoClient.d.ts.map +1 -1
- package/dist/client/createDaimoClient.js +23 -0
- package/dist/client/createDaimoClient.js.map +1 -1
- package/dist/common/account.d.ts +419 -13
- package/dist/common/account.d.ts.map +1 -1
- package/dist/common/account.js +278 -0
- package/dist/common/account.js.map +1 -1
- package/dist/common/frameReadiness.d.ts +22 -0
- package/dist/common/frameReadiness.d.ts.map +1 -0
- package/dist/common/frameReadiness.js +33 -0
- package/dist/common/frameReadiness.js.map +1 -0
- package/dist/common/frameReadiness.test.d.ts +2 -0
- package/dist/common/frameReadiness.test.d.ts.map +1 -0
- package/dist/common/frameReadiness.test.js +76 -0
- package/dist/common/frameReadiness.test.js.map +1 -0
- package/dist/native/DaimoFrameRN.d.ts +3 -2
- package/dist/native/DaimoFrameRN.d.ts.map +1 -1
- package/dist/native/DaimoFrameRN.js +20 -14
- package/dist/native/DaimoFrameRN.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/web/api/navTree.d.ts +3 -1
- package/dist/web/api/navTree.d.ts.map +1 -1
- package/dist/web/components/ChooseOptionPage.d.ts +2 -1
- package/dist/web/components/ChooseOptionPage.d.ts.map +1 -1
- package/dist/web/components/ChooseOptionPage.js +3 -4
- package/dist/web/components/ChooseOptionPage.js.map +1 -1
- package/dist/web/components/ChooseOptionPage.test.d.ts +2 -0
- package/dist/web/components/ChooseOptionPage.test.d.ts.map +1 -0
- package/dist/web/components/ChooseOptionPage.test.js +29 -0
- package/dist/web/components/ChooseOptionPage.test.js.map +1 -0
- package/dist/web/components/Countdown.d.ts +4 -1
- package/dist/web/components/Countdown.d.ts.map +1 -1
- package/dist/web/components/Countdown.js +24 -10
- package/dist/web/components/Countdown.js.map +1 -1
- package/dist/web/components/Countdown.test.d.ts +2 -0
- package/dist/web/components/Countdown.test.d.ts.map +1 -0
- package/dist/web/components/Countdown.test.js +16 -0
- package/dist/web/components/Countdown.test.js.map +1 -0
- package/dist/web/components/DaimoFrame.d.ts +3 -2
- package/dist/web/components/DaimoFrame.d.ts.map +1 -1
- package/dist/web/components/DaimoFrame.js +34 -16
- package/dist/web/components/DaimoFrame.js.map +1 -1
- package/dist/web/components/DaimoModal.d.ts.map +1 -1
- package/dist/web/components/DaimoModal.js +45 -32
- package/dist/web/components/DaimoModal.js.map +1 -1
- package/dist/web/components/ProgressPulse.d.ts +14 -0
- package/dist/web/components/ProgressPulse.d.ts.map +1 -0
- package/dist/web/components/ProgressPulse.js +15 -0
- package/dist/web/components/ProgressPulse.js.map +1 -0
- package/dist/web/components/account/AccountApplePayPage.d.ts +4 -3
- package/dist/web/components/account/AccountApplePayPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountApplePayPage.js +75 -40
- package/dist/web/components/account/AccountApplePayPage.js.map +1 -1
- package/dist/web/components/account/AccountApprovalPage.d.ts +34 -0
- package/dist/web/components/account/AccountApprovalPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountApprovalPage.js +145 -0
- package/dist/web/components/account/AccountApprovalPage.js.map +1 -0
- package/dist/web/components/account/AccountBankDetailsPage.d.ts +4 -3
- package/dist/web/components/account/AccountBankDetailsPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountBankDetailsPage.js +12 -10
- package/dist/web/components/account/AccountBankDetailsPage.js.map +1 -1
- package/dist/web/components/account/AccountBankPickerPage.d.ts +6 -9
- package/dist/web/components/account/AccountBankPickerPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountBankPickerPage.js +52 -23
- package/dist/web/components/account/AccountBankPickerPage.js.map +1 -1
- package/dist/web/components/account/AccountBankTransferSubmittedPage.d.ts +15 -0
- package/dist/web/components/account/AccountBankTransferSubmittedPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountBankTransferSubmittedPage.js +33 -0
- package/dist/web/components/account/AccountBankTransferSubmittedPage.js.map +1 -0
- package/dist/web/components/account/AccountDeeplinkPage.d.ts +3 -1
- package/dist/web/components/account/AccountDeeplinkPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountDeeplinkPage.js +17 -9
- package/dist/web/components/account/AccountDeeplinkPage.js.map +1 -1
- package/dist/web/components/account/AccountEnrollmentPage.d.ts +1 -4
- package/dist/web/components/account/AccountEnrollmentPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountEnrollmentPage.js +270 -236
- package/dist/web/components/account/AccountEnrollmentPage.js.map +1 -1
- package/dist/web/components/account/AccountInteracConfirmPage.d.ts +4 -3
- package/dist/web/components/account/AccountInteracConfirmPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountInteracConfirmPage.js +15 -23
- package/dist/web/components/account/AccountInteracConfirmPage.js.map +1 -1
- package/dist/web/components/account/AccountOtpCodeEntry.d.ts +2 -1
- package/dist/web/components/account/AccountOtpCodeEntry.d.ts.map +1 -1
- package/dist/web/components/account/AccountOtpCodeEntry.js +25 -6
- package/dist/web/components/account/AccountOtpCodeEntry.js.map +1 -1
- package/dist/web/components/account/AccountPaymentPage.d.ts +3 -2
- package/dist/web/components/account/AccountPaymentPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountPaymentPage.js +10 -5
- package/dist/web/components/account/AccountPaymentPage.js.map +1 -1
- package/dist/web/components/account/AccountPaymentResumePage.d.ts +8 -0
- package/dist/web/components/account/AccountPaymentResumePage.d.ts.map +1 -0
- package/dist/web/components/account/AccountPaymentResumePage.js +42 -0
- package/dist/web/components/account/AccountPaymentResumePage.js.map +1 -0
- package/dist/web/components/account/AccountPhoneOtpPage.d.ts +1 -3
- package/dist/web/components/account/AccountPhoneOtpPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountPhoneOtpPage.js +3 -40
- package/dist/web/components/account/AccountPhoneOtpPage.js.map +1 -1
- package/dist/web/components/account/AccountPhonePage.d.ts +1 -2
- package/dist/web/components/account/AccountPhonePage.d.ts.map +1 -1
- package/dist/web/components/account/AccountPhonePage.js +1 -2
- package/dist/web/components/account/AccountPhonePage.js.map +1 -1
- package/dist/web/components/account/AccountReadyPage.d.ts +2 -0
- package/dist/web/components/account/AccountReadyPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountReadyPage.js +7 -0
- package/dist/web/components/account/AccountReadyPage.js.map +1 -0
- package/dist/web/components/account/AccountRequestToPayPage.d.ts +28 -0
- package/dist/web/components/account/AccountRequestToPayPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountRequestToPayPage.js +79 -0
- package/dist/web/components/account/AccountRequestToPayPage.js.map +1 -0
- package/dist/web/components/account/AccountRipioOtpPage.d.ts +7 -0
- package/dist/web/components/account/AccountRipioOtpPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountRipioOtpPage.js +53 -0
- package/dist/web/components/account/AccountRipioOtpPage.js.map +1 -0
- package/dist/web/components/account/PaginatedEnrollmentForm.d.ts +4 -1
- package/dist/web/components/account/PaginatedEnrollmentForm.d.ts.map +1 -1
- package/dist/web/components/account/PaginatedEnrollmentForm.js +74 -8
- package/dist/web/components/account/PaginatedEnrollmentForm.js.map +1 -1
- package/dist/web/components/account/PaginatedEnrollmentForm.test.d.ts +2 -0
- package/dist/web/components/account/PaginatedEnrollmentForm.test.d.ts.map +1 -0
- package/dist/web/components/account/PaginatedEnrollmentForm.test.js +67 -0
- package/dist/web/components/account/PaginatedEnrollmentForm.test.js.map +1 -0
- package/dist/web/components/account/accountNav.d.ts +14 -10
- package/dist/web/components/account/accountNav.d.ts.map +1 -1
- package/dist/web/components/account/accountNav.js +60 -34
- package/dist/web/components/account/accountNav.js.map +1 -1
- package/dist/web/components/account/accountNav.test.js +148 -17
- package/dist/web/components/account/accountNav.test.js.map +1 -1
- package/dist/web/components/account/accountPaymentCompatibility.d.ts +40 -0
- package/dist/web/components/account/accountPaymentCompatibility.d.ts.map +1 -0
- package/dist/web/components/account/accountPaymentCompatibility.js +319 -0
- package/dist/web/components/account/accountPaymentCompatibility.js.map +1 -0
- package/dist/web/components/account/accountSessionRecreate.d.ts +15 -0
- package/dist/web/components/account/accountSessionRecreate.d.ts.map +1 -0
- package/dist/web/components/account/accountSessionRecreate.js +24 -0
- package/dist/web/components/account/accountSessionRecreate.js.map +1 -0
- package/dist/web/components/account/accountSessionRecreate.test.d.ts +2 -0
- package/dist/web/components/account/accountSessionRecreate.test.d.ts.map +1 -0
- package/dist/web/components/account/accountSessionRecreate.test.js +75 -0
- package/dist/web/components/account/accountSessionRecreate.test.js.map +1 -0
- package/dist/web/components/account/approvalInteractions.test.d.ts +2 -0
- package/dist/web/components/account/approvalInteractions.test.d.ts.map +1 -0
- package/dist/web/components/account/approvalInteractions.test.js +209 -0
- package/dist/web/components/account/approvalInteractions.test.js.map +1 -0
- package/dist/web/components/account/enrollmentProtocol.d.ts +76 -0
- package/dist/web/components/account/enrollmentProtocol.d.ts.map +1 -0
- package/dist/web/components/account/enrollmentProtocol.js +323 -0
- package/dist/web/components/account/enrollmentProtocol.js.map +1 -0
- package/dist/web/components/account/enrollmentProtocol.test.d.ts +2 -0
- package/dist/web/components/account/enrollmentProtocol.test.d.ts.map +1 -0
- package/dist/web/components/account/enrollmentProtocol.test.js +544 -0
- package/dist/web/components/account/enrollmentProtocol.test.js.map +1 -0
- package/dist/web/components/account/fiatPopup.d.ts +7 -2
- package/dist/web/components/account/fiatPopup.d.ts.map +1 -1
- package/dist/web/components/account/fiatPopup.js +16 -6
- package/dist/web/components/account/fiatPopup.js.map +1 -1
- package/dist/web/components/account/fiatPopup.test.js +8 -6
- package/dist/web/components/account/fiatPopup.test.js.map +1 -1
- package/dist/web/components/account/formSchemas.d.ts +6 -6
- package/dist/web/components/account/requestToPay.test.d.ts +2 -0
- package/dist/web/components/account/requestToPay.test.d.ts.map +1 -0
- package/dist/web/components/account/requestToPay.test.js +117 -0
- package/dist/web/components/account/requestToPay.test.js.map +1 -0
- package/dist/web/components/account/walletPayDetails.d.ts +8 -0
- package/dist/web/components/account/walletPayDetails.d.ts.map +1 -0
- package/dist/web/components/account/walletPayDetails.js +46 -0
- package/dist/web/components/account/walletPayDetails.js.map +1 -0
- package/dist/web/components/account/walletPayDetails.test.d.ts +2 -0
- package/dist/web/components/account/walletPayDetails.test.d.ts.map +1 -0
- package/dist/web/components/account/walletPayDetails.test.js +87 -0
- package/dist/web/components/account/walletPayDetails.test.js.map +1 -0
- package/dist/web/components/account/walletPayName.d.ts +8 -0
- package/dist/web/components/account/walletPayName.d.ts.map +1 -0
- package/dist/web/components/account/walletPayName.js +12 -0
- package/dist/web/components/account/walletPayName.js.map +1 -0
- package/dist/web/components/account/walletPayName.test.d.ts +2 -0
- package/dist/web/components/account/walletPayName.test.d.ts.map +1 -0
- package/dist/web/components/account/walletPayName.test.js +15 -0
- package/dist/web/components/account/walletPayName.test.js.map +1 -0
- package/dist/web/components/shared.d.ts.map +1 -1
- package/dist/web/components/shared.js +1 -1
- package/dist/web/components/shared.js.map +1 -1
- package/dist/web/hooks/accountAuthNav.d.ts.map +1 -1
- package/dist/web/hooks/accountAuthNav.js +1 -6
- package/dist/web/hooks/accountAuthNav.js.map +1 -1
- package/dist/web/hooks/accountAuthNav.test.js +9 -15
- package/dist/web/hooks/accountAuthNav.test.js.map +1 -1
- package/dist/web/hooks/locales/en.d.ts +3 -2
- package/dist/web/hooks/locales/en.d.ts.map +1 -1
- package/dist/web/hooks/locales/en.js +4 -3
- package/dist/web/hooks/locales/en.js.map +1 -1
- package/dist/web/hooks/locales/es.d.ts.map +1 -1
- package/dist/web/hooks/locales/es.js +4 -3
- package/dist/web/hooks/locales/es.js.map +1 -1
- package/dist/web/hooks/locales/ja.d.ts.map +1 -1
- package/dist/web/hooks/locales/ja.js +4 -3
- package/dist/web/hooks/locales/ja.js.map +1 -1
- package/dist/web/hooks/locales/ko.d.ts.map +1 -1
- package/dist/web/hooks/locales/ko.js +4 -3
- package/dist/web/hooks/locales/ko.js.map +1 -1
- package/dist/web/hooks/locales/pt.d.ts.map +1 -1
- package/dist/web/hooks/locales/pt.js +4 -3
- package/dist/web/hooks/locales/pt.js.map +1 -1
- package/dist/web/hooks/locales/zh.d.ts.map +1 -1
- package/dist/web/hooks/locales/zh.js +4 -3
- package/dist/web/hooks/locales/zh.js.map +1 -1
- package/dist/web/hooks/types.d.ts +15 -8
- package/dist/web/hooks/types.d.ts.map +1 -1
- package/dist/web/hooks/types.js.map +1 -1
- package/dist/web/hooks/useAccountFlow.d.ts +3 -9
- package/dist/web/hooks/useAccountFlow.d.ts.map +1 -1
- package/dist/web/hooks/useAccountFlow.js +0 -12
- package/dist/web/hooks/useAccountFlow.js.map +1 -1
- package/dist/web/hooks/useCreateDeposit.d.ts +20 -0
- package/dist/web/hooks/useCreateDeposit.d.ts.map +1 -0
- package/dist/web/hooks/useCreateDeposit.js +54 -0
- package/dist/web/hooks/useCreateDeposit.js.map +1 -0
- package/dist/web/hooks/useDepositPoller.js +1 -1
- package/dist/web/hooks/useDepositPoller.js.map +1 -1
- package/dist/web/hooks/useDraftDeposit.d.ts +3 -2
- package/dist/web/hooks/useDraftDeposit.d.ts.map +1 -1
- package/dist/web/hooks/useDraftDeposit.js +12 -5
- package/dist/web/hooks/useDraftDeposit.js.map +1 -1
- package/dist/web/hooks/useRequestToPayDeposit.d.ts +26 -0
- package/dist/web/hooks/useRequestToPayDeposit.d.ts.map +1 -0
- package/dist/web/hooks/useRequestToPayDeposit.js +81 -0
- package/dist/web/hooks/useRequestToPayDeposit.js.map +1 -0
- package/dist/web/hooks/useSessionNav.d.ts +5 -1
- package/dist/web/hooks/useSessionNav.d.ts.map +1 -1
- package/dist/web/hooks/useSessionNav.js +150 -21
- package/dist/web/hooks/useSessionNav.js.map +1 -1
- package/dist/web/isDesktopBrowser.d.ts +2 -0
- package/dist/web/isDesktopBrowser.d.ts.map +1 -0
- package/dist/web/isDesktopBrowser.js +6 -0
- package/dist/web/isDesktopBrowser.js.map +1 -0
- package/dist/web/styles.css +1 -1
- package/dist/web/theme.css +1 -1
- package/dist/web/theme.d.ts.map +1 -1
- package/dist/web/theme.js +3 -1
- package/dist/web/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import type { AccountDepositStatus,
|
|
1
|
+
import type { AccountDepositStatus, DepositPaymentInfo, DepositPaymentInteraction } from "../../../common/account.js";
|
|
2
2
|
import { type DaimoPlatform } from "../../platform.js";
|
|
3
3
|
/**
|
|
4
4
|
* Pick the modal page to resume at for a session with an existing deposit.
|
|
5
5
|
* Once payment is past the provider (or terminal), the status page owns the
|
|
6
6
|
* UX; earlier states re-enter the normal payment flow.
|
|
7
7
|
*/
|
|
8
|
-
export declare function getDepositResumeTarget(status: AccountDepositStatus): "account-status" | null;
|
|
8
|
+
export declare function getDepositResumeTarget(status: AccountDepositStatus, interaction?: DepositPaymentInteraction): "account-status" | null;
|
|
9
|
+
/** Expired interactive requests recover on their own semantic surface. */
|
|
10
|
+
export declare function shouldRecoverExpiredPayment(status: AccountDepositStatus, interaction: DepositPaymentInteraction): boolean;
|
|
9
11
|
/**
|
|
10
|
-
* Pick the modal entry page
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - apple_pay: single unified amount+Apple Pay page (Coinbase Headless)
|
|
12
|
+
* Pick the modal entry page from the server-advertised interaction.
|
|
13
|
+
* Wallet pay keeps its combined amount+widget screen; every other interaction
|
|
14
|
+
* starts with generic amount entry.
|
|
14
15
|
*/
|
|
15
|
-
export declare function getAccountPaymentEntryTarget(
|
|
16
|
+
export declare function getAccountPaymentEntryTarget(interaction: DepositPaymentInteraction): "account-amount" | "account-wallet-pay";
|
|
16
17
|
/**
|
|
17
|
-
* Pick the modal
|
|
18
|
-
* that use the two-step flow).
|
|
18
|
+
* Pick the modal renderer for an interaction after amount entry.
|
|
19
19
|
*/
|
|
20
|
-
export declare function getAccountPaymentAdvanceTarget(
|
|
20
|
+
export declare function getAccountPaymentAdvanceTarget(interaction: DepositPaymentInteraction, platform: DaimoPlatform): "account-approval" | "account-request-to-pay" | "account-institution-picker" | "account-institution-review" | "account-payment-instructions" | "account-wallet-pay";
|
|
21
|
+
/** Advance after institution selection without re-entering the legacy picker. */
|
|
22
|
+
export declare function getInstitutionSelectionAdvanceTarget(paymentFlow: DepositPaymentInteraction, platform: DaimoPlatform): "account-approval" | "account-request-to-pay" | "account-institution-picker" | "account-institution-review" | "account-payment-instructions" | "account-wallet-pay";
|
|
23
|
+
/** Fail closed when server-advertised intent and actual instructions diverge. */
|
|
24
|
+
export declare function isPaymentInteractionCompatible(interaction: DepositPaymentInteraction, payment: DepositPaymentInfo): boolean;
|
|
21
25
|
//# sourceMappingURL=accountNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountNav.d.ts","sourceRoot":"","sources":["../../../../src/web/components/account/accountNav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"accountNav.d.ts","sourceRoot":"","sources":["../../../../src/web/components/account/accountNav.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,oBAAoB,EAC5B,WAAW,CAAC,EAAE,yBAAyB,GACtC,gBAAgB,GAAG,IAAI,CAgBzB;AAED,0EAA0E;AAC1E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,oBAAoB,EAC5B,WAAW,EAAE,yBAAyB,GACrC,OAAO,CAQT;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,yBAAyB,2CAcvC;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,yBAAyB,EACtC,QAAQ,EAAE,aAAa,uKAsBxB;AAED,iFAAiF;AACjF,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,yBAAyB,EACtC,QAAQ,EAAE,aAAa,uKAMxB;AAED,iFAAiF;AACjF,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,yBAAyB,EACtC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAET"}
|
|
@@ -4,59 +4,85 @@ import { isDesktop } from "../../platform.js";
|
|
|
4
4
|
* Once payment is past the provider (or terminal), the status page owns the
|
|
5
5
|
* UX; earlier states re-enter the normal payment flow.
|
|
6
6
|
*/
|
|
7
|
-
export function getDepositResumeTarget(status) {
|
|
7
|
+
export function getDepositResumeTarget(status, interaction) {
|
|
8
8
|
switch (status) {
|
|
9
9
|
case "payment_received":
|
|
10
10
|
case "token_delivered":
|
|
11
11
|
case "completed":
|
|
12
12
|
case "failed":
|
|
13
|
-
case "expired":
|
|
14
13
|
return "account-status";
|
|
14
|
+
case "expired":
|
|
15
|
+
return interaction != null &&
|
|
16
|
+
shouldRecoverExpiredPayment(status, interaction)
|
|
17
|
+
? null
|
|
18
|
+
: "account-status";
|
|
15
19
|
case "initiated":
|
|
16
20
|
case "awaiting_payment":
|
|
17
21
|
return null;
|
|
18
22
|
}
|
|
19
23
|
}
|
|
24
|
+
/** Expired interactive requests recover on their own semantic surface. */
|
|
25
|
+
export function shouldRecoverExpiredPayment(status, interaction) {
|
|
26
|
+
if (status !== "expired")
|
|
27
|
+
return false;
|
|
28
|
+
return (interaction === "request-to-pay" ||
|
|
29
|
+
interaction === "institution-picker" ||
|
|
30
|
+
interaction === "hosted-approval" ||
|
|
31
|
+
interaction === "external-app-approval");
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
|
-
* Pick the modal entry page
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* - apple_pay: single unified amount+Apple Pay page (Coinbase Headless)
|
|
34
|
+
* Pick the modal entry page from the server-advertised interaction.
|
|
35
|
+
* Wallet pay keeps its combined amount+widget screen; every other interaction
|
|
36
|
+
* starts with generic amount entry.
|
|
25
37
|
*/
|
|
26
|
-
export function getAccountPaymentEntryTarget(
|
|
27
|
-
switch (
|
|
28
|
-
case "
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
case "
|
|
32
|
-
case "
|
|
33
|
-
case "
|
|
34
|
-
case "
|
|
35
|
-
case "
|
|
36
|
-
|
|
37
|
-
return "account-
|
|
38
|
+
export function getAccountPaymentEntryTarget(interaction) {
|
|
39
|
+
switch (interaction) {
|
|
40
|
+
case "wallet-pay-widget":
|
|
41
|
+
return "account-wallet-pay";
|
|
42
|
+
case "bank-picker":
|
|
43
|
+
case "bank-transfer":
|
|
44
|
+
case "directions":
|
|
45
|
+
case "external-app-approval":
|
|
46
|
+
case "hosted-approval":
|
|
47
|
+
case "institution-picker":
|
|
48
|
+
case "request-to-pay":
|
|
49
|
+
return "account-amount";
|
|
38
50
|
}
|
|
39
51
|
}
|
|
40
52
|
/**
|
|
41
|
-
* Pick the modal
|
|
42
|
-
* that use the two-step flow).
|
|
53
|
+
* Pick the modal renderer for an interaction after amount entry.
|
|
43
54
|
*/
|
|
44
|
-
export function getAccountPaymentAdvanceTarget(
|
|
45
|
-
switch (
|
|
46
|
-
case "
|
|
55
|
+
export function getAccountPaymentAdvanceTarget(interaction, platform) {
|
|
56
|
+
switch (interaction) {
|
|
57
|
+
case "institution-picker":
|
|
58
|
+
return "account-institution-picker";
|
|
59
|
+
case "bank-picker":
|
|
47
60
|
// JS-driven bank deeplinks (form-post popups, window.open) are
|
|
48
|
-
// unreliable on mobile — skip the picker, then review before
|
|
61
|
+
// unreliable on mobile — skip the picker, then review before opening.
|
|
49
62
|
return isDesktop(platform)
|
|
50
|
-
? "account-
|
|
51
|
-
: "account-
|
|
52
|
-
case "
|
|
53
|
-
case "
|
|
54
|
-
|
|
55
|
-
case "
|
|
56
|
-
return "account-
|
|
57
|
-
case "
|
|
58
|
-
|
|
59
|
-
return "account-
|
|
63
|
+
? "account-institution-picker"
|
|
64
|
+
: "account-institution-review";
|
|
65
|
+
case "bank-transfer":
|
|
66
|
+
case "directions":
|
|
67
|
+
return "account-payment-instructions";
|
|
68
|
+
case "request-to-pay":
|
|
69
|
+
return "account-request-to-pay";
|
|
70
|
+
case "hosted-approval":
|
|
71
|
+
case "external-app-approval":
|
|
72
|
+
return "account-approval";
|
|
73
|
+
case "wallet-pay-widget":
|
|
74
|
+
return "account-wallet-pay";
|
|
60
75
|
}
|
|
61
76
|
}
|
|
77
|
+
/** Advance after institution selection without re-entering the legacy picker. */
|
|
78
|
+
export function getInstitutionSelectionAdvanceTarget(paymentFlow, platform) {
|
|
79
|
+
if (paymentFlow === "bank-picker") {
|
|
80
|
+
return "account-institution-review";
|
|
81
|
+
}
|
|
82
|
+
return getAccountPaymentAdvanceTarget(paymentFlow, platform);
|
|
83
|
+
}
|
|
84
|
+
/** Fail closed when server-advertised intent and actual instructions diverge. */
|
|
85
|
+
export function isPaymentInteractionCompatible(interaction, payment) {
|
|
86
|
+
return interaction === payment.flow;
|
|
87
|
+
}
|
|
62
88
|
//# sourceMappingURL=accountNav.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountNav.js","sourceRoot":"","sources":["../../../../src/web/components/account/accountNav.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accountNav.js","sourceRoot":"","sources":["../../../../src/web/components/account/accountNav.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAA4B,EAC5B,WAAuC;IAEvC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,kBAAkB,CAAC;QACxB,KAAK,iBAAiB,CAAC;QACvB,KAAK,WAAW,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC;QAC1B,KAAK,SAAS;YACZ,OAAO,WAAW,IAAI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QAC3C,KAAK,iBAAiB,CAAC;QACvB,KAAK,uBAAuB;YAC1B,OAAO,kBAA2B,CAAC;QACrC,KAAK,mBAAmB;YACtB,OAAO,oBAA6B,CAAC;IACzC,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,oCAAoC,CAClD,WAAsC,EACtC,QAAuB;IAEvB,IAAI,WAAW,KAAK,aAAa,EAAE,CAAC;QAClC,OAAO,4BAAqC,CAAC;IAC/C,CAAC;IACD,OAAO,8BAA8B,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,8BAA8B,CAC5C,WAAsC,EACtC,OAA2B;IAE3B,OAAO,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
|
-
import { getAccountPaymentAdvanceTarget, getDepositResumeTarget, } from "./accountNav.js";
|
|
2
|
+
import { getAccountPaymentAdvanceTarget, getAccountPaymentEntryTarget, getDepositResumeTarget, getInstitutionSelectionAdvanceTarget, isPaymentInteractionCompatible, shouldRecoverExpiredPayment, } from "./accountNav.js";
|
|
3
|
+
import { getInstitutionPaymentContract, getNodePaymentInteraction, } from "./accountPaymentCompatibility.js";
|
|
3
4
|
const ALL_PLATFORMS = [
|
|
4
5
|
"desktop",
|
|
5
6
|
"mobile",
|
|
@@ -7,33 +8,141 @@ const ALL_PLATFORMS = [
|
|
|
7
8
|
"android",
|
|
8
9
|
"other",
|
|
9
10
|
];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const ALL_INTERACTIONS = [
|
|
12
|
+
"bank-picker",
|
|
13
|
+
"bank-transfer",
|
|
14
|
+
"directions",
|
|
15
|
+
"external-app-approval",
|
|
16
|
+
"hosted-approval",
|
|
17
|
+
"institution-picker",
|
|
18
|
+
"request-to-pay",
|
|
19
|
+
"wallet-pay-widget",
|
|
20
|
+
];
|
|
21
|
+
describe("interaction-driven account navigation", () => {
|
|
22
|
+
test("wallet pay keeps combined entry while other interactions enter amount", () => {
|
|
23
|
+
expect(getAccountPaymentEntryTarget("wallet-pay-widget")).toBe("account-wallet-pay");
|
|
24
|
+
for (const interaction of [
|
|
25
|
+
"bank-picker",
|
|
26
|
+
"bank-transfer",
|
|
27
|
+
"directions",
|
|
28
|
+
"external-app-approval",
|
|
29
|
+
"hosted-approval",
|
|
30
|
+
"institution-picker",
|
|
31
|
+
"request-to-pay",
|
|
32
|
+
]) {
|
|
33
|
+
expect(getAccountPaymentEntryTarget(interaction)).toBe("account-amount");
|
|
34
|
+
}
|
|
15
35
|
});
|
|
16
|
-
test("
|
|
36
|
+
test("institution picker preserves desktop and mobile choreography", () => {
|
|
37
|
+
expect(getAccountPaymentAdvanceTarget("bank-picker", "desktop")).toBe("account-institution-picker");
|
|
38
|
+
expect(getAccountPaymentAdvanceTarget("bank-picker", "other")).toBe("account-institution-picker");
|
|
17
39
|
for (const platform of ["mobile", "ios", "android"]) {
|
|
18
|
-
expect(getAccountPaymentAdvanceTarget("
|
|
40
|
+
expect(getAccountPaymentAdvanceTarget("bank-picker", platform)).toBe("account-institution-review");
|
|
19
41
|
}
|
|
20
42
|
});
|
|
21
|
-
test("
|
|
22
|
-
const
|
|
23
|
-
|
|
43
|
+
test("legacy selection advances to review instead of re-entering the picker", () => {
|
|
44
|
+
for (const platform of ALL_PLATFORMS) {
|
|
45
|
+
expect(getInstitutionSelectionAdvanceTarget("bank-picker", platform)).toBe("account-institution-review");
|
|
46
|
+
expect(getInstitutionSelectionAdvanceTarget("hosted-approval", platform)).toBe("account-approval");
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
test("every non-picker interaction has a platform-independent renderer", () => {
|
|
50
|
+
const expected = {
|
|
51
|
+
"bank-transfer": "account-payment-instructions",
|
|
52
|
+
directions: "account-payment-instructions",
|
|
53
|
+
"external-app-approval": "account-approval",
|
|
54
|
+
"hosted-approval": "account-approval",
|
|
55
|
+
"institution-picker": "account-institution-picker",
|
|
56
|
+
"request-to-pay": "account-request-to-pay",
|
|
57
|
+
"wallet-pay-widget": "account-wallet-pay",
|
|
58
|
+
};
|
|
59
|
+
for (const [interaction, target] of Object.entries(expected)) {
|
|
24
60
|
for (const platform of ALL_PLATFORMS) {
|
|
25
|
-
expect(getAccountPaymentAdvanceTarget(
|
|
61
|
+
expect(getAccountPaymentAdvanceTarget(interaction, platform)).toBe(target);
|
|
26
62
|
}
|
|
27
63
|
}
|
|
28
64
|
});
|
|
29
|
-
test("
|
|
30
|
-
for (const
|
|
31
|
-
|
|
65
|
+
test("actual payment flow must match the advertised interaction", () => {
|
|
66
|
+
for (const advertised of ALL_INTERACTIONS) {
|
|
67
|
+
for (const actual of ALL_INTERACTIONS) {
|
|
68
|
+
const payment = { flow: actual };
|
|
69
|
+
expect(isPaymentInteractionCompatible(advertised, payment)).toBe(advertised === actual);
|
|
70
|
+
}
|
|
32
71
|
}
|
|
33
72
|
});
|
|
73
|
+
test("uses server interaction without consulting the rail", () => {
|
|
74
|
+
const node = makeFiatNode("ach", "wallet-pay-widget");
|
|
75
|
+
expect(getNodePaymentInteraction(node)).toBe("wallet-pay-widget");
|
|
76
|
+
});
|
|
77
|
+
test("isolates temporary old-server rail fallback", () => {
|
|
78
|
+
expect(getNodePaymentInteraction(makeFiatNode("interac"))).toBe("bank-picker");
|
|
79
|
+
expect(getNodePaymentInteraction(makeFiatNode("apple_pay"))).toBe("wallet-pay-widget");
|
|
80
|
+
expect(getNodePaymentInteraction(makeFiatNode("ach"))).toBe("bank-transfer");
|
|
81
|
+
expect(getNodePaymentInteraction(makeFiatNode("sepa"))).toBe("bank-transfer");
|
|
82
|
+
expect(getNodePaymentInteraction(makeFiatNode("jpyc"))).toBe("directions");
|
|
83
|
+
expect(getNodePaymentInteraction(makeFiatNode("ars"))).toBe("bank-transfer");
|
|
84
|
+
});
|
|
85
|
+
test("isolates old bank-picker payload normalization", () => {
|
|
86
|
+
const payment = {
|
|
87
|
+
flow: "bank-picker",
|
|
88
|
+
currency: { code: "CAD", symbol: "CA$" },
|
|
89
|
+
qrUrl: "https://example.com/accept?rID=legacy-reference",
|
|
90
|
+
};
|
|
91
|
+
const contract = getInstitutionPaymentContract(payment, "25.00");
|
|
92
|
+
expect(contract.ui.review.fields).toEqual([
|
|
93
|
+
{ key: "sender", label: "Sender", value: "PayTrie AB Inc" },
|
|
94
|
+
{ key: "amount", label: "Amount", value: "CA$25.00 CAD" },
|
|
95
|
+
]);
|
|
96
|
+
expect(contract.ui.review.fieldsAfterInstitution).toEqual([
|
|
97
|
+
{
|
|
98
|
+
key: "processing_time",
|
|
99
|
+
label: "Processing time",
|
|
100
|
+
value: "5–30 min",
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
expect(contract.ui.waiting.instructions).toContain("5–30 min");
|
|
104
|
+
expect(contract.fallbackDeeplink).toEqual({
|
|
105
|
+
type: "redirect",
|
|
106
|
+
url: payment.qrUrl,
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
test("preserves server-owned UI when only the fallback action is absent", () => {
|
|
110
|
+
const institutionPaymentUi = {
|
|
111
|
+
picker: {
|
|
112
|
+
title: "Choose an institution",
|
|
113
|
+
searchPlaceholder: "Search institutions",
|
|
114
|
+
otherInstitutionsLabel: "More institutions",
|
|
115
|
+
},
|
|
116
|
+
review: {
|
|
117
|
+
title: "Review payment request",
|
|
118
|
+
description: "Review the request in your institution.",
|
|
119
|
+
fields: [{ key: "reference", label: "Reference", value: "abc-123" }],
|
|
120
|
+
institutionLabel: "Institution",
|
|
121
|
+
openInstitutionLabel: "Open",
|
|
122
|
+
openFallbackLabel: "Open request",
|
|
123
|
+
},
|
|
124
|
+
waiting: {
|
|
125
|
+
title: "Complete payment",
|
|
126
|
+
instructions: "Approve the request in your institution.",
|
|
127
|
+
openInstitutionLabel: "Open",
|
|
128
|
+
openFallbackLabel: "Open request",
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
const payment = {
|
|
132
|
+
flow: "bank-picker",
|
|
133
|
+
currency: { code: "USD", symbol: "$" },
|
|
134
|
+
qrUrl: "https://example.com/request/abc-123",
|
|
135
|
+
institutionPaymentUi,
|
|
136
|
+
};
|
|
137
|
+
const contract = getInstitutionPaymentContract(payment, "25.00");
|
|
138
|
+
expect(contract.ui).toBe(institutionPaymentUi);
|
|
139
|
+
expect(contract.fallbackDeeplink).toEqual({
|
|
140
|
+
type: "redirect",
|
|
141
|
+
url: payment.qrUrl,
|
|
142
|
+
});
|
|
143
|
+
});
|
|
34
144
|
});
|
|
35
145
|
describe("getDepositResumeTarget", () => {
|
|
36
|
-
// Exhaustive: adding a deposit status must force a decision here.
|
|
37
146
|
const ALL_STATUSES = [
|
|
38
147
|
"initiated",
|
|
39
148
|
"awaiting_payment",
|
|
@@ -55,10 +164,23 @@ describe("getDepositResumeTarget", () => {
|
|
|
55
164
|
expect(getDepositResumeTarget(status)).toBe("account-status");
|
|
56
165
|
}
|
|
57
166
|
});
|
|
58
|
-
test("pre-payment deposits re-enter the
|
|
167
|
+
test("pre-payment deposits re-enter the interaction flow", () => {
|
|
59
168
|
expect(getDepositResumeTarget("initiated")).toBeNull();
|
|
60
169
|
expect(getDepositResumeTarget("awaiting_payment")).toBeNull();
|
|
61
170
|
});
|
|
171
|
+
test("expired request-to-pay re-enters interaction recovery", () => {
|
|
172
|
+
expect(getDepositResumeTarget("expired", "request-to-pay")).toBeNull();
|
|
173
|
+
expect(shouldRecoverExpiredPayment("expired", "request-to-pay")).toBe(true);
|
|
174
|
+
expect(shouldRecoverExpiredPayment("expired", "bank-transfer")).toBe(false);
|
|
175
|
+
for (const interaction of [
|
|
176
|
+
"institution-picker",
|
|
177
|
+
"hosted-approval",
|
|
178
|
+
"external-app-approval",
|
|
179
|
+
]) {
|
|
180
|
+
expect(getDepositResumeTarget("expired", interaction)).toBeNull();
|
|
181
|
+
expect(shouldRecoverExpiredPayment("expired", interaction)).toBe(true);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
62
184
|
test("every status has a decision", () => {
|
|
63
185
|
for (const status of ALL_STATUSES) {
|
|
64
186
|
const target = getDepositResumeTarget(status);
|
|
@@ -66,4 +188,13 @@ describe("getDepositResumeTarget", () => {
|
|
|
66
188
|
}
|
|
67
189
|
});
|
|
68
190
|
});
|
|
191
|
+
function makeFiatNode(fiatMethod, paymentInteraction) {
|
|
192
|
+
return {
|
|
193
|
+
type: "Fiat",
|
|
194
|
+
id: `Fiat-${fiatMethod}`,
|
|
195
|
+
title: fiatMethod,
|
|
196
|
+
fiatMethod,
|
|
197
|
+
paymentInteraction,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
69
200
|
//# sourceMappingURL=accountNav.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountNav.test.js","sourceRoot":"","sources":["../../../../src/web/components/account/accountNav.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"accountNav.test.js","sourceRoot":"","sources":["../../../../src/web/components/account/accountNav.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAShD,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,sBAAsB,EACtB,oCAAoC,EACpC,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,kCAAkC,CAAC;AAE1C,MAAM,aAAa,GAAoB;IACrC,SAAS;IACT,QAAQ;IACR,KAAK;IACL,SAAS;IACT,OAAO;CACR,CAAC;AAEF,MAAM,gBAAgB,GAAgC;IACpD,aAAa;IACb,eAAe;IACf,YAAY;IACZ,uBAAuB;IACvB,iBAAiB;IAC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AE,CAAC;QACvE,MAAM,CAAC,2BAA2B,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5E,MAAM,CAAC,2BAA2B,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5E,KAAK,MAAM,WAAW,IAAI;YACxB,oBAAoB;YACpB,iBAAiB;YACjB,uBAAuB;SACf,EAAE,CAAC;YACX,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YAClE,MAAM,CAAC,2BAA2B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACvC,KAAK,MAAM,MAAM,IAAI,YAAY,EAAE,CAAC;YAClC,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;YAC9C,MAAM,CAAC,MAAM,KAAK,gBAAgB,IAAI,MAAM,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,SAAS,YAAY,CACnB,UAAqC,EACrC,kBAA8C;IAE9C,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,QAAQ,UAAU,EAAE;QACxB,KAAK,EAAE,UAAU;QACjB,UAAU;QACV,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DepositDeeplink, DepositInstitutionPaymentUi, DepositPaymentInfo, DepositPaymentInteraction, DepositPreCreatePaymentInput } from "../../../common/account.js";
|
|
2
|
+
import type { NavNodeFiat } from "../../api/navTree.js";
|
|
3
|
+
type BankPickerPayment = Pick<Extract<DepositPaymentInfo, {
|
|
4
|
+
flow: "bank-picker";
|
|
5
|
+
}>, "flow" | "currency" | "qrUrl" | "institutionPaymentUi" | "fallbackDeeplink">;
|
|
6
|
+
export type RequestToPayPayment = Extract<DepositPaymentInfo, {
|
|
7
|
+
flow: "request-to-pay";
|
|
8
|
+
}>;
|
|
9
|
+
export type InstitutionPickerPayment = Extract<DepositPaymentInfo, {
|
|
10
|
+
flow: "institution-picker";
|
|
11
|
+
}>;
|
|
12
|
+
export type ApprovalPayment = Extract<DepositPaymentInfo, {
|
|
13
|
+
flow: "hosted-approval" | "external-app-approval";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Temporary old-server compatibility boundary. The normal path reads the
|
|
17
|
+
* interaction from the nav node; only legacy nodes fall back to public rail.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNodePaymentInteraction(node: NavNodeFiat): DepositPaymentInteraction;
|
|
20
|
+
/** Normalize additive institution UI fields, including old-server payloads. */
|
|
21
|
+
export declare function getInstitutionPaymentContract(payment: BankPickerPayment, depositAmount: string): {
|
|
22
|
+
ui: DepositInstitutionPaymentUi;
|
|
23
|
+
fallbackDeeplink: DepositDeeplink | null;
|
|
24
|
+
};
|
|
25
|
+
/** Validate every required request-to-pay field before rendering or signing. */
|
|
26
|
+
export declare function getRequestToPayContract(payment: DepositPaymentInfo): RequestToPayPayment | null;
|
|
27
|
+
/** Validate one exact pre-create institution catalog before rendering. */
|
|
28
|
+
export declare function getInstitutionPickerContract(payment: DepositPaymentInfo): InstitutionPickerPayment | null;
|
|
29
|
+
/** Build the only typed client input accepted for an issued catalog action. */
|
|
30
|
+
export declare function buildInstitutionPaymentInput(payment: DepositPaymentInfo, institutionId: string): DepositPreCreatePaymentInput;
|
|
31
|
+
/** Validate hosted and passive external-app approval contracts. */
|
|
32
|
+
export declare function getApprovalContract(payment: DepositPaymentInfo): ApprovalPayment | null;
|
|
33
|
+
/** Select the token-units amount covered by the routing authorization. */
|
|
34
|
+
export declare function getAuthorizedRoutingAmount(payment: DepositPaymentInfo, depositAmount: string): string;
|
|
35
|
+
/** True only for a valid approval whose absolute server expiry has passed. */
|
|
36
|
+
export declare function isExpiredApproval(payment: DepositPaymentInfo, nowSeconds?: number): boolean;
|
|
37
|
+
/** True only for a valid request whose absolute server expiry has passed. */
|
|
38
|
+
export declare function isExpiredRequestToPay(payment: DepositPaymentInfo, nowSeconds?: number): boolean;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=accountPaymentCompatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountPaymentCompatibility.d.ts","sourceRoot":"","sources":["../../../../src/web/components/account/accountPaymentCompatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,KAAK,iBAAiB,GAAG,IAAI,CAC3B,OAAO,CAAC,kBAAkB,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,EACpD,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,sBAAsB,GAAG,kBAAkB,CAC5E,CAAC;AAIF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,kBAAkB,EAClB;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAC3B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,kBAAkB,EAClB;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAC/B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,kBAAkB,EAClB;IAAE,IAAI,EAAE,iBAAiB,GAAG,uBAAuB,CAAA;CAAE,CACtD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,WAAW,GAChB,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