@fiatconnect/fiatconnect-sdk
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.3.5](https://github.com/fiatconnect/fiatconnect-sdk/compare/v0.3.4...v0.3.5) (2022-08-03) | ||
### Bug Fixes | ||
* **deps:** update dependency @fiatconnect/fiatconnect-types to v7 ([#53](https://github.com/fiatconnect/fiatconnect-sdk/issues/53)) ([6a6063b](https://github.com/fiatconnect/fiatconnect-sdk/commit/6a6063bd2cce60a5ee7bb0ff4ec67d0cefd4f28b)) | ||
### [0.3.4](https://github.com/fiatconnect/fiatconnect-sdk/compare/v0.3.3...v0.3.4) (2022-08-03) | ||
@@ -7,0 +14,0 @@ |
{ | ||
"name": "@fiatconnect/fiatconnect-sdk", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "A helper libary for wallets to integrate with FiatConnect APIs", | ||
@@ -54,3 +54,3 @@ "scripts": { | ||
"@badrap/result": "^0.2.12", | ||
"@fiatconnect/fiatconnect-types": "^6.1.0", | ||
"@fiatconnect/fiatconnect-types": "^7.0.0", | ||
"cross-fetch": "^3.1.5", | ||
@@ -57,0 +57,0 @@ "ethers": "^5.6.4", |
@@ -11,3 +11,4 @@ import { FiatConnectClient, ResponseError } from '../src' | ||
mockQuoteRequestQuery, | ||
mockQuoteResponse, | ||
mockQuoteInResponse, | ||
mockQuoteOutResponse, | ||
mockTransferRequestParams, | ||
@@ -396,3 +397,3 @@ mockTransferResponse, | ||
it('calls /quote/in and returns QuoteResponse', async () => { | ||
fetchMock.mockResponseOnce(JSON.stringify(mockQuoteResponse)) | ||
fetchMock.mockResponseOnce(JSON.stringify(mockQuoteInResponse)) | ||
const response = await client.createQuoteIn(mockQuoteRequestQuery) | ||
@@ -408,3 +409,3 @@ expect(fetchMock).toHaveBeenCalledWith( | ||
expect(response.isOk).toBeTruthy() | ||
expect(response.unwrap()).toMatchObject(mockQuoteResponse) | ||
expect(response.unwrap()).toMatchObject(mockQuoteInResponse) | ||
expect(getHeadersMock).toHaveBeenCalled() | ||
@@ -435,3 +436,3 @@ }) | ||
it('calls /quote/out and returns QuoteResponse', async () => { | ||
fetchMock.mockResponseOnce(JSON.stringify(mockQuoteResponse)) | ||
fetchMock.mockResponseOnce(JSON.stringify(mockQuoteOutResponse)) | ||
const response = await client.createQuoteOut(mockQuoteRequestQuery) | ||
@@ -447,3 +448,3 @@ expect(fetchMock).toHaveBeenCalledWith( | ||
expect(response.isOk).toBeTruthy() | ||
expect(response.unwrap()).toMatchObject(mockQuoteResponse) | ||
expect(response.unwrap()).toMatchObject(mockQuoteOutResponse) | ||
expect(getHeadersMock).toHaveBeenCalled() | ||
@@ -450,0 +451,0 @@ }) |
@@ -34,3 +34,3 @@ import { | ||
export const mockQuoteResponse: QuoteResponse = { | ||
export const mockQuoteInResponse: QuoteResponse = { | ||
quote: { | ||
@@ -43,2 +43,3 @@ fiatType: FiatType.USD, | ||
guaranteedUntil: '2030-01-01T00:00:00.000Z', | ||
transferType: TransferType.TransferIn, | ||
}, | ||
@@ -65,2 +66,32 @@ kyc: { | ||
export const mockQuoteOutResponse: QuoteResponse = { | ||
quote: { | ||
fiatType: FiatType.USD, | ||
cryptoType: CryptoType.cUSD, | ||
fiatAmount: '1.0', | ||
cryptoAmount: '1.0', | ||
quoteId: 'mock_quote_id', | ||
guaranteedUntil: '2030-01-01T00:00:00.000Z', | ||
transferType: TransferType.TransferOut, | ||
}, | ||
kyc: { | ||
kycRequired: true, | ||
kycSchemas: [ | ||
{ kycSchema: KycSchema.PersonalDataAndDocuments, allowedValues: {} }, | ||
], | ||
}, | ||
fiatAccount: { | ||
[FiatAccountType.BankAccount]: { | ||
fiatAccountSchemas: [ | ||
{ | ||
fiatAccountSchema: FiatAccountSchema.AccountNumber, | ||
allowedValues: {}, | ||
}, | ||
], | ||
fee: '.001', | ||
feeType: FeeType.PlatformFee, | ||
}, | ||
}, | ||
} | ||
export const mockQuoteErrorResponse: QuoteErrorResponse = { | ||
@@ -110,2 +141,3 @@ error: FiatConnectError.GeoNotSupported, | ||
fiatAccountType: FiatAccountType.BankAccount, | ||
fiatAccountSchema: FiatAccountSchema.AccountNumber, | ||
} | ||
@@ -112,0 +144,0 @@ |
112062
2402
+ Added@fiatconnect/fiatconnect-types@7.0.4(transitive)
- Removed@fiatconnect/fiatconnect-types@6.1.0(transitive)