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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,63 @@ export interface AffiliateWhitelist_TierSDKType {

taker_fee_share_ppm: number;
}
<<<<<<< HEAD
=======
/** 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[];
}
>>>>>>> 1b536022 (Integrate commission and overrides to fee tier calculation (#3117))

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

<<<<<<< HEAD
=======
};

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;
}

>>>>>>> 1b536022 (Integrate commission and overrides to fee tier calculation (#3117))
};
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import { AffiliateTiers, AffiliateTiersSDKType } from "./affiliates";
import { AffiliateTiers, AffiliateTiersSDKType, AffiliateParameters, AffiliateParametersSDKType } from "./affiliates";
import * as _m0 from "protobufjs/minimal";
import { DeepPartial } from "../../helpers";
/** GenesisState defines generis state of `x/affiliates` */

export interface GenesisState {
/** The list of affiliate tiers */
affiliateTiers?: AffiliateTiers;
/** The affiliate parameters */

affiliateParameters?: AffiliateParameters;
}
/** GenesisState defines generis state of `x/affiliates` */

export interface GenesisStateSDKType {
/** The list of affiliate tiers */
affiliate_tiers?: AffiliateTiersSDKType;
/** The affiliate parameters */

affiliate_parameters?: AffiliateParametersSDKType;
}

function createBaseGenesisState(): GenesisState {
return {
affiliateTiers: undefined
affiliateTiers: undefined,
affiliateParameters: undefined
};
}

Expand All @@ -26,6 +33,10 @@ export const GenesisState = {
AffiliateTiers.encode(message.affiliateTiers, writer.uint32(10).fork()).ldelim();
}

if (message.affiliateParameters !== undefined) {
AffiliateParameters.encode(message.affiliateParameters, writer.uint32(18).fork()).ldelim();
}

return writer;
},

Expand All @@ -42,6 +53,10 @@ export const GenesisState = {
message.affiliateTiers = AffiliateTiers.decode(reader, reader.uint32());
break;

case 2:
message.affiliateParameters = AffiliateParameters.decode(reader, reader.uint32());
break;

default:
reader.skipType(tag & 7);
break;
Expand All @@ -54,6 +69,7 @@ export const GenesisState = {
fromPartial(object: DeepPartial<GenesisState>): GenesisState {
const message = createBaseGenesisState();
message.affiliateTiers = object.affiliateTiers !== undefined && object.affiliateTiers !== null ? AffiliateTiers.fromPartial(object.affiliateTiers) : undefined;
message.affiliateParameters = object.affiliateParameters !== undefined && object.affiliateParameters !== null ? AffiliateParameters.fromPartial(object.affiliateParameters) : undefined;
return message;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ export interface AffiliateInfoResponse {
feeSharePpm: number;
/** The affiliate's all-time referred volume in quote quantums. */

/** @deprecated */

referredVolume: Uint8Array;
/** The affiliate's currently staked native tokens (in whole coins). */

stakedAmount: Uint8Array;
/** The affiliate's 30d referred volume in quote quantums. */

referredVolume_30dRolling: Uint8Array;
}
/**
* AffiliateInfoResponse is the response type for the Query/AffiliateInfo RPC
Expand All @@ -66,10 +71,15 @@ export interface AffiliateInfoResponseSDKType {
fee_share_ppm: number;
/** The affiliate's all-time referred volume in quote quantums. */

/** @deprecated */

referred_volume: Uint8Array;
/** The affiliate's currently staked native tokens (in whole coins). */

staked_amount: Uint8Array;
/** The affiliate's 30d referred volume in quote quantums. */

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

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

Expand All @@ -231,6 +242,10 @@ export const AffiliateInfoResponse = {
writer.uint32(42).bytes(message.stakedAmount);
}

if (message.referredVolume_30dRolling.length !== 0) {
writer.uint32(50).bytes(message.referredVolume_30dRolling);
}

return writer;
},

Expand Down Expand Up @@ -263,6 +278,10 @@ export const AffiliateInfoResponse = {
message.stakedAmount = reader.bytes();
break;

case 6:
message.referredVolume_30dRolling = reader.bytes();
break;

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

Expand Down
Loading
Loading