@fuul/sdk 2.1.2 → 3.1.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.
@@ -0,0 +1,28 @@
1
+ import { HttpClient } from './HttpClient';
2
+ export type AffiliateServiceSettings = {
3
+ httpClient: HttpClient;
4
+ debug?: boolean;
5
+ };
6
+ export declare class ValidationError extends Error {
7
+ readonly errors: string[];
8
+ constructor(errors: string[]);
9
+ }
10
+ export declare class AddressInUseError extends Error {
11
+ readonly address: string;
12
+ constructor(address: string);
13
+ }
14
+ export declare class CodeInUseError extends Error {
15
+ readonly code: string;
16
+ constructor(code: string);
17
+ }
18
+ export declare class InvalidSignatureError extends Error {
19
+ constructor();
20
+ }
21
+ export declare class AffiliateService {
22
+ private readonly httpClient;
23
+ private readonly _debug;
24
+ constructor(settings: AffiliateServiceSettings);
25
+ create(address: string, code: string, signature: string, signatureMessage: string): Promise<void>;
26
+ getCode(address: string): Promise<string | null>;
27
+ }
28
+ //# sourceMappingURL=AffiliateService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AffiliateService.d.ts","sourceRoot":"","sources":["../../src/AffiliateService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,qBAAa,eAAgB,SAAQ,KAAK;IACxC,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;gBAErB,MAAM,EAAE,MAAM,EAAE;CAK7B;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAgB,OAAO,EAAE,MAAM,CAAC;gBAEpB,OAAO,EAAE,MAAM;CAK5B;AAED,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,IAAI,EAAE,MAAM;CAKzB;AAED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AAI,EAAE,MAAM,EACZ,IAAI,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,GACA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAItB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAGzD"}
package/dist/core.d.ts CHANGED
@@ -37,6 +37,17 @@ export declare function sendPageview(pageName?: string): Promise<void>;
37
37
  * ```
38
38
  */
39
39
  export declare function sendConnectWallet(userMetadata: UserMetadata): Promise<void>;
40
+ /**
41
+ * Creates an affiliate code that maps to an affiliate address
42
+ * @param {string} address - Affiliate wallet address
43
+ * @param {string} code - Affiliate code to map address to
44
+ * @param {string} signature - Signed message authenticating address ownership
45
+ * @example
46
+ * ```typescript
47
+ * await Fuul.createAffiliateCode('0x12345', 'my-cool-code', '<signature>')
48
+ * ```
49
+ **/
50
+ export declare function createAffiliateCode(address: string, code: string, signature: string): Promise<void>;
40
51
  /**
41
52
  * Generates a tracking link for an affiliate
42
53
  * @param {string} baseUrl - Base url of the project
@@ -50,7 +61,7 @@ export declare function sendConnectWallet(userMetadata: UserMetadata): Promise<v
50
61
  * ```
51
62
  * @see https://docs.fuul.xyz/technical-guide-for-projects/creating-partners-tracking-links-using-the-fuul-sdk
52
63
  **/
53
- export declare function generateTrackingLink(baseUrl: string, affiliateAddress: string, params?: AffiliateLinkParams): string;
64
+ export declare function generateTrackingLink(baseUrl: string, affiliateAddress: string, params?: AffiliateLinkParams): Promise<string>;
54
65
  export declare function getConversions(): Promise<Conversion[]>;
55
66
  declare const _default: {
56
67
  init: typeof init;
@@ -59,6 +70,7 @@ declare const _default: {
59
70
  sendConnectWallet: typeof sendConnectWallet;
60
71
  generateTrackingLink: typeof generateTrackingLink;
61
72
  getConversions: typeof getConversions;
73
+ createAffiliateCode: typeof createAffiliateCode;
62
74
  };
63
75
  export default _default;
64
76
  //# sourceMappingURL=core.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAa,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWzF,wBAAgB,IAAI,CAAC,QAAQ,EAAE,YAAY,QAoB1C;AAQD;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD1G;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjF;AAED;;;;;;;;;;;;IAYI;AACJ,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAgBpH;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAG5D;;;;;;;;;AAuBD,wBAOE"}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAa,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAYzF,wBAAgB,IAAI,CAAC,QAAQ,EAAE,YAAY,QAqB1C;AAQD;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC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