axispay-sdk 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/package.json +7 -6
  2. package/src/index.ts +0 -66
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "axispay-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
- "main": "./dist/index.ts",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
6
11
  "exports": {
7
12
  ".": {
8
13
  "types": "./src/index.d.ts",
9
14
  "import": "./src/index.ts"
10
15
  }
11
16
  },
12
- "files": [
13
- "src",
14
- "dist"
15
- ],
16
17
  "scripts": {
17
18
  "build": "unbuild",
18
19
  "publish": "npm version patch && sudo npm publish"
package/src/index.ts DELETED
@@ -1,66 +0,0 @@
1
- import { ofetch } from 'ofetch'
2
-
3
- export default function createRequestClient(options: {
4
- baseURL: string,
5
- token: string
6
- }) {
7
- let req = ofetch.create({
8
- baseURL: options.baseURL,
9
- headers: {
10
- token: options.token
11
- },
12
-
13
- async onResponse({ response }) {
14
- if(response.status!=200){
15
- throw response._data
16
- }
17
- return response._data
18
- }
19
- })
20
-
21
- return {
22
- getAddress:(params:{
23
- userId:string|number,
24
- chain:string
25
- })=>{
26
- return req('/api/platform/wallet/address',{
27
- method:'GET',
28
- query:params
29
- })
30
- },
31
- checkRecharge: (params:{
32
- chain:string,
33
- token:string,
34
- address:string
35
- }) => {
36
- return req('/api/platform/wallet/checkRecharge', {
37
- method: 'GET',
38
- query: params
39
- })
40
- },
41
- withdraw:(params:{
42
- chain:string,
43
- token:string,
44
- address:string,
45
- amount:number,
46
- user_id:string|number
47
- })=>{
48
- return req('/api/platform/wallet/withdraw',{
49
- method:'POST',
50
- body:params
51
- })
52
- },
53
- }
54
-
55
- }
56
-
57
- // let client = createRequestClient({
58
- // baseURL: 'http://localhost:10000',
59
- // token: 'ef5e2a6a609a2bcc9ff02829594fc619'
60
- // })
61
-
62
- // let res = await client.checkRecharge({
63
- // chain:'TRON',
64
- // token:'USDT',
65
- // address:'TKENKNXoe5oiPeNNe8GsPeCB45KwCvS2Qcc'
66
- // })