@xyo-network/react-wallet-service 2.64.0-rc.3 → 2.64.0-rc.4
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.mts.map +1 -0
- package/dist/browser/contexts/Context.d.ts.map +1 -0
- package/dist/browser/contexts/Context.js +6 -0
- package/dist/browser/contexts/Context.js.map +1 -0
- package/dist/browser/contexts/Provider.d.mts.map +1 -0
- package/dist/browser/contexts/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/Provider.js +10 -0
- package/dist/browser/contexts/Provider.js.map +1 -0
- package/dist/browser/contexts/State.d.mts.map +1 -0
- package/dist/browser/contexts/State.d.ts.map +1 -0
- package/dist/browser/contexts/State.js +1 -0
- package/dist/browser/contexts/State.js.map +1 -0
- package/dist/browser/contexts/defaultState.d.mts.map +1 -0
- package/dist/browser/contexts/defaultState.d.ts.map +1 -0
- package/dist/browser/contexts/defaultState.js +11 -0
- package/dist/browser/contexts/defaultState.js.map +1 -0
- package/dist/browser/contexts/index.d.mts.map +1 -0
- package/dist/browser/contexts/index.d.ts.map +1 -0
- package/dist/browser/contexts/index.js +5 -0
- package/dist/browser/contexts/index.js.map +1 -0
- package/dist/browser/contexts/use.d.mts.map +1 -0
- package/dist/browser/contexts/use.d.ts.map +1 -0
- package/dist/browser/contexts/use.js +12 -0
- package/dist/browser/contexts/use.js.map +1 -0
- package/dist/{index.d.mts.map → browser/index.d.mts.map} +1 -1
- package/dist/{index.d.ts.map → browser/index.d.ts.map} +1 -1
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/node/contexts/Context.d.mts +4 -0
- package/dist/node/contexts/Context.d.mts.map +1 -0
- package/dist/node/contexts/Context.d.ts +4 -0
- package/dist/node/contexts/Context.d.ts.map +1 -0
- package/dist/node/contexts/Context.js +30 -0
- package/dist/node/contexts/Context.js.map +1 -0
- package/dist/node/contexts/Context.mjs +6 -0
- package/dist/node/contexts/Context.mjs.map +1 -0
- package/dist/node/contexts/Provider.d.mts +4 -0
- package/dist/node/contexts/Provider.d.mts.map +1 -0
- package/dist/node/contexts/Provider.d.ts +4 -0
- package/dist/node/contexts/Provider.d.ts.map +1 -0
- package/dist/node/contexts/Provider.js +34 -0
- package/dist/node/contexts/Provider.js.map +1 -0
- package/dist/node/contexts/Provider.mjs +10 -0
- package/dist/node/contexts/Provider.mjs.map +1 -0
- package/dist/node/contexts/State.d.mts +6 -0
- package/dist/node/contexts/State.d.mts.map +1 -0
- package/dist/node/contexts/State.d.ts +6 -0
- package/dist/node/contexts/State.d.ts.map +1 -0
- package/dist/node/contexts/State.js +17 -0
- package/dist/node/contexts/State.js.map +1 -0
- package/dist/node/contexts/State.mjs +1 -0
- package/dist/node/contexts/State.mjs.map +1 -0
- package/dist/node/contexts/defaultState.d.mts +3 -0
- package/dist/node/contexts/defaultState.d.mts.map +1 -0
- package/dist/node/contexts/defaultState.d.ts +3 -0
- package/dist/node/contexts/defaultState.d.ts.map +1 -0
- package/dist/node/contexts/defaultState.js +35 -0
- package/dist/node/contexts/defaultState.js.map +1 -0
- package/dist/node/contexts/defaultState.mjs +11 -0
- package/dist/node/contexts/defaultState.mjs.map +1 -0
- package/dist/node/contexts/index.d.mts +5 -0
- package/dist/node/contexts/index.d.mts.map +1 -0
- package/dist/node/contexts/index.d.ts +5 -0
- package/dist/node/contexts/index.d.ts.map +1 -0
- package/dist/node/contexts/index.js +29 -0
- package/dist/node/contexts/index.js.map +1 -0
- package/dist/node/contexts/index.mjs +5 -0
- package/dist/node/contexts/index.mjs.map +1 -0
- package/dist/node/contexts/use.d.mts +2 -0
- package/dist/node/contexts/use.d.mts.map +1 -0
- package/dist/node/contexts/use.d.ts +2 -0
- package/dist/node/contexts/use.d.ts.map +1 -0
- package/dist/{index.js → node/contexts/use.js} +7 -33
- package/dist/node/contexts/use.js.map +1 -0
- package/dist/node/contexts/use.mjs +12 -0
- package/dist/node/contexts/use.mjs.map +1 -0
- package/dist/node/index.d.mts +2 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +23 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +17 -17
- package/dist/contexts/Context.d.mts.map +0 -1
- package/dist/contexts/Context.d.ts.map +0 -1
- package/dist/contexts/Provider.d.mts.map +0 -1
- package/dist/contexts/Provider.d.ts.map +0 -1
- package/dist/contexts/State.d.mts.map +0 -1
- package/dist/contexts/State.d.ts.map +0 -1
- package/dist/contexts/defaultState.d.mts.map +0 -1
- package/dist/contexts/defaultState.d.ts.map +0 -1
- package/dist/contexts/index.d.mts.map +0 -1
- package/dist/contexts/index.d.ts.map +0 -1
- package/dist/contexts/use.d.mts.map +0 -1
- package/dist/contexts/use.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -33
- package/dist/index.mjs.map +0 -1
- /package/dist/{contexts → browser/contexts}/Context.d.mts +0 -0
- /package/dist/{contexts → browser/contexts}/Context.d.ts +0 -0
- /package/dist/{contexts → browser/contexts}/Provider.d.mts +0 -0
- /package/dist/{contexts → browser/contexts}/Provider.d.ts +0 -0
- /package/dist/{contexts → browser/contexts}/State.d.mts +0 -0
- /package/dist/{contexts → browser/contexts}/State.d.ts +0 -0
- /package/dist/{contexts → browser/contexts}/defaultState.d.mts +0 -0
- /package/dist/{contexts → browser/contexts}/defaultState.d.ts +0 -0
- /package/dist/{contexts → browser/contexts}/index.d.mts +0 -0
- /package/dist/{contexts → browser/contexts}/index.d.ts +0 -0
- /package/dist/{contexts → browser/contexts}/use.d.mts +0 -0
- /package/dist/{contexts → browser/contexts}/use.d.ts +0 -0
- /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
- /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/contexts/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/contexts/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/Context.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n"],"mappings":"AAAA,SAAS,uBAAuB;AAIzB,MAAM,uBAAuB,gBAAoC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WalletServiceContext } from "./Context";
|
|
3
|
+
import { defaultState } from "./defaultState";
|
|
4
|
+
const WalletServiceProvider = ({ children }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(WalletServiceContext.Provider, { value: defaultState(), children });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
WalletServiceProvider
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/Provider.tsx"],"sourcesContent":["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"],"mappings":"AAMS;AAJT,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAEtB,MAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../src/contexts/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../src/contexts/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=State.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/defaultState.ts"],"sourcesContent":["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"],"mappings":"AAAA,SAAS,yBAAyB;AAI3B,MAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/index.ts"],"sourcesContent":["export * from './Context'\nexport * from './Provider'\nexport * from './State'\nexport * from './use'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,iGAK5B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,iGAK5B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { assertEx } from "@xylabs/assert";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { WalletServiceContext } from "./Context";
|
|
4
|
+
const useWalletService = () => {
|
|
5
|
+
const context = useContext(WalletServiceContext);
|
|
6
|
+
assertEx(context.metaMaskWallet, "WalletServiceContext not initialized");
|
|
7
|
+
return context;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
useWalletService
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=use.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/use.tsx"],"sourcesContent":["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,gBAAgB;AACzB,SAAS,kBAAkB;AAE3B,SAAS,4BAA4B;AAE9B,MAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;AAC/C,WAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './contexts'\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/contexts/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/contexts/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Context_exports = {};
|
|
20
|
+
__export(Context_exports, {
|
|
21
|
+
WalletServiceContext: () => WalletServiceContext
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Context_exports);
|
|
24
|
+
var import_react_shared = require("@xyo-network/react-shared");
|
|
25
|
+
const WalletServiceContext = (0, import_react_shared.createContextEx)();
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
WalletServiceContext
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/Context.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC;AAIzB,MAAM,2BAAuB,qCAAoC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/Context.tsx"],"sourcesContent":["import { createContextEx } from '@xyo-network/react-shared'\n\nimport { WalletServiceState } from './State'\n\nexport const WalletServiceContext = createContextEx<WalletServiceState>()\n"],"mappings":"AAAA,SAAS,uBAAuB;AAIzB,MAAM,uBAAuB,gBAAoC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Provider_exports = {};
|
|
20
|
+
__export(Provider_exports, {
|
|
21
|
+
WalletServiceProvider: () => WalletServiceProvider
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Provider_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_Context = require("./Context");
|
|
26
|
+
var import_defaultState = require("./defaultState");
|
|
27
|
+
const WalletServiceProvider = ({ children }) => {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Context.WalletServiceContext.Provider, { value: (0, import_defaultState.defaultState)(), children });
|
|
29
|
+
};
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
WalletServiceProvider
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=Provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/Provider.tsx"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMS;AAJT,qBAAqC;AACrC,0BAA6B;AAEtB,MAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,4CAAC,oCAAqB,UAArB,EAA8B,WAAO,kCAAa,GAAI,UAAS;AACzE;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WalletServiceContext } from "./Context";
|
|
3
|
+
import { defaultState } from "./defaultState";
|
|
4
|
+
const WalletServiceProvider = ({ children }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(WalletServiceContext.Provider, { value: defaultState(), children });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
WalletServiceProvider
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Provider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/Provider.tsx"],"sourcesContent":["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"],"mappings":"AAMS;AAJT,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAEtB,MAAM,wBAAgD,CAAC,EAAE,SAAS,MAAM;AAC7E,SAAO,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,aAAa,GAAI,UAAS;AACzE;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MetaMaskConnector } from '@xyo-network/metamask-connector';
|
|
2
|
+
import { 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,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MetaMaskConnector } from '@xyo-network/metamask-connector';
|
|
2
|
+
import { 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,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var State_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(State_exports);
|
|
17
|
+
//# sourceMappingURL=State.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/State.ts"],"sourcesContent":["import { MetaMaskConnector } from '@xyo-network/metamask-connector'\nimport { ContextExState } from '@xyo-network/react-shared'\n\nexport interface WalletServiceState extends ContextExState {\n metaMaskWallet: MetaMaskConnector\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=State.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var defaultState_exports = {};
|
|
20
|
+
__export(defaultState_exports, {
|
|
21
|
+
defaultState: () => defaultState
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(defaultState_exports);
|
|
24
|
+
var import_metamask_connector = require("@xyo-network/metamask-connector");
|
|
25
|
+
const defaultState = () => {
|
|
26
|
+
return {
|
|
27
|
+
metaMaskWallet: new import_metamask_connector.MetaMaskConnector(),
|
|
28
|
+
provided: true
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
defaultState
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=defaultState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/defaultState.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAkC;AAI3B,MAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,4CAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/defaultState.ts"],"sourcesContent":["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"],"mappings":"AAAA,SAAS,yBAAyB;AAI3B,MAAM,eAAe,MAA0B;AACpD,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,UAAU;AAAA,EACZ;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var contexts_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(contexts_exports);
|
|
18
|
+
__reExport(contexts_exports, require("./Context"), module.exports);
|
|
19
|
+
__reExport(contexts_exports, require("./Provider"), module.exports);
|
|
20
|
+
__reExport(contexts_exports, require("./State"), module.exports);
|
|
21
|
+
__reExport(contexts_exports, require("./use"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("./Context"),
|
|
25
|
+
...require("./Provider"),
|
|
26
|
+
...require("./State"),
|
|
27
|
+
...require("./use")
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/index.ts"],"sourcesContent":["export * from './Context'\nexport * from './Provider'\nexport * from './State'\nexport * from './use'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,sBAAd;AACA,6BAAc,uBADd;AAEA,6BAAc,oBAFd;AAGA,6BAAc,kBAHd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/index.ts"],"sourcesContent":["export * from './Context'\nexport * from './Provider'\nexport * from './State'\nexport * from './use'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,iGAK5B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,iGAK5B,CAAA"}
|
|
@@ -16,47 +16,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
WalletServiceContext: () => WalletServiceContext,
|
|
24
|
-
WalletServiceProvider: () => WalletServiceProvider,
|
|
19
|
+
var use_exports = {};
|
|
20
|
+
__export(use_exports, {
|
|
25
21
|
useWalletService: () => useWalletService
|
|
26
22
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
-
|
|
29
|
-
// src/contexts/Context.tsx
|
|
30
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
|
31
|
-
var WalletServiceContext = (0, import_react_shared.createContextEx)();
|
|
32
|
-
|
|
33
|
-
// src/contexts/defaultState.ts
|
|
34
|
-
var import_metamask_connector = require("@xyo-network/metamask-connector");
|
|
35
|
-
var defaultState = () => {
|
|
36
|
-
return {
|
|
37
|
-
metaMaskWallet: new import_metamask_connector.MetaMaskConnector(),
|
|
38
|
-
provided: true
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// src/contexts/Provider.tsx
|
|
43
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
var WalletServiceProvider = ({ children }) => {
|
|
45
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WalletServiceContext.Provider, { value: defaultState(), children });
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/contexts/use.tsx
|
|
23
|
+
module.exports = __toCommonJS(use_exports);
|
|
49
24
|
var import_assert = require("@xylabs/assert");
|
|
50
25
|
var import_react = require("react");
|
|
51
|
-
var
|
|
52
|
-
|
|
26
|
+
var import_Context = require("./Context");
|
|
27
|
+
const useWalletService = () => {
|
|
28
|
+
const context = (0, import_react.useContext)(import_Context.WalletServiceContext);
|
|
53
29
|
(0, import_assert.assertEx)(context.metaMaskWallet, "WalletServiceContext not initialized");
|
|
54
30
|
return context;
|
|
55
31
|
};
|
|
56
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57
33
|
0 && (module.exports = {
|
|
58
|
-
WalletServiceContext,
|
|
59
|
-
WalletServiceProvider,
|
|
60
34
|
useWalletService
|
|
61
35
|
});
|
|
62
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=use.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/use.tsx"],"sourcesContent":["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,oBAAyB;AACzB,mBAA2B;AAE3B,qBAAqC;AAE9B,MAAM,mBAAmB,MAAM;AACpC,QAAM,cAAU,yBAAW,mCAAoB;AAC/C,8BAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { assertEx } from "@xylabs/assert";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { WalletServiceContext } from "./Context";
|
|
4
|
+
const useWalletService = () => {
|
|
5
|
+
const context = useContext(WalletServiceContext);
|
|
6
|
+
assertEx(context.metaMaskWallet, "WalletServiceContext not initialized");
|
|
7
|
+
return context;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
useWalletService
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=use.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/contexts/use.tsx"],"sourcesContent":["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,gBAAgB;AACzB,SAAS,kBAAkB;AAE3B,SAAS,4BAA4B;AAE9B,MAAM,mBAAmB,MAAM;AACpC,QAAM,UAAU,WAAW,oBAAoB;AAC/C,WAAS,QAAQ,gBAAgB,sCAAsC;AAEvE,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./contexts"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./contexts")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './contexts'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,uBAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './contexts'\n"],"mappings":"AAAA,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/assert": "^2.11.7",
|
|
14
|
-
"@xylabs/react-shared": "^3.1.0-rc.
|
|
15
|
-
"@xyo-network/metamask-connector": "^2.74.
|
|
16
|
-
"@xyo-network/react-shared": "~2.64.0-rc.
|
|
14
|
+
"@xylabs/react-shared": "^3.1.0-rc.6",
|
|
15
|
+
"@xyo-network/metamask-connector": "^2.74.5",
|
|
16
|
+
"@xyo-network/react-shared": "~2.64.0-rc.4"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@mui/icons-material": "^5",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"react-router-dom": "^6.3.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
28
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.55",
|
|
29
29
|
"typescript": "^5.2.2"
|
|
30
30
|
},
|
|
31
31
|
"description": "Common React library for all XYO projects that use React",
|
|
@@ -34,30 +34,30 @@
|
|
|
34
34
|
".": {
|
|
35
35
|
"node": {
|
|
36
36
|
"import": {
|
|
37
|
-
"types": "./dist/index.d.mts",
|
|
38
|
-
"default": "./dist/index.mjs"
|
|
37
|
+
"types": "./dist/node/index.d.mts",
|
|
38
|
+
"default": "./dist/node/index.mjs"
|
|
39
39
|
},
|
|
40
40
|
"require": {
|
|
41
|
-
"types": "./dist/index.d.ts",
|
|
42
|
-
"default": "./dist/index.js"
|
|
41
|
+
"types": "./dist/node/index.d.ts",
|
|
42
|
+
"default": "./dist/node/index.js"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"browser": {
|
|
46
46
|
"import": {
|
|
47
|
-
"types": "./dist/index.d.
|
|
48
|
-
"default": "./dist/index.
|
|
47
|
+
"types": "./dist/browser/index.d.ts",
|
|
48
|
+
"default": "./dist/browser/index.js"
|
|
49
49
|
},
|
|
50
50
|
"require": {
|
|
51
|
-
"types": "./dist/index.d.ts",
|
|
52
|
-
"default": "./dist/index.js"
|
|
51
|
+
"types": "./dist/browser/index.d.ts",
|
|
52
|
+
"default": "./dist/browser/index.js"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"default": "./dist/index.mjs"
|
|
55
|
+
"default": "./dist/browser/index.mjs"
|
|
56
56
|
},
|
|
57
57
|
"./package.json": "./package.json"
|
|
58
58
|
},
|
|
59
|
-
"main": "dist/index.js",
|
|
60
|
-
"module": "dist/index.
|
|
59
|
+
"main": "dist/browser/index.js",
|
|
60
|
+
"module": "dist/browser/index.js",
|
|
61
61
|
"homepage": "https://xyo.network",
|
|
62
62
|
"keywords": [
|
|
63
63
|
"xyo",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"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\""
|
|
79
79
|
},
|
|
80
80
|
"sideEffects": false,
|
|
81
|
-
"types": "dist/index.d.ts",
|
|
82
|
-
"version": "2.64.0-rc.
|
|
81
|
+
"types": "dist/browser/index.d.ts",
|
|
82
|
+
"version": "2.64.0-rc.4",
|
|
83
83
|
"stableVersion": "2.63.1"
|
|
84
84
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/contexts/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/contexts/Context.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,oBAAoB,kGAAwC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../src/contexts/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../src/contexts/Provider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKnD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAExD,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../src/contexts/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../src/contexts/State.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,cAAc,EAAE,iBAAiB,CAAA;CAClC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultState.d.ts","sourceRoot":"","sources":["../../src/contexts/defaultState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,YAAY,QAAO,kBAK/B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../src/contexts/use.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,iGAK5B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../src/contexts/use.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,iGAK5B,CAAA"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
package/dist/index.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// src/contexts/Context.tsx
|
|
2
|
-
import { createContextEx } from "@xyo-network/react-shared";
|
|
3
|
-
var WalletServiceContext = createContextEx();
|
|
4
|
-
|
|
5
|
-
// src/contexts/defaultState.ts
|
|
6
|
-
import { MetaMaskConnector } from "@xyo-network/metamask-connector";
|
|
7
|
-
var defaultState = () => {
|
|
8
|
-
return {
|
|
9
|
-
metaMaskWallet: new MetaMaskConnector(),
|
|
10
|
-
provided: true
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
// src/contexts/Provider.tsx
|
|
15
|
-
import { jsx } from "react/jsx-runtime";
|
|
16
|
-
var WalletServiceProvider = ({ children }) => {
|
|
17
|
-
return /* @__PURE__ */ jsx(WalletServiceContext.Provider, { value: defaultState(), children });
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// src/contexts/use.tsx
|
|
21
|
-
import { assertEx } from "@xylabs/assert";
|
|
22
|
-
import { useContext } from "react";
|
|
23
|
-
var useWalletService = () => {
|
|
24
|
-
const context = useContext(WalletServiceContext);
|
|
25
|
-
assertEx(context.metaMaskWallet, "WalletServiceContext not initialized");
|
|
26
|
-
return context;
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
WalletServiceContext,
|
|
30
|
-
WalletServiceProvider,
|
|
31
|
-
useWalletService
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|