Skip to content

Commit c2c05b0

Browse files
committed
feat: add crypto payment method error
1 parent 09bb112 commit c2c05b0

File tree

1 file changed

+13
-0
lines changed
  • packages/subscription-controller/src

1 file changed

+13
-0
lines changed

packages/subscription-controller/src/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ export const SUBSCRIPTION_STATUSES = {
4141
export type SubscriptionStatus =
4242
(typeof SUBSCRIPTION_STATUSES)[keyof typeof SUBSCRIPTION_STATUSES];
4343

44+
export const CRYPTO_PAYMENT_METHOD_ERRORS = {
45+
APPROVAL_TRANSACTION_TOO_OLD: 'approval_transaction_too_old',
46+
APPROVAL_TRANSACTION_REVERTED: 'approval_transaction_reverted',
47+
APPROVAL_TRANSACTION_MAX_VERIFICATION_ATTEMPTS_REACHED:
48+
'approval_transaction_max_verification_attempts_reached',
49+
INSUFFICIENT_BALANCE: 'insufficient_balance',
50+
INSUFFICIENT_ALLOWANCE: 'insufficient_allowance',
51+
} as const;
52+
53+
export type CryptoPaymentMethodError =
54+
(typeof CRYPTO_PAYMENT_METHOD_ERRORS)[keyof typeof CRYPTO_PAYMENT_METHOD_ERRORS];
55+
4456
/** only usd for now */
4557
export type Currency = 'usd';
4658

@@ -86,6 +98,7 @@ export type SubscriptionCryptoPaymentMethod = {
8698
payerAddress: Hex;
8799
chainId: Hex;
88100
tokenSymbol: string;
101+
error?: CryptoPaymentMethodError;
89102
};
90103
};
91104

0 commit comments

Comments
 (0)