13.3.37 • Published 9 months ago

@fiatconnect/fiatconnect-types v13.3.37

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months 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.33

9 months ago

13.3.32

9 months ago

13.3.31

10 months ago

13.3.30

10 months ago

13.3.37

9 months ago

13.3.9

1 year ago

13.3.36

9 months ago

13.3.35

9 months ago

13.3.34

9 months ago

13.3.11

1 year ago

13.3.10

1 year ago

13.3.19

10 months ago

13.3.18

10 months ago

13.3.17

10 months ago

13.3.16

10 months ago

13.3.15

10 months ago

13.3.14

10 months ago

13.3.13

10 months ago

13.3.12

11 months ago

13.3.22

10 months ago

13.3.21

10 months ago

13.3.20

10 months ago

13.3.29

10 months ago

13.3.28

10 months ago

13.3.27

10 months ago

13.3.26

10 months ago

13.3.25

10 months ago

13.3.24

10 months ago

13.3.23

10 months ago

13.3.8

2 years ago

13.3.7

2 years ago

13.3.6

2 years ago

13.3.5

2 years ago

13.3.4

2 years ago

13.3.3

2 years ago

13.3.2

2 years ago

13.3.1

2 years ago

13.1.3

3 years ago

13.1.1

3 years ago

13.3.0

2 years ago

13.1.2

3 years ago

13.2.2

2 years ago

13.2.0

3 years ago

13.2.1

2 years ago

13.1.0

3 years ago

13.0.2

3 years ago

13.0.0

3 years ago

13.0.1

3 years ago

12.0.0

3 years ago

12.0.1

3 years ago

11.1.3

3 years ago

11.1.2

3 years ago

11.1.1

3 years ago

11.0.2

3 years ago

11.1.0

3 years ago

10.0.0

3 years ago

10.1.0

3 years ago

10.2.0

3 years ago

10.2.1

3 years ago

10.2.2

3 years ago

7.0.4

3 years ago

8.0.0-rc1

3 years ago

8.0.0

3 years ago

9.1.0

3 years ago

9.0.0

3 years ago

8.0.0-rc2

3 years ago

11.0.0

3 years ago

11.0.1

3 years ago

5.0.0

4 years ago

6.1.0

4 years ago

6.0.1

4 years ago

6.0.0

4 years ago

6.0.2

4 years ago

7.0.0

4 years ago

7.0.3

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

3.3.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago