decentralcardgame-cardchain-client-ts 0.0.27 → 0.0.28

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,104 +1,102 @@
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 {BaseAccount as typeBaseAccount} from "./types"
12
- import {ModuleAccount as typeModuleAccount} from "./types"
13
- import {Params as typeParams} from "./types"
11
+ import { BaseAccount as typeBaseAccount} from "./types"
12
+ import { ModuleAccount as typeModuleAccount} from "./types"
13
+ import { Params as typeParams} from "./types"
14
+
15
+ export { };
14
16
 
15
- export {};
16
17
 
17
18
 
18
19
  export const registry = new Registry(msgTypes);
19
20
 
20
21
  type Field = {
21
- name: string;
22
- type: unknown;
22
+ name: string;
23
+ type: unknown;
23
24
  }
24
-
25
25
  function getStructure(template) {
26
- const structure: { fields: Field[] } = {fields: []}
27
- for (let [key, value] of Object.entries(template)) {
28
- let field = {name: key, type: typeof value}
29
- structure.fields.push(field)
30
- }
31
- return structure
26
+ const structure: {fields: Field[]} = { fields: [] }
27
+ for (let [key, value] of Object.entries(template)) {
28
+ let field = { name: key, type: typeof value }
29
+ structure.fields.push(field)
30
+ }
31
+ return structure
32
32
  }
33
-
34
33
  const defaultFee = {
35
- amount: [],
36
- gas: "200000",
34
+ amount: [],
35
+ gas: "200000",
37
36
  };
38
37
 
39
38
  interface TxClientOptions {
40
- addr: string
41
- prefix: string
42
- signer?: OfflineSigner
39
+ addr: string
40
+ prefix: string
41
+ signer?: OfflineSigner
43
42
  }
44
43
 
45
- export const txClient = ({signer, prefix, addr}: TxClientOptions = {
46
- addr: "http://localhost:26657",
47
- prefix: "cosmos"
48
- }) => {
44
+ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
49
45
 
50
- return {}
46
+ return {
47
+
48
+
49
+ }
51
50
  };
52
51
 
53
52
  interface QueryClientOptions {
54
- addr: string
53
+ addr: string
55
54
  }
56
55
 
57
- export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
58
- return new Api({baseURL: addr});
56
+ export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
57
+ return new Api({ baseURL: addr });
59
58
  };
60
59
 
61
60
  class SDKModule {
62
- public query: ReturnType<typeof queryClient>;
63
- public tx: ReturnType<typeof txClient>;
64
- public structure: Record<string, unknown>;
65
- public registry: Array<[string, GeneratedType]> = [];
66
-
67
- constructor(client: IgniteClient) {
68
-
69
- this.query = queryClient({addr: client.env.apiURL});
70
- this.updateTX(client);
71
- this.structure = {
72
- BaseAccount: getStructure(typeBaseAccount.fromPartial({})),
73
- ModuleAccount: getStructure(typeModuleAccount.fromPartial({})),
74
- Params: getStructure(typeParams.fromPartial({})),
75
-
76
- };
77
- client.on('signer-changed', (signer) => {
78
- this.updateTX(client);
79
- })
80
- }
81
-
82
- updateTX(client: IgniteClient) {
83
- const methods = txClient({
84
- signer: client.signer,
85
- addr: client.env.rpcURL,
86
- prefix: client.env.prefix ?? "cosmos",
87
- })
88
-
89
- this.tx = methods;
90
- for (let m in methods) {
91
- this.tx[m] = methods[m].bind(this.tx);
92
- }
61
+ public query: ReturnType<typeof queryClient>;
62
+ public tx: ReturnType<typeof txClient>;
63
+ public structure: Record<string,unknown>;
64
+ public registry: Array<[string, GeneratedType]> = [];
65
+
66
+ constructor(client: IgniteClient) {
67
+
68
+ this.query = queryClient({ addr: client.env.apiURL });
69
+ this.updateTX(client);
70
+ this.structure = {
71
+ BaseAccount: getStructure(typeBaseAccount.fromPartial({})),
72
+ ModuleAccount: getStructure(typeModuleAccount.fromPartial({})),
73
+ Params: getStructure(typeParams.fromPartial({})),
74
+
75
+ };
76
+ client.on('signer-changed',(signer) => {
77
+ this.updateTX(client);
78
+ })
79
+ }
80
+ updateTX(client: IgniteClient) {
81
+ const methods = txClient({
82
+ signer: client.signer,
83
+ addr: client.env.rpcURL,
84
+ prefix: client.env.prefix ?? "cosmos",
85
+ })
86
+
87
+ this.tx = methods;
88
+ for (let m in methods) {
89
+ this.tx[m] = methods[m].bind(this.tx);
93
90
  }
91
+ }
94
92
  };
95
93
 
96
94
  const Module = (test: IgniteClient) => {
97
- return {
98
- module: {
99
- CosmosAuthV1Beta1: new SDKModule(test)
100
- },
101
- registry: msgTypes
102
- }
95
+ return {
96
+ module: {
97
+ CosmosAuthV1Beta1: new SDKModule(test)
98
+ },
99
+ registry: msgTypes
100
+ }
103
101
  }
104
102
  export default Module;
@@ -23,7 +23,10 @@ const defaultFee = {
23
23
  amount: [],
24
24
  gas: "200000",
25
25
  };
26
- export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
26
+ export const txClient = ({ signer, prefix, addr } = {
27
+ addr: "http://localhost:26657",
28
+ prefix: "cosmos"
29
+ }) => {
27
30
  return {};
28
31
  };
29
32
  export const queryClient = ({ addr: addr } = { addr: "http://localhost:1317" }) => {
@@ -1,112 +1,114 @@
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 { Channel as typeChannel} from "./types"
12
- import { IdentifiedChannel as typeIdentifiedChannel} from "./types"
13
- import { Counterparty as typeCounterparty} from "./types"
14
- import { Packet as typePacket} from "./types"
15
- import { PacketState as typePacketState} from "./types"
16
- import { PacketId as typePacketId} from "./types"
17
- import { Acknowledgement as typeAcknowledgement} from "./types"
18
- import { PacketSequence as typePacketSequence} from "./types"
19
-
20
- export { };
11
+ import {Channel as typeChannel} from "./types"
12
+ import {IdentifiedChannel as typeIdentifiedChannel} from "./types"
13
+ import {Counterparty as typeCounterparty} from "./types"
14
+ import {Packet as typePacket} from "./types"
15
+ import {PacketState as typePacketState} from "./types"
16
+ import {PacketId as typePacketId} from "./types"
17
+ import {Acknowledgement as typeAcknowledgement} from "./types"
18
+ import {PacketSequence as typePacketSequence} from "./types"
21
19
 
20
+ export {};
22
21
 
23
22
 
24
23
  export const registry = new Registry(msgTypes);
25
24
 
26
25
  type Field = {
27
- name: string;
28
- type: unknown;
26
+ name: string;
27
+ type: unknown;
29
28
  }
29
+
30
30
  function getStructure(template) {
31
- const structure: {fields: Field[]} = { fields: [] }
32
- for (let [key, value] of Object.entries(template)) {
33
- let field = { name: key, type: typeof value }
34
- structure.fields.push(field)
35
- }
36
- return structure
31
+ const structure: { fields: Field[] } = {fields: []}
32
+ for (let [key, value] of Object.entries(template)) {
33
+ let field = {name: key, type: typeof value}
34
+ structure.fields.push(field)
35
+ }
36
+ return structure
37
37
  }
38
+
38
39
  const defaultFee = {
39
- amount: [],
40
- gas: "200000",
40
+ amount: [],
41
+ gas: "200000",
41
42
  };
42
43
 
43
44
  interface TxClientOptions {
44
- addr: string
45
- prefix: string
46
- signer?: OfflineSigner
45
+ addr: string
46
+ prefix: string
47
+ signer?: OfflineSigner
47
48
  }
48
49
 
49
- export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
50
+ export const txClient = ({signer, prefix, addr}: TxClientOptions = {
51
+ addr: "http://localhost:26657",
52
+ prefix: "cosmos"
53
+ }) => {
50
54
 
51
- return {
52
-
53
-
54
- }
55
+ return {}
55
56
  };
56
57
 
57
58
  interface QueryClientOptions {
58
- addr: string
59
+ addr: string
59
60
  }
60
61
 
61
- export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
62
- return new Api({ baseURL: addr });
62
+ export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
63
+ return new Api({baseURL: addr});
63
64
  };
64
65
 
65
66
  class SDKModule {
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
- Channel: getStructure(typeChannel.fromPartial({})),
77
- IdentifiedChannel: getStructure(typeIdentifiedChannel.fromPartial({})),
78
- Counterparty: getStructure(typeCounterparty.fromPartial({})),
79
- Packet: getStructure(typePacket.fromPartial({})),
80
- PacketState: getStructure(typePacketState.fromPartial({})),
81
- PacketId: getStructure(typePacketId.fromPartial({})),
82
- Acknowledgement: getStructure(typeAcknowledgement.fromPartial({})),
83
- PacketSequence: getStructure(typePacketSequence.fromPartial({})),
84
-
85
- };
86
- client.on('signer-changed',(signer) => {
87
- this.updateTX(client);
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);
67
+ public query: ReturnType<typeof queryClient>;
68
+ public tx: ReturnType<typeof txClient>;
69
+ public structure: Record<string, unknown>;
70
+ public registry: Array<[string, GeneratedType]> = [];
71
+
72
+ constructor(client: IgniteClient) {
73
+
74
+ this.query = queryClient({addr: client.env.apiURL});
75
+ this.updateTX(client);
76
+ this.structure = {
77
+ Channel: getStructure(typeChannel.fromPartial({})),
78
+ IdentifiedChannel: getStructure(typeIdentifiedChannel.fromPartial({})),
79
+ Counterparty: getStructure(typeCounterparty.fromPartial({})),
80
+ Packet: getStructure(typePacket.fromPartial({})),
81
+ PacketState: getStructure(typePacketState.fromPartial({})),
82
+ PacketId: getStructure(typePacketId.fromPartial({})),
83
+ Acknowledgement: getStructure(typeAcknowledgement.fromPartial({})),
84
+ PacketSequence: getStructure(typePacketSequence.fromPartial({})),
85
+
86
+ };
87
+ client.on('signer-changed', (signer) => {
88
+ this.updateTX(client);
89
+ })
90
+ }
91
+
92
+ updateTX(client: IgniteClient) {
93
+ const methods = txClient({
94
+ signer: client.signer,
95
+ addr: client.env.rpcURL,
96
+ prefix: client.env.prefix ?? "cosmos",
97
+ })
98
+
99
+ this.tx = methods;
100
+ for (let m in methods) {
101
+ this.tx[m] = methods[m].bind(this.tx);
102
+ }
100
103
  }
101
- }
102
104
  };
103
105
 
104
106
  const Module = (test: IgniteClient) => {
105
- return {
106
- module: {
107
- IbcCoreChannelV1: new SDKModule(test)
108
- },
109
- registry: msgTypes
110
- }
107
+ return {
108
+ module: {
109
+ IbcCoreChannelV1: new SDKModule(test)
110
+ },
111
+ registry: msgTypes
112
+ }
111
113
  }
112
114
  export default Module;
@@ -24,7 +24,10 @@ const defaultFee = {
24
24
  amount: [],
25
25
  gas: "200000",
26
26
  };
27
- export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
27
+ export const txClient = ({ signer, prefix, addr } = {
28
+ addr: "http://localhost:26657",
29
+ prefix: "cosmos"
30
+ }) => {
28
31
  return {};
29
32
  };
30
33
  export const queryClient = ({ addr: addr } = { addr: "http://localhost:1317" }) => {
@@ -1,114 +1,116 @@
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 { IdentifiedClientState as typeIdentifiedClientState} from "./types"
12
- import { ConsensusStateWithHeight as typeConsensusStateWithHeight} from "./types"
13
- import { ClientConsensusStates as typeClientConsensusStates} from "./types"
14
- import { ClientUpdateProposal as typeClientUpdateProposal} from "./types"
15
- import { UpgradeProposal as typeUpgradeProposal} from "./types"
16
- import { Height as typeHeight} from "./types"
17
- import { Params as typeParams} from "./types"
18
- import { GenesisMetadata as typeGenesisMetadata} from "./types"
19
- import { IdentifiedGenesisMetadata as typeIdentifiedGenesisMetadata} from "./types"
20
-
21
- export { };
11
+ import {IdentifiedClientState as typeIdentifiedClientState} from "./types"
12
+ import {ConsensusStateWithHeight as typeConsensusStateWithHeight} from "./types"
13
+ import {ClientConsensusStates as typeClientConsensusStates} from "./types"
14
+ import {ClientUpdateProposal as typeClientUpdateProposal} from "./types"
15
+ import {UpgradeProposal as typeUpgradeProposal} from "./types"
16
+ import {Height as typeHeight} from "./types"
17
+ import {Params as typeParams} from "./types"
18
+ import {GenesisMetadata as typeGenesisMetadata} from "./types"
19
+ import {IdentifiedGenesisMetadata as typeIdentifiedGenesisMetadata} from "./types"
22
20
 
21
+ export {};
23
22
 
24
23
 
25
24
  export const registry = new Registry(msgTypes);
26
25
 
27
26
  type Field = {
28
- name: string;
29
- type: unknown;
27
+ name: string;
28
+ type: unknown;
30
29
  }
30
+
31
31
  function getStructure(template) {
32
- const structure: {fields: Field[]} = { fields: [] }
33
- for (let [key, value] of Object.entries(template)) {
34
- let field = { name: key, type: typeof value }
35
- structure.fields.push(field)
36
- }
37
- return structure
32
+ const structure: { fields: Field[] } = {fields: []}
33
+ for (let [key, value] of Object.entries(template)) {
34
+ let field = {name: key, type: typeof value}
35
+ structure.fields.push(field)
36
+ }
37
+ return structure
38
38
  }
39
+
39
40
  const defaultFee = {
40
- amount: [],
41
- gas: "200000",
41
+ amount: [],
42
+ gas: "200000",
42
43
  };
43
44
 
44
45
  interface TxClientOptions {
45
- addr: string
46
- prefix: string
47
- signer?: OfflineSigner
46
+ addr: string
47
+ prefix: string
48
+ signer?: OfflineSigner
48
49
  }
49
50
 
50
- export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
51
+ export const txClient = ({signer, prefix, addr}: TxClientOptions = {
52
+ addr: "http://localhost:26657",
53
+ prefix: "cosmos"
54
+ }) => {
51
55
 
52
- return {
53
-
54
-
55
- }
56
+ return {}
56
57
  };
57
58
 
58
59
  interface QueryClientOptions {
59
- addr: string
60
+ addr: string
60
61
  }
61
62
 
62
- export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
63
- return new Api({ baseURL: addr });
63
+ export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
64
+ return new Api({baseURL: addr});
64
65
  };
