@solworks/poll-api-client 0.1.2 → 0.1.3

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.js CHANGED
@@ -73,7 +73,7 @@ export class PollClient {
73
73
  // ── User ──────────────────────────────────────────────────────────────
74
74
  async getAccount() {
75
75
  // API returns { user: {...}, address: string, error: null }
76
- const res = await this.request('GET', '/api/user/account');
76
+ const res = await this.request('GET', '/api/user');
77
77
  return { ...res.user, walletAddress: res.address };
78
78
  }
79
79
  async getProfile(uuid) {
@@ -83,7 +83,7 @@ export class PollClient {
83
83
  return { ...res.profile, stats: res.stats };
84
84
  }
85
85
  async updateDisplayName(name) {
86
- await this.request('POST', '/api/user/account/displayname', {
86
+ await this.request('POST', '/api/user/displayname', {
87
87
  displayName: name,
88
88
  });
89
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solworks/poll-api-client",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Typed HTTP client for the Poll.fun REST API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@ describe('User endpoints', () => {
26
26
 
27
27
  expect(result).toEqual({ ...user, walletAddress: address });
28
28
  const [url, init] = mockFetch.mock.calls[0];
29
- expect(url).toBe('https://api.poll.fun/api/user/account');
29
+ expect(url).toBe('https://api.poll.fun/api/user');
30
30
  expect(init.method).toBe('GET');
31
31
  });
32
32
 
@@ -61,7 +61,7 @@ describe('User endpoints', () => {
61
61
  await client.updateDisplayName('NewName');
62
62
 
63
63
  const [url, init] = mockFetch.mock.calls[0];
64
- expect(url).toBe('https://api.poll.fun/api/user/account/displayname');
64
+ expect(url).toBe('https://api.poll.fun/api/user/displayname');
65
65
  expect(init.method).toBe('POST');
66
66
  expect(JSON.parse(init.body)).toEqual({ displayName: 'NewName' });
67
67
  });