Skip to content
Open
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
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./protocol/scripts/protocgen.sh

proto-clean:
@rm -rf ./proto/.proto-export
@rm -rf ./.proto-export

proto-gen-clean:
@echo "Cleaning old artifacts"
@rm -rf ./proto/.proto-export
@rm -rf ./.proto-export
@echo "Generating Protobuf files"
@$(protoImage) sh ./protocol/scripts/protocgen.sh
@cd proto && make proto-export-v4-proto-js

proto-check-bc-breaking:
@rm -rf ./.proto-export
@$(protoImage) buf breaking --against .git#branch=$$(git merge-base HEAD origin/main)
Expand Down
2 changes: 1 addition & 1 deletion indexer/packages/v4-protos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:prod": "rm -rf build/ && tsc",
"build:watch": "pnpm run build -- --watch",
"test": "echo \"Error: no test specified\"",
"build:proto": "(cd ../../../proto && rm -rf .proto-export && cd ../ && rm -rf .proto-export && make proto-export) && rm -rf src/codegen && telescope transpile --protoDirs ../../../.proto-export --outPath ./src/codegen --no-includeAminos --includeLCDClients --includeRPCClients",
"build:proto": "(cd ../../.. && make proto-export) && rm -rf src/codegen && telescope transpile --protoDirs ../../../.proto-export --outPath ./src/codegen --no-includeAminos --includeLCDClients --includeRPCClients",
"build:verify-proto": "pnpm run build:proto && git diff --exit-code src/codegen",
"postinstall": "patch-package"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,60 +74,6 @@ export interface AffiliateWhitelist_TierSDKType {

taker_fee_share_ppm: number;
}
/** AffiliateParameters defines the parameters for the affiliate program. */

export interface AffiliateParameters {
/**
* Maximum attributable volume for a referred user in a 30d rolling window in
* notional
*/
maximum_30dAttributableVolumePerReferredUserQuoteQuantums: Long;
/** Referred user automatically gets set to this fee tier */

refereeMinimumFeeTierIdx: number;
/**
* Maximum affiliate revenue for a referred user in a 30d rolling window in
* quote quantums
*/

maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums: Long;
}
/** AffiliateParameters defines the parameters for the affiliate program. */

export interface AffiliateParametersSDKType {
/**
* Maximum attributable volume for a referred user in a 30d rolling window in
* notional
*/
maximum_30d_attributable_volume_per_referred_user_quote_quantums: Long;
/** Referred user automatically gets set to this fee tier */

referee_minimum_fee_tier_idx: number;
/**
* Maximum affiliate revenue for a referred user in a 30d rolling window in
* quote quantums
*/

maximum_30d_affiliate_revenue_per_referred_user_quote_quantums: Long;
}
/** AffiliateOverrides defines the affiliate whitelist. */

export interface AffiliateOverrides {
/**
* List of unique whitelisted addresses.
* These are automatically put at the maximum affiliate tier
*/
addresses: string[];
}
/** AffiliateOverrides defines the affiliate whitelist. */

export interface AffiliateOverridesSDKType {
/**
* List of unique whitelisted addresses.
* These are automatically put at the maximum affiliate tier
*/
addresses: string[];
}

