@swarm-tips/client 0.2.13 → 0.4.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.
@@ -135,12 +135,12 @@ export declare class CoordinationGameApiClient {
135
135
  chain: string;
136
136
  session_key: string;
137
137
  tournament_id: number;
138
- }): Promise<XQueueResponse>;
138
+ }, token?: string): Promise<XQueueResponse>;
139
139
  crossChainStatus(by: {
140
140
  handle: string;
141
141
  } | {
142
142
  wallet: string;
143
- }): Promise<XQueueResponse>;
143
+ }, token?: string): Promise<XQueueResponse>;
144
144
  crossChainCommit(body: {
145
145
  wallet: string;
146
146
  commit: string;
@@ -177,8 +177,8 @@ export declare class CoordinationGameApiClient {
177
177
  player_wallet?: string;
178
178
  chain: string;
179
179
  tournament_id: number;
180
- }): Promise<EvmJoinResponse>;
181
- evmGameStatus(wallet: string): Promise<EvmJoinResponse>;
180
+ }, token?: string): Promise<EvmJoinResponse>;
181
+ evmGameStatus(wallet: string, token?: string): Promise<EvmJoinResponse>;
182
182
  evmGameCommitted(body: {
183
183
  game_id: string;
184
184
  wallet: string;
@@ -19,14 +19,14 @@ export class CoordinationGameApiClient {
19
19
  committed(body, token) { return this.http.post("/games/committed", body, token); }
20
20
  bothCommitted(body, token) { return this.http.post("/games/both-committed", body, token); }
21
21
  resolved(body, token) { return this.http.post("/games/resolved", body, token); }
22
- joinCrossChainQueue(body) {
23
- return this.http.post("/internal/xqueue/join", body);
22
+ joinCrossChainQueue(body, token) {
23
+ return this.http.post("/internal/xqueue/join", body, token);
24
24
  }
25
- crossChainStatus(by) {
25
+ crossChainStatus(by, token) {
26
26
  const query = "handle" in by
27
27
  ? `handle=${encodeURIComponent(by.handle)}`
28
28
  : `wallet=${encodeURIComponent(by.wallet)}`;
29
- return this.http.get(`/internal/xqueue/status?${query}`);
29
+ return this.http.get(`/internal/xqueue/status?${query}`, token);
30
30
  }
31
31
  crossChainCommit(body) {
32
32
  return this.http.post("/internal/xqueue/commit", body);
@@ -43,11 +43,11 @@ export class CoordinationGameApiClient {
43
43
  : `wallet=${encodeURIComponent(by.wallet)}`;
44
44
  return this.http.get(`/internal/xqueue/gameplay?${query}`);
45
45
  }
46
- joinEvmGame(body) {
47
- return this.http.post("/internal/evmgame/join", body);
46
+ joinEvmGame(body, token) {
47
+ return this.http.post("/internal/evmgame/join", body, token);
48
48
  }
49
- evmGameStatus(wallet) {
50
- return this.http.get(`/internal/evmgame/status?wallet=${encodeURIComponent(wallet)}`);
49
+ evmGameStatus(wallet, token) {
50
+ return this.http.get(`/internal/evmgame/status?wallet=${encodeURIComponent(wallet)}`, token);
51
51
  }
52
52
  evmGameCommitted(body) {
53
53
  return this.http.post("/internal/evmgame/committed", body);
package/dist/errors.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type SwarmClientErrorCode = "INVALID_ARGUMENT" | "INVALID_RESPONSE" | "NETWORK_ERROR" | "HTTP_ERROR" | "TIMEOUT" | "TRANSACTION_MISMATCH" | "TRANSACTION_FAILED" | "STORAGE_ERROR" | "WEBSOCKET_ERROR";
1
+ export type SwarmClientErrorCode = "INVALID_ARGUMENT" | "INVALID_RESPONSE" | "NETWORK_ERROR" | "HTTP_ERROR" | "TIMEOUT" | "TRANSACTION_MISMATCH" | "TRANSACTION_FAILED" | "SPEND_CAP_EXCEEDED" | "AUTH_REQUIRED" | "STORAGE_ERROR" | "WEBSOCKET_ERROR";
2
2
  export interface SwarmClientErrorOptions {
3
3
  code: SwarmClientErrorCode;
4
4
  operation: string;