@getpara/graz-connector 0.1.0-alpha.0 → 0.1.0-alpha.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.
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
  var __async = (__this, __arguments, generator) => {
19
29
  return new Promise((resolve, reject) => {
@@ -37,13 +47,19 @@ var __async = (__this, __arguments, generator) => {
37
47
  };
38
48
  var Wallet_exports = {};
39
49
  __export(Wallet_exports, {
50
+ getParaClient: () => getParaClient,
40
51
  getParaGrazConnector: () => getParaGrazConnector
41
52
  });
42
53
  module.exports = __toCommonJS(Wallet_exports);
43
- const getParaGrazConnector = (config) => __async(void 0, null, function* () {
54
+ var import_react_sdk = __toESM(require("@getpara/react-sdk"));
55
+ const getParaClient = (config) => {
44
56
  if (!config || !config.apiKey || !config.env) {
45
57
  throw new Error("Para Connector: Missing API Key or Environment in config.");
46
58
  }
59
+ const client = new import_react_sdk.default(config.env, config.apiKey);
60
+ return client;
61
+ };
62
+ const getParaGrazConnector = (config) => __async(void 0, null, function* () {
47
63
  return {
48
64
  getOfflineSigner: (chainId) => {
49
65
  throw new Error("getOfflineSigner not implemented");
@@ -73,5 +89,6 @@ const getParaGrazConnector = (config) => __async(void 0, null, function* () {
73
89
  });
74
90
  // Annotate the CommonJS export names for ESM import in node:
75
91
  0 && (module.exports = {
92
+ getParaClient,
76
93
  getParaGrazConnector
77
94
  });
package/dist/cjs/index.js CHANGED
@@ -21,9 +21,8 @@ __export(src_exports, {
21
21
  AuthMethod: () => import_react_sdk.AuthMethod,
22
22
  Environment: () => import_react_sdk.Environment,
23
23
  OAuthMethod: () => import_react_sdk.OAuthMethod,
24
- ParaModal: () => import_react_sdk.ParaModal,
25
- ParaWeb: () => import_react_sdk.ParaWeb,
26
24
  WalletType: () => import_react_sdk.WalletType,
25
+ getParaClient: () => import_Wallet.getParaClient,
27
26
  getParaGrazConnector: () => import_Wallet.getParaGrazConnector
28
27
  });
29
28
  module.exports = __toCommonJS(src_exports);
@@ -35,8 +34,7 @@ var import_Wallet = require("./Wallet.js");
35
34
  AuthMethod,
36
35
  Environment,
37
36
  OAuthMethod,
38
- ParaModal,
39
- ParaWeb,
40
37
  WalletType,
38
+ getParaClient,
41
39
  getParaGrazConnector
42
40
  });
@@ -1,10 +1,15 @@
1
1
  import {
2
2
  __async
3
3
  } from "./chunk-4AFQP74Z.js";
4
- const getParaGrazConnector = (config) => __async(void 0, null, function* () {
4
+ import ParaWeb from "@getpara/react-sdk";
5
+ const getParaClient = (config) => {
5
6
  if (!config || !config.apiKey || !config.env) {
6
7
  throw new Error("Para Connector: Missing API Key or Environment in config.");
7
8
  }
9
+ const client = new ParaWeb(config.env, config.apiKey);
10
+ return client;
11
+ };
12
+ const getParaGrazConnector = (config) => __async(void 0, null, function* () {
8
13
  return {
9
14
  getOfflineSigner: (chainId) => {
10
15
  throw new Error("getOfflineSigner not implemented");
@@ -33,5 +38,6 @@ const getParaGrazConnector = (config) => __async(void 0, null, function* () {
33
38
  };
34
39
  });
35
40
  export {
41
+ getParaClient,
36
42
  getParaGrazConnector
37
43
  };
package/dist/esm/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import "./chunk-4AFQP74Z.js";
2
- import { ParaWeb, ParaModal, WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from "@getpara/react-sdk";
3
- import { getParaGrazConnector } from "./Wallet.js";
2
+ import { WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from "@getpara/react-sdk";
3
+ import { getParaGrazConnector, getParaClient } from "./Wallet.js";
4
4
  export {
5
5
  AuthLayout,
6
6
  AuthMethod,
7
7
  Environment,
8
8
  OAuthMethod,
9
- ParaModal,
10
- ParaWeb,
11
9
  WalletType,
10
+ getParaClient,
12
11
  getParaGrazConnector
13
12
  };
@@ -1,8 +1,9 @@
1
- import { Environment, ParaModalProps } from '@getpara/react-sdk';
1
+ import ParaWeb, { Environment, ParaModalProps } from '@getpara/react-sdk';
2
2
  import { Wallet } from 'graz';
3
3
  export interface ParaGrazConfig {
4
4
  apiKey: string;
5
5
  env: Environment;
6
6
  modalProps?: ParaModalProps;
7
7
  }
8
+ export declare const getParaClient: (config: ParaGrazConfig) => ParaWeb;
8
9
  export declare const getParaGrazConnector: (config: ParaGrazConfig) => Promise<Omit<Wallet, 'enable'>>;
@@ -1,4 +1,4 @@
1
- export { ParaWeb, ParaModal, WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from '@getpara/react-sdk';
2
- export type { ParaModalProps, ParaModalTheme, Wallet } from '@getpara/react-sdk';
3
- export { getParaGrazConnector } from './Wallet.js';
1
+ export { WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from '@getpara/react-sdk';
2
+ export type { ParaWeb, ParaModal, ParaModalProps, ParaModalTheme, Wallet } from '@getpara/react-sdk';
3
+ export { getParaGrazConnector, getParaClient } from './Wallet.js';
4
4
  export type { ParaGrazConfig } from './Wallet.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/graz-connector",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.2",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
package/src/Wallet.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Environment, ParaModalProps } from '@getpara/react-sdk';
1
+ import ParaWeb, { Environment, ParaModalProps } from '@getpara/react-sdk';
2
2
  import { Wallet } from 'graz';
3
3
 
4
4
  export interface ParaGrazConfig {
@@ -7,11 +7,15 @@ export interface ParaGrazConfig {
7
7
  modalProps?: ParaModalProps;
8
8
  }
9
9
 
10
- export const getParaGrazConnector = async (config: ParaGrazConfig): Promise<Omit<Wallet, 'enable'>> => {
10
+ export const getParaClient = (config: ParaGrazConfig): ParaWeb => {
11
11
  if (!config || !config.apiKey || !config.env) {
12
12
  throw new Error('Para Connector: Missing API Key or Environment in config.');
13
13
  }
14
+ const client = new ParaWeb(config.env, config.apiKey);
15
+ return client;
16
+ };
14
17
 
18
+ export const getParaGrazConnector = async (config: ParaGrazConfig): Promise<Omit<Wallet, 'enable'>> => {
15
19
  return {
16
20
  getOfflineSigner: (chainId: string) => {
17
21
  throw new Error('getOfflineSigner not implemented');
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { ParaWeb, ParaModal, WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from '@getpara/react-sdk';
2
- export type { ParaModalProps, ParaModalTheme, Wallet } from '@getpara/react-sdk';
3
- export { getParaGrazConnector } from './Wallet.js';
1
+ export { WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from '@getpara/react-sdk';
2
+ export type { ParaWeb, ParaModal, ParaModalProps, ParaModalTheme, Wallet } from '@getpara/react-sdk';
3
+ export { getParaGrazConnector, getParaClient } from './Wallet.js';
4
4
  export type { ParaGrazConfig } from './Wallet.js';