1
+ import { LCDClient } from "@osmonauts/lcd" ;
2
+ import { AffiliateInfoRequest , AffiliateInfoResponseSDKType , ReferredByRequest , ReferredByResponseSDKType , AllAffiliateTiersRequest , AllAffiliateTiersResponseSDKType , AffiliateWhitelistRequest , AffiliateWhitelistResponseSDKType } from "./query" ;
3
+ export class LCDQueryClient {
4
+ req : LCDClient ;
5
+
6
+ constructor ( {
7
+ requestClient
8
+ } : {
9
+ requestClient : LCDClient ;
10
+ } ) {
11
+ this . req = requestClient ;
12
+ this . affiliateInfo = this . affiliateInfo . bind ( this ) ;
13
+ this . referredBy = this . referredBy . bind ( this ) ;
14
+ this . allAffiliateTiers = this . allAffiliateTiers . bind ( this ) ;
15
+ this . affiliateWhitelist = this . affiliateWhitelist . bind ( this ) ;
16
+ }
17
+ /* Query AffiliateInfo returns the affiliate info for a given address. */
18
+
19
+
20
+ async affiliateInfo ( params : AffiliateInfoRequest ) : Promise < AffiliateInfoResponseSDKType > {
21
+ const endpoint = `dydxprotocol/affiliates/affiliate_info/${ params . address } ` ;
22
+ return await this . req . get < AffiliateInfoResponseSDKType > ( endpoint ) ;
23
+ }
24
+ /* Query ReferredBy returns the affiliate that referred a given address. */
25
+
26
+
27
+ async referredBy ( params : ReferredByRequest ) : Promise < ReferredByResponseSDKType > {
28
+ const endpoint = `dydxprotocol/affiliates/referred_by/${ params . address } ` ;
29
+ return await this . req . get < ReferredByResponseSDKType > ( endpoint ) ;
30
+ }
31
+ /* Query AllAffiliateTiers returns all affiliate tiers. */
32
+
33
+
34
+ async allAffiliateTiers ( _params : AllAffiliateTiersRequest = { } ) : Promise < AllAffiliateTiersResponseSDKType > {
35
+ const endpoint = `dydxprotocol/affiliates/all_affiliate_tiers` ;
36
+ return await this . req . get < AllAffiliateTiersResponseSDKType > ( endpoint ) ;
37
+ }
38
+ /* Query AffiliateWhitelist returns the affiliate whitelist. */
39
+
40
+
41
+ async affiliateWhitelist ( _params : AffiliateWhitelistRequest = { } ) : Promise < AffiliateWhitelistResponseSDKType > {
42
+ const endpoint = `dydxprotocol/affiliates/affiliate_whitelist` ;
43
+ return await this . req . get < AffiliateWhitelistResponseSDKType > ( endpoint ) ;
44
+ }
45
+
46
+ }
0 commit comments