@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.
- package/dist/browser/contexts/Context.d.ts +3 -0
- package/dist/browser/contexts/Context.d.ts.map +1 -0
- package/dist/browser/contexts/Provider.d.ts +4 -0
- package/dist/browser/contexts/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/State.d.ts +6 -0
- package/dist/browser/contexts/State.d.ts.map +1 -0
- package/dist/browser/contexts/defaultState.d.ts +3 -0
- package/dist/browser/contexts/defaultState.d.ts.map +1 -0
- package/dist/browser/contexts/index.d.ts +5 -0
- package/dist/browser/contexts/index.d.ts.map +1 -0
- package/dist/browser/contexts/use.d.ts +2 -0
- package/dist/browser/contexts/use.d.ts.map +1 -0
- package/dist/browser/index.d.ts +2 -18
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +49 -44
- package/src/contexts/Context.ts +1 -1
- package/src/contexts/Provider.tsx +1 -1
- package/src/contexts/State.ts +2 -2
- package/src/contexts/defaultState.ts +1 -1
- package/xy.config.ts +2 -4
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,oGAK5B,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
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
|
-
"
|
|
10
|
-
"
|
|
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
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
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
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
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
|
-
"
|
|
30
|
-
"
|
|
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
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
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
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
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
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
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
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
}
|
package/src/contexts/Context.ts
CHANGED
package/src/contexts/State.ts
CHANGED
|
@@ -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
|
package/xy.config.ts
CHANGED