-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: chore msg factories * fix: fix CI * fix: fix build * fix: coverage
- Loading branch information
Showing
14 changed files
with
461 additions
and
29 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
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
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,88 @@ | ||
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing" | ||
import { | ||
MsgCancelFeeShare, | ||
MsgRegisterFeeShare, | ||
MsgUpdateFeeShare, | ||
MsgUpdateParams, | ||
} from "../../protojs/nibiru/devgas/v1/tx" | ||
import { TxMessage } from ".." | ||
|
||
const protobufPackage = "nibiru.devgas.v1" | ||
|
||
export const DEVGAS_MSG_TYPE_URLS = { | ||
MsgCancelFeeShare: `/${protobufPackage}.MsgCancelFeeShare`, | ||
MsgRegisterFeeShare: `/${protobufPackage}.MsgRegisterFeeShare`, | ||
MsgUpdateFeeShare: `/${protobufPackage}.MsgUpdateFeeShare`, | ||
MsgUpdateParams: `/${protobufPackage}.MsgUpdateParams`, | ||
} | ||
|
||
export const devgasTypes: ReadonlyArray<[string, GeneratedType]> = [ | ||
[DEVGAS_MSG_TYPE_URLS.MsgCancelFeeShare, MsgCancelFeeShare], | ||
[DEVGAS_MSG_TYPE_URLS.MsgRegisterFeeShare, MsgRegisterFeeShare], | ||
[DEVGAS_MSG_TYPE_URLS.MsgUpdateFeeShare, MsgUpdateFeeShare], | ||
[DEVGAS_MSG_TYPE_URLS.MsgUpdateParams, MsgUpdateParams], | ||
] | ||
|
||
export interface MsgCancelFeeShareEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgCancelFeeShare> | ||
} | ||
|
||
export const isMsgCancelFeeShareEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgCancelFeeShare | ||
|
||
export interface MsgRegisterFeeShareEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgRegisterFeeShare> | ||
} | ||
|
||
export const isMsgRegisterFeeShareEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgRegisterFeeShare | ||
|
||
export interface MsgUpdateFeeShareEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgUpdateFeeShare> | ||
} | ||
|
||
export const isMsgUpdateFeeShareEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgUpdateFeeShare | ||
|
||
export interface MsgUpdateParamsEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgUpdateParams> | ||
} | ||
|
||
export const isMsgUpdateParamsEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === DEVGAS_MSG_TYPE_URLS.MsgUpdateParams | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
export class DevgasMsgFactory { | ||
static cancelFeeShare(msg: MsgCancelFeeShare): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgCancelFeeShare`, | ||
value: MsgCancelFeeShare.fromPartial(msg), | ||
} | ||
} | ||
|
||
static registerFeeShare(msg: MsgRegisterFeeShare): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgRegisterFeeShare`, | ||
value: MsgRegisterFeeShare.fromPartial(msg), | ||
} | ||
} | ||
|
||
static MsgUpdateFeeShare(msg: MsgUpdateFeeShare): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgUpdateFeeShare`, | ||
value: MsgUpdateFeeShare.fromPartial(msg), | ||
} | ||
} | ||
|
||
static updateParams(msg: MsgUpdateParams): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgUpdateParams`, | ||
value: MsgUpdateParams.fromPartial(msg), | ||
} | ||
} | ||
} |
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
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,53 @@ | ||
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing" | ||
import { | ||
MsgEditInflationParams, | ||
MsgToggleInflation, | ||
} from "../../protojs/nibiru/inflation/v1/tx" | ||
import { TxMessage } from ".." | ||
|
||
const protobufPackage = "nibiru.inflation.v1" | ||
|
||
export const INFLATION_MSG_TYPE_URLS = { | ||
MsgEditInflationParams: `/${protobufPackage}.MsgEditInflationParams`, | ||
MsgToggleInflation: `/${protobufPackage}.MsgToggleInflation`, | ||
} | ||
|
||
export const inflationTypes: ReadonlyArray<[string, GeneratedType]> = [ | ||
[INFLATION_MSG_TYPE_URLS.MsgEditInflationParams, MsgEditInflationParams], | ||
[INFLATION_MSG_TYPE_URLS.MsgToggleInflation, MsgToggleInflation], | ||
] | ||
|
||
export interface MsgEditInflationParamsEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgEditInflationParams> | ||
} | ||
|
||
export const isMsgEditInflationParamsEncodeObject = ( | ||
encodeObject: EncodeObject | ||
) => encodeObject.typeUrl === INFLATION_MSG_TYPE_URLS.MsgEditInflationParams | ||
|
||
export interface MsgToggleInflationEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgToggleInflation> | ||
} | ||
|
||
export const isMsgToggleInflationEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === INFLATION_MSG_TYPE_URLS.MsgToggleInflation | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
export class InflationMsgFactory { | ||
static editInflationParams(msg: MsgEditInflationParams): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgEditInflationParams`, | ||
value: MsgEditInflationParams.fromPartial(msg), | ||
} | ||
} | ||
|
||
static toggleInflation(msg: MsgToggleInflation): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgToggleInflation`, | ||
value: MsgToggleInflation.fromPartial(msg), | ||
} | ||
} | ||
} |
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,103 @@ | ||
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing" | ||
import { | ||
MsgAggregateExchangeRatePrevote, | ||
MsgAggregateExchangeRateVote, | ||
MsgDelegateFeedConsent, | ||
MsgEditOracleParams, | ||
} from "../../protojs/nibiru/oracle/v1/tx" | ||
import { TxMessage } from ".." | ||
|
||
const protobufPackage = "nibiru.oracle.v1" | ||
|
||
export const ORACLE_MSG_TYPE_URLS = { | ||
MsgAggregateExchangeRatePrevote: `/${protobufPackage}.MsgAggregateExchangeRatePrevote`, | ||
MsgAggregateExchangeRateVote: `/${protobufPackage}.MsgAggregateExchangeRateVote`, | ||
MsgDelegateFeedConsent: `/${protobufPackage}.MsgDelegateFeedConsent`, | ||
MsgEditOracleParams: `/${protobufPackage}.MsgEditOracleParams`, | ||
} | ||
|
||
export const oracleTypes: ReadonlyArray<[string, GeneratedType]> = [ | ||
[ | ||
ORACLE_MSG_TYPE_URLS.MsgAggregateExchangeRatePrevote, | ||
MsgAggregateExchangeRatePrevote, | ||
], | ||
[ | ||
ORACLE_MSG_TYPE_URLS.MsgAggregateExchangeRateVote, | ||
MsgAggregateExchangeRateVote, | ||
], | ||
[ORACLE_MSG_TYPE_URLS.MsgDelegateFeedConsent, MsgDelegateFeedConsent], | ||
[ORACLE_MSG_TYPE_URLS.MsgEditOracleParams, MsgEditOracleParams], | ||
] | ||
|
||
export interface MsgAggregateExchangeRatePrevoteEncodeObject | ||
extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgAggregateExchangeRatePrevote> | ||
} | ||
|
||
export const isMsgAggregateExchangeRatePrevoteEncodeObject = ( | ||
encodeObject: EncodeObject | ||
) => | ||
encodeObject.typeUrl === ORACLE_MSG_TYPE_URLS.MsgAggregateExchangeRatePrevote | ||
|
||
export interface MsgAggregateExchangeRateVoteEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgAggregateExchangeRateVote> | ||
} | ||
|
||
export const isMsgAggregateExchangeRateVoteEncodeObject = ( | ||
encodeObject: EncodeObject | ||
) => encodeObject.typeUrl === ORACLE_MSG_TYPE_URLS.MsgAggregateExchangeRateVote | ||
|
||
export interface MsgDelegateFeedConsentEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgDelegateFeedConsent> | ||
} | ||
|
||
export const isMsgDelegateFeedConsentEncodeObject = ( | ||
encodeObject: EncodeObject | ||
) => encodeObject.typeUrl === ORACLE_MSG_TYPE_URLS.MsgDelegateFeedConsent | ||
|
||
export interface MsgEditOracleParamsEncodeObject extends EncodeObject { | ||
readonly typeUrl: string | ||
readonly value: Partial<MsgEditOracleParams> | ||
} | ||
|
||
export const isMsgEditOracleParamsEncodeObject = (encodeObject: EncodeObject) => | ||
encodeObject.typeUrl === ORACLE_MSG_TYPE_URLS.MsgEditOracleParams | ||
|
||
// ---------------------------------------------------------------------------- | ||
|
||
export class OracleMsgFactory { | ||
static aggregateExchangeRatePrevote( | ||
msg: MsgAggregateExchangeRatePrevote | ||
): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgAggregateExchangeRatePrevote`, | ||
value: MsgAggregateExchangeRatePrevote.fromPartial(msg), | ||
} | ||
} | ||
|
||
static aggregateExchangeRateVote( | ||
msg: MsgAggregateExchangeRateVote | ||
): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgAggregateExchangeRateVote`, | ||
value: MsgAggregateExchangeRateVote.fromPartial(msg), | ||
} | ||
} | ||
|
||
static delegateFeedConsent(msg: MsgDelegateFeedConsent): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgDelegateFeedConsent`, | ||
value: MsgDelegateFeedConsent.fromPartial(msg), | ||
} | ||
} | ||
|
||
static editOracleParams(msg: MsgEditOracleParams): TxMessage { | ||
return { | ||
typeUrl: `/${protobufPackage}.MsgEditOracleParams`, | ||
value: MsgEditOracleParams.fromPartial(msg), | ||
} | ||
} | ||
} |
Oops, something went wrong.