juno-network 0.2.1 → 0.2.2
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/main/codegen/cosmos/base/query/v1beta1/pagination.js +190 -0
- package/main/codegen/cosmos/base/v1beta1/coin.js +268 -0
- package/main/codegen/cosmos/bundle.js +4 -4
- package/main/codegen/cosmwasm/bundle.js +4 -4
- package/main/codegen/ibc/bundle.js +25 -15
- package/main/codegen/ibc/client.js +6 -2
- package/main/codegen/ibc/core/client/v1/client.js +585 -0
- package/main/codegen/ibc/core/client/v1/genesis.js +367 -0
- package/main/codegen/ibc/core/client/v1/query.js +1047 -0
- package/main/codegen/ibc/core/client/v1/query.lcd.js +381 -0
- package/main/codegen/ibc/core/client/v1/query.rpc.query.js +125 -0
- package/main/codegen/ibc/core/client/v1/tx.amino.js +149 -0
- package/main/codegen/ibc/core/client/v1/tx.js +538 -0
- package/main/codegen/ibc/core/client/v1/tx.registry.js +160 -0
- package/main/codegen/ibc/core/client/v1/tx.rpc.msg.js +81 -0
- package/main/codegen/ibc/lcd.js +21 -6
- package/main/codegen/ibc/rpc.query.js +19 -6
- package/main/codegen/ibc/rpc.tx.js +19 -6
- package/main/codegen/juno/bundle.js +6 -6
- package/module/codegen/cosmos/base/query/v1beta1/pagination.js +189 -0
- package/module/codegen/cosmos/base/v1beta1/coin.js +268 -0
- package/module/codegen/cosmos/bundle.js +4 -4
- package/module/codegen/cosmwasm/bundle.js +4 -4
- package/module/codegen/ibc/bundle.js +20 -15
- package/module/codegen/ibc/client.js +4 -2
- package/module/codegen/ibc/core/client/v1/client.js +549 -0
- package/module/codegen/ibc/core/client/v1/genesis.js +287 -0
- package/module/codegen/ibc/core/client/v1/query.js +1029 -0
- package/module/codegen/ibc/core/client/v1/query.lcd.js +128 -0
- package/module/codegen/ibc/core/client/v1/query.rpc.query.js +69 -0
- package/module/codegen/ibc/core/client/v1/tx.amino.js +150 -0
- package/module/codegen/ibc/core/client/v1/tx.js +544 -0
- package/module/codegen/ibc/core/client/v1/tx.registry.js +159 -0
- package/module/codegen/ibc/core/client/v1/tx.rpc.msg.js +41 -0
- package/module/codegen/ibc/lcd.js +5 -0
- package/module/codegen/ibc/rpc.query.js +3 -0
- package/module/codegen/ibc/rpc.tx.js +3 -0
- package/module/codegen/juno/bundle.js +6 -6
- package/package.json +3 -2
- package/types/codegen/JunoSwap.client.d.ts +1 -1
- package/types/codegen/JunoSwap.react-query.d.ts +11 -11
- package/types/codegen/JunoSwap.types.d.ts +1 -1
- package/types/codegen/contracts.d.ts +5 -5
- package/types/codegen/cosmos/bank/v1beta1/query.lcd.d.ts +3 -3
- package/types/codegen/cosmos/base/query/v1beta1/pagination.d.ts +79 -0
- package/types/codegen/cosmos/base/v1beta1/coin.d.ts +58 -0
- package/types/codegen/cosmos/bundle.d.ts +758 -153
- package/types/codegen/cosmos/client.d.ts +6 -2
- package/types/codegen/cosmos/distribution/v1beta1/query.lcd.d.ts +2 -2
- package/types/codegen/cosmos/staking/v1beta1/query.lcd.d.ts +2 -2
- package/types/codegen/cosmwasm/bundle.d.ts +87 -18
- package/types/codegen/cosmwasm/client.d.ts +8 -2
- package/types/codegen/cosmwasm/wasm/v1/query.lcd.d.ts +2 -2
- package/types/codegen/ibc/applications/transfer/v1/query.lcd.d.ts +2 -2
- package/types/codegen/ibc/bundle.d.ts +878 -64
- package/types/codegen/ibc/client.d.ts +8 -2
- package/types/codegen/ibc/core/channel/v1/query.lcd.d.ts +1 -1
- package/types/codegen/ibc/core/client/v1/client.d.ts +143 -0
- package/types/codegen/ibc/core/client/v1/genesis.d.ts +56 -0
- package/types/codegen/ibc/core/client/v1/query.d.ts +263 -0
- package/types/codegen/ibc/core/client/v1/query.lcd.d.ts +15 -0
- package/types/codegen/ibc/core/client/v1/query.rpc.query.d.ts +25 -0
- package/types/codegen/ibc/core/client/v1/tx.amino.d.ts +77 -0
- package/types/codegen/ibc/core/client/v1/tx.d.ts +131 -0
- package/types/codegen/ibc/core/client/v1/tx.registry.d.ts +96 -0
- package/types/codegen/ibc/core/client/v1/tx.rpc.msg.d.ts +17 -0
- package/types/codegen/ibc/lcd.d.ts +3 -0
- package/types/codegen/ibc/rpc.query.d.ts +3 -0
- package/types/codegen/ibc/rpc.tx.d.ts +3 -0
- package/types/codegen/index.d.ts +1 -1
- package/types/codegen/juno/bundle.d.ts +6 -6
- package/types/codegen/juno/mint/query.lcd.d.ts +3 -3
@@ -0,0 +1,128 @@
|
|
1
|
+
import { LCDClient } from "@osmonauts/lcd";
|
2
|
+
import { setPaginationParams } from "@osmonauts/helpers";
|
3
|
+
export class LCDQueryClient extends LCDClient {
|
4
|
+
constructor({
|
5
|
+
restEndpoint
|
6
|
+
}) {
|
7
|
+
super({
|
8
|
+
restEndpoint
|
9
|
+
});
|
10
|
+
}
|
11
|
+
/* ClientState queries an IBC light client. */
|
12
|
+
|
13
|
+
|
14
|
+
async clientState(params) {
|
15
|
+
const options = {
|
16
|
+
params: {}
|
17
|
+
};
|
18
|
+
|
19
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.clientId) !== "undefined") {
|
20
|
+
options.params.client_id = params.clientId;
|
21
|
+
}
|
22
|
+
|
23
|
+
const endpoint = `ibc/core/client/v1/client_states/${params.clientId}`;
|
24
|
+
return await this.request(endpoint, options);
|
25
|
+
}
|
26
|
+
/* ClientStates queries all the IBC light clients of a chain. */
|
27
|
+
|
28
|
+
|
29
|
+
async clientStates(params = {
|
30
|
+
pagination: undefined
|
31
|
+
}) {
|
32
|
+
const options = {
|
33
|
+
params: {}
|
34
|
+
};
|
35
|
+
|
36
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
|
37
|
+
setPaginationParams(options, params.pagination);
|
38
|
+
}
|
39
|
+
|
40
|
+
const endpoint = `ibc/core/client/v1/client_states`;
|
41
|
+
return await this.request(endpoint, options);
|
42
|
+
}
|
43
|
+
/* ConsensusState queries a consensus state associated with a client state at
|
44
|
+
a given height. */
|
45
|
+
|
46
|
+
|
47
|
+
async consensusState(params) {
|
48
|
+
const options = {
|
49
|
+
params: {}
|
50
|
+
};
|
51
|
+
|
52
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.clientId) !== "undefined") {
|
53
|
+
options.params.client_id = params.clientId;
|
54
|
+
}
|
55
|
+
|
56
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.revisionNumber) !== "undefined") {
|
57
|
+
options.params.revision_number = params.revisionNumber;
|
58
|
+
}
|
59
|
+
|
60
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.revisionHeight) !== "undefined") {
|
61
|
+
options.params.revision_height = params.revisionHeight;
|
62
|
+
}
|
63
|
+
|
64
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.latestHeight) !== "undefined") {
|
65
|
+
options.params.latest_height = params.latestHeight;
|
66
|
+
}
|
67
|
+
|
68
|
+
const endpoint = `ibc/core/client/v1/consensus_states/${params.clientId}/revision/${params.revisionNumber}height/${params.revisionHeight}`;
|
69
|
+
return await this.request(endpoint, options);
|
70
|
+
}
|
71
|
+
/* ConsensusStates queries all the consensus state associated with a given
|
72
|
+
client. */
|
73
|
+
|
74
|
+
|
75
|
+
async consensusStates(params) {
|
76
|
+
const options = {
|
77
|
+
params: {}
|
78
|
+
};
|
79
|
+
|
80
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.clientId) !== "undefined") {
|
81
|
+
options.params.client_id = params.clientId;
|
82
|
+
}
|
83
|
+
|
84
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.pagination) !== "undefined") {
|
85
|
+
setPaginationParams(options, params.pagination);
|
86
|
+
}
|
87
|
+
|
88
|
+
const endpoint = `ibc/core/client/v1/consensus_states/${params.clientId}`;
|
89
|
+
return await this.request(endpoint, options);
|
90
|
+
}
|
91
|
+
/* Status queries the status of an IBC client. */
|
92
|
+
|
93
|
+
|
94
|
+
async clientStatus(params) {
|
95
|
+
const options = {
|
96
|
+
params: {}
|
97
|
+
};
|
98
|
+
|
99
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.clientId) !== "undefined") {
|
100
|
+
options.params.client_id = params.clientId;
|
101
|
+
}
|
102
|
+
|
103
|
+
const endpoint = `ibc/core/client/v1/client_status/${params.clientId}`;
|
104
|
+
return await this.request(endpoint, options);
|
105
|
+
}
|
106
|
+
/* ClientParams queries all parameters of the ibc client. */
|
107
|
+
|
108
|
+
|
109
|
+
async clientParams(_params = {}) {
|
110
|
+
const endpoint = `ibc/client/v1/params`;
|
111
|
+
return await this.request(endpoint);
|
112
|
+
}
|
113
|
+
/* UpgradedClientState queries an Upgraded IBC light client. */
|
114
|
+
|
115
|
+
|
116
|
+
async upgradedClientState(_params = {}) {
|
117
|
+
const endpoint = `ibc/core/client/v1/upgraded_client_states`;
|
118
|
+
return await this.request(endpoint);
|
119
|
+
}
|
120
|
+
/* UpgradedConsensusState queries an Upgraded IBC consensus state. */
|
121
|
+
|
122
|
+
|
123
|
+
async upgradedConsensusState(_params = {}) {
|
124
|
+
const endpoint = `ibc/core/client/v1/upgraded_consensus_states`;
|
125
|
+
return await this.request(endpoint);
|
126
|
+
}
|
127
|
+
|
128
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
+
import * as _m0 from "protobufjs/minimal";
|
3
|
+
import { QueryClientStateRequest, QueryClientStateResponse, QueryClientStatesRequest, QueryClientStatesResponse, QueryConsensusStateRequest, QueryConsensusStateResponse, QueryConsensusStatesRequest, QueryConsensusStatesResponse, QueryClientStatusRequest, QueryClientStatusResponse, QueryClientParamsRequest, QueryClientParamsResponse, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse } from "./query";
|
4
|
+
/** Query defines the RPC service */
|
5
|
+
|
6
|
+
export class QueryClientImpl {
|
7
|
+
constructor(rpc) {
|
8
|
+
_defineProperty(this, "rpc", void 0);
|
9
|
+
|
10
|
+
this.rpc = rpc;
|
11
|
+
this.clientState = this.clientState.bind(this);
|
12
|
+
this.clientStates = this.clientStates.bind(this);
|
13
|
+
this.consensusState = this.consensusState.bind(this);
|
14
|
+
this.consensusStates = this.consensusStates.bind(this);
|
15
|
+
this.clientStatus = this.clientStatus.bind(this);
|
16
|
+
this.clientParams = this.clientParams.bind(this);
|
17
|
+
this.upgradedClientState = this.upgradedClientState.bind(this);
|
18
|
+
this.upgradedConsensusState = this.upgradedConsensusState.bind(this);
|
19
|
+
}
|
20
|
+
|
21
|
+
clientState(request) {
|
22
|
+
const data = QueryClientStateRequest.encode(request).finish();
|
23
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data);
|
24
|
+
return promise.then(data => QueryClientStateResponse.decode(new _m0.Reader(data)));
|
25
|
+
}
|
26
|
+
|
27
|
+
clientStates(request) {
|
28
|
+
const data = QueryClientStatesRequest.encode(request).finish();
|
29
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data);
|
30
|
+
return promise.then(data => QueryClientStatesResponse.decode(new _m0.Reader(data)));
|
31
|
+
}
|
32
|
+
|
33
|
+
consensusState(request) {
|
34
|
+
const data = QueryConsensusStateRequest.encode(request).finish();
|
35
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data);
|
36
|
+
return promise.then(data => QueryConsensusStateResponse.decode(new _m0.Reader(data)));
|
37
|
+
}
|
38
|
+
|
39
|
+
consensusStates(request) {
|
40
|
+
const data = QueryConsensusStatesRequest.encode(request).finish();
|
41
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data);
|
42
|
+
return promise.then(data => QueryConsensusStatesResponse.decode(new _m0.Reader(data)));
|
43
|
+
}
|
44
|
+
|
45
|
+
clientStatus(request) {
|
46
|
+
const data = QueryClientStatusRequest.encode(request).finish();
|
47
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStatus", data);
|
48
|
+
return promise.then(data => QueryClientStatusResponse.decode(new _m0.Reader(data)));
|
49
|
+
}
|
50
|
+
|
51
|
+
clientParams(request) {
|
52
|
+
const data = QueryClientParamsRequest.encode(request).finish();
|
53
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data);
|
54
|
+
return promise.then(data => QueryClientParamsResponse.decode(new _m0.Reader(data)));
|
55
|
+
}
|
56
|
+
|
57
|
+
upgradedClientState(request) {
|
58
|
+
const data = QueryUpgradedClientStateRequest.encode(request).finish();
|
59
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedClientState", data);
|
60
|
+
return promise.then(data => QueryUpgradedClientStateResponse.decode(new _m0.Reader(data)));
|
61
|
+
}
|
62
|
+
|
63
|
+
upgradedConsensusState(request) {
|
64
|
+
const data = QueryUpgradedConsensusStateRequest.encode(request).finish();
|
65
|
+
const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data);
|
66
|
+
return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data)));
|
67
|
+
}
|
68
|
+
|
69
|
+
}
|
@@ -0,0 +1,150 @@
|
|
1
|
+
export const AminoConverter = {
|
2
|
+
"/ibc.core.client.v1.MsgCreateClient": {
|
3
|
+
aminoType: "cosmos-sdk/MsgCreateClient",
|
4
|
+
toAmino: ({
|
5
|
+
clientState,
|
6
|
+
consensusState,
|
7
|
+
signer
|
8
|
+
}) => {
|
9
|
+
return {
|
10
|
+
client_state: {
|
11
|
+
type_url: clientState.typeUrl,
|
12
|
+
value: clientState.value
|
13
|
+
},
|
14
|
+
consensus_state: {
|
15
|
+
type_url: consensusState.typeUrl,
|
16
|
+
value: consensusState.value
|
17
|
+
},
|
18
|
+
signer
|
19
|
+
};
|
20
|
+
},
|
21
|
+
fromAmino: ({
|
22
|
+
client_state,
|
23
|
+
consensus_state,
|
24
|
+
signer
|
25
|
+
}) => {
|
26
|
+
return {
|
27
|
+
clientState: {
|
28
|
+
typeUrl: client_state.type_url,
|
29
|
+
value: client_state.value
|
30
|
+
},
|
31
|
+
consensusState: {
|
32
|
+
typeUrl: consensus_state.type_url,
|
33
|
+
value: consensus_state.value
|
34
|
+
},
|
35
|
+
signer
|
36
|
+
};
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"/ibc.core.client.v1.MsgUpdateClient": {
|
40
|
+
aminoType: "cosmos-sdk/MsgUpdateClient",
|
41
|
+
toAmino: ({
|
42
|
+
clientId,
|
43
|
+
header,
|
44
|
+
signer
|
45
|
+
}) => {
|
46
|
+
return {
|
47
|
+
client_id: clientId,
|
48
|
+
header: {
|
49
|
+
type_url: header.typeUrl,
|
50
|
+
value: header.value
|
51
|
+
},
|
52
|
+
signer
|
53
|
+
};
|
54
|
+
},
|
55
|
+
fromAmino: ({
|
56
|
+
client_id,
|
57
|
+
header,
|
58
|
+
signer
|
59
|
+
}) => {
|
60
|
+
return {
|
61
|
+
clientId: client_id,
|
62
|
+
header: {
|
63
|
+
typeUrl: header.type_url,
|
64
|
+
value: header.value
|
65
|
+
},
|
66
|
+
signer
|
67
|
+
};
|
68
|
+
}
|
69
|
+
},
|
70
|
+
"/ibc.core.client.v1.MsgUpgradeClient": {
|
71
|
+
aminoType: "cosmos-sdk/MsgUpgradeClient",
|
72
|
+
toAmino: ({
|
73
|
+
clientId,
|
74
|
+
clientState,
|
75
|
+
consensusState,
|
76
|
+
proofUpgradeClient,
|
77
|
+
proofUpgradeConsensusState,
|
78
|
+
signer
|
79
|
+
}) => {
|
80
|
+
return {
|
81
|
+
client_id: clientId,
|
82
|
+
client_state: {
|
83
|
+
type_url: clientState.typeUrl,
|
84
|
+
value: clientState.value
|
85
|
+
},
|
86
|
+
consensus_state: {
|
87
|
+
type_url: consensusState.typeUrl,
|
88
|
+
value: consensusState.value
|
89
|
+
},
|
90
|
+
proof_upgrade_client: proofUpgradeClient,
|
91
|
+
proof_upgrade_consensus_state: proofUpgradeConsensusState,
|
92
|
+
signer
|
93
|
+
};
|
94
|
+
},
|
95
|
+
fromAmino: ({
|
96
|
+
client_id,
|
97
|
+
client_state,
|
98
|
+
consensus_state,
|
99
|
+
proof_upgrade_client,
|
100
|
+
proof_upgrade_consensus_state,
|
101
|
+
signer
|
102
|
+
}) => {
|
103
|
+
return {
|
104
|
+
clientId: client_id,
|
105
|
+
clientState: {
|
106
|
+
typeUrl: client_state.type_url,
|
107
|
+
value: client_state.value
|
108
|
+
},
|
109
|
+
consensusState: {
|
110
|
+
typeUrl: consensus_state.type_url,
|
111
|
+
value: consensus_state.value
|
112
|
+
},
|
113
|
+
proofUpgradeClient: proof_upgrade_client,
|
114
|
+
proofUpgradeConsensusState: proof_upgrade_consensus_state,
|
115
|
+
signer
|
116
|
+
};
|
117
|
+
}
|
118
|
+
},
|
119
|
+
"/ibc.core.client.v1.MsgSubmitMisbehaviour": {
|
120
|
+
aminoType: "cosmos-sdk/MsgSubmitMisbehaviour",
|
121
|
+
toAmino: ({
|
122
|
+
clientId,
|
123
|
+
misbehaviour,
|
124
|
+
signer
|
125
|
+
}) => {
|
126
|
+
return {
|
127
|
+
client_id: clientId,
|
128
|
+
misbehaviour: {
|
129
|
+
type_url: misbehaviour.typeUrl,
|
130
|
+
value: misbehaviour.value
|
131
|
+
},
|
132
|
+
signer
|
133
|
+
};
|
134
|
+
},
|
135
|
+
fromAmino: ({
|
136
|
+
client_id,
|
137
|
+
misbehaviour,
|
138
|
+
signer
|
139
|
+
}) => {
|
140
|
+
return {
|
141
|
+
clientId: client_id,
|
142
|
+
misbehaviour: {
|
143
|
+
typeUrl: misbehaviour.type_url,
|
144
|
+
value: misbehaviour.value
|
145
|
+
},
|
146
|
+
signer
|
147
|
+
};
|
148
|
+
}
|
149
|
+
}
|
150
|
+
};
|