function createBaseAffiliateTiers(): AffiliateTiers {
return {
Expand Down Expand Up @@ -337,114 +283,4 @@ export const AffiliateWhitelist_Tier = {
return message;
}

};

function createBaseAffiliateParameters(): AffiliateParameters {
return {
maximum_30dAttributableVolumePerReferredUserQuoteQuantums: Long.UZERO,
refereeMinimumFeeTierIdx: 0,
maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums: Long.UZERO
};
}

export const AffiliateParameters = {
encode(message: AffiliateParameters, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (!message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums.isZero()) {
writer.uint32(8).uint64(message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums);
}

if (message.refereeMinimumFeeTierIdx !== 0) {
writer.uint32(16).uint32(message.refereeMinimumFeeTierIdx);
}

if (!message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums.isZero()) {
writer.uint32(24).uint64(message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums);
}

return writer;
},

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

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

switch (tag >>> 3) {
case 1:
message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums = (reader.uint64() as Long);
break;

case 2:
message.refereeMinimumFeeTierIdx = reader.uint32();
break;

case 3:
message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums = (reader.uint64() as Long);
break;

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

return message;
},

fromPartial(object: DeepPartial<AffiliateParameters>): AffiliateParameters {
const message = createBaseAffiliateParameters();
message.maximum_30dAttributableVolumePerReferredUserQuoteQuantums = object.maximum_30dAttributableVolumePerReferredUserQuoteQuantums !== undefined && object.maximum_30dAttributableVolumePerReferredUserQuoteQuantums !== null ? Long.fromValue(object.maximum_30dAttributableVolumePerReferredUserQuoteQuantums) : Long.UZERO;
message.refereeMinimumFeeTierIdx = object.refereeMinimumFeeTierIdx ?? 0;
message.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums = object.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums !== undefined && object.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums !== null ? Long.fromValue(object.maximum_30dAffiliateRevenuePerReferredUserQuoteQuantums) : Long.UZERO;
return message;
}

};

function createBaseAffiliateOverrides(): AffiliateOverrides {
return {
addresses: []
};
}

export const AffiliateOverrides = {
encode(message: AffiliateOverrides, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
for (const v of message.addresses) {
writer.uint32(10).string(v!);
}

return writer;
},

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

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

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

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

return message;
},

fromPartial(object: DeepPartial<AffiliateOverrides>): AffiliateOverrides {
const message = createBaseAffiliateOverrides();
message.addresses = object.addresses?.map(e => e) || [];
return message;
}

};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LCDClient } from "@osmonauts/lcd";
import { AffiliateInfoRequest, AffiliateInfoResponseSDKType, ReferredByRequest, ReferredByResponseSDKType, AllAffiliateTiersRequest, AllAffiliateTiersResponseSDKType, AffiliateWhitelistRequest, AffiliateWhitelistResponseSDKType, AffiliateParametersRequest, AffiliateParametersResponseSDKType, AffiliateOverridesRequest, AffiliateOverridesResponseSDKType } from "./query";
import { AffiliateInfoRequest, AffiliateInfoResponseSDKType, ReferredByRequest, ReferredByResponseSDKType, AllAffiliateTiersRequest, AllAffiliateTiersResponseSDKType, AffiliateWhitelistRequest, AffiliateWhitelistResponseSDKType } from "./query";
export class LCDQueryClient {
req: LCDClient;

Expand All @@ -13,8 +13,6 @@ export class LCDQueryClient {
this.referredBy = this.referredBy.bind(this);
this.allAffiliateTiers = this.allAffiliateTiers.bind(this);
this.affiliateWhitelist = this.affiliateWhitelist.bind(this);
this.affiliateParameters = this.affiliateParameters.bind(this);
this.affiliateOverrides = this.affiliateOverrides.bind(this);
}
/* Query AffiliateInfo returns the affiliate info for a given address. */

Expand Down Expand Up @@ -44,19 +42,5 @@ export class LCDQueryClient {
const endpoint = `dydxprotocol/affiliates/affiliate_whitelist`;
return await this.req.get<AffiliateWhitelistResponseSDKType>(endpoint);
}
/* Query AffiliateParameters returns the affiliate parameters. */


async affiliateParameters(_params: AffiliateParametersRequest = {}): Promise<AffiliateParametersResponseSDKType> {
const endpoint = `dydxprotocol/affiliates/affiliate_parameters`;
return await this.req.get<AffiliateParametersResponseSDKType>(endpoint);
}
/* Query AffiliateOverrides returns the affiliate overrides. */


async affiliateOverrides(_params: AffiliateOverridesRequest = {}): Promise<AffiliateOverridesResponseSDKType> {
const endpoint = `dydxprotocol/affiliates/affiliate_overrides`;
return await this.req.get<AffiliateOverridesResponseSDKType>(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 { AffiliateInfoRequest, AffiliateInfoResponse, ReferredByRequest, ReferredByResponse, AllAffiliateTiersRequest, AllAffiliateTiersResponse, AffiliateWhitelistRequest, AffiliateWhitelistResponse, AffiliateParametersRequest, AffiliateParametersResponse, AffiliateOverridesRequest, AffiliateOverridesResponse } from "./query";
import { AffiliateInfoRequest, AffiliateInfoResponse, ReferredByRequest, ReferredByResponse, AllAffiliateTiersRequest, AllAffiliateTiersResponse, AffiliateWhitelistRequest, AffiliateWhitelistResponse } from "./query";
/** Query defines the gRPC querier service. */

export interface Query {
Expand All @@ -16,12 +16,6 @@ export interface Query {
/** Query AffiliateWhitelist returns the affiliate whitelist. */

affiliateWhitelist(request?: AffiliateWhitelistRequest): Promise<AffiliateWhitelistResponse>;
/** Query AffiliateParameters returns the affiliate parameters. */

affiliateParameters(request?: AffiliateParametersRequest): Promise<AffiliateParametersResponse>;
/** Query AffiliateOverrides returns the affiliate overrides. */

affiliateOverrides(request?: AffiliateOverridesRequest): Promise<AffiliateOverridesResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
Expand All @@ -32,8 +26,6 @@ export class QueryClientImpl implements Query {
this.referredBy = this.referredBy.bind(this);
this.allAffiliateTiers = this.allAffiliateTiers.bind(this);
this.affiliateWhitelist = this.affiliateWhitelist.bind(this);
this.affiliateParameters = this.affiliateParameters.bind(this);
this.affiliateOverrides = this.affiliateOverrides.bind(this);
}

affiliateInfo(request: AffiliateInfoRequest): Promise<AffiliateInfoResponse> {
Expand All @@ -60,18 +52,6 @@ export class QueryClientImpl implements Query {
return promise.then(data => AffiliateWhitelistResponse.decode(new _m0.Reader(data)));
}

affiliateParameters(request: AffiliateParametersRequest = {}): Promise<AffiliateParametersResponse> {
const data = AffiliateParametersRequest.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.affiliates.Query", "AffiliateParameters", data);
return promise.then(data => AffiliateParametersResponse.decode(new _m0.Reader(data)));
}

affiliateOverrides(request: AffiliateOverridesRequest = {}): Promise<AffiliateOverridesResponse> {
const data = AffiliateOverridesRequest.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.affiliates.Query", "AffiliateOverrides", data);
return promise.then(data => AffiliateOverridesResponse.decode(new _m0.Reader(data)));
}

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

affiliateWhitelist(request?: AffiliateWhitelistRequest): Promise<AffiliateWhitelistResponse> {
return queryService.affiliateWhitelist(request);
},

affiliateParameters(request?: AffiliateParametersRequest): Promise<AffiliateParametersResponse> {
return queryService.affiliateParameters(request);
},

affiliateOverrides(request?: AffiliateOverridesRequest): Promise<AffiliateOverridesResponse> {
return queryService.affiliateOverrides(request);
}

};
Expand Down
Loading
Loading