@spritz-finance/api-client 0.4.13 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -871,6 +871,45 @@ const fees = await client.paymentRequest.transactionPrice(101)
871
871
 
872
872
  Payments represent a fiat payment that has been issued to the account. Once the status of the Payment Request has moved to `Confirmed` then the Payment will be created.
873
873
 
874
+ ### Transaction Details
875
+
876
+ Payments now include transaction details about the blockchain transaction that fulfilled the payment. When a payment is completed, the `transaction` field contains:
877
+
878
+ - **hash**: The blockchain transaction hash
879
+ - **from**: The wallet address that sent the payment
880
+ - **asset**: The token contract address used for payment
881
+ - **value**: The amount transferred (in the token's smallest unit)
882
+ - **network**: The blockchain network used (e.g., 'ethereum', 'polygon', etc.)
883
+
884
+ This allows you to track the on-chain transaction that corresponds to each fiat payment.
885
+
886
+ ### Retrieve a payment by ID
887
+
888
+ You can fetch a payment directly by its ID:
889
+
890
+ ```typescript
891
+ const payment = await client.payment.fetchById('6368e3a3ec516e9572bbd23b');
892
+
893
+ // Example response
894
+
895
+ {
896
+ id: '6368e3a3ec516e9572bbd23b',
897
+ userId: '63d12d3B577fab6c6382136e',
898
+ status: 'COMPLETED',
899
+ accountId: '6322445f10d3f4d19c4d72fe',
900
+ amount: 100,
901
+ feeAmount: null,
902
+ createdAt: '2022-11-07T10:53:23.998Z',
903
+ transaction: {
904
+ hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
905
+ from: '0xYourWalletAddress',
906
+ asset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
907
+ value: 100000000,
908
+ network: 'ethereum'
909
+ }
910
+ }
911
+ ```
912
+
874
913
  ### Retrieve the payment for a payment request
875
914
 
876
915
  ```typescript
@@ -893,7 +932,8 @@ const payment = await client.payment.getForPaymentRequest(paymentRequest.id);
893
932
  accountId: '6322445f10d3f4d19c4d72fe',
894
933
  amount: 100,
895
934
  feeAmount: null,
896
- createdAt: '2022-11-07T10:53:23.998Z'
935
+ createdAt: '2022-11-07T10:53:23.998Z',
936
+ transaction: null // Will be populated once the payment is fulfilled
897
937
  }
898
938
 
899
939
  ```
@@ -909,11 +949,19 @@ const payments = await client.payment.listForAccount(account.id)
909
949
  {
910
950
  id: '6368e3a3ec516e9572bbd23b',
911
951
  userId: '63d12d3B577fab6c6382136e',
912
- status: 'PENDING',
952
+ status: 'COMPLETED',
913
953
  accountId: '6322445f10d3f4d19c4d72fe',
914
954
  amount: 100,
915
955
  feeAmount: null,
916
956
  createdAt: '2022-11-07T10:53:23.998Z',
957
+ transaction: {
958
+ __typename: 'BlockchainTransaction',
959
+ hash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
960
+ from: '0xYourWalletAddress',
961
+ asset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
962
+ value: 100000000,
963
+ network: 'ethereum'
964
+ }
917
965
  },
918
966
  ]
919
967
  ```
@@ -1042,6 +1090,26 @@ Upon receiving a webhook, your server will get a payload with the following stru
1042
1090
  }
1043
1091
  ```
1044
1092
 
1093
+ ### Managing webhooks
1094
+
1095
+ #### List all webhooks
1096
+
1097
+ To retrieve all webhooks configured for your integration:
1098
+
1099
+ ```typescript
1100
+ const webhooks = await client.webhook.list()
1101
+ // Returns an array of webhook configurations
1102
+ ```
1103
+
1104
+ #### Delete a webhook
1105
+
1106
+ To delete a specific webhook by its ID:
1107
+
1108
+ ```typescript
1109
+ const deletedWebhook = await client.webhook.delete('webhook-id-here')
1110
+ // Returns the deleted webhook object
1111
+ ```
1112
+
1045
1113
  ### Webhook security and signing
