@xyo-network/react-wallet-service 4.1.8 → 4.1.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const WalletServiceProvider: React.FC<
|
|
3
|
+
export declare const WalletServiceProvider: React.FC<PropsWithChildren>;
|
|
4
4
|
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAE7D,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 type { WalletServiceState } from './State.ts'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import type {
|
|
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 { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport { WalletServiceContext } from './Context.ts'\nimport { defaultState } from './defaultState.ts'\n\nexport const WalletServiceProvider: React.FC<PropsWithChildren> = ({ 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,wBAAqD,wBAAC,EAAEC,SAAQ,MAAE;AAC7E,SAAO,sBAAA,cAACC,qBAAqBC,UAAQ;IAACC,OAAOC,aAAAA;KAAiBJ,QAAAA;AAChE,GAFkE;;;AENlE,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-wallet-service",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.9",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -43,10 +43,9 @@
|
|
|
43
43
|
"lint-pkg": "npmPkgJsonLint ."
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xylabs/assert": "^4.3.
|
|
47
|
-
"@
|
|
48
|
-
"@xyo-network/
|
|
49
|
-
"@xyo-network/react-shared": "^4.1.8"
|
|
46
|
+
"@xylabs/assert": "^4.3.3",
|
|
47
|
+
"@xyo-network/metamask-connector": "^3.3.2",
|
|
48
|
+
"@xyo-network/react-shared": "^4.1.9"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@mui/icons-material": "^6.1.5",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithChildren } from 'react'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { WalletServiceContext } from './Context.ts'
|
|
5
5
|
import { defaultState } from './defaultState.ts'
|
|
6
6
|
|
|
7
|
-
export const WalletServiceProvider: React.FC<
|
|
7
|
+
export const WalletServiceProvider: React.FC<PropsWithChildren> = ({ children }) => {
|
|
8
8
|
return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>
|
|
9
9
|
}
|