Skip to content

Commit

Permalink
Fix/improve supported currencies (#236)
Browse files Browse the repository at this point in the history
* Add MATIC to SupportedCurrencies

* Use SupportedCurrencies in PaymentRequestDataInfo

* Disable linter for console.warn
  • Loading branch information
amonsosanz authored Aug 27, 2024
1 parent 1e015ef commit 9d2fc4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/iden3comm/types/protocol/payment.ts
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down Expand Up @@ -33,7 +38,7 @@ export type PaymentRequestDataInfo = {
id: string;
chainId: string;
address: string;
currency: string;
currency: SupportedCurrencies;
signature?: string;
};

Expand Down
3 changes: 2 additions & 1 deletion src/verifiable/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export enum PaymentType {
* @enum {number}
*/
export enum SupportedCurrencies {
ETH = 'ETH'
ETH = 'ETH',
MATIC = 'MATIC'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 9d2fc4f

Please sign in to comment.