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.
- package/DecentralCardGame.cardchain.cardchain/module.js +399 -345
- package/DecentralCardGame.cardchain.cardchain/module.ts +624 -544
- 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 +4 -1
- package/tsconfig.json +10 -10
|
@@ -1,110 +1,112 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
27
|
-
|
|
25
|
+
name: string;
|
|
26
|
+
type: unknown;
|
|
28
27
|
}
|
|
28
|
+
|
|
29
29
|
function getStructure(template) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
39
|
+
amount: [],
|
|
40
|
+
gas: "200000",
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
interface TxClientOptions {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
addr: string
|
|
45
|
+
prefix: string
|
|
46
|
+
signer?: OfflineSigner
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
export const txClient = ({
|
|
49
|
+
export const txClient = ({signer, prefix, addr}: TxClientOptions = {
|
|
50
|
+
addr: "http://localhost:26657",
|
|
51
|
+
prefix: "cosmos"
|
|
52
|
+
}) => {
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
+
return {}
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
interface QueryClientOptions {
|
|
57
|
-
|
|
58
|
+
addr: string
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
export const queryClient = ({
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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.
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
}
|