@xyo-network/react-chain-model 1.14.0 → 1.14.2
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/index.mjs.map +1 -1
- package/dist/browser/provider/xyoProvider.d.ts +2 -2
- package/dist/browser/provider/xyoProvider.d.ts.map +1 -1
- package/dist/browser/types/XyoGlobal.d.ts +2 -2
- package/dist/browser/types/XyoGlobal.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/provider/xyoProvider.ts +3 -3
- package/src/types/XyoGlobal.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/provider/xyoProvider.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../src/provider/xyoProvider.ts"],"sourcesContent":["import type { XyoConnection } from '@xyo-network/xl1-protocol'\n\nimport type { XyoGlobal } from '../types/index.ts'\n\ndeclare global {\n interface Window {\n xyo: XyoGlobal\n }\n\n var xyo: XyoGlobal\n var xyoWalletExtensionId: string\n}\n\nexport const hasXyoWalletInjectable = () => {\n return 'xyo' in globalThis && 'walletExtensionId' in globalThis.xyo\n}\n\nexport const hasXyoWalletProvider = () => {\n return hasXyoWalletInjectable() && 'provider' in globalThis.xyo\n}\n\nexport function getXyoProvider(options: { assert: true }): XyoConnection\nexport function getXyoProvider(options?: { assert?: boolean }): XyoConnection | undefined {\n const { assert } = options ?? {}\n if (hasXyoWalletProvider()) {\n return globalThis.xyo.provider\n } else {\n console.error('XYO Wallet not installed')\n if (assert) {\n throw new Error('XYO Wallet not installed')\n } else {\n return undefined\n }\n }\n}\n"],"mappings":";;;;AAaO,IAAMA,yBAAyB,6BAAA;AACpC,SAAO,SAASC,cAAc,uBAAuBA,WAAWC;AAClE,GAFsC;AAI/B,IAAMC,uBAAuB,6BAAA;AAClC,SAAOH,uBAAAA,KAA4B,cAAcC,WAAWC;AAC9D,GAFoC;AAK7B,SAASE,eAAeC,SAA8B;AAC3D,QAAM,EAAEC,OAAM,IAAKD,WAAW,CAAC;AAC/B,MAAIF,qBAAAA,GAAwB;AAC1B,WAAOF,WAAWC,IAAIK;EACxB,OAAO;AACLC,YAAQC,MAAM,0BAAA;AACd,QAAIH,QAAQ;AACV,YAAM,IAAII,MAAM,0BAAA;IAClB,OAAO;AACL,aAAOC;IACT;EACF;AACF;AAZgBP;","names":["hasXyoWalletInjectable","globalThis","xyo","hasXyoWalletProvider","getXyoProvider","options","assert","provider","console","error","Error","undefined"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { XyoConnection } from '@xyo-network/xl1-protocol';
|
|
2
2
|
import type { XyoGlobal } from '../types/index.ts';
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
@@ -11,5 +11,5 @@ export declare const hasXyoWalletInjectable: () => boolean;
|
|
|
11
11
|
export declare const hasXyoWalletProvider: () => boolean;
|
|
12
12
|
export declare function getXyoProvider(options: {
|
|
13
13
|
assert: true;
|
|
14
|
-
}):
|
|
14
|
+
}): XyoConnection;
|
|
15
15
|
//# sourceMappingURL=xyoProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xyoProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/xyoProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"xyoProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/xyoProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,GAAG,EAAE,SAAS,CAAA;KACf;IAED,IAAI,GAAG,EAAE,SAAS,CAAA;IAClB,IAAI,oBAAoB,EAAE,MAAM,CAAA;CACjC;AAED,eAAO,MAAM,sBAAsB,eAElC,CAAA;AAED,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAAG,aAAa,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ChainConnection } from '@xyo-network/chain-network-model';
|
|
2
|
-
import type { XyoClient,
|
|
2
|
+
import type { XyoClient, XyoConnection, XyoGatewayProvider } from '@xyo-network/xl1-protocol';
|
|
3
3
|
export interface XyoGlobal {
|
|
4
4
|
client?: XyoClient;
|
|
5
5
|
/** @deprecated - use client gateways instead */
|
|
@@ -9,7 +9,7 @@ export interface XyoGlobal {
|
|
|
9
9
|
errors?: Error[];
|
|
10
10
|
gateway?: XyoGatewayProvider;
|
|
11
11
|
/** @deprecated - use client gateways instead */
|
|
12
|
-
provider?:
|
|
12
|
+
provider?: XyoConnection;
|
|
13
13
|
sessionId: () => string;
|
|
14
14
|
/** @deprecated - use session id instead */
|
|
15
15
|
walletExtensionId: () => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoGlobal.d.ts","sourceRoot":"","sources":["../../../src/types/XyoGlobal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EACV,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"XyoGlobal.d.ts","sourceRoot":"","sources":["../../../src/types/XyoGlobal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EACV,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAC7C,MAAM,2BAA2B,CAAA;AAGlC,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,gDAAgD;IAChD,WAAW,EAAE;QAEX,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAA;KACnC,CAAA;IACD,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,SAAS,EAAE,MAAM,MAAM,CAAA;IACvB,2CAA2C;IAC3C,iBAAiB,EAAE,MAAM,MAAM,CAAA;CAChC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/react-chain-model",
|
|
4
|
-
"version": "1.14.
|
|
4
|
+
"version": "1.14.2",
|
|
5
5
|
"description": "XYO Layer One React SDK Stake",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"src"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@xyo-network/chain-network-model": "~1.14.
|
|
45
|
-
"@xyo-network/xl1-protocol": "~1.
|
|
44
|
+
"@xyo-network/chain-network-model": "~1.14.2",
|
|
45
|
+
"@xyo-network/xl1-protocol": "~1.12.14"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@xylabs/ts-scripts-yarn3": "~7.1.7",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { XyoConnection } from '@xyo-network/xl1-protocol'
|
|
2
2
|
|
|
3
3
|
import type { XyoGlobal } from '../types/index.ts'
|
|
4
4
|
|
|
@@ -19,8 +19,8 @@ export const hasXyoWalletProvider = () => {
|
|
|
19
19
|
return hasXyoWalletInjectable() && 'provider' in globalThis.xyo
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export function getXyoProvider(options: { assert: true }):
|
|
23
|
-
export function getXyoProvider(options?: { assert?: boolean }):
|
|
22
|
+
export function getXyoProvider(options: { assert: true }): XyoConnection
|
|
23
|
+
export function getXyoProvider(options?: { assert?: boolean }): XyoConnection | undefined {
|
|
24
24
|
const { assert } = options ?? {}
|
|
25
25
|
if (hasXyoWalletProvider()) {
|
|
26
26
|
return globalThis.xyo.provider
|
package/src/types/XyoGlobal.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line sonarjs/deprecation
|
|
2
2
|
import type { ChainConnection } from '@xyo-network/chain-network-model'
|
|
3
3
|
import type {
|
|
4
|
-
XyoClient,
|
|
4
|
+
XyoClient, XyoConnection, XyoGatewayProvider,
|
|
5
5
|
} from '@xyo-network/xl1-protocol'
|
|
6
6
|
|
|
7
7
|
// TODO - add optional send method of type Transport
|
|
@@ -15,7 +15,7 @@ export interface XyoGlobal {
|
|
|
15
15
|
errors?: Error[]
|
|
16
16
|
gateway?: XyoGatewayProvider
|
|
17
17
|
/** @deprecated - use client gateways instead */
|
|
18
|
-
provider?:
|
|
18
|
+
provider?: XyoConnection
|
|
19
19
|
sessionId: () => string
|
|
20
20
|
/** @deprecated - use session id instead */
|
|
21
21
|
walletExtensionId: () => string
|