13.3.6 • Published 4 days ago

@fiatconnect/fiatconnect-types v13.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

fiatconnect-types

Types used in the FiatConnect specification. Offered as standalone module for payment providers and wallets to both use for FiatConnect APIs and integrations.

Installation

From your project directory, run:

yarn add @fiatconnect/fiatconnect-types

or

npm i @fiatconnect/fiatconnect-types

Example usage

import { TransferStatus } from '@fiatconnect/fiatconnect-types'
import axios from 'axios'

export async function getTransferStatus(
  transferId: string,
): Promise<TransferStatus> {
  const response = await axios
    .create({ url: 'https://MOCK-PROVIDER-URL.fake' })
    .get(`/transfer/${transferId}/status`)
  return response.data.status
}

Zod Schemas

For each type exported from this package there is also a corresponding zod schema with the name {typeWithFirstCharLowercase}Schema. So for example TransferStatus has transferStatusSchema.

import {
  TransferStatus,
  transferStatusSchema,
} from '@fiatconnect/fiatconnect-types'
import axios from 'axios'
import { z } from 'zod'

export async function getTransferStatus(
  transferId: string,
): Promise<TransferStatus> {
  const response = await axios
    .create({ url: 'https://MOCK-PROVIDER-URL.fake' })
    .get(`/transfer/${transferId}/status`)

  // Will throw an error if the status does not match the schema
  transferStatusSchema.parse(response.data.status)
  return response.data.status
}

Contributing

13.3.6

4 days ago

13.3.5

6 days ago

13.3.4

13 days ago

13.3.3

14 days ago

13.3.2

15 days ago

13.3.1

18 days ago

13.1.3

9 months ago

13.1.1

9 months ago

13.3.0

6 months ago

13.1.2

9 months ago

13.2.2

7 months ago

13.2.0

9 months ago

13.2.1

7 months ago

13.1.0

11 months ago

13.0.2

1 year ago

13.0.0

1 year ago

13.0.1

1 year ago

12.0.0

1 year ago

12.0.1

1 year ago

11.1.3

1 year ago

11.1.2

1 year ago

11.1.1

1 year ago

11.0.2

1 year ago

11.1.0

1 year ago

10.0.0

2 years ago

10.1.0

2 years ago

10.2.0

1 year ago

10.2.1

1 year ago

10.2.2

1 year ago

7.0.4

2 years ago

8.0.0-rc1

2 years ago

8.0.0

2 years ago

9.1.0

2 years ago

9.0.0

2 years ago

8.0.0-rc2

2 years ago

11.0.0

1 year ago

11.0.1

1 year ago

5.0.0

2 years ago

6.1.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.2

2 years ago

7.0.0

2 years ago

7.0.3

2 years ago

7.0.2

2 years ago

7.0.1

2 years ago

3.3.0

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago