@tuwaio/quasar-sdk 0.1.7 → 0.1.8

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.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var siwxReact=require('@tuwaio/siwx-react'),ofetch=require('ofetch');var a="https://api.tuwa.io",c="/v1/engine/pulsar/sync",u="/v1/engine/pulsar/history";var i=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},n=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide a secretKey starting with sk_live_.");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||a,this.timeout=r.timeout||1e4;}async request(r,e={}){try{return await ofetch.ofetch(r,{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(t){throw this.buildError(t)}}buildError(r){let e=r,t=e.statusCode??e.response?.status,p=(e.data??e.response?._data)?.error??e.message??"Unknown Error";return (t===401||t===403)&&console.error("\u{1F6A8} [Quasar SDK] Auth Error. Check your Secret Key and scopes."),new i(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var o=class{constructor(r){this.client=r;}async syncCreate(r,e){return this.client.request(c,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(u,{method:"GET",query:{page:r.page??1,limit:r.limit??10,chainId:r.chainId,status:r.status,txKey:r.txKey,appName:r.appName,walletAddress:r.walletAddress}})}};async function Q(s){if(!siwxReact.useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let e=s||a;try{let t=await fetch(`${e}/v1/engine/monitoring/health`,{method:"GET",cache:"no-store"});if(!t.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${t.status}`)}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}}var l=class{client;pulsar;constructor(r){this.client=new n(r),this.pulsar=new o(this.client);}};
2
- exports.BASE_API_URL=a;exports.PULSAR_HISTORY_ENDPOINT=u;exports.PULSAR_SYNC_ENDPOINT=c;exports.PulsarModule=o;exports.Quasar=l;exports.QuasarSDKError=i;exports.preFlightTxCheck=Q;
1
+ 'use strict';var siwxReact=require('@tuwaio/siwx-react'),ofetch=require('ofetch'),pulsarCore=require('@tuwaio/pulsar-core');var o="https://api.tuwa.io",c="/v1/engine/pulsar/sync",u="/v1/engine/pulsar/history";var n=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},i=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide a secretKey starting with sk_live_.");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||o,this.timeout=r.timeout||1e4;}async request(r,e={}){try{return await ofetch.ofetch(r,{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(t){throw this.buildError(t)}}buildError(r){let e=r,t=e.statusCode??e.response?.status,p=(e.data??e.response?._data)?.error??e.message??"Unknown Error";return (t===401||t===403)&&console.error("\u{1F6A8} [Quasar SDK] Auth Error. Check your Secret Key and scopes."),new n(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var a=class{constructor(r){this.client=r;}async syncCreate(r,e){return this.client.request(c,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(u,{method:"GET",query:{page:r.page??1,limit:r.limit??10,chainId:r.chainId,status:r.status,txKey:r.txKey,appName:r.appName,walletAddress:r.walletAddress}})}};async function A(s){if(!siwxReact.useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let e=s||o;try{let t=await fetch(`${e}/v1/engine/monitoring/health`,{method:"GET",cache:"no-store"});if(!t.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${t.status}`)}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}}var l=class{client;pulsar;constructor(r){this.client=new i(r),this.pulsar=new a(this.client);}};
2
+ Object.defineProperty(exports,"TransactionStatus",{enumerable:true,get:function(){return pulsarCore.TransactionStatus}});Object.defineProperty(exports,"TransactionTracker",{enumerable:true,get:function(){return pulsarCore.TransactionTracker}});exports.BASE_API_URL=o;exports.PULSAR_HISTORY_ENDPOINT=u;exports.PULSAR_SYNC_ENDPOINT=c;exports.PulsarModule=a;exports.Quasar=l;exports.QuasarSDKError=n;exports.preFlightTxCheck=A;
package/dist/index.d.cts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { FetchOptions } from 'ofetch';
2
2
  import { Transaction } from '@tuwaio/pulsar-core';
3
- export { Transaction, UpdatableTransactionFields } from '@tuwaio/pulsar-core';
3
+ export { Transaction, TransactionStatus, TransactionTracker, UpdatableTransactionFields } from '@tuwaio/pulsar-core';
4
4
 
5
5
  /**
6
6
  * @module types
7
7
  * @description Shared type definitions for the Quasar SDK.
8
8
  * Contains configuration interfaces, query parameters, and authentication structures.
9
9
  */
10
-
11
10
  /**
12
11
  * Configuration options for initializing the {@link Quasar} SDK client.
13
12
  *
package/dist/index.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { FetchOptions } from 'ofetch';
2
2
  import { Transaction } from '@tuwaio/pulsar-core';
3
- export { Transaction, UpdatableTransactionFields } from '@tuwaio/pulsar-core';
3
+ export { Transaction, TransactionStatus, TransactionTracker, UpdatableTransactionFields } from '@tuwaio/pulsar-core';
4
4
 
5
5
  /**
6
6
  * @module types
7
7
  * @description Shared type definitions for the Quasar SDK.
8
8
  * Contains configuration interfaces, query parameters, and authentication structures.
9
9
  */
