decentralcardgame-cardchain-client-ts 0.0.28 → 0.0.30

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.
Files changed (56) hide show
  1. package/DecentralCardGame.cardchain.cardchain/module.js +428 -460
  2. package/DecentralCardGame.cardchain.cardchain/module.ts +1496 -1571
  3. package/DecentralCardGame.cardchain.cardchain/registry.js +74 -66
  4. package/DecentralCardGame.cardchain.cardchain/registry.ts +74 -66
  5. package/DecentralCardGame.cardchain.cardchain/rest.js +71 -0
  6. package/DecentralCardGame.cardchain.cardchain/rest.ts +132 -0
  7. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.js +6 -0
  8. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/card.ts +6 -0
  9. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/early_access_proposal.js +81 -0
  10. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/early_access_proposal.ts +106 -0
  11. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/encounters.js +295 -0
  12. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/encounters.ts +354 -0
  13. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.js +16 -0
  14. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/genesis.ts +19 -1
  15. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.js +447 -0
  16. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/query.ts +570 -0
  17. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +504 -0
  18. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +613 -0
  19. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +50 -0
  20. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +48 -0
  21. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/zealy.js +58 -0
  22. package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/zealy.ts +82 -0
  23. package/DecentralCardGame.cardchain.cardchain/types.js +5 -1
  24. package/DecentralCardGame.cardchain.cardchain/types.ts +8 -0
  25. package/DecentralCardGame.cardchain.featureflag/module.js +9 -7
  26. package/DecentralCardGame.cardchain.featureflag/module.ts +69 -65
  27. package/client.js +2 -5
  28. package/client.ts +164 -162
  29. package/cosmos.authz.v1beta1/module.js +33 -22
  30. package/cosmos.authz.v1beta1/module.ts +220 -148
  31. package/cosmos.distribution.v1beta1/module.js +65 -35
  32. package/cosmos.distribution.v1beta1/module.ts +354 -200
  33. package/cosmos.evidence.v1beta1/module.js +21 -13
  34. package/cosmos.evidence.v1beta1/module.ts +115 -86
  35. package/cosmos.gov.v1/module.js +48 -29
  36. package/cosmos.gov.v1/module.ts +275 -178
  37. package/cosmos.mint.v1beta1/module.js +9 -7
  38. package/cosmos.mint.v1beta1/module.ts +67 -63
  39. package/cosmos.nft.v1beta1/module.js +9 -7
  40. package/cosmos.nft.v1beta1/module.ts +75 -71
  41. package/cosmos.tx.v1beta1/module.js +9 -7
  42. package/cosmos.tx.v1beta1/module.ts +89 -85
  43. package/cosmos.vesting.v1beta1/module.js +52 -29
  44. package/cosmos.vesting.v1beta1/module.ts +249 -149
  45. package/ibc.applications.interchain_accounts.controller.v1/module.js +9 -7
  46. package/ibc.applications.interchain_accounts.controller.v1/module.ts +65 -61
  47. package/ibc.applications.transfer.v1/module.js +17 -12
  48. package/ibc.applications.transfer.v1/module.ts +114 -88
  49. package/ibc.core.channel.v1/module.js +1 -4
  50. package/ibc.core.channel.v1/module.ts +79 -81
  51. package/ibc.core.client.v1/module.js +1 -4
  52. package/ibc.core.client.v1/module.ts +81 -83
  53. package/ibc.core.connection.v1/module.js +6 -7
  54. package/ibc.core.connection.v1/module.ts +88 -84
  55. package/package.json +4 -1
  56. package/tsconfig.json +1 -1
@@ -1,114 +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 {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"
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 { };
19
21
 
20
- export {};
21
22
 
22
23
 
23
24
  export const registry = new Registry(msgTypes);
24
25
 
25
26
  type Field = {
26
- name: string;
27
- type: unknown;
27
+ name: string;
28
+ type: unknown;
28
29
  }
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
-
39
38
  const defaultFee = {
40
- amount: [],
41
- gas: "200000",
39
+ amount: [],
40
+ gas: "200000",
42
41
  };
43
42
 
44
43
  interface TxClientOptions {
45
- addr: string
46
- prefix: string
47
- signer?: OfflineSigner
44
+ addr: string
45
+ prefix: string
46
+ signer?: OfflineSigner
48
47
  }
49
48
 
50
- export const txClient = ({signer, prefix, addr}: TxClientOptions = {
51
- addr: "http://localhost:26657",
52
- prefix: "cosmos"
53
- }) => {
49
+ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
54
50
 
55
- return {}
51
+ return {
52
+
53
+
54
+ }
56
55
  };
57
56
 
58
57
  interface QueryClientOptions {
59
- addr: string
58
+ addr: string
60
59
  }
61
60
 
62
- export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
63
- return new Api({baseURL: addr});
61
+ export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
62
+ return new Api({ baseURL: addr });
64
63
  };
65
64
 
66
65
  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
- 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
- }
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);
103
100
  }
101
+ }
104
102
  };
105
103
 
106
104
  const Module = (test: IgniteClient) => {
107
- return {
108
- module: {
109
- IbcCoreChannelV1: new SDKModule(test)
110
- },
111
- registry: msgTypes
112
- }
105
+ return {
106
+ module: {
107
+ IbcCoreChannelV1: new SDKModule(test)
108
+ },
109
+ registry: msgTypes
110
+ }
113
111
  }
114
112
  export default Module;
@@ -24,10 +24,7 @@ const defaultFee = {
24
24
  amount: [],
25
25
  gas: "200000",
26
26
  };
27
- export const txClient = ({ signer, prefix, addr } = {
28
- addr: "http://localhost:26657",
29
- prefix: "cosmos"
30
- }) => {
27
+ export const txClient = ({ signer, prefix, addr } = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
31
28
  return {};
32
29
  };
33
30
  export const queryClient = ({ addr: addr } = { addr: "http://localhost:1317" }) => {
@@ -1,116 +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 {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"
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 { };
20
22
 
21
- export {};
22
23
 
23
24
 
24
25
  export const registry = new Registry(msgTypes);
25
26
 
26
27
  type Field = {
27
- name: string;
28
- type: unknown;
28
+ name: string;
29
+ type: unknown;
29
30
  }
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
-
40
39
  const defaultFee = {
41
- amount: [],
42
- gas: "200000",
40
+ amount: [],
41
+ gas: "200000",
43
42
  };
44
43
 
45
44
  interface TxClientOptions {
46
- addr: string
47
- prefix: string
48
- signer?: OfflineSigner
45
+ addr: string
46
+ prefix: string
47
+ signer?: OfflineSigner
49
48
  }
50
49
 
51
- export const txClient = ({signer, prefix, addr}: TxClientOptions = {
52
- addr: "http://localhost:26657",
53
- prefix: "cosmos"
54
- }) => {
50
+ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
55
51
 
56
- return {}
52
+ return {
53
+
54
+
55
+ }
57
56
  };
58
57
 
59
58
  interface QueryClientOptions {
60
- addr: string
59
+ addr: string
61
60
  }
62
61
 
63
- export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
64
- return new Api({baseURL: addr});
62
+ export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
63
+ return new Api({ baseURL: addr });
65
64
  };
66
65
 
67
66
  class SDKModule {
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
- }
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);
105
102
  }
103
+ }
106
104
  };
107
105
 
108
106
  const Module = (test: IgniteClient) => {
109
- return {
110
- module: {
111
- IbcCoreClientV1: new SDKModule(test)
112
- },
113
- registry: msgTypes
114
- }
107
+ return {
108
+ module: {
109
+ IbcCoreClientV1: new SDKModule(test)
110
+ },
111
+ registry: msgTypes
112
+ }
115
113
  }
116
114
  export default Module;
@@ -1,6 +1,6 @@
1
1
  // Generated by Ignite ignite.com/cli
2
- import { Registry } from "@cosmjs/proto-signing";
3
- import { msgTypes } from './registry';
2
+ import { Registry, } from "@cosmjs/proto-signing";
3
+ import { msgTypes } from "./registry";
4
4
  import { Api } from "./rest";
5
5
  import { ConnectionEnd as typeConnectionEnd } from "./types";
6
6
  import { IdentifiedConnection as typeIdentifiedConnection } from "./types";
@@ -24,7 +24,7 @@ const defaultFee = {
24
24
  };
25
25
  export const txClient = ({ signer, prefix, addr } = {
26
26
  addr: "http://localhost:26657",
27
- prefix: "cosmos"
27
+ prefix: "cosmos",
28
28
  }) => {
29
29
  return {};
30
30
  };
@@ -45,7 +45,7 @@ class SDKModule {
45
45
  Version: getStructure(typeVersion.fromPartial({})),
46
46
  Params: getStructure(typeParams.fromPartial({})),
47
47
  };
48
- client.on('signer-changed', (signer) => {
48
+ client.on("signer-changed", (signer) => {
49
49
  this.updateTX(client);
50
50
  });
51
51
  }
@@ -61,13 +61,12 @@ class SDKModule {
61
61
  }
62
62
  }
63
63
  }
64
- ;
65
64
  const Module = (test) => {
66
65
  return {
67
66
  module: {
68
- IbcCoreConnectionV1: new SDKModule(test)
67
+ IbcCoreConnectionV1: new SDKModule(test),
69
68
  },
70
- registry: msgTypes
69
+ registry: msgTypes,
71
70
  };
72
71
  };
73
72
  export default Module;
@@ -1,112 +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";
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"
3
+ import { StdFee } from "@cosmjs/amino";
4
+ import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate";
5
+ import {
6
+ EncodeObject,
7
+ GeneratedType,
8
+ OfflineSigner,
9
+ Registry,
10
+ } from "@cosmjs/proto-signing";
11
+ import { msgTypes } from "./registry";
12
+ import { IgniteClient } from "../client";
13
+ import { MissingWalletError } from "../helpers";
14
+ import { Api } from "./rest";
15
+
16
+ import { ConnectionEnd as typeConnectionEnd } from "./types";
17
+ import { IdentifiedConnection as typeIdentifiedConnection } from "./types";
18
+ import { Counterparty as typeCounterparty } from "./types";
19
+ import { ClientPaths as typeClientPaths } from "./types";
20
+ import { ConnectionPaths as typeConnectionPaths } from "./types";
21
+ import { Version as typeVersion } from "./types";
22
+ import { Params as typeParams } from "./types";
18
23
 
19
24
  export {};
20
25
 
21
-
22
26
  export const registry = new Registry(msgTypes);
23
27
 
24
28
  type Field = {
25
- name: string;
26
- type: unknown;
27
- }
28
-
29
+ name: string;
30
+ type: unknown;
31
+ };
29
32
  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
33
+ const structure: { fields: Field[] } = { fields: [] };
34
+ for (let [key, value] of Object.entries(template)) {
35
+ let field = { name: key, type: typeof value };
36
+ structure.fields.push(field);
37
+ }
38
+ return structure;
36
39
  }
37
-
38
40
  const defaultFee = {
39
- amount: [],
40
- gas: "200000",
41
+ amount: [],
42
+ gas: "200000",
41
43
  };
42
44
 
43
45
  interface TxClientOptions {
44
- addr: string
45
- prefix: string
46
- signer?: OfflineSigner
46
+ addr: string;
47
+ prefix: string;
48
+ signer?: OfflineSigner;
47
49
  }
48
50
 
49
- export const txClient = ({signer, prefix, addr}: TxClientOptions = {
51
+ export const txClient = (
52
+ { signer, prefix, addr }: TxClientOptions = {
50
53
  addr: "http://localhost:26657",
51
- prefix: "cosmos"
52
- }) => {
53
-
54
- return {}
54
+ prefix: "cosmos",
55
+ },
56
+ ) => {
57
+ return {};
55
58
  };
56
59
 
57
60
  interface QueryClientOptions {
58
- addr: string
61
+ addr: string;
59
62
  }
60
63
 
61
- export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
62
- return new Api({baseURL: addr});
64
+ export const queryClient = (
65
+ { addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" },
66
+ ) => {
67
+ return new Api({ baseURL: addr });
63
68
  };
64
69
 
65
70
  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
- 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
- })
71
+ public query: ReturnType<typeof queryClient>;
72
+ public tx: ReturnType<typeof txClient>;
73
+ public structure: Record<string, unknown>;
74
+ public registry: Array<[string, GeneratedType]> = [];
75
+
76
+ constructor(client: IgniteClient) {
77
+ this.query = queryClient({ addr: client.env.apiURL });
78
+ this.updateTX(client);
79
+ this.structure = {
80
+ ConnectionEnd: getStructure(typeConnectionEnd.fromPartial({})),
81
+ IdentifiedConnection: getStructure(
82
+ typeIdentifiedConnection.fromPartial({}),
83
+ ),
84
+ Counterparty: getStructure(typeCounterparty.fromPartial({})),
85
+ ClientPaths: getStructure(typeClientPaths.fromPartial({})),
86
+ ConnectionPaths: getStructure(typeConnectionPaths.fromPartial({})),
87
+ Version: getStructure(typeVersion.fromPartial({})),
88
+ Params: getStructure(typeParams.fromPartial({})),
89
+ };
90
+ client.on("signer-changed", (signer) => {
91
+ this.updateTX(client);
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);
88
104
  }
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
- }
101
- }
102
- };
105
+ }
106
+ }
103
107
 
104
108
  const Module = (test: IgniteClient) => {
105
- return {
106
- module: {
107
- IbcCoreConnectionV1: new SDKModule(test)
108
- },
109
- registry: msgTypes
110
- }
111
- }
112
- export default Module;
109
+ return {
110
+ module: {
111
+ IbcCoreConnectionV1: new SDKModule(test),
112
+ },
113
+ registry: msgTypes,
114
+ };
115
+ };
116
+ export default Module;