@leofcoin/endpoint-clients 0.3.3 → 0.3.4

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/exports/direct.js CHANGED
@@ -27,7 +27,7 @@ class Client {
27
27
  }
28
28
  async selectAccount(address) {
29
29
  try {
30
- await walletStore.put('selected-account', address);
30
+ await globalThis.walletStore.put('selected-account', address);
31
31
  }
32
32
  catch (error) {
33
33
  throw new Error(`couldn't set selected account`);
@@ -1,11 +1,11 @@
1
1
  type responseType = 'json' | 'text' | 'arrayBuffer' | 'clone' | 'formData' | 'blob';
2
2
  type networkVersion = 'peach' | string;
3
3
  export default class Client {
4
- url: URL;
4
+ url: string;
5
5
  networkVersion: networkVersion;
6
6
  get isHttpClient(): boolean;
7
7
  constructor(url: any, networkVersion: any);
8
- _fetch(method: any, params?: any, type?: responseType): Promise<any>;
8
+ _fetch(method: string, params?: any, type?: responseType): Promise<any>;
9
9
  _fetchString(method: string, params?: any): Promise<string>;
10
10
  _fetchNumber(method: string, params?: any): Promise<number>;
11
11
  _fetchBoolean(method: string, params?: any): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/endpoint-clients",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
package/rollup.config.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import typescript from '@rollup/plugin-typescript'
2
- import tsConfig from './tsconfig.json' assert { type: 'json'}
3
2
  export default [{
4
3
  input: ['./src/index.ts', './src/http.ts', './src/ws.ts', './src/direct.ts'],
5
4
  output: {
@@ -7,7 +6,7 @@ export default [{
7
6
  format: 'es'
8
7
  },
9
8
  plugins: [
10
- typescript(tsConfig)
9
+ typescript()
11
10
  ],
12
11
  external: [
13
12
  './identity.js'
package/src/direct.ts CHANGED
@@ -38,7 +38,7 @@ export default class Client {
38
38
 
39
39
  async selectAccount(address: any) {
40
40
  try {
41
- await walletStore.put('selected-account', address)
41
+ await globalThis.walletStore.put('selected-account', address)
42
42
  } catch (error) {
43
43
  throw new Error(`couldn't set selected account`)
44
44
  }
package/src/http.ts CHANGED
@@ -4,7 +4,7 @@ type responseType = 'json' | 'text' | 'arrayBuffer' | 'clone' | 'formData' | 'bl
4
4
  type networkVersion = 'peach' | string;
5
5
 
6
6
  export default class Client {
7
- url: URL;
7
+ url: string;
8
8
  networkVersion: networkVersion;
9
9
  get isHttpClient() {
10
10
  return true
@@ -15,7 +15,7 @@ export default class Client {
15
15
  this.networkVersion = networkVersion
16
16
  }
17
17
 
18
- async _fetch(method, params?, type: responseType = 'json') {
18
+ async _fetch(method: string, params?, type: responseType = 'json') {
19
19
  params = new URLSearchParams(params).toString()
20
20
  const response = await fetch(`${this.url}/${method}?${params}`)
21
21
  return response[type]()
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "es2022",
3
+ "module": "NodeNext",
4
4
  "target": "es2022",
5
5
  "outDir": "./exports",
6
6
  "moduleResolution":"NodeNext",