@spritz-finance/api-client 0.4.21 → 0.4.22

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
@@ -846,6 +846,40 @@ When creating a payment request, you can specify how the amount should be calcul
846
846
 
847
847
  This allows you to control whether fees are included in or added to the specified amount.
848
848
 
849
+ #### Fee Subsidies (Integrator Feature)
850
+
851
+ Integrators can subsidize transaction fees on behalf of their users. When enabled, you can cover part or all of the transaction fees, which Spritz will invoice to you separately.
852
+
853
+ > **Note**: Fee subsidies are a gated feature and must be enabled by the Spritz team before use. Contact Spritz to request access.
854
+
855
+ **Parameters:**
856
+
857
+ - **`feeSubsidyPercentage`** (string): The percentage of the transaction fee you want to subsidize for the user. For example, `"100"` covers the entire fee, `"50"` covers half.
858
+ - **`maxFeeSubsidyAmount`** (string, optional): The maximum dollar amount you're willing to subsidize per transaction. If the fee exceeds this cap, the user pays the difference.
859
+
860
+ **How it works:**
861
+
862
+ 1. Set `feeSubsidyPercentage` to define what portion of fees you'll cover
863
+ 2. Optionally set `maxFeeSubsidyAmount` to cap your exposure
864
+ 3. Spritz invoices you separately for the subsidized amounts
865
+ 4. Users see reduced or zero fees on their transactions
866
+
867
+ **Example:**
868
+
869
+ ```typescript
870
+ // Cover 100% of fees up to $5 per transaction
871
+ const paymentRequest = await client.paymentRequest.create({
872
+ amount: 100,
873
+ accountId: account.id,
874
+ network: PaymentNetwork.Ethereum,
875
+ feeSubsidyPercentage: '100',
876
+ maxFeeSubsidyAmount: '5',
877
+ })
878
+
879
+ // If transaction fee is $3: integrator pays $3, user pays $0
880
+ // If transaction fee is $8: integrator pays $5, user pays $3
881
+ ```
882
+
849
883
  ```typescript
850
884
  import {PaymentNetwork, AmountMode} from '@spritz-finance/api-client';
851
885
 
@@ -900,7 +934,6 @@ const transactionData = await client.paymentRequest.getWeb3PaymentParams({
900
934
  calldata: '0xd71d9632000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000000000000000000064539a31c1ac408007b12277',
901
935
  value: null,
902
936
  requiredTokenInput: '100000000',
903
- suggestedGasLimit: '110000'
904
937
  }
905
938
  ```
906
939
 
@@ -195,7 +195,7 @@ query UserBankAccounts {
195
195
  ...BankAccountFragment
196
196
  }
197
197
  }
