0.5.130 • Published 12 months ago

@fiatconnect/fiatconnect-sdk v0.5.130

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

fiatconnect-sdk

A lightweight Typescript helper library for wallets or dapps to integrate with FiatConnect compliant APIs.

Basic usage

To begin, install the library from your project:

yarn add @fiatconnect/fiatconnect-sdk

Next, initialize a FiatConnectClient wherever you need to access a FiatConnect API in your codebase. See examples in the Valora wallet and FiatConnect validation tests.

From there, you can access any FiatConnect endpoint by invoking a method on the FiatConnectClient instance. There is a convenient example of a full transfer in this validation test.

Authenticated endpoints

Note that some FiatConnect endpoints require authentication before they can be accessed. You can read up on FiatConnect authentication here.

The FiatConnect SDK handles authentication by taking a signingFunction as a parameter in the FiatConnectClient constructor. The FiatConnectClient instance uses the signing function to sign a SIWE message and log in with a FiatConnect provider when:

  • the login method is invoked explicitly
  • any method for an endpoint that requires authentication is invoked (and the user does not already have a valid session)

Wallets may or may not wish to require a PIN every time a SIWE message is signed, or just some of the time. They may implement whatever preference they have by writing the signingFunction accordingly.

Accessing multiple FiatConnect providers

In most cases, clients will wish to integrate with multiple FiatConnect providers. However, it is worth noting that the FiatConnectClient class deals with only a single provider. This allows for more convenient separation of session cookies and provider-specific configuration data (base URL, etc.).

For an example of how to manage multiple FiatConnect providers in your codebase using the FiatConnect SDK, you may refer to the Valora wallet, which stores an object in memory mapping provider ID's to FiatConnectClient instances. Many similar possibilities exist.

Testing with a sandbox server

At time of writing, three companies offer a FiatConnect-compliant sandbox API: Valora, Alpha Fortress, and Bitmama.

If you want to test against a sandbox server that is FiatConnect-compliant, you can ask one of these companies on Discord to share API credentials with you. In particular, you will want a base URL and client API key that can be used to instantiate a FiatConnectClient.

Alternatively, if you want to make heavier use of a sandbox server (such as for CI), you can stand up your own FiatConnect-compliant sandbox using the api starter.

Running tests

yarn test

Contributing

We welcome contributions in the form of Issues and PRs. See CONTRIBUTING.md. If you have ideas for FiatConnect SDK that you'd like to discuss with other developers, you may contact us on the FiatConnect Discord.

Publishing

  • Publishing updates is done automatically via semantic-release. Remember to use conventional commits or your PR will be rejected (since merging it would mess up the changelog and version numbers).
0.5.98

12 months ago

0.5.99

12 months ago

0.5.96

12 months ago

0.5.97

12 months ago

0.5.94

12 months ago

0.5.95

12 months ago

0.5.92

12 months ago

0.5.93

12 months ago

0.5.90

12 months ago

0.5.91

12 months ago

0.5.87

1 year ago

0.5.88

1 year ago

0.5.85

1 year ago

0.5.86

1 year ago

0.5.83

1 year ago

0.5.84

1 year ago

0.5.81

1 year ago

0.5.82

1 year ago

0.5.103

12 months ago

0.5.102

12 months ago

0.5.105

12 months ago

0.5.104

12 months ago

0.5.101

12 months ago

0.5.89

12 months ago

0.5.100

12 months ago

0.5.80

1 year ago

0.5.76

1 year ago

0.5.77

1 year ago

0.5.74

1 year ago

0.5.75

1 year ago

0.5.72

1 year ago

0.5.73

1 year ago

0.5.70

1 year ago

0.5.71

1 year ago

0.5.78

1 year ago

0.5.79

1 year ago

0.5.65

1 year ago

0.5.66

1 year ago

0.5.63

1 year ago

0.5.64

1 year ago

0.5.62

2 years ago

0.5.69

1 year ago

0.5.67

1 year ago

0.5.68

1 year ago

0.5.130

12 months ago

0.5.129

12 months ago

0.5.128

12 months ago

0.5.114

12 months ago

0.5.113

12 months ago

0.5.116

12 months ago

0.5.115

12 months ago

0.5.110

12 months ago

0.5.112

12 months ago

0.5.111

12 months ago

0.5.107

12 months ago

0.5.106

12 months ago

0.5.109

12 months ago

0.5.108

12 months ago

0.5.125

12 months ago

0.5.124

12 months ago

0.5.127

12 months ago

0.5.126

12 months ago

0.5.121

12 months ago

0.5.120

12 months ago

0.5.123

12 months ago

0.5.122

12 months ago

0.5.118

12 months ago

0.5.117

12 months ago

0.5.119

12 months ago

0.5.61

2 years ago

0.5.60

2 years ago

0.5.59

2 years ago

0.5.58

2 years ago

0.5.57

2 years ago

0.5.54

2 years ago

0.5.55

2 years ago

0.5.52

2 years ago

0.5.53

2 years ago

0.5.56

2 years ago

0.5.50

2 years ago

0.5.51

2 years ago

0.5.49

2 years ago

0.5.48

2 years ago

0.5.47

2 years ago

0.5.46

2 years ago

0.5.43

2 years ago

0.5.44

2 years ago

0.5.45

2 years ago

0.5.41

2 years ago

0.5.42

2 years ago

0.5.40

2 years ago

0.5.39

2 years ago

0.5.38

2 years ago

0.5.37

2 years ago

0.5.36

2 years ago

0.5.34

2 years ago

0.5.35

2 years ago

0.5.33

2 years ago

0.5.32

2 years ago

0.5.31

2 years ago

0.5.30

2 years ago

0.5.29

2 years ago

0.5.28

2 years ago

0.5.27

2 years ago

0.5.26

2 years ago

0.5.25

2 years ago

0.5.24

2 years ago

0.5.23

2 years ago

0.5.10

3 years ago

0.5.11

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.9

3 years ago

0.5.18

3 years ago

0.5.19

3 years ago

0.5.16

3 years ago

0.5.17

3 years ago

0.5.14

3 years ago

0.5.15

3 years ago

0.5.12

3 years ago

0.5.13

3 years ago

0.5.21

3 years ago

0.5.22

2 years ago

0.5.20

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.2

3 years ago

0.3.9

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.5.1

3 years ago

0.3.0

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.2

4 years ago

0.2.3

4 years ago

0.3.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.2.2

4 years ago

0.2.1-alpha.2

4 years ago

0.2.1-alpha.1

4 years ago

0.2.1-alpha.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago