-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.go
29 lines (26 loc) · 917 Bytes
/
utils.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package utils
import (
"github.com/ci123chain/ci123chain/pkg/abci/types/pagination"
"github.com/ci123chain/ci123chain/pkg/client/context"
"github.com/ci123chain/ci123chain/pkg/ibc"
"github.com/ci123chain/ci123chain/pkg/ibc/application/transfer/types"
ibcclient "github.com/ci123chain/ci123chain/pkg/ibc/core/client"
)
func QueryDenomTraces(clientCtx context.Context, offset, limit uint64) (*types.QueryDenomTracesResponse, error) {
path := "/custom/" + ibc.ModuleName + "/" + types.QueryDenomTraces
req := &types.QueryDenomTracesRequest{
Pagination: &pagination.PageRequest{
Offset: offset,
Limit: limit,
CountTotal: true,
},
}
key := clientCtx.Cdc.MustMarshalJSON(req)
value, _, err := ibcclient.QueryABCI(clientCtx, path, key, false)
if err != nil {
return nil, err
}
var resp types.QueryDenomTracesResponse
clientCtx.Cdc.MustUnmarshalJSON(value, &resp)
return &resp, nil
}