@xyo-network/react-wallet-service 3.0.1 → 3.0.3

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.
@@ -0,0 +1,3 @@
1
+ import type { WalletServiceState } from './State.ts';
2
+ export declare const WalletServiceContext: import("react").Context<WalletServiceState & import("@xyo-network/react-shared").ContextExState>;
3
+ //# sourceMappingURL=Context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/contexts/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { WithChildren } from '@xylabs/react-shared';
2
+ import React from 'react';
3
+ export declare const WalletServiceProvider: React.FC<WithChildren>;
4
+ //# sourceMappingURL=Provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { MetaMaskConnector } from '@xyo-network/metamask-connector';
2
+ import type { ContextExState } from '@xyo-network/react-shared';
3
+ export interface WalletServiceState extends ContextExState {
4
+ metaMaskWallet: MetaMaskConnector;
5
+ }
6
+ //# sourceMappingURL=State.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../src/contexts/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
@@ -0,0 +1,3 @@
1
+ import type { WalletServiceState } from './State.ts';
2
+ export declare const defaultState: () => WalletServiceState;
3
+ //# sourceMappingURL=defaultState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './Context.ts';
2
+ export * from './Provider.tsx';
3
+ export * from './State.ts';
4
+ export * from './use.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const useWalletService: () => import("./State.ts").WalletServiceState & import("@xyo-network/react-shared").ContextExState;
2
+ //# sourceMappingURL=use.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,oGAK5B,CAAA"}
@@ -1,18 +1,2 @@
1
- import * as react from 'react';
2
- import react__default from 'react';
3
- import * as _xyo_network_react_shared from '@xyo-network/react-shared';
4
- import { ContextExState } from '@xyo-network/react-shared';
5
- import { MetaMaskConnector } from '@xyo-network/metamask-connector';
6
- import { WithChildren } from '@xylabs/react-shared';
7
-
8
- interface WalletServiceState extends ContextExState {
9
- metaMaskWallet: MetaMaskConnector;
10
- }
11
-
12
- declare const WalletServiceContext: react.Context<WalletServiceState & _xyo_network_react_shared.ContextExState>;
13
-
14
- declare const WalletServiceProvider: react__default.FC<WithChildren>;
15
-
16
- declare const useWalletService: () => WalletServiceState & _xyo_network_react_shared.ContextExState;
17
-
18
- export { WalletServiceContext, WalletServiceProvider, type WalletServiceState, useWalletService };
1
+ export * from './contexts/index.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/Context.ts","../../src/contexts/Provider.tsx","../../src/contexts/defaultState.ts","../../src/contexts/use.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State.ts'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { WithChildren } from '@xylabs/react-shared'\nimport React from 'react'\n\nimport { WalletServiceContext } from './Context.ts'\nimport { defaultState } from './defaultState.ts'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State.ts'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context.ts'\n\nexport const useWalletService = () => {\n const context = useContext(WalletServiceContext)\n assertEx(context.metaMaskWallet, () => 'WalletServiceContext not initialized')\n // we do the cast to make the api non-optional\n return context\n}\n"],"mappings":";;;;AAAA,SAASA,uBAAuB;AAIzB,IAAMC,uBAAuBD,gBAAAA;;;ACHpC,OAAOE,WAAW;;;ACDlB,SAASC,yBAAyB;AAI3B,IAAMC,eAAe,6BAAA;AAC1B,SAAO;IACLC,gBAAgB,IAAIC,kBAAAA;IACpBC,UAAU;EACZ;AACF,GAL4B;;;ADErB,IAAMC,wBAAgD,wBAAC,EAAEC,SAAQ,MAAE;AACxE,SAAO,sBAAA,cAACC,qBAAqBC,UAAQ;IAACC,OAAOC,aAAAA;KAAiBJ,QAAAA;AAChE,GAF6D;;;AEN7D,SAASK,gBAAgB;AACzB,SAASC,kBAAkB;AAIpB,IAAMC,mBAAmB,6BAAA;AAC9B,QAAMC,UAAUC,WAAWC,oBAAAA;AAC3BC,WAASH,QAAQI,gBAAgB,MAAM,sCAAA;AAEvC,SAAOJ;AACT,GALgC;","names":["createContextEx","WalletServiceContext","React","MetaMaskConnector","defaultState","metaMaskWallet","MetaMaskConnector","provided","WalletServiceProvider","children","WalletServiceContext","Provider","value","defaultState","assertEx","useContext","useWalletService","context","useContext","WalletServiceContext","assertEx","metaMaskWallet"]}
1
+ {"version":3,"sources":["../../src/contexts/Context.ts","../../src/contexts/Provider.tsx","../../src/contexts/defaultState.ts","../../src/contexts/use.ts"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { WalletServiceState } from './State.ts'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import type { WithChildren } from '@xylabs/react-shared'\nimport React from 'react'\n\nimport { WalletServiceContext } from './Context.ts'\nimport { defaultState } from './defaultState.ts'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport type { WalletServiceState } from './State.ts'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context.ts'\n\nexport const useWalletService = () => {\n const context = useContext(WalletServiceContext)\n assertEx(context.metaMaskWallet, () => 'WalletServiceContext not initialized')\n // we do the cast to make the api non-optional\n return context\n}\n"],"mappings":";;;;AAAA,SAASA,uBAAuB;AAIzB,IAAMC,uBAAuBD,gBAAAA;;;ACHpC,OAAOE,WAAW;;;ACDlB,SAASC,yBAAyB;AAI3B,IAAMC,eAAe,6BAAA;AAC1B,SAAO;IACLC,gBAAgB,IAAIC,kBAAAA;IACpBC,UAAU;EACZ;AACF,GAL4B;;;ADErB,IAAMC,wBAAgD,wBAAC,EAAEC,SAAQ,MAAE;AACxE,SAAO,sBAAA,cAACC,qBAAqBC,UAAQ;IAACC,OAAOC,aAAAA;KAAiBJ,QAAAA;AAChE,GAF6D;;;AEN7D,SAASK,gBAAgB;AACzB,SAASC,kBAAkB;AAIpB,IAAMC,mBAAmB,6BAAA;AAC9B,QAAMC,UAAUC,WAAWC,oBAAAA;AAC3BC,WAASH,QAAQI,gBAAgB,MAAM,sCAAA;AAEvC,SAAOJ;AACT,GALgC;","names":["createContextEx","WalletServiceContext","React","MetaMaskConnector","defaultState","metaMaskWallet","MetaMaskConnector","provided","WalletServiceProvider","children","WalletServiceContext","Provider","value","defaultState","assertEx","useContext","useWalletService","context","useContext","WalletServiceContext","assertEx","metaMaskWallet"]}
package/package.json CHANGED
@@ -1,33 +1,30 @@
1
1
  {
2
2
  "name": "@xyo-network/react-wallet-service",
3
- "author": {
4
- "email": "support@xyo.network",
5
- "name": "XYO Development Team",
6
- "url": "https://xyo.network"
7
- },
3
+ "version": "3.0.3",
4
+ "description": "Common React library for all XYO projects that use React",
5
+ "keywords": [
6
+ "xyo",
7
+ "utility",
8
+ "typescript",
9
+ "react"
10
+ ],
11
+ "homepage": "https://xyo.network",
8
12
  "bugs": {
9
- "email": "support@xyo.network",
10
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
11
- },
12
- "dependencies": {
13
- "@xylabs/assert": "^4.0.1",
14
- "@xylabs/react-shared": "^4.0.1",
15
- "@xyo-network/metamask-connector": "^3.0.2",
16
- "@xyo-network/react-shared": "^3.0.1"
13
+ "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues",
14
+ "email": "support@xyo.network"
17
15
  },
18
- "peerDependencies": {
19
- "@mui/icons-material": "^5",
20
- "@mui/material": "^5",
21
- "@mui/styles": "^5",
22
- "react": "^18.2.0",
23
- "react-dom": "^18.2.0"
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
24
19
  },
25
- "devDependencies": {
26
- "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.15",
27
- "typescript": "^5.5.4"
20
+ "license": "LGPL-3.0-only",
21
+ "author": {
22
+ "name": "XYO Development Team",
23
+ "email": "support@xyo.network",
24
+ "url": "https://xyo.network"
28
25
  },
29
- "description": "Common React library for all XYO projects that use React",
30
- "docs": "dist/docs.json",
26
+ "sideEffects": false,
27
+ "type": "module",
31
28
  "exports": {
32
29
  ".": {
33
30
  "import": {
@@ -40,27 +37,35 @@
40
37
  "./package.json": "./package.json"
41
38
  },
42
39
  "module": "dist/browser/index.mjs",
43
- "homepage": "https://xyo.network",
44
- "keywords": [
45
- "xyo",
46
- "utility",
47
- "typescript",
48
- "react"
49
- ],
50
- "license": "LGPL-3.0-only",
51
- "publishConfig": {
52
- "access": "public"
40
+ "types": "dist/browser/index.d.ts",
41
+ "scripts": {
42
+ "license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\"",
43
+ "lint-pkg": "npmPkgJsonLint ."
53
44
  },
54
- "repository": {
55
- "type": "git",
56
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
45
+ "dependencies": {
46
+ "@xylabs/assert": "^4.0.5",
47
+ "@xylabs/react-shared": "^4.0.3",
48
+ "@xyo-network/metamask-connector": "^3.0.15",
49
+ "@xyo-network/react-shared": "^3.0.3"
57
50
  },
58
- "scripts": {
59
- "lint-pkg": "npmPkgJsonLint .",
60
- "license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
51
+ "devDependencies": {
52
+ "@mui/icons-material": "^5.16.7",
53
+ "@mui/material": "^5.16.7",
54
+ "@mui/styles": "^5.16.7",
55
+ "@xylabs/ts-scripts-yarn3": "^4.0.7",
56
+ "react": "^18.3.1",
57
+ "react-dom": "^18.3.1",
58
+ "typescript": "^5.5.4"
61
59
  },
62
- "sideEffects": false,
63
- "types": "dist/browser/index.d.ts",
64
- "version": "3.0.1",
65
- "type": "module"
60
+ "peerDependencies": {
61
+ "@mui/icons-material": "^5",
62
+ "@mui/material": "^5",
63
+ "@mui/styles": "^5",
64
+ "react": "^18.2.0",
65
+ "react-dom": "^18.2.0"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "docs": "dist/docs.json"
66
71
  }
@@ -1,5 +1,5 @@
1
1
  import { createContextEx } from '@xyo-network/react-shared'
2
2
 
3
- import { WalletServiceState } from './State.ts'
3
+ import type { WalletServiceState } from './State.ts'
4
4
 
5
5
  export const WalletServiceContext = createContextEx<WalletServiceState>()
@@ -1,4 +1,4 @@
1
- import { WithChildren } from '@xylabs/react-shared'
1
+ import type { WithChildren } from '@xylabs/react-shared'
2
2
  import React from 'react'
3
3
 
4
4
  import { WalletServiceContext } from './Context.ts'
@@ -1,5 +1,5 @@
1
- import { MetaMaskConnector } from '@xyo-network/metamask-connector'
2
- import { ContextExState } from '@xyo-network/react-shared'
1
+ import type { MetaMaskConnector } from '@xyo-network/metamask-connector'
2
+ import type { ContextExState } from '@xyo-network/react-shared'
3
3
 
4
4
  export interface WalletServiceState extends ContextExState {
5
5
  metaMaskWallet: MetaMaskConnector
@@ -1,6 +1,6 @@
1
1
  import { MetaMaskConnector } from '@xyo-network/metamask-connector'
2
2
 
3
- import { WalletServiceState } from './State.ts'
3
+ import type { WalletServiceState } from './State.ts'
4
4
 
5
5
  export const defaultState = (): WalletServiceState => {
6
6
  return {
package/xy.config.ts CHANGED
@@ -1,9 +1,7 @@
1
- import { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
1
+ import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
2
  const config: XyTsupConfig = {
3
3
  compile: {
4
- browser: {
5
- src: true,
6
- },
4
+ browser: { src: true },
7
5
  node: {},
8
6
  neutral: {},
9
7
  },