@spritz-finance/api-client 0.4.24 → 0.4.25

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.
@@ -411,13 +411,14 @@ query VirtualAccounts {
411
411
  virtualAccounts {
412
412
  ...VirtualAccountFragment
413
413
  }
414
- }`,name:"GraphQL request",locationOffset:{line:1,column:1}};var v4={};function qE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return v4[t]?!1:(v4[t]=!0,!0)})}ht.definitions=ht.definitions.concat(qE(oi.definitions));function ju(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){ju(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){ju(u,n)}),e.definitions&&e.definitions.forEach(function(u){ju(u,n)})}var vs={};(function(){ht.definitions.forEach(function(n){if(n.name){var t=new Set;ju(n,t),vs[n.name.value]=t}})})();function p4(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 ME(e,n){var t={kind:e.kind,definitions:[p4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=vs[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=vs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=p4(e,o);s&&t.definitions.push(s)}),t}ME(ht,"VirtualAccounts");var Me=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Base="base",e.Bitcoin="bitcoin",e.Dash="dash",e.Tron="tron",e.Solana="solana",e.Sui="sui",e))(Me||{});const h4={[Me.Ethereum]:["USDC","USDT","DAI","USDP","PYUSD"],[Me.Polygon]:["USDC"],[Me.Base]:["USDC"],[Me.Arbitrum]:["USDC"],[Me.Avalanche]:["USDC"],[Me.Optimism]:["USDC"],[Me.Solana]:["USDC","PYUSD"],[Me.Tron]:["USDT"]};function GE(e){const{network:n,token:t}=e,u=h4[n];if(!u||!u.includes(t))throw new Error(`Token "${t}" is not supported on network "${n}". Supported tokens for ${n}: ${u?.join(", ")||"none"}`)}class JE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:ht})).virtualAccounts}async create(n){return GE(n),(await this.client.query({query:pt,variables:{network:n.network,address:n.address,token:n.token}})).createVirtualAccount}}var gt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"failureReason"},name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:348}};gt.loc.source={body:`fragment PaymentFragment on Payment {
414
+ }`,name:"GraphQL request",locationOffset:{line:1,column:1}};var v4={};function qE(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return v4[t]?!1:(v4[t]=!0,!0)})}ht.definitions=ht.definitions.concat(qE(oi.definitions));function ju(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){ju(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){ju(u,n)}),e.definitions&&e.definitions.forEach(function(u){ju(u,n)})}var vs={};(function(){ht.definitions.forEach(function(n){if(n.name){var t=new Set;ju(n,t),vs[n.name.value]=t}})})();function p4(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 ME(e,n){var t={kind:e.kind,definitions:[p4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=vs[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=vs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=p4(e,o);s&&t.definitions.push(s)}),t}ME(ht,"VirtualAccounts");var Me=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Base="base",e.Bitcoin="bitcoin",e.Dash="dash",e.Tron="tron",e.Solana="solana",e.Sui="sui",e))(Me||{});const h4={[Me.Ethereum]:["USDC","USDT","DAI","USDP","PYUSD"],[Me.Polygon]:["USDC"],[Me.Base]:["USDC"],[Me.Arbitrum]:["USDC"],[Me.Avalanche]:["USDC"],[Me.Optimism]:["USDC"],[Me.Solana]:["USDC","PYUSD"],[Me.Tron]:["USDT"]};function GE(e){const{network:n,token:t}=e,u=h4[n];if(!u||!u.includes(t))throw new Error(`Token "${t}" is not supported on network "${n}". Supported tokens for ${n}: ${u?.join(", ")||"none"}`)}class JE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:ht})).virtualAccounts}async create(n){return GE(n),(await this.client.query({query:pt,variables:{network:n.network,address:n.address,token:n.token}})).createVirtualAccount}}var gt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeSubsidyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"failureReason"},name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:369}};gt.loc.source={body:`fragment PaymentFragment on Payment {
415
415
  id
416
416
  userId
417
417
  status
418
418
  accountId
419
419
  amount
420
420
  feeAmount
421
+ feeSubsidyAmount
421
422
  createdAt
422
423
  deliveryMethod
423
424
  paymentRequestId
@@ -216,6 +216,7 @@ interface AccountPayments_paymentsForAccount {
216
216
  accountId: any;
217
217
  amount: number | null;
218
218
  feeAmount: number | null;
219
+ feeSubsidyAmount: number | null;
219
220
  createdAt: any;
220
221
  deliveryMethod: PaymentDeliveryMethod | null;
221
222
  paymentRequestId: string | null;
@@ -649,6 +650,7 @@ interface Payment_payment {
649
650
  accountId: any;
650
651
  amount: number | null;
651
652
  feeAmount: number | null;
653
+ feeSubsidyAmount: number | null;
652
654
  createdAt: any;
653
655
  deliveryMethod: PaymentDeliveryMethod | null;
654
656
  paymentRequestId: string | null;
@@ -681,6 +683,7 @@ interface PaymentFragment {
681
683
  accountId: any;
682
684
  amount: number | null;
683
685
  feeAmount: number | null;
686
+ feeSubsidyAmount: number | null;
684
687
  createdAt: any;
685
688
  deliveryMethod: PaymentDeliveryMethod | null;
686
689
  paymentRequestId: string | null;
@@ -737,6 +740,7 @@ interface PaymentRequestPayment_paymentForPaymentRequest {
737
740
  accountId: any;
738
741
  amount: number | null;
739
742
  feeAmount: number | null;
743
+ feeSubsidyAmount: number | null;
740
744
  createdAt: any;
741
745
  deliveryMethod: PaymentDeliveryMethod | null;
742
746
  paymentRequestId: string | null;
@@ -1784,6 +1788,8 @@ interface CreatePaymentRequestInput {
1784
1788
  deliveryMethod?: PaymentDeliveryMethod | null;
1785
1789
  tokenAddress?: string | null;
1786
1790
  amountMode?: AmountMode | null;
1791
+ feeSubsidyPercentage?: string | null;
1792
+ maxFeeSubsidyAmount?: string | null;
1787
1793
  }
1788
1794
 
1789
1795
  declare const onrampSupportedTokens: Partial<Record<PaymentNetwork, string[]>>;
@@ -411,13 +411,14 @@ query VirtualAccounts {
411
411
  virtualAccounts {
412
412
  ...VirtualAccountFragment
413
413
  }
414
- }`,name:"GraphQL request",locationOffset:{line:1,column:1}};var m4={};function ME(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return m4[t]?!1:(m4[t]=!0,!0)})}ht.definitions=ht.definitions.concat(ME(oi.definitions));function ju(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){ju(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){ju(u,n)}),e.definitions&&e.definitions.forEach(function(u){ju(u,n)})}var vs={};(function(){ht.definitions.forEach(function(n){if(n.name){var t=new Set;ju(n,t),vs[n.name.value]=t}})})();function v4(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 GE(e,n){var t={kind:e.kind,definitions:[v4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=vs[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=vs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=v4(e,o);s&&t.definitions.push(s)}),t}GE(ht,"VirtualAccounts");var Me=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Base="base",e.Bitcoin="bitcoin",e.Dash="dash",e.Tron="tron",e.Solana="solana",e.Sui="sui",e))(Me||{});const p4={[Me.Ethereum]:["USDC","USDT","DAI","USDP","PYUSD"],[Me.Polygon]:["USDC"],[Me.Base]:["USDC"],[Me.Arbitrum]:["USDC"],[Me.Avalanche]:["USDC"],[Me.Optimism]:["USDC"],[Me.Solana]:["USDC","PYUSD"],[Me.Tron]:["USDT"]};function JE(e){const{network:n,token:t}=e,u=p4[n];if(!u||!u.includes(t))throw new Error(`Token "${t}" is not supported on network "${n}". Supported tokens for ${n}: ${u?.join(", ")||"none"}`)}class QE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:ht})).virtualAccounts}async create(n){return JE(n),(await this.client.query({query:pt,variables:{network:n.network,address:n.address,token:n.token}})).createVirtualAccount}}var gt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"failureReason"},name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:348}};gt.loc.source={body:`fragment PaymentFragment on Payment {
414
+ }`,name:"GraphQL request",locationOffset:{line:1,column:1}};var m4={};function ME(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return m4[t]?!1:(m4[t]=!0,!0)})}ht.definitions=ht.definitions.concat(ME(oi.definitions));function ju(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){ju(u,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(u){ju(u,n)}),e.definitions&&e.definitions.forEach(function(u){ju(u,n)})}var vs={};(function(){ht.definitions.forEach(function(n){if(n.name){var t=new Set;ju(n,t),vs[n.name.value]=t}})})();function v4(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 GE(e,n){var t={kind:e.kind,definitions:[v4(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var u=vs[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=vs[o]||new Set;s.forEach(function(c){r.add(c)})}})}return i.forEach(function(o){var s=v4(e,o);s&&t.definitions.push(s)}),t}GE(ht,"VirtualAccounts");var Me=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Base="base",e.Bitcoin="bitcoin",e.Dash="dash",e.Tron="tron",e.Solana="solana",e.Sui="sui",e))(Me||{});const p4={[Me.Ethereum]:["USDC","USDT","DAI","USDP","PYUSD"],[Me.Polygon]:["USDC"],[Me.Base]:["USDC"],[Me.Arbitrum]:["USDC"],[Me.Avalanche]:["USDC"],[Me.Optimism]:["USDC"],[Me.Solana]:["USDC","PYUSD"],[Me.Tron]:["USDT"]};function JE(e){const{network:n,token:t}=e,u=p4[n];if(!u||!u.includes(t))throw new Error(`Token "${t}" is not supported on network "${n}". Supported tokens for ${n}: ${u?.join(", ")||"none"}`)}class QE{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:ht})).virtualAccounts}async create(n){return JE(n),(await this.client.query({query:pt,variables:{network:n.network,address:n.address,token:n.token}})).createVirtualAccount}}var gt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeSubsidyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"deliveryMethod"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentRequestId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"targetCurrencyRate"},arguments:[],directives:[]},{kind:"Field",alias:{kind:"Name",value:"failureReason"},name:{kind:"Name",value:"error"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"transaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hash"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"from"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:369}};gt.loc.source={body:`fragment PaymentFragment on Payment {
415
415
  id
416
416
  userId
417
417
  status
418
418
  accountId
419
419
  amount
420
420
  feeAmount
421
+ feeSubsidyAmount
421
422
  createdAt
422
423
  deliveryMethod
423
424
  paymentRequestId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/api-client",
3
- "version": "0.4.24",
3
+ "version": "0.4.25",
4
4
  "description": "Typescript library for interacting with the Spritz Finance API",
5
5
  "type": "module",
6
6
  "main": "dist/spritz-api-client.cjs",