-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ibc transfer * add query denom-trace、 query denom-traces、query params、query rscrow Address * update ibc-transfer coin denom * update go.mod * add all ibc query * update ibc * add query tx * add query header * update ibc private key type * update ibc private key type Co-authored-by: finefine <[email protected]>
- Loading branch information
Showing
11 changed files
with
1,248 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package exposed | ||
|
||
import ( | ||
gosdktypes "github.com/okex/exchain-go-sdk/types" | ||
|
||
sdk "github.com/okex/exchain/libs/cosmos-sdk/types" | ||
"github.com/okex/exchain/libs/cosmos-sdk/types/query" | ||
ibcTypes "github.com/okex/exchain/libs/ibc-go/modules/apps/transfer/types" | ||
client_types "github.com/okex/exchain/libs/ibc-go/modules/core/02-client/types" | ||
chantypes "github.com/okex/exchain/libs/ibc-go/modules/core/04-channel/types" | ||
ibcexported "github.com/okex/exchain/libs/ibc-go/modules/core/exported" | ||
tmcrypto "github.com/okex/exchain/libs/tendermint/crypto" | ||
ctypes "github.com/okex/exchain/libs/tendermint/rpc/core/types" | ||
) | ||
|
||
// Ibc shows the expected behavior for inner ibc client | ||
type Ibc interface { | ||
gosdktypes.Module | ||
IbcTx | ||
IbcQuery | ||
} | ||
|
||
// IbcTx send ibc tx | ||
type IbcTx interface { | ||
|
||
// Transfer transfer token to destination chain | ||
Transfer(priKey tmcrypto.PrivKey, srcChannel string, receiver string, amount string, fee sdk.CoinAdapters, memo string, timeoutHeight client_types.Height) (resp sdk.TxResponse, err error) | ||
} | ||
|
||
// IbcQuery shows the ibc query info | ||
type IbcQuery interface { | ||
|
||
// QueryDenomTrace query a a denomination trace from a given hash. | ||
QueryDenomTrace(hash string) (*ibcTypes.QueryDenomTraceResponse, error) | ||
|
||
// QueryDenomTraces query all the denomination trace infos. | ||
QueryDenomTraces(page *query.PageRequest) (*ibcTypes.QueryDenomTracesResponse, error) | ||
|
||
// QueryIbcParams ibc-transfer parameter querying. | ||
QueryIbcParams() (*ibcTypes.QueryParamsResponse, error) | ||
|
||
// QueryEscrowAddress ibc-transfer parameter querying. | ||
QueryEscrowAddress(portID, channelID string) sdk.AccAddress | ||
|
||
// QueryChannels query channels | ||
QueryChannels() (*chantypes.QueryChannelsResponse, error) | ||
|
||
// QueryTx query a tx | ||
QueryTx(hash string) (*ctypes.ResultTx, error) | ||
|
||
// QueryTxs | ||
QueryTxs(page, limit int, events []string) ([]*ctypes.ResultTx, error) | ||
|
||
// QueryHeaderAtHeight | ||
QueryHeaderAtHeight(height int64) (ibcexported.Header, error) | ||
|
||
// QueryChannel | ||
QueryChannel(req *chantypes.QueryChannelRequest) (*chantypes.QueryChannelResponse, error) | ||
|
||
// ConnectionChannels queries all the channels associated with a connection | ||
// end. | ||
ConnectionChannels(req *chantypes.QueryConnectionChannelsRequest) (*chantypes.QueryConnectionChannelsResponse, error) | ||
// ChannelClientState queries for the client state for the channel associated | ||
// with the provided channel identifiers. | ||
ChannelClientState(req *chantypes.QueryChannelClientStateRequest) (*chantypes.QueryChannelClientStateResponse, error) | ||
// ChannelConsensusState queries for the consensus state for the channel | ||
// associated with the provided channel identifiers. | ||
ChannelConsensusState(req *chantypes.QueryChannelConsensusStateRequest) (*chantypes.QueryChannelConsensusStateResponse, error) | ||
// PacketCommitment queries a stored packet commitment hash. | ||
PacketCommitment(req *chantypes.QueryPacketCommitmentRequest) (*chantypes.QueryPacketCommitmentResponse, error) | ||
// PacketCommitments returns all the packet commitments hashes associated | ||
// with a channel. | ||
PacketCommitments(req *chantypes.QueryPacketCommitmentsRequest) (*chantypes.QueryPacketCommitmentsResponse, error) | ||
// PacketReceipt queries if a given packet sequence has been received on the | ||
// queried chain | ||
PacketReceipt(req *chantypes.QueryPacketReceiptRequest) (*chantypes.QueryPacketReceiptResponse, error) | ||
// PacketAcknowledgement queries a stored packet acknowledgement hash. | ||
PacketAcknowledgement(req *chantypes.QueryPacketAcknowledgementRequest) (*chantypes.QueryPacketAcknowledgementResponse, error) | ||
// PacketAcknowledgements returns all the packet acknowledgements associated | ||
// with a channel. | ||
PacketAcknowledgements(req *chantypes.QueryPacketAcknowledgementsRequest) (*chantypes.QueryPacketAcknowledgementsResponse, error) | ||
// UnreceivedPackets returns all the unreceived IBC packets associated with a | ||
// channel and sequences. | ||
UnreceivedPackets(req *chantypes.QueryUnreceivedPacketsRequest) (*chantypes.QueryUnreceivedPacketsResponse, error) | ||
// UnreceivedAcks returns all the unreceived IBC acknowledgements associated | ||
// with a channel and sequences. | ||
UnreceivedAcks(req *chantypes.QueryUnreceivedAcksRequest) (*chantypes.QueryUnreceivedAcksResponse, error) | ||
// NextSequenceReceive returns the next receive sequence for a given channel. | ||
NextSequenceReceive(req *chantypes.QueryNextSequenceReceiveRequest) (*chantypes.QueryNextSequenceReceiveResponse, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.