@getpara/graz-connector 0.1.0-alpha.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.
@@ -0,0 +1,77 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var __async = (__this, __arguments, generator) => {
19
+ return new Promise((resolve, reject) => {
20
+ var fulfilled = (value) => {
21
+ try {
22
+ step(generator.next(value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ };
27
+ var rejected = (value) => {
28
+ try {
29
+ step(generator.throw(value));
30
+ } catch (e) {
31
+ reject(e);
32
+ }
33
+ };
34
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35
+ step((generator = generator.apply(__this, __arguments)).next());
36
+ });
37
+ };
38
+ var Wallet_exports = {};
39
+ __export(Wallet_exports, {
40
+ getParaGrazConnector: () => getParaGrazConnector
41
+ });
42
+ module.exports = __toCommonJS(Wallet_exports);
43
+ const getParaGrazConnector = (config) => __async(void 0, null, function* () {
44
+ if (!config || !config.apiKey || !config.env) {
45
+ throw new Error("Para Connector: Missing API Key or Environment in config.");
46
+ }
47
+ return {
48
+ getOfflineSigner: (chainId) => {
49
+ throw new Error("getOfflineSigner not implemented");
50
+ },
51
+ getOfflineSignerAuto: (chainId) => {
52
+ throw new Error("getOfflineSignerAuto not implemented");
53
+ },
54
+ getOfflineSignerOnlyAmino: (chainId) => {
55
+ throw new Error("getOfflineSignerOnlyAmino not implemented");
56
+ },
57
+ signDirect: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
58
+ throw new Error("signDirect not implemented");
59
+ }),
60
+ signAmino: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
61
+ throw new Error("signAmino not implemented");
62
+ }),
63
+ signArbitrary: (chainId, signerAddress, data) => __async(void 0, null, function* () {
64
+ throw new Error("signArbitrary not implemented");
65
+ }),
66
+ experimentalSuggestChain: (chainInfo) => __async(void 0, null, function* () {
67
+ throw new Error("experimentalSuggestChain not implemented");
68
+ }),
69
+ getKey: (chainId) => __async(void 0, null, function* () {
70
+ throw new Error("getKey not implemented");
71
+ })
72
+ };
73
+ });
74
+ // Annotate the CommonJS export names for ESM import in node:
75
+ 0 && (module.exports = {
76
+ getParaGrazConnector
77
+ });
@@ -0,0 +1,42 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var src_exports = {};
19
+ __export(src_exports, {
20
+ AuthLayout: () => import_react_sdk.AuthLayout,
21
+ AuthMethod: () => import_react_sdk.AuthMethod,
22
+ Environment: () => import_react_sdk.Environment,
23
+ OAuthMethod: () => import_react_sdk.OAuthMethod,
24
+ ParaModal: () => import_react_sdk.ParaModal,
25
+ ParaWeb: () => import_react_sdk.ParaWeb,
26
+ WalletType: () => import_react_sdk.WalletType,
27
+ getParaGrazConnector: () => import_Wallet.getParaGrazConnector
28
+ });
29
+ module.exports = __toCommonJS(src_exports);
30
+ var import_react_sdk = require("@getpara/react-sdk");
31
+ var import_Wallet = require("./Wallet.js");
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ AuthLayout,
35
+ AuthMethod,
36
+ Environment,
37
+ OAuthMethod,
38
+ ParaModal,
39
+ ParaWeb,
40
+ WalletType,
41
+ getParaGrazConnector
42
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,37 @@
1
+ import {
2
+ __async
3
+ } from "./chunk-4AFQP74Z.js";
4
+ const getParaGrazConnector = (config) => __async(void 0, null, function* () {
5
+ if (!config || !config.apiKey || !config.env) {
6
+ throw new Error("Para Connector: Missing API Key or Environment in config.");
7
+ }
8
+ return {
9
+ getOfflineSigner: (chainId) => {
10
+ throw new Error("getOfflineSigner not implemented");
11
+ },
12
+ getOfflineSignerAuto: (chainId) => {
13
+ throw new Error("getOfflineSignerAuto not implemented");
14
+ },
15
+ getOfflineSignerOnlyAmino: (chainId) => {
16
+ throw new Error("getOfflineSignerOnlyAmino not implemented");
17
+ },
18
+ signDirect: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
19
+ throw new Error("signDirect not implemented");
20
+ }),
21
+ signAmino: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
22
+ throw new Error("signAmino not implemented");
23
+ }),
24
+ signArbitrary: (chainId, signerAddress, data) => __async(void 0, null, function* () {
25
+ throw new Error("signArbitrary not implemented");
26
+ }),
27
+ experimentalSuggestChain: (chainInfo) => __async(void 0, null, function* () {
28
+ throw new Error("experimentalSuggestChain not implemented");
29
+ }),
30
+ getKey: (chainId) => __async(void 0, null, function* () {
31
+ throw new Error("getKey not implemented");
32
+ })
33
+ };
34
+ });
35
+ export {
36
+ getParaGrazConnector
37
+ };
@@ -0,0 +1,24 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+
22
+ export {
23
+ __async
24
+ };
@@ -0,0 +1,13 @@
1
+ import "./chunk-4AFQP74Z.js";
2
+ import { ParaWeb, ParaModal, WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from "@getpara/react-sdk";
3
+ import { getParaGrazConnector } from "./Wallet.js";
4
+ export {
5
+ AuthLayout,
6
+ AuthMethod,
7
+ Environment,
8
+ OAuthMethod,
9
+ ParaModal,
10
+ ParaWeb,
11
+ WalletType,
12
+ getParaGrazConnector
13
+ };
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": false
4
+ }
@@ -0,0 +1,8 @@
1
+ import { Environment, ParaModalProps } from '@getpara/react-sdk';
2
+ import { Wallet } from 'graz';
3
+ export interface ParaGrazConfig {
4
+ apiKey: string;
5
+ env: Environment;
6
+ modalProps?: ParaModalProps;
7
+ }
8
+ export declare const getParaGrazConnector: (config: ParaGrazConfig) => Promise<Omit<Wallet, 'enable'>>;
@@ -0,0 +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';
4
+ export type { ParaGrazConfig } from './Wallet.js';
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@getpara/graz-connector",
3
+ "version": "0.1.0-alpha.0",
4
+ "main": "dist/cjs/index.js",
5
+ "module": "dist/esm/index.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "typings": "dist/types/index.d.ts",
8
+ "sideEffects": false,
9
+ "dependencies": {
10
+ "@getpara/react-sdk": "1.11.0",
11
+ "@getpara/cosmjs-v0-integration": "1.11.0"
12
+ },
13
+ "scripts": {
14
+ "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
15
+ "old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
16
+ "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
17
+ "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
18
+ "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration"
19
+ },
20
+ "devDependencies": {
21
+ "@cosmjs/amino": "^0.32.3",
22
+ "@cosmjs/encoding": "^0.32.3",
23
+ "@cosmjs/proto-signing": "^0.32.3",
24
+ "cosmjs-types": "0.9.0",
25
+ "typescript": "5.1.6",
26
+ "graz": "0.2.1",
27
+ "@keplr-wallet/types": "0.12.221"
28
+ }
29
+ }
@@ -0,0 +1,51 @@
1
+ import * as esbuild from 'esbuild';
2
+ import * as fs from 'fs/promises';
3
+ import * as path from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname } from 'path';
6
+ import { glob } from 'glob';
7
+
8
+ const entryPoints = await glob('src/**/*.{ts,tsx,js,jsx}');
9
+
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
11
+ const distDir = path.resolve(__dirname, '../dist');
12
+
13
+ await fs.mkdir(`${distDir}/cjs`, { recursive: true });
14
+ await fs.writeFile(`${distDir}/cjs/package.json`, JSON.stringify({ type: 'commonjs' }, null, 2));
15
+
16
+ await fs.mkdir(`${distDir}/esm`, { recursive: true });
17
+ await fs.writeFile(`${distDir}/esm/package.json`, JSON.stringify({ type: 'module', sideEffects: false }, null, 2));
18
+
19
+ /** @type {import('esbuild').BuildOptions} */
20
+ await esbuild.build({
21
+ bundle: false,
22
+ write: true,
23
+ format: 'esm',
24
+ loader: {
25
+ '.json': 'text',
26
+ },
27
+ platform: 'browser',
28
+ entryPoints,
29
+ outdir: 'dist/esm',
30
+ allowOverwrite: true,
31
+ splitting: true, // Required for tree shaking
32
+ minify: false,
33
+ target: ['es2015'],
34
+ packages: 'external',
35
+ });
36
+
37
+ await esbuild.build({
38
+ bundle: false,
39
+ write: true,
40
+ format: 'cjs',
41
+ loader: {
42
+ '.json': 'text',
43
+ },
44
+ platform: 'node',
45
+ entryPoints,
46
+ outdir: 'dist/cjs',
47
+ allowOverwrite: true,
48
+ minify: false,
49
+ target: ['es2015'],
50
+ packages: 'external',
51
+ });
package/src/Wallet.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { Environment, ParaModalProps } from '@getpara/react-sdk';
2
+ import { Wallet } from 'graz';
3
+
4
+ export interface ParaGrazConfig {
5
+ apiKey: string;
6
+ env: Environment;
7
+ modalProps?: ParaModalProps;
8
+ }
9
+
10
+ export const getParaGrazConnector = async (config: ParaGrazConfig): Promise<Omit<Wallet, 'enable'>> => {
11
+ if (!config || !config.apiKey || !config.env) {
12
+ throw new Error('Para Connector: Missing API Key or Environment in config.');
13
+ }
14
+
15
+ return {
16
+ getOfflineSigner: (chainId: string) => {
17
+ throw new Error('getOfflineSigner not implemented');
18
+ },
19
+ getOfflineSignerAuto: (chainId: string) => {
20
+ throw new Error('getOfflineSignerAuto not implemented');
21
+ },
22
+ getOfflineSignerOnlyAmino: (chainId: string) => {
23
+ throw new Error('getOfflineSignerOnlyAmino not implemented');
24
+ },
25
+ signDirect: async (chainId: string, signerAddress: string, signDoc: any) => {
26
+ throw new Error('signDirect not implemented');
27
+ },
28
+ signAmino: async (chainId: string, signerAddress: string, signDoc: any) => {
29
+ throw new Error('signAmino not implemented');
30
+ },
31
+ signArbitrary: async (chainId: string, signerAddress: string, data: string) => {
32
+ throw new Error('signArbitrary not implemented');
33
+ },
34
+ experimentalSuggestChain: async (chainInfo: any) => {
35
+ throw new Error('experimentalSuggestChain not implemented');
36
+ },
37
+ getKey: async (chainId: string) => {
38
+ throw new Error('getKey not implemented');
39
+ },
40
+ };
41
+ };
package/src/index.ts ADDED
@@ -0,0 +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';
4
+ export type { ParaGrazConfig } from './Wallet.js';
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "declaration": false,
5
+ "outDir": "./dist"
6
+ },
7
+ "include": ["**/*.ts"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }