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.
- package/DecentralCardGame.cardchain.cardchain/module.js +386 -332
- package/DecentralCardGame.cardchain.cardchain/module.ts +622 -542
- package/DecentralCardGame.cardchain.cardchain/registry.js +66 -62
- package/DecentralCardGame.cardchain.cardchain/registry.ts +66 -62
- package/DecentralCardGame.cardchain.cardchain/rest.ts +11 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.js +182 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/tx.ts +226 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.js +74 -0
- package/DecentralCardGame.cardchain.cardchain/types/cardchain/cardchain/user.ts +87 -0
- package/DecentralCardGame.cardchain.cardchain/types.js +2 -1
- package/DecentralCardGame.cardchain.cardchain/types.ts +2 -0
- package/DecentralCardGame.cardchain.featureflag/module.js +1 -4
- package/DecentralCardGame.cardchain.featureflag/module.ts +69 -71
- package/client.js +4 -1
- package/client.ts +161 -154
- package/cosmos.auth.v1beta1/module.js +1 -4
- package/cosmos.auth.v1beta1/module.ts +69 -71
- package/ibc.core.channel.v1/module.js +4 -1
- package/ibc.core.channel.v1/module.ts +81 -79
- package/ibc.core.client.v1/module.js +4 -1
- package/ibc.core.client.v1/module.ts +83 -81
- package/ibc.core.connection.v1/module.js +4 -1
- package/ibc.core.connection.v1/module.ts +79 -77
- package/package.json +1 -1
- package/tsconfig.json +10 -10
|
@@ -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
|
-
|
|
22
|
-
|
|
22
|
+
name: string;
|
|
23
|
+
type: unknown;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
25
|
function getStructure(template) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
36
|
-
|
|
34
|
+
amount: [],
|
|
35
|
+
gas: "200000",
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
interface TxClientOptions {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}
|
|
51
50
|
};
|
|
52
51
|
|
|
53
52
|
interface QueryClientOptions {
|
|
54
|
-
|
|
53
|
+
addr: string
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
export const queryClient = ({addr: addr}: QueryClientOptions = {addr: "http://localhost:1317"}) => {
|
|
58
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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 } = {
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
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
|
-
|
|
28
|
-
|
|
26
|
+
name: string;
|
|
27
|
+
type: unknown;
|
|
29
28
|
}
|
|
29
|
+
|
|
30
30
|
function getStructure(template) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
40
|
-
|
|
40
|
+
amount: [],
|
|
41
|
+
gas: "200000",
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
interface TxClientOptions {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
addr: string
|
|
46
|
+
prefix: string
|
|
47
|
+
signer?: OfflineSigner
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
export const txClient = ({
|
|
50
|
+
export const txClient = ({signer, prefix, addr}: TxClientOptions = {
|
|
51
|
+
addr: "http://localhost:26657",
|
|
52
|
+
prefix: "cosmos"
|
|
53
|
+
}) => {
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
+
return {}
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
interface QueryClientOptions {
|
|
58
|
-
|
|
59
|
+
addr: string
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
export const queryClient = ({
|
|
62
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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 } = {
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
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
|
-
|
|
29
|
-
|
|
27
|
+
name: string;
|
|
28
|
+
type: unknown;
|
|
30
29
|
}
|
|
30
|
+
|
|
31
31
|
function getStructure(template) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
41
|
-
|
|
41
|
+
amount: [],
|
|
42
|
+
gas: "200000",
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
interface TxClientOptions {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
addr: string
|
|
47
|
+
prefix: string
|
|
48
|
+
signer?: OfflineSigner
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
export const txClient = ({
|
|
51
|
+
export const txClient = ({signer, prefix, addr}: TxClientOptions = {
|
|
52
|
+
addr: "http://localhost:26657",
|
|
53
|
+
prefix: "cosmos"
|
|
54
|
+
}) => {
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
+
return {}
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
interface QueryClientOptions {
|
|
59
|
-
|
|
60
|
+
addr: string
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
export const queryClient = ({
|
|
63
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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 } = {
|
|
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" }) => {
|