Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spritz-finance/api-client

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spritz-finance/api-client - npm Package Compare versions

Comparing version 0.0.12 to 0.1.0

285

dist/spritz-api-client.d.ts

@@ -81,113 +81,2 @@ import { AxiosInstance } from 'axios';

interface CreateUSBankAccount_createUSBankAccount_bankAccountDetails_CanadianBankAccountDetails {
__typename: 'CanadianBankAccountDetails';
}
interface CreateUSBankAccount_createUSBankAccount_bankAccountDetails_USBankAccountDetails {
__typename: 'USBankAccountDetails';
routingNumber: string;
}
type CreateUSBankAccount_createUSBankAccount_bankAccountDetails = CreateUSBankAccount_createUSBankAccount_bankAccountDetails_CanadianBankAccountDetails | CreateUSBankAccount_createUSBankAccount_bankAccountDetails_USBankAccountDetails;
interface CreateUSBankAccount_createUSBankAccount_institution {
__typename: 'BankAccountInstitution' | 'BillInstitution';
id: string;
name: string;
logo: string | null;
country: string;
currency: string;
}
interface CreateUSBankAccount_createUSBankAccount {
__typename: 'BankAccount';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
accountNumber: string;
bankAccountType: BankAccountType;
bankAccountSubType: BankAccountSubType;
holder: string;
email: string;
ownedByUser: boolean;
bankAccountDetails: CreateUSBankAccount_createUSBankAccount_bankAccountDetails;
institution: CreateUSBankAccount_createUSBankAccount_institution | null;
}
interface CreateUSBankAccount {
createUSBankAccount: CreateUSBankAccount_createUSBankAccount;
}
interface CreateUSBankAccountVariables {
createUSAccountInput: USBankAccountInput;
}
interface DeleteBankAccount_deletePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails {
__typename: 'CanadianBankAccountDetails';
}
interface DeleteBankAccount_deletePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails {
__typename: 'USBankAccountDetails';
routingNumber: string;
}
type DeleteBankAccount_deletePayableAccount_BankAccount_bankAccountDetails = DeleteBankAccount_deletePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails | DeleteBankAccount_deletePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails;
interface DeleteBankAccount_deletePayableAccount_BankAccount_institution {
__typename: 'BankAccountInstitution' | 'BillInstitution';
id: string;
name: string;
logo: string | null;
country: string;
currency: string;
}
interface DeleteBankAccount_deletePayableAccount_BankAccount {
__typename: 'BankAccount';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
accountNumber: string;
bankAccountType: BankAccountType;
bankAccountSubType: BankAccountSubType;
holder: string;
email: string;
ownedByUser: boolean;
bankAccountDetails: DeleteBankAccount_deletePayableAccount_BankAccount_bankAccountDetails;
institution: DeleteBankAccount_deletePayableAccount_BankAccount_institution | null;
}
interface RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails {
__typename: 'CanadianBankAccountDetails';
}
interface RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails {
__typename: 'USBankAccountDetails';
routingNumber: string;
}
type RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails = RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails | RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails;
interface RenameBankAccount_renamePayableAccount_BankAccount_institution {
__typename: 'BankAccountInstitution' | 'BillInstitution';
id: string;
name: string;
logo: string | null;
country: string;
currency: string;
}
interface RenameBankAccount_renamePayableAccount_BankAccount {
__typename: 'BankAccount';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
accountNumber: string;
bankAccountType: BankAccountType;
bankAccountSubType: BankAccountSubType;
holder: string;
email: string;
ownedByUser: boolean;
bankAccountDetails: RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails;
institution: RenameBankAccount_renamePayableAccount_BankAccount_institution | null;
}
interface AccountPayments_paymentsForAccount {

@@ -715,2 +604,113 @@ __typename: 'Payment';

interface CreateUSBankAccount_createUSBankAccount_bankAccountDetails_CanadianBankAccountDetails {
__typename: 'CanadianBankAccountDetails';
}
interface CreateUSBankAccount_createUSBankAccount_bankAccountDetails_USBankAccountDetails {
__typename: 'USBankAccountDetails';
routingNumber: string;
}
type CreateUSBankAccount_createUSBankAccount_bankAccountDetails = CreateUSBankAccount_createUSBankAccount_bankAccountDetails_CanadianBankAccountDetails | CreateUSBankAccount_createUSBankAccount_bankAccountDetails_USBankAccountDetails;
interface CreateUSBankAccount_createUSBankAccount_institution {
__typename: 'BankAccountInstitution' | 'BillInstitution';
id: string;
name: string;
logo: string | null;
country: string;
currency: string;
}
interface CreateUSBankAccount_createUSBankAccount {
__typename: 'BankAccount';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
accountNumber: string;
bankAccountType: BankAccountType;
bankAccountSubType: BankAccountSubType;
holder: string;
email: string;
ownedByUser: boolean;
bankAccountDetails: CreateUSBankAccount_createUSBankAccount_bankAccountDetails;
institution: CreateUSBankAccount_createUSBankAccount_institution | null;
}
interface CreateUSBankAccount {
createUSBankAccount: CreateUSBankAccount_createUSBankAccount;
}
interface CreateUSBankAccountVariables {
createUSAccountInput: USBankAccountInput;
}
interface DeletePayableAccount_deletePayableAccount_BankAccount_institution {
__typename: 'BankAccountInstitution' | 'BillInstitution';
id: string;
name: string;
logo: string | null;
country: string;
currency: string;
}
interface DeletePayableAccount_deletePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails {
__typename: 'CanadianBankAccountDetails';
}
interface DeletePayableAccount_deletePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails {
__typename: 'USBankAccountDetails';
routingNumber: string;
}
type DeletePayableAccount_deletePayableAccount_BankAccount_bankAccountDetails = DeletePayableAccount_deletePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails | DeletePayableAccount_deletePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails;
interface DeletePayableAccount_deletePayableAccount_BankAccount {
__typename: 'BankAccount';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
institution: DeletePayableAccount_deletePayableAccount_BankAccount_institution | null;
accountNumber: string;
bankAccountType: BankAccountType;
bankAccountSubType: BankAccountSubType;
holder: string;
email: string;
ownedByUser: boolean;
bankAccountDetails: DeletePayableAccount_deletePayableAccount_BankAccount_bankAccountDetails;
}
interface RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails {
__typename: 'CanadianBankAccountDetails';
}
interface RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails {
__typename: 'USBankAccountDetails';
routingNumber: string;
}
type RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails = RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails | RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_USBankAccountDetails;
interface RenameBankAccount_renamePayableAccount_BankAccount_institution {
__typename: 'BankAccountInstitution' | 'BillInstitution';
id: string;
name: string;
logo: string | null;
country: string;
currency: string;
}
interface RenameBankAccount_renamePayableAccount_BankAccount {
__typename: 'BankAccount';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
accountNumber: string;
bankAccountType: BankAccountType;
bankAccountSubType: BankAccountSubType;
holder: string;
email: string;
ownedByUser: boolean;
bankAccountDetails: RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails;
institution: RenameBankAccount_renamePayableAccount_BankAccount_institution | null;
}
interface QueryParams<V = any> {

@@ -727,6 +727,6 @@ query: DocumentNode;

type CreateInputMapping = {
type CreateInputMapping$1 = {
[BankAccountType.USBankAccount]: USBankAccountInput;
};
type CreateMutationMapping = {
type CreateMutationMapping$1 = {
[BankAccountType.USBankAccount]: {

@@ -743,4 +743,4 @@ query: CreateUSBankAccount;

rename(accountId: string, name: string): Promise<RenameBankAccount_renamePayableAccount_BankAccount>;
delete(accountId: string): Promise<DeleteBankAccount_deletePayableAccount_BankAccount>;
create<T extends BankAccountType>(type: T, input: CreateInputMapping[T]): Promise<NonNullable<CreateMutationMapping[T]["query"][keyof CreateMutationMapping[T]["query"]]> | null>;
delete(accountId: string): Promise<DeletePayableAccount_deletePayableAccount_BankAccount>;
create<T extends BankAccountType>(type: T, input: CreateInputMapping$1[T]): Promise<NonNullable<CreateMutationMapping$1[T]["query"][keyof CreateMutationMapping$1[T]["query"]]> | null>;
}

@@ -816,2 +816,54 @@

interface CreateUSVirtualDebitCard_createUSVirtualDebitCard_billingInfo_address {
__typename: 'CardHolderAddress';
street: string | null;
street2: string | null;
city: string | null;
subdivision: string | null;
postalCode: string | null;
countryCode: string | null;
}
interface CreateUSVirtualDebitCard_createUSVirtualDebitCard_billingInfo {
__typename: 'BillingInfo';
holder: string;
phone: string;
email: string;
address: CreateUSVirtualDebitCard_createUSVirtualDebitCard_billingInfo_address | null;
}
interface CreateUSVirtualDebitCard_createUSVirtualDebitCard {
__typename: 'VirtualCard';
id: string;
name: string | null;
userId: string;
country: string;
currency: string;
createdAt: any;
type: PayableAccountType;
mask: string | null;
balance: number;
renderSecret: string | null;
virtualCardType: VirtualCardType;
billingInfo: CreateUSVirtualDebitCard_createUSVirtualDebitCard_billingInfo | null;
}
interface CreateUSVirtualDebitCard {
createUSVirtualDebitCard: CreateUSVirtualDebitCard_createUSVirtualDebitCard;
}
type CreateInputMapping = {
[VirtualCardType.USVirtualDebitCard]: undefined;
};
type CreateMutationMapping = {
[VirtualCardType.USVirtualDebitCard]: {
query: CreateUSVirtualDebitCard;
variables: undefined;
response: keyof CreateUSVirtualDebitCard;
};
};
declare class VirtualCardService {
private client;
constructor(client: GraphClient);
fetch(): Promise<UserVirtualDebitCard_virtualDebitCard | null>;
create<T extends VirtualCardType>(type: T, input: CreateInputMapping[T]): Promise<NonNullable<CreateMutationMapping[T]["query"][keyof CreateMutationMapping[T]["query"]]> | null>;
}
type ClientParams = {

@@ -831,2 +883,3 @@ environment: Environment;

payment: PaymentService;
virtualCard: VirtualCardService;
constructor(apiKey: string, integrationKey: string, environment: Environment);

@@ -838,2 +891,2 @@ static initialize({ environment, apiKey, integrationKey }: ClientParams): SpritzApiClient;

export { AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, AccountProvider, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountSubType, BankAccountType, CreateDirectPaymentInput, CreatePaymentRequestInput, CurrentUser, CurrentUser_me, DirectPaymentStatus, Environment, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, ModuleStatus, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_institution, PayableAccountType, PaymentFragment, PaymentNetwork, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, PaymentStatus, SpritzApiClient, TokenBalanceFragment, TransactionPrice, TransactionPriceVariables, USBankAccountInput, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, VirtualCardType, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances };
export { AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountSubType, BankAccountType, CreateDirectPaymentInput, CreatePaymentRequestInput, CurrentUser, CurrentUser_me, Environment, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_institution, PayableAccountType, PaymentFragment, PaymentNetwork, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, DirectPaymentStatus as PaymentRequestStatus, PaymentStatus, SpritzApiClient, TokenBalanceFragment, TransactionPrice, TransactionPriceVariables, USBankAccountInput, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, VirtualCardType, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances };
{
"name": "@spritz-finance/api-client",
"version": "0.0.12",
"version": "0.1.0",
"description": "Typescript library for interacting with the Spritz Finance API",

@@ -5,0 +5,0 @@ "main": "dist/spritz-api-client.js",

@@ -24,4 +24,4 @@ # @spritz-finance/api-client

Your integration key is provided by Spritz and must always be provided.
The api key is specific to each user,
and is returned once the user is created. Leave the api key blank if you haven't created the user yet.
The api key is specific to each user,
and is returned once the user is created. Leave the api key blank if you haven't created the user yet.

@@ -33,3 +33,3 @@ ```typescript

environment: Environment.Staging,
apiKey: 'YOUR_USER_API_KEY_HERE',
apiKey: 'YOUR_USER_API_KEY_HERE',
integrationKey: 'YOUR_INTEGRATION_KEY_HERE',

@@ -41,8 +41,7 @@ })

You start the process by transmitting the user's email address.
A new Spritz user can be created by supplying the user's email address.
```typescript
// Fetch all bank accounts for the user
const user = await client.user.createUser({
email: "bilbo@shiremail.net"
const user = await client.user.create({
email: 'bilbo@shiremail.net',
})

@@ -55,4 +54,2 @@

// }
```

@@ -206,2 +203,59 @@

## Virtual Cards
Spritz enables the creation of virtual cards, which can be funded using cryptocurrency. Similar to bank accounts, these virtual cards represent an additional type of payable account provided by Spritz. Utilize the endpoints detailed below to interact with the Virtual Card API.
### Fetch a users virtual card
The fetch endpoint returns an object encompassing all the details associated with the virtual card. Please note, this object does not include sensitive card information such as the card number or the CVV.
```typescript
const virtualCard = await client.virtualCard.fetch()
```
#### Example response
```typescript
const virtualCard = {
id: '62d17d3b377dab6c1342136e',
type: 'VirtualCard',
virtualCardType: 'USVirtualDebitCard',
userId: '62d17d3b377dab6c1342136e',
mask: '0001',
country: 'US',
currency: 'USD',
balance: 0,
renderSecret: 'U2FsdGVkX18bLYGYLILf4AeW5fOl8VYxAvKWVDtbZI5DO7swFqkJ2o',
billingInfo: {
holder: 'Bilbo Baggins',
phone: '+123456789',
email: 'bilbo@shiremail.net',
address: {
street: '1 Bagshot Row',
street2: '',
city: 'Hobbiton',
subdivision: 'The Shire',
postalCose: '12345',
countryCode: 'ME',
},
},
}
```
### Create a US virtual debit card
```typescript
import { VirtualCardType } from '@spritz-finance/api-client'
const virtualCard = await client.virtualCard.create(VirtualCardType.USVirtualDebitCard)
```
### Displaying sensitive card details
In order to display the sensitive card details necessary for a user to make payments, you must utilize our drop-in widget, which securely renders the card. This process requires the renderSecret, returned from the standard fetch card endpoint, in combination with the user's API key.
We currently offer and maintain the following packages to assist with the card rendering process:
- [React Native Library](https://www.npmjs.com/package/@spritz-finance/react-native-secure-elements)
## Payment Requests

@@ -208,0 +262,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc