Skip to content

Commit 4c9cb0b

Browse files
Merge pull request #55 from InjectiveLabs/f/support-fee-discount-query
Misc: Support fee discount query + devnet-1
2 parents 9df862d + 2b58c06 commit 4c9cb0b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

client/chain/chain.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type ChainClient interface {
8383
DefaultSubaccount(acc cosmtypes.AccAddress) eth.Hash
8484

8585
GetSubAccountNonce(ctx context.Context, subaccountId eth.Hash) (*exchangetypes.QuerySubaccountTradeNonceResponse, error)
86+
GetFeeDiscountInfo(ctx context.Context, account string) (*exchangetypes.QueryFeeDiscountAccountInfoResponse, error)
8687
ComputeOrderHashes(spotOrders []exchangetypes.SpotOrder, derivativeOrders []exchangetypes.DerivativeOrder) (OrderHashes, error)
8788

8889
SpotOrder(defaultSubaccountID eth.Hash, network common.Network, d *SpotOrderData) *exchangetypes.SpotOrder
@@ -416,6 +417,13 @@ func (c *chainClient) SyncBroadcastMsg(msgs ...sdk.Msg) (*txtypes.BroadcastTxRes
416417
return res, nil
417418
}
418419

420+
func (c *chainClient) GetFeeDiscountInfo(ctx context.Context, account string) (*exchangetypes.QueryFeeDiscountAccountInfoResponse, error) {
421+
req := &exchangetypes.QueryFeeDiscountAccountInfoRequest{
422+
Account: account,
423+
}
424+
return c.exchangeQueryClient.FeeDiscountAccountInfo(ctx, req)
425+
}
426+
419427
func (c *chainClient) SimulateMsg(clientCtx client.Context, msgs ...sdk.Msg) (*txtypes.SimulateResponse, error) {
420428
c.txFactory = c.txFactory.WithSequence(c.accSeq)
421429
c.txFactory = c.txFactory.WithAccountNumber(c.accNum)

client/common/network.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ func getFileAbsPath(relativePath string) string {
2929
}
3030

3131
func LoadNetwork(name string, node string) Network {
32-
if name == "devnet" {
32+
if name == "devnet-1" {
33+
return Network{
34+
LcdEndpoint: "https://devnet-1.lcd.injective.dev",
35+
TmEndpoint: "https://devnet-1.tm.injective.dev:443",
36+
ChainGrpcEndpoint: "tcp://devnet-1.grpc.injective.dev:9900",
37+
ExchangeGrpcEndpoint: "tcp://devnet-1.api.injective.dev:9910",
38+
ChainId: "injective-777",
39+
Fee_denom: "inj",
40+
Name: "devnet-1",
41+
}
42+
} else if name == "devnet" {
3343
return Network{
3444
LcdEndpoint: "https://devnet.lcd.injective.dev",
3545
TmEndpoint: "https://devnet.tm.injective.dev:443",

0 commit comments

Comments
 (0)