@devizovaburza/fiat-processor-sdk
v1.1.0
Published
This SDK provides TypeScript type definitions for integrating with the DBU Fiat Processor API. It enables external organizations to interact with the API in a type-safe manner.
Readme
DBU Fiat Processor SDK
This SDK provides TypeScript type definitions for integrating with the DBU Fiat Processor API. It enables external organizations to interact with the API in a type-safe manner.
Installation
npm install @pcse/fiat-sdk
# or
yarn add @pcse/fiat-sdkUsage
Import the types you need in your application:
import type {
CreateAccessTokenPairRequestBody,
WithdrawRequestBody,
GetTransactionsQuery
// other types...
} from '@pcse/fiat-sdk';Available Types
The SDK includes type definitions for:
- Authentication - Creating, refreshing and revoking access tokens
- Organization Management - Organization details, signature keys and user management
- Transactions - Deposits, withdrawals and transaction history
Example
import type { CreateAccessTokenPairRequestBody } from '@pcse/fiat-sdk';
const authPayload: CreateAccessTokenPairRequestBody = {
email: '...',
organizationId: '...',
password: '...',
role: 'MEMBER',
};
// Use with your API client...Cryptographic Helpers
Sign Payload
Signs a given string payload using a base64-encoded RSA private key.
import { signPayload } from '@pcse/fiat-sdk';
const signature = await signPayload({
payload: JSON.stringify({ amount: 1000 }),
privateKey: 'BASE64_ENCODED_PRIVATE_KEY',
});Verify Payload Signature
Verifies the signature of a payload using a base64-encoded RSA public key.
import { verifyPayloadSignature} from '@pcse/fiat-sdk';
const isValid = await verifyPayloadSignature({
payload: JSON.stringify({ amount: 1000 }),
signature: 'GENERATED_SIGNATURE',
publicKey: 'BASE64_ENCODED_PUBLIC_KEY',
});License
MIT