65
66
 
66
67
  class SDKModule {
67
- public query: ReturnType<typeof queryClient>;
68
- public tx: ReturnType<typeof txClient>;
69
- public structure: Record<string,unknown>;
70
- public registry: Array<[string, GeneratedType]> = [];
71
-
72
- constructor(client: IgniteClient) {
73
-
74
- this.query = queryClient({ addr: client.env.apiURL });
75
- this.updateTX(client);
76
- this.structure = {
77
- IdentifiedClientState: getStructure(typeIdentifiedClientState.fromPartial({})),
78
- ConsensusStateWithHeight: getStructure(typeConsensusStateWithHeight.fromPartial({})),
79
- ClientConsensusStates: getStructure(typeClientConsensusStates.fromPartial({})),
80
- ClientUpdateProposal: getStructure(typeClientUpdateProposal.fromPartial({})),
81
- UpgradeProposal: getStructure(typeUpgradeProposal.fromPartial({})),
82
- Height: getStructure(typeHeight.fromPartial({})),
83
- Params: getStructure(typeParams.fromPartial({})),
84
- GenesisMetadata: getStructure(typeGenesisMetadata.fromPartial({})),
85
- IdentifiedGenesisMetadata: getStructure(typeIdentifiedGenesisMetadata.fromPartial({})),
86
-
87
- };
88
- client.on('signer-changed',(signer) => {
89
- this.updateTX(client);
90
- })
91
- }
92
- updateTX(client: IgniteClient) {
93
- const methods = txClient({
94
- signer: client.signer,
95
- addr: client.env.rpcURL,
96
- prefix: client.env.prefix ?? "cosmos",
97
- })
98
-
99
- this.tx = methods;
100
- for (let m in methods) {
101
- this.tx[m] = methods[m].bind(this.tx);
68
+ public query: ReturnType<typeof queryClient>;
69
+ public tx: ReturnType<typeof txClient>;
70
+ public structure: Record<string, unknown>;
71
+ public registry: Array<[string, GeneratedType]> = [];
72
+
73
+ constructor(client: IgniteClient) {
74
+
75
+ this.query = queryClient({addr: client.env.apiURL});
76
+ this.updateTX(client);
77
+ this.structure = {
78
+ IdentifiedClientState: getStructure(typeIdentifiedClientState.fromPartial({})),
79
+ ConsensusStateWithHeight: getStructure(typeConsensusStateWithHeight.fromPartial({})),
80
+ ClientConsensusStates: getStructure(typeClientConsensusStates.fromPartial({})),
81
+ ClientUpdateProposal: getStructure(typeClientUpdateProposal.fromPartial({})),
82
+ UpgradeProposal: getStructure(typeUpgradeProposal.fromPartial({})),
83
+ Height: getStructure(typeHeight.fromPartial({})),
84
+ Params: getStructure(typeParams.fromPartial({})),
85
+ GenesisMetadata: getStructure(typeGenesisMetadata.fromPartial({})),
86
+ IdentifiedGenesisMetadata: getStructure(typeIdentifiedGenesisMetadata.fromPartial({})),
87
+
88
+ };
89
+ client.on('signer-changed', (signer) => {
90
+ this.updateTX(client);
91
+ })
92
+ }
93
+
94
+ updateTX(client: IgniteClient) {
95
+ const methods = txClient({
96
+ signer: client.signer,
97
+ addr: client.env.rpcURL,
98
+ prefix: client.env.prefix ?? "cosmos",
99
+ })
100
+
101
+ this.tx = methods;
102
+ for (let m in methods) {
103
+ this.tx[m] = methods[m].bind(this.tx);
104
+ }
102
105
  }
103
- }
104
106
  };
105
107
 
106
108
  const Module = (test: IgniteClient) => {
107
- return {
108
- module: {
109
- IbcCoreClientV1: new SDKModule(test)
110
- },
111
- registry: msgTypes
112
- }
109
+ return {
110
+ module: {
111
+ IbcCoreClientV1: new SDKModule(test)
112
+ },
113
+ registry: msgTypes
114
+ }
113
115
  }
114
116
  export default Module;
@@ -22,7 +22,10 @@ const defaultFee = {
22
22
  amount: [],
23
23
  gas: "200000",
24
24
  };
25
- export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
25
+ export const txClient = ({ signer, prefix, addr } = {
26
+ addr: "http://localhost:26657",
27
+ prefix: "cosmos"
28
+ }) => {
26
29
  return {};
27
30
  };
28
31
  export const queryClient = ({ addr: addr } = { addr: "http://localhost:1317" }) => {