10
-
11
10
  /**
12
11
  * Configuration options for initializing the {@link Quasar} SDK client.
13
12
  *
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import {useSiwxSessionStore}from'@tuwaio/siwx-react';import {ofetch}from'ofetch';var a="https://api.tuwa.io",c="/v1/engine/pulsar/sync",u="/v1/engine/pulsar/history";var i=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},n=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide a secretKey starting with sk_live_.");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||a,this.timeout=r.timeout||1e4;}async request(r,e={}){try{return await ofetch(r,{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(t){throw this.buildError(t)}}buildError(r){let e=r,t=e.statusCode??e.response?.status,p=(e.data??e.response?._data)?.error??e.message??"Unknown Error";return (t===401||t===403)&&console.error("\u{1F6A8} [Quasar SDK] Auth Error. Check your Secret Key and scopes."),new i(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var o=class{constructor(r){this.client=r;}async syncCreate(r,e){return this.client.request(c,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(u,{method:"GET",query:{page:r.page??1,limit:r.limit??10,chainId:r.chainId,status:r.status,txKey:r.txKey,appName:r.appName,walletAddress:r.walletAddress}})}};async function Q(s){if(!useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let e=s||a;try{let t=await fetch(`${e}/v1/engine/monitoring/health`,{method:"GET",cache:"no-store"});if(!t.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${t.status}`)}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}}var l=class{client;pulsar;constructor(r){this.client=new n(r),this.pulsar=new o(this.client);}};
2
- export{a as BASE_API_URL,u as PULSAR_HISTORY_ENDPOINT,c as PULSAR_SYNC_ENDPOINT,o as PulsarModule,l as Quasar,i as QuasarSDKError,Q as preFlightTxCheck};
1
+ import {useSiwxSessionStore}from'@tuwaio/siwx-react';import {ofetch}from'ofetch';export{TransactionStatus,TransactionTracker}from'@tuwaio/pulsar-core';var o="https://api.tuwa.io",c="/v1/engine/pulsar/sync",u="/v1/engine/pulsar/history";var n=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},i=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide a secretKey starting with sk_live_.");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||o,this.timeout=r.timeout||1e4;}async request(r,e={}){try{return await ofetch(r,{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(t){throw this.buildError(t)}}buildError(r){let e=r,t=e.statusCode??e.response?.status,p=(e.data??e.response?._data)?.error??e.message??"Unknown Error";return (t===401||t===403)&&console.error("\u{1F6A8} [Quasar SDK] Auth Error. Check your Secret Key and scopes."),new n(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var a=class{constructor(r){this.client=r;}async syncCreate(r,e){return this.client.request(c,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(u,{method:"GET",query:{page:r.page??1,limit:r.limit??10,chainId:r.chainId,status:r.status,txKey:r.txKey,appName:r.appName,walletAddress:r.walletAddress}})}};async function A(s){if(!useSiwxSessionStore.getState().session)throw new Error("[QuasarSDK] No SIWX Session found. User must be signed in.");let e=s||o;try{let t=await fetch(`${e}/v1/engine/monitoring/health`,{method:"GET",cache:"no-store"});if(!t.ok)throw new Error(`[QuasarSDK] API Health check failed with status: ${t.status}`)}catch(t){throw new Error("[QuasarSDK] Quasar Cloud Engine is currently unreachable.",{cause:t})}}var l=class{client;pulsar;constructor(r){this.client=new i(r),this.pulsar=new a(this.client);}};
2
+ export{o as BASE_API_URL,u as PULSAR_HISTORY_ENDPOINT,c as PULSAR_SYNC_ENDPOINT,a as PulsarModule,l as Quasar,n as QuasarSDKError,A as preFlightTxCheck};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/quasar-sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "solana",
32
32
  "wagmi",
33
33
  "viem",
34
- "gill",
34
+ "@solana/kit",
35
35
  "wallet-standard",
36
36
  "wallet",
37
37
  "wallet-connect",
@@ -80,11 +80,11 @@
80
80
  }
81
81
  ],
82
82
  "peerDependencies": {
83
- "@tuwaio/pulsar-core": "^0.6.11",
83
+ "@tuwaio/pulsar-core": ">=0.7",
84
84
  "ofetch": "^1.5.1",
85
- "@tuwaio/siwx-react": "^0.2.3",
86
- "@tuwaio/siwx-core": "^0.2.2",
87
- "@tuwaio/siwx-server": "^0.2.2"
85
+ "@tuwaio/siwx-react": ">=0.3",
86
+ "@tuwaio/siwx-core": ">=0.3",
87
+ "@tuwaio/siwx-server": ">=0.3"
88
88
  },
89
89
  "peerDependenciesMeta": {
90
90
  "@tuwaio/pulsar-core": {
@@ -104,17 +104,17 @@
104
104
  }
105
105
  },
106
106
  "devDependencies": {
107
- "@tuwaio/pulsar-core": "^0.6.12",
107
+ "@tuwaio/pulsar-core": "^0.7.0",
108
108
  "ofetch": "^1.5.1",
109
109
  "tsup": "^8.5.1",
110
110
  "typescript": "6.0.3",
111
- "@tuwaio/siwx-react": "^0.2.3",
112
- "@tuwaio/siwx-core": "^0.2.2",
113
- "@tuwaio/siwx-server": "^0.2.2"
111
+ "@tuwaio/siwx-react": "^0.3.0",
112
+ "@tuwaio/siwx-core": "^0.3.0",
113
+ "@tuwaio/siwx-server": "^0.3.0"
114
114
  },
115
115
  "scripts": {
116
116
  "start": "tsup src/index.ts --watch",
117
117
  "build": "tsup",
118
- "test": "node --import tsx --test src/__tests__/*.test.ts"
118
+ "test": "vitest run"
119
119
  }
120
120
  }