decentralcardgame-cardchain-client-ts 0.0.27 → 0.0.29

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,110 +1,112 @@
1
1
  // Generated by Ignite ignite.com/cli
2
2
 
3
- import { StdFee } from "@cosmjs/amino";
4
- import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate";
5
- import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing";
6
- import { msgTypes } from './registry';
7
- import { IgniteClient } from "../client"
8
- import { MissingWalletError } from "../helpers"
9
- import { Api } from "./rest";
3
+ import {StdFee} from "@cosmjs/amino";
4
+ import {SigningStargateClient, DeliverTxResponse} from "@cosmjs/stargate";
5
+ import {EncodeObject, GeneratedType, OfflineSigner, Registry} from "@cosmjs/proto-signing";
6
+ import {msgTypes} from './registry';
7
+ import {IgniteClient} from "../client"
8
+ import {MissingWalletError} from "../helpers"
9
+ import {Api} from "./rest";
10
10
 
11
- import { ConnectionEnd as typeConnectionEnd} from "./types"
12
- import { IdentifiedConnection as typeIdentifiedConnection} from "./types"
13
- import { Counterparty as typeCounterparty} from "./types"
14
- import { ClientPaths as typeClientPaths} from "./types"
15
- import { ConnectionPaths as typeConnectionPaths} from "./types"
16
- import { Version as typeVersion} from "./types"
17
- import { Params as typeParams} from "./types"
18
-
19
- export { };
11
+ import {ConnectionEnd as typeConnectionEnd} from "./types"
12
+ import {IdentifiedConnection as typeIdentifiedConnection} from "./types"
13
+ import {Counterparty as typeCounterparty} from "./types"
14
+ import {ClientPaths as typeClientPaths} from "./types"
15
+ import {ConnectionPaths as typeConnectionPaths} from "./types"
16
+ import {Version as typeVersion} from "./types"
17
+ import {Params as typeParams} from "./types"
20
18
 
19
+ export {};
21
20
 
22
21
 
23
22
  export const registry = new Registry(msgTypes);
24
23
 
25
24
  type Field = {
26
- name: string;
27
- type: unknown;
25
+ name: string;
26
+ type: unknown;
28
27
  }
28
+
29
29
  function getStructure(template) {
30
- const structure: {fields: Field[]} = { fields: [] }
31
- for (let [key, value] of Object.entries(template)) {
32
- let field = { name: key, type: typeof value }
33
- structure.fields.push(field)
34
- }
35
- return structure
30
+ const structure: { fields: Field[] } = {fields: []}
31
+ for (let [key, value] of Object.entries(template)) {
32
+ let field = {name: key, type: typeof value}
33
+ structure.fields.push(field)
34
+ }
35
+ return structure
36
36
  }
37
+
37
38
  const defaultFee = {
38
- amount: [],
39
- gas: "200000",
39
+ amount: [],
40
+ gas: "200000",
40
41
  };
41
42
 
42
43
  interface TxClientOptions {
43
- addr: string
44
- prefix: string
45
- signer?: OfflineSigner
44
+ addr: string
45
+ prefix: string
46
+ signer?: OfflineSigner
46
47
  }
47
48
 
48
- export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
49
+ export const txClient = ({signer, prefix, addr}: TxClientOptions = {
50
+ addr: "http://localhost:26657",
51
+ prefix: "cosmos"
52
+ }) => {
49
53
 
50
- return {
51
-
52
-
53
- }
54
+ return {}
54
55
  };
55
56
 
56
57
  interface QueryClientOptions {
57
- addr: string
58
+ addr: string
58
59
  }
59
60
 
60
- export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
61
- return new Api({ baseURL: addr });
61
+ export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
62
+ return new Api({baseURL: addr});
62
63
  };
63
64
 
