@tuwaio/quasar-sdk 0.3.0 → 0.4.1
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/cli.cjs +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/dist/cli.cjs
CHANGED
|
@@ -48,11 +48,11 @@ var path = __toESM(require("path"), 1);
|
|
|
48
48
|
// package.json
|
|
49
49
|
var package_default = {
|
|
50
50
|
name: "@tuwaio/quasar-sdk",
|
|
51
|
-
version: "0.
|
|
51
|
+
version: "0.4.1",
|
|
52
52
|
private: false,
|
|
53
53
|
author: "Oleksandr Tkach",
|
|
54
54
|
license: "Apache-2.0",
|
|
55
|
-
description: "
|
|
55
|
+
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.",
|
|
56
56
|
type: "module",
|
|
57
57
|
main: "./dist/index.cjs",
|
|
58
58
|
module: "./dist/index.js",
|
|
@@ -131,10 +131,10 @@ var package_default = {
|
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
133
|
devDependencies: {
|
|
134
|
-
"@tuwaio/pulsar-core": "^0.9.
|
|
134
|
+
"@tuwaio/pulsar-core": "^0.9.1",
|
|
135
135
|
tsup: "^8.5.1",
|
|
136
136
|
typescript: "6.0.3",
|
|
137
|
-
"@tuwaio/siwx-react": "^0.
|
|
137
|
+
"@tuwaio/siwx-react": "^0.6.0"
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkNJH5FYLU_cjs=require('./chunk-NJH5FYLU.cjs'),ofetch=require('ofetch'),pulsarCore=require('@tuwaio/pulsar-core');var a=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},o=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide the secretKey of your Quasar app (sk_live_ or sk_test_).");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||chunkNJH5FYLU_cjs.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 a(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var s=class{constructor(r){this.client=r;}async syncCreate(r,e){return this.client.request(chunkNJH5FYLU_cjs.b,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(chunkNJH5FYLU_cjs.c,{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}})}};var n=class{client;pulsar;constructor(r){this.client=new o(r),this.pulsar=new s(this.client);}};Object.defineProperty(exports,"BASE_API_URL",{enumerable:true,get:function(){return chunkNJH5FYLU_cjs.a}});Object.defineProperty(exports,"PULSAR_HISTORY_ENDPOINT",{enumerable:true,get:function(){return chunkNJH5FYLU_cjs.c}});Object.defineProperty(exports,"PULSAR_SYNC_ENDPOINT",{enumerable:true,get:function(){return chunkNJH5FYLU_cjs.b}});Object.defineProperty(exports,"TransactionStatus",{enumerable:true,get:function(){return pulsarCore.TransactionStatus}});Object.defineProperty(exports,"TransactionTracker",{enumerable:true,get:function(){return pulsarCore.TransactionTracker}});exports.PulsarModule=s;exports.Quasar=n;exports.QuasarSDKError=a;
|
|
1
|
+
'use strict';var chunkNJH5FYLU_cjs=require('./chunk-NJH5FYLU.cjs'),ofetch=require('ofetch'),pulsarCore=require('@tuwaio/pulsar-core');var a=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},o=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide the secretKey of your Quasar app (sk_live_ or sk_test_).");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||chunkNJH5FYLU_cjs.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 a(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var s=class{constructor(r){this.client=r;}client;async syncCreate(r,e){return this.client.request(chunkNJH5FYLU_cjs.b,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(chunkNJH5FYLU_cjs.c,{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}})}};var n=class{client;pulsar;constructor(r){this.client=new o(r),this.pulsar=new s(this.client);}};Object.defineProperty(exports,"BASE_API_URL",{enumerable:true,get:function(){return chunkNJH5FYLU_cjs.a}});Object.defineProperty(exports,"PULSAR_HISTORY_ENDPOINT",{enumerable:true,get:function(){return chunkNJH5FYLU_cjs.c}});Object.defineProperty(exports,"PULSAR_SYNC_ENDPOINT",{enumerable:true,get:function(){return chunkNJH5FYLU_cjs.b}});Object.defineProperty(exports,"TransactionStatus",{enumerable:true,get:function(){return pulsarCore.TransactionStatus}});Object.defineProperty(exports,"TransactionTracker",{enumerable:true,get:function(){return pulsarCore.TransactionTracker}});exports.PulsarModule=s;exports.Quasar=n;exports.QuasarSDKError=a;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,c,a as a$1}from'./chunk-YPUBFZPR.js';export{a as BASE_API_URL,c as PULSAR_HISTORY_ENDPOINT,b as PULSAR_SYNC_ENDPOINT}from'./chunk-YPUBFZPR.js';import {ofetch}from'ofetch';export{TransactionStatus,TransactionTracker}from'@tuwaio/pulsar-core';var a=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},o=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide the secretKey of your Quasar app (sk_live_ or sk_test_).");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||a$1,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 a(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var s=class{constructor(r){this.client=r;}async syncCreate(r,e){return this.client.request(b,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(c,{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}})}};var n=class{client;pulsar;constructor(r){this.client=new o(r),this.pulsar=new s(this.client);}};export{s as PulsarModule,n as Quasar,a as QuasarSDKError};
|
|
1
|
+
import {b,c,a as a$1}from'./chunk-YPUBFZPR.js';export{a as BASE_API_URL,c as PULSAR_HISTORY_ENDPOINT,b as PULSAR_SYNC_ENDPOINT}from'./chunk-YPUBFZPR.js';import {ofetch}from'ofetch';export{TransactionStatus,TransactionTracker}from'@tuwaio/pulsar-core';var a=class extends Error{status;originalError;constructor(r,e,t){super(r),this.name="QuasarSDKError",this.status=e,this.originalError=t;}},o=class{secretKey;internalSecret;baseUrl;timeout;constructor(r){if(!r.secretKey)throw new Error("[Quasar SDK] Missing API Key. Provide the secretKey of your Quasar app (sk_live_ or sk_test_).");this.secretKey=r.secretKey,this.internalSecret=r.internalSecret,this.baseUrl=r.baseUrl||a$1,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 a(`[Quasar SDK] Request Failed (${t}): ${p}`,t,e)}};var s=class{constructor(r){this.client=r;}client;async syncCreate(r,e){return this.client.request(b,{method:"POST",body:{...r,appName:e}})}async getHistory(r={}){return this.client.request(c,{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}})}};var n=class{client;pulsar;constructor(r){this.client=new o(r),this.pulsar=new s(this.client);}};export{s as PulsarModule,n as Quasar,a as QuasarSDKError};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/quasar-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"description": "
|
|
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.",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.cjs",
|
|
10
10
|
"module": "./dist/index.js",
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@tuwaio/pulsar-core": "^0.9.
|
|
81
|
+
"@tuwaio/pulsar-core": "^0.9.1",
|
|
82
82
|
"tsup": "^8.5.1",
|
|
83
83
|
"typescript": "6.0.3",
|
|
84
|
-
"@tuwaio/siwx-react": "^0.
|
|
84
|
+
"@tuwaio/siwx-react": "^0.6.0"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"start": "tsup src/index.ts --watch",
|