@getpara/graz-connector 0.1.0-alpha.1 → 0.1.0-alpha.3

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,125 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
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
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var __async = (__this, __arguments, generator) => {
29
+ return new Promise((resolve, reject) => {
30
+ var fulfilled = (value) => {
31
+ try {
32
+ step(generator.next(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ };
37
+ var rejected = (value) => {
38
+ try {
39
+ step(generator.throw(value));
40
+ } catch (e) {
41
+ reject(e);
42
+ }
43
+ };
44
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
+ step((generator = generator.apply(__this, __arguments)).next());
46
+ });
47
+ };
48
+ var ParaGrazProvider_exports = {};
49
+ __export(ParaGrazProvider_exports, {
50
+ ParaGrazInternalProvider: () => ParaGrazInternalProvider
51
+ });
52
+ module.exports = __toCommonJS(ParaGrazProvider_exports);
53
+ var import_react_sdk = __toESM(require("@getpara/react-sdk"));
54
+ var import_cosmjs_v0_integration = require("@getpara/cosmjs-v0-integration");
55
+ var import_encoding = require("@cosmjs/encoding");
56
+ class ParaGrazInternalProvider {
57
+ constructor(config) {
58
+ if (!config || !config.apiKey || !config.env) {
59
+ throw new Error("Para Connector: Missing API Key or Environment in config.");
60
+ }
61
+ this.config = config;
62
+ this.paraWebClient = new import_react_sdk.default(config.env, config.apiKey);
63
+ }
64
+ getKey(chainId) {
65
+ return __async(this, null, function* () {
66
+ const wallets = Object.values(this.paraWebClient.getWalletsByType("COSMOS"));
67
+ if (wallets.length === 0) {
68
+ throw new Error(`Para Connector: No wallets found for chainId ${chainId}`);
69
+ }
70
+ const walletSigner = new import_cosmjs_v0_integration.ParaProtoSigner(this.paraWebClient, wallets[0].id);
71
+ const accountData = yield walletSigner.getAccounts();
72
+ if (accountData.length === 0) {
73
+ throw new Error(`Para Connector: No accounts found for wallet ${wallets[0].id}`);
74
+ }
75
+ return {
76
+ address: (0, import_encoding.fromBech32)(accountData[0].address).data,
77
+ bech32Address: accountData[0].address,
78
+ algo: accountData[0].algo,
79
+ name: accountData[0].address,
80
+ pubKey: accountData[0].pubkey,
81
+ isKeystone: false,
82
+ isNanoLedger: false
83
+ };
84
+ });
85
+ }
86
+ getOfflineSigner(chainId) {
87
+ console.warn(`Para Connector: getOfflineSigner called for ${chainId} - Needs Implementation`);
88
+ throw new Error("getOfflineSigner not implemented");
89
+ }
90
+ getOfflineSignerOnlyAmino(chainId) {
91
+ console.warn(`Para Connector: getOfflineSignerOnlyAmino called for ${chainId} - Needs Implementation`);
92
+ throw new Error("getOfflineSignerOnlyAmino not implemented");
93
+ }
94
+ getOfflineSignerAuto(chainId) {
95
+ console.warn(`Para Connector: getOfflineSignerAuto called for ${chainId} - Needs Implementation`);
96
+ return this.getOfflineSignerOnlyAmino(chainId);
97
+ }
98
+ signAmino(chainId, signer, signDoc, signOptions) {
99
+ return __async(this, null, function* () {
100
+ console.warn(`Para Connector: signAmino called for ${chainId} - Needs Implementation`);
101
+ throw new Error("signAmino not implemented");
102
+ });
103
+ }
104
+ signDirect(chainId, signer, signDoc, signOptions) {
105
+ return __async(this, null, function* () {
106
+ console.warn(`Para Connector: signDirect called for ${chainId} - Needs Implementation`);
107
+ throw new Error("signDirect not implemented");
108
+ });
109
+ }
110
+ signArbitrary(chainId, signer, data) {
111
+ return __async(this, null, function* () {
112
+ console.warn(`Para Connector: signArbitrary called for ${chainId} - Needs Implementation`);
113
+ throw new Error("signArbitrary not implemented");
114
+ });
115
+ }
116
+ disconnect() {
117
+ return __async(this, null, function* () {
118
+ yield this.paraWebClient.logout();
119
+ });
120
+ }
121
+ }
122
+ // Annotate the CommonJS export names for ESM import in node:
123
+ 0 && (module.exports = {
124
+ ParaGrazInternalProvider
125
+ });
package/dist/cjs/index.js CHANGED
@@ -21,18 +21,18 @@ __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
- WalletType: () => import_react_sdk.WalletType,
25
- getParaGrazConnector: () => import_Wallet.getParaGrazConnector
24
+ ParaGrazInternalProvider: () => import_ParaGrazProvider.ParaGrazInternalProvider,
25
+ WalletType: () => import_react_sdk.WalletType
26
26
  });
27
27
  module.exports = __toCommonJS(src_exports);
28
28
  var import_react_sdk = require("@getpara/react-sdk");
29
- var import_Wallet = require("./Wallet.js");
29
+ var import_ParaGrazProvider = require("./ParaGrazProvider.js");
30
30
  // Annotate the CommonJS export names for ESM import in node:
31
31
  0 && (module.exports = {
32
32
  AuthLayout,
33
33
  AuthMethod,
34
34
  Environment,
35
35
  OAuthMethod,
36
- WalletType,
37
- getParaGrazConnector
36
+ ParaGrazInternalProvider,
37
+ WalletType
38
38
  });
@@ -0,0 +1,75 @@
1
+ import {
2
+ __async
3
+ } from "./chunk-4AFQP74Z.js";
4
+ import ParaWeb from "@getpara/react-sdk";
5
+ import { ParaProtoSigner } from "@getpara/cosmjs-v0-integration";
6
+ import { fromBech32 } from "@cosmjs/encoding";
7
+ class ParaGrazInternalProvider {
8
+ constructor(config) {
9
+ if (!config || !config.apiKey || !config.env) {
10
+ throw new Error("Para Connector: Missing API Key or Environment in config.");
11
+ }
12
+ this.config = config;
13
+ this.paraWebClient = new ParaWeb(config.env, config.apiKey);
14
+ }
15
+ getKey(chainId) {
16
+ return __async(this, null, function* () {
17
+ const wallets = Object.values(this.paraWebClient.getWalletsByType("COSMOS"));
18
+ if (wallets.length === 0) {
19
+ throw new Error(`Para Connector: No wallets found for chainId ${chainId}`);
20
+ }
21
+ const walletSigner = new ParaProtoSigner(this.paraWebClient, wallets[0].id);
22
+ const accountData = yield walletSigner.getAccounts();
23
+ if (accountData.length === 0) {
24
+ throw new Error(`Para Connector: No accounts found for wallet ${wallets[0].id}`);
25
+ }
26
+ return {
27
+ address: fromBech32(accountData[0].address).data,
28
+ bech32Address: accountData[0].address,
29
+ algo: accountData[0].algo,
30
+ name: accountData[0].address,
31
+ pubKey: accountData[0].pubkey,
32
+ isKeystone: false,
33
+ isNanoLedger: false
34
+ };
35
+ });
36
+ }
37
+ getOfflineSigner(chainId) {
38
+ console.warn(`Para Connector: getOfflineSigner called for ${chainId} - Needs Implementation`);
39
+ throw new Error("getOfflineSigner not implemented");
40
+ }
41
+ getOfflineSignerOnlyAmino(chainId) {
42
+ console.warn(`Para Connector: getOfflineSignerOnlyAmino called for ${chainId} - Needs Implementation`);
43
+ throw new Error("getOfflineSignerOnlyAmino not implemented");
44
+ }
45
+ getOfflineSignerAuto(chainId) {
46
+ console.warn(`Para Connector: getOfflineSignerAuto called for ${chainId} - Needs Implementation`);
47
+ return this.getOfflineSignerOnlyAmino(chainId);
48
+ }
49
+ signAmino(chainId, signer, signDoc, signOptions) {
50
+ return __async(this, null, function* () {
51
+ console.warn(`Para Connector: signAmino called for ${chainId} - Needs Implementation`);
52
+ throw new Error("signAmino not implemented");
53
+ });
54
+ }
55
+ signDirect(chainId, signer, signDoc, signOptions) {
56
+ return __async(this, null, function* () {
57
+ console.warn(`Para Connector: signDirect called for ${chainId} - Needs Implementation`);
58
+ throw new Error("signDirect not implemented");
59
+ });
60
+ }
61
+ signArbitrary(chainId, signer, data) {
62
+ return __async(this, null, function* () {
63
+ console.warn(`Para Connector: signArbitrary called for ${chainId} - Needs Implementation`);
64
+ throw new Error("signArbitrary not implemented");
65
+ });
66
+ }
67
+ disconnect() {
68
+ return __async(this, null, function* () {
69
+ yield this.paraWebClient.logout();
70
+ });
71
+ }
72
+ }
73
+ export {
74
+ ParaGrazInternalProvider
75
+ };
package/dist/esm/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import "./chunk-4AFQP74Z.js";
2
2
  import { WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from "@getpara/react-sdk";
3
- import { getParaGrazConnector } from "./Wallet.js";
3
+ import { ParaGrazInternalProvider } from "./ParaGrazProvider.js";
4
4
  export {
5
5
  AuthLayout,
6
6
  AuthMethod,
7
7
  Environment,
8
8
  OAuthMethod,
9
- WalletType,
10
- getParaGrazConnector
9
+ ParaGrazInternalProvider,
10
+ WalletType
11
11
  };
@@ -0,0 +1,24 @@
1
+ import type { Environment, ParaModalProps } from '@getpara/react-sdk';
2
+ import type { Key as GrazKey } from 'graz';
3
+ import type { OfflineAminoSigner, OfflineDirectSigner, AminoSignResponse, StdSignDoc, StdSignature } from '@keplr-wallet/types';
4
+ export interface ParaGrazConfig {
5
+ apiKey: string;
6
+ env: Environment;
7
+ modalProps?: ParaModalProps;
8
+ }
9
+ export declare class ParaGrazInternalProvider {
10
+ private paraWebClient;
11
+ private config;
12
+ constructor(config: ParaGrazConfig);
13
+ getKey(chainId: string): Promise<GrazKey>;
14
+ getOfflineSigner(chainId: string): Promise<OfflineAminoSigner & OfflineDirectSigner>;
15
+ getOfflineSignerOnlyAmino(chainId: string): Promise<OfflineAminoSigner>;
16
+ getOfflineSignerAuto(chainId: string): Promise<OfflineAminoSigner | OfflineDirectSigner>;
17
+ signAmino(chainId: string, signer: string, signDoc: StdSignDoc, signOptions?: any): Promise<AminoSignResponse>;
18
+ signDirect(chainId: string, signer: string, signDoc: any, signOptions?: any): Promise<{
19
+ signed: any;
20
+ signature: StdSignature;
21
+ }>;
22
+ signArbitrary(chainId: string, signer: string, data: string | Uint8Array): Promise<StdSignature>;
23
+ disconnect(): Promise<void>;
24
+ }
@@ -1,4 +1,4 @@
1
1
  export { WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from '@getpara/react-sdk';
2
2
  export type { ParaWeb, ParaModal, ParaModalProps, ParaModalTheme, Wallet } from '@getpara/react-sdk';
3
- export { getParaGrazConnector } from './Wallet.js';
4
- export type { ParaGrazConfig } from './Wallet.js';
3
+ export { ParaGrazInternalProvider } from './ParaGrazProvider.js';
4
+ export type { ParaGrazConfig } from './ParaGrazProvider.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/graz-connector",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.3",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -0,0 +1,94 @@
1
+ import ParaWeb from '@getpara/react-sdk';
2
+ import type { Environment, ParaModalProps } from '@getpara/react-sdk';
3
+ import type { Wallet, Key as GrazKey } from 'graz';
4
+ import type {
5
+ OfflineAminoSigner,
6
+ OfflineDirectSigner,
7
+ AminoSignResponse,
8
+ StdSignDoc,
9
+ StdSignature,
10
+ } from '@keplr-wallet/types';
11
+ import { ParaAminoSigner, ParaProtoSigner } from '@getpara/cosmjs-v0-integration';
12
+ import { fromBech32 } from '@cosmjs/encoding';
13
+
14
+ export interface ParaGrazConfig {
15
+ apiKey: string;
16
+ env: Environment;
17
+ modalProps?: ParaModalProps;
18
+ }
19
+
20
+ export class ParaGrazInternalProvider /* implements NeededWalletMethods */ {
21
+ private paraWebClient: ParaWeb;
22
+ private config: ParaGrazConfig;
23
+
24
+ constructor(config: ParaGrazConfig) {
25
+ if (!config || !config.apiKey || !config.env) {
26
+ throw new Error('Para Connector: Missing API Key or Environment in config.');
27
+ }
28
+ this.config = config;
29
+ this.paraWebClient = new ParaWeb(config.env, config.apiKey);
30
+ }
31
+
32
+ async getKey(chainId: string): Promise<GrazKey> {
33
+ const wallets = Object.values(this.paraWebClient.getWalletsByType('COSMOS'));
34
+
35
+ if (wallets.length === 0) {
36
+ throw new Error(`Para Connector: No wallets found for chainId ${chainId}`);
37
+ }
38
+
39
+ const walletSigner = new ParaProtoSigner(this.paraWebClient, wallets[0].id);
40
+ const accountData = await walletSigner.getAccounts();
41
+ if (accountData.length === 0) {
42
+ throw new Error(`Para Connector: No accounts found for wallet ${wallets[0].id}`);
43
+ }
44
+
45
+ return {
46
+ address: fromBech32(accountData[0].address).data,
47
+ bech32Address: accountData[0].address,
48
+ algo: accountData[0].algo,
49
+ name: accountData[0].address,
50
+ pubKey: accountData[0].pubkey,
51
+ isKeystone: false,
52
+ isNanoLedger: false,
53
+ };
54
+ }
55
+
56
+ getOfflineSigner(chainId: string): Promise<OfflineAminoSigner & OfflineDirectSigner> {
57
+ console.warn(`Para Connector: getOfflineSigner called for ${chainId} - Needs Implementation`);
58
+ throw new Error('getOfflineSigner not implemented');
59
+ }
60
+
61
+ getOfflineSignerOnlyAmino(chainId: string): Promise<OfflineAminoSigner> {
62
+ console.warn(`Para Connector: getOfflineSignerOnlyAmino called for ${chainId} - Needs Implementation`);
63
+ throw new Error('getOfflineSignerOnlyAmino not implemented');
64
+ }
65
+
66
+ getOfflineSignerAuto(chainId: string): Promise<OfflineAminoSigner | OfflineDirectSigner> {
67
+ console.warn(`Para Connector: getOfflineSignerAuto called for ${chainId} - Needs Implementation`);
68
+ return this.getOfflineSignerOnlyAmino(chainId);
69
+ }
70
+
71
+ async signAmino(chainId: string, signer: string, signDoc: StdSignDoc, signOptions?: any): Promise<AminoSignResponse> {
72
+ console.warn(`Para Connector: signAmino called for ${chainId} - Needs Implementation`);
73
+ throw new Error('signAmino not implemented');
74
+ }
75
+
76
+ async signDirect(
77
+ chainId: string,
78
+ signer: string,
79
+ signDoc: any,
80
+ signOptions?: any,
81
+ ): Promise<{ signed: any; signature: StdSignature }> {
82
+ console.warn(`Para Connector: signDirect called for ${chainId} - Needs Implementation`);
83
+ throw new Error('signDirect not implemented');
84
+ }
85
+
86
+ async signArbitrary(chainId: string, signer: string, data: string | Uint8Array): Promise<StdSignature> {
87
+ console.warn(`Para Connector: signArbitrary called for ${chainId} - Needs Implementation`);
88
+ throw new Error('signArbitrary not implemented');
89
+ }
90
+
91
+ async disconnect(): Promise<void> {
92
+ await this.paraWebClient.logout();
93
+ }
94
+ }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { WalletType, AuthLayout, AuthMethod, OAuthMethod, Environment } from '@getpara/react-sdk';
2
2
  export type { ParaWeb, ParaModal, ParaModalProps, ParaModalTheme, Wallet } from '@getpara/react-sdk';
3
- export { getParaGrazConnector } from './Wallet.js';
4
- export type { ParaGrazConfig } from './Wallet.js';
3
+ export { ParaGrazInternalProvider } from './ParaGrazProvider.js';
4
+ export type { ParaGrazConfig } from './ParaGrazProvider.js';
@@ -1,94 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
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
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
- var Wallet_exports = {};
49
- __export(Wallet_exports, {
50
- getParaClient: () => getParaClient,
51
- getParaGrazConnector: () => getParaGrazConnector
52
- });
53
- module.exports = __toCommonJS(Wallet_exports);
54
- var import_react_sdk = __toESM(require("@getpara/react-sdk"));
55
- const getParaClient = (config) => {
56
- if (!config || !config.apiKey || !config.env) {
57
- throw new Error("Para Connector: Missing API Key or Environment in config.");
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* () {
63
- return {
64
- getOfflineSigner: (chainId) => {
65
- throw new Error("getOfflineSigner not implemented");
66
- },
67
- getOfflineSignerAuto: (chainId) => {
68
- throw new Error("getOfflineSignerAuto not implemented");
69
- },
70
- getOfflineSignerOnlyAmino: (chainId) => {
71
- throw new Error("getOfflineSignerOnlyAmino not implemented");
72
- },
73
- signDirect: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
74
- throw new Error("signDirect not implemented");
75
- }),
76
- signAmino: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
77
- throw new Error("signAmino not implemented");
78
- }),
79
- signArbitrary: (chainId, signerAddress, data) => __async(void 0, null, function* () {
80
- throw new Error("signArbitrary not implemented");
81
- }),
82
- experimentalSuggestChain: (chainInfo) => __async(void 0, null, function* () {
83
- throw new Error("experimentalSuggestChain not implemented");
84
- }),
85
- getKey: (chainId) => __async(void 0, null, function* () {
86
- throw new Error("getKey not implemented");
87
- })
88
- };
89
- });
90
- // Annotate the CommonJS export names for ESM import in node:
91
- 0 && (module.exports = {
92
- getParaClient,
93
- getParaGrazConnector
94
- });
@@ -1,43 +0,0 @@
1
- import {
2
- __async
3
- } from "./chunk-4AFQP74Z.js";
4
- import ParaWeb from "@getpara/react-sdk";
5
- const getParaClient = (config) => {
6
- if (!config || !config.apiKey || !config.env) {
7
- throw new Error("Para Connector: Missing API Key or Environment in config.");
8
- }
9
- const client = new ParaWeb(config.env, config.apiKey);
10
- return client;
11
- };
12
- const getParaGrazConnector = (config) => __async(void 0, null, function* () {
13
- return {
14
- getOfflineSigner: (chainId) => {
15
- throw new Error("getOfflineSigner not implemented");
16
- },
17
- getOfflineSignerAuto: (chainId) => {
18
- throw new Error("getOfflineSignerAuto not implemented");
19
- },
20
- getOfflineSignerOnlyAmino: (chainId) => {
21
- throw new Error("getOfflineSignerOnlyAmino not implemented");
22
- },
23
- signDirect: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
24
- throw new Error("signDirect not implemented");
25
- }),
26
- signAmino: (chainId, signerAddress, signDoc) => __async(void 0, null, function* () {
27
- throw new Error("signAmino not implemented");
28
- }),
29
- signArbitrary: (chainId, signerAddress, data) => __async(void 0, null, function* () {
30
- throw new Error("signArbitrary not implemented");
31
- }),
32
- experimentalSuggestChain: (chainInfo) => __async(void 0, null, function* () {
33
- throw new Error("experimentalSuggestChain not implemented");
34
- }),
35
- getKey: (chainId) => __async(void 0, null, function* () {
36
- throw new Error("getKey not implemented");
37
- })
38
- };
39
- });
40
- export {
41
- getParaClient,
42
- getParaGrazConnector
43
- };
@@ -1,9 +0,0 @@
1
- import ParaWeb, { 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 getParaClient: (config: ParaGrazConfig) => ParaWeb;
9
- export declare const getParaGrazConnector: (config: ParaGrazConfig) => Promise<Omit<Wallet, 'enable'>>;
package/src/Wallet.ts DELETED
@@ -1,45 +0,0 @@
1
- import ParaWeb, { 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 getParaClient = (config: ParaGrazConfig): ParaWeb => {
11
- if (!config || !config.apiKey || !config.env) {
12
- throw new Error('Para Connector: Missing API Key or Environment in config.');
13
- }
14
- const client = new ParaWeb(config.env, config.apiKey);
15
- return client;
16
- };
17
-
18
- export const getParaGrazConnector = async (config: ParaGrazConfig): Promise<Omit<Wallet, 'enable'>> => {
19
- return {
20
- getOfflineSigner: (chainId: string) => {
21
- throw new Error('getOfflineSigner not implemented');
22
- },
23
- getOfflineSignerAuto: (chainId: string) => {
24
- throw new Error('getOfflineSignerAuto not implemented');
25
- },
26
- getOfflineSignerOnlyAmino: (chainId: string) => {
27
- throw new Error('getOfflineSignerOnlyAmino not implemented');
28
- },
29
- signDirect: async (chainId: string, signerAddress: string, signDoc: any) => {
30
- throw new Error('signDirect not implemented');
31
- },
32
- signAmino: async (chainId: string, signerAddress: string, signDoc: any) => {
33
- throw new Error('signAmino not implemented');
34
- },
35
- signArbitrary: async (chainId: string, signerAddress: string, data: string) => {
36
- throw new Error('signArbitrary not implemented');
37
- },
38
- experimentalSuggestChain: async (chainInfo: any) => {
39
- throw new Error('experimentalSuggestChain not implemented');
40
- },
41
- getKey: async (chainId: string) => {
42
- throw new Error('getKey not implemented');
43
- },
44
- };
45
- };