@reyaxyz/community-sdk 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/modules/twitter/index.js +20 -6
- package/dist/modules/twitter/index.js.map +1 -1
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/modules/twitter/index.d.ts +7 -3
- package/dist/types/modules/twitter/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/client/index.ts +3 -1
- package/src/modules/twitter/index.ts +34 -8
package/dist/client/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var CommunityClient = /** @class */ (function () {
|
|
|
17
17
|
function CommunityClient() {
|
|
18
18
|
this._voteModule = new vote_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
19
19
|
this._lgeModule = new lge_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
20
|
-
this._twitterModule = new twitter_1.default(CommunityClient.config.twitter.
|
|
20
|
+
this._twitterModule = new twitter_1.default(CommunityClient.config.twitter.getExtraBoostTwitterApiURI, CommunityClient.config.twitter.getLockGameBoostTwitterApiURI, CommunityClient.config.twitter.getShareReferralTwitterApiURI, CommunityClient.config.twitter.clientId, CommunityClient.config.logging);
|
|
21
21
|
this._leaderboardModule = new leaderboard_1.default(CommunityClient.config.apiEndpoint, CommunityClient.config.logging);
|
|
22
22
|
this._referralModule = new referral_1.default(CommunityClient.config.logging);
|
|
23
23
|
}
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAoE;AACpE,yDAAyC;AACzC,uDAAuC;AACvC,+DAA+C;AAC/C,uEAAuD;AACvD,iEAAiD;AAEjD;;GAEG;AACH;IAUE;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,cAAU,CAC/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ONFIGS, ServiceConfig } from '@reyaxyz/common';\nimport VoteModule from '../modules/vote';\nimport LGEModule from '../modules/lge';\nimport TwitterModule from '../modules/twitter';\nimport LeaderboardModule from '../modules/leaderboard';\nimport ReferralModule from '../modules/referral';\n\n/**\n * @description Client for Community SDK\n */\nexport class CommunityClient {\n private static instance: CommunityClient;\n private static config: ServiceConfig = API_CLIENT_CONFIGS['test'];\n\n private readonly _voteModule: VoteModule;\n private readonly _lgeModule: LGEModule;\n private readonly _twitterModule: TwitterModule;\n private readonly _leaderboardModule: LeaderboardModule;\n private readonly _referralModule: ReferralModule;\n\n private constructor() {\n this._voteModule = new VoteModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._lgeModule = new LGEModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._twitterModule = new TwitterModule(\n CommunityClient.config.twitter.getExtraBoostTwitterApiURI,\n CommunityClient.config.twitter.getLockGameBoostTwitterApiURI,\n CommunityClient.config.twitter.getShareReferralTwitterApiURI,\n CommunityClient.config.twitter.clientId,\n CommunityClient.config.logging,\n );\n this._leaderboardModule = new LeaderboardModule(\n CommunityClient.config.apiEndpoint,\n CommunityClient.config.logging,\n );\n this._referralModule = new ReferralModule(CommunityClient.config.logging);\n }\n\n public static configure(environment: ServiceConfig['environment']): void {\n CommunityClient.config =\n API_CLIENT_CONFIGS[environment] || API_CLIENT_CONFIGS['test'];\n CommunityClient.instance = new CommunityClient();\n }\n\n private static getInstance(): CommunityClient {\n if (!CommunityClient.instance) {\n throw new Error(\n 'Client is not configured. Please configure it before using.',\n );\n }\n return CommunityClient.instance;\n }\n\n /**\n * Provides access to the VoteModule instance.\n * This getter allows for interacting with vote-related functionalities.\n *\n * @returns {VoteModule} An instance of VoteModule for vote operations.\n * @memberof CommunityClient\n */\n public static get vote(): VoteModule {\n return CommunityClient.getInstance()._voteModule;\n }\n\n /**\n * Provides access to the LGEModule instance.\n * This getter allows for interacting with LGE-related functionalities.\n *\n * @returns {LGEModule} An instance of LGEModule for LGE operations.\n * @memberof CommunityClient\n */\n public static get lge(): LGEModule {\n return CommunityClient.getInstance()._lgeModule;\n }\n\n /**\n * Provides access to the TwitterModule instance.\n * This getter allows for interacting with twitter-related functionalities.\n *\n * @returns {TwitterModule} An instance of Twitter for twitter operations.\n * @memberof CommunityClient\n */\n public static get twitter(): TwitterModule {\n return CommunityClient.getInstance()._twitterModule;\n }\n\n /**\n * Provides access to the LeaderboardModule instance.\n * This getter allows for interacting with leaderboard-related functionalities.\n *\n * @returns {LeaderboardModule} An instance of Leaderboard for twitter operations.\n * @memberof CommunityClient\n */\n public static get leaderboard(): LeaderboardModule {\n return CommunityClient.getInstance()._leaderboardModule;\n }\n\n /**\n * Provides access to the ReferralModule instance.\n * This getter allows for interacting with referral related functionalities.\n *\n * @returns {ReferralModule} An instance of ReferralModule .\n * @memberof CommunityClient\n */\n public static get referral(): ReferralModule {\n return CommunityClient.getInstance()._referralModule;\n }\n\n public static get supportedChain(): number {\n return CommunityClient.config.chain;\n }\n}\n"]}
|
|
@@ -20,18 +20,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
var services_1 = require("./services");
|
|
21
21
|
var common_1 = require("@reyaxyz/common");
|
|
22
22
|
var TwitterModule = /** @class */ (function () {
|
|
23
|
-
function TwitterModule(
|
|
23
|
+
function TwitterModule(getExtraBoostTwitterApiURI, getLockGameBoostTwitterApiURI, getShareReferralTwitterApiURI, twitterClientId, loggingEnabled) {
|
|
24
24
|
this.loggingEnabled = false;
|
|
25
|
-
this.
|
|
25
|
+
this.getExtraBoostTwitterApiURI = getExtraBoostTwitterApiURI;
|
|
26
|
+
this.getLockGameBoostTwitterApiURI = getLockGameBoostTwitterApiURI;
|
|
27
|
+
this.getShareReferralTwitterApiURI = getShareReferralTwitterApiURI;
|
|
26
28
|
this.twitterClientId = twitterClientId;
|
|
27
29
|
this.loggingEnabled = loggingEnabled;
|
|
28
30
|
}
|
|
29
|
-
TwitterModule.prototype.
|
|
30
|
-
return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.
|
|
31
|
+
TwitterModule.prototype.getExtraBoostTwitterLink = function (params) {
|
|
32
|
+
return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.getExtraBoostTwitterApiURI, twitterClientId: this.twitterClientId }));
|
|
31
33
|
};
|
|
34
|
+
TwitterModule.prototype.getLockGameBoostTwitterLink = function (params) {
|
|
35
|
+
return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.getLockGameBoostTwitterApiURI, twitterClientId: this.twitterClientId }));
|
|
36
|
+
};
|
|
37
|
+
TwitterModule.prototype.getShareReferralTwitterLink = function (params) {
|
|
38
|
+
return (0, services_1.getTwitterOauthUrl)(__assign(__assign({}, params), { redirectURI: this.getShareReferralTwitterApiURI, twitterClientId: this.twitterClientId }));
|
|
39
|
+
};
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, common_1.Logger)('TwitterModule.getExtraBoostTwitterLink')
|
|
42
|
+
], TwitterModule.prototype, "getExtraBoostTwitterLink", null);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, common_1.Logger)('TwitterModule.getLockGameBoostTwitterLink')
|
|
45
|
+
], TwitterModule.prototype, "getLockGameBoostTwitterLink", null);
|
|
32
46
|
__decorate([
|
|
33
|
-
(0, common_1.Logger)('TwitterModule.
|
|
34
|
-
], TwitterModule.prototype, "
|
|
47
|
+
(0, common_1.Logger)('TwitterModule.getShareReferralTwitterLink')
|
|
48
|
+
], TwitterModule.prototype, "getShareReferralTwitterLink", null);
|
|
35
49
|
return TwitterModule;
|
|
36
50
|
}());
|
|
37
51
|
exports.default = TwitterModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,uCAA0E;AAC1E,0CAAmD;AAEnD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,uCAA0E;AAC1E,0CAAmD;AAEnD;IAQE,uBACE,0BAAkC,EAClC,6BAAqC,EACrC,6BAAqC,EACrC,eAAuB,EACvB,cAAuB;QAPzB,mBAAc,GAAY,KAAK,CAAC;QAS9B,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;QAC7D,IAAI,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;QACnE,IAAI,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;QACnE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAGD,gDAAwB,GAAxB,UACE,MAAuD;QAEvD,OAAO,IAAA,6BAAkB,wBACpB,MAAM,KACT,WAAW,EAAE,IAAI,CAAC,0BAA0B,EAC5C,eAAe,EAAE,IAAI,CAAC,eAAe,IACrC,CAAC;IACL,CAAC;IAGD,mDAA2B,GAA3B,UACE,MAAuD;QAEvD,OAAO,IAAA,6BAAkB,wBACpB,MAAM,KACT,WAAW,EAAE,IAAI,CAAC,6BAA6B,EAC/C,eAAe,EAAE,IAAI,CAAC,eAAe,IACrC,CAAC;IACL,CAAC;IAGD,mDAA2B,GAA3B,UACE,MAAuD;QAEvD,OAAO,IAAA,6BAAkB,wBACpB,MAAM,KACT,WAAW,EAAE,IAAI,CAAC,6BAA6B,EAC/C,eAAe,EAAE,IAAI,CAAC,eAAe,IACrC,CAAC;IACL,CAAC;IA9BD;QADC,IAAA,eAAM,EAAC,wCAAwC,CAAC;iEAShD;IAGD;QADC,IAAA,eAAM,EAAC,2CAA2C,CAAC;oEASnD;IAGD;QADC,IAAA,eAAM,EAAC,2CAA2C,CAAC;oEASnD;IACH,oBAAC;CAAA,AAtDD,IAsDC;kBAtDoB,aAAa","sourcesContent":["import { getTwitterOauthUrl, GetTwitterOauthUrlParams } from './services';\nimport { Loggable, Logger } from '@reyaxyz/common';\n\nexport default class TwitterModule implements Loggable {\n private getExtraBoostTwitterApiURI: string;\n private getLockGameBoostTwitterApiURI: string;\n private getShareReferralTwitterApiURI: string;\n\n private twitterClientId: string;\n loggingEnabled: boolean = false;\n\n constructor(\n getExtraBoostTwitterApiURI: string,\n getLockGameBoostTwitterApiURI: string,\n getShareReferralTwitterApiURI: string,\n twitterClientId: string,\n loggingEnabled: boolean,\n ) {\n this.getExtraBoostTwitterApiURI = getExtraBoostTwitterApiURI;\n this.getLockGameBoostTwitterApiURI = getLockGameBoostTwitterApiURI;\n this.getShareReferralTwitterApiURI = getShareReferralTwitterApiURI;\n this.twitterClientId = twitterClientId;\n this.loggingEnabled = loggingEnabled;\n }\n\n @Logger('TwitterModule.getExtraBoostTwitterLink')\n getExtraBoostTwitterLink(\n params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,\n ): string {\n return getTwitterOauthUrl({\n ...params,\n redirectURI: this.getExtraBoostTwitterApiURI,\n twitterClientId: this.twitterClientId,\n });\n }\n\n @Logger('TwitterModule.getLockGameBoostTwitterLink')\n getLockGameBoostTwitterLink(\n params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,\n ): string {\n return getTwitterOauthUrl({\n ...params,\n redirectURI: this.getLockGameBoostTwitterApiURI,\n twitterClientId: this.twitterClientId,\n });\n }\n\n @Logger('TwitterModule.getShareReferralTwitterLink')\n getShareReferralTwitterLink(\n params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,\n ): string {\n return getTwitterOauthUrl({\n ...params,\n redirectURI: this.getShareReferralTwitterApiURI,\n twitterClientId: this.twitterClientId,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,UAAU,MAAM,iBAAiB,CAAC;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,CAAC,aAAa,CAAC,GAAG,IAAI;IAMxE,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,IAAI,IAAI,UAAU,CAEnC;IAED;;;;;;OAMG;IACH,WAAkB,GAAG,IAAI,SAAS,CAEjC;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,WAAW,IAAI,iBAAiB,CAEjD;IAED;;;;;;OAMG;IACH,WAAkB,QAAQ,IAAI,cAAc,CAE3C;IAED,WAAkB,cAAc,IAAI,MAAM,CAEzC;CACF"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { GetTwitterOauthUrlParams } from './services';
|
|
2
2
|
import { Loggable } from '@reyaxyz/common';
|
|
3
3
|
export default class TwitterModule implements Loggable {
|
|
4
|
-
private
|
|
4
|
+
private getExtraBoostTwitterApiURI;
|
|
5
|
+
private getLockGameBoostTwitterApiURI;
|
|
6
|
+
private getShareReferralTwitterApiURI;
|
|
5
7
|
private twitterClientId;
|
|
6
8
|
loggingEnabled: boolean;
|
|
7
|
-
constructor(
|
|
8
|
-
|
|
9
|
+
constructor(getExtraBoostTwitterApiURI: string, getLockGameBoostTwitterApiURI: string, getShareReferralTwitterApiURI: string, twitterClientId: string, loggingEnabled: boolean);
|
|
10
|
+
getExtraBoostTwitterLink(params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>): string;
|
|
11
|
+
getLockGameBoostTwitterLink(params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>): string;
|
|
12
|
+
getShareReferralTwitterLink(params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>): string;
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,QAAQ;IACpD,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["modules/twitter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,QAAQ;IACpD,OAAO,CAAC,0BAA0B,CAAS;IAC3C,OAAO,CAAC,6BAA6B,CAAS;IAC9C,OAAO,CAAC,6BAA6B,CAAS;IAE9C,OAAO,CAAC,eAAe,CAAS;IAChC,cAAc,EAAE,OAAO,CAAS;gBAG9B,0BAA0B,EAAE,MAAM,EAClC,6BAA6B,EAAE,MAAM,EACrC,6BAA6B,EAAE,MAAM,EACrC,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,OAAO;IAUzB,wBAAwB,CACtB,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GACtD,MAAM;IAST,2BAA2B,CACzB,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GACtD,MAAM;IAST,2BAA2B,CACzB,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GACtD,MAAM;CAOV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reyaxyz/community-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"url": "https://github.com/Reya-Labs/reya-off-chain-monorepo.git"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@reyaxyz/common": "0.
|
|
14
|
-
"@reyaxyz/sdk": "0.49.
|
|
13
|
+
"@reyaxyz/common": "0.57.0",
|
|
14
|
+
"@reyaxyz/sdk": "0.49.1",
|
|
15
15
|
"ethers": "6.9.0"
|
|
16
16
|
},
|
|
17
17
|
"main": "dist/index.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"generate:coverage-badges": "npx istanbul-badges-readme --silent"
|
|
39
39
|
},
|
|
40
40
|
"packageManager": "pnpm@8.10.4",
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "58d9e1729861ee7ab5299cf86ba59027799dab22"
|
|
42
42
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -28,7 +28,9 @@ export class CommunityClient {
|
|
|
28
28
|
CommunityClient.config.logging,
|
|
29
29
|
);
|
|
30
30
|
this._twitterModule = new TwitterModule(
|
|
31
|
-
CommunityClient.config.twitter.
|
|
31
|
+
CommunityClient.config.twitter.getExtraBoostTwitterApiURI,
|
|
32
|
+
CommunityClient.config.twitter.getLockGameBoostTwitterApiURI,
|
|
33
|
+
CommunityClient.config.twitter.getShareReferralTwitterApiURI,
|
|
32
34
|
CommunityClient.config.twitter.clientId,
|
|
33
35
|
CommunityClient.config.logging,
|
|
34
36
|
);
|
|
@@ -2,31 +2,57 @@ import { getTwitterOauthUrl, GetTwitterOauthUrlParams } from './services';
|
|
|
2
2
|
import { Loggable, Logger } from '@reyaxyz/common';
|
|
3
3
|
|
|
4
4
|
export default class TwitterModule implements Loggable {
|
|
5
|
-
private
|
|
5
|
+
private getExtraBoostTwitterApiURI: string;
|
|
6
|
+
private getLockGameBoostTwitterApiURI: string;
|
|
7
|
+
private getShareReferralTwitterApiURI: string;
|
|
8
|
+
|
|
6
9
|
private twitterClientId: string;
|
|
7
10
|
loggingEnabled: boolean = false;
|
|
8
11
|
|
|
9
12
|
constructor(
|
|
10
|
-
|
|
13
|
+
getExtraBoostTwitterApiURI: string,
|
|
14
|
+
getLockGameBoostTwitterApiURI: string,
|
|
15
|
+
getShareReferralTwitterApiURI: string,
|
|
11
16
|
twitterClientId: string,
|
|
12
17
|
loggingEnabled: boolean,
|
|
13
18
|
) {
|
|
14
|
-
this.
|
|
19
|
+
this.getExtraBoostTwitterApiURI = getExtraBoostTwitterApiURI;
|
|
20
|
+
this.getLockGameBoostTwitterApiURI = getLockGameBoostTwitterApiURI;
|
|
21
|
+
this.getShareReferralTwitterApiURI = getShareReferralTwitterApiURI;
|
|
15
22
|
this.twitterClientId = twitterClientId;
|
|
16
23
|
this.loggingEnabled = loggingEnabled;
|
|
17
24
|
}
|
|
18
25
|
|
|
19
|
-
@Logger('TwitterModule.
|
|
20
|
-
|
|
26
|
+
@Logger('TwitterModule.getExtraBoostTwitterLink')
|
|
27
|
+
getExtraBoostTwitterLink(
|
|
28
|
+
params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,
|
|
29
|
+
): string {
|
|
30
|
+
return getTwitterOauthUrl({
|
|
31
|
+
...params,
|
|
32
|
+
redirectURI: this.getExtraBoostTwitterApiURI,
|
|
33
|
+
twitterClientId: this.twitterClientId,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Logger('TwitterModule.getLockGameBoostTwitterLink')
|
|
38
|
+
getLockGameBoostTwitterLink(
|
|
21
39
|
params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,
|
|
22
40
|
): string {
|
|
23
41
|
return getTwitterOauthUrl({
|
|
24
42
|
...params,
|
|
25
|
-
redirectURI: this.
|
|
43
|
+
redirectURI: this.getLockGameBoostTwitterApiURI,
|
|
26
44
|
twitterClientId: this.twitterClientId,
|
|
27
45
|
});
|
|
28
46
|
}
|
|
29
47
|
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
@Logger('TwitterModule.getShareReferralTwitterLink')
|
|
49
|
+
getShareReferralTwitterLink(
|
|
50
|
+
params: Pick<GetTwitterOauthUrlParams, 'walletAddress'>,
|
|
51
|
+
): string {
|
|
52
|
+
return getTwitterOauthUrl({
|
|
53
|
+
...params,
|
|
54
|
+
redirectURI: this.getShareReferralTwitterApiURI,
|
|
55
|
+
twitterClientId: this.twitterClientId,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
32
58
|
}
|