Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hooks/memo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PaymentInformation } from '../types/publicAPI'
import { PaymentInformation } from '../types/protocol'

/**
* This function is expected to be overwritten by companies deploying
Expand Down
2 changes: 1 addition & 1 deletion src/services/basePayId.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AddressInformation } from '../types/database'
import { AddressDetailsType, PaymentInformation } from '../types/publicAPI'
import { AddressDetailsType, PaymentInformation } from '../types/protocol'

import { ParsedAcceptHeader } from './headers'

Expand Down
2 changes: 1 addition & 1 deletion src/types/database.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CryptoAddressDetails, FiatAddressDetails } from './publicAPI'
import { CryptoAddressDetails, FiatAddressDetails } from './protocol'

/**
* Model of the Account table schema for the database.
Expand Down
28 changes: 22 additions & 6 deletions src/types/publicAPI.ts → src/types/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/* eslint-disable import/no-cycle --
Cycle between this file and types/verifiedAddress.ts. Should we combine these into one?
*/
import { VerifiedAddress } from './verifiedAddress'

/**
* Type of payment address in PaymentInformation.
*/
Expand Down Expand Up @@ -41,9 +36,30 @@ export interface PaymentInformation {
/**
* Address information included inside of a PaymentInformation object.
*/
export interface Address {
interface Address {
readonly paymentNetwork: string
readonly environment?: string
readonly addressDetailsType: AddressDetailsType
readonly addressDetails: CryptoAddressDetails | FiatAddressDetails
}

/**
* Object containing address information alongside signatures.
*/
interface VerifiedAddress {
readonly payload: VerifiedAddressPayload
readonly signatures: readonly VerifiedAddressSignature[]
}

interface VerifiedAddressPayload {
payId: string
payIdAddress: Address
}

/**
* JWS object for verification.
*/
interface VerifiedAddressSignature {
protected: string
signature: string
}
24 changes: 0 additions & 24 deletions src/types/verifiedAddress.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/unit/formatPaymentInfo.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assert } from 'chai'

import { formatPaymentInfo } from '../../src/services/basePayId'
import { AddressDetailsType } from '../../src/types/publicAPI'
import { AddressDetailsType } from '../../src/types/protocol'

describe('Base PayID - formatPaymentInfo()', function (): void {
it('Returns CryptoAddressDetails & FiatAddressDetails for addressDetailsTypes when formatting array with multiple AddressInformation', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/getAddressDetailsType.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assert } from 'chai'

import { getAddressDetailsType } from '../../src/services/basePayId'
import { AddressDetailsType } from '../../src/types/publicAPI'
import { AddressDetailsType } from '../../src/types/protocol'

describe('Base PayID - getAddressDetailsType()', function (): void {
it('Returns FiatAddressDetails for addressDetailsType when formatting ACH AddressInformation', function () {
Expand Down