@spritz-finance/api-client 0.4.20 → 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
@@ -237,51 +237,68 @@ All users must undergo basic identity verification before they can engage with t
237
237
 
238
238
  ### How to Present Verification Flow to the User
239
239
 
240
- Spritz offers two methods for integrating KYC verification:
240
+ Spritz offers two methods for integrating KYC verification, both using the `getVerificationParams()` method:
241
241
 
242
- #### Method 1: Verification URL (Simple Integration)
242
+ ```typescript
243
+ // Get verification parameters from Spritz
244
+ const verificationParams = await client.user.getVerificationParams()
245
+
246
+ // The response includes:
247
+ // - inquiryId: Unique identifier for this verification inquiry
248
+ // - verificationUrl: URL for hosted verification
249
+ // - sessionToken: Token for use with Plaid Link SDK
250
+ // - verificationUrlExpiresAt: Expiration timestamp for the verification URL
251
+ ```
243
252
 
244
- Use the `verificationUrl` for a straightforward integration where Spritz handles the entire verification flow:
253
+ #### Method 1: Verification URL (Simple Integration)
245
254
 
246
- - **Browser**: Open the URL in a new browser tab.
247
- - **In-App**: Embed the URL in an iframe within your application.
248
- - **Mobile**: If your platform is mobile-based, open the URL in a native mobile web view.
249
- - **Email**: Send users an email containing the link, prompting them to complete the identity verification.
255
+ Use the `verificationUrl` from `getVerificationParams()` for a straightforward integration where Spritz handles the entire verification flow:
250
256
 
251
257
  ```typescript
252
- const userData = await client.user.getCurrentUser()
253
- // Access verification data directly from user object
254
- const verificationStatus = userData.verificationStatus
255
- const verificationUrl = userData.verificationUrl
256
- const verifiedCountry = userData.verifiedCountry
257
- const canRetryVerification = userData.canRetryVerification
258
-
259
- // Access verification metadata for failed verifications
260
- const verificationMetadata = userData.verificationMetadata
258
+ const verificationParams = await client.user.getVerificationParams()
259
+ const verificationUrl = verificationParams.verificationUrl
260
+ const expiresAt = verificationParams.verificationUrlExpiresAt
261
+
262
+ // Important: The verification URL is short-lived and single-use
263
+ // - Check the expiration with verificationUrlExpiresAt before using
264
+ // - Once accessed, the URL becomes invalid
265
+ // - If verification is not completed, call getVerificationParams() again for a new URL
266
+
267
+ // Use the verification URL in your application:
268
+ // - Browser: Open the URL in a new browser tab
269
+ // - In-App: Embed the URL in an iframe within your application
270
+ // - Mobile: Open the URL in a native mobile web view
271
+ // - Email: Send users an email containing the link
261
272
  ```
262
273
 
263
- #### Method 2: Verification Token (Advanced Integration)
274
+ **Note**: The verification URL can only be used once. If the user doesn't complete verification after accessing the URL, you'll need to call `getVerificationParams()` again to generate a fresh URL and session.
275
+
276
+ #### Method 2: Embedded Flow (Advanced Integration)
264
277
 
265
- For more control over the verification experience, use the verification token approach with the Plaid Link SDK:
278
+ For more control over the verification experience, use the `inquiryId` and `sessionToken` (if present) from `getVerificationParams()` with the Persona Embedded Flow:
266
279
 
267
280
  ```typescript
268
- // Get a verification token from Spritz
269
- const verificationToken = await client.user.getVerificationToken()
281
+ const verificationParams = await client.user.getVerificationParams()
282
+ const inquiryId = verificationParams.inquiryId
283
+ const sessionToken = verificationParams.sessionToken // May be null for some flows
270
284
 
271
- // Use the token with Plaid Link SDK to create a custom verification flow
285
+ // Use the inquiryId (and sessionToken if present) with Persona's Embedded Flow
286
+ // to create a custom verification experience
272
287
  // This allows you to:
273
288
  // - Customize the UI/UX of the verification process
274
289
  // - Handle callbacks and events directly
275
290
  // - Integrate verification seamlessly into your application flow
291
+ // - Build a native mobile experience using Persona's mobile SDKs
276
292
  ```
277
293
 
278
- The verification token method is ideal when you want to:
294
+ The embedded flow method is ideal when you want to:
295
+
279
296
  - Maintain full control over the user experience
280
297
  - Integrate verification directly into your app without redirects
281
298
  - Handle verification events and callbacks programmatically
282
- - Build a native mobile experience using Plaid's mobile SDKs
299
+ - Track and resume verification sessions with the inquiryId
283
300
 
