@fuul/sdk 4.10.0 → 4.11.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/affiliates/AffiliateService.d.ts +2 -2
- package/dist/affiliates/AffiliateService.d.ts.map +1 -1
- package/dist/core.d.ts +38 -15
- package/dist/core.d.ts.map +1 -1
- package/dist/index.mjs +679 -664
- package/dist/index.umd.js +5 -5
- package/dist/leaderboard/LeaderboardService.d.ts +13 -0
- package/dist/leaderboard/LeaderboardService.d.ts.map +1 -0
- package/dist/payouts/PayoutService.d.ts +1 -3
- package/dist/payouts/PayoutService.d.ts.map +1 -1
- package/dist/types/api.d.ts +9 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +6 -0
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,8 +7,8 @@ export declare class AffiliateService {
|
|
|
7
7
|
private readonly httpClient;
|
|
8
8
|
private readonly _debug;
|
|
9
9
|
constructor(settings: AffiliateServiceSettings);
|
|
10
|
-
create(address: string, code: string, signature: string): Promise<void>;
|
|
11
|
-
update(address: string, code: string, signature: string): Promise<void>;
|
|
10
|
+
create(address: string, code: string, signature: string, accountChainId?: number): Promise<void>;
|
|
11
|
+
update(address: string, code: string, signature: string, accountChainId?: number): Promise<void>;
|
|
12
12
|
isCodeFree(code: string): Promise<boolean>;
|
|
13
13
|
getCode(address: string): Promise<string | null>;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../../src/affiliates/AffiliateService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,wBAAwB;IAKjC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../../src/affiliates/AffiliateService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,wBAAwB;IAKjC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiChG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgChG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe1C,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAc9D"}
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Conversion, GetConversionsParams, GetPayoutsLeaderboardParams, GetPointsLeaderboardParams, GetUserAudiencesParams, GetUserAudiencesResponse, GetUserPayoutMovementsParams, GetUserPayoutsByConversionParams, GetUserPointsByConversionParams, GetUserPointsMovementsParams, GetVolumeLeaderboardParams, LeaderboardResponse, PayoutsLeaderboard, PointsLeaderboard, UserPayoutMovementsResponse, UserPayoutsByConversionResponse, UserPointsByConversionResponse, UserPointsMovementsResponse, VolumeLeaderboard } from './types/api';
|
|
2
|
-
import { AffiliateLinkParams, EventArgs, FuulSettings, UserMetadata } from './types/sdk';
|
|
1
|
+
import { Conversion, GetConversionsParams, GetPayoutsLeaderboardParams, GetPointsLeaderboardParams, GetReferredUsersLeaderboardParams, GetUserAudiencesParams, GetUserAudiencesResponse, GetUserPayoutMovementsParams, GetUserPayoutsByConversionParams, GetUserPointsByConversionParams, GetUserPointsMovementsParams, GetVolumeLeaderboardParams, LeaderboardResponse, PayoutsLeaderboard, PointsLeaderboard, ReferredUsersLeaderboard, UserPayoutMovementsResponse, UserPayoutsByConversionResponse, UserPointsByConversionResponse, UserPointsMovementsResponse, VolumeLeaderboard } from './types/api';
|
|
2
|
+
import { AffiliateCodeParams, AffiliateLinkParams, EventArgs, FuulSettings, UserMetadata } from './types/sdk';
|
|
3
3
|
import { GetUserAffiliatesParams, UserAffiliate } from './user/types';
|
|
4
4
|
export declare function init(settings: FuulSettings): void;
|
|
5
5
|
/**
|
|
@@ -36,7 +36,7 @@ export declare function sendPageview(pageName?: string): Promise<void>;
|
|
|
36
36
|
* })
|
|
37
37
|
*
|
|
38
38
|
*
|
|
39
|
-
* // You can also send the account chain id if you are using a smart contract account
|
|
39
|
+
* // You can also send the account chain id if you are using a smart contract account (EIP-1271)
|
|
40
40
|
* sendConnectWallet({
|
|
41
41
|
* userAddress: '0x12345',
|
|
42
42
|
* signature: '0xaad9a0b62f87c15a248cb99ca926785b828b5',
|
|
@@ -48,26 +48,38 @@ export declare function sendPageview(pageName?: string): Promise<void>;
|
|
|
48
48
|
export declare function sendConnectWallet(userMetadata: UserMetadata): Promise<void>;
|
|
49
49
|
/**
|
|
50
50
|
* Creates a code registered to an affiliate address
|
|
51
|
-
* @param {
|
|
52
|
-
* @param {string}
|
|
53
|
-
* @param {string}
|
|
51
|
+
* @param {object} params Create affiliate code parameters
|
|
52
|
+
* @param {string} params.address Affiliate wallet address
|
|
53
|
+
* @param {string} params.code Affiliate code to map address to
|
|
54
|
+
* @param {string} params.signature Signed message authenticating address ownership. Message to be signed: `I confirm that I am creating the ${code} code on Fuul`
|
|
55
|
+
* @param {number} [params.accountChainId] Account chain id (required for EIP-1271 signature validation)
|
|
54
56
|
* @example
|
|
55
57
|
* ```typescript
|
|
56
|
-
* await Fuul.createAffiliateCode(
|
|
58
|
+
* await Fuul.createAffiliateCode({
|
|
59
|
+
* address: '0x12345',
|
|
60
|
+
* code: 'my-cool-code',
|
|
61
|
+
* signature: '<signature>'
|
|
62
|
+
* })
|
|
57
63
|
* ```
|
|
58
64
|
**/
|
|
59
|
-
export declare function createAffiliateCode(
|
|
65
|
+
export declare function createAffiliateCode(params: AffiliateCodeParams): Promise<void>;
|
|
60
66
|
/**
|
|
61
67
|
* Updates the code registered to an affiliate address
|
|
62
|
-
* @param {
|
|
63
|
-
* @param {string}
|
|
64
|
-
* @param {string}
|
|
68
|
+
* @param {object} params Update affiliate code parameters
|
|
69
|
+
* @param {string} params.address Affiliate wallet address
|
|
70
|
+
* @param {string} params.code New affiliate code
|
|
71
|
+
* @param {string} params.signature Signed message authenticating code update. Message to be signed: `I confirm that I am updating my code to ${code} on Fuul`
|
|
72
|
+
* @param {number} [params.accountChainId] Account chain id (required for EIP-1271 signature validation)
|
|
65
73
|
* @example
|
|
66
74
|
* ```typescript
|
|
67
|
-
* await Fuul.updateAffiliateCode(
|
|
75
|
+
* await Fuul.updateAffiliateCode({
|
|
76
|
+
* address: '0x12345',
|
|
77
|
+
* code: 'my-new-cool-code',
|
|
78
|
+
* signature: '<signature>'
|
|
79
|
+
* })
|
|
68
80
|
* ```
|
|
69
81
|
**/
|
|
70
|
-
export declare function updateAffiliateCode(
|
|
82
|
+
export declare function updateAffiliateCode(params: AffiliateCodeParams): Promise<void>;
|
|
71
83
|
/**
|
|
72
84
|
* Gets the code registered to an affiliate address
|
|
73
85
|
* @param {string} address Affiliate wallet address
|
|
@@ -110,7 +122,7 @@ export declare function generateTrackingLink(baseUrl: string, affiliateAddress:
|
|
|
110
122
|
* @returns {LeaderboardResponse<PayoutsLeaderboard>} Payouts leaderboard response
|
|
111
123
|
* @example
|
|
112
124
|
* ```typescript
|
|
113
|
-
* const results = await Fuul.getPayoutsLeaderboard({ currency_address: '0x12345' }
|
|
125
|
+
* const results = await Fuul.getPayoutsLeaderboard({ currency_address: '0x12345', page: 1, page_size: 10 });
|
|
114
126
|
* ```
|
|
115
127
|
**/
|
|
116
128
|
export declare function getPayoutsLeaderboard(params: GetPayoutsLeaderboardParams): Promise<LeaderboardResponse<PayoutsLeaderboard>>;
|
|
@@ -120,10 +132,20 @@ export declare function getPayoutsLeaderboard(params: GetPayoutsLeaderboardParam
|
|
|
120
132
|
* @returns {LeaderboardResponse<PointsLeaderboard>} Points leaderboard response
|
|
121
133
|
* @example
|
|
122
134
|
* ```typescript
|
|
123
|
-
* const results = await Fuul.getPointsLeaderboard({ currency_address: '0x12345' }
|
|
135
|
+
* const results = await Fuul.getPointsLeaderboard({ currency_address: '0x12345', page: 1, page_size: 10 });
|
|
124
136
|
* ```
|
|
125
137
|
**/
|
|
126
138
|
export declare function getPointsLeaderboard(params: GetPointsLeaderboardParams): Promise<LeaderboardResponse<PointsLeaderboard>>;
|
|
139
|
+
/**
|
|
140
|
+
* Gets the referred users leaderboard
|
|
141
|
+
* @param params {GetReferredUsersLeaderboardParams} The search params
|
|
142
|
+
* @returns {LeaderboardResponse<ReferredUsersLeaderboard>} Referred users leaderboard response
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const results = await Fuul.getReferredUsersLeaderboard({ page: 1, page_size: 10 });;
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export declare function getReferredUsersLeaderboard(params: GetReferredUsersLeaderboardParams): Promise<LeaderboardResponse<ReferredUsersLeaderboard>>;
|
|
127
149
|
/**
|
|
128
150
|
* Gets the project value leaderboard, the amounts are converted into UDSC
|
|
129
151
|
* @param {GetVolumeLeaderboardParams} params The search params
|
|
@@ -217,6 +239,7 @@ declare const _default: {
|
|
|
217
239
|
isAffiliateCodeFree: typeof isAffiliateCodeFree;
|
|
218
240
|
getPayoutsLeaderboard: typeof getPayoutsLeaderboard;
|
|
219
241
|
getPointsLeaderboard: typeof getPointsLeaderboard;
|
|
242
|
+
getReferredUsersLeaderboard: typeof getReferredUsersLeaderboard;
|
|
220
243
|
getUserAudiences: typeof getUserAudiences;
|
|
221
244
|
getUserPayoutsByConversion: typeof getUserPayoutsByConversion;
|
|
222
245
|
getUserPointsByConversion: typeof getUserPointsByConversion;
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,UAAU,EAEV,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,iCAAiC,EACjC,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAiBtE,wBAAgB,IAAI,CAAC,QAAQ,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