Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export interface AffiliateTiersSDKType {
export interface AffiliateTiers_Tier {
/** Required all-time referred volume in quote quantums. */
reqReferredVolumeQuoteQuantums: Long;
/** Required currently staked native tokens (in whole coins). */
/**
* Required currently staked native tokens (in whole coins).
* This is deprecated
*/

/** @deprecated */

reqStakedWholeCoins: number;
/** Taker fee share in parts-per-million. */
Expand All @@ -29,7 +34,12 @@ export interface AffiliateTiers_Tier {
export interface AffiliateTiers_TierSDKType {
/** Required all-time referred volume in quote quantums. */
req_referred_volume_quote_quantums: Long;
/** Required currently staked native tokens (in whole coins). */
/**
* Required currently staked native tokens (in whole coins).
* This is deprecated
*/

/** @deprecated */

req_staked_whole_coins: number;
/** Taker fee share in parts-per-million. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export interface AffiliateInfoResponse {
/** The affiliate's 30d referred volume in quote quantums. */

referredVolume_30dRolling: Uint8Array;
/** The affiliate's 30d attributed volume in quote quantums (from referees). */

attributedVolume_30dRolling: Uint8Array;
}
/**
* AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC
Expand Down Expand Up @@ -80,6 +83,9 @@ export interface AffiliateInfoResponseSDKType {
/** The affiliate's 30d referred volume in quote quantums. */

referred_volume_30d_rolling: Uint8Array;
/** The affiliate's 30d attributed volume in quote quantums (from referees). */

attributed_volume_30d_rolling: Uint8Array;
}
/** ReferredByRequest is the request type for the Query/ReferredBy RPC method. */

Expand Down Expand Up @@ -272,7 +278,8 @@ function createBaseAffiliateInfoResponse(): AffiliateInfoResponse {
feeSharePpm: 0,
referredVolume: new Uint8Array(),
stakedAmount: new Uint8Array(),
referredVolume_30dRolling: new Uint8Array()
referredVolume_30dRolling: new Uint8Array(),
attributedVolume_30dRolling: new Uint8Array()
};
}

Expand Down Expand Up @@ -302,6 +309,10 @@ export const AffiliateInfoResponse = {
writer.uint32(50).bytes(message.referredVolume_30dRolling);
}

if (message.attributedVolume_30dRolling.length !== 0) {
writer.uint32(58).bytes(message.attributedVolume_30dRolling);
}

return writer;
},

