decentralcardgame-cardchain-client-ts 0.0.31 → 0.0.32
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/lib/index.d.ts +78 -78
- package/lib/index.js +23 -23
- package/package.json +5 -2
- package/cardchain.cardchain/index.ts +0 -6
- package/cardchain.cardchain/module.ts +0 -1869
- package/cardchain.cardchain/registry.ts +0 -111
- package/cardchain.cardchain/rest.ts +0 -655
- package/cardchain.cardchain/types.ts +0 -63
- package/cardchain.featureflag/index.ts +0 -6
- package/cardchain.featureflag/module.ts +0 -165
- package/cardchain.featureflag/registry.ts +0 -11
- package/cardchain.featureflag/rest.ts +0 -256
- package/cardchain.featureflag/types.ts +0 -9
- package/client.ts +0 -164
- package/cosmos.auth.v1beta1/index.ts +0 -6
- package/cosmos.auth.v1beta1/module.ts +0 -136
- package/cosmos.auth.v1beta1/registry.ts +0 -9
- package/cosmos.auth.v1beta1/rest.ts +0 -403
- package/cosmos.auth.v1beta1/types.ts +0 -13
- package/cosmos.authz.v1beta1/index.ts +0 -6
- package/cosmos.authz.v1beta1/module.ts +0 -206
- package/cosmos.authz.v1beta1/registry.ts +0 -13
- package/cosmos.authz.v1beta1/rest.ts +0 -256
- package/cosmos.authz.v1beta1/types.ts +0 -17
- package/cosmos.bank.v1beta1/index.ts +0 -6
- package/cosmos.bank.v1beta1/module.ts +0 -247
- package/cosmos.bank.v1beta1/registry.ts +0 -15
- package/cosmos.bank.v1beta1/rest.ts +0 -466
- package/cosmos.bank.v1beta1/types.ts +0 -25
- package/cosmos.base.node.v1beta1/index.ts +0 -6
- package/cosmos.base.node.v1beta1/module.ts +0 -95
- package/cosmos.base.node.v1beta1/registry.ts +0 -7
- package/cosmos.base.node.v1beta1/rest.ts +0 -235
- package/cosmos.base.node.v1beta1/types.ts +0 -5
- package/cosmos.base.tendermint.v1beta1/index.ts +0 -6
- package/cosmos.base.tendermint.v1beta1/module.ts +0 -109
- package/cosmos.base.tendermint.v1beta1/registry.ts +0 -7
- package/cosmos.base.tendermint.v1beta1/rest.ts +0 -340
- package/cosmos.base.tendermint.v1beta1/types.ts +0 -19
- package/cosmos.circuit.v1/index.ts +0 -6
- package/cosmos.circuit.v1/module.ts +0 -198
- package/cosmos.circuit.v1/registry.ts +0 -13
- package/cosmos.circuit.v1/rest.ts +0 -256
- package/cosmos.circuit.v1/types.ts +0 -9
- package/cosmos.consensus.v1/index.ts +0 -6
- package/cosmos.consensus.v1/module.ts +0 -128
- package/cosmos.consensus.v1/registry.ts +0 -9
- package/cosmos.consensus.v1/rest.ts +0 -214
- package/cosmos.consensus.v1/types.ts +0 -5
- package/cosmos.crisis.v1beta1/index.ts +0 -6
- package/cosmos.crisis.v1beta1/module.ts +0 -161
- package/cosmos.crisis.v1beta1/registry.ts +0 -11
- package/cosmos.crisis.v1beta1/rest.ts +0 -193
- package/cosmos.crisis.v1beta1/types.ts +0 -5
- package/cosmos.distribution.v1beta1/index.ts +0 -6
- package/cosmos.distribution.v1beta1/module.ts +0 -364
- package/cosmos.distribution.v1beta1/registry.ts +0 -21
- package/cosmos.distribution.v1beta1/rest.ts +0 -403
- package/cosmos.distribution.v1beta1/types.ts +0 -43
- package/cosmos.evidence.v1beta1/index.ts +0 -6
- package/cosmos.evidence.v1beta1/module.ts +0 -130
- package/cosmos.evidence.v1beta1/registry.ts +0 -9
- package/cosmos.evidence.v1beta1/rest.ts +0 -235
- package/cosmos.evidence.v1beta1/types.ts +0 -7
- package/cosmos.feegrant.v1beta1/index.ts +0 -6
- package/cosmos.feegrant.v1beta1/module.ts +0 -202
- package/cosmos.feegrant.v1beta1/registry.ts +0 -13
- package/cosmos.feegrant.v1beta1/rest.ts +0 -256
- package/cosmos.feegrant.v1beta1/types.ts +0 -13
- package/cosmos.gov.v1/index.ts +0 -6
- package/cosmos.gov.v1/module.ts +0 -344
- package/cosmos.gov.v1/registry.ts +0 -21
- package/cosmos.gov.v1/rest.ts +0 -382
- package/cosmos.gov.v1/types.ts +0 -23
- package/cosmos.gov.v1beta1/index.ts +0 -6
- package/cosmos.gov.v1beta1/module.ts +0 -245
- package/cosmos.gov.v1beta1/registry.ts +0 -15
- package/cosmos.gov.v1beta1/rest.ts +0 -361
- package/cosmos.gov.v1beta1/types.ts +0 -23
- package/cosmos.group.v1/index.ts +0 -6
- package/cosmos.group.v1/module.ts +0 -599
- package/cosmos.group.v1/registry.ts +0 -35
- package/cosmos.group.v1/rest.ts +0 -487
- package/cosmos.group.v1/types.ts +0 -47
- package/cosmos.mint.v1beta1/index.ts +0 -6
- package/cosmos.mint.v1beta1/module.ts +0 -132
- package/cosmos.mint.v1beta1/registry.ts +0 -9
- package/cosmos.mint.v1beta1/rest.ts +0 -256
- package/cosmos.mint.v1beta1/types.ts +0 -9
- package/cosmos.nft.v1beta1/index.ts +0 -6
- package/cosmos.nft.v1beta1/module.ts +0 -140
- package/cosmos.nft.v1beta1/registry.ts +0 -9
- package/cosmos.nft.v1beta1/rest.ts +0 -340
- package/cosmos.nft.v1beta1/types.ts +0 -17
- package/cosmos.params.v1beta1/index.ts +0 -6
- package/cosmos.params.v1beta1/module.ts +0 -101
- package/cosmos.params.v1beta1/registry.ts +0 -7
- package/cosmos.params.v1beta1/rest.ts +0 -235
- package/cosmos.params.v1beta1/types.ts +0 -11
- package/cosmos.slashing.v1beta1/index.ts +0 -6
- package/cosmos.slashing.v1beta1/module.ts +0 -171
- package/cosmos.slashing.v1beta1/registry.ts +0 -11
- package/cosmos.slashing.v1beta1/rest.ts +0 -256
- package/cosmos.slashing.v1beta1/types.ts +0 -15
- package/cosmos.staking.v1beta1/index.ts +0 -6
- package/cosmos.staking.v1beta1/module.ts +0 -374
- package/cosmos.staking.v1beta1/registry.ts +0 -21
- package/cosmos.staking.v1beta1/rest.ts +0 -487
- package/cosmos.staking.v1beta1/types.ts +0 -53
- package/cosmos.tx.v1beta1/index.ts +0 -6
- package/cosmos.tx.v1beta1/module.ts +0 -121
- package/cosmos.tx.v1beta1/registry.ts +0 -7
- package/cosmos.tx.v1beta1/rest.ts +0 -382
- package/cosmos.tx.v1beta1/types.ts +0 -31
- package/cosmos.upgrade.v1beta1/index.ts +0 -6
- package/cosmos.upgrade.v1beta1/module.ts +0 -169
- package/cosmos.upgrade.v1beta1/registry.ts +0 -11
- package/cosmos.upgrade.v1beta1/rest.ts +0 -298
- package/cosmos.upgrade.v1beta1/types.ts +0 -13
- package/cosmos.vesting.v1beta1/index.ts +0 -6
- package/cosmos.vesting.v1beta1/module.ts +0 -206
- package/cosmos.vesting.v1beta1/registry.ts +0 -13
- package/cosmos.vesting.v1beta1/rest.ts +0 -193
- package/cosmos.vesting.v1beta1/types.ts +0 -17
- package/env.ts +0 -7
- package/helpers.ts +0 -32
- package/ibc.applications.fee.v1/index.ts +0 -6
- package/ibc.applications.fee.v1/module.ts +0 -247
- package/ibc.applications.fee.v1/registry.ts +0 -15
- package/ibc.applications.fee.v1/rest.ts +0 -403
- package/ibc.applications.fee.v1/types.ts +0 -25
- package/ibc.applications.interchain_accounts.controller.v1/index.ts +0 -6
- package/ibc.applications.interchain_accounts.controller.v1/module.ts +0 -196
- package/ibc.applications.interchain_accounts.controller.v1/registry.ts +0 -13
- package/ibc.applications.interchain_accounts.controller.v1/rest.ts +0 -235
- package/ibc.applications.interchain_accounts.controller.v1/types.ts +0 -7
- package/ibc.applications.interchain_accounts.host.v1/index.ts +0 -6
- package/ibc.applications.interchain_accounts.host.v1/module.ts +0 -165
- package/ibc.applications.interchain_accounts.host.v1/registry.ts +0 -11
- package/ibc.applications.interchain_accounts.host.v1/rest.ts +0 -214
- package/ibc.applications.interchain_accounts.host.v1/types.ts +0 -9
- package/ibc.applications.transfer.v1/index.ts +0 -6
- package/ibc.applications.transfer.v1/module.ts +0 -169
- package/ibc.applications.transfer.v1/registry.ts +0 -11
- package/ibc.applications.transfer.v1/rest.ts +0 -319
- package/ibc.applications.transfer.v1/types.ts +0 -13
- package/ibc.core.channel.v1/index.ts +0 -6
- package/ibc.core.channel.v1/module.ts +0 -748
- package/ibc.core.channel.v1/registry.ts +0 -45
- package/ibc.core.channel.v1/rest.ts +0 -550
- package/ibc.core.channel.v1/types.ts +0 -31
- package/ibc.core.client.v1/index.ts +0 -6
- package/ibc.core.client.v1/module.ts +0 -344
- package/ibc.core.client.v1/registry.ts +0 -21
- package/ibc.core.client.v1/rest.ts +0 -403
- package/ibc.core.client.v1/types.ts +0 -23
- package/ibc.core.connection.v1/index.ts +0 -6
- package/ibc.core.connection.v1/module.ts +0 -274
- package/ibc.core.connection.v1/registry.ts +0 -17
- package/ibc.core.connection.v1/rest.ts +0 -319
- package/ibc.core.connection.v1/types.ts +0 -19
- package/index.ts +0 -81
- package/modules.ts +0 -5
- package/tsconfig.json +0 -13
- package/types/amino/amino.ts +0 -9
- package/types/capability/v1/capability.ts +0 -263
- package/types/capability/v1/genesis.ts +0 -220
- package/types/cardchain/cardchain/card.ts +0 -712
- package/types/cardchain/cardchain/card_content.ts +0 -116
- package/types/cardchain/cardchain/card_with_image.ts +0 -134
- package/types/cardchain/cardchain/council.ts +0 -502
- package/types/cardchain/cardchain/encounter.ts +0 -307
- package/types/cardchain/cardchain/encounter_with_image.ts +0 -119
- package/types/cardchain/cardchain/genesis.ts +0 -403
- package/types/cardchain/cardchain/image.ts +0 -122
- package/types/cardchain/cardchain/match.ts +0 -453
- package/types/cardchain/cardchain/module/module.ts +0 -99
- package/types/cardchain/cardchain/params.ts +0 -544
- package/types/cardchain/cardchain/query.ts +0 -3786
- package/types/cardchain/cardchain/running_average.ts +0 -116
- package/types/cardchain/cardchain/sell_offer.ts +0 -224
- package/types/cardchain/cardchain/server.ts +0 -144
- package/types/cardchain/cardchain/set.ts +0 -537
- package/types/cardchain/cardchain/set_with_artwork.ts +0 -142
- package/types/cardchain/cardchain/tx.ts +0 -8053
- package/types/cardchain/cardchain/user.ts +0 -955
- package/types/cardchain/cardchain/voting.ts +0 -328
- package/types/cardchain/cardchain/voting_results.ts +0 -227
- package/types/cardchain/cardchain/zealy.ts +0 -116
- package/types/cardchain/featureflag/flag.ts +0 -133
- package/types/cardchain/featureflag/genesis.ts +0 -226
- package/types/cardchain/featureflag/module/module.ts +0 -99
- package/types/cardchain/featureflag/params.ts +0 -78
- package/types/cardchain/featureflag/query.ts +0 -445
- package/types/cardchain/featureflag/tx.ts +0 -373
- package/types/cosmos/app/runtime/v1alpha1/module.ts +0 -389
- package/types/cosmos/app/v1alpha1/config.ts +0 -346
- package/types/cosmos/app/v1alpha1/module.ts +0 -348
- package/types/cosmos/app/v1alpha1/query.ts +0 -175
- package/types/cosmos/auth/module/v1/module.ts +0 -229
- package/types/cosmos/auth/v1beta1/auth.ts +0 -531
- package/types/cosmos/auth/v1beta1/genesis.ts +0 -125
- package/types/cosmos/auth/v1beta1/query.ts +0 -1564
- package/types/cosmos/auth/v1beta1/tx.ts +0 -213
- package/types/cosmos/authz/module/v1/module.ts +0 -78
- package/types/cosmos/authz/v1beta1/authz.ts +0 -411
- package/types/cosmos/authz/v1beta1/event.ts +0 -241
- package/types/cosmos/authz/v1beta1/genesis.ts +0 -101
- package/types/cosmos/authz/v1beta1/query.ts +0 -643
- package/types/cosmos/authz/v1beta1/tx.ts +0 -574
- package/types/cosmos/autocli/v1/options.ts +0 -1049
- package/types/cosmos/autocli/v1/query.ts +0 -291
- package/types/cosmos/bank/module/v1/module.ts +0 -150
- package/types/cosmos/bank/v1beta1/authz.ts +0 -129
- package/types/cosmos/bank/v1beta1/bank.ts +0 -775
- package/types/cosmos/bank/v1beta1/genesis.ts +0 -277
- package/types/cosmos/bank/v1beta1/query.ts +0 -2424
- package/types/cosmos/bank/v1beta1/tx.ts +0 -697
- package/types/cosmos/base/abci/v1beta1/abci.ts +0 -1469
- package/types/cosmos/base/node/v1beta1/query.ts +0 -485
- package/types/cosmos/base/query/v1beta1/pagination.ts +0 -336
- package/types/cosmos/base/reflection/v1beta1/reflection.ts +0 -328
- package/types/cosmos/base/reflection/v2alpha1/reflection.ts +0 -2092
- package/types/cosmos/base/tendermint/v1beta1/query.ts +0 -2025
- package/types/cosmos/base/tendermint/v1beta1/types.ts +0 -548
- package/types/cosmos/base/v1beta1/coin.ts +0 -209
- package/types/cosmos/circuit/module/v1/module.ts +0 -99
- package/types/cosmos/circuit/v1/query.ts +0 -476
- package/types/cosmos/circuit/v1/tx.ts +0 -576
- package/types/cosmos/circuit/v1/types.ts +0 -362
- package/types/cosmos/consensus/module/v1/module.ts +0 -99
- package/types/cosmos/consensus/v1/query.ts +0 -181
- package/types/cosmos/consensus/v1/tx.ts +0 -271
- package/types/cosmos/crisis/module/v1/module.ts +0 -119
- package/types/cosmos/crisis/v1beta1/genesis.ts +0 -105
- package/types/cosmos/crisis/v1beta1/tx.ts +0 -367
- package/types/cosmos/crypto/ed25519/keys.ts +0 -195
- package/types/cosmos/crypto/hd/v1/hd.ts +0 -178
- package/types/cosmos/crypto/keyring/v1/record.ts +0 -440
- package/types/cosmos/crypto/multisig/keys.ts +0 -124
- package/types/cosmos/crypto/multisig/v1beta1/multisig.ts +0 -218
- package/types/cosmos/crypto/secp256k1/keys.ts +0 -192
- package/types/cosmos/crypto/secp256r1/keys.ts +0 -193
- package/types/cosmos/distribution/module/v1/module.ts +0 -118
- package/types/cosmos/distribution/v1beta1/distribution.ts +0 -1177
- package/types/cosmos/distribution/v1beta1/genesis.ts +0 -1028
- package/types/cosmos/distribution/v1beta1/query.ts +0 -1700
- package/types/cosmos/distribution/v1beta1/tx.ts +0 -1178
- package/types/cosmos/evidence/module/v1/module.ts +0 -78
- package/types/cosmos/evidence/v1beta1/evidence.ts +0 -194
- package/types/cosmos/evidence/v1beta1/genesis.ts +0 -98
- package/types/cosmos/evidence/v1beta1/query.ts +0 -414
- package/types/cosmos/evidence/v1beta1/tx.ts +0 -243
- package/types/cosmos/feegrant/module/v1/module.ts +0 -78
- package/types/cosmos/feegrant/v1beta1/feegrant.ts +0 -513
- package/types/cosmos/feegrant/v1beta1/genesis.ts +0 -101
- package/types/cosmos/feegrant/v1beta1/query.ts +0 -597
- package/types/cosmos/feegrant/v1beta1/tx.ts +0 -496
- package/types/cosmos/genutil/module/v1/module.ts +0 -78
- package/types/cosmos/genutil/v1beta1/genesis.ts +0 -122
- package/types/cosmos/gov/module/v1/module.ts +0 -133
- package/types/cosmos/gov/v1/genesis.ts +0 -313
- package/types/cosmos/gov/v1/gov.ts +0 -1712
- package/types/cosmos/gov/v1/query.ts +0 -1605
- package/types/cosmos/gov/v1/tx.ts +0 -1387
- package/types/cosmos/gov/v1beta1/genesis.ts +0 -241
- package/types/cosmos/gov/v1beta1/gov.ts +0 -1273
- package/types/cosmos/gov/v1beta1/query.ts +0 -1441
- package/types/cosmos/gov/v1beta1/tx.ts +0 -738
- package/types/cosmos/group/module/v1/module.ts +0 -141
- package/types/cosmos/group/v1/events.ts +0 -795
- package/types/cosmos/group/v1/genesis.ts +0 -265
- package/types/cosmos/group/v1/query.ts +0 -2441
- package/types/cosmos/group/v1/tx.ts +0 -2631
- package/types/cosmos/group/v1/types.ts +0 -1850
- package/types/cosmos/ics23/v1/proofs.ts +0 -1731
- package/types/cosmos/mint/module/v1/module.ts +0 -118
- package/types/cosmos/mint/v1beta1/genesis.ts +0 -126
- package/types/cosmos/mint/v1beta1/mint.ts +0 -293
- package/types/cosmos/mint/v1beta1/query.ts +0 -453
- package/types/cosmos/mint/v1beta1/tx.ts +0 -213
- package/types/cosmos/msg/textual/v1/textual.ts +0 -9
- package/types/cosmos/msg/v1/msg.ts +0 -9
- package/types/cosmos/nft/module/v1/module.ts +0 -78
- package/types/cosmos/nft/v1beta1/event.ts +0 -359
- package/types/cosmos/nft/v1beta1/genesis.ts +0 -204
- package/types/cosmos/nft/v1beta1/nft.ts +0 -348
- package/types/cosmos/nft/v1beta1/query.ts +0 -1173
- package/types/cosmos/nft/v1beta1/tx.ts +0 -228
- package/types/cosmos/orm/module/v1alpha1/module.ts +0 -82
- package/types/cosmos/orm/query/v1alpha1/query.ts +0 -933
- package/types/cosmos/orm/v1/orm.ts +0 -453
- package/types/cosmos/orm/v1alpha1/schema.ts +0 -321
- package/types/cosmos/params/module/v1/module.ts +0 -78
- package/types/cosmos/params/v1beta1/params.ts +0 -236
- package/types/cosmos/params/v1beta1/query.ts +0 -439
- package/types/cosmos/query/v1/query.ts +0 -9
- package/types/cosmos/reflection/v1/reflection.ts +0 -179
- package/types/cosmos/slashing/module/v1/module.ts +0 -99
- package/types/cosmos/slashing/v1beta1/genesis.ts +0 -424
- package/types/cosmos/slashing/v1beta1/query.ts +0 -487
- package/types/cosmos/slashing/v1beta1/slashing.ts +0 -422
- package/types/cosmos/slashing/v1beta1/tx.ts +0 -336
- package/types/cosmos/staking/module/v1/module.ts +0 -161
- package/types/cosmos/staking/v1beta1/authz.ts +0 -306
- package/types/cosmos/staking/v1beta1/genesis.ts +0 -377
- package/types/cosmos/staking/v1beta1/query.ts +0 -2540
- package/types/cosmos/staking/v1beta1/staking.ts +0 -2576
- package/types/cosmos/staking/v1beta1/tx.ts +0 -1433
- package/types/cosmos/store/internal/kv/v1beta1/kv.ts +0 -205
- package/types/cosmos/store/snapshots/v1/snapshot.ts +0 -746
- package/types/cosmos/store/streaming/abci/grpc.ts +0 -367
- package/types/cosmos/store/v1beta1/commit_info.ts +0 -370
- package/types/cosmos/store/v1beta1/listening.ts +0 -301
- package/types/cosmos/tx/config/v1/config.ts +0 -125
- package/types/cosmos/tx/signing/v1beta1/signing.ts +0 -630
- package/types/cosmos/tx/v1beta1/service.ts +0 -1889
- package/types/cosmos/tx/v1beta1/tx.ts +0 -1657
- package/types/cosmos/upgrade/module/v1/module.ts +0 -99
- package/types/cosmos/upgrade/v1beta1/query.ts +0 -819
- package/types/cosmos/upgrade/v1beta1/tx.ts +0 -340
- package/types/cosmos/upgrade/v1beta1/upgrade.ts +0 -525
- package/types/cosmos/vesting/module/v1/module.ts +0 -78
- package/types/cosmos/vesting/v1beta1/tx.ts +0 -640
- package/types/cosmos/vesting/v1beta1/vesting.ts +0 -624
- package/types/cosmos_proto/cosmos.ts +0 -307
- package/types/gogoproto/gogo.ts +0 -9
- package/types/google/api/annotations.ts +0 -9
- package/types/google/api/http.ts +0 -770
- package/types/google/protobuf/any.ts +0 -259
- package/types/google/protobuf/descriptor.ts +0 -6642
- package/types/google/protobuf/duration.ts +0 -200
- package/types/google/protobuf/timestamp.ts +0 -229
- package/types/ibc/applications/fee/v1/ack.ts +0 -166
- package/types/ibc/applications/fee/v1/fee.ts +0 -403
- package/types/ibc/applications/fee/v1/genesis.ts +0 -571
- package/types/ibc/applications/fee/v1/metadata.ts +0 -122
- package/types/ibc/applications/fee/v1/query.ts +0 -1757
- package/types/ibc/applications/fee/v1/tx.ts +0 -781
- package/types/ibc/applications/interchain_accounts/controller/v1/controller.ts +0 -104
- package/types/ibc/applications/interchain_accounts/controller/v1/query.ts +0 -333
- package/types/ibc/applications/interchain_accounts/controller/v1/tx.ts +0 -619
- package/types/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +0 -590
- package/types/ibc/applications/interchain_accounts/host/v1/host.ts +0 -242
- package/types/ibc/applications/interchain_accounts/host/v1/query.ts +0 -175
- package/types/ibc/applications/interchain_accounts/host/v1/tx.ts +0 -416
- package/types/ibc/applications/interchain_accounts/v1/account.ts +0 -120
- package/types/ibc/applications/interchain_accounts/v1/metadata.ts +0 -199
- package/types/ibc/applications/interchain_accounts/v1/packet.ts +0 -264
- package/types/ibc/applications/transfer/v1/authz.ts +0 -254
- package/types/ibc/applications/transfer/v1/genesis.ts +0 -165
- package/types/ibc/applications/transfer/v1/query.ts +0 -934
- package/types/ibc/applications/transfer/v1/transfer.ts +0 -220
- package/types/ibc/applications/transfer/v1/tx.ts +0 -505
- package/types/ibc/applications/transfer/v2/packet.ts +0 -177
- package/types/ibc/core/channel/v1/channel.ts +0 -1358
- package/types/ibc/core/channel/v1/genesis.ts +0 -377
- package/types/ibc/core/channel/v1/query.ts +0 -3781
- package/types/ibc/core/channel/v1/tx.ts +0 -4424
- package/types/ibc/core/channel/v1/upgrade.ts +0 -348
- package/types/ibc/core/client/v1/client.ts +0 -753
- package/types/ibc/core/client/v1/genesis.ts +0 -423
- package/types/ibc/core/client/v1/query.ts +0 -1898
- package/types/ibc/core/client/v1/tx.ts +0 -1301
- package/types/ibc/core/commitment/v1/commitment.ts +0 -336
- package/types/ibc/core/connection/v1/connection.ts +0 -840
- package/types/ibc/core/connection/v1/genesis.ts +0 -172
- package/types/ibc/core/connection/v1/query.ts +0 -1243
- package/types/ibc/core/connection/v1/tx.ts +0 -1352
- package/types/ibc/core/types/v1/genesis.ts +0 -150
- package/types/ibc/lightclients/localhost/v2/localhost.ts +0 -102
- package/types/ibc/lightclients/solomachine/v2/solomachine.ts +0 -1765
- package/types/ibc/lightclients/solomachine/v3/solomachine.ts +0 -945
- package/types/ibc/lightclients/tendermint/v1/tendermint.ts +0 -853
- package/types/ibc/lightclients/wasm/v1/genesis.ts +0 -192
- package/types/ibc/lightclients/wasm/v1/query.ts +0 -377
- package/types/ibc/lightclients/wasm/v1/tx.ts +0 -550
- package/types/ibc/lightclients/wasm/v1/wasm.ts +0 -370
- package/types/tendermint/abci/types.ts +0 -6103
- package/types/tendermint/crypto/keys.ts +0 -142
- package/types/tendermint/crypto/proof.ts +0 -533
- package/types/tendermint/libs/bits/types.ts +0 -139
- package/types/tendermint/p2p/types.ts +0 -544
- package/types/tendermint/types/block.ts +0 -158
- package/types/tendermint/types/evidence.ts +0 -502
- package/types/tendermint/types/params.ts +0 -701
- package/types/tendermint/types/types.ts +0 -2133
- package/types/tendermint/types/validator.ts +0 -424
- package/types/tendermint/version/types.ts +0 -218
- package/types.d.ts +0 -21
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
|
|
2
|
-
import { QueryInterchainAccountResponse } from "../types/ibc/applications/interchain_accounts/controller/v1/query";
|
|
3
|
-
import { QueryParamsResponse } from "../types/ibc/applications/interchain_accounts/controller/v1/query";
|
|
4
|
-
|
|
5
|
-
import { QueryInterchainAccountRequest } from "../types/ibc/applications/interchain_accounts/controller/v1/query";
|
|
6
|
-
import { QueryParamsRequest } from "../types/ibc/applications/interchain_accounts/controller/v1/query";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import type {SnakeCasedPropertiesDeep} from 'type-fest';
|
|
10
|
-
|
|
11
|
-
export type QueryParamsType = Record<string | number, any>;
|
|
12
|
-
|
|
13
|
-
export type FlattenObject<TValue> = CollapseEntries<CreateObjectEntries<TValue, TValue>>;
|
|
14
|
-
|
|
15
|
-
type Entry = { key: string; value: unknown };
|
|
16
|
-
type EmptyEntry<TValue> = { key: ''; value: TValue };
|
|
17
|
-
type ExcludedTypes = Date | Set<unknown> | Map<unknown, unknown>;
|
|
18
|
-
type ArrayEncoder = `[${bigint}]`;
|
|
19
|
-
|
|
20
|
-
type EscapeArrayKey<TKey extends string> = TKey extends `${infer TKeyBefore}.${ArrayEncoder}${infer TKeyAfter}`
|
|
21
|
-
? EscapeArrayKey<`${TKeyBefore}${ArrayEncoder}${TKeyAfter}`>
|
|
22
|
-
: TKey;
|
|
23
|
-
|
|
24
|
-
// Transforms entries to one flattened type
|
|
25
|
-
type CollapseEntries<TEntry extends Entry> = {
|
|
26
|
-
[E in TEntry as EscapeArrayKey<E['key']>]: E['value'];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Transforms array type to object
|
|
30
|
-
type CreateArrayEntry<TValue, TValueInitial> = OmitItself<
|
|
31
|
-
TValue extends unknown[] ? { [k: ArrayEncoder]: TValue[number] } : TValue,
|
|
32
|
-
TValueInitial
|
|
33
|
-
>;
|
|
34
|
-
|
|
35
|
-
// Omit the type that references itself
|
|
36
|
-
type OmitItself<TValue, TValueInitial> = TValue extends TValueInitial
|
|
37
|
-
? EmptyEntry<TValue>
|
|
38
|
-
: OmitExcludedTypes<TValue, TValueInitial>;
|
|
39
|
-
|
|
40
|
-
// Omit the type that is listed in ExcludedTypes union
|
|
41
|
-
type OmitExcludedTypes<TValue, TValueInitial> = TValue extends ExcludedTypes
|
|
42
|
-
? EmptyEntry<TValue>
|
|
43
|
-
: CreateObjectEntries<TValue, TValueInitial>;
|
|
44
|
-
|
|
45
|
-
type CreateObjectEntries<TValue, TValueInitial> = TValue extends object
|
|
46
|
-
? {
|
|
47
|
-
// Checks that Key is of type string
|
|
48
|
-
[TKey in keyof TValue]-?: TKey extends string
|
|
49
|
-
? // Nested key can be an object, run recursively to the bottom
|
|
50
|
-
CreateArrayEntry<TValue[TKey], TValueInitial> extends infer TNestedValue
|
|
51
|
-
? TNestedValue extends Entry
|
|
52
|
-
? TNestedValue['key'] extends ''
|
|
53
|
-
? {
|
|
54
|
-
key: TKey;
|
|
55
|
-
value: TNestedValue['value'];
|
|
56
|
-
}
|
|
57
|
-
:
|
|
58
|
-
| {
|
|
59
|
-
key: `${TKey}.${TNestedValue['key']}`;
|
|
60
|
-
value: TNestedValue['value'];
|
|
61
|
-
}
|
|
62
|
-
| {
|
|
63
|
-
key: TKey;
|
|
64
|
-
value: TValue[TKey];
|
|
65
|
-
}
|
|
66
|
-
: never
|
|
67
|
-
: never
|
|
68
|
-
: never;
|
|
69
|
-
}[keyof TValue] // Builds entry for each key
|
|
70
|
-
: EmptyEntry<TValue>;
|
|
71
|
-
|
|
72
|
-
export type ChangeProtoToJSPrimitives<T extends object> = {
|
|
73
|
-
[key in keyof T]: T[key] extends Uint8Array | Date ? string : T[key] extends object ? ChangeProtoToJSPrimitives<T[key]>: T[key];
|
|
74
|
-
// ^^^^ This line is used to convert Uint8Array to string, if you want to keep Uint8Array as is, you can remove this line
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
|
|
78
|
-
/** set parameter to `true` for call `securityWorker` for this request */
|
|
79
|
-
secure?: boolean;
|
|
80
|
-
/** request path */
|
|
81
|
-
path: string;
|
|
82
|
-
/** content type of request body */
|
|
83
|
-
type?: ContentType;
|
|
84
|
-
/** query params */
|
|
85
|
-
query?: QueryParamsType;
|
|
86
|
-
/** format of response (i.e. response.json() -> format: "json") */
|
|
87
|
-
format?: ResponseType;
|
|
88
|
-
/** request body */
|
|
89
|
-
body?: unknown;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
|
|
93
|
-
|
|
94
|
-
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, "data" | "cancelToken"> {
|
|
95
|
-
securityWorker?: (
|
|
96
|
-
securityData: SecurityDataType | null,
|
|
97
|
-
) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
98
|
-
secure?: boolean;
|
|
99
|
-
format?: ResponseType;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export enum ContentType {
|
|
103
|
-
Json = "application/json",
|
|
104
|
-
FormData = "multipart/form-data",
|
|
105
|
-
UrlEncoded = "application/x-www-form-urlencoded",
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export class HttpClient<SecurityDataType = unknown> {
|
|
109
|
-
public instance: AxiosInstance;
|
|
110
|
-
private securityData: SecurityDataType | null = null;
|
|
111
|
-
private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
|
|
112
|
-
private secure?: boolean;
|
|
113
|
-
private format?: ResponseType;
|
|
114
|
-
|
|
115
|
-
constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig<SecurityDataType> = {}) {
|
|
116
|
-
this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" });
|
|
117
|
-
this.secure = secure;
|
|
118
|
-
this.format = format;
|
|
119
|
-
this.securityWorker = securityWorker;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
public setSecurityData = (data: SecurityDataType | null) => {
|
|
123
|
-
this.securityData = data;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig {
|
|
127
|
-
return {
|
|
128
|
-
...this.instance.defaults,
|
|
129
|
-
...params1,
|
|
130
|
-
...(params2 || {}),
|
|
131
|
-
headers: {
|
|
132
|
-
...(this.instance.defaults.headers ),
|
|
133
|
-
...(params1.headers || {}),
|
|
134
|
-
...((params2 && params2.headers) || {}),
|
|
135
|
-
},
|
|
136
|
-
} as AxiosRequestConfig;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
private createFormData(input: Record<string, unknown>): FormData {
|
|
140
|
-
return Object.keys(input || {}).reduce((formData, key) => {
|
|
141
|
-
const property = input[key];
|
|
142
|
-
formData.append(
|
|
143
|
-
key,
|
|
144
|
-
property instanceof Blob
|
|
145
|
-
? property
|
|
146
|
-
: typeof property === "object" && property !== null
|
|
147
|
-
? JSON.stringify(property)
|
|
148
|
-
: `${property}`,
|
|
149
|
-
);
|
|
150
|
-
return formData;
|
|
151
|
-
}, new FormData());
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public request = async <T = any>({
|
|
155
|
-
secure,
|
|
156
|
-
path,
|
|
157
|
-
type,
|
|
158
|
-
query,
|
|
159
|
-
format,
|
|
160
|
-
body,
|
|
161
|
-
...params
|
|
162
|
-
}: FullRequestParams): Promise<AxiosResponse<T>> => {
|
|
163
|
-
const secureParams =
|
|
164
|
-
((typeof secure === "boolean" ? secure : this.secure) &&
|
|
165
|
-
this.securityWorker &&
|
|
166
|
-
(await this.securityWorker(this.securityData))) ||
|
|
167
|
-
{};
|
|
168
|
-
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
169
|
-
const responseFormat = (format && this.format) || void 0;
|
|
170
|
-
|
|
171
|
-
if (type === ContentType.FormData && body && body !== null && typeof body === "object") {
|
|
172
|
-
requestParams.headers.common = { Accept: "*/*" };
|
|
173
|
-
requestParams.headers.post = {};
|
|
174
|
-
requestParams.headers.put = {};
|
|
175
|
-
|
|
176
|
-
body = this.createFormData(body as Record<string, unknown>);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return this.instance.request({
|
|
180
|
-
...requestParams,
|
|
181
|
-
headers: {
|
|
182
|
-
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
|
|
183
|
-
...(requestParams.headers || {}),
|
|
184
|
-
},
|
|
185
|
-
params: query,
|
|
186
|
-
responseType: responseFormat,
|
|
187
|
-
data: body,
|
|
188
|
-
url: path,
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* @title ibc.applications.interchain_accounts.controller.v1
|
|
195
|
-
*/
|
|
196
|
-
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
197
|
-
/**
|
|
198
|
-
* QueryInterchainAccount
|
|
199
|
-
*
|
|
200
|
-
* @tags Query
|
|
201
|
-
* @name queryInterchainAccount
|
|
202
|
-
* @request GET:/ibc/apps/interchain_accounts/controller/v1/owners/{owner}/connections/{connection_id}
|
|
203
|
-
*/
|
|
204
|
-
queryInterchainAccount = (owner: string, connection_id: string,
|
|
205
|
-
query?: Record<string, any>,
|
|
206
|
-
params: RequestParams = {},
|
|
207
|
-
) =>
|
|
208
|
-
this.request<SnakeCasedPropertiesDeep<ChangeProtoToJSPrimitives<QueryInterchainAccountResponse>>>({
|
|
209
|
-
path: `/ibc/apps/interchain_accounts/controller/v1/owners/${owner}/connections/${connection_id}`,
|
|
210
|
-
method: "GET",
|
|
211
|
-
query: query,
|
|
212
|
-
format: "json",
|
|
213
|
-
...params,
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* QueryParams
|
|
218
|
-
*
|
|
219
|
-
* @tags Query
|
|
220
|
-
* @name queryParams
|
|
221
|
-
* @request GET:/ibc/apps/interchain_accounts/controller/v1/params
|
|
222
|
-
*/
|
|
223
|
-
queryParams = (
|
|
224
|
-
query?: Record<string, any>,
|
|
225
|
-
params: RequestParams = {},
|
|
226
|
-
) =>
|
|
227
|
-
this.request<SnakeCasedPropertiesDeep<ChangeProtoToJSPrimitives<QueryParamsResponse>>>({
|
|
228
|
-
path: `/ibc/apps/interchain_accounts/controller/v1/params`,
|
|
229
|
-
method: "GET",
|
|
230
|
-
query: query,
|
|
231
|
-
format: "json",
|
|
232
|
-
...params,
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// Generated by Ignite ignite.com/cli
|
|
2
|
-
|
|
3
|
-
import { SigningStargateClient, DeliverTxResponse, StdFee } from "@cosmjs/stargate";
|
|
4
|
-
import { EncodeObject, GeneratedType, OfflineSigner, Registry } from "@cosmjs/proto-signing";
|
|
5
|
-
import { msgTypes } from './registry';
|
|
6
|
-
import { IgniteClient } from "../client"
|
|
7
|
-
import { MissingWalletError } from "../helpers"
|
|
8
|
-
import { Api } from "./rest";
|
|
9
|
-
import { MsgUpdateParams } from "../types/ibc/applications/interchain_accounts/host/v1/tx";
|
|
10
|
-
import { MsgModuleQuerySafe } from "../types/ibc/applications/interchain_accounts/host/v1/tx";
|
|
11
|
-
|
|
12
|
-
import { Params as typeParams} from "./types"
|
|
13
|
-
import { QueryRequest as typeQueryRequest} from "./types"
|
|
14
|
-
|
|
15
|
-
export { MsgUpdateParams, MsgModuleQuerySafe };
|
|
16
|
-
|
|
17
|
-
type sendMsgUpdateParamsParams = {
|
|
18
|
-
value: MsgUpdateParams,
|
|
19
|
-
fee?: StdFee,
|
|
20
|
-
memo?: string
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
type sendMsgModuleQuerySafeParams = {
|
|
24
|
-
value: MsgModuleQuerySafe,
|
|
25
|
-
fee?: StdFee,
|
|
26
|
-
memo?: string
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
type msgUpdateParamsParams = {
|
|
31
|
-
value: MsgUpdateParams,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
type msgModuleQuerySafeParams = {
|
|
35
|
-
value: MsgModuleQuerySafe,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export const registry = new Registry(msgTypes);
|
|
40
|
-
|
|
41
|
-
type Field = {
|
|
42
|
-
name: string;
|
|
43
|
-
type: unknown;
|
|
44
|
-
}
|
|
45
|
-
function getStructure(template) {
|
|
46
|
-
const structure: {fields: Field[]} = { fields: [] }
|
|
47
|
-
for (let [key, value] of Object.entries(template)) {
|
|
48
|
-
let field = { name: key, type: typeof value }
|
|
49
|
-
structure.fields.push(field)
|
|
50
|
-
}
|
|
51
|
-
return structure
|
|
52
|
-
}
|
|
53
|
-
const defaultFee = {
|
|
54
|
-
amount: [],
|
|
55
|
-
gas: "200000",
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
interface TxClientOptions {
|
|
59
|
-
addr: string
|
|
60
|
-
prefix: string
|
|
61
|
-
signer?: OfflineSigner
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "http://localhost:26657", prefix: "cosmos" }) => {
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
|
|
68
|
-
async sendMsgUpdateParams({ value, fee, memo }: sendMsgUpdateParamsParams): Promise<DeliverTxResponse> {
|
|
69
|
-
if (!signer) {
|
|
70
|
-
throw new Error('TxClient:sendMsgUpdateParams: Unable to sign Tx. Signer is not present.')
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
const { address } = (await signer.getAccounts())[0];
|
|
74
|
-
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry});
|
|
75
|
-
let msg = this.msgUpdateParams({ value: MsgUpdateParams.fromPartial(value) })
|
|
76
|
-
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
77
|
-
} catch (e: any) {
|
|
78
|
-
throw new Error('TxClient:sendMsgUpdateParams: Could not broadcast Tx: '+ e.message)
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
async sendMsgModuleQuerySafe({ value, fee, memo }: sendMsgModuleQuerySafeParams): Promise<DeliverTxResponse> {
|
|
83
|
-
if (!signer) {
|
|
84
|
-
throw new Error('TxClient:sendMsgModuleQuerySafe: Unable to sign Tx. Signer is not present.')
|
|
85
|
-
}
|
|
86
|
-
try {
|
|
87
|
-
const { address } = (await signer.getAccounts())[0];
|
|
88
|
-
const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry});
|
|
89
|
-
let msg = this.msgModuleQuerySafe({ value: MsgModuleQuerySafe.fromPartial(value) })
|
|
90
|
-
return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo)
|
|
91
|
-
} catch (e: any) {
|
|
92
|
-
throw new Error('TxClient:sendMsgModuleQuerySafe: Could not broadcast Tx: '+ e.message)
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
msgUpdateParams({ value }: msgUpdateParamsParams): EncodeObject {
|
|
98
|
-
try {
|
|
99
|
-
return { typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", value: MsgUpdateParams.fromPartial( value ) }
|
|
100
|
-
} catch (e: any) {
|
|
101
|
-
throw new Error('TxClient:MsgUpdateParams: Could not create message: ' + e.message)
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
msgModuleQuerySafe({ value }: msgModuleQuerySafeParams): EncodeObject {
|
|
106
|
-
try {
|
|
107
|
-
return { typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", value: MsgModuleQuerySafe.fromPartial( value ) }
|
|
108
|
-
} catch (e: any) {
|
|
109
|
-
throw new Error('TxClient:MsgModuleQuerySafe: Could not create message: ' + e.message)
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
interface QueryClientOptions {
|
|
117
|
-
addr: string
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const queryClient = ({ addr: addr }: QueryClientOptions = { addr: "http://localhost:1317" }) => {
|
|
121
|
-
return new Api({ baseURL: addr });
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
class SDKModule {
|
|
125
|
-
public query: ReturnType<typeof queryClient>;
|
|
126
|
-
public tx: ReturnType<typeof txClient>;
|
|
127
|
-
public structure: Record<string,unknown>;
|
|
128
|
-
public registry: Array<[string, GeneratedType]> = [];
|
|
129
|
-
|
|
130
|
-
constructor(client: IgniteClient) {
|
|
131
|
-
|
|
132
|
-
this.query = queryClient({ addr: client.env.apiURL });
|
|
133
|
-
this.updateTX(client);
|
|
134
|
-
this.structure = {
|
|
135
|
-
Params: getStructure(typeParams.fromPartial({})),
|
|
136
|
-
QueryRequest: getStructure(typeQueryRequest.fromPartial({})),
|
|
137
|
-
|
|
138
|
-
};
|
|
139
|
-
client.on('signer-changed',(signer) => {
|
|
140
|
-
this.updateTX(client);
|
|
141
|
-
})
|
|
142
|
-
}
|
|
143
|
-
updateTX(client: IgniteClient) {
|
|
144
|
-
const methods = txClient({
|
|
145
|
-
signer: client.signer,
|
|
146
|
-
addr: client.env.rpcURL,
|
|
147
|
-
prefix: client.env.prefix ?? "cosmos",
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
this.tx = methods;
|
|
151
|
-
for (let m in methods) {
|
|
152
|
-
this.tx[m] = methods[m].bind(this.tx);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const IgntModule = (test: IgniteClient) => {
|
|
158
|
-
return {
|
|
159
|
-
module: {
|
|
160
|
-
IbcApplicationsInterchainAccountsHostV_1: new SDKModule(test)
|
|
161
|
-
},
|
|
162
|
-
registry: msgTypes
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
export default IgntModule;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgUpdateParams } from "../types/ibc/applications/interchain_accounts/host/v1/tx";
|
|
3
|
-
import { MsgModuleQuerySafe } from "../types/ibc/applications/interchain_accounts/host/v1/tx";
|
|
4
|
-
|
|
5
|
-
const msgTypes: Array<[string, GeneratedType]> = [
|
|
6
|
-
["/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", MsgUpdateParams],
|
|
7
|
-
["/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", MsgModuleQuerySafe],
|
|
8
|
-
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
export { msgTypes }
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
|
|
2
|
-
import { QueryParamsResponse } from "../types/ibc/applications/interchain_accounts/host/v1/query";
|
|
3
|
-
|
|
4
|
-
import { QueryParamsRequest } from "../types/ibc/applications/interchain_accounts/host/v1/query";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import type {SnakeCasedPropertiesDeep} from 'type-fest';
|
|
8
|
-
|
|
9
|
-
export type QueryParamsType = Record<string | number, any>;
|
|
10
|
-
|
|
11
|
-
export type FlattenObject<TValue> = CollapseEntries<CreateObjectEntries<TValue, TValue>>;
|
|
12
|
-
|
|
13
|
-
type Entry = { key: string; value: unknown };
|
|
14
|
-
type EmptyEntry<TValue> = { key: ''; value: TValue };
|
|
15
|
-
type ExcludedTypes = Date | Set<unknown> | Map<unknown, unknown>;
|
|
16
|
-
type ArrayEncoder = `[${bigint}]`;
|
|
17
|
-
|
|
18
|
-
type EscapeArrayKey<TKey extends string> = TKey extends `${infer TKeyBefore}.${ArrayEncoder}${infer TKeyAfter}`
|
|
19
|
-
? EscapeArrayKey<`${TKeyBefore}${ArrayEncoder}${TKeyAfter}`>
|
|
20
|
-
: TKey;
|
|
21
|
-
|
|
22
|
-
// Transforms entries to one flattened type
|
|
23
|
-
type CollapseEntries<TEntry extends Entry> = {
|
|
24
|
-
[E in TEntry as EscapeArrayKey<E['key']>]: E['value'];
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// Transforms array type to object
|
|
28
|
-
type CreateArrayEntry<TValue, TValueInitial> = OmitItself<
|
|
29
|
-
TValue extends unknown[] ? { [k: ArrayEncoder]: TValue[number] } : TValue,
|
|
30
|
-
TValueInitial
|
|
31
|
-
>;
|
|
32
|
-
|
|
33
|
-
// Omit the type that references itself
|
|
34
|
-
type OmitItself<TValue, TValueInitial> = TValue extends TValueInitial
|
|
35
|
-
? EmptyEntry<TValue>
|
|
36
|
-
: OmitExcludedTypes<TValue, TValueInitial>;
|
|
37
|
-
|
|
38
|
-
// Omit the type that is listed in ExcludedTypes union
|
|
39
|
-
type OmitExcludedTypes<TValue, TValueInitial> = TValue extends ExcludedTypes
|
|
40
|
-
? EmptyEntry<TValue>
|
|
41
|
-
: CreateObjectEntries<TValue, TValueInitial>;
|
|
42
|
-
|
|
43
|
-
type CreateObjectEntries<TValue, TValueInitial> = TValue extends object
|
|
44
|
-
? {
|
|
45
|
-
// Checks that Key is of type string
|
|
46
|
-
[TKey in keyof TValue]-?: TKey extends string
|
|
47
|
-
? // Nested key can be an object, run recursively to the bottom
|
|
48
|
-
CreateArrayEntry<TValue[TKey], TValueInitial> extends infer TNestedValue
|
|
49
|
-
? TNestedValue extends Entry
|
|
50
|
-
? TNestedValue['key'] extends ''
|
|
51
|
-
? {
|
|
52
|
-
key: TKey;
|
|
53
|
-
value: TNestedValue['value'];
|
|
54
|
-
}
|
|
55
|
-
:
|
|
56
|
-
| {
|
|
57
|
-
key: `${TKey}.${TNestedValue['key']}`;
|
|
58
|
-
value: TNestedValue['value'];
|
|
59
|
-
}
|
|
60
|
-
| {
|
|
61
|
-
key: TKey;
|
|
62
|
-
value: TValue[TKey];
|
|
63
|
-
}
|
|
64
|
-
: never
|
|
65
|
-
: never
|
|
66
|
-
: never;
|
|
67
|
-
}[keyof TValue] // Builds entry for each key
|
|
68
|
-
: EmptyEntry<TValue>;
|
|
69
|
-
|
|
70
|
-
export type ChangeProtoToJSPrimitives<T extends object> = {
|
|
71
|
-
[key in keyof T]: T[key] extends Uint8Array | Date ? string : T[key] extends object ? ChangeProtoToJSPrimitives<T[key]>: T[key];
|
|
72
|
-
// ^^^^ This line is used to convert Uint8Array to string, if you want to keep Uint8Array as is, you can remove this line
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
|
|
76
|
-
/** set parameter to `true` for call `securityWorker` for this request */
|
|
77
|
-
secure?: boolean;
|
|
78
|
-
/** request path */
|
|
79
|
-
path: string;
|
|
80
|
-
/** content type of request body */
|
|
81
|
-
type?: ContentType;
|
|
82
|
-
/** query params */
|
|
83
|
-
query?: QueryParamsType;
|
|
84
|
-
/** format of response (i.e. response.json() -> format: "json") */
|
|
85
|
-
format?: ResponseType;
|
|
86
|
-
/** request body */
|
|
87
|
-
body?: unknown;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
|
|
91
|
-
|
|
92
|
-
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, "data" | "cancelToken"> {
|
|
93
|
-
securityWorker?: (
|
|
94
|
-
securityData: SecurityDataType | null,
|
|
95
|
-
) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
96
|
-
secure?: boolean;
|
|
97
|
-
format?: ResponseType;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export enum ContentType {
|
|
101
|
-
Json = "application/json",
|
|
102
|
-
FormData = "multipart/form-data",
|
|
103
|
-
UrlEncoded = "application/x-www-form-urlencoded",
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export class HttpClient<SecurityDataType = unknown> {
|
|
107
|
-
public instance: AxiosInstance;
|
|
108
|
-
private securityData: SecurityDataType | null = null;
|
|
109
|
-
private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
|
|
110
|
-
private secure?: boolean;
|
|
111
|
-
private format?: ResponseType;
|
|
112
|
-
|
|
113
|
-
constructor({ securityWorker, secure, format, ...axiosConfig }: ApiConfig<SecurityDataType> = {}) {
|
|
114
|
-
this.instance = axios.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "" });
|
|
115
|
-
this.secure = secure;
|
|
116
|
-
this.format = format;
|
|
117
|
-
this.securityWorker = securityWorker;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
public setSecurityData = (data: SecurityDataType | null) => {
|
|
121
|
-
this.securityData = data;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
private mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig {
|
|
125
|
-
return {
|
|
126
|
-
...this.instance.defaults,
|
|
127
|
-
...params1,
|
|
128
|
-
...(params2 || {}),
|
|
129
|
-
headers: {
|
|
130
|
-
...(this.instance.defaults.headers ),
|
|
131
|
-
...(params1.headers || {}),
|
|
132
|
-
...((params2 && params2.headers) || {}),
|
|
133
|
-
},
|
|
134
|
-
} as AxiosRequestConfig;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
private createFormData(input: Record<string, unknown>): FormData {
|
|
138
|
-
return Object.keys(input || {}).reduce((formData, key) => {
|
|
139
|
-
const property = input[key];
|
|
140
|
-
formData.append(
|
|
141
|
-
key,
|
|
142
|
-
property instanceof Blob
|
|
143
|
-
? property
|
|
144
|
-
: typeof property === "object" && property !== null
|
|
145
|
-
? JSON.stringify(property)
|
|
146
|
-
: `${property}`,
|
|
147
|
-
);
|
|
148
|
-
return formData;
|
|
149
|
-
}, new FormData());
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
public request = async <T = any>({
|
|
153
|
-
secure,
|
|
154
|
-
path,
|
|
155
|
-
type,
|
|
156
|
-
query,
|
|
157
|
-
format,
|
|
158
|
-
body,
|
|
159
|
-
...params
|
|
160
|
-
}: FullRequestParams): Promise<AxiosResponse<T>> => {
|
|
161
|
-
const secureParams =
|
|
162
|
-
((typeof secure === "boolean" ? secure : this.secure) &&
|
|
163
|
-
this.securityWorker &&
|
|
164
|
-
(await this.securityWorker(this.securityData))) ||
|
|
165
|
-
{};
|
|
166
|
-
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
167
|
-
const responseFormat = (format && this.format) || void 0;
|
|
168
|
-
|
|
169
|
-
if (type === ContentType.FormData && body && body !== null && typeof body === "object") {
|
|
170
|
-
requestParams.headers.common = { Accept: "*/*" };
|
|
171
|
-
requestParams.headers.post = {};
|
|
172
|
-
requestParams.headers.put = {};
|
|
173
|
-
|
|
174
|
-
body = this.createFormData(body as Record<string, unknown>);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return this.instance.request({
|
|
178
|
-
...requestParams,
|
|
179
|
-
headers: {
|
|
180
|
-
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
|
|
181
|
-
...(requestParams.headers || {}),
|
|
182
|
-
},
|
|
183
|
-
params: query,
|
|
184
|
-
responseType: responseFormat,
|
|
185
|
-
data: body,
|
|
186
|
-
url: path,
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* @title ibc.applications.interchain_accounts.host.v1
|
|
193
|
-
*/
|
|
194
|
-
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
195
|
-
/**
|
|
196
|
-
* QueryParams
|
|
197
|
-
*
|
|
198
|
-
* @tags Query
|
|
199
|
-
* @name queryParams
|
|
200
|
-
* @request GET:/ibc/apps/interchain_accounts/host/v1/params
|
|
201
|
-
*/
|
|
202
|
-
queryParams = (
|
|
203
|
-
query?: Record<string, any>,
|
|
204
|
-
params: RequestParams = {},
|
|
205
|
-
) =>
|
|
206
|
-
this.request<SnakeCasedPropertiesDeep<ChangeProtoToJSPrimitives<QueryParamsResponse>>>({
|
|
207
|
-
path: `/ibc/apps/interchain_accounts/host/v1/params`,
|
|
208
|
-
method: "GET",
|
|
209
|
-
query: query,
|
|
210
|
-
format: "json",
|
|
211
|
-
...params,
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
}
|