@fuul/sdk 5.0.0 → 6.0.1
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/README.md +5 -5
- package/dist/affiliates/AffiliateService.d.ts +1 -1
- package/dist/affiliates/AffiliateService.d.ts.map +1 -1
- package/dist/core.d.ts +9 -7
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +149 -145
- package/dist/index.umd.js +5 -5
- package/dist/release.json.d.ts +1 -1
- package/dist/types/api.d.ts +2 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +3 -2
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -36,7 +36,6 @@ Now you can start sending events.
|
|
|
36
36
|
|
|
37
37
|
For Fuul to attribute conversion events you'll need to report the "pageview" and "connect wallet" events.
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
#### Page view event
|
|
41
40
|
|
|
42
41
|
Projects must send this event every time a user visits a page on their website.
|
|
@@ -49,7 +48,7 @@ await Fuul.sendPageview();
|
|
|
49
48
|
|
|
50
49
|
#### Connect wallet event
|
|
51
50
|
|
|
52
|
-
Projects must send this event every time users connect a wallet to their website.
|
|
51
|
+
Projects must send this event every time users connect a wallet to their website.
|
|
53
52
|
|
|
54
53
|
NOTE: Make sure to send the event when connecting a wallet for the first time as well as when changing wallets during the session.
|
|
55
54
|
|
|
@@ -57,8 +56,9 @@ NOTE: Make sure to send the event when connecting a wallet for the first time as
|
|
|
57
56
|
import { Fuul } from ('@fuul/sdk');
|
|
58
57
|
|
|
59
58
|
await Fuul.sendConnectWallet({
|
|
60
|
-
address: "
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
address: "0xe06099DbbF626892397f9A74C7f42F16748292Db",
|
|
60
|
+
blockchain: BlockchainType.Ethereum,
|
|
61
|
+
signature: "0xb823038d78e541470946e5125b74878c226a84f891671946f18fbe7e5995171731b92f569c3e83f1c9fb89c5351245494c5d2ce6273f74c853a2cace6073f09c1c",
|
|
62
|
+
message: "Connect wallet"
|
|
63
63
|
});
|
|
64
64
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../src/affiliates/AffiliateService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../src/affiliates/AffiliateService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACpC,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,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqC5H,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoC5H,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe1C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAc1F"}
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BlockchainType } from '
|
|
1
|
+
import { BlockchainType } from '.';
|
|
2
2
|
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';
|
|
3
|
-
import { AffiliateCodeParams, AffiliateLinkParams, EventArgs, FuulSettings
|
|
3
|
+
import { AffiliateCodeParams, AffiliateLinkParams, ConnectWalletEventParams, EventArgs, FuulSettings } from './types/sdk';
|
|
4
4
|
import { GetUserAffiliatesParams, UserAffiliate } from './user/types';
|
|
5
5
|
export declare function init(settings: FuulSettings): void;
|
|
6
6
|
/**
|
|
@@ -15,7 +15,7 @@ export declare function init(settings: FuulSettings): void;
|
|
|
15
15
|
export declare function sendEvent(name: string, args?: EventArgs): Promise<void>;
|
|
16
16
|
/**
|
|
17
17
|
* @param {string} pageName Optional page name, default is document.location.pathname
|
|
18
|
-
* @see https://docs.fuul.xyz/
|
|
18
|
+
* @see https://docs.fuul.xyz/for-devs/tracking-referrals-in-your-app#pageview-event
|
|
19
19
|
* @returns {Promise<void>}
|
|
20
20
|
* @example
|
|
21
21
|
* ```typescript
|
|
@@ -25,13 +25,14 @@ export declare function sendEvent(name: string, args?: EventArgs): Promise<void>
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function sendPageview(pageName?: string, projectIds?: string[]): Promise<void>;
|
|
27
27
|
/**
|
|
28
|
-
* @param {
|
|
29
|
-
* @see https://docs.fuul.xyz/
|
|
28
|
+
* @param {ConnectWalletEventParams} ConnectWalletEventParams Metadata from the user that connected the wallet
|
|
29
|
+
* @see https://docs.fuul.xyz/for-devs/tracking-referrals-in-your-app#connect-wallet-event
|
|
30
30
|
* @returns {Promise<void>}
|
|
31
31
|
* @example
|
|
32
32
|
* ```typescript
|
|
33
33
|
* sendConnectWallet({
|
|
34
34
|
* userAddress: '0x12345',
|
|
35
|
+
* blockchain: BlockchainType.Ethereum,
|
|
35
36
|
* signature: '0xaad9a0b62f87c15a248cb99ca926785b828b5',
|
|
36
37
|
* signatureMessage: 'Accept referral from Fuul'
|
|
37
38
|
* })
|
|
@@ -40,13 +41,14 @@ export declare function sendPageview(pageName?: string, projectIds?: string[]):
|
|
|
40
41
|
* // You can also send the account chain id if you are using a smart contract account (EIP-1271)
|
|
41
42
|
* sendConnectWallet({
|
|
42
43
|
* userAddress: '0x12345',
|
|
44
|
+
* blockchain: BlockchainType.Ethereum,
|
|
43
45
|
* signature: '0xaad9a0b62f87c15a248cb99ca926785b828b5',
|
|
44
46
|
* signatureMessage: 'Accept referral from Fuul'
|
|
45
47
|
* accountChainId: 8453,
|
|
46
48
|
* })
|
|
47
49
|
* ```
|
|
48
50
|
*/
|
|
49
|
-
export declare function sendConnectWallet(
|
|
51
|
+
export declare function sendConnectWallet(params: ConnectWalletEventParams, projectIds?: string[]): Promise<void>;
|
|
50
52
|
/**
|
|
51
53
|
* Creates a code registered to an affiliate address
|
|
52
54
|
* @param {object} params Create affiliate code parameters
|
|
@@ -120,7 +122,7 @@ export declare function isAffiliateCodeFree(code: string): Promise<boolean>;
|
|
|
120
122
|
* const trackingLink = Fuul.generateTrackingLink('https://myproject.com', '0x12345')
|
|
121
123
|
* console.log(trackingLink) // https://myproject.com?af=0x12345
|
|
122
124
|
* ```
|
|
123
|
-
* @see https://docs.fuul.xyz/
|
|
125
|
+
* @see https://docs.fuul.xyz/for-devs/building-your-incentives-hub-in-your-app-white-label/creating-affiliate-links-or-codes
|
|
124
126
|
**/
|
|
125
127
|
export declare function generateTrackingLink(baseUrl: string, affiliateAddress: string, blockchain: BlockchainType, params?: AffiliateLinkParams): Promise<string>;
|
|
126
128
|
/**
|
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":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AASnC,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,wBAAwB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1H,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAiBtE,wBAAgB,IAAI,CAAC,QAAQ,EAAE,YAAY,QAsB1C;AAQD;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAc7E;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB1F;AAED;;;;;;;;;;;;;;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B,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAExH;AAED;;;;;;;;IAQI;AACJ,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gCAAgC,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAE7H;AAED;;;;;;;;IAQI;AACJ,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,+BAA+B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAE1H;AAED;;;;;;;;IAQI;AACJ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEjH;AAED;;;;;;;;IAQI;AACJ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEjH;AAED;;;;;;;;IAQI;AACJ,wBAAsB,cAAc,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAGzF;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAGjG;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGxG;;;;;;;;;;;;;;;;;;;;;;;AA6BD,wBAqBE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { default as Fuul } from './core';
|
|
2
2
|
export * from './affiliates/errors';
|
|
3
3
|
export type { Conversion } from './types/api';
|
|
4
|
-
export type { EventArgs, FuulSettings
|
|
4
|
+
export type { ConnectWalletEventParams, EventArgs, FuulSettings } from './types/sdk';
|
|
5
|
+
export declare enum BlockchainType {
|
|
6
|
+
Ethereum = "ethereum",
|
|
7
|
+
Solana = "solana"
|
|
8
|
+
}
|
|
5
9
|
export { Fuul };
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,wBAAwB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAErF,oBAAY,cAAc;IACxB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
|