Expand Down Expand Up @@ -338,6 +349,10 @@ export const AffiliateInfoResponse = {
message.referredVolume_30dRolling = reader.bytes();
break;

case 7:
message.attributedVolume_30dRolling = reader.bytes();
break;

default:
reader.skipType(tag & 7);
break;
Expand All @@ -355,6 +370,7 @@ export const AffiliateInfoResponse = {
message.referredVolume = object.referredVolume ?? new Uint8Array();
message.stakedAmount = object.stakedAmount ?? new Uint8Array();
message.referredVolume_30dRolling = object.referredVolume_30dRolling ?? new Uint8Array();
message.attributedVolume_30dRolling = object.attributedVolume_30dRolling ?? new Uint8Array();
return message;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,42 @@ export interface MsgSendFromModuleToAccountSDKType {

coin?: CoinSDKType;
}
/**
* MsgSendFromAccountToAccount represents a single transfer from one
* `x/bank` account to another `x/bank` account.
* Should only be executed by governance.
*/

export interface MsgSendFromAccountToAccount {
authority: string;
/** The sender account address. */

sender: string;
/** The recipient account address. */

recipient: string;
/** The coin to transfer, which specifies both denom and amount. */

coin?: Coin;
}
/**
* MsgSendFromAccountToAccount represents a single transfer from one
* `x/bank` account to another `x/bank` account.
* Should only be executed by governance.
*/

export interface MsgSendFromAccountToAccountSDKType {
authority: string;
/** The sender account address. */

sender: string;
/** The recipient account address. */

recipient: string;
/** The coin to transfer, which specifies both denom and amount. */

coin?: CoinSDKType;
}

function createBaseTransfer(): Transfer {
return {
Expand Down Expand Up @@ -447,4 +483,79 @@ export const MsgSendFromModuleToAccount = {
return message;
}

};

function createBaseMsgSendFromAccountToAccount(): MsgSendFromAccountToAccount {
return {
authority: "",
sender: "",
recipient: "",
coin: undefined
};
}

export const MsgSendFromAccountToAccount = {
encode(message: MsgSendFromAccountToAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}

if (message.sender !== "") {
writer.uint32(18).string(message.sender);
}

if (message.recipient !== "") {
writer.uint32(26).string(message.recipient);
}

if (message.coin !== undefined) {
Coin.encode(message.coin, writer.uint32(34).fork()).ldelim();
}

return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendFromAccountToAccount {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgSendFromAccountToAccount();

while (reader.pos < end) {
const tag = reader.uint32();

switch (tag >>> 3) {
case 1:
message.authority = reader.string();
break;

case 2:
message.sender = reader.string();
break;

case 3:
message.recipient = reader.string();
break;

case 4:
message.coin = Coin.decode(reader, reader.uint32());
break;

default:
reader.skipType(tag & 7);
break;
}
}

return message;
},

fromPartial(object: DeepPartial<MsgSendFromAccountToAccount>): MsgSendFromAccountToAccount {
const message = createBaseMsgSendFromAccountToAccount();
message.authority = object.authority ?? "";
message.sender = object.sender ?? "";
message.recipient = object.recipient ?? "";
message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined;
return message;
}

};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MsgDepositToSubaccount, MsgWithdrawFromSubaccount, MsgSendFromModuleToAccount } from "./transfer";
import { MsgDepositToSubaccount, MsgWithdrawFromSubaccount, MsgSendFromModuleToAccount, MsgSendFromAccountToAccount } from "./transfer";
import { Rpc } from "../../helpers";
import * as _m0 from "protobufjs/minimal";
import { MsgCreateTransfer, MsgCreateTransferResponse, MsgDepositToSubaccountResponse, MsgWithdrawFromSubaccountResponse, MsgSendFromModuleToAccountResponse } from "./tx";
import { MsgCreateTransfer, MsgCreateTransferResponse, MsgDepositToSubaccountResponse, MsgWithdrawFromSubaccountResponse, MsgSendFromModuleToAccountResponse, MsgSendFromAccountToAccountResponse } from "./tx";
/** Msg defines the Msg service. */

export interface Msg {
Expand All @@ -25,6 +25,12 @@ export interface Msg {
*/

sendFromModuleToAccount(request: MsgSendFromModuleToAccount): Promise<MsgSendFromModuleToAccountResponse>;
/**
* SendFromAccountToAccount initiates a new transfer from an `x/bank` account
* to another `x/bank` account (should only be executed by governance).
*/

sendFromAccountToAccount(request: MsgSendFromAccountToAccount): Promise<MsgSendFromAccountToAccountResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
Expand All @@ -35,6 +41,7 @@ export class MsgClientImpl implements Msg {
this.depositToSubaccount = this.depositToSubaccount.bind(this);
this.withdrawFromSubaccount = this.withdrawFromSubaccount.bind(this);
this.sendFromModuleToAccount = this.sendFromModuleToAccount.bind(this);
this.sendFromAccountToAccount = this.sendFromAccountToAccount.bind(this);
}

createTransfer(request: MsgCreateTransfer): Promise<MsgCreateTransferResponse> {
Expand All @@ -61,4 +68,10 @@ export class MsgClientImpl implements Msg {
return promise.then(data => MsgSendFromModuleToAccountResponse.decode(new _m0.Reader(data)));
}

sendFromAccountToAccount(request: MsgSendFromAccountToAccount): Promise<MsgSendFromAccountToAccountResponse> {
const data = MsgSendFromAccountToAccount.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.sending.Msg", "SendFromAccountToAccount", data);
return promise.then(data => MsgSendFromAccountToAccountResponse.decode(new _m0.Reader(data)));
}

}
46 changes: 46 additions & 0 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/sending/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ export interface MsgSendFromModuleToAccountResponse {}
*/

export interface MsgSendFromModuleToAccountResponseSDKType {}
/**
* MsgSendFromAccountToAccountResponse is a response type used for new
* account-to-account transfers.
*/

export interface MsgSendFromAccountToAccountResponse {}
/**
* MsgSendFromAccountToAccountResponse is a response type used for new
* account-to-account transfers.
*/

export interface MsgSendFromAccountToAccountResponseSDKType {}

function createBaseMsgCreateTransfer(): MsgCreateTransfer {
return {
Expand Down Expand Up @@ -235,4 +247,38 @@ export const MsgSendFromModuleToAccountResponse = {
return message;
}

};

function createBaseMsgSendFromAccountToAccountResponse(): MsgSendFromAccountToAccountResponse {
return {};
}

export const MsgSendFromAccountToAccountResponse = {
encode(_: MsgSendFromAccountToAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendFromAccountToAccountResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgSendFromAccountToAccountResponse();

while (reader.pos < end) {
const tag = reader.uint32();

switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}

return message;
},

fromPartial(_: DeepPartial<MsgSendFromAccountToAccountResponse>): MsgSendFromAccountToAccountResponse {
const message = createBaseMsgSendFromAccountToAccountResponse();
return message;
}

};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LCDClient } from "@osmonauts/lcd";
import { QueryParamsRequest, QueryParamsResponseSDKType, QueryStatsMetadataRequest, QueryStatsMetadataResponseSDKType, QueryGlobalStatsRequest, QueryGlobalStatsResponseSDKType, QueryUserStatsRequest, QueryUserStatsResponseSDKType } from "./query";
import { QueryParamsRequest, QueryParamsResponseSDKType, QueryStatsMetadataRequest, QueryStatsMetadataResponseSDKType, QueryGlobalStatsRequest, QueryGlobalStatsResponseSDKType, QueryUserStatsRequest, QueryUserStatsResponseSDKType, QueryEpochStatsRequest, QueryEpochStatsResponseSDKType } from "./query";
export class LCDQueryClient {
req: LCDClient;

Expand All @@ -13,6 +13,7 @@ export class LCDQueryClient {
this.statsMetadata = this.statsMetadata.bind(this);
this.globalStats = this.globalStats.bind(this);
this.userStats = this.userStats.bind(this);
this.epochStats = this.epochStats.bind(this);
}
/* Queries the Params. */

Expand Down Expand Up @@ -50,5 +51,12 @@ export class LCDQueryClient {
const endpoint = `dydxprotocol/v4/stats/user_stats`;
return await this.req.get<QueryUserStatsResponseSDKType>(endpoint, options);
}
/* Queries EpochStats for a specific epoch. */


async epochStats(params: QueryEpochStatsRequest): Promise<QueryEpochStatsResponseSDKType> {
const endpoint = `dydxprotocol/v4/stats/epoch_stats/${params.epoch}`;
return await this.req.get<QueryEpochStatsResponseSDKType>(endpoint);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Rpc } from "../../helpers";
import * as _m0 from "protobufjs/minimal";
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryParamsRequest, QueryParamsResponse, QueryStatsMetadataRequest, QueryStatsMetadataResponse, QueryGlobalStatsRequest, QueryGlobalStatsResponse, QueryUserStatsRequest, QueryUserStatsResponse } from "./query";
import { QueryParamsRequest, QueryParamsResponse, QueryStatsMetadataRequest, QueryStatsMetadataResponse, QueryGlobalStatsRequest, QueryGlobalStatsResponse, QueryUserStatsRequest, QueryUserStatsResponse, QueryEpochStatsRequest, QueryEpochStatsResponse } from "./query";
/** Query defines the gRPC querier service. */

export interface Query {
Expand All @@ -16,6 +16,9 @@ export interface Query {
/** Queries UserStats. */

userStats(request: QueryUserStatsRequest): Promise<QueryUserStatsResponse>;
/** Queries EpochStats for a specific epoch. */

epochStats(request: QueryEpochStatsRequest): Promise<QueryEpochStatsResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
Expand All @@ -26,6 +29,7 @@ export class QueryClientImpl implements Query {
this.statsMetadata = this.statsMetadata.bind(this);
this.globalStats = this.globalStats.bind(this);
this.userStats = this.userStats.bind(this);
this.epochStats = this.epochStats.bind(this);
}

params(request: QueryParamsRequest = {}): Promise<QueryParamsResponse> {
Expand All @@ -52,6 +56,12 @@ export class QueryClientImpl implements Query {
return promise.then(data => QueryUserStatsResponse.decode(new _m0.Reader(data)));
}

epochStats(request: QueryEpochStatsRequest): Promise<QueryEpochStatsResponse> {
const data = QueryEpochStatsRequest.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.stats.Query", "EpochStats", data);
return promise.then(data => QueryEpochStatsResponse.decode(new _m0.Reader(data)));
}

}
export const createRpcQueryExtension = (base: QueryClient) => {
const rpc = createProtobufRpcClient(base);
Expand All @@ -71,6 +81,10 @@ export const createRpcQueryExtension = (base: QueryClient) => {

userStats(request: QueryUserStatsRequest): Promise<QueryUserStatsResponse> {
return queryService.userStats(request);
},

epochStats(request: QueryEpochStatsRequest): Promise<QueryEpochStatsResponse> {
return queryService.epochStats(request);
}

};
Expand Down
Loading