diff --git a/src/iden3comm/types/protocol/payment.ts b/src/iden3comm/types/protocol/payment.ts index 778d0f0a..f12a3bd4 100644 --- a/src/iden3comm/types/protocol/payment.ts +++ b/src/iden3comm/types/protocol/payment.ts @@ -1,5 +1,10 @@ import { BasicMessage } from '../'; -import { PaymentRequestDataType, PaymentRequestType, PaymentType } from '../../../verifiable'; +import { + PaymentRequestDataType, + PaymentRequestType, + PaymentType, + SupportedCurrencies +} from '../../../verifiable'; import { PROTOCOL_MESSAGE_TYPE } from '../../constants'; /** @beta PaymentRequestMessage is struct the represents payment-request message */ @@ -33,7 +38,7 @@ export type PaymentRequestDataInfo = { id: string; chainId: string; address: string; - currency: string; + currency: SupportedCurrencies; signature?: string; }; diff --git a/src/verifiable/constants.ts b/src/verifiable/constants.ts index beaa591b..b1fd2521 100644 --- a/src/verifiable/constants.ts +++ b/src/verifiable/constants.ts @@ -144,7 +144,8 @@ export enum PaymentType { * @enum {number} */ export enum SupportedCurrencies { - ETH = 'ETH' + ETH = 'ETH', + MATIC = 'MATIC' } /** diff --git a/tests/handlers/payment.test.ts b/tests/handlers/payment.test.ts index 85c5b7a1..b2196f46 100644 --- a/tests/handlers/payment.test.ts +++ b/tests/handlers/payment.test.ts @@ -136,7 +136,7 @@ describe('payment-request handler', () => { id: '12432', chainId: '80002', address: '0x2C2007d72f533FfD409F0D9f515983e95bF14992', - currency: 'ETH' + currency: SupportedCurrencies.ETH }, expiration: '2125558127', description: 'payment-request integration test'