@blocklet/launcher-util 2.3.63 → 2.3.64

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/es/api.js ADDED
@@ -0,0 +1,10 @@
1
+ import axios from "axios";
2
+ import { default as default2 } from "axios";
3
+ import { createAxios } from "@blocklet/js-sdk";
4
+ axios.defaults.baseURL = "";
5
+ axios.defaults.timeout = 2e5;
6
+ const create = (...args) => createAxios(...args);
7
+ export {
8
+ create,
9
+ default2 as default
10
+ };
package/es/get-asset.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import joinUrl from "url-join";
2
- import axios from "axios";
3
2
  import get from "lodash/get";
3
+ import { create } from "./api";
4
4
  const getAsset = async (chainHost, address) => {
5
5
  const url = joinUrl(new URL(chainHost).origin, "/api/gql/");
6
- const result = await axios.post(
6
+ const request = create();
7
+ const result = await request.post(
7
8
  url,
8
9
  JSON.stringify({
9
10
  query: `{
package/lib/api.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const axios = require("axios");
4
+ const jsSdk = require("@blocklet/js-sdk");
5
+ axios.defaults.baseURL = "";
6
+ axios.defaults.timeout = 2e5;
7
+ const create = (...args) => jsSdk.createAxios(...args);
8
+ exports.default = axios;
9
+ exports.create = create;
package/lib/get-asset.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  const joinUrl = require("url-join");
3
- const axios = require("axios");
4
3
  const get = require("lodash/get");
4
+ const api = require("./api");
5
5
  const getAsset = async (chainHost, address) => {
6
6
  const url = joinUrl(new URL(chainHost).origin, "/api/gql/");
7
- const result = await axios.post(
7
+ const request = api.create();
8
+ const result = await request.post(
8
9
  url,
9
10
  JSON.stringify({
10
11
  query: `{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-util",
3
- "version": "2.3.63",
3
+ "version": "2.3.64",
4
4
  "description": "Common constants",
5
5
  "keywords": [
6
6
  "constant"
@@ -35,18 +35,19 @@
35
35
  "url": "https://github.com/blocklet/launcher/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@blocklet/sdk": "1.16.31",
38
+ "@blocklet/js-sdk": "^1.16.32",
39
+ "@blocklet/sdk": "1.16.32",
39
40
  "@ocap/util": "^1.18.135",
40
41
  "axios": "^1.7.7",
41
42
  "flat": "^5.0.2",
42
43
  "lodash": "^4.17.21",
43
44
  "moment": "^2.30.1",
44
- "moment-timezone": "^0.5.45",
45
+ "moment-timezone": "^0.5.46",
45
46
  "url-join": "^4.0.1"
46
47
  },
47
48
  "devDependencies": {
48
49
  "vite": "^5.4.8",
49
50
  "vite-plugin-build": "^0.10.0"
50
51
  },
51
- "gitHead": "c4ea98e35b952b97303d92620fd3104e41a402ad"
52
+ "gitHead": "95c58de49aba2495c7d832b268d27fe3eace24be"
52
53
  }