@xyo-network/react-chain-provider 1.7.7 → 1.7.9

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/README.md CHANGED
@@ -8,13 +8,230 @@
8
8
  [![npm-license-badge][]](LICENSE)
9
9
  [![socket-badge][]][socket-link]
10
10
 
11
- Version: 1.7.3
12
-
13
11
  XYO Layer One API
14
12
 
15
13
  ## Documentation
16
14
 
17
- [TypeDoc Generated Documentation](https://gitbook.xyo.network/xyo-data-lab/xyo-reference/package-documentation/xyo-network__react-chain-provider)
15
+ ## Reference
16
+
17
+ **@xyo-network/react-chain-provider**
18
+
19
+ ***
20
+
21
+ ## Functions
22
+
23
+ - [useAddressBalance](#functions/useAddressBalance)
24
+ - [useCurrentBlock](#functions/useCurrentBlock)
25
+ - [useHttpRpcRunner](#functions/useHttpRpcRunner)
26
+ - [useNetwork](#functions/useNetwork)
27
+ - [useSigner](#functions/useSigner)
28
+ - [useHttpRpcViewer](#functions/useHttpRpcViewer)
29
+ - [useViewerFromWallet](#functions/useViewerFromWallet)
30
+
31
+ ### functions
32
+
33
+ ### <a id="useAddressBalance"></a>useAddressBalance
34
+
35
+ [**@xyo-network/react-chain-provider**](#../README)
36
+
37
+ ***
38
+
39
+ ```ts
40
+ function useAddressBalance(
41
+ address?,
42
+ viewer?,
43
+ refresh?): object;
44
+ ```
45
+
46
+ ## Parameters
47
+
48
+ ### address?
49
+
50
+ `Lowercase`\<`string`\>
51
+
52
+ ### viewer?
53
+
54
+ `XyoViewer`
55
+
56
+ ### refresh?
57
+
58
+ `number`
59
+
60
+ ## Returns
61
+
62
+ `object`
63
+
64
+ ### address
65
+
66
+ ```ts
67
+ address: undefined | Lowercase<string>;
68
+ ```
69
+
70
+ ### balanceForAddress
71
+
72
+ ```ts
73
+ balanceForAddress: undefined | null | AttoXL1 = balancesResult;
74
+ ```
75
+
76
+ ### balanceIntlFriendly
77
+
78
+ ```ts
79
+ balanceIntlFriendly: undefined | string;
80
+ ```
81
+
82
+ ### shortBalanceIntlFriendly
83
+
84
+ ```ts
85
+ shortBalanceIntlFriendly: undefined | string;
86
+ ```
87
+
88
+ ### error
89
+
90
+ ```ts
91
+ error: undefined | Error = balancesError;
92
+ ```
93
+
94
+ ### loading
95
+
96
+ ```ts
97
+ loading: boolean;
98
+ ```
99
+
100
+ ### <a id="useCurrentBlock"></a>useCurrentBlock
101
+
102
+ [**@xyo-network/react-chain-provider**](#../README)
103
+
104
+ ***
105
+
106
+ ```ts
107
+ function useCurrentBlock(refresh, viewer?): [undefined | HydratedBlock, undefined | Error, undefined | UsePromiseState];
108
+ ```
109
+
110
+ ## Parameters
111
+
112
+ ### refresh
113
+
114
+ `number` = `1`
115
+
116
+ ### viewer?
117
+
118
+ `XyoViewer`
119
+
120
+ ## Returns
121
+
122
+ \[`undefined` \| `HydratedBlock`, `undefined` \| `Error`, `undefined` \| `UsePromiseState`\]
123
+
124
+ ### <a id="useHttpRpcRunner"></a>useHttpRpcRunner
125
+
126
+ [**@xyo-network/react-chain-provider**](#../README)
127
+
128
+ ***
129
+
130
+ ```ts
131
+ function useHttpRpcRunner(url?): undefined | JsonRpcXyoRunner;
132
+ ```
133
+
134
+ ## Parameters
135
+
136
+ ### url?
137
+
138
+ `string`
139
+
140
+ ## Returns
141
+
142
+ `undefined` \| `JsonRpcXyoRunner`
143
+
144
+ ### <a id="useHttpRpcViewer"></a>useHttpRpcViewer
145
+
146
+ [**@xyo-network/react-chain-provider**](#../README)
147
+
148
+ ***
149
+
150
+ ```ts
151
+ function useHttpRpcViewer(url?): undefined | JsonRpcXyoViewer;
152
+ ```
153
+
154
+ ## Parameters
155
+
156
+ ### url?
157
+
158
+ `string`
159
+
160
+ ## Returns
161
+
162
+ `undefined` \| `JsonRpcXyoViewer`
163
+
164
+ ### <a id="useNetwork"></a>useNetwork
165
+
166
+ [**@xyo-network/react-chain-provider**](#../README)
167
+
168
+ ***
169
+
170
+ ```ts
171
+ function useNetwork(id?): undefined | MemoryXyoNetwork;
172
+ ```
173
+
174
+ ## Parameters
175
+
176
+ ### id?
177
+
178
+ `DefaultNetworkIds`
179
+
180
+ ## Returns
181
+
182
+ `undefined` \| `MemoryXyoNetwork`
183
+
184
+ ### <a id="useSigner"></a>useSigner
185
+
186
+ [**@xyo-network/react-chain-provider**](#../README)
187
+
188
+ ***
189
+
190
+ ```ts
191
+ function useSigner(_provider?, account?): undefined | XyoSigner;
192
+ ```
193
+
194
+ ## Parameters
195
+
196
+ ### \_provider?
197
+
198
+ `XyoConnectionProvider`
199
+
200
+ ### account?
201
+
202
+ `AccountInstance`
203
+
204
+ ## Returns
205
+
206
+ `undefined` \| `XyoSigner`
207
+
208
+ ### <a id="useViewerFromWallet"></a>useViewerFromWallet
209
+
210
+ [**@xyo-network/react-chain-provider**](#../README)
211
+
212
+ ***
213
+
214
+ ```ts
215
+ function useViewerFromWallet(networkId?): undefined | JsonRpcXyoViewer;
216
+ ```
217
+
218
+ Creates a JsonRpcXyoViewer instance based on the provided networkId.
219
+
220
+ ## Parameters
221
+
222
+ ### networkId?
223
+
224
+ `string`
225
+
226
+ a network id like 'sequence', 'local', etc.
227
+
228
+ ## Returns
229
+
230
+ `undefined` \| `JsonRpcXyoViewer`
231
+
232
+ An instance of JsonRpcXyoViewer if the networkId is found in walletConnections,
233
+ otherwise undefined.
234
+
18
235
 
19
236
  ## Maintainers
20
237
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/react-chain-provider",
4
- "version": "1.7.7",
4
+ "version": "1.7.9",
5
5
  "description": "XYO Layer One API",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -24,23 +24,30 @@
24
24
  ".": {
25
25
  "browser": {
26
26
  "types": "./dist/browser/index.d.ts",
27
+ "source": "./src/index.ts",
27
28
  "default": "./dist/browser/index.mjs"
28
29
  },
29
30
  "types": "./dist/browser/index.d.ts",
31
+ "source": "./src/index.ts",
30
32
  "default": "./dist/browser/index.mjs"
31
33
  },
32
34
  "./package.json": "./package.json"
33
35
  },
34
- "module": "dist/browser/index.mjs",
35
- "types": "dist/browser/index.d.ts",
36
+ "module": "./dist/browser/index.mjs",
37
+ "source": "./src/index.ts",
38
+ "types": "./dist/browser/index.d.ts",
39
+ "files": [
40
+ "dist",
41
+ "src"
42
+ ],
36
43
  "dependencies": {
37
- "@xylabs/hex": "^4.13.19",
44
+ "@xylabs/hex": "^4.13.21",
38
45
  "@xylabs/react-promise": "^6.3.13",
39
- "@xylabs/typeof": "^4.13.19",
40
- "@xyo-network/account-model": "^4.1.4",
41
- "@xyo-network/chain-wrappers": "^1.7.7",
42
- "@xyo-network/xl1-protocol": "^1.7.5",
43
- "@xyo-network/xl1-rpc": "^1.7.7",
46
+ "@xylabs/typeof": "^4.13.21",
47
+ "@xyo-network/account-model": "^4.1.6",
48
+ "@xyo-network/chain-wrappers": "^1.7.9",
49
+ "@xyo-network/xl1-protocol": "^1.7.10",
50
+ "@xyo-network/xl1-rpc": "^1.7.9",
44
51
  "react": "^19.1.0"
45
52
  },
46
53
  "devDependencies": {
@@ -51,9 +58,9 @@
51
58
  "@types/react": "^19.1.8",
52
59
  "@xylabs/ts-scripts-yarn3": "^7.0.0",
53
60
  "@xylabs/tsconfig-react": "^7.0.0",
54
- "@xyo-network/chain-network-model": "^1.7.7",
55
- "@xyo-network/react-chain-model": "^1.7.7",
56
- "knip": "^5.61.3",
61
+ "@xyo-network/chain-network-model": "^1.7.9",
62
+ "@xyo-network/react-chain-model": "^1.7.9",
63
+ "knip": "^5.62.0",
57
64
  "typescript": "^5.8.3"
58
65
  },
59
66
  "packageManager": "yarn@4.6.0",
package/vitest.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import { config } from 'dotenv'
2
- import { defineConfig } from 'vitest/config'
3
-
4
- config({ quiet: true })
5
-
6
- export default defineConfig({
7
- test: {
8
- globals: true,
9
- testTimeout: 100_000,
10
- },
11
- })
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: { src: true },
5
- node: {},
6
- neutral: {},
7
- },
8
- }
9
-
10
- export default config