284
- See the [Plaid Link documentation](https://plaid.com/docs/link/) for detailed integration instructions with the verification token.
301
+ See the [Persona Embedded Flow documentation](https://docs.withpersona.com/quickstart-embedded-flow) for detailed integration instructions with the inquiryId and sessionToken.
285
302
 
286
303
  ### Verification Metadata (Failed Verifications)
287
304
 
@@ -829,6 +846,40 @@ When creating a payment request, you can specify how the amount should be calcul
829
846
 
830
847
  This allows you to control whether fees are included in or added to the specified amount.
831
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
+
832
883
  ```typescript
833
884
  import {PaymentNetwork, AmountMode} from '@spritz-finance/api-client';
834
885
 
@@ -883,7 +934,6 @@ const transactionData = await client.paymentRequest.getWeb3PaymentParams({
883
934
  calldata: '0xd71d9632000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000000000000000000064539a31c1ac408007b12277',
884
935
  value: null,
885
936
  requiredTokenInput: '100000000',
886
- suggestedGasLimit: '110000'
887
937
  }
888
938
  ```
889
939
 
@@ -1210,6 +1260,7 @@ The on-ramp feature allows users to purchase cryptocurrency using traditional pa
1210
1260
  ### Prerequisites
1211
1261
 
1212
1262
  Before a user can on-ramp, they must:
1263
+
1213
1264
  1. Complete platform-level KYC (identity verification)
1214
1265
  2. Accept the third-party on-ramp provider's Terms of Service
1215
1266
  3. Wait for the provider's KYC to process (happens automatically after accepting ToS)
@@ -1228,7 +1279,7 @@ if (accessCapabilities.capabilities.onramp.active) {
1228
1279
  // Features may include: 'ach_purchase', 'wire_purchase'
1229
1280
  } else {
1230
1281
  console.log('User needs to complete requirements:')
1231
- accessCapabilities.capabilities.onramp.requirements.forEach(req => {
1282
+ accessCapabilities.capabilities.onramp.requirements.forEach((req) => {
1232
1283
  console.log(`- ${req.type}: ${req.description}`)
1233
1284
  if (req.actionUrl) {
1234
1285
  console.log(` Action URL: ${req.actionUrl}`)
@@ -1269,7 +1320,7 @@ const access = await client.user.getUserAccess()
1269
1320
 
1270
1321
  // Find the Terms of Service requirement
1271
1322
  const tosRequirement = access.capabilities.onramp.requirements.find(
1272
- req => req.type === 'terms_acceptance'
1323
+ (req) => req.type === 'terms_acceptance'
1273
1324
  )
1274
1325
 
1275
1326
  if (tosRequirement && tosRequirement.actionUrl) {
@@ -1301,7 +1352,7 @@ const access = await client.user.getUserAccess()
1301
1352
 
1302
1353
  // Check provider KYC status (for monitoring only)
1303
1354
  const kycRequirement = access.capabilities.onramp.requirements.find(
1304
- req => req.type === 'identity_verification'
1355
+ (req) => req.type === 'identity_verification'
1305
1356
  )
1306
1357
 
1307
1358
  if (kycRequirement) {
@@ -1327,7 +1378,7 @@ Use webhooks to be notified when user capabilities change:
1327
1378
  // Set up a webhook to monitor capability updates
1328
1379
  const webhook = await client.webhook.create({
1329
1380
  url: 'https://your-server.com/webhook',
1330
- events: ['capabilities.updated']
1381
+ events: ['capabilities.updated'],
1331
1382
  })
1332
1383
 
1333
1384
  // In your webhook handler:
@@ -1354,7 +1405,7 @@ console.log('Supported tokens on Ethereum:', supportedTokens)
1354
1405
  const virtualAccount = await client.virtualAccounts.create({
1355
1406
  network: PaymentNetwork.Ethereum,
1356
1407
  address: '0xYourEthereumAddress',
1357
- token: 'USDC'
1408
+ token: 'USDC',
1358
1409
  })
1359
1410
 
1360
1411
  // The virtual account includes deposit instructions
@@ -1374,7 +1425,7 @@ if (virtualAccount.depositInstructions) {
1374
1425
  // Get all virtual accounts for the user
1375
1426
  const accounts = await client.virtualAccounts.list()
1376
1427
 
1377
- accounts.forEach(account => {
1428
+ accounts.forEach((account) => {
1378
1429
  console.log(`Network: ${account.network}`)
1379
1430
  console.log(`Address: ${account.address}`)
1380
1431
  console.log(`Token: ${account.token}`)
@@ -1406,7 +1457,7 @@ import { SpritzApiClient, Environment, PaymentNetwork } from '@spritz-finance/ap
1406
1457
 
1407
1458
  const client = SpritzApiClient.initialize({
1408
1459
  environment: Environment.Production,
1409
- integrationKey: 'YOUR_INTEGRATION_KEY'
1460
+ integrationKey: 'YOUR_INTEGRATION_KEY',
1410
1461
  })
1411
1462
 
1412
1463
  // Set user API key
@@ -1435,7 +1486,7 @@ async function setupOnramp() {
1435
1486
  const virtualAccount = await client.virtualAccounts.create({
1436
1487
  network: PaymentNetwork.Ethereum,
1437
1488
  address: '0xUserWalletAddress',
1438
- token: 'USDC'
1489
+ token: 'USDC',
1439
1490
  })
1440
1491
 
1441
1492
  console.log('Virtual account created!')
@@ -1444,7 +1495,7 @@ async function setupOnramp() {
1444
1495
  return true
1445
1496
  }
1446
1497
 
1447
- setupOnramp().then(success => {
1498
+ setupOnramp().then((success) => {
1448
1499
  if (success) {
1449
1500
  console.log('On-ramp setup complete!')
1450
1501
  }
@@ -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:
@@ -530,10 +530,7 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
530
530
  */var vb="0.1.1";function pb(){return vb}var Te=class rc extends Error{constructor(n,t={}){const u=(()=>{if(t.cause instanceof rc){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&typeof t.cause.details=="string"?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof rc&&t.cause.docsPath||t.docsPath,a=`https://oxlib.sh${i??""}`,o=[n||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...u||i?["",u?`Details: ${u}`:void 0,i?`See: ${a}`:void 0]:[]].filter(s=>typeof s=="string").join(`
531
531
  `);super(o,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${pb()}`}),this.cause=t.cause,this.details=u,this.docs=a,this.docsPath=i,this.shortMessage=n}walk(n){return gv(this,n)}};function gv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?gv(e.cause,n):n?null:e}function hb(e,n){if(bv(e)>n)throw new Bb({givenSize:bv(e),maxSize:n})}var tn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ev(e){if(e>=tn.zero&&e<=tn.nine)return e-tn.zero;if(e>=tn.A&&e<=tn.F)return e-(tn.A-10);if(e>=tn.a&&e<=tn.f)return e-(tn.a-10)}function gb(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;if(e.length>u)throw new wb({size:e.length,targetSize:u,type:"Bytes"});const i=new Uint8Array(u);for(let r=0;r<u;r++){const a=t==="right";i[a?r:u-r-1]=e[a?r:e.length-r-1]}return i}function Ps(e,n){if(js(e)>n)throw new Ib({givenSize:js(e),maxSize:n})}function yv(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;const i=e.replace("0x","");if(i.length>u*2)throw new Nb({size:Math.ceil(i.length/2),targetSize:u,type:"Hex"});return`0x${i[t==="right"?"padEnd":"padStart"](u*2,"0")}`}new TextDecoder;var Eb=new TextEncoder;function yb(e){return e instanceof Uint8Array?e:typeof e=="string"?kb(e):bb(e)}function bb(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function kb(e,n={}){const{size:t}=n;let u=e;t&&(Ps(e,t),u=Rs(e,t));let i=u.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,a=new Uint8Array(r);for(let o=0,s=0;o<r;o++){const c=Ev(i.charCodeAt(s++)),l=Ev(i.charCodeAt(s++));if(c===void 0||l===void 0)throw new Te(`Invalid byte sequence ("${i[s-2]}${i[s-1]}" in "${i}").`);a[o]=c*16+l}return a}function Db(e,n={}){const{size:t}=n,u=Eb.encode(e);return typeof t=="number"?(hb(u,t),Sb(u,t)):u}function Sb(e,n){return gb(e,{dir:"right",size:n})}function bv(e){return e.length}var Bb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},wb=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}},Ab=new TextEncoder,_b=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function kv(...e){return`0x${e.reduce((n,t)=>n+t.replace("0x",""),"")}`}function Cb(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(Ps(t,n.size),hr(t,n.size)):t}function Dv(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=_b[e[i]];const u=`0x${t}`;return typeof n.size=="number"?(Ps(u,n.size),Rs(u,n.size)):u}function $b(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const c=typeof e=="bigint"?"n":"";throw new xb({max:r?`${r}${c}`:void 0,min:`${a}${c}`,signed:t,size:u,value:`${e}${c}`})}const s=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?hr(s,u):s}function Fb(e,n={}){return Dv(Ab.encode(e),n)}function hr(e,n){return yv(e,{dir:"left",size:n})}function Rs(e,n){return yv(e,{dir:"right",size:n})}function js(e){return Math.ceil((e.length-2)/2)}var xb=class extends Te{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number \`${i}\` is not in safe${u?` ${u*8}-bit`:""}${t?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},Ib=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},Nb=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}},Sv="2.31.7",Ls={getDocsUrl:({docsBaseUrl:e,docsPath:n="",docsSlug:t})=>n?`${e??"https://viem.sh"}${n}${t?`#${t}`:""}`:void 0,version:`viem@${Sv}`},gr=class ac extends Error{constructor(n,t={}){const u=t.cause instanceof ac?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof ac&&t.cause.docsPath||t.docsPath,r=Ls.getDocsUrl?.({...t,docsPath:i}),a=[n||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...u?[`Details: ${u}`]:[],...Ls.version?[`Version: ${Ls.version}`]:[]].join(`
532
532
  `);super(a,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=u,this.docsPath=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=n,this.version=Sv}walk(n){return Bv(this,n)}};function Bv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Bv(e.cause,n):n?null:e}function Zs(e,{strict:n=!0}={}){return!e||typeof e!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function wv(e){return Zs(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var Av=class extends gr{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};function Er(e,{dir:n,size:t=32}={}){return typeof e=="string"?Tb(e,{dir:n,size:t}):Ob(e,{dir:n,size:t})}function Tb(e,{dir:n,size:t=32}={}){if(t===null)return e;const u=e.replace("0x","");if(u.length>t*2)throw new Av({size:Math.ceil(u.length/2),targetSize:t,type:"hex"});return`0x${u[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function Ob(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new Av({size:e.length,targetSize:t,type:"bytes"});const u=new Uint8Array(t);for(let i=0;i<t;i++){const r=n==="right";u[r?i:t-i-1]=e[r?i:e.length-i-1]}return u}var zb=class extends gr{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number "${i}" is not in safe ${u?`${u*8}-bit ${t?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Ub=class extends gr{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function yr(e,{size:n}){if(wv(e)>n)throw new Ub({givenSize:wv(e),maxSize:n})}function Pb(e,n={}){const{signed:t}=n;n.size&&yr(e,{size:n.size});const u=BigInt(e);if(!t)return u;const i=(e.length-2)/2,r=(1n<<BigInt(i)*8n-1n)-1n;return u<=r?u:u-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Rb(e,n={}){return Number(Pb(e,n))}Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function Vs(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const s=typeof e=="bigint"?"n":"";throw new zb({max:r?`${r}${s}`:void 0,min:`${a}${s}`,signed:t,size:u,value:`${e}${s}`})}const o=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?Er(o,{size:u}):o}new TextEncoder;var jb=new TextEncoder;function Lb(e,n={}){return typeof e=="number"||typeof e=="bigint"?Vb(e,n):typeof e=="boolean"?Zb(e,n):Zs(e)?Cv(e,n):$v(e,n)}function Zb(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(yr(t,{size:n.size}),Er(t,{size:n.size})):t}var un={zero:48,nine:57,A:65,F:70,a:97,f:102};function _v(e){if(e>=un.zero&&e<=un.nine)return e-un.zero;if(e>=un.A&&e<=un.F)return e-(un.A-10);if(e>=un.a&&e<=un.f)return e-(un.a-10)}function Cv(e,n={}){let t=e;n.size&&(yr(t,{size:n.size}),t=Er(t,{dir:"right",size:n.size}));let u=t.slice(2);u.length%2&&(u=`0${u}`);const i=u.length/2,r=new Uint8Array(i);for(let a=0,o=0;a<i;a++){const s=_v(u.charCodeAt(o++)),c=_v(u.charCodeAt(o++));if(s===void 0||c===void 0)throw new gr(`Invalid byte sequence ("${u[o-2]}${u[o-1]}" in "${u}").`);r[a]=s*16+c}return r}function Vb(e,n){const t=Vs(e,n);return Cv(t)}function $v(e,n={}){const t=jb.encode(e);return typeof n.size=="number"?(yr(t,{size:n.size}),Er(t,{dir:"right",size:n.size})):t}var qb=BigInt(0),hi=BigInt(1),Mb=BigInt(2),Gb=BigInt(7),Jb=BigInt(256),Qb=BigInt(113),Fv=[],xv=[],Iv=[];for(let e=0,n=hi,t=1,u=0;e<24;e++){[t,u]=[u,(2*t+3*u)%5],Fv.push(2*(5*u+t)),xv.push((e+1)*(e+2)/2%64);let i=qb;for(let r=0;r<7;r++)n=(n<<hi^(n>>Gb)*Qb)%Jb,n&Mb&&(i^=hi<<(hi<<BigInt(r))-hi);Iv.push(i)}var Nv=P4(Iv,!0),Hb=Nv[0],Kb=Nv[1],Tv=(e,n,t)=>t>32?hy(e,n,t):vy(e,n,t),Ov=(e,n,t)=>t>32?gy(e,n,t):py(e,n,t);function Wb(e,n=24){const t=new Uint32Array(10);for(let u=24-n;u<24;u++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,s=(a+2)%10,c=t[s],l=t[s+1],f=Tv(c,l,1)^t[o],m=Ov(c,l,1)^t[o+1];for(let d=0;d<50;d+=10)e[a+d]^=f,e[a+d+1]^=m}let i=e[2],r=e[3];for(let a=0;a<24;a++){const o=xv[a],s=Tv(i,r,o),c=Ov(i,r,o),l=Fv[a];i=e[l],r=e[l+1],e[l]=s,e[l+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=e[a+o];for(let o=0;o<10;o++)e[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}e[0]^=Hb[u],e[1]^=Kb[u]}Be(t)}var zv=class mp extends Ss{constructor(n,t,u,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=n,this.suffix=t,this.outputLen=u,this.enableXOF=i,this.rounds=r,si(u),!(0<n&&n<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=uy(this.state)}clone(){return this._cloneInto()}keccak(){C4(this.state32),Wb(this.state32,this.rounds),C4(this.state32),this.posOut=0,this.pos=0}update(n){St(this),n=li(n),fe(n);const{blockLen:t,state:u}=this,i=n.length;for(let r=0;r<i;){const a=Math.min(t-this.pos,i-r);for(let o=0;o<a;o++)u[this.pos++]^=n[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:n,suffix:t,pos:u,blockLen:i}=this;n[u]^=t,(t&128)!==0&&u===i-1&&this.keccak(),n[i-1]^=128,this.keccak()}writeInto(n){St(this,!1),fe(n),this.finish();const t=this.state,{blockLen:u}=this;for(let i=0,r=n.length;i<r;){this.posOut>=u&&this.keccak();const a=Math.min(u-this.posOut,r-i);n.set(t.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return n}xofInto(n){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(n)}xof(n){return si(n),this.xofInto(new Uint8Array(n))}digestInto(n){if(_4(n,this),this.finished)throw new Error("digest() was already called");return this.writeInto(n),this.destroy(),n}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Be(this.state)}_cloneInto(n){const{blockLen:t,suffix:u,outputLen:i,rounds:r,enableXOF:a}=this;return n||(n=new mp(t,u,i,a,r)),n.state32.set(this.state32),n.pos=this.pos,n.posOut=this.posOut,n.finished=this.finished,n.rounds=r,n.suffix=u,n.outputLen=i,n.enableXOF=a,n.destroyed=this.destroyed,n}},yn=(e,n,t)=>Je(()=>new zv(n,e,t));yn(6,144,224/8),yn(6,136,256/8),yn(6,104,384/8),yn(6,72,512/8),yn(1,144,224/8);var Uv=yn(1,136,256/8);yn(1,104,384/8),yn(1,72,512/8);var Pv=(e,n,t)=>cy((u={})=>new zv(n,e,u.dkLen===void 0?t:u.dkLen,!0));Pv(31,168,128/8),Pv(31,136,256/8);function Yb(e,n){return Uv(Zs(e,{strict:!1})?Lb(e):e)}var gi=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},Xb=/^0x[a-fA-F0-9]{40}$/,qs=new gi(8192);function ek(e,n){const{strict:t=!0}={},u=`${e}.${t}`;if(qs.has(u))return qs.get(u);const i=Xb.test(e)?e.toLowerCase()===e?!0:t?nk(e)===e:!0:!1;return qs.set(u,i),i}var Ms=new gi(8192);function nk(e,n){if(Ms.has(`${e}.${n}`))return Ms.get(`${e}.${n}`);const t=e.substring(2).toLowerCase(),u=Yb($v(t)),i=t.split("");for(let a=0;a<40;a+=2)u[a>>1]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(u[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const r=`0x${i.join("")}`;return Ms.set(`${e}.${n}`,r),r}async function tk(e,{address:n,blockTag:t="latest",blockNumber:u}){const i=await e.request({method:"eth_getTransactionCount",params:[n,typeof u=="bigint"?Vs(u):t]},{dedupe:!!u});return Rb(i)}new gi(128),Vs(0,{size:32}),new gi(8192);var $t=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),bn=new Uint32Array(80),ik=class extends fi{constructor(){super(64,20,8,!1),this.A=$t[0]|0,this.B=$t[1]|0,this.C=$t[2]|0,this.D=$t[3]|0,this.E=$t[4]|0}get(){const{A:e,B:n,C:t,D:u,E:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0,this.E=i|0}process(e,n){for(let o=0;o<16;o++,n+=4)bn[o]=e.getUint32(n,!1);for(let o=16;o<80;o++)bn[o]=dn(bn[o-3]^bn[o-8]^bn[o-14]^bn[o-16],1);let{A:t,B:u,C:i,D:r,E:a}=this;for(let o=0;o<80;o++){let s,c;o<20?(s=or(u,i,r),c=1518500249):o<40?(s=u^i^r,c=1859775393):o<60?(s=L4(u,i,r),c=2400959708):(s=u^i^r,c=3395469782);const l=dn(t,5)+s+a+c+bn[o]|0;a=r,r=i,i=dn(u,30),u=t,t=l}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,a=a+this.E|0,this.set(t,u,i,r,a)}roundClean(){Be(bn)}destroy(){this.set(0,0,0,0,0),Be(this.buffer)}};Je(()=>new ik);var uk=Math.pow(2,32),rk=Array.from({length:64},(e,n)=>Math.floor(uk*Math.abs(Math.sin(n+1)))),br=$t.slice(0,4),Gs=new Uint32Array(16),ak=class extends fi{constructor(){super(64,16,8,!0),this.A=br[0]|0,this.B=br[1]|0,this.C=br[2]|0,this.D=br[3]|0}get(){const{A:e,B:n,C:t,D:u}=this;return[e,n,t,u]}set(e,n,t,u){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0}process(e,n){for(let a=0;a<16;a++,n+=4)Gs[a]=e.getUint32(n,!0);let{A:t,B:u,C:i,D:r}=this;for(let a=0;a<64;a++){let o,s,c;a<16?(o=or(u,i,r),s=a,c=[7,12,17,22]):a<32?(o=or(r,u,i),s=(5*a+1)%16,c=[5,9,14,20]):a<48?(o=u^i^r,s=(3*a+5)%16,c=[4,11,16,23]):(o=i^(u|~r),s=7*a%16,c=[6,10,15,21]),o=o+t+rk[a]+Gs[s],t=r,r=i,i=u,u=u+dn(o,c[a%4])}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,this.set(t,u,i,r)}roundClean(){Be(Gs)}destroy(){this.set(0,0,0,0),Be(this.buffer)}};Je(()=>new ak);var ok=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Rv=Uint8Array.from(new Array(16).fill(0).map((e,n)=>n)),sk=Rv.map(e=>(9*e+5)%16),jv=(()=>{const t=[[Rv],[sk]];for(let u=0;u<4;u++)for(let i of t)i.push(i[u].map(r=>ok[r]));return t})(),Lv=jv[0],Zv=jv[1],Vv=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),ck=Lv.map((e,n)=>e.map(t=>Vv[n][t])),lk=Zv.map((e,n)=>e.map(t=>Vv[n][t])),dk=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),fk=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function qv(e,n,t,u){return e===0?n^t^u:e===1?n&t|~n&u:e===2?(n|~t)^u:e===3?n&u|t&~u:n^(t|~u)}var kr=new Uint32Array(16),mk=class extends fi{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:t,h3:u,h4:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.h0=e|0,this.h1=n|0,this.h2=t|0,this.h3=u|0,this.h4=i|0}process(e,n){for(let m=0;m<16;m++,n+=4)kr[m]=e.getUint32(n,!0);let t=this.h0|0,u=t,i=this.h1|0,r=i,a=this.h2|0,o=a,s=this.h3|0,c=s,l=this.h4|0,f=l;for(let m=0;m<5;m++){const d=4-m,v=dk[m],h=fk[m],b=Lv[m],y=Zv[m],E=ck[m],k=lk[m];for(let _=0;_<16;_++){const B=dn(t+qv(m,i,a,s)+kr[b[_]]+v,E[_])+l|0;t=l,l=s,s=dn(a,10)|0,a=i,i=B}for(let _=0;_<16;_++){const B=dn(u+qv(d,r,o,c)+kr[y[_]]+h,k[_])+f|0;u=f,f=c,c=dn(o,10)|0,o=r,r=B}}this.set(this.h1+a+c|0,this.h2+s+f|0,this.h3+l+u|0,this.h4+t+r|0,this.h0+i+o|0)}roundClean(){Be(kr)}destroy(){this.destroyed=!0,Be(this.buffer),this.set(0,0,0,0,0)}};Je(()=>new mk);function vk(e){const{source:n}=e,t=new Map,u=new gi(8192),i=new Map,r=({address:a,chainId:o})=>`${a}.${o}`;return{async consume({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o}),l=this.get({address:a,chainId:o,client:s});this.increment({address:a,chainId:o});const f=await l;return await n.set({address:a,chainId:o},f),u.set(c,f),f},async increment({address:a,chainId:o}){const s=r({address:a,chainId:o}),c=t.get(s)??0;t.set(s,c+1)},async get({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o});let l=i.get(c);return l||(l=(async()=>{try{const m=await n.get({address:a,chainId:o,client:s}),d=u.get(c)??0;return d>0&&m<=d?d+1:(u.delete(c),m)}finally{this.reset({address:a,chainId:o})}})(),i.set(c,l)),(t.get(c)??0)+await l},reset({address:a,chainId:o}){const s=r({address:a,chainId:o});t.delete(s),i.delete(s)}}}function pk(){return{async get(e){const{address:n,client:t}=e;return tk(t,{address:n,blockTag:"pending"})},set(){}}}vk({source:pk()});function hk(e,n={}){const{as:t=typeof e=="string"?"Hex":"Bytes"}=n,u=Uv(yb(e));return t==="Bytes"?u:Dv(u)}var gk=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},Ek={checksum:new gk(8192)},Js=Ek.checksum,yk=/^0x[a-fA-F0-9]{40}$/;function Mv(e,n={}){const{strict:t=!0}=n;if(!yk.test(e))throw new Gv({address:e,cause:new kk});if(t){if(e.toLowerCase()===e)return;if(bk(e)!==e)throw new Gv({address:e,cause:new Dk})}}function bk(e){if(Js.has(e))return Js.get(e);Mv(e,{strict:!1});const n=e.substring(2).toLowerCase(),t=hk(Db(n),{as:"Bytes"}),u=n.split("");for(let r=0;r<40;r+=2)t[r>>1]>>4>=8&&u[r]&&(u[r]=u[r].toUpperCase()),(t[r>>1]&15)>=8&&u[r+1]&&(u[r+1]=u[r+1].toUpperCase());const i=`0x${u.join("")}`;return Js.set(e,i),i}var Gv=class extends Te{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},kk=class extends Te{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},Dk=class extends Te{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}},Sk=/^(.*)\[([0-9]*)\]$/,Bk=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,wk=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Qs(e,n){if(e.length!==n.length)throw new _k({expectedLength:e.length,givenLength:n.length});const t=[];for(let u=0;u<e.length;u++){const i=e[u],r=n[u];t.push(Qs.encode(i,r))}return kv(...t)}(function(e){function n(t,u,i=!1){if(t==="address"){const s=u;return Mv(s),hr(s.toLowerCase(),i?32:0)}if(t==="string")return Fb(u);if(t==="bytes")return u;if(t==="bool")return hr(Cb(u),i?32:1);const r=t.match(wk);if(r){const[s,c,l="256"]=r,f=Number.parseInt(l)/8;return $b(u,{size:i?32:f,signed:c==="int"})}const a=t.match(Bk);if(a){const[s,c]=a;if(Number.parseInt(c)!==(u.length-2)/2)throw new Ak({expectedSize:Number.parseInt(c),value:u});return Rs(u,i?32:0)}const o=t.match(Sk);if(o&&Array.isArray(u)){const[s,c]=o,l=[];for(let f=0;f<u.length;f++)l.push(n(c,u[f],!0));return l.length===0?"0x":kv(...l)}throw new Ck(t)}e.encode=n})(Qs||(Qs={}));var Ak=class extends Te{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${js(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}},_k=class extends Te{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(`
533
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},Ck=class extends Te{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};function $k(e){if(!/^0[xX][0-9a-fA-F]{40}$/.test(e))return!1;const n="0x"+e.slice(2),t=n.slice(2);return t===t.toLowerCase()||t===t.toUpperCase()?!0:ek(n)}function Jv(e){try{return new sc.PublicKey(e),!0}catch{return!1}}const Hs=e=>Math.round((e+Number.EPSILON)*100)/100;function Fk(e){const n=e.replace(/^data:\w+\/\w+;base64,/,""),t=Buffer.from(n,"base64");return new Uint8Array(t)}class xk{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:kt,variables:{createDirectPaymentInput:{...n,amount:Hs(n.amount)}}}))?.createDirectPayment}async getWeb3PaymentParams(n){if(!$k(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Ku,variables:{amount:Hs(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}async getSolanaPaymentParams(n){if(!Jv(n.paymentTokenAddress))throw new Error(`Invalid token address: ${n.paymentTokenAddress}`);if(!Jv(n.signer))throw new Error(`Invalid signer: ${n.signer}`);const t=await this.client.query({query:Qu,variables:{amount:Hs(n.paymentRequest.amountDue),tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id,signer:n.signer}});return{versionedTransaction:sc.VersionedTransaction.deserialize(Fk(t?.solanaParams?.transactionSerialized??"")),transactionSerialized:t?.solanaParams?.transactionSerialized}}}var Dr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GetKycLinkToken"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getKycLinkToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"enhancedVerification"},value:{kind:"BooleanValue",value:!0}}],directives:[]}]}}],loc:{start:0,end:77}};Dr.loc.source={body:`mutation GetKycLinkToken {
534
- getKycLinkToken(enhancedVerification: true)
535
- }
536
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sr(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){Sr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Sr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Sr(u,n)})}var Ks={};(function(){Dr.definitions.forEach(function(n){if(n.name){var t=new Set;Sr(n,t),Ks[n.name.value]=t}})})();function Qv(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 Ik(e,n){var t={kind:e.kind,definitions:[Qv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ks[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=Ks[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Qv(e,o);s&&t.definitions.push(s)}),t}Ik(Dr,"GetKycLinkToken");var Ft={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VerificationFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Verification"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"canRetry"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationMetadata"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"failureReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"details"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedEmail"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:286}};Ft.loc.source={body:`fragment VerificationFragment on Verification {
533
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},Ck=class extends Te{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};function $k(e){if(!/^0[xX][0-9a-fA-F]{40}$/.test(e))return!1;const n="0x"+e.slice(2),t=n.slice(2);return t===t.toLowerCase()||t===t.toUpperCase()?!0:ek(n)}function Jv(e){try{return new sc.PublicKey(e),!0}catch{return!1}}const Hs=e=>Math.round((e+Number.EPSILON)*100)/100;function Fk(e){const n=e.replace(/^data:\w+\/\w+;base64,/,""),t=Buffer.from(n,"base64");return new Uint8Array(t)}class xk{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:kt,variables:{createDirectPaymentInput:{...n,amount:Hs(n.amount)}}}))?.createDirectPayment}async getWeb3PaymentParams(n){if(!$k(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Ku,variables:{amount:Hs(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}async getSolanaPaymentParams(n){if(!Jv(n.paymentTokenAddress))throw new Error(`Invalid token address: ${n.paymentTokenAddress}`);if(!Jv(n.signer))throw new Error(`Invalid signer: ${n.signer}`);const t=await this.client.query({query:Qu,variables:{amount:Hs(n.paymentRequest.amountDue),tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id,signer:n.signer}});return{versionedTransaction:sc.VersionedTransaction.deserialize(Fk(t?.solanaParams?.transactionSerialized??"")),transactionSerialized:t?.solanaParams?.transactionSerialized}}}var Ft={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VerificationFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Verification"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"canRetry"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationMetadata"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"failureReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"details"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedEmail"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:286}};Ft.loc.source={body:`fragment VerificationFragment on Verification {
537
534
  userId
538
535
  identity {
539
536
  canRetry
@@ -548,14 +545,22 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
548
545
  }
549
546
  }
550
547
  }
551
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Br(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){Br(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Br(u,n)}),e.definitions&&e.definitions.forEach(function(u){Br(u,n)})}var Ws={};(function(){Ft.definitions.forEach(function(n){if(n.name){var t=new Set;Br(n,t),Ws[n.name.value]=t}})})();function Hv(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 Nk(e,n){var t={kind:e.kind,definitions:[Hv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ws[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=Ws[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Hv(e,o);s&&t.definitions.push(s)}),t}Nk(Ft,"VerificationFragment");var xt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RetryFailedVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"retryFailedVerification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:156}};xt.loc.source={body:`#import "../queries/verificationFragment.graphql"
548
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Dr(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){Dr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Dr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Dr(u,n)})}var Ks={};(function(){Ft.definitions.forEach(function(n){if(n.name){var t=new Set;Dr(n,t),Ks[n.name.value]=t}})})();function Qv(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 Ik(e,n){var t={kind:e.kind,definitions:[Qv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ks[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=Ks[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Qv(e,o);s&&t.definitions.push(s)}),t}Ik(Ft,"VerificationFragment");var xt={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RetryFailedVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"retryFailedVerification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:156}};xt.loc.source={body:`#import "../queries/verificationFragment.graphql"
552
549
 
553
550
  mutation RetryFailedVerification {
554
551
  retryFailedVerification {
555
552
  ...VerificationFragment
556
553
  }
557
554
  }
558
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Kv={};function Tk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Kv[t]?!1:(Kv[t]=!0,!0)})}xt.definitions=xt.definitions.concat(Tk(Ft.definitions));function wr(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){wr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wr(u,n)}),e.definitions&&e.definitions.forEach(function(u){wr(u,n)})}var Ys={};(function(){xt.definitions.forEach(function(n){if(n.name){var t=new Set;wr(n,t),Ys[n.name.value]=t}})})();function Wv(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 Ok(e,n){var t={kind:e.kind,definitions:[Wv(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=Wv(e,o);s&&t.definitions.push(s)}),t}Ok(xt,"RetryFailedVerification");var Ei={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};Ei.loc.source={body:`fragment UserFragment on User {
555
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Hv={};function Nk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Hv[t]?!1:(Hv[t]=!0,!0)})}xt.definitions=xt.definitions.concat(Nk(Ft.definitions));function Sr(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){Sr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Sr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Sr(u,n)})}var Ws={};(function(){xt.definitions.forEach(function(n){if(n.name){var t=new Set;Sr(n,t),Ws[n.name.value]=t}})})();function Kv(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 Tk(e,n){var t={kind:e.kind,definitions:[Kv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ws[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=Ws[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Kv(e,o);s&&t.definitions.push(s)}),t}Tk(xt,"RetryFailedVerification");var Br={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GetVerificationParams"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getVerificationParams"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inquiryId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sessionToken"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrlExpiresAt"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:165}};Br.loc.source={body:`mutation GetVerificationParams {
556
+ getVerificationParams {
557
+ inquiryId
558
+ verificationUrl
559
+ sessionToken
560
+ verificationUrlExpiresAt
561
+ }
562
+ }
563
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function wr(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){wr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wr(u,n)}),e.definitions&&e.definitions.forEach(function(u){wr(u,n)})}var Ys={};(function(){Br.definitions.forEach(function(n){if(n.name){var t=new Set;wr(n,t),Ys[n.name.value]=t}})})();function Wv(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 Ok(e,n){var t={kind:e.kind,definitions:[Wv(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=Wv(e,o);s&&t.definitions.push(s)}),t}Ok(Br,"GetVerificationParams");var Ei={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};Ei.loc.source={body:`fragment UserFragment on User {
559
564
  id
560
565
  email
561
566
  firstName
@@ -595,7 +600,7 @@ query UserAccess {
595
600
  hasAcceptedTos
596
601
  }
597
602
  }
598
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var tp={};function ip(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return tp[t]?!1:(tp[t]=!0,!0)})}Dn.definitions=Dn.definitions.concat(ip(Ei.definitions)),Dn.definitions=Dn.definitions.concat(ip(Ft.definitions));function Cr(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){Cr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Cr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Cr(u,n)})}var nc={};(function(){Dn.definitions.forEach(function(n){if(n.name){var t=new Set;Cr(n,t),nc[n.name.value]=t}})})();function up(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 Pk(e,n){var t={kind:e.kind,definitions:[up(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=nc[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=nc[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=up(e,o);s&&t.definitions.push(s)}),t}Pk(Dn,"UserAccess");var rn=(e=>(e.NotStarted="not_started",e.Pending="pending",e.Completed="completed",e.Failed="failed",e))(rn||{}),Oe=(e=>(e.IdentityVerification="identity_verification",e.TermsAcceptance="terms_acceptance",e.AdditionalVerification="additional_verification",e.RegionalCompliance="regional_compliance",e.RiskEvaluation="risk_evaluation",e.DocumentSubmission="document_submission",e))(Oe||{}),$r=(e=>(e.AchPurchase="ach_purchase",e.WirePurchase="wire_purchase",e))($r||{}),rp=(e=>(e.UsBankAccount="us_bank_account",e.UsBills="us_bills",e.UsDebitCard="us_debit_card",e.IbanTransfer="iban_transfer",e.UkBankAccount="uk_bank_account",e.CaBankAccount="ca_bank_account",e))(rp||{}),ap=(e=>(e.UsVirtualCard="us_virtual_card",e.UsPhysicalCard="us_physical_card",e))(ap||{}),Rk=(e=>(e.VerifySms="verify_sms",e.DocumentVerification="documentary_verification",e.RiskCheck="risk_check",e.KycCheck="kyc_check",e.WatchlistScreening="watchlist_screening",e.SelfieCheck="selfie_check",e.AddressInvalid="address_invalid",e.DuplicateIdentity="duplicate_identity",e))(Rk||{}),It=(e=>(e.NotStarted="not_started",e.Verified="verified",e.Failed="failed",e.Disabled="disabled",e))(It||{});function jk(e=rt.INITIALIZED){switch(e){case rt.FAILED:return"failed";case rt.ACTIVE:return"verified";case rt.DISABLED:return"disabled";case rt.RETRY:return"failed";default:return"not_started"}}function op(e){const n=e?.me??null;if(!n)return null;const t=e?.verification??null,u=t?.identity?.verificationMetadata??null,i=u?.details?.matchedEmail??null,r=u?.failureReason?{failureReason:u.failureReason,details:{matchedEmail:i}}:null;return{...n,verificationStatus:jk(t?.identity?.status),verificationUrl:t?.identity?.verificationUrl??null,verifiedCountry:t?.identity?.country??null,canRetryVerification:t?.identity?.canRetry??!1,verificationMetadata:r}}function Lk(e,n){return{verified:e===It.Verified,country:n??null}}function Zk({verificationUrl:e,verificationStatus:n,retryable:t}){if(n!==It.Verified)return n===It.Failed?{type:Oe.IdentityVerification,description:"Identity verification failed. Please retry verification.",retryable:t,status:rn.Failed}:n===It.NotStarted?{type:Oe.IdentityVerification,description:"Verify your identity to unlock features",actionUrl:e,status:rn.NotStarted}:{type:Oe.IdentityVerification,description:"Identity verification pending review",status:rn.Pending}}function Vk(e){try{const n=new URL(e);return n.searchParams.delete("redirect_uri"),n.toString()}catch{return e}}function qk(e,n){if(!e&&n)return{type:Oe.TermsAcceptance,description:"Please review and accept the terms of service",actionUrl:Vk(n),status:rn.NotStarted}}function Mk(e){if(!e)return{type:Oe.IdentityVerification,status:rn.NotStarted};if(!(e.status==="active"||e.status==="approved"))return e.status==="rejected"||e.status==="failed"?{type:Oe.IdentityVerification,status:rn.Failed}:e.status==="pending"||e.status==="in_review"?{type:Oe.IdentityVerification,status:rn.Pending}:{type:Oe.IdentityVerification,status:rn.NotStarted}}function Gk(e){if(!e)return[];if(!["US"].includes(e.toUpperCase()))return[];const n=[];return e.toUpperCase()==="US"&&n.push($r.AchPurchase,$r.WirePurchase),n}function Jk(e,n){const t=Gk(e.country??null);if(!e.verified)return{active:!1,features:[],requirements:[]};const u=[],i=qk(n?.hasAcceptedTos??!1,n?.tosLink);i&&u.push(i);const r=Mk(n);if(r&&u.push(r),t.length===0)return{active:!1,features:[],requirements:u};const a={active:u.length===0,features:u.length===0?t:[],requirements:u};return i?a.nextRequirement=Oe.TermsAcceptance:r&&(a.nextRequirement=Oe.IdentityVerification),a}function Qk(e,n,t){const u=e?.bridgeUser,i=e?.verification?.identity?.canRetry??!1,r=e?.verification?.identity?.verificationUrl??null,a=Lk(n,t),o=Zk({verificationStatus:n,retryable:i,verificationUrl:r}),s={onramp:Jk(a,u)};return{kycStatus:a,...o&&{kycRequirement:o},capabilities:s}}class Hk{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getCurrentUser(){const n=await this.client.query({query:kn});return op(n)}async retryFailedVerification(){return await this.client.query({query:xt}),this.getCurrentUser()}async getVerificationToken(){return(await this.client.query({query:Dr})).getKycLinkToken}async getUserAccess(){const n=await this.client.query({query:Dn}),t=op(n),u=t?.verificationStatus??It.NotStarted,i=t?.verifiedCountry??null;return Qk(n,u,i)}}var yi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},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:469}};yi.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
603
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var tp={};function ip(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return tp[t]?!1:(tp[t]=!0,!0)})}Dn.definitions=Dn.definitions.concat(ip(Ei.definitions)),Dn.definitions=Dn.definitions.concat(ip(Ft.definitions));function Cr(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){Cr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Cr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Cr(u,n)})}var nc={};(function(){Dn.definitions.forEach(function(n){if(n.name){var t=new Set;Cr(n,t),nc[n.name.value]=t}})})();function up(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 Pk(e,n){var t={kind:e.kind,definitions:[up(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=nc[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=nc[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=up(e,o);s&&t.definitions.push(s)}),t}Pk(Dn,"UserAccess");var rn=(e=>(e.NotStarted="not_started",e.Pending="pending",e.Completed="completed",e.Failed="failed",e))(rn||{}),Oe=(e=>(e.IdentityVerification="identity_verification",e.TermsAcceptance="terms_acceptance",e.AdditionalVerification="additional_verification",e.RegionalCompliance="regional_compliance",e.RiskEvaluation="risk_evaluation",e.DocumentSubmission="document_submission",e))(Oe||{}),$r=(e=>(e.AchPurchase="ach_purchase",e.WirePurchase="wire_purchase",e))($r||{}),rp=(e=>(e.UsBankAccount="us_bank_account",e.UsBills="us_bills",e.UsDebitCard="us_debit_card",e.IbanTransfer="iban_transfer",e.UkBankAccount="uk_bank_account",e.CaBankAccount="ca_bank_account",e))(rp||{}),ap=(e=>(e.UsVirtualCard="us_virtual_card",e.UsPhysicalCard="us_physical_card",e))(ap||{}),Rk=(e=>(e.VerifySms="verify_sms",e.DocumentVerification="documentary_verification",e.RiskCheck="risk_check",e.KycCheck="kyc_check",e.WatchlistScreening="watchlist_screening",e.SelfieCheck="selfie_check",e.AddressInvalid="address_invalid",e.DuplicateIdentity="duplicate_identity",e))(Rk||{}),It=(e=>(e.NotStarted="not_started",e.Verified="verified",e.Failed="failed",e.Disabled="disabled",e))(It||{});function jk(e=rt.INITIALIZED){switch(e){case rt.FAILED:return"failed";case rt.ACTIVE:return"verified";case rt.DISABLED:return"disabled";case rt.RETRY:return"failed";default:return"not_started"}}function op(e){const n=e?.me??null;if(!n)return null;const t=e?.verification??null,u=t?.identity?.verificationMetadata??null,i=u?.details?.matchedEmail??null,r=u?.failureReason?{failureReason:u.failureReason,details:{matchedEmail:i}}:null;return{...n,verificationStatus:jk(t?.identity?.status),verificationUrl:t?.identity?.verificationUrl??null,verifiedCountry:t?.identity?.country??null,canRetryVerification:t?.identity?.canRetry??!1,verificationMetadata:r}}function Lk(e,n){return{verified:e===It.Verified,country:n??null}}function Zk({verificationUrl:e,verificationStatus:n,retryable:t}){if(n!==It.Verified)return n===It.Failed?{type:Oe.IdentityVerification,description:"Identity verification failed. Please retry verification.",retryable:t,status:rn.Failed}:n===It.NotStarted?{type:Oe.IdentityVerification,description:"Verify your identity to unlock features",actionUrl:e,status:rn.NotStarted}:{type:Oe.IdentityVerification,description:"Identity verification pending review",status:rn.Pending}}function Vk(e){try{const n=new URL(e);return n.searchParams.delete("redirect_uri"),n.toString()}catch{return e}}function qk(e,n){if(!e&&n)return{type:Oe.TermsAcceptance,description:"Please review and accept the terms of service",actionUrl:Vk(n),status:rn.NotStarted}}function Mk(e){if(!e)return{type:Oe.IdentityVerification,status:rn.NotStarted};if(!(e.status==="active"||e.status==="approved"))return e.status==="rejected"||e.status==="failed"?{type:Oe.IdentityVerification,status:rn.Failed}:e.status==="pending"||e.status==="in_review"?{type:Oe.IdentityVerification,status:rn.Pending}:{type:Oe.IdentityVerification,status:rn.NotStarted}}function Gk(e){if(!e)return[];if(!["US"].includes(e.toUpperCase()))return[];const n=[];return e.toUpperCase()==="US"&&n.push($r.AchPurchase,$r.WirePurchase),n}function Jk(e,n){const t=Gk(e.country??null);if(!e.verified)return{active:!1,features:[],requirements:[]};const u=[],i=qk(n?.hasAcceptedTos??!1,n?.tosLink);i&&u.push(i);const r=Mk(n);if(r&&u.push(r),t.length===0)return{active:!1,features:[],requirements:u};const a={active:u.length===0,features:u.length===0?t:[],requirements:u};return i?a.nextRequirement=Oe.TermsAcceptance:r&&(a.nextRequirement=Oe.IdentityVerification),a}function Qk(e,n,t){const u=e?.bridgeUser,i=e?.verification?.identity?.canRetry??!1,r=e?.verification?.identity?.verificationUrl??null,a=Lk(n,t),o=Zk({verificationStatus:n,retryable:i,verificationUrl:r}),s={onramp:Jk(a,u)};return{kycStatus:a,...o&&{kycRequirement:o},capabilities:s}}class Hk{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getCurrentUser(){const n=await this.client.query({query:kn});return op(n)}async retryFailedVerification(){return await this.client.query({query:xt}),this.getCurrentUser()}async getVerificationParams(){return(await this.client.query({query:Br})).getVerificationParams}async getUserAccess(){const n=await this.client.query({query:Dn}),t=op(n),u=t?.verificationStatus??It.NotStarted,i=t?.verifiedCountry??null;return Qk(n,u,i)}}var yi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},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:469}};yi.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
599
604
  id
600
605
  name
601
606
  userId
@@ -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;
@@ -1823,6 +1829,14 @@ declare class PaymentRequestService {
1823
1829
  }>;
1824
1830
  }
1825
1831
 
1832
+ interface GetVerificationParams_getVerificationParams {
1833
+ __typename: 'VerificationParams';
1834
+ inquiryId: string;
1835
+ verificationUrl: string | null;
1836
+ sessionToken: string | null;
1837
+ verificationUrlExpiresAt: any | null;
1838
+ }
1839
+
1826
1840
  declare enum VerificationFailureReason {
1827
1841
  VerifySms = "verify_sms",
1828
1842
  DocumentVerification = "documentary_verification",
@@ -1947,7 +1961,7 @@ declare class UserService {
1947
1961
  };
1948
1962
  } | null;
1949
1963
  }) | null>;
1950
- getVerificationToken(): Promise<string>;
1964
+ getVerificationParams(): Promise<GetVerificationParams_getVerificationParams>;
1951
1965
  getUserAccess(): Promise<UserAccessCapabilities>;
1952
1966
  }
1953
1967
 
@@ -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:
@@ -530,10 +530,7 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
530
530
  */var pb="0.1.1";function hb(){return pb}var Te=class rc extends Error{constructor(n,t={}){const u=(()=>{if(t.cause instanceof rc){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&typeof t.cause.details=="string"?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof rc&&t.cause.docsPath||t.docsPath,a=`https://oxlib.sh${i??""}`,o=[n||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...u||i?["",u?`Details: ${u}`:void 0,i?`See: ${a}`:void 0]:[]].filter(s=>typeof s=="string").join(`
531
531
  `);super(o,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${hb()}`}),this.cause=t.cause,this.details=u,this.docs=a,this.docsPath=i,this.shortMessage=n}walk(n){return hv(this,n)}};function hv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?hv(e.cause,n):n?null:e}function gb(e,n){if(yv(e)>n)throw new wb({givenSize:yv(e),maxSize:n})}var tn={zero:48,nine:57,A:65,F:70,a:97,f:102};function gv(e){if(e>=tn.zero&&e<=tn.nine)return e-tn.zero;if(e>=tn.A&&e<=tn.F)return e-(tn.A-10);if(e>=tn.a&&e<=tn.f)return e-(tn.a-10)}function Eb(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;if(e.length>u)throw new Ab({size:e.length,targetSize:u,type:"Bytes"});const i=new Uint8Array(u);for(let r=0;r<u;r++){const a=t==="right";i[a?r:u-r-1]=e[a?r:e.length-r-1]}return i}function Ps(e,n){if(js(e)>n)throw new Nb({givenSize:js(e),maxSize:n})}function Ev(e,n={}){const{dir:t,size:u=32}=n;if(u===0)return e;const i=e.replace("0x","");if(i.length>u*2)throw new Tb({size:Math.ceil(i.length/2),targetSize:u,type:"Hex"});return`0x${i[t==="right"?"padEnd":"padStart"](u*2,"0")}`}new TextDecoder;var yb=new TextEncoder;function bb(e){return e instanceof Uint8Array?e:typeof e=="string"?Db(e):kb(e)}function kb(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Db(e,n={}){const{size:t}=n;let u=e;t&&(Ps(e,t),u=Rs(e,t));let i=u.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,a=new Uint8Array(r);for(let o=0,s=0;o<r;o++){const c=gv(i.charCodeAt(s++)),l=gv(i.charCodeAt(s++));if(c===void 0||l===void 0)throw new Te(`Invalid byte sequence ("${i[s-2]}${i[s-1]}" in "${i}").`);a[o]=c*16+l}return a}function Sb(e,n={}){const{size:t}=n,u=yb.encode(e);return typeof t=="number"?(gb(u,t),Bb(u,t)):u}function Bb(e,n){return Eb(e,{dir:"right",size:n})}function yv(e){return e.length}var wb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Ab=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}},_b=new TextEncoder,Cb=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function bv(...e){return`0x${e.reduce((n,t)=>n+t.replace("0x",""),"")}`}function $b(e,n={}){const t=`0x${Number(e)}`;return typeof n.size=="number"?(Ps(t,n.size),hr(t,n.size)):t}function kv(e,n={}){let t="";for(let i=0;i<e.length;i++)t+=Cb[e[i]];const u=`0x${t}`;return typeof n.size=="number"?(Ps(u,n.size),Rs(u,n.size)):u}function xb(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const c=typeof e=="bigint"?"n":"";throw new Ib({max:r?`${r}${c}`:void 0,min:`${a}${c}`,signed:t,size:u,value:`${e}${c}`})}const s=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?hr(s,u):s}function Fb(e,n={}){return kv(_b.encode(e),n)}function hr(e,n){return Ev(e,{dir:"left",size:n})}function Rs(e,n){return Ev(e,{dir:"right",size:n})}function js(e){return Math.ceil((e.length-2)/2)}var Ib=class extends Te{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number \`${i}\` is not in safe${u?` ${u*8}-bit`:""}${t?" signed":" unsigned"} integer range ${e?`(\`${n}\` to \`${e}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},Nb=class extends Te{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},Tb=class extends Te{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}},Dv="2.31.7",Ls={getDocsUrl:({docsBaseUrl:e,docsPath:n="",docsSlug:t})=>n?`${e??"https://viem.sh"}${n}${t?`#${t}`:""}`:void 0,version:`viem@${Dv}`},gr=class ac extends Error{constructor(n,t={}){const u=t.cause instanceof ac?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof ac&&t.cause.docsPath||t.docsPath,r=Ls.getDocsUrl?.({...t,docsPath:i}),a=[n||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: ${r}`]:[],...u?[`Details: ${u}`]:[],...Ls.version?[`Version: ${Ls.version}`]:[]].join(`
532
532
  `);super(a,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=u,this.docsPath=i,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=n,this.version=Dv}walk(n){return Sv(this,n)}};function Sv(e,n){return n?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Sv(e.cause,n):n?null:e}function Zs(e,{strict:n=!0}={}){return!e||typeof e!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Bv(e){return Zs(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var wv=class extends gr{constructor({size:e,targetSize:n,type:t}){super(`${t.charAt(0).toUpperCase()}${t.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};function Er(e,{dir:n,size:t=32}={}){return typeof e=="string"?Ob(e,{dir:n,size:t}):zb(e,{dir:n,size:t})}function Ob(e,{dir:n,size:t=32}={}){if(t===null)return e;const u=e.replace("0x","");if(u.length>t*2)throw new wv({size:Math.ceil(u.length/2),targetSize:t,type:"hex"});return`0x${u[n==="right"?"padEnd":"padStart"](t*2,"0")}`}function zb(e,{dir:n,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new wv({size:e.length,targetSize:t,type:"bytes"});const u=new Uint8Array(t);for(let i=0;i<t;i++){const r=n==="right";u[r?i:t-i-1]=e[r?i:e.length-i-1]}return u}var Ub=class extends gr{constructor({max:e,min:n,signed:t,size:u,value:i}){super(`Number "${i}" is not in safe ${u?`${u*8}-bit ${t?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Pb=class extends gr{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function yr(e,{size:n}){if(Bv(e)>n)throw new Pb({givenSize:Bv(e),maxSize:n})}function Rb(e,n={}){const{signed:t}=n;n.size&&yr(e,{size:n.size});const u=BigInt(e);if(!t)return u;const i=(e.length-2)/2,r=(1n<<BigInt(i)*8n-1n)-1n;return u<=r?u:u-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function jb(e,n={}){return Number(Rb(e,n))}Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function Vs(e,n={}){const{signed:t,size:u}=n,i=BigInt(e);let r;u?t?r=(1n<<BigInt(u)*8n-1n)-1n:r=2n**(BigInt(u)*8n)-1n:typeof e=="number"&&(r=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof r=="bigint"&&t?-r-1n:0;if(r&&i>r||i<a){const s=typeof e=="bigint"?"n":"";throw new Ub({max:r?`${r}${s}`:void 0,min:`${a}${s}`,signed:t,size:u,value:`${e}${s}`})}const o=`0x${(t&&i<0?(1n<<BigInt(u*8))+BigInt(i):i).toString(16)}`;return u?Er(o,{size:u}):o}new TextEncoder;var Lb=new TextEncoder;function Zb(e,n={}){return typeof e=="number"||typeof e=="bigint"?qb(e,n):typeof e=="boolean"?Vb(e,n):Zs(e)?_v(e,n):Cv(e,n)}function Vb(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(yr(t,{size:n.size}),Er(t,{size:n.size})):t}var un={zero:48,nine:57,A:65,F:70,a:97,f:102};function Av(e){if(e>=un.zero&&e<=un.nine)return e-un.zero;if(e>=un.A&&e<=un.F)return e-(un.A-10);if(e>=un.a&&e<=un.f)return e-(un.a-10)}function _v(e,n={}){let t=e;n.size&&(yr(t,{size:n.size}),t=Er(t,{dir:"right",size:n.size}));let u=t.slice(2);u.length%2&&(u=`0${u}`);const i=u.length/2,r=new Uint8Array(i);for(let a=0,o=0;a<i;a++){const s=Av(u.charCodeAt(o++)),c=Av(u.charCodeAt(o++));if(s===void 0||c===void 0)throw new gr(`Invalid byte sequence ("${u[o-2]}${u[o-1]}" in "${u}").`);r[a]=s*16+c}return r}function qb(e,n){const t=Vs(e,n);return _v(t)}function Cv(e,n={}){const t=Lb.encode(e);return typeof n.size=="number"?(yr(t,{size:n.size}),Er(t,{dir:"right",size:n.size})):t}var Mb=BigInt(0),hi=BigInt(1),Gb=BigInt(2),Jb=BigInt(7),Qb=BigInt(256),Hb=BigInt(113),$v=[],xv=[],Fv=[];for(let e=0,n=hi,t=1,u=0;e<24;e++){[t,u]=[u,(2*t+3*u)%5],$v.push(2*(5*u+t)),xv.push((e+1)*(e+2)/2%64);let i=Mb;for(let r=0;r<7;r++)n=(n<<hi^(n>>Jb)*Hb)%Qb,n&Gb&&(i^=hi<<(hi<<BigInt(r))-hi);Fv.push(i)}var Iv=U4(Fv,!0),Kb=Iv[0],Wb=Iv[1],Nv=(e,n,t)=>t>32?gy(e,n,t):py(e,n,t),Tv=(e,n,t)=>t>32?Ey(e,n,t):hy(e,n,t);function Yb(e,n=24){const t=new Uint32Array(10);for(let u=24-n;u<24;u++){for(let a=0;a<10;a++)t[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,s=(a+2)%10,c=t[s],l=t[s+1],f=Nv(c,l,1)^t[o],m=Tv(c,l,1)^t[o+1];for(let d=0;d<50;d+=10)e[a+d]^=f,e[a+d+1]^=m}let i=e[2],r=e[3];for(let a=0;a<24;a++){const o=xv[a],s=Nv(i,r,o),c=Tv(i,r,o),l=$v[a];i=e[l],r=e[l+1],e[l]=s,e[l+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=e[a+o];for(let o=0;o<10;o++)e[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}e[0]^=Kb[u],e[1]^=Wb[u]}Be(t)}var Ov=class fp extends Ss{constructor(n,t,u,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=n,this.suffix=t,this.outputLen=u,this.enableXOF=i,this.rounds=r,si(u),!(0<n&&n<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=ry(this.state)}clone(){return this._cloneInto()}keccak(){_4(this.state32),Yb(this.state32,this.rounds),_4(this.state32),this.posOut=0,this.pos=0}update(n){St(this),n=li(n),fe(n);const{blockLen:t,state:u}=this,i=n.length;for(let r=0;r<i;){const a=Math.min(t-this.pos,i-r);for(let o=0;o<a;o++)u[this.pos++]^=n[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:n,suffix:t,pos:u,blockLen:i}=this;n[u]^=t,(t&128)!==0&&u===i-1&&this.keccak(),n[i-1]^=128,this.keccak()}writeInto(n){St(this,!1),fe(n),this.finish();const t=this.state,{blockLen:u}=this;for(let i=0,r=n.length;i<r;){this.posOut>=u&&this.keccak();const a=Math.min(u-this.posOut,r-i);n.set(t.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return n}xofInto(n){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(n)}xof(n){return si(n),this.xofInto(new Uint8Array(n))}digestInto(n){if(A4(n,this),this.finished)throw new Error("digest() was already called");return this.writeInto(n),this.destroy(),n}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Be(this.state)}_cloneInto(n){const{blockLen:t,suffix:u,outputLen:i,rounds:r,enableXOF:a}=this;return n||(n=new fp(t,u,i,a,r)),n.state32.set(this.state32),n.pos=this.pos,n.posOut=this.posOut,n.finished=this.finished,n.rounds=r,n.suffix=u,n.outputLen=i,n.enableXOF=a,n.destroyed=this.destroyed,n}},yn=(e,n,t)=>Je(()=>new Ov(n,e,t));yn(6,144,224/8),yn(6,136,256/8),yn(6,104,384/8),yn(6,72,512/8),yn(1,144,224/8);var zv=yn(1,136,256/8);yn(1,104,384/8),yn(1,72,512/8);var Uv=(e,n,t)=>ly((u={})=>new Ov(n,e,u.dkLen===void 0?t:u.dkLen,!0));Uv(31,168,128/8),Uv(31,136,256/8);function Xb(e,n){return zv(Zs(e,{strict:!1})?Zb(e):e)}var gi=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},ek=/^0x[a-fA-F0-9]{40}$/,qs=new gi(8192);function nk(e,n){const{strict:t=!0}={},u=`${e}.${t}`;if(qs.has(u))return qs.get(u);const i=ek.test(e)?e.toLowerCase()===e?!0:t?tk(e)===e:!0:!1;return qs.set(u,i),i}var Ms=new gi(8192);function tk(e,n){if(Ms.has(`${e}.${n}`))return Ms.get(`${e}.${n}`);const t=e.substring(2).toLowerCase(),u=Xb(Cv(t)),i=t.split("");for(let a=0;a<40;a+=2)u[a>>1]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(u[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const r=`0x${i.join("")}`;return Ms.set(`${e}.${n}`,r),r}async function ik(e,{address:n,blockTag:t="latest",blockNumber:u}){const i=await e.request({method:"eth_getTransactionCount",params:[n,typeof u=="bigint"?Vs(u):t]},{dedupe:!!u});return jb(i)}new gi(128),Vs(0,{size:32}),new gi(8192);var $t=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),bn=new Uint32Array(80),uk=class extends fi{constructor(){super(64,20,8,!1),this.A=$t[0]|0,this.B=$t[1]|0,this.C=$t[2]|0,this.D=$t[3]|0,this.E=$t[4]|0}get(){const{A:e,B:n,C:t,D:u,E:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0,this.E=i|0}process(e,n){for(let o=0;o<16;o++,n+=4)bn[o]=e.getUint32(n,!1);for(let o=16;o<80;o++)bn[o]=dn(bn[o-3]^bn[o-8]^bn[o-14]^bn[o-16],1);let{A:t,B:u,C:i,D:r,E:a}=this;for(let o=0;o<80;o++){let s,c;o<20?(s=or(u,i,r),c=1518500249):o<40?(s=u^i^r,c=1859775393):o<60?(s=j4(u,i,r),c=2400959708):(s=u^i^r,c=3395469782);const l=dn(t,5)+s+a+c+bn[o]|0;a=r,r=i,i=dn(u,30),u=t,t=l}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,a=a+this.E|0,this.set(t,u,i,r,a)}roundClean(){Be(bn)}destroy(){this.set(0,0,0,0,0),Be(this.buffer)}};Je(()=>new uk);var rk=Math.pow(2,32),ak=Array.from({length:64},(e,n)=>Math.floor(rk*Math.abs(Math.sin(n+1)))),br=$t.slice(0,4),Gs=new Uint32Array(16),ok=class extends fi{constructor(){super(64,16,8,!0),this.A=br[0]|0,this.B=br[1]|0,this.C=br[2]|0,this.D=br[3]|0}get(){const{A:e,B:n,C:t,D:u}=this;return[e,n,t,u]}set(e,n,t,u){this.A=e|0,this.B=n|0,this.C=t|0,this.D=u|0}process(e,n){for(let a=0;a<16;a++,n+=4)Gs[a]=e.getUint32(n,!0);let{A:t,B:u,C:i,D:r}=this;for(let a=0;a<64;a++){let o,s,c;a<16?(o=or(u,i,r),s=a,c=[7,12,17,22]):a<32?(o=or(r,u,i),s=(5*a+1)%16,c=[5,9,14,20]):a<48?(o=u^i^r,s=(3*a+5)%16,c=[4,11,16,23]):(o=i^(u|~r),s=7*a%16,c=[6,10,15,21]),o=o+t+ak[a]+Gs[s],t=r,r=i,i=u,u=u+dn(o,c[a%4])}t=t+this.A|0,u=u+this.B|0,i=i+this.C|0,r=r+this.D|0,this.set(t,u,i,r)}roundClean(){Be(Gs)}destroy(){this.set(0,0,0,0),Be(this.buffer)}};Je(()=>new ok);var sk=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Pv=Uint8Array.from(new Array(16).fill(0).map((e,n)=>n)),ck=Pv.map(e=>(9*e+5)%16),Rv=(()=>{const t=[[Pv],[ck]];for(let u=0;u<4;u++)for(let i of t)i.push(i[u].map(r=>sk[r]));return t})(),jv=Rv[0],Lv=Rv[1],Zv=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),lk=jv.map((e,n)=>e.map(t=>Zv[n][t])),dk=Lv.map((e,n)=>e.map(t=>Zv[n][t])),fk=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),mk=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function Vv(e,n,t,u){return e===0?n^t^u:e===1?n&t|~n&u:e===2?(n|~t)^u:e===3?n&u|t&~u:n^(t|~u)}var kr=new Uint32Array(16),vk=class extends fi{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:n,h2:t,h3:u,h4:i}=this;return[e,n,t,u,i]}set(e,n,t,u,i){this.h0=e|0,this.h1=n|0,this.h2=t|0,this.h3=u|0,this.h4=i|0}process(e,n){for(let m=0;m<16;m++,n+=4)kr[m]=e.getUint32(n,!0);let t=this.h0|0,u=t,i=this.h1|0,r=i,a=this.h2|0,o=a,s=this.h3|0,c=s,l=this.h4|0,f=l;for(let m=0;m<5;m++){const d=4-m,v=fk[m],h=mk[m],b=jv[m],y=Lv[m],E=lk[m],k=dk[m];for(let _=0;_<16;_++){const B=dn(t+Vv(m,i,a,s)+kr[b[_]]+v,E[_])+l|0;t=l,l=s,s=dn(a,10)|0,a=i,i=B}for(let _=0;_<16;_++){const B=dn(u+Vv(d,r,o,c)+kr[y[_]]+h,k[_])+f|0;u=f,f=c,c=dn(o,10)|0,o=r,r=B}}this.set(this.h1+a+c|0,this.h2+s+f|0,this.h3+l+u|0,this.h4+t+r|0,this.h0+i+o|0)}roundClean(){Be(kr)}destroy(){this.destroyed=!0,Be(this.buffer),this.set(0,0,0,0,0)}};Je(()=>new vk);function pk(e){const{source:n}=e,t=new Map,u=new gi(8192),i=new Map,r=({address:a,chainId:o})=>`${a}.${o}`;return{async consume({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o}),l=this.get({address:a,chainId:o,client:s});this.increment({address:a,chainId:o});const f=await l;return await n.set({address:a,chainId:o},f),u.set(c,f),f},async increment({address:a,chainId:o}){const s=r({address:a,chainId:o}),c=t.get(s)??0;t.set(s,c+1)},async get({address:a,chainId:o,client:s}){const c=r({address:a,chainId:o});let l=i.get(c);return l||(l=(async()=>{try{const m=await n.get({address:a,chainId:o,client:s}),d=u.get(c)??0;return d>0&&m<=d?d+1:(u.delete(c),m)}finally{this.reset({address:a,chainId:o})}})(),i.set(c,l)),(t.get(c)??0)+await l},reset({address:a,chainId:o}){const s=r({address:a,chainId:o});t.delete(s),i.delete(s)}}}function hk(){return{async get(e){const{address:n,client:t}=e;return ik(t,{address:n,blockTag:"pending"})},set(){}}}pk({source:hk()});function gk(e,n={}){const{as:t=typeof e=="string"?"Hex":"Bytes"}=n,u=zv(bb(e));return t==="Bytes"?u:kv(u)}var Ek=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const t=this.keys().next().value;t&&this.delete(t)}return this}},yk={checksum:new Ek(8192)},Js=yk.checksum,bk=/^0x[a-fA-F0-9]{40}$/;function qv(e,n={}){const{strict:t=!0}=n;if(!bk.test(e))throw new Mv({address:e,cause:new Dk});if(t){if(e.toLowerCase()===e)return;if(kk(e)!==e)throw new Mv({address:e,cause:new Sk})}}function kk(e){if(Js.has(e))return Js.get(e);qv(e,{strict:!1});const n=e.substring(2).toLowerCase(),t=gk(Sb(n),{as:"Bytes"}),u=n.split("");for(let r=0;r<40;r+=2)t[r>>1]>>4>=8&&u[r]&&(u[r]=u[r].toUpperCase()),(t[r>>1]&15)>=8&&u[r+1]&&(u[r+1]=u[r+1].toUpperCase());const i=`0x${u.join("")}`;return Js.set(e,i),i}var Mv=class extends Te{constructor({address:e,cause:n}){super(`Address "${e}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},Dk=class extends Te{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},Sk=class extends Te{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}},Bk=/^(.*)\[([0-9]*)\]$/,wk=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ak=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Qs(e,n){if(e.length!==n.length)throw new Ck({expectedLength:e.length,givenLength:n.length});const t=[];for(let u=0;u<e.length;u++){const i=e[u],r=n[u];t.push(Qs.encode(i,r))}return bv(...t)}(function(e){function n(t,u,i=!1){if(t==="address"){const s=u;return qv(s),hr(s.toLowerCase(),i?32:0)}if(t==="string")return Fb(u);if(t==="bytes")return u;if(t==="bool")return hr($b(u),i?32:1);const r=t.match(Ak);if(r){const[s,c,l="256"]=r,f=Number.parseInt(l)/8;return xb(u,{size:i?32:f,signed:c==="int"})}const a=t.match(wk);if(a){const[s,c]=a;if(Number.parseInt(c)!==(u.length-2)/2)throw new _k({expectedSize:Number.parseInt(c),value:u});return Rs(u,i?32:0)}const o=t.match(Bk);if(o&&Array.isArray(u)){const[s,c]=o,l=[];for(let f=0;f<u.length;f++)l.push(n(c,u[f],!0));return l.length===0?"0x":bv(...l)}throw new $k(t)}e.encode=n})(Qs||(Qs={}));var _k=class extends Te{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${js(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}},Ck=class extends Te{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${n}`].join(`
533
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},$k=class extends Te{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};function xk(e){if(!/^0[xX][0-9a-fA-F]{40}$/.test(e))return!1;const n="0x"+e.slice(2),t=n.slice(2);return t===t.toLowerCase()||t===t.toUpperCase()?!0:nk(n)}function Gv(e){try{return new mp(e),!0}catch{return!1}}const Hs=e=>Math.round((e+Number.EPSILON)*100)/100;function Fk(e){const n=e.replace(/^data:\w+\/\w+;base64,/,""),t=Buffer.from(n,"base64");return new Uint8Array(t)}class Ik{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:kt,variables:{createDirectPaymentInput:{...n,amount:Hs(n.amount)}}}))?.createDirectPayment}async getWeb3PaymentParams(n){if(!xk(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Ku,variables:{amount:Hs(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}async getSolanaPaymentParams(n){if(!Gv(n.paymentTokenAddress))throw new Error(`Invalid token address: ${n.paymentTokenAddress}`);if(!Gv(n.signer))throw new Error(`Invalid signer: ${n.signer}`);const t=await this.client.query({query:Qu,variables:{amount:Hs(n.paymentRequest.amountDue),tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id,signer:n.signer}});return{versionedTransaction:vp.deserialize(Fk(t?.solanaParams?.transactionSerialized??"")),transactionSerialized:t?.solanaParams?.transactionSerialized}}}var Dr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GetKycLinkToken"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getKycLinkToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"enhancedVerification"},value:{kind:"BooleanValue",value:!0}}],directives:[]}]}}],loc:{start:0,end:77}};Dr.loc.source={body:`mutation GetKycLinkToken {
534
- getKycLinkToken(enhancedVerification: true)
535
- }
536
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sr(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){Sr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Sr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Sr(u,n)})}var Ks={};(function(){Dr.definitions.forEach(function(n){if(n.name){var t=new Set;Sr(n,t),Ks[n.name.value]=t}})})();function Jv(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 Nk(e,n){var t={kind:e.kind,definitions:[Jv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ks[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=Ks[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Jv(e,o);s&&t.definitions.push(s)}),t}Nk(Dr,"GetKycLinkToken");var xt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VerificationFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Verification"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"canRetry"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationMetadata"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"failureReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"details"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedEmail"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:286}};xt.loc.source={body:`fragment VerificationFragment on Verification {
533
+ `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},$k=class extends Te{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};function xk(e){if(!/^0[xX][0-9a-fA-F]{40}$/.test(e))return!1;const n="0x"+e.slice(2),t=n.slice(2);return t===t.toLowerCase()||t===t.toUpperCase()?!0:nk(n)}function Gv(e){try{return new mp(e),!0}catch{return!1}}const Hs=e=>Math.round((e+Number.EPSILON)*100)/100;function Fk(e){const n=e.replace(/^data:\w+\/\w+;base64,/,""),t=Buffer.from(n,"base64");return new Uint8Array(t)}class Ik{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:kt,variables:{createDirectPaymentInput:{...n,amount:Hs(n.amount)}}}))?.createDirectPayment}async getWeb3PaymentParams(n){if(!xk(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Ku,variables:{amount:Hs(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}async getSolanaPaymentParams(n){if(!Gv(n.paymentTokenAddress))throw new Error(`Invalid token address: ${n.paymentTokenAddress}`);if(!Gv(n.signer))throw new Error(`Invalid signer: ${n.signer}`);const t=await this.client.query({query:Qu,variables:{amount:Hs(n.paymentRequest.amountDue),tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id,signer:n.signer}});return{versionedTransaction:vp.deserialize(Fk(t?.solanaParams?.transactionSerialized??"")),transactionSerialized:t?.solanaParams?.transactionSerialized}}}var xt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VerificationFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Verification"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"canRetry"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationMetadata"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"failureReason"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"details"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"matchedEmail"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:286}};xt.loc.source={body:`fragment VerificationFragment on Verification {
537
534
  userId
538
535
  identity {
539
536
  canRetry
@@ -548,14 +545,22 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
548
545
  }
549
546
  }
550
547
  }
551
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Br(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){Br(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Br(u,n)}),e.definitions&&e.definitions.forEach(function(u){Br(u,n)})}var Ws={};(function(){xt.definitions.forEach(function(n){if(n.name){var t=new Set;Br(n,t),Ws[n.name.value]=t}})})();function Qv(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 Tk(e,n){var t={kind:e.kind,definitions:[Qv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ws[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=Ws[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Qv(e,o);s&&t.definitions.push(s)}),t}Tk(xt,"VerificationFragment");var Ft={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RetryFailedVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"retryFailedVerification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:156}};Ft.loc.source={body:`#import "../queries/verificationFragment.graphql"
548
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function Dr(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){Dr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Dr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Dr(u,n)})}var Ks={};(function(){xt.definitions.forEach(function(n){if(n.name){var t=new Set;Dr(n,t),Ks[n.name.value]=t}})})();function Jv(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 Nk(e,n){var t={kind:e.kind,definitions:[Jv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ks[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=Ks[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Jv(e,o);s&&t.definitions.push(s)}),t}Nk(xt,"VerificationFragment");var Ft={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RetryFailedVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"retryFailedVerification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VerificationFragment"},directives:[]}]}}]}}],loc:{start:0,end:156}};Ft.loc.source={body:`#import "../queries/verificationFragment.graphql"
552
549
 
553
550
  mutation RetryFailedVerification {
554
551
  retryFailedVerification {
555
552
  ...VerificationFragment
556
553
  }
557
554
  }
558
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Hv={};function Ok(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Hv[t]?!1:(Hv[t]=!0,!0)})}Ft.definitions=Ft.definitions.concat(Ok(xt.definitions));function wr(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){wr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wr(u,n)}),e.definitions&&e.definitions.forEach(function(u){wr(u,n)})}var Ys={};(function(){Ft.definitions.forEach(function(n){if(n.name){var t=new Set;wr(n,t),Ys[n.name.value]=t}})})();function Kv(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 zk(e,n){var t={kind:e.kind,definitions:[Kv(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=Kv(e,o);s&&t.definitions.push(s)}),t}zk(Ft,"RetryFailedVerification");var Ei={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};Ei.loc.source={body:`fragment UserFragment on User {
555
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var Qv={};function Tk(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Qv[t]?!1:(Qv[t]=!0,!0)})}Ft.definitions=Ft.definitions.concat(Tk(xt.definitions));function Sr(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){Sr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Sr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Sr(u,n)})}var Ws={};(function(){Ft.definitions.forEach(function(n){if(n.name){var t=new Set;Sr(n,t),Ws[n.name.value]=t}})})();function Hv(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 Ok(e,n){var t={kind:e.kind,definitions:[Hv(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=Ws[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=Ws[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=Hv(e,o);s&&t.definitions.push(s)}),t}Ok(Ft,"RetryFailedVerification");var Br={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"GetVerificationParams"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getVerificationParams"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"inquiryId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sessionToken"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrlExpiresAt"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:165}};Br.loc.source={body:`mutation GetVerificationParams {
556
+ getVerificationParams {
557
+ inquiryId
558
+ verificationUrl
559
+ sessionToken
560
+ verificationUrlExpiresAt
561
+ }
562
+ }
563
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};function wr(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){wr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){wr(u,n)}),e.definitions&&e.definitions.forEach(function(u){wr(u,n)})}var Ys={};(function(){Br.definitions.forEach(function(n){if(n.name){var t=new Set;wr(n,t),Ys[n.name.value]=t}})})();function Kv(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 zk(e,n){var t={kind:e.kind,definitions:[Kv(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=Kv(e,o);s&&t.definitions.push(s)}),t}zk(Br,"GetVerificationParams");var Ei={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:105}};Ei.loc.source={body:`fragment UserFragment on User {
559
564
  id
560
565
  email
561
566
  firstName
@@ -595,7 +600,7 @@ query UserAccess {
595
600
  hasAcceptedTos
596
601
  }
597
602
  }
598
- `,name:"GraphQL request",locationOffset:{line:1,column:1}};var np={};function tp(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return np[t]?!1:(np[t]=!0,!0)})}Dn.definitions=Dn.definitions.concat(tp(Ei.definitions)),Dn.definitions=Dn.definitions.concat(tp(xt.definitions));function Cr(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){Cr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Cr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Cr(u,n)})}var nc={};(function(){Dn.definitions.forEach(function(n){if(n.name){var t=new Set;Cr(n,t),nc[n.name.value]=t}})})();function ip(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 Rk(e,n){var t={kind:e.kind,definitions:[ip(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=nc[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=nc[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=ip(e,o);s&&t.definitions.push(s)}),t}Rk(Dn,"UserAccess");var rn=(e=>(e.NotStarted="not_started",e.Pending="pending",e.Completed="completed",e.Failed="failed",e))(rn||{}),Oe=(e=>(e.IdentityVerification="identity_verification",e.TermsAcceptance="terms_acceptance",e.AdditionalVerification="additional_verification",e.RegionalCompliance="regional_compliance",e.RiskEvaluation="risk_evaluation",e.DocumentSubmission="document_submission",e))(Oe||{}),$r=(e=>(e.AchPurchase="ach_purchase",e.WirePurchase="wire_purchase",e))($r||{}),up=(e=>(e.UsBankAccount="us_bank_account",e.UsBills="us_bills",e.UsDebitCard="us_debit_card",e.IbanTransfer="iban_transfer",e.UkBankAccount="uk_bank_account",e.CaBankAccount="ca_bank_account",e))(up||{}),rp=(e=>(e.UsVirtualCard="us_virtual_card",e.UsPhysicalCard="us_physical_card",e))(rp||{}),jk=(e=>(e.VerifySms="verify_sms",e.DocumentVerification="documentary_verification",e.RiskCheck="risk_check",e.KycCheck="kyc_check",e.WatchlistScreening="watchlist_screening",e.SelfieCheck="selfie_check",e.AddressInvalid="address_invalid",e.DuplicateIdentity="duplicate_identity",e))(jk||{}),It=(e=>(e.NotStarted="not_started",e.Verified="verified",e.Failed="failed",e.Disabled="disabled",e))(It||{});function Lk(e=rt.INITIALIZED){switch(e){case rt.FAILED:return"failed";case rt.ACTIVE:return"verified";case rt.DISABLED:return"disabled";case rt.RETRY:return"failed";default:return"not_started"}}function ap(e){const n=e?.me??null;if(!n)return null;const t=e?.verification??null,u=t?.identity?.verificationMetadata??null,i=u?.details?.matchedEmail??null,r=u?.failureReason?{failureReason:u.failureReason,details:{matchedEmail:i}}:null;return{...n,verificationStatus:Lk(t?.identity?.status),verificationUrl:t?.identity?.verificationUrl??null,verifiedCountry:t?.identity?.country??null,canRetryVerification:t?.identity?.canRetry??!1,verificationMetadata:r}}function Zk(e,n){return{verified:e===It.Verified,country:n??null}}function Vk({verificationUrl:e,verificationStatus:n,retryable:t}){if(n!==It.Verified)return n===It.Failed?{type:Oe.IdentityVerification,description:"Identity verification failed. Please retry verification.",retryable:t,status:rn.Failed}:n===It.NotStarted?{type:Oe.IdentityVerification,description:"Verify your identity to unlock features",actionUrl:e,status:rn.NotStarted}:{type:Oe.IdentityVerification,description:"Identity verification pending review",status:rn.Pending}}function qk(e){try{const n=new URL(e);return n.searchParams.delete("redirect_uri"),n.toString()}catch{return e}}function Mk(e,n){if(!e&&n)return{type:Oe.TermsAcceptance,description:"Please review and accept the terms of service",actionUrl:qk(n),status:rn.NotStarted}}function Gk(e){if(!e)return{type:Oe.IdentityVerification,status:rn.NotStarted};if(!(e.status==="active"||e.status==="approved"))return e.status==="rejected"||e.status==="failed"?{type:Oe.IdentityVerification,status:rn.Failed}:e.status==="pending"||e.status==="in_review"?{type:Oe.IdentityVerification,status:rn.Pending}:{type:Oe.IdentityVerification,status:rn.NotStarted}}function Jk(e){if(!e)return[];if(!["US"].includes(e.toUpperCase()))return[];const n=[];return e.toUpperCase()==="US"&&n.push($r.AchPurchase,$r.WirePurchase),n}function Qk(e,n){const t=Jk(e.country??null);if(!e.verified)return{active:!1,features:[],requirements:[]};const u=[],i=Mk(n?.hasAcceptedTos??!1,n?.tosLink);i&&u.push(i);const r=Gk(n);if(r&&u.push(r),t.length===0)return{active:!1,features:[],requirements:u};const a={active:u.length===0,features:u.length===0?t:[],requirements:u};return i?a.nextRequirement=Oe.TermsAcceptance:r&&(a.nextRequirement=Oe.IdentityVerification),a}function Hk(e,n,t){const u=e?.bridgeUser,i=e?.verification?.identity?.canRetry??!1,r=e?.verification?.identity?.verificationUrl??null,a=Zk(n,t),o=Vk({verificationStatus:n,retryable:i,verificationUrl:r}),s={onramp:Qk(a,u)};return{kycStatus:a,...o&&{kycRequirement:o},capabilities:s}}class Kk{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getCurrentUser(){const n=await this.client.query({query:kn});return ap(n)}async retryFailedVerification(){return await this.client.query({query:Ft}),this.getCurrentUser()}async getVerificationToken(){return(await this.client.query({query:Dr})).getKycLinkToken}async getUserAccess(){const n=await this.client.query({query:Dn}),t=ap(n),u=t?.verificationStatus??It.NotStarted,i=t?.verifiedCountry??null;return Hk(n,u,i)}}var yi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},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:469}};yi.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
603
+ `,name:"GraphQL request",locationOffset:{line:1,column:1}};var np={};function tp(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return np[t]?!1:(np[t]=!0,!0)})}Dn.definitions=Dn.definitions.concat(tp(Ei.definitions)),Dn.definitions=Dn.definitions.concat(tp(xt.definitions));function Cr(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){Cr(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){Cr(u,n)}),e.definitions&&e.definitions.forEach(function(u){Cr(u,n)})}var nc={};(function(){Dn.definitions.forEach(function(n){if(n.name){var t=new Set;Cr(n,t),nc[n.name.value]=t}})})();function ip(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 Rk(e,n){var t={kind:e.kind,definitions:[ip(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=nc[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=nc[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=ip(e,o);s&&t.definitions.push(s)}),t}Rk(Dn,"UserAccess");var rn=(e=>(e.NotStarted="not_started",e.Pending="pending",e.Completed="completed",e.Failed="failed",e))(rn||{}),Oe=(e=>(e.IdentityVerification="identity_verification",e.TermsAcceptance="terms_acceptance",e.AdditionalVerification="additional_verification",e.RegionalCompliance="regional_compliance",e.RiskEvaluation="risk_evaluation",e.DocumentSubmission="document_submission",e))(Oe||{}),$r=(e=>(e.AchPurchase="ach_purchase",e.WirePurchase="wire_purchase",e))($r||{}),up=(e=>(e.UsBankAccount="us_bank_account",e.UsBills="us_bills",e.UsDebitCard="us_debit_card",e.IbanTransfer="iban_transfer",e.UkBankAccount="uk_bank_account",e.CaBankAccount="ca_bank_account",e))(up||{}),rp=(e=>(e.UsVirtualCard="us_virtual_card",e.UsPhysicalCard="us_physical_card",e))(rp||{}),jk=(e=>(e.VerifySms="verify_sms",e.DocumentVerification="documentary_verification",e.RiskCheck="risk_check",e.KycCheck="kyc_check",e.WatchlistScreening="watchlist_screening",e.SelfieCheck="selfie_check",e.AddressInvalid="address_invalid",e.DuplicateIdentity="duplicate_identity",e))(jk||{}),It=(e=>(e.NotStarted="not_started",e.Verified="verified",e.Failed="failed",e.Disabled="disabled",e))(It||{});function Lk(e=rt.INITIALIZED){switch(e){case rt.FAILED:return"failed";case rt.ACTIVE:return"verified";case rt.DISABLED:return"disabled";case rt.RETRY:return"failed";default:return"not_started"}}function ap(e){const n=e?.me??null;if(!n)return null;const t=e?.verification??null,u=t?.identity?.verificationMetadata??null,i=u?.details?.matchedEmail??null,r=u?.failureReason?{failureReason:u.failureReason,details:{matchedEmail:i}}:null;return{...n,verificationStatus:Lk(t?.identity?.status),verificationUrl:t?.identity?.verificationUrl??null,verifiedCountry:t?.identity?.country??null,canRetryVerification:t?.identity?.canRetry??!1,verificationMetadata:r}}function Zk(e,n){return{verified:e===It.Verified,country:n??null}}function Vk({verificationUrl:e,verificationStatus:n,retryable:t}){if(n!==It.Verified)return n===It.Failed?{type:Oe.IdentityVerification,description:"Identity verification failed. Please retry verification.",retryable:t,status:rn.Failed}:n===It.NotStarted?{type:Oe.IdentityVerification,description:"Verify your identity to unlock features",actionUrl:e,status:rn.NotStarted}:{type:Oe.IdentityVerification,description:"Identity verification pending review",status:rn.Pending}}function qk(e){try{const n=new URL(e);return n.searchParams.delete("redirect_uri"),n.toString()}catch{return e}}function Mk(e,n){if(!e&&n)return{type:Oe.TermsAcceptance,description:"Please review and accept the terms of service",actionUrl:qk(n),status:rn.NotStarted}}function Gk(e){if(!e)return{type:Oe.IdentityVerification,status:rn.NotStarted};if(!(e.status==="active"||e.status==="approved"))return e.status==="rejected"||e.status==="failed"?{type:Oe.IdentityVerification,status:rn.Failed}:e.status==="pending"||e.status==="in_review"?{type:Oe.IdentityVerification,status:rn.Pending}:{type:Oe.IdentityVerification,status:rn.NotStarted}}function Jk(e){if(!e)return[];if(!["US"].includes(e.toUpperCase()))return[];const n=[];return e.toUpperCase()==="US"&&n.push($r.AchPurchase,$r.WirePurchase),n}function Qk(e,n){const t=Jk(e.country??null);if(!e.verified)return{active:!1,features:[],requirements:[]};const u=[],i=Mk(n?.hasAcceptedTos??!1,n?.tosLink);i&&u.push(i);const r=Gk(n);if(r&&u.push(r),t.length===0)return{active:!1,features:[],requirements:u};const a={active:u.length===0,features:u.length===0?t:[],requirements:u};return i?a.nextRequirement=Oe.TermsAcceptance:r&&(a.nextRequirement=Oe.IdentityVerification),a}function Hk(e,n,t){const u=e?.bridgeUser,i=e?.verification?.identity?.canRetry??!1,r=e?.verification?.identity?.verificationUrl??null,a=Zk(n,t),o=Vk({verificationStatus:n,retryable:i,verificationUrl:r}),s={onramp:Qk(a,u)};return{kycStatus:a,...o&&{kycRequirement:o},capabilities:s}}class Kk{client;constructor(n){this.client=n}async createUser(n){return this.client.request({method:"post",path:"/users/integration",body:n})}async create(n){return this.createUser(n)}async requestApiKey(n){return this.client.request({method:"post",path:"/users/request-key",body:{email:n}})}async authorizeApiKeyWithOTP(n){return this.client.request({method:"post",path:"/users/validate-key",body:n})}async getCurrentUser(){const n=await this.client.query({query:kn});return ap(n)}async retryFailedVerification(){return await this.client.query({query:Ft}),this.getCurrentUser()}async getVerificationParams(){return(await this.client.query({query:Br})).getVerificationParams}async getUserAccess(){const n=await this.client.query({query:Dn}),t=ap(n),u=t?.verificationStatus??It.NotStarted,i=t?.verifiedCountry??null;return Hk(n,u,i)}}var yi={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},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:469}};yi.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
599
604
  id
600
605
  name
601
606
  userId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/api-client",
3
- "version": "0.4.20",
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",