@pear-protocol/core-sdk 1.16.0 → 1.17.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.
@@ -11,16 +11,22 @@ declare class Auth {
11
11
  /**
12
12
  * Begin linking an X account. Send the browser to the returned `authorizeUrl`;
13
13
  * X redirects back to the backend callback, which finishes the link.
14
+ *
15
+ * Pass `returnTo` as the page the user is on - normally `location.href` - and the
16
+ * callback returns them there with the outcome on the query string.
14
17
  */
15
- startXLink(headers?: ClientHeaders): Promise<{
18
+ startXLink(body?: HttpTypes.StartXLinkRequest, headers?: ClientHeaders): Promise<{
16
19
  authorizeUrl: string;
17
20
  }>;
18
21
  /**
19
22
  * Begin signing in with X. Send the browser to the returned `authorizeUrl`; X redirects
20
23
  * back to the backend callback, which signs in the Pear account that has this X account
21
24
  * connected. It never creates one - connect X from a signed-in session first.
25
+ *
26
+ * Pass `returnTo` as the page the user is on - normally `location.href` - and the
27
+ * callback returns them there with the outcome on the query string.
22
28
  */
23
- startXLogin(headers?: ClientHeaders): Promise<{
29
+ startXLogin(body?: HttpTypes.StartXLoginRequest, headers?: ClientHeaders): Promise<{
24
30
  authorizeUrl: string;
25
31
  }>;
26
32
  /**
@@ -20,22 +20,30 @@ class Auth {
20
20
  /**
21
21
  * Begin linking an X account. Send the browser to the returned `authorizeUrl`;
22
22
  * X redirects back to the backend callback, which finishes the link.
23
+ *
24
+ * Pass `returnTo` as the page the user is on - normally `location.href` - and the
25
+ * callback returns them there with the outcome on the query string.
23
26
  */
24
- async startXLink(headers) {
27
+ async startXLink(body = {}, headers) {
25
28
  return await this.client.fetch(`/auth/link/x/start`, {
26
29
  method: "POST",
27
- headers
30
+ headers,
31
+ body
28
32
  });
29
33
  }
30
34
  /**
31
35
  * Begin signing in with X. Send the browser to the returned `authorizeUrl`; X redirects
32
36
  * back to the backend callback, which signs in the Pear account that has this X account
33
37
  * connected. It never creates one - connect X from a signed-in session first.
38
+ *
39
+ * Pass `returnTo` as the page the user is on - normally `location.href` - and the
40
+ * callback returns them there with the outcome on the query string.
34
41
  */
35
- async startXLogin(headers) {
42
+ async startXLogin(body = {}, headers) {
36
43
  return await this.client.fetch(`/auth/login/x/start`, {
37
44
  method: "POST",
38
- headers
45
+ headers,
46
+ body
39
47
  });
40
48
  }
41
49
  /**
@@ -187,7 +187,7 @@ declare class Core {
187
187
  get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
188
188
  baseBps: string;
189
189
  discounts: {
190
- scope: "user" | "connector" | "all" | "client_id";
190
+ scope: "connector" | "all" | "user" | "client_id";
191
191
  rate: string;
192
192
  }[];
193
193
  finalBps: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/core-sdk",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "Pear Protocol Core SDK",
5
5
  "private": false,
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsc --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@pear-protocol/types": "^1.23.0",
29
+ "@pear-protocol/types": "^1.24.0",
30
30
  "@pear-protocol/utils": "^0.5.1",
31
31
  "qs": "^6.14.0"
32
32
  },