1046
1114
 
1047
1115
  Each webhook request is signed using an HMAC SHA256 signature, based on the exact JSON payload sent in the body. This signature is included in the Signature HTTP header of the request.
@@ -366,7 +366,7 @@ query OnrampPayments {
366
366
  ...OnrampPaymentFragment
367
367
  }
368
368
  }
369
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Om={};function J1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Om[t]?!1:(Om[t]=!0,!0)})}ct.definitions=ct.definitions.concat(J1(Wt.definitions));function Su(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){Su(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Su(u,n)}),e.definitions&&e.definitions.forEach(function(u){Su(u,n)})}var qo={};(function(){ct.definitions.forEach(function(n){if(n.name){var t=new Set;Su(n,t),qo[n.name.value]=t}})})();function zm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function H1(e,n){var t={kind:e.kind,definitions:[zm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zm(e,o);s&&t.definitions.push(s)}),t}H1(ct,"OnrampPayments");class K1{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:st,variables:{createOnrampPaymentInput:n}}))?.createOnrampPayment}async list(){return(await this.client.query({query:ct}))?.onrampPayments}}var lt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]}]}}],loc:{start:0,end:229}};lt.loc.source={body:`fragment PaymentFragment on Payment {
369
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Om={};function J1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Om[t]?!1:(Om[t]=!0,!0)})}ct.definitions=ct.definitions.concat(J1(Wt.definitions));function Su(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){Su(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Su(u,n)}),e.definitions&&e.definitions.forEach(function(u){Su(u,n)})}var qo={};(function(){ct.definitions.forEach(function(n){if(n.name){var t=new Set;Su(n,t),qo[n.name.value]=t}})})();function zm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function H1(e,n){var t={kind:e.kind,definitions:[zm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zm(e,o);s&&t.definitions.push(s)}),t}H1(ct,"OnrampPayments");class K1{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:st,variables:{createOnrampPaymentInput:n}}))?.createOnrampPayment}async list(){return(await this.client.query({query:ct}))?.onrampPayments}}var lt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:323}};lt.loc.source={body:`fragment PaymentFragment on Payment {
370
370
  id
371
371
  userId
372
372
  status
@@ -379,6 +379,13 @@ query OnrampPayments {
379
379
  targetCurrency
380
380
  targetCurrencyAmount
381
381
  targetCurrencyRate
382
+ transaction {
383
+ hash
384
+ from
385
+ asset
386
+ value
387
+ network
388
+ }
382
389
  }
383
390
  `,name:"GraphQL request",locationOffset:{line:1,column:1}};function wu(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){wu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wu(u,n)}),e.definitions&&e.definitions.forEach(function(u){wu(u,n)})}var Mo={};(function(){lt.definitions.forEach(function(n){if(n.name){var t=new Set;wu(n,t),Mo[n.name.value]=t}})})();function Um(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Q1(e,n){var t={kind:e.kind,definitions:[Um(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Mo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Mo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Um(e,o);s&&t.definitions.push(s)}),t}Q1(lt,"PaymentFragment");var dt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentRequestPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentForPaymentRequest"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentRequestId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};dt.loc.source={body:`#import "./paymentFragment.graphql"
384
391
 
@@ -559,7 +566,7 @@ query UserVirtualDebitCard {
559
566
  ...VirtualDebitCardFragment
560
567
  }
561
568
  }
562
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Av={};function Wb(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Av[t]?!1:(Av[t]=!0,!0)})}wt.definitions=wt.definitions.concat(Wb(ci.definitions));function pr(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){pr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){pr(u,n)}),e.definitions&&e.definitions.forEach(function(u){pr(u,n)})}var Os={};(function(){wt.definitions.forEach(function(n){if(n.name){var t=new Set;pr(n,t),Os[n.name.value]=t}})})();function Cv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Yb(e,n){var t={kind:e.kind,definitions:[Cv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Os[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Os[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Cv(e,o);s&&t.definitions.push(s)}),t}Yb(wt,"UserVirtualDebitCard");const Xb={[xo.USVirtualDebitCard]:e=>({query:St,variables:void 0,response:"createUSVirtualDebitCard"})},ek=(e,n)=>Xb[e]?.(n)??null;class nk{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:wt}))?.virtualDebitCard??null}async create(n,t){const u=ek(n,t);if(!u)throw new Error("Invalid virtual card type");return(await this.client.query({query:u.query,variables:u.variables}))?.[u.response]??null}}class tk{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}async updateWebhookSecret(n){return this.client.request({method:"post",path:"/users/integrators/webhook-secret",body:{secret:n}})}}class Ps{environment;apiKey;integrationKey;client;user;bankAccount;debitCard;paymentRequest;payment;onrampPayment;virtualCard;bill;institution;webhook;constructor(n,t,u,i){if(t===void 0&&u===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(this.environment=n,this.apiKey=t,this.integrationKey=u,!i&&th())throw new Error(`It seems you're operating within a browser environment.
569
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Av={};function Wb(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Av[t]?!1:(Av[t]=!0,!0)})}wt.definitions=wt.definitions.concat(Wb(ci.definitions));function pr(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){pr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){pr(u,n)}),e.definitions&&e.definitions.forEach(function(u){pr(u,n)})}var Os={};(function(){wt.definitions.forEach(function(n){if(n.name){var t=new Set;pr(n,t),Os[n.name.value]=t}})})();function Cv(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Yb(e,n){var t={kind:e.kind,definitions:[Cv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Os[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Os[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Cv(e,o);s&&t.definitions.push(s)}),t}Yb(wt,"UserVirtualDebitCard");const Xb={[xo.USVirtualDebitCard]:e=>({query:St,variables:void 0,response:"createUSVirtualDebitCard"})},ek=(e,n)=>Xb[e]?.(n)??null;class nk{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:wt}))?.virtualDebitCard??null}async create(n,t){const u=ek(n,t);if(!u)throw new Error("Invalid virtual card type");return(await this.client.query({query:u.query,variables:u.variables}))?.[u.response]??null}}class tk{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}async updateWebhookSecret(n){return this.client.request({method:"post",path:"/users/integrators/webhook-secret",body:{secret:n}})}async list(){return this.client.request({method:"get",path:"/users/integrators/webhooks"})}async delete(n){return this.client.request({method:"delete",path:`/users/integrators/webhooks/${n}`})}}class Ps{environment;apiKey;integrationKey;client;user;bankAccount;debitCard;paymentRequest;payment;onrampPayment;virtualCard;bill;institution;webhook;constructor(n,t,u,i){if(t===void 0&&u===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(this.environment=n,this.apiKey=t,this.integrationKey=u,!i&&th())throw new Error(`It seems you're operating within a browser environment.
563
570
 
564
571
  By default, this is deactivated due to the potential risk of exposing your confidential integrator credentials.
565
572
  If you're aware of these risks and have taken necessary security measures, you can enable the \`dangerouslyAllowBrowser\` option, e.g.,
@@ -190,6 +190,14 @@ interface CreateBankAccount_createBankAccount {
190
190
  institution: CreateBankAccount_createBankAccount_institution | null;
191
191
  }
192
192
 
193
+ interface AccountPayments_paymentsForAccount_transaction {
194
+ __typename: 'BlockchainTransaction';
195
+ hash: string;
196
+ from: string | null;
197
+ asset: string | null;
198
+ value: number | null;
199
+ network: string;
200
+ }
193
201
  interface AccountPayments_paymentsForAccount {
194
202
  __typename: 'Payment';
195
203
  id: string;
@@ -204,6 +212,7 @@ interface AccountPayments_paymentsForAccount {
204
212
  targetCurrency: string | null;
205
213
  targetCurrencyAmount: number;
206
214
  targetCurrencyRate: number | null;
215
+ transaction: AccountPayments_paymentsForAccount_transaction | null;
207
216
  }
208
217
  interface AccountPayments {
209
218
  paymentsForAccount: AccountPayments_paymentsForAccount[];
@@ -592,6 +601,14 @@ interface PayableAccountInstitutionFragment {
592
601
  logo: string | null;
593
602
  }
594
603
 
604
+ interface Payment_payment_transaction {
605
+ __typename: 'BlockchainTransaction';
606
+ hash: string;
607
+ from: string | null;
608
+ asset: string | null;
609
+ value: number | null;
610
+ network: string;
611
+ }
595
612
  interface Payment_payment {
596
613
  __typename: 'Payment';
597
614
  id: string;
@@ -606,6 +623,7 @@ interface Payment_payment {
606
623
  targetCurrency: string | null;
607
624
  targetCurrencyAmount: number;
608
625
  targetCurrencyRate: number | null;
626
+ transaction: Payment_payment_transaction | null;
609
627
  }
610
628
  interface Payment {
611
629
  payment: Payment_payment | null;
@@ -614,6 +632,14 @@ interface PaymentVariables {
614
632
  paymentId: string;
615
633
  }
616
634
 
635
+ interface PaymentFragment_transaction {
636
+ __typename: 'BlockchainTransaction';
637
+ hash: string;
638
+ from: string | null;
639
+ asset: string | null;
640
+ value: number | null;
641
+ network: string;
642
+ }
617
643
  interface PaymentFragment {
618
644
  __typename: 'Payment';
619
645
  id: string;
@@ -628,6 +654,7 @@ interface PaymentFragment {
628
654
  targetCurrency: string | null;
629
655
  targetCurrencyAmount: number;
630
656
  targetCurrencyRate: number | null;
657
+ transaction: PaymentFragment_transaction | null;
631
658
  }
632
659
 
633
660
  interface PaymentRequestFragment {
@@ -647,6 +674,14 @@ interface PaymentRequestFragment {
647
674
  targetCurrencyRate: number;
648
675
  }
649
676
 
677
+ interface PaymentRequestPayment_paymentForPaymentRequest_transaction {
678
+ __typename: 'BlockchainTransaction';
679
+ hash: string;
680
+ from: string | null;
681
+ asset: string | null;
682
+ value: number | null;
683
+ network: string;
684
+ }
650
685
  interface PaymentRequestPayment_paymentForPaymentRequest {
651
686
  __typename: 'Payment';
652
687
  id: string;
@@ -661,6 +696,7 @@ interface PaymentRequestPayment_paymentForPaymentRequest {
661
696
  targetCurrency: string | null;
662
697
  targetCurrencyAmount: number;
663
698
  targetCurrencyRate: number | null;
699
+ transaction: PaymentRequestPayment_paymentForPaymentRequest_transaction | null;
664
700
  }
665
701
  interface PaymentRequestPayment {
666
702
  paymentForPaymentRequest: PaymentRequestPayment_paymentForPaymentRequest | null;
@@ -1722,6 +1758,8 @@ declare class WebhookService {
1722
1758
  updateWebhookSecret(secret: string): Promise<{
1723
1759
  success: boolean;
1724
1760
  }>;
1761
+ list(): Promise<IntegratorWebhook[]>;
1762
+ delete(webhookId: string): Promise<IntegratorWebhook>;
1725
1763
  }
1726
1764
 
1727
1765
  type ClientOptions = {
@@ -1770,4 +1808,4 @@ declare class SpritzApiClient {
1770
1808
  }
1771
1809
 
1772
1810
  export { AmountMode, BankAccountSubType, BankAccountType, BillType, DebitCardNetwork, Environment, PayableAccountType, PaymentDeliveryMethod, PaymentNetwork, DirectPaymentStatus as PaymentRequestStatus, PaymentStatus, SpritzApiClient, VirtualCardType };
1773
- export type { AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountFragment_paymentAddresses, BankAccountInput, BillFragment, BillFragment_billAccountDetails, BillFragment_dataSync, BillFragment_institution, BillFragment_paymentAddresses, ClientOptions, CreateDirectPaymentInput, CreateOnrampPaymentInput, CreatePaymentRequestInput, CurrentUser, CurrentUser_me, CurrentUser_verification, CurrentUser_verification_identity, DebitCardFragment, DebitCardInput, GetSolanaPayParams, GetSolanaPayParamsVariables, GetSolanaPayParams_solanaParams, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, OnrampPaymentFragment, OnrampPaymentFragment_depositInstructions, OnrampPayments, OnrampPayments_onrampPayments, OnrampPayments_onrampPayments_depositInstructions, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_dataSync, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_billAccountDetails, PayableAccountFragment_Bill_dataSync, PayableAccountFragment_Bill_institution, PayableAccountFragment_DebitCard, PayableAccountFragment_DebitCard_dataSync, PayableAccountFragment_DebitCard_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_dataSync, PayableAccountFragment_VirtualCard_institution, PayableAccountInstitutionFragment, Payment, PaymentFragment, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, PaymentVariables, Payment_payment, PopularBillInstitutions, PopularBillInstitutionsVariables, PopularBillInstitutions_popularUSBillInstitutions, SearchUSBillInstitutions, SearchUSBillInstitutionsVariables, SearchUSBillInstitutions_searchUSBillInstitutions, TokenBalanceFragment, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserBankAccounts_bankAccounts_paymentAddresses, UserBills, UserBills_bills, UserBills_bills_billAccountDetails, UserBills_bills_dataSync, UserBills_bills_institution, UserBills_bills_paymentAddresses, UserDebitCards, UserDebitCards_debitCards, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_dataSync, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_billAccountDetails, UserPayableAccounts_payableAccounts_Bill_dataSync, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_DebitCard, UserPayableAccounts_payableAccounts_DebitCard_dataSync, UserPayableAccounts_payableAccounts_DebitCard_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_dataSync, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, UserVirtualDebitCard_virtualDebitCard_paymentAddresses, VerificationFragment, VerificationFragment_identity, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, VirtualDebitCardFragment_paymentAddresses, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances };
1811
+ export type { AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, AccountPayments_paymentsForAccount_transaction, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountFragment_paymentAddresses, BankAccountInput, BillFragment, BillFragment_billAccountDetails, BillFragment_dataSync, BillFragment_institution, BillFragment_paymentAddresses, ClientOptions, CreateDirectPaymentInput, CreateOnrampPaymentInput, CreatePaymentRequestInput, CurrentUser, CurrentUser_me, CurrentUser_verification, CurrentUser_verification_identity, DebitCardFragment, DebitCardInput, GetSolanaPayParams, GetSolanaPayParamsVariables, GetSolanaPayParams_solanaParams, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, OnrampPaymentFragment, OnrampPaymentFragment_depositInstructions, OnrampPayments, OnrampPayments_onrampPayments, OnrampPayments_onrampPayments_depositInstructions, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_dataSync, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_billAccountDetails, PayableAccountFragment_Bill_dataSync, PayableAccountFragment_Bill_institution, PayableAccountFragment_DebitCard, PayableAccountFragment_DebitCard_dataSync, PayableAccountFragment_DebitCard_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_dataSync, PayableAccountFragment_VirtualCard_institution, PayableAccountInstitutionFragment, Payment, PaymentFragment, PaymentFragment_transaction, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, PaymentRequestPayment_paymentForPaymentRequest_transaction, PaymentVariables, Payment_payment, Payment_payment_transaction, PopularBillInstitutions, PopularBillInstitutionsVariables, PopularBillInstitutions_popularUSBillInstitutions, SearchUSBillInstitutions, SearchUSBillInstitutionsVariables, SearchUSBillInstitutions_searchUSBillInstitutions, TokenBalanceFragment, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserBankAccounts_bankAccounts_paymentAddresses, UserBills, UserBills_bills, UserBills_bills_billAccountDetails, UserBills_bills_dataSync, UserBills_bills_institution, UserBills_bills_paymentAddresses, UserDebitCards, UserDebitCards_debitCards, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_dataSync, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_billAccountDetails, UserPayableAccounts_payableAccounts_Bill_dataSync, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_DebitCard, UserPayableAccounts_payableAccounts_DebitCard_dataSync, UserPayableAccounts_payableAccounts_DebitCard_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_dataSync, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, UserVirtualDebitCard_virtualDebitCard_paymentAddresses, VerificationFragment, VerificationFragment_identity, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, VirtualDebitCardFragment_paymentAddresses, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances };
@@ -366,7 +366,7 @@ query OnrampPayments {
366
366
  ...OnrampPaymentFragment
367
367
  }
368
368
  }
369
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Tm={};function H1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Tm[t]?!1:(Tm[t]=!0,!0)})}ct.definitions=ct.definitions.concat(H1(Wt.definitions));function Su(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){Su(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Su(u,n)}),e.definitions&&e.definitions.forEach(function(u){Su(u,n)})}var qo={};(function(){ct.definitions.forEach(function(n){if(n.name){var t=new Set;Su(n,t),qo[n.name.value]=t}})})();function Om(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function K1(e,n){var t={kind:e.kind,definitions:[Om(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Om(e,o);s&&t.definitions.push(s)}),t}K1(ct,"OnrampPayments");class Q1{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:st,variables:{createOnrampPaymentInput:n}}))?.createOnrampPayment}async list(){return(await this.client.query({query:ct}))?.onrampPayments}}var lt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]}]}}],loc:{start:0,end:229}};lt.loc.source={body:`fragment PaymentFragment on Payment {
369
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Tm={};function H1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Tm[t]?!1:(Tm[t]=!0,!0)})}ct.definitions=ct.definitions.concat(H1(Wt.definitions));function Su(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){Su(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Su(u,n)}),e.definitions&&e.definitions.forEach(function(u){Su(u,n)})}var qo={};(function(){ct.definitions.forEach(function(n){if(n.name){var t=new Set;Su(n,t),qo[n.name.value]=t}})})();function Om(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function K1(e,n){var t={kind:e.kind,definitions:[Om(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=qo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=qo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Om(e,o);s&&t.definitions.push(s)}),t}K1(ct,"OnrampPayments");class Q1{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:st,variables:{createOnrampPaymentInput:n}}))?.createOnrampPayment}async list(){return(await this.client.query({query:ct}))?.onrampPayments}}var lt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:323}};lt.loc.source={body:`fragment PaymentFragment on Payment {
370
370
  id
371
371
  userId
372
372
  status
@@ -379,6 +379,13 @@ query OnrampPayments {
379
379
  targetCurrency
380
380
  targetCurrencyAmount
381
381
  targetCurrencyRate
382
+ transaction {
383
+ hash
384
+ from
385
+ asset
386
+ value
387
+ network
388
+ }
382
389
  }
383
390
  `,name:"GraphQL request",locationOffset:{line:1,column:1}};function wu(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){wu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wu(u,n)}),e.definitions&&e.definitions.forEach(function(u){wu(u,n)})}var Mo={};(function(){lt.definitions.forEach(function(n){if(n.name){var t=new Set;wu(n,t),Mo[n.name.value]=t}})})();function zm(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function W1(e,n){var t={kind:e.kind,definitions:[zm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Mo[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Mo[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=zm(e,o);s&&t.definitions.push(s)}),t}W1(lt,"PaymentFragment");var dt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentRequestPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentForPaymentRequest"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentRequestId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};dt.loc.source={body:`#import "./paymentFragment.graphql"
384
391
 
@@ -559,7 +566,7 @@ query UserVirtualDebitCard {
559
566
  ...VirtualDebitCardFragment
560
567
  }
561
568
  }
562
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var _v={};function Yb(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return _v[t]?!1:(_v[t]=!0,!0)})}wt.definitions=wt.definitions.concat(Yb(ci.definitions));function pr(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){pr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){pr(u,n)}),e.definitions&&e.definitions.forEach(function(u){pr(u,n)})}var Os={};(function(){wt.definitions.forEach(function(n){if(n.name){var t=new Set;pr(n,t),Os[n.name.value]=t}})})();function Av(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Xb(e,n){var t={kind:e.kind,definitions:[Av(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Os[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Os[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Av(e,o);s&&t.definitions.push(s)}),t}Xb(wt,"UserVirtualDebitCard");const ek={[xo.USVirtualDebitCard]:e=>({query:St,variables:void 0,response:"createUSVirtualDebitCard"})},nk=(e,n)=>ek[e]?.(n)??null;class tk{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:wt}))?.virtualDebitCard??null}async create(n,t){const u=nk(n,t);if(!u)throw new Error("Invalid virtual card type");return(await this.client.query({query:u.query,variables:u.variables}))?.[u.response]??null}}class ik{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}async updateWebhookSecret(n){return this.client.request({method:"post",path:"/users/integrators/webhook-secret",body:{secret:n}})}}class Ps{environment;apiKey;integrationKey;client;user;bankAccount;debitCard;paymentRequest;payment;onrampPayment;virtualCard;bill;institution;webhook;constructor(n,t,u,i){if(t===void 0&&u===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(this.environment=n,this.apiKey=t,this.integrationKey=u,!i&&ih())throw new Error(`It seems you're operating within a browser environment.
569
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var _v={};function Yb(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return _v[t]?!1:(_v[t]=!0,!0)})}wt.definitions=wt.definitions.concat(Yb(ci.definitions));function pr(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(u){pr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){pr(u,n)}),e.definitions&&e.definitions.forEach(function(u){pr(u,n)})}var Os={};(function(){wt.definitions.forEach(function(n){if(n.name){var t=new Set;pr(n,t),Os[n.name.value]=t}})})();function Av(e,n){for(var t=0;t<e.definitions.length;t++){var u=e.definitions[t];if(u.name&&u.name.value==n)return u}}function Xb(e,n){var t={kind:e.kind,definitions:[Av(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Os[n]||new Set,i=new Set,r=new Set;for(u.forEach(function(o){r.add(o)});r.size>0;){var a=r;r=new Set,a.forEach(function(o){if(!i.has(o)){i.add(o);var s=Os[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Av(e,o);s&&t.definitions.push(s)}),t}Xb(wt,"UserVirtualDebitCard");const ek={[xo.USVirtualDebitCard]:e=>({query:St,variables:void 0,response:"createUSVirtualDebitCard"})},nk=(e,n)=>ek[e]?.(n)??null;class tk{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:wt}))?.virtualDebitCard??null}async create(n,t){const u=nk(n,t);if(!u)throw new Error("Invalid virtual card type");return(await this.client.query({query:u.query,variables:u.variables}))?.[u.response]??null}}class ik{client;constructor(n){this.client=n}async create(n){return this.client.request({method:"post",path:"/users/integrators/webhooks",body:n})}async updateWebhookSecret(n){return this.client.request({method:"post",path:"/users/integrators/webhook-secret",body:{secret:n}})}async list(){return this.client.request({method:"get",path:"/users/integrators/webhooks"})}async delete(n){return this.client.request({method:"delete",path:`/users/integrators/webhooks/${n}`})}}class Ps{environment;apiKey;integrationKey;client;user;bankAccount;debitCard;paymentRequest;payment;onrampPayment;virtualCard;bill;institution;webhook;constructor(n,t,u,i){if(t===void 0&&u===void 0)throw new Error("The integrationKey or apiKey variable appears to be missing or empty. Please ensure you provide it, or when initializing the SpritzApiClient, opt for the integratorKey option.");if(this.environment=n,this.apiKey=t,this.integrationKey=u,!i&&ih())throw new Error(`It seems you're operating within a browser environment.
563
570
 
564
571
  By default, this is deactivated due to the potential risk of exposing your confidential integrator credentials.
565
572
  If you're aware of these risks and have taken necessary security measures, you can enable the \`dangerouslyAllowBrowser\` option, e.g.,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/api-client",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "Typescript library for interacting with the Spritz Finance API",
5
5
  "type": "module",
6
6
  "main": "dist/spritz-api-client.cjs",