@xyo-network/react-wallet-service 2.70.6 → 2.71.0

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.
@@ -50,7 +50,7 @@ var import_assert = require("@xylabs/assert");
50
50
  var import_react = require("react");
51
51
  var useWalletService = () => {
52
52
  const context = (0, import_react.useContext)(WalletServiceContext);
53
- (0, import_assert.assertEx)(context.metaMaskWallet, "WalletServiceContext not initialized");
53
+ (0, import_assert.assertEx)(context.metaMaskWallet, () => "WalletServiceContext not initialized");
54
54
  return context;
55
55
  };
56
56
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["export * from './contexts'\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;;;ACJxE,gCAAkC;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,4CAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,4CAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,oBAAyB;AACzB,mBAA2B;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,cAAU,yBAAW,oBAAoB;AAC/C,8BAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["export * from './contexts'\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;;;ACJxE,gCAAkC;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,4CAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,4CAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,oBAAyB;AACzB,mBAA2B;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,cAAU,yBAAW,oBAAoB;AAC/C,8BAAS,QAAQ,gBAAgB,MAAM,sCAAsC;AAE7E,SAAO;AACT;","names":[]}
@@ -22,7 +22,7 @@ import { assertEx } from "@xylabs/assert";
22
22
  import { useContext } from "react";
23
23
  var useWalletService = () => {
24
24
  const context = useContext(WalletServiceContext);
25
- assertEx(context.metaMaskWallet, "WalletServiceContext not initialized");
25
+ assertEx(context.metaMaskWallet, () => "WalletServiceContext not initialized");
26
26
  return context;
27
27
  };
28
28
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;;;ACJxE,SAAS,yBAAyB;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;AAC/C,WAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;;;ACJxE,SAAS,yBAAyB;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;AAC/C,WAAS,QAAQ,gBAAgB,MAAM,sCAAsC;AAE7E,SAAO;AACT;","names":[]}
@@ -50,7 +50,7 @@ var import_assert = require("@xylabs/assert");
50
50
  var import_react = require("react");
51
51
  var useWalletService = () => {
52
52
  const context = (0, import_react.useContext)(WalletServiceContext);
53
- (0, import_assert.assertEx)(context.metaMaskWallet, "WalletServiceContext not initialized");
53
+ (0, import_assert.assertEx)(context.metaMaskWallet, () => "WalletServiceContext not initialized");
54
54
  return context;
55
55
  };
56
56
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["export * from './contexts'\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;;;ACJxE,gCAAkC;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,4CAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,4CAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,oBAAyB;AACzB,mBAA2B;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,cAAU,yBAAW,oBAAoB;AAC/C,8BAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["export * from './contexts'\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAgC;AAIzB,IAAM,2BAAuB,qCAAoC;;;ACJxE,gCAAkC;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,4CAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,4CAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,oBAAyB;AACzB,mBAA2B;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,cAAU,yBAAW,oBAAoB;AAC/C,8BAAS,QAAQ,gBAAgB,MAAM,sCAAsC;AAE7E,SAAO;AACT;","names":[]}
@@ -22,7 +22,7 @@ import { assertEx } from "@xylabs/assert";
22
22
  import { useContext } from "react";
23
23
  var useWalletService = () => {
24
24
  const context = useContext(WalletServiceContext);
25
- assertEx(context.metaMaskWallet, "WalletServiceContext not initialized");
25
+ assertEx(context.metaMaskWallet, () => "WalletServiceContext not initialized");
26
26
  return context;
27
27
  };
28
28
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;;;ACJxE,SAAS,yBAAyB;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;AAC/C,WAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/contexts/Context.tsx","../../src/contexts/defaultState.ts","../../src/contexts/Provider.tsx","../../src/contexts/use.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n","import { MetaMaskConnector } from '@xyo-network/metamask-connector'\n\nimport { WalletServiceState } from './State'\n\nexport const defaultState = (): WalletServiceState => {\n return {\n metaMaskWallet: new MetaMaskConnector(),\n provided: true,\n }\n}\n","import { WithChildren } from '@xylabs/react-shared'\n\nimport { WalletServiceContext } from './Context'\nimport { defaultState } from './defaultState'\n\nexport const WalletServiceProvider: React.FC<WithChildren> = ({ children }) => {\n return <WalletServiceContext.Provider value={defaultState()}>{children}</WalletServiceContext.Provider>\n}\n","import { assertEx } from '@xylabs/assert'\nimport { useContext } from 'react'\n\nimport { WalletServiceContext } from './Context'\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,SAAS,uBAAuB;AAIzB,IAAM,uBAAuB,gBAAoC;;;ACJxE,SAAS,yBAAyB;AAI3B,IAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;;;ACHS;AADF,IAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;;;ACPA,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAIpB,IAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;AAC/C,WAAS,QAAQ,gBAAgB,MAAM,sCAAsC;AAE7E,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -10,10 +10,10 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^3.0.12",
14
- "@xylabs/react-shared": "^3.1.5",
15
- "@xyo-network/metamask-connector": "^2.92.3",
16
- "@xyo-network/react-shared": "~2.70.6"
13
+ "@xylabs/assert": "^3.0.24",
14
+ "@xylabs/react-shared": "^3.1.6",
15
+ "@xyo-network/metamask-connector": "^2.93.4",
16
+ "@xyo-network/react-shared": "~2.71.0"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@mui/icons-material": "^5",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@xylabs/ts-scripts-yarn3": "^3.5.2",
27
- "typescript": "^5.4.2"
27
+ "typescript": "^5.4.3"
28
28
  },
29
29
  "description": "Common React library for all XYO projects that use React",
30
30
  "docs": "dist/docs.json",
@@ -77,6 +77,6 @@
77
77
  },
78
78
  "sideEffects": false,
79
79
  "types": "dist/browser/index.d.ts",
80
- "version": "2.70.6",
80
+ "version": "2.71.0",
81
81
  "type": "module"
82
82
  }
@@ -5,7 +5,7 @@ import { WalletServiceContext } from './Context'
5
5
 
6
6
  export const useWalletService = () => {
7
7
  const context = useContext(WalletServiceContext)
8
- assertEx(context.metaMaskWallet, 'WalletServiceContext not initialized')
8
+ assertEx(context.metaMaskWallet, () => 'WalletServiceContext not initialized')
9
9
  //we do the cast to make the api non-optional
10
10
  return context
11
11
  }