@polymarket/relayer-client 1.0.6 → 1.0.8

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
@@ -71,7 +71,7 @@ class RelayClient {
71
71
  const request = yield builder_1.buildProxyTransactionRequest(this.signer, args);
72
72
  console.log(`Client side proxy request creation took: ${(Date.now() - start) / 1000} seconds`);
73
73
  const resp = yield this.submitTransaction(request);
74
- return new response_1.ClientRelayerTransactionResponse(resp.transactionID, resp.state, this);
74
+ return new response_1.ClientRelayerTransactionResponse(resp.transactionID, resp.state, resp.transactionHash, this);
75
75
  });
76
76
  }
77
77
  executeSafeTransactions(txns) {
@@ -92,7 +92,7 @@ class RelayClient {
92
92
  const request = yield builder_1.buildSafeTransactionRequest(this.signer, args);
93
93
  console.log(`Client side safe request creation took: ${(Date.now() - start) / 1000} seconds`);
94
94
  const resp = yield this.submitTransaction(request);
95
- return new response_1.ClientRelayerTransactionResponse(resp.transactionID, resp.state, this);
95
+ return new response_1.ClientRelayerTransactionResponse(resp.transactionID, resp.state, resp.transactionHash, this);
96
96
  });
97
97
  }
98
98
  executeManualTransactions(txns, overrides) {
@@ -124,7 +124,7 @@ class RelayClient {
124
124
  const request = yield builder_1.buildSafeCreateTransactionRequest(this.signer, args);
125
125
  console.log(`Client side deploy request creation took: ${(Date.now() - start) / 1000} seconds`);
126
126
  const resp = yield this.submitTransaction(request);
127
- return new response_1.ClientRelayerTransactionResponse(resp.transactionID, resp.state, this);
127
+ return new response_1.ClientRelayerTransactionResponse(resp.transactionID, resp.state, resp.transactionHash, this);
128
128
  });
129
129
  }
130
130
  // Periodically polls the transaction id until it reaches a desired state
@@ -1,9 +1,11 @@
1
1
  import { RelayClient } from "../client";
2
- import { RelayerTransactionResponse } from "../types";
2
+ import { RelayerTransaction, RelayerTransactionResponse } from "../types";
3
3
  export declare class ClientRelayerTransactionResponse implements RelayerTransactionResponse {
4
4
  readonly client: RelayClient;
5
5
  readonly transactionID: string;
6
+ readonly transactionHash: string;
6
7
  readonly state: string;
7
- constructor(transactionID: string, state: string, client: RelayClient);
8
- wait(): Promise<boolean>;
8
+ constructor(transactionID: string, state: string, transactionHash: string, client: RelayClient);
9
+ getTransaction(): Promise<RelayerTransaction[]>;
10
+ wait(): Promise<RelayerTransaction | undefined>;
9
11
  }
@@ -4,21 +4,23 @@ exports.ClientRelayerTransactionResponse = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const types_1 = require("../types");
6
6
  class ClientRelayerTransactionResponse {
7
- constructor(transactionID, state, client) {
7
+ constructor(transactionID, state, transactionHash, client) {
8
8
  this.transactionID = transactionID;
9
9
  this.state = state;
10
+ this.transactionHash = transactionHash;
10
11
  this.client = client;
11
12
  }
13
+ getTransaction() {
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ return this.client.getTransaction(this.transactionID);
16
+ });
17
+ }
12
18
  wait() {
13
19
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
- const txn = yield this.client.pollUntilState(this.transactionID, [
20
+ return this.client.pollUntilState(this.transactionID, [
15
21
  types_1.RelayerTransactionState.STATE_MINED,
16
22
  types_1.RelayerTransactionState.STATE_CONFIRMED,
17
23
  ], 30);
18
- if (txn == undefined) {
19
- return false;
20
- }
21
- return true;
22
24
  });
23
25
  }
24
26
  }
package/dist/types.d.ts CHANGED
@@ -89,11 +89,6 @@ export declare enum RelayerTransactionState {
89
89
  STATE_CONFIRMED = "STATE_CONFIRMED",
90
90
  STATE_FAILED = "STATE_FAILED"
91
91
  }
92
- export interface RelayerTransactionResponse {
93
- transactionID: string;
94
- state: string;
95
- wait: () => Promise<boolean>;
96
- }
97
92
  export interface RelayerSubRequest {
98
93
  address: string;
99
94
  transactions: string[];
@@ -118,6 +113,13 @@ export interface RelayerTransaction {
118
113
  createdAt: Date;
119
114
  updatedAt: Date;
120
115
  }
116
+ export interface RelayerTransactionResponse {
117
+ transactionID: string;
118
+ state: string;
119
+ transactionHash: string;
120
+ getTransaction: () => Promise<RelayerTransaction[]>;
121
+ wait: () => Promise<RelayerTransaction | undefined>;
122
+ }
121
123
  export interface ManualOverrides {
122
124
  gasLimit?: BigNumberish;
123
125
  gasPrice?: BigNumberish;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@polymarket/relayer-client",
3
3
  "description": "Client for Polymarket relayers",
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [