@tuwaio/quasar-sdk 0.7.3 → 0.8.0

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/dist/index.js CHANGED
@@ -1 +1 @@
1
- import {b,d as d$1,c as c$1,a}from'./chunk-MK6C4P3O.js';export{a as BASE_API_URL,c as PULSAR_HISTORY_ENDPOINT,b as PULSAR_SYNC_ENDPOINT,d as pulsarSyncHashEndpoint}from'./chunk-MK6C4P3O.js';import {ofetch}from'ofetch';import {TransactionTracker}from'@tuwaio/pulsar-core';export{TransactionStatus,TransactionTracker}from'@tuwaio/pulsar-core';var c=class extends Error{status;originalError;constructor(t,e,r){super(t),this.name="QuasarSDKError",this.status=e,this.originalError=r;}},u=class{secretKey;internalSecret;baseUrl;timeout;constructor(t){if(!t.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide the secretKey of your Quasar app (sk_live_ or sk_test_).");this.secretKey=t.secretKey,this.internalSecret=t.internalSecret,this.baseUrl=t.baseUrl||a,this.timeout=t.timeout||1e4;}async request(t,e={}){try{return await ofetch(t,{baseURL:this.baseUrl,timeout:this.timeout,...e,headers:{"Content-Type":"application/json","x-tuwa-secret-key":this.secretKey,...this.internalSecret?{"x-internal-secret":this.internalSecret}:{},...e.headers}})}catch(r){throw this.buildError(r)}}buildError(t){let e=t,r=e.statusCode??e.response?.status,l=(e.data??e.response?._data)?.error??e.message??"Unknown Error";return (r===401||r===403)&&console.error("\u{1F6A8} [Quasar SDK] Auth Error. Check your Secret Key and scopes."),new c(`[Quasar SDK] Request Failed (${r}): ${l}`,r,e)}};var o=class{constructor(t){this.client=t;}client;async syncCreate(t,e){return this.client.request(b,{method:"POST",body:{...t,appName:e}})}async syncHash(t,e){return this.client.request(d$1(t),{method:"POST",body:{hash:e}})}async getHistory(t={}){return this.client.request(c$1,{method:"GET",query:{page:t.page??1,limit:t.limit??10,chainId:t.chainId,status:t.status,txKey:t.txKey,appName:t.appName,walletAddress:t.walletAddress}})}};var P=3600;function T(s,t){let e=new Set,r=n=>{let l=Math.floor(Date.now()/1e3)-P;for(let a of Object.values(n)){let p=a.hash;if(a.tracker!==TransactionTracker.EIP5792||!p||a.syncStatus==="pending-sync"||a.localTimestamp<l)continue;let i=`${a.txKey}:${p}`;if(!e.has(i)){e.add(i);try{Promise.resolve(t({...a,hash:p})).catch(()=>e.delete(i));}catch{e.delete(i);}}}};return r(s.getState().transactionsPool),s.subscribe(n=>r(n.transactionsPool))}var d=class{client;pulsar;constructor(t){this.client=new u(t),this.pulsar=new o(this.client);}};export{o as PulsarModule,d as Quasar,c as QuasarSDKError,T as watchBatchHashes};
1
+ import {b as b$1}from'./chunk-KLHEH7HS.js';export{a as QuasarSDKError}from'./chunk-KLHEH7HS.js';import {e,b,d as d$1,c as c$1,a as a$1}from'./chunk-ZSO6HC5H.js';export{a as BASE_API_URL,e as PAYMENTS_ENDPOINT,c as PULSAR_HISTORY_ENDPOINT,b as PULSAR_SYNC_ENDPOINT,d as pulsarSyncHashEndpoint}from'./chunk-ZSO6HC5H.js';import {ofetch}from'ofetch';var s=r=>encodeURIComponent(r),d=r=>r instanceof Date?r.toISOString():r,p=r=>r?.idempotencyKey?{"Idempotency-Key":r.idempotencyKey}:{},I=r=>Array.isArray(r)?r.join(","):r,c=r=>Object.fromEntries(Object.entries(r).filter(([,e])=>e!==void 0)),m=class{constructor(e){this.client=e;}client;async createInvoice(e$1,t){return this.client.request(`${e}/invoices`,{method:"POST",body:{...e$1,dueAt:d(e$1.dueAt),supplyDate:d(e$1.supplyDate)},headers:p(t)})}async getInvoice(e$1){return this.client.request(`${e}/invoices/${s(e$1)}`,{method:"GET"})}async listInvoiceRefunds(e$1,t={}){return this.client.request(`${e}/invoices/${s(e$1)}/refunds`,{method:"GET",query:c({limit:t.limit,cursor:t.cursor})})}async listInvoiceDocuments(e$1,t={}){return this.client.request(`${e}/invoices/${s(e$1)}/documents`,{method:"GET",query:c({limit:t.limit,cursor:t.cursor})})}async listInvoices(e$1={}){return this.client.request(`${e}/invoices`,{method:"GET",query:c({status:I(e$1.status),environment:e$1.environment,externalId:e$1.externalId,createdAfter:d(e$1.createdAfter),createdBefore:d(e$1.createdBefore),limit:e$1.limit,cursor:e$1.cursor})})}async cancelInvoice(e$1,t={}){return this.client.request(`${e}/invoices/${s(e$1)}/cancel`,{method:"POST",body:t})}async releaseInvoice(e$1,t){return this.client.request(`${e}/invoices/${s(e$1)}/release`,{method:"POST",body:t})}async correctInvoice(e$1,t){return this.client.request(`${e}/invoices/${s(e$1)}/correct`,{method:"POST",body:t})}async replacePayLink(e$1){return this.client.request(`${e}/invoices/${s(e$1)}/checkout`,{method:"POST",body:{}})}async getEvents(e$1,t={}){return this.client.request(`${e}/invoices/${s(e$1)}/events`,{method:"GET",query:c({verify:t.verify?"true":void 0,limit:t.limit,cursor:t.cursor})})}async previewRefund(e$1,t={}){return this.client.request(`${e}/invoices/${s(e$1)}/refunds/preview`,{method:"POST",body:t})}async refund(e$1,t={},i){return this.client.request(`${e}/invoices/${s(e$1)}/refunds`,{method:"POST",body:t,headers:p(i)})}async withdrawRefund(e$1){return this.client.request(`${e}/refunds/${s(e$1)}/withdraw`,{method:"POST",body:{}})}async getRefund(e$1){return this.client.request(`${e}/refunds/${s(e$1)}`,{method:"GET"})}async submitRefund(e$1,t){return this.client.request(`${e}/refunds/${s(e$1)}/submit`,{method:"POST",body:t})}async listHeldTransfers(e$1={}){let t=e$1.invoice?`${e}/invoices/${s(e$1.invoice)}/held-transfers`:`${e}/held-transfers`,i=await this.client.request(t,{method:"GET",query:e$1.invoice?{}:c({status:e$1.status})});return e$1.invoice&&e$1.status?i.heldTransfers.filter(o=>o.status===e$1.status):i.heldTransfers}async refundHeldTransfer(e$1){return this.client.request(`${e}/held-transfers/${s(e$1)}/refund`,{method:"POST",body:{}})}async getDocument(e$1,t){return this.client.requestFile(`${e}/invoices/${s(e$1)}/documents/${t}`)}async getCreditNote(e$1,t,i="pdf"){let o=`${s(t)}${i==="ubl"?".xml":""}`;return this.client.requestFile(`${e}/invoices/${s(e$1)}/documents/credit-note/${o}`)}async quote(e$1){return this.client.request(`${e}/quotes`,{method:"POST",body:e$1})}async listMethods(){return this.client.request(`${e}/methods`,{method:"GET"})}async createSubscription(e$1,t){return this.client.request(`${e}/subscriptions`,{method:"POST",body:{...e$1,endsAt:d(e$1.endsAt)},headers:p(t)})}async listSubscriptions(e$1={}){return this.client.request(`${e}/subscriptions`,{method:"GET",query:c({status:I(e$1.status),limit:e$1.limit,cursor:e$1.cursor})})}async getSubscription(e$1){return this.client.request(`${e}/subscriptions/${s(e$1)}`,{method:"GET"})}async listSubscriptionInvoices(e$1,t={}){return this.client.request(`${e}/subscriptions/${s(e$1)}/invoices`,{method:"GET",query:c({limit:t.limit,cursor:t.cursor})})}async listSubscriptionCharges(e$1,t={}){return this.client.request(`${e}/subscriptions/${s(e$1)}/charges`,{method:"GET",query:c({limit:t.limit,cursor:t.cursor})})}async cancelSubscription(e$1,t={}){return this.client.request(`${e}/subscriptions/${s(e$1)}/cancel`,{method:"POST",body:t})}async undoSubscriptionCancel(e$1){return this.client.request(`${e}/subscriptions/${s(e$1)}/cancel/undo`,{method:"POST",body:{}})}async endSubscriptionPermission(e$1){return this.client.request(`${e}/subscriptions/${s(e$1)}/permission/end`,{method:"POST",body:{}})}async pauseSubscription(e$1){return this.client.request(`${e}/subscriptions/${s(e$1)}/pause`,{method:"POST",body:{}})}async resumeSubscription(e$1){return this.client.request(`${e}/subscriptions/${s(e$1)}/resume`,{method:"POST",body:{}})}};var l=class{constructor(e){this.client=e;}client;async syncCreate(e,t){return this.client.request(b,{method:"POST",body:{...e,appName:t}})}async syncHash(e,t){return this.client.request(d$1(e),{method:"POST",body:{hash:t}})}async getHistory(e={}){return this.client.request(c$1,{method:"GET",query:{page:e.page??1,limit:e.limit??10,chainId:e.chainId,status:e.status,txKey:e.txKey,appName:e.appName,walletAddress:e.walletAddress}})}};var y=class{secretKey;internalSecret;baseUrl;timeout;constructor(e){if(!e.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide the secretKey of your Quasar app (sk_live_ or sk_test_).");this.secretKey=e.secretKey,this.internalSecret=e.internalSecret,this.baseUrl=e.baseUrl||a$1,this.timeout=e.timeout||1e4;}async request(e,t={}){try{return await ofetch(e,{baseURL:this.baseUrl,timeout:this.timeout,...t,headers:{"Content-Type":"application/json","x-tuwa-secret-key":this.secretKey,...this.internalSecret?{"x-internal-secret":this.internalSecret}:{},...t.headers}})}catch(i){throw b$1(i)}}async requestFile(e){try{let t=await ofetch.raw(e,{baseURL:this.baseUrl,timeout:this.timeout,method:"GET",responseType:"arrayBuffer",headers:{"x-tuwa-secret-key":this.secretKey,...this.internalSecret?{"x-internal-secret":this.internalSecret}:{}}}),i=t.headers.get("content-disposition")??"";return {bytes:new Uint8Array(t._data??new ArrayBuffer(0)),contentType:t.headers.get("content-type"),filename:/filename="([^"]*)"/.exec(i)?.[1]??null}}catch(t){throw b$1(t)}}};var f=class{client;pulsar;payments;constructor(e){this.client=new y(e),this.pulsar=new l(this.client),this.payments=new m(this.client);}};var C="x-quasar-signature",O="payments.v1",a=class extends Error{code;constructor(e,t){super(t),this.name="QuasarWebhookError",this.code=e;}},k=300;async function A(r,e){let t=await crypto.subtle.importKey("raw",new TextEncoder().encode(r),{name:"HMAC",hash:"SHA-256"},false,["sign"]),i=new Uint8Array(await crypto.subtle.sign("HMAC",t,e));return Array.from(i,o=>o.toString(16).padStart(2,"0")).join("")}function R(r,e){if(r.length!==e.length)return false;let t=0;for(let i=0;i<r.length;i++)t|=r.charCodeAt(i)^e.charCodeAt(i);return t===0}function W(r){if(H(r)||r.sentAt!=null)return {field:"sentAt",time:typeof r.sentAt=="string"?Date.parse(r.sentAt):NaN};let{timestamp:e}=r;return {field:"timestamp",time:typeof e=="number"&&Number.isFinite(e)?e*1e3:NaN}}function H(r){return r.apiVersion===O}async function Y(r){let{body:e,signature:t,secret:i,toleranceSeconds:o=k,now:E=new Date}=r;if(o!==false&&(typeof o!="number"||!Number.isFinite(o)||o<=0))throw new a("invalid_options","toleranceSeconds must be a finite number above 0, or false");if(!i)throw new a("missing_secret","No signing secret to verify the webhook with");if(!t)throw new a("missing_signature",`The ${C} header is missing`);let x=typeof e=="string"?new TextEncoder().encode(e):e,_=await A(i,x);if(!R(t.trim().toLowerCase(),_))throw new a("invalid_signature","The signature does not match the body");let u;try{u=JSON.parse(typeof e=="string"?e:new TextDecoder().decode(e));}catch{throw new a("invalid_body","The body is not JSON")}if(typeof u!="object"||u===null||Array.isArray(u))throw new a("invalid_body","The body is not a webhook");let b=u;if(o!==false){let{field:P,time:g}=W(b);if(Number.isNaN(g))throw new a("stale",`The event carries no valid send time (${P})`);if(Math.abs(E.getTime()-g)>o*1e3)throw new a("stale",`The event was sent outside the ${o} s tolerance (${P})`)}return b}export{O as PAYMENT_WEBHOOK_VERSION,m as PaymentsModule,l as PulsarModule,f as Quasar,a as QuasarWebhookError,C as WEBHOOK_SIGNATURE_HEADER,H as isPaymentWebhookEvent,Y as verifyWebhook};
@@ -0,0 +1 @@
1
+ 'use strict';var pulsarCore=require('@tuwaio/pulsar-core');var h=3600;function d(a,c){let o=new Set,n=s=>{let i=Math.floor(Date.now()/1e3)-h;for(let t of Object.values(s)){let r=t.hash;if(t.tracker!==pulsarCore.TransactionTracker.EIP5792||!r||t.syncStatus==="pending-sync"||t.localTimestamp<i)continue;let e=`${t.txKey}:${r}`;if(!o.has(e)){o.add(e);try{Promise.resolve(c({...t,hash:r})).catch(()=>o.delete(e));}catch{o.delete(e);}}}};return n(a.getState().transactionsPool),a.subscribe(s=>n(s.transactionsPool))}Object.defineProperty(exports,"TransactionStatus",{enumerable:true,get:function(){return pulsarCore.TransactionStatus}});Object.defineProperty(exports,"TransactionTracker",{enumerable:true,get:function(){return pulsarCore.TransactionTracker}});exports.watchBatchHashes=d;
@@ -0,0 +1,50 @@
1
+ import { Transaction } from '@tuwaio/pulsar-core';
2
+ export { TransactionStatus, TransactionTracker } from '@tuwaio/pulsar-core';
3
+
4
+ /**
5
+ * @file Hashes of EIP-5792 batches, read from a Pulsar store in the browser.
6
+ */
7
+
8
+ /**
9
+ * The part of a Pulsar store that {@link watchBatchHashes} reads: the store returned by `createPulsarStore` of
10
+ * `@tuwaio/pulsar-core` has it.
11
+ *
12
+ * @typeParam T - The transaction type of the store.
13
+ */
14
+ interface PulsarPoolStore<T extends Transaction> {
15
+ /** Returns the current state of the store. */
16
+ getState: () => {
17
+ transactionsPool: Record<string, T>;
18
+ };
19
+ /** Calls `listener` with the new state on every change; returns the function that removes it. */
20
+ subscribe: (listener: (state: {
21
+ transactionsPool: Record<string, T>;
22
+ }) => void) => () => void;
23
+ }
24
+ /**
25
+ * Watches a Pulsar store for EIP-5792 batches whose transaction became known and calls `onHash` once for each, so the
26
+ * app can send the hash to Quasar with `PulsarModule.syncHash` (through a Server Action, since that call needs the
27
+ * secret key). A batch is reported once Quasar has it (`syncStatus: 'synced'`) and Pulsar wrote its `hash`; batches
28
+ * created more than an hour ago are skipped, because Quasar no longer waits for them. When `onHash` rejects, the batch
29
+ * is reported again on the next change of the store.
30
+ *
31
+ * Side effects: subscribes to the store until the returned function is called; keeps the reported batch IDs in memory.
32
+ *
33
+ * @param store - The Pulsar store, for example the one `createPulsarStore` returns.
34
+ * @param onHash - Called with each batch and its hash; return its promise so a failure is retried.
35
+ * @returns A function that stops watching.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { watchBatchHashes } from '@tuwaio/quasar-sdk/pulsar';
40
+ *
41
+ * // In the browser, next to the store; `syncBatchHash` is a Server Action that calls `quasar.pulsar.syncHash`
42
+ * const stop = watchBatchHashes(pulsarStore, (tx) => syncBatchHash(tx.txKey, tx.hash));
43
+ * ```
44
+ */
45
+ declare function watchBatchHashes<T extends Transaction>(store: PulsarPoolStore<T>, onHash: (tx: T & {
46
+ hash: `0x${string}`;
47
+ }) => void | Promise<void>): () => void;
48
+
49
+ export { watchBatchHashes };
50
+ export type { PulsarPoolStore };
@@ -0,0 +1,50 @@
1
+ import { Transaction } from '@tuwaio/pulsar-core';
2
+ export { TransactionStatus, TransactionTracker } from '@tuwaio/pulsar-core';
3
+
4
+ /**
5
+ * @file Hashes of EIP-5792 batches, read from a Pulsar store in the browser.
6
+ */
7
+
8
+ /**
9
+ * The part of a Pulsar store that {@link watchBatchHashes} reads: the store returned by `createPulsarStore` of
10
+ * `@tuwaio/pulsar-core` has it.
11
+ *
12
+ * @typeParam T - The transaction type of the store.
13
+ */
14
+ interface PulsarPoolStore<T extends Transaction> {
15
+ /** Returns the current state of the store. */
16
+ getState: () => {
17
+ transactionsPool: Record<string, T>;
18
+ };
19
+ /** Calls `listener` with the new state on every change; returns the function that removes it. */
20
+ subscribe: (listener: (state: {
21
+ transactionsPool: Record<string, T>;
22
+ }) => void) => () => void;
23
+ }
24
+ /**
25
+ * Watches a Pulsar store for EIP-5792 batches whose transaction became known and calls `onHash` once for each, so the
26
+ * app can send the hash to Quasar with `PulsarModule.syncHash` (through a Server Action, since that call needs the
27
+ * secret key). A batch is reported once Quasar has it (`syncStatus: 'synced'`) and Pulsar wrote its `hash`; batches
28
+ * created more than an hour ago are skipped, because Quasar no longer waits for them. When `onHash` rejects, the batch
29
+ * is reported again on the next change of the store.
30
+ *
31
+ * Side effects: subscribes to the store until the returned function is called; keeps the reported batch IDs in memory.
32
+ *
33
+ * @param store - The Pulsar store, for example the one `createPulsarStore` returns.
34
+ * @param onHash - Called with each batch and its hash; return its promise so a failure is retried.
35
+ * @returns A function that stops watching.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { watchBatchHashes } from '@tuwaio/quasar-sdk/pulsar';
40
+ *
41
+ * // In the browser, next to the store; `syncBatchHash` is a Server Action that calls `quasar.pulsar.syncHash`
42
+ * const stop = watchBatchHashes(pulsarStore, (tx) => syncBatchHash(tx.txKey, tx.hash));
43
+ * ```
44
+ */
45
+ declare function watchBatchHashes<T extends Transaction>(store: PulsarPoolStore<T>, onHash: (tx: T & {
46
+ hash: `0x${string}`;
47
+ }) => void | Promise<void>): () => void;
48
+
49
+ export { watchBatchHashes };
50
+ export type { PulsarPoolStore };
package/dist/pulsar.js ADDED
@@ -0,0 +1 @@
1
+ import {TransactionTracker}from'@tuwaio/pulsar-core';export{TransactionStatus,TransactionTracker}from'@tuwaio/pulsar-core';var h=3600;function d(a,c){let o=new Set,n=s=>{let i=Math.floor(Date.now()/1e3)-h;for(let t of Object.values(s)){let r=t.hash;if(t.tracker!==TransactionTracker.EIP5792||!r||t.syncStatus==="pending-sync"||t.localTimestamp<i)continue;let e=`${t.txKey}:${r}`;if(!o.has(e)){o.add(e);try{Promise.resolve(c({...t,hash:r})).catch(()=>o.delete(e));}catch{o.delete(e);}}}};return n(a.getState().transactionsPool),a.subscribe(s=>n(s.transactionsPool))}export{d as watchBatchHashes};
package/dist/react.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunk7EJ6DS4C_cjs=require('./chunk-7EJ6DS4C.cjs'),siwxReact=require('@tuwaio/siwx-react');var i="/v1/engine/monitoring/health";async function u(s){if(!siwxReact.useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let o=(s||chunk7EJ6DS4C_cjs.a).replace(/\/+$/,""),e;try{e=await fetch(`${o}${i}`,{method:"GET",cache:"no-store"});}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}if(!e.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${e.status}`)}exports.preFlightTxCheck=u;
1
+ 'use strict';var chunk2LAAWGEK_cjs=require('./chunk-2LAAWGEK.cjs'),siwxReact=require('@tuwaio/siwx-react');var i="/v1/engine/monitoring/health",a=5e3;async function l(r){if(!siwxReact.useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let o=(r||chunk2LAAWGEK_cjs.a).replace(/\/+$/,""),e;try{e=await fetch(`${o}${i}`,{method:"GET",cache:"no-store",signal:AbortSignal.timeout(a)});}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}if(!e.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${e.status}`)}exports.preFlightTxCheck=l;
package/dist/react.js CHANGED
@@ -1 +1 @@
1
- import {a}from'./chunk-MK6C4P3O.js';import {useSiwxSessionStore}from'@tuwaio/siwx-react';var i="/v1/engine/monitoring/health";async function u(s){if(!useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let o=(s||a).replace(/\/+$/,""),e;try{e=await fetch(`${o}${i}`,{method:"GET",cache:"no-store"});}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}if(!e.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${e.status}`)}export{u as preFlightTxCheck};
1
+ import {a as a$1}from'./chunk-ZSO6HC5H.js';import {useSiwxSessionStore}from'@tuwaio/siwx-react';var i="/v1/engine/monitoring/health",a=5e3;async function l(r){if(!useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let o=(r||a$1).replace(/\/+$/,""),e;try{e=await fetch(`${o}${i}`,{method:"GET",cache:"no-store",signal:AbortSignal.timeout(a)});}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}if(!e.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${e.status}`)}export{l as preFlightTxCheck};
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tuwaio/quasar-sdk",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
7
- "description": "L5 client of Quasar (TUWA): the Quasar API client for Quasar Cloud and self-hosted Quasar nodes (transaction sync and history for Pulsar), and the quasar-sdk CLI that relays webhooks to localhost.",
7
+ "description": "L5 client of Quasar (TUWA): the Quasar API client for Quasar Cloud and self-hosted Quasar nodes (transaction sync and history for Pulsar, Payments invoices, refunds and subscriptions, webhook verification), and the quasar-sdk CLI that relays webhooks to localhost.",
8
8
  "type": "module",
9
9
  "main": "./dist/index.cjs",
10
10
  "module": "./dist/index.js",
@@ -15,12 +15,23 @@
15
15
  "import": "./dist/index.js",
16
16
  "require": "./dist/index.cjs"
17
17
  },
18
+ "./pulsar": {
19
+ "types": "./dist/pulsar.d.ts",
20
+ "import": "./dist/pulsar.js",
21
+ "require": "./dist/pulsar.cjs"
22
+ },
18
23
  "./react": {
19
24
  "types": "./dist/react.d.ts",
20
25
  "import": "./dist/react.js",
21
26
  "require": "./dist/react.cjs"
27
+ },
28
+ "./checkout": {
29
+ "types": "./dist/checkout.d.ts",
30
+ "import": "./dist/checkout.js",
31
+ "require": "./dist/checkout.cjs"
22
32
  }
23
33
  },
34
+ "sideEffects": false,
24
35
  "publishConfig": {
25
36
  "access": "public"
26
37
  },
@@ -52,12 +63,12 @@
52
63
  ],
53
64
  "repository": {
54
65
  "type": "git",
55
- "url": "git+https://github.com/TuwaIO/sdk.git",
66
+ "url": "git+https://github.com/TuwaIO/quasar-client.git",
56
67
  "directory": "packages/quasar-sdk"
57
68
  },
58
- "homepage": "https://github.com/TuwaIO/sdk",
69
+ "homepage": "https://github.com/TuwaIO/quasar-client",
59
70
  "bugs": {
60
- "url": "https://github.com/TuwaIO/sdk/issues"
71
+ "url": "https://github.com/TuwaIO/quasar-client/issues"
61
72
  },
62
73
  "contributors": [
63
74
  {
@@ -70,18 +81,26 @@
70
81
  },
71
82
  "peerDependencies": {
72
83
  "@tuwaio/pulsar-core": ">=0.10",
73
- "@tuwaio/siwx-react": ">=0.5"
84
+ "@tuwaio/siwx-react": ">=0.5",
85
+ "zustand": "5.x.x"
74
86
  },
75
87
  "peerDependenciesMeta": {
88
+ "@tuwaio/pulsar-core": {
89
+ "optional": true
90
+ },
76
91
  "@tuwaio/siwx-react": {
77
92
  "optional": true
93
+ },
94
+ "zustand": {
95
+ "optional": true
78
96
  }
79
97
  },
80
98
  "devDependencies": {
81
- "@tuwaio/pulsar-core": "^0.11.1",
82
- "@tuwaio/siwx-react": "^0.6.5",
99
+ "@tuwaio/pulsar-core": "^0.12.4",
100
+ "@tuwaio/siwx-react": "^0.6.6",
83
101
  "tsup": "^9.0.0",
84
- "typescript": "6.0.3"
102
+ "typescript": "6.0.3",
103
+ "zustand": "^5.0.15"
85
104
  },
86
105
  "scripts": {
87
106
  "start": "tsup src/index.ts --watch",
@@ -1,2 +0,0 @@
1
- var o="https://api.tuwa.io",t="/v1/engine/pulsar/sync",s="/v1/engine/pulsar/history",e=n=>`${t}/${encodeURIComponent(n)}/hash`;
2
- export{o as a,t as b,s as c,e as d};