198
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Cm={};function G1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Cm[t]?!1:(Cm[t]=!0,!0)})}it.definitions=it.definitions.concat(G1(ii.definitions));function gu(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){gu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){gu(u,n)}),e.definitions&&e.definitions.forEach(function(u){gu(u,n)})}var Go={};(function(){it.definitions.forEach(function(n){if(n.name){var t=new Set;gu(n,t),Go[n.name.value]=t}})})();function $m(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 J1(e,n){var t={kind:e.kind,definitions:[$m(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Go[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=Go[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=$m(e,o);s&&t.definitions.push(s)}),t}J1(it,"UserBankAccounts");function Q1(e){throw new Error(e)}var H1=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(H1||{}),Fm=(e=>(e.AMOUNT_RECEIVED="AMOUNT_RECEIVED",e.TOTAL_AMOUNT="TOTAL_AMOUNT",e))(Fm||{}),xm=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(xm||{}),ut=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(ut||{}),Im=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Im||{}),Nm=(e=>(e.Mastercard="Mastercard",e.Visa="Visa",e))(Nm||{}),Tm=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.FAILED_VALIDATION="FAILED_VALIDATION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Tm||{}),rt=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(rt||{}),K1=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.ON_HOLD="ON_HOLD",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSED="REVERSED",e))(K1||{}),W1=(e=>(e.Provider="Provider",e.User="User",e))(W1||{}),Om=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e.DigitalAccount="DigitalAccount",e.VirtualCard="VirtualCard",e))(Om||{}),zm=(e=>(e.INSTANT="INSTANT",e.SAME_DAY="SAME_DAY",e.STANDARD="STANDARD",e))(zm||{}),Um=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(Um||{}),Jo=(e=>(e.USPhysicalDebitCard="USPhysicalDebitCard",e.USVirtualDebitCard="USVirtualDebitCard",e))(Jo||{});const Y1=ye.object({transitNumber:ye.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:ye.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),X1=ye.object({routingNumber:ye.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),eE=ye.object({iban:ye.string().min(15,{message:"IBAN must be at least 15 characters long"}).max(34,{message:"IBAN must be at most 34 characters long"}).regex(/^[A-Z]{2}[0-9]{2}[A-Z0-9]+$/,"IBAN must start with 2 letters, followed by 2 digits, then alphanumeric characters")}),nE=ye.object({sortCode:ye.string().length(6,{message:"Sort code must be exactly 6 characters long"}).regex(/^[0-9]{6}$/,"Sort code should contain only digits.")}),tE={[ut.CABankAccount]:Y1,[ut.USBankAccount]:X1,[ut.IbanAccount]:eE,[ut.UKBankAccount]:nE};class iE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:it}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:tt,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:ln,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const u=tE[n]??Q1("Invalid bank account type");try{const i=u.parse(t);return(await this.client.query({query:nt,variables:{createAccountInput:{accountNumber:t.accountNumber,name:t.name??null,type:n,subType:t.subType,details:i,email:t.email??null,ownedByUser:t.ownedByUser??null}}}))?.createBankAccount??null}catch(i){throw i instanceof ye.ZodError?new Error(i?.issues?.[0]?.message??"Input validation failure"):i}}}var ui={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};ui.loc.source={body:`fragment BillFragment on Bill {
198
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Cm={};function G1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Cm[t]?!1:(Cm[t]=!0,!0)})}it.definitions=it.definitions.concat(G1(ii.definitions));function gu(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){gu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){gu(u,n)}),e.definitions&&e.definitions.forEach(function(u){gu(u,n)})}var Go={};(function(){it.definitions.forEach(function(n){if(n.name){var t=new Set;gu(n,t),Go[n.name.value]=t}})})();function $m(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 J1(e,n){var t={kind:e.kind,definitions:[$m(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Go[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=Go[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=$m(e,o);s&&t.definitions.push(s)}),t}J1(it,"UserBankAccounts");function Q1(e){throw new Error(e)}var H1=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(H1||{}),Fm=(e=>(e.AMOUNT_RECEIVED="AMOUNT_RECEIVED",e.TOTAL_AMOUNT="TOTAL_AMOUNT",e))(Fm||{}),xm=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(xm||{}),ut=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(ut||{}),Im=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Im||{}),Nm=(e=>(e.Mastercard="Mastercard",e.Visa="Visa",e))(Nm||{}),Tm=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.FAILED_VALIDATION="FAILED_VALIDATION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Tm||{}),rt=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNDER_REVIEW="UNDER_REVIEW",e.UNINITIALIZED="UNINITIALIZED",e))(rt||{}),K1=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.ON_HOLD="ON_HOLD",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSED="REVERSED",e))(K1||{}),W1=(e=>(e.Provider="Provider",e.User="User",e))(W1||{}),Om=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e.DigitalAccount="DigitalAccount",e.OneTimePayment="OneTimePayment",e.VirtualCard="VirtualCard",e))(Om||{}),zm=(e=>(e.INSTANT="INSTANT",e.SAME_DAY="SAME_DAY",e.STANDARD="STANDARD",e))(zm||{}),Um=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(Um||{}),Jo=(e=>(e.USPhysicalDebitCard="USPhysicalDebitCard",e.USVirtualDebitCard="USVirtualDebitCard",e))(Jo||{});const Y1=ye.object({transitNumber:ye.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:ye.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),X1=ye.object({routingNumber:ye.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),eE=ye.object({iban:ye.string().min(15,{message:"IBAN must be at least 15 characters long"}).max(34,{message:"IBAN must be at most 34 characters long"}).regex(/^[A-Z]{2}[0-9]{2}[A-Z0-9]+$/,"IBAN must start with 2 letters, followed by 2 digits, then alphanumeric characters")}),nE=ye.object({sortCode:ye.string().length(6,{message:"Sort code must be exactly 6 characters long"}).regex(/^[0-9]{6}$/,"Sort code should contain only digits.")}),tE={[ut.CABankAccount]:Y1,[ut.USBankAccount]:X1,[ut.IbanAccount]:eE,[ut.UKBankAccount]:nE};class iE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:it}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:tt,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:ln,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const u=tE[n]??Q1("Invalid bank account type");try{const i=u.parse(t);return(await this.client.query({query:nt,variables:{createAccountInput:{accountNumber:t.accountNumber,name:t.name??null,type:n,subType:t.subType,details:i,email:t.email??null,ownedByUser:t.ownedByUser??null}}}))?.createBankAccount??null}catch(i){throw i instanceof ye.ZodError?new Error(i?.issues?.[0]?.message??"Input validation failure"):i}}}var ui={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};ui.loc.source={body:`fragment BillFragment on Bill {
199
199
  id
200
200
  name
201
201
  userId
@@ -454,7 +454,7 @@ query Payment($paymentId: String!) {
454
454
  ...PaymentFragment
455
455
  }
456
456
  }
457
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var b4={};function HE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return b4[t]?!1:(b4[t]=!0,!0)})}bt.definitions=bt.definitions.concat(HE(gt.definitions));function qu(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){qu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){qu(u,n)}),e.definitions&&e.definitions.forEach(function(u){qu(u,n)})}var hs={};(function(){bt.definitions.forEach(function(n){if(n.name){var t=new Set;qu(n,t),hs[n.name.value]=t}})})();function k4(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 KE(e,n){var t={kind:e.kind,definitions:[k4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=hs[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=hs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=k4(e,o);s&&t.definitions.push(s)}),t}KE(bt,"Payment");class WE{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:yt,variables:{accountId:n}}))?.paymentsForAccount??[]}async fetchById(n){return(await this.client.query({query:bt,variables:{paymentId:n}}))?.payment??null}async getForPaymentRequest(n){return(await this.client.query({query:Et,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var Mu={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},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:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},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:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},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:"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:247}};Mu.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
457
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var b4={};function HE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return b4[t]?!1:(b4[t]=!0,!0)})}bt.definitions=bt.definitions.concat(HE(gt.definitions));function qu(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){qu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){qu(u,n)}),e.definitions&&e.definitions.forEach(function(u){qu(u,n)})}var hs={};(function(){bt.definitions.forEach(function(n){if(n.name){var t=new Set;qu(n,t),hs[n.name.value]=t}})})();function k4(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 KE(e,n){var t={kind:e.kind,definitions:[k4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=hs[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=hs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=k4(e,o);s&&t.definitions.push(s)}),t}KE(bt,"Payment");class WE{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:yt,variables:{accountId:n}}))?.paymentsForAccount??[]}async fetchById(n){return(await this.client.query({query:bt,variables:{paymentId:n}}))?.payment??null}async getForPaymentRequest(n){return(await this.client.query({query:Et,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var Mu={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},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:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},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:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},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:"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:"feeSubsidyAmount"},arguments:[],directives:[]}]}}],loc:{start:0,end:268}};Mu.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
458
458
  id
459
459
  userId
460
460
  accountId
@@ -468,6 +468,7 @@ query Payment($paymentId: String!) {
468
468
  targetCurrency
469
469
  targetCurrencyAmount
470
470
  targetCurrencyRate
471
+ feeSubsidyAmount
471
472
  }
472
473
  `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Gu(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){Gu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Gu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Gu(u,n)})}var gs={};(function(){Mu.definitions.forEach(function(n){if(n.name){var t=new Set;Gu(n,t),gs[n.name.value]=t}})})();function D4(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 YE(e,n){var t={kind:e.kind,definitions:[D4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=gs[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=gs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=D4(e,o);s&&t.definitions.push(s)}),t}YE(Mu,"PaymentRequestFragment");var kt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePaymentRequest"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateDirectPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDirectPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createDirectPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentRequestFragment"},directives:[]}]}}]}}],loc:{start:0,end:260}};kt.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
473
474
 
@@ -492,7 +493,7 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
492
493
  transaction
493
494
  }
494
495
  }
495
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Hu(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){Hu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Hu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Hu(u,n)})}var ys={};(function(){Qu.definitions.forEach(function(n){if(n.name){var t=new Set;Hu(n,t),ys[n.name.value]=t}})})();function w4(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 ny(e,n){var t={kind:e.kind,definitions:[w4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ys[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=ys[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=w4(e,o);s&&t.definitions.push(s)}),t}ny(Qu,"GetSolanaPayParams");var Ku={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"suggestedGasLimit"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:399}};Ku.loc.source={body:`query GetSpritzPayParams(
496
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Hu(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){Hu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Hu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Hu(u,n)})}var ys={};(function(){Qu.definitions.forEach(function(n){if(n.name){var t=new Set;Hu(n,t),ys[n.name.value]=t}})})();function w4(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 ny(e,n){var t={kind:e.kind,definitions:[w4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ys[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=ys[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=w4(e,o);s&&t.definitions.push(s)}),t}ny(Qu,"GetSolanaPayParams");var Ku={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:373}};Ku.loc.source={body:`query GetSpritzPayParams(
496
497
  $tokenAddress: String!
497
498
  $amount: Float!
498
499
  $reference: String!
@@ -509,7 +510,6 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
509
510
  calldata
510
511
  value
511
512
  requiredTokenInput
512
- suggestedGasLimit
513
513
  }
514
514
  }
515
515
  `,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 bs={};(function(){Ku.definitions.forEach(function(n){if(n.name){var t=new Set;Wu(n,t),bs[n.name.value]=t}})})();function A4(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 ty(e,n){var t={kind:e.kind,definitions:[A4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=bs[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=bs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=A4(e,o);s&&t.definitions.push(s)}),t}ty(Ku,"GetSpritzPayParams");var Dt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Yu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function si(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function fe(e,...n){if(!Yu(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function iy(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");si(e.outputLen),si(e.blockLen)}function St(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function _4(e,n){fe(e);const t=n.outputLen;if(e.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function uy(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Be(...e){for(let n=0;n<e.length;n++)e[n].fill(0)}function ks(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ge(e,n){return e<<32-n|e>>>n}function dn(e,n){return e<<n|e>>>32-n>>>0}var ry=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function ay(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function oy(e){for(let n=0;n<e.length;n++)e[n]=ay(e[n]);return e}var C4=ry?e=>e:oy,$4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",sy=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function ci(e){if(fe(e),$4)return e.toHex();let n="";for(let t=0;t<e.length;t++)n+=sy[e[t]];return n}var We={_0:48,_9:57,A:65,F:70,a:97,f:102};function F4(e){if(e>=We._0&&e<=We._9)return e-We._0;if(e>=We.A&&e<=We.F)return e-(We.A-10);if(e>=We.a&&e<=We.f)return e-(We.a-10)}function Ds(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if($4)return Uint8Array.fromHex(e);const n=e.length,t=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const u=new Uint8Array(t);for(let i=0,r=0;i<t;i++,r+=2){const a=F4(e.charCodeAt(r)),o=F4(e.charCodeAt(r+1));if(a===void 0||o===void 0){const s=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+r)}u[i]=a*16+o}return u}function Xu(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function li(e){return typeof e=="string"&&(e=Xu(e)),fe(e),e}function ke(...e){let n=0;for(let u=0;u<e.length;u++){const i=e[u];fe(i),n+=i.length}const t=new Uint8Array(n);for(let u=0,i=0;u<e.length;u++){const r=e[u];t.set(r,i),i+=r.length}return t}var Ss=class{};function Je(e){const n=u=>e().update(li(u)).digest(),t=e();return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=()=>e(),n}function cy(e){const n=(u,i)=>e(i).update(li(u)).digest(),t=e({});return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=u=>e(u),n}function x4(e=32){if(Dt&&typeof Dt.getRandomValues=="function")return Dt.getRandomValues(new Uint8Array(e));if(Dt&&typeof Dt.randomBytes=="function")return Uint8Array.from(Dt.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var Bs=BigInt(0),ws=BigInt(1);function er(e,n){if(typeof n!="boolean")throw new Error(e+" boolean expected, got "+n)}function nr(e){const n=e.toString(16);return n.length&1?"0"+n:n}function I4(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Bs:BigInt("0x"+e)}function On(e){return I4(ci(e))}function N4(e){return fe(e),I4(ci(Uint8Array.from(e).reverse()))}function di(e,n){return Ds(e.toString(16).padStart(n*2,"0"))}function T4(e,n){return di(e,n).reverse()}function ce(e,n,t){let u;if(typeof n=="string")try{u=Ds(n)}catch(r){throw new Error(e+" must be hex string or Uint8Array, cause: "+r)}else if(Yu(n))u=Uint8Array.from(n);else throw new Error(e+" must be hex string or Uint8Array");const i=u.length;if(typeof t=="number"&&i!==t)throw new Error(e+" of length "+t+" expected, got "+i);return u}var As=e=>typeof e=="bigint"&&Bs<=e;function _s(e,n,t){return As(e)&&As(n)&&As(t)&&n<=e&&e<t}function O4(e,n,t,u){if(!_s(n,t,u))throw new Error("expected valid "+e+": "+t+" <= n < "+u+", got "+n)}function ly(e){let n;for(n=0;e>Bs;e>>=ws,n+=1);return n}var tr=e=>(ws<<BigInt(e))-ws;function dy(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const u=d=>new Uint8Array(d),i=d=>Uint8Array.of(d);let r=u(e),a=u(e),o=0;const s=()=>{r.fill(1),a.fill(0),o=0},c=(...d)=>t(a,r,...d),l=(d=u(0))=>{a=c(i(0),d),r=c(),d.length!==0&&(a=c(i(1),d),r=c())},f=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const v=[];for(;d<n;){r=c();const h=r.slice();v.push(h),d+=r.length}return ke(...v)};return(d,v)=>{s(),l(d);let h;for(;!(h=v(f()));)l();return s(),h}}function fy(e){return typeof e=="function"&&Number.isSafeInteger(e.outputLen)}function ir(e,n,t={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function u(i,r,a){const o=e[i];if(a&&o===void 0)return;const s=typeof o;if(s!==r||o===null)throw new Error(`param "${i}" is invalid: expected ${r}, got ${s}`)}Object.entries(n).forEach(([i,r])=>u(i,r,!1)),Object.entries(t).forEach(([i,r])=>u(i,r,!0))}function z4(e){const n=new WeakMap;return(t,...u)=>{const i=n.get(t);if(i!==void 0)return i;const r=e(t,...u);return n.set(t,r),r}}var ur=BigInt(2**32-1),U4=BigInt(32);function my(e,n=!1){return n?{h:Number(e&ur),l:Number(e>>U4&ur)}:{h:Number(e>>U4&ur)|0,l:Number(e&ur)|0}}function P4(e,n=!1){const t=e.length;let u=new Uint32Array(t),i=new Uint32Array(t);for(let r=0;r<t;r++){const{h:a,l:o}=my(e[r],n);[u[r],i[r]]=[a,o]}return[u,i]}var R4=(e,n,t)=>e>>>t,j4=(e,n,t)=>e<<32-t|n>>>t,Bt=(e,n,t)=>e>>>t|n<<32-t,wt=(e,n,t)=>e<<32-t|n>>>t,rr=(e,n,t)=>e<<64-t|n>>>t-32,ar=(e,n,t)=>e>>>t-32|n<<64-t,vy=(e,n,t)=>e<<t|n>>>32-t,py=(e,n,t)=>n<<t|e>>>32-t,hy=(e,n,t)=>n<<t-32|e>>>64-t,gy=(e,n,t)=>e<<t-32|n>>>64-t;function Ye(e,n,t,u){const i=(n>>>0)+(u>>>0);return{h:e+t+(i/2**32|0)|0,l:i|0}}var Ey=(e,n,t)=>(e>>>0)+(n>>>0)+(t>>>0),yy=(e,n,t,u)=>n+t+u+(e/2**32|0)|0,by=(e,n,t,u)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0),ky=(e,n,t,u,i)=>n+t+u+i+(e/2**32|0)|0,Dy=(e,n,t,u,i)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0)+(i>>>0),Sy=(e,n,t,u,i,r)=>n+t+u+i+r+(e/2**32|0)|0;/*! Bundled license information:
@@ -61,6 +61,7 @@ declare enum ModuleStatus {
61
61
  LOADING = "LOADING",
62
62
  RETRY = "RETRY",
63
63
  UNAVAILABLE = "UNAVAILABLE",
64
+ UNDER_REVIEW = "UNDER_REVIEW",
64
65
  UNINITIALIZED = "UNINITIALIZED"
65
66
  }
66
67
  declare enum OnrampPaymentStatus {
@@ -82,6 +83,7 @@ declare enum PayableAccountType {
82
83
  Bill = "Bill",
83
84
  DebitCard = "DebitCard",
84
85
  DigitalAccount = "DigitalAccount",
86
+ OneTimePayment = "OneTimePayment",
85
87
  VirtualCard = "VirtualCard"
86
88
  }
87
89
  declare enum PaymentDeliveryMethod {
@@ -133,9 +135,12 @@ interface CreateDirectPaymentInput {
133
135
  network: string;
134
136
  pointsRedemptionId?: string | null;
135
137
  paymentNote?: string | null;
138
+ feeSubsidyPercentage?: string | null;
139
+ maxFeeSubsidyAmount?: string | null;
136
140
  paymentStrategy?: string | null;
137
141
  deliveryMethod?: PaymentDeliveryMethod | null;
138
142
  amountMode?: AmountMode | null;
143
+ integratorId?: string | null;
139
144
  }
140
145
  interface CreateOnrampPaymentInput {
141
146
  amount: number;
@@ -398,7 +403,6 @@ interface GetSpritzPayParams_spritzPayParams {
398
403
  calldata: string;
399
404
  value: string | null;
400
405
  requiredTokenInput: string;
401
- suggestedGasLimit: string | null;
402
406
  }
403
407
  interface GetSpritzPayParams {
404
408
  spritzPayParams: GetSpritzPayParams_spritzPayParams;
@@ -475,7 +479,7 @@ interface PayableAccountFragment_DebitCard_institution {
475
479
  logo: string | null;
476
480
  }
477
481
  interface PayableAccountFragment_DebitCard {
478
- __typename: 'DebitCard' | 'DigitalAccount';
482
+ __typename: 'DebitCard' | 'DigitalAccount' | 'OneTimePayment';
479
483
  id: string;
480
484
  name: string | null;
481
485
  userId: string;
@@ -698,6 +702,7 @@ interface PaymentRequestFragment {
698
702
  targetCurrency: string | null;
699
703
  targetCurrencyAmount: number;
700
704
  targetCurrencyRate: number;
705
+ feeSubsidyAmount: number | null;
701
706
  }
702
707
 
703
708
  interface PaymentRequestPayment_paymentForPaymentRequest_transaction {
@@ -973,7 +978,7 @@ interface UserPayableAccounts_payableAccounts_DebitCard_institution {
973
978
  logo: string | null;
974
979
  }
975
980
  interface UserPayableAccounts_payableAccounts_DebitCard {
976
- __typename: 'DebitCard' | 'DigitalAccount';
981
+ __typename: 'DebitCard' | 'DigitalAccount' | 'OneTimePayment';
977
982
  id: string;
978
983
  name: string | null;
979
984
  userId: string;
@@ -1342,7 +1347,7 @@ interface DeletePayableAccount_deletePayableAccount_DebitCard_institution {
1342
1347
  logo: string | null;
1343
1348
  }
1344
1349
  interface DeletePayableAccount_deletePayableAccount_DebitCard {
1345
- __typename: 'DebitCard' | 'DigitalAccount';
1350
+ __typename: 'DebitCard' | 'DigitalAccount' | 'OneTimePayment';
1346
1351
  id: string;
1347
1352
  name: string | null;
1348
1353
  userId: string;
@@ -1437,7 +1442,7 @@ interface DeletePayableAccount_deletePayableAccount_Bill {
1437
1442
  }
1438
1443
 
1439
1444
  interface RenameBankAccount_renamePayableAccount_Bill {
1440
- __typename: 'Bill' | 'DebitCard' | 'DigitalAccount' | 'VirtualCard';
1445
+ __typename: 'Bill' | 'DebitCard' | 'DigitalAccount' | 'OneTimePayment' | 'VirtualCard';
1441
1446
  }
1442
1447
  interface RenameBankAccount_renamePayableAccount_BankAccount_bankAccountDetails_CanadianBankAccountDetails {
1443
1448
  __typename: 'CanadianBankAccountDetails' | 'UKBankAccountDetails' | 'IBANBankAccountDetails';
@@ -1802,6 +1807,7 @@ interface CreatePaymentRequest_createDirectPayment {
1802
1807
  targetCurrency: string | null;
1803
1808
  targetCurrencyAmount: number;
1804
1809
  targetCurrencyRate: number;
1810
+ feeSubsidyAmount: number | null;
1805
1811
  }
1806
1812
 
1807
1813
  type PaymentRequest = CreatePaymentRequest_createDirectPayment;
@@ -195,7 +195,7 @@ query UserBankAccounts {
195
195
  ...BankAccountFragment
196
196
  }
197
197
  }
198
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var _m={};function J1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return _m[t]?!1:(_m[t]=!0,!0)})}it.definitions=it.definitions.concat(J1(ii.definitions));function gu(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){gu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){gu(u,n)}),e.definitions&&e.definitions.forEach(function(u){gu(u,n)})}var Go={};(function(){it.definitions.forEach(function(n){if(n.name){var t=new Set;gu(n,t),Go[n.name.value]=t}})})();function Cm(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:[Cm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Go[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=Go[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Cm(e,o);s&&t.definitions.push(s)}),t}Q1(it,"UserBankAccounts");function H1(e){throw new Error(e)}var K1=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(K1||{}),$m=(e=>(e.AMOUNT_RECEIVED="AMOUNT_RECEIVED",e.TOTAL_AMOUNT="TOTAL_AMOUNT",e))($m||{}),xm=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(xm||{}),ut=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(ut||{}),Fm=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Fm||{}),Im=(e=>(e.Mastercard="Mastercard",e.Visa="Visa",e))(Im||{}),Nm=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.FAILED_VALIDATION="FAILED_VALIDATION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Nm||{}),rt=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(rt||{}),W1=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.ON_HOLD="ON_HOLD",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSED="REVERSED",e))(W1||{}),Y1=(e=>(e.Provider="Provider",e.User="User",e))(Y1||{}),Tm=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e.DigitalAccount="DigitalAccount",e.VirtualCard="VirtualCard",e))(Tm||{}),Om=(e=>(e.INSTANT="INSTANT",e.SAME_DAY="SAME_DAY",e.STANDARD="STANDARD",e))(Om||{}),zm=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(zm||{}),Jo=(e=>(e.USPhysicalDebitCard="USPhysicalDebitCard",e.USVirtualDebitCard="USVirtualDebitCard",e))(Jo||{});const X1=ye.object({transitNumber:ye.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:ye.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),eE=ye.object({routingNumber:ye.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),nE=ye.object({iban:ye.string().min(15,{message:"IBAN must be at least 15 characters long"}).max(34,{message:"IBAN must be at most 34 characters long"}).regex(/^[A-Z]{2}[0-9]{2}[A-Z0-9]+$/,"IBAN must start with 2 letters, followed by 2 digits, then alphanumeric characters")}),tE=ye.object({sortCode:ye.string().length(6,{message:"Sort code must be exactly 6 characters long"}).regex(/^[0-9]{6}$/,"Sort code should contain only digits.")}),iE={[ut.CABankAccount]:X1,[ut.USBankAccount]:eE,[ut.IbanAccount]:nE,[ut.UKBankAccount]:tE};class uE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:it}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:tt,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:ln,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const u=iE[n]??H1("Invalid bank account type");try{const i=u.parse(t);return(await this.client.query({query:nt,variables:{createAccountInput:{accountNumber:t.accountNumber,name:t.name??null,type:n,subType:t.subType,details:i,email:t.email??null,ownedByUser:t.ownedByUser??null}}}))?.createBankAccount??null}catch(i){throw i instanceof ye.ZodError?new Error(i?.issues?.[0]?.message??"Input validation failure"):i}}}var ui={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};ui.loc.source={body:`fragment BillFragment on Bill {
198
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var _m={};function J1(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return _m[t]?!1:(_m[t]=!0,!0)})}it.definitions=it.definitions.concat(J1(ii.definitions));function gu(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){gu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){gu(u,n)}),e.definitions&&e.definitions.forEach(function(u){gu(u,n)})}var Go={};(function(){it.definitions.forEach(function(n){if(n.name){var t=new Set;gu(n,t),Go[n.name.value]=t}})})();function Cm(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:[Cm(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Go[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=Go[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Cm(e,o);s&&t.definitions.push(s)}),t}Q1(it,"UserBankAccounts");function H1(e){throw new Error(e)}var K1=(e=>(e.Active="Active",e.Error="Error",e.Syncing="Syncing",e.Unavailable="Unavailable",e))(K1||{}),$m=(e=>(e.AMOUNT_RECEIVED="AMOUNT_RECEIVED",e.TOTAL_AMOUNT="TOTAL_AMOUNT",e))($m||{}),xm=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(xm||{}),ut=(e=>(e.CABankAccount="CABankAccount",e.IbanAccount="IbanAccount",e.UKBankAccount="UKBankAccount",e.USBankAccount="USBankAccount",e))(ut||{}),Fm=(e=>(e.AutoLoan="AutoLoan",e.CreditCard="CreditCard",e.Loan="Loan",e.MobilePhone="MobilePhone",e.Mortgage="Mortgage",e.StudentLoan="StudentLoan",e.Unknown="Unknown",e.Utility="Utility",e))(Fm||{}),Im=(e=>(e.Mastercard="Mastercard",e.Visa="Visa",e))(Im||{}),Nm=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.FAILED_VALIDATION="FAILED_VALIDATION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(Nm||{}),rt=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNDER_REVIEW="UNDER_REVIEW",e.UNINITIALIZED="UNINITIALIZED",e))(rt||{}),W1=(e=>(e.AWAITING_FUNDS="AWAITING_FUNDS",e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.ON_HOLD="ON_HOLD",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSED="REVERSED",e))(W1||{}),Y1=(e=>(e.Provider="Provider",e.User="User",e))(Y1||{}),Tm=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e.DigitalAccount="DigitalAccount",e.OneTimePayment="OneTimePayment",e.VirtualCard="VirtualCard",e))(Tm||{}),Om=(e=>(e.INSTANT="INSTANT",e.SAME_DAY="SAME_DAY",e.STANDARD="STANDARD",e))(Om||{}),zm=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(zm||{}),Jo=(e=>(e.USPhysicalDebitCard="USPhysicalDebitCard",e.USVirtualDebitCard="USVirtualDebitCard",e))(Jo||{});const X1=ye.object({transitNumber:ye.string().length(5,{message:"Transit number must be exactly 5 characters long"}).regex(/^[0-9]{5}$/,"Transit number should contain only digits."),institutionNumber:ye.string().length(3,{message:"Institution number must be exactly 3 characters long"}).regex(/^[0-9]{3}$/,"Institution number should contain only digits.")}),eE=ye.object({routingNumber:ye.string().length(9,{message:"Routing number must be exactly 9 characters long"}).regex(/^[0-9]{9}$/,"Routing number should contain only digits.")}),nE=ye.object({iban:ye.string().min(15,{message:"IBAN must be at least 15 characters long"}).max(34,{message:"IBAN must be at most 34 characters long"}).regex(/^[A-Z]{2}[0-9]{2}[A-Z0-9]+$/,"IBAN must start with 2 letters, followed by 2 digits, then alphanumeric characters")}),tE=ye.object({sortCode:ye.string().length(6,{message:"Sort code must be exactly 6 characters long"}).regex(/^[0-9]{6}$/,"Sort code should contain only digits.")}),iE={[ut.CABankAccount]:X1,[ut.USBankAccount]:eE,[ut.IbanAccount]:nE,[ut.UKBankAccount]:tE};class uE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:it}))?.bankAccounts??[]}async rename(n,t){return(await this.client.query({query:tt,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:ln,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const u=iE[n]??H1("Invalid bank account type");try{const i=u.parse(t);return(await this.client.query({query:nt,variables:{createAccountInput:{accountNumber:t.accountNumber,name:t.name??null,type:n,subType:t.subType,details:i,email:t.email??null,ownedByUser:t.ownedByUser??null}}}))?.createBankAccount??null}catch(i){throw i instanceof ye.ZodError?new Error(i?.issues?.[0]?.message??"Input validation failure"):i}}}var ui={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BillFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Bill"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"originator"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verifying"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"openedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastPaymentDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentDueDate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nextPaymentMinimumAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastStatementBalance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"remainingStatementBalance"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"dataSync"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lastSync"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"syncStatus"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paymentAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:588}};ui.loc.source={body:`fragment BillFragment on Bill {
199
199
  id
200
200
  name
201
201
  userId
@@ -454,7 +454,7 @@ query Payment($paymentId: String!) {
454
454
  ...PaymentFragment
455
455
  }
456
456
  }
457
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var y4={};function KE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return y4[t]?!1:(y4[t]=!0,!0)})}bt.definitions=bt.definitions.concat(KE(gt.definitions));function qu(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){qu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){qu(u,n)}),e.definitions&&e.definitions.forEach(function(u){qu(u,n)})}var hs={};(function(){bt.definitions.forEach(function(n){if(n.name){var t=new Set;qu(n,t),hs[n.name.value]=t}})})();function b4(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 WE(e,n){var t={kind:e.kind,definitions:[b4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=hs[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=hs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=b4(e,o);s&&t.definitions.push(s)}),t}WE(bt,"Payment");class YE{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:yt,variables:{accountId:n}}))?.paymentsForAccount??[]}async fetchById(n){return(await this.client.query({query:bt,variables:{paymentId:n}}))?.payment??null}async getForPaymentRequest(n){return(await this.client.query({query:Et,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var Mu={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},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:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},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:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},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:"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:247}};Mu.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
457
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var y4={};function KE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return y4[t]?!1:(y4[t]=!0,!0)})}bt.definitions=bt.definitions.concat(KE(gt.definitions));function qu(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){qu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){qu(u,n)}),e.definitions&&e.definitions.forEach(function(u){qu(u,n)})}var hs={};(function(){bt.definitions.forEach(function(n){if(n.name){var t=new Set;qu(n,t),hs[n.name.value]=t}})})();function b4(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 WE(e,n){var t={kind:e.kind,definitions:[b4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=hs[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=hs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=b4(e,o);s&&t.definitions.push(s)}),t}WE(bt,"Payment");class YE{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:yt,variables:{accountId:n}}))?.paymentsForAccount??[]}async fetchById(n){return(await this.client.query({query:bt,variables:{paymentId:n}}))?.payment??null}async getForPaymentRequest(n){return(await this.client.query({query:Et,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var Mu={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},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:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},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:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},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:"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:"feeSubsidyAmount"},arguments:[],directives:[]}]}}],loc:{start:0,end:268}};Mu.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
458
458
  id
459
459
  userId
460
460
  accountId
@@ -468,6 +468,7 @@ query Payment($paymentId: String!) {
468
468
  targetCurrency
469
469
  targetCurrencyAmount
470
470
  targetCurrencyRate
471
+ feeSubsidyAmount
471
472
  }
472
473
  `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Gu(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){Gu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Gu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Gu(u,n)})}var gs={};(function(){Mu.definitions.forEach(function(n){if(n.name){var t=new Set;Gu(n,t),gs[n.name.value]=t}})})();function k4(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 XE(e,n){var t={kind:e.kind,definitions:[k4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=gs[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=gs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=k4(e,o);s&&t.definitions.push(s)}),t}XE(Mu,"PaymentRequestFragment");var kt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePaymentRequest"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateDirectPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDirectPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createDirectPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentRequestFragment"},directives:[]}]}}]}}],loc:{start:0,end:260}};kt.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
473
474
 
@@ -492,7 +493,7 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
492
493
  transaction
493
494
  }
494
495
  }
495
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Hu(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){Hu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Hu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Hu(u,n)})}var ys={};(function(){Qu.definitions.forEach(function(n){if(n.name){var t=new Set;Hu(n,t),ys[n.name.value]=t}})})();function B4(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 ty(e,n){var t={kind:e.kind,definitions:[B4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ys[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=ys[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=B4(e,o);s&&t.definitions.push(s)}),t}ty(Qu,"GetSolanaPayParams");var Ku={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"suggestedGasLimit"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:399}};Ku.loc.source={body:`query GetSpritzPayParams(
496
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Hu(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){Hu(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Hu(u,n)}),e.definitions&&e.definitions.forEach(function(u){Hu(u,n)})}var ys={};(function(){Qu.definitions.forEach(function(n){if(n.name){var t=new Set;Hu(n,t),ys[n.name.value]=t}})})();function B4(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 ty(e,n){var t={kind:e.kind,definitions:[B4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=ys[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=ys[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=B4(e,o);s&&t.definitions.push(s)}),t}ty(Qu,"GetSolanaPayParams");var Ku={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:373}};Ku.loc.source={body:`query GetSpritzPayParams(
496
497
  $tokenAddress: String!
497
498
  $amount: Float!
498
499
  $reference: String!
@@ -509,7 +510,6 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
509
510
  calldata
510
511
  value
511
512
  requiredTokenInput
512
- suggestedGasLimit
513
513
  }
514
514
  }
515
515
  `,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 bs={};(function(){Ku.definitions.forEach(function(n){if(n.name){var t=new Set;Wu(n,t),bs[n.name.value]=t}})})();function w4(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 iy(e,n){var t={kind:e.kind,definitions:[w4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=bs[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=bs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=w4(e,o);s&&t.definitions.push(s)}),t}iy(Ku,"GetSpritzPayParams");var Dt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Yu(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function si(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function fe(e,...n){if(!Yu(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function uy(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");si(e.outputLen),si(e.blockLen)}function St(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function A4(e,n){fe(e);const t=n.outputLen;if(e.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function ry(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Be(...e){for(let n=0;n<e.length;n++)e[n].fill(0)}function ks(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ge(e,n){return e<<32-n|e>>>n}function dn(e,n){return e<<n|e>>>32-n>>>0}var ay=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function oy(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function sy(e){for(let n=0;n<e.length;n++)e[n]=oy(e[n]);return e}var _4=ay?e=>e:sy,C4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",cy=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function ci(e){if(fe(e),C4)return e.toHex();let n="";for(let t=0;t<e.length;t++)n+=cy[e[t]];return n}var We={_0:48,_9:57,A:65,F:70,a:97,f:102};function $4(e){if(e>=We._0&&e<=We._9)return e-We._0;if(e>=We.A&&e<=We.F)return e-(We.A-10);if(e>=We.a&&e<=We.f)return e-(We.a-10)}function Ds(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(C4)return Uint8Array.fromHex(e);const n=e.length,t=n/2;if(n%2)throw new Error("hex string expected, got unpadded hex of length "+n);const u=new Uint8Array(t);for(let i=0,r=0;i<t;i++,r+=2){const a=$4(e.charCodeAt(r)),o=$4(e.charCodeAt(r+1));if(a===void 0||o===void 0){const s=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+s+'" at index '+r)}u[i]=a*16+o}return u}function Xu(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function li(e){return typeof e=="string"&&(e=Xu(e)),fe(e),e}function ke(...e){let n=0;for(let u=0;u<e.length;u++){const i=e[u];fe(i),n+=i.length}const t=new Uint8Array(n);for(let u=0,i=0;u<e.length;u++){const r=e[u];t.set(r,i),i+=r.length}return t}var Ss=class{};function Je(e){const n=u=>e().update(li(u)).digest(),t=e();return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=()=>e(),n}function ly(e){const n=(u,i)=>e(i).update(li(u)).digest(),t=e({});return n.outputLen=t.outputLen,n.blockLen=t.blockLen,n.create=u=>e(u),n}function x4(e=32){if(Dt&&typeof Dt.getRandomValues=="function")return Dt.getRandomValues(new Uint8Array(e));if(Dt&&typeof Dt.randomBytes=="function")return Uint8Array.from(Dt.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var Bs=BigInt(0),ws=BigInt(1);function er(e,n){if(typeof n!="boolean")throw new Error(e+" boolean expected, got "+n)}function nr(e){const n=e.toString(16);return n.length&1?"0"+n:n}function F4(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Bs:BigInt("0x"+e)}function On(e){return F4(ci(e))}function I4(e){return fe(e),F4(ci(Uint8Array.from(e).reverse()))}function di(e,n){return Ds(e.toString(16).padStart(n*2,"0"))}function N4(e,n){return di(e,n).reverse()}function ce(e,n,t){let u;if(typeof n=="string")try{u=Ds(n)}catch(r){throw new Error(e+" must be hex string or Uint8Array, cause: "+r)}else if(Yu(n))u=Uint8Array.from(n);else throw new Error(e+" must be hex string or Uint8Array");const i=u.length;if(typeof t=="number"&&i!==t)throw new Error(e+" of length "+t+" expected, got "+i);return u}var As=e=>typeof e=="bigint"&&Bs<=e;function _s(e,n,t){return As(e)&&As(n)&&As(t)&&n<=e&&e<t}function T4(e,n,t,u){if(!_s(n,t,u))throw new Error("expected valid "+e+": "+t+" <= n < "+u+", got "+n)}function dy(e){let n;for(n=0;e>Bs;e>>=ws,n+=1);return n}var tr=e=>(ws<<BigInt(e))-ws;function fy(e,n,t){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");const u=d=>new Uint8Array(d),i=d=>Uint8Array.of(d);let r=u(e),a=u(e),o=0;const s=()=>{r.fill(1),a.fill(0),o=0},c=(...d)=>t(a,r,...d),l=(d=u(0))=>{a=c(i(0),d),r=c(),d.length!==0&&(a=c(i(1),d),r=c())},f=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const v=[];for(;d<n;){r=c();const h=r.slice();v.push(h),d+=r.length}return ke(...v)};return(d,v)=>{s(),l(d);let h;for(;!(h=v(f()));)l();return s(),h}}function my(e){return typeof e=="function"&&Number.isSafeInteger(e.outputLen)}function ir(e,n,t={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function u(i,r,a){const o=e[i];if(a&&o===void 0)return;const s=typeof o;if(s!==r||o===null)throw new Error(`param "${i}" is invalid: expected ${r}, got ${s}`)}Object.entries(n).forEach(([i,r])=>u(i,r,!1)),Object.entries(t).forEach(([i,r])=>u(i,r,!0))}function O4(e){const n=new WeakMap;return(t,...u)=>{const i=n.get(t);if(i!==void 0)return i;const r=e(t,...u);return n.set(t,r),r}}var ur=BigInt(2**32-1),z4=BigInt(32);function vy(e,n=!1){return n?{h:Number(e&ur),l:Number(e>>z4&ur)}:{h:Number(e>>z4&ur)|0,l:Number(e&ur)|0}}function U4(e,n=!1){const t=e.length;let u=new Uint32Array(t),i=new Uint32Array(t);for(let r=0;r<t;r++){const{h:a,l:o}=vy(e[r],n);[u[r],i[r]]=[a,o]}return[u,i]}var P4=(e,n,t)=>e>>>t,R4=(e,n,t)=>e<<32-t|n>>>t,Bt=(e,n,t)=>e>>>t|n<<32-t,wt=(e,n,t)=>e<<32-t|n>>>t,rr=(e,n,t)=>e<<64-t|n>>>t-32,ar=(e,n,t)=>e>>>t-32|n<<64-t,py=(e,n,t)=>e<<t|n>>>32-t,hy=(e,n,t)=>n<<t|e>>>32-t,gy=(e,n,t)=>n<<t-32|e>>>64-t,Ey=(e,n,t)=>e<<t-32|n>>>64-t;function Ye(e,n,t,u){const i=(n>>>0)+(u>>>0);return{h:e+t+(i/2**32|0)|0,l:i|0}}var yy=(e,n,t)=>(e>>>0)+(n>>>0)+(t>>>0),by=(e,n,t,u)=>n+t+u+(e/2**32|0)|0,ky=(e,n,t,u)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0),Dy=(e,n,t,u,i)=>n+t+u+i+(e/2**32|0)|0,Sy=(e,n,t,u,i)=>(e>>>0)+(n>>>0)+(t>>>0)+(u>>>0)+(i>>>0),By=(e,n,t,u,i,r)=>n+t+u+i+r+(e/2**32|0)|0;/*! Bundled license information:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/api-client",
3
- "version": "0.4.21",
3
+ "version": "0.4.22",
4
4
  "description": "Typescript library for interacting with the Spritz Finance API",
5
5
  "type": "module",
6
6
  "main": "dist/spritz-api-client.cjs",