64
65
  class SDKModule {
65
- public query: ReturnType<typeof queryClient>;
66
- public tx: ReturnType<typeof txClient>;
67
- public structure: Record<string,unknown>;
68
- public registry: Array<[string, GeneratedType]> = [];
69
-
70
- constructor(client: IgniteClient) {
71
-
72
- this.query = queryClient({ addr: client.env.apiURL });
73
- this.updateTX(client);
74
- this.structure = {
75
- ConnectionEnd: getStructure(typeConnectionEnd.fromPartial({})),
76
- IdentifiedConnection: getStructure(typeIdentifiedConnection.fromPartial({})),
77
- Counterparty: getStructure(typeCounterparty.fromPartial({})),
78
- ClientPaths: getStructure(typeClientPaths.fromPartial({})),
79
- ConnectionPaths: getStructure(typeConnectionPaths.fromPartial({})),
80
- Version: getStructure(typeVersion.fromPartial({})),
81
- Params: getStructure(typeParams.fromPartial({})),
82
-
83
- };
84
- client.on('signer-changed',(signer) => {
85
- this.updateTX(client);
86
- })
87
- }
88
- updateTX(client: IgniteClient) {
89
- const methods = txClient({
90
- signer: client.signer,
91
- addr: client.env.rpcURL,
92
- prefix: client.env.prefix ?? "cosmos",
93
- })
94
-
95
- this.tx = methods;
96
- for (let m in methods) {
97
- this.tx[m] = methods[m].bind(this.tx);
66
+ public query: ReturnType<typeof queryClient>;
67
+ public tx: ReturnType<typeof txClient>;
68
+ public structure: Record<string, unknown>;
69
+ public registry: Array<[string, GeneratedType]> = [];
70
+
71
+ constructor(client: IgniteClient) {
72
+
73
+ this.query = queryClient({addr: client.env.apiURL});
74
+ this.updateTX(client);
75
+ this.structure = {
76
+ ConnectionEnd: getStructure(typeConnectionEnd.fromPartial({})),
77
+ IdentifiedConnection: getStructure(typeIdentifiedConnection.fromPartial({})),
78
+ Counterparty: getStructure(typeCounterparty.fromPartial({})),
79
+ ClientPaths: getStructure(typeClientPaths.fromPartial({})),
80
+ ConnectionPaths: getStructure(typeConnectionPaths.fromPartial({})),
81
+ Version: getStructure(typeVersion.fromPartial({})),
82
+ Params: getStructure(typeParams.fromPartial({})),
83
+
84
+ };
85
+ client.on('signer-changed', (signer) => {
86
+ this.updateTX(client);
87
+ })
88
+ }
89
+
90
+ updateTX(client: IgniteClient) {
91
+ const methods = txClient({
92
+ signer: client.signer,
93
+ addr: client.env.rpcURL,
94
+ prefix: client.env.prefix ?? "cosmos",
95
+ })
96
+
97
+ this.tx = methods;
98
+ for (let m in methods) {
99
+ this.tx[m] = methods[m].bind(this.tx);
100
+ }
98
101
  }
99
- }
100
102
  };
101
103
 
102
104
  const Module = (test: IgniteClient) => {
103
- return {
104
- module: {
105
- IbcCoreConnectionV1: new SDKModule(test)
106
- },
107
- registry: msgTypes
108
- }
105
+ return {
106
+ module: {
107
+ IbcCoreConnectionV1: new SDKModule(test)
108
+ },
109
+ registry: msgTypes
110
+ }
109
111
  }
110
112
  export default Module;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decentralcardgame-cardchain-client-ts",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "Autogenerated Typescript Client for crowdcontrol cardchain",
5
5
  "author": "Lxgr <lxgr@protonmail.com>",
6
6
  "license": "GPL-v3",
@@ -8,6 +8,9 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
+ "scripts": {
12
+ "build": "tsc"
13
+ },
11
14
  "dependencies": {
12
15
  "@cosmjs/amino": "0.29.5",
13
16
  "@cosmjs/proto-signing": "0.27.1",
package/tsconfig.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ES2020",
5
- "moduleResolution": "node",
6
- "allowSyntheticDefaultImports": true,
7
- "esModuleInterop": false,
8
- "strict": false,
9
- "skipLibCheck": true
10
- }
11
- }
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ES2020",
5
+ "moduleResolution": "node",
6
+ "allowSyntheticDefaultImports": true,
7
+ "esModuleInterop": false,
8
+ "strict": false,
9
+ "skipLibCheck": true
10
+ }
11
+ }