@polymarket/relayer-client 3.0.0 → 4.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.
- package/README.md +7 -9
- package/dist/abis/erc20Abi.js +155 -155
- package/dist/abis/index.d.ts +3 -3
- package/dist/abis/index.js +3 -3
- package/dist/abis/multisend.js +12 -12
- package/dist/abis/proxyFactory.js +216 -216
- package/dist/abis/safe.js +769 -769
- package/dist/abis/safeFactory.js +159 -159
- package/dist/auth/handler.d.ts +2 -2
- package/dist/auth/handler.js +8 -6
- package/dist/builder/create.d.ts +4 -4
- package/dist/builder/create.js +1 -1
- package/dist/builder/derive.js +4 -4
- package/dist/builder/index.d.ts +2 -2
- package/dist/builder/index.js +2 -2
- package/dist/builder/proxy.d.ts +4 -4
- package/dist/builder/proxy.js +9 -7
- package/dist/builder/safe.d.ts +4 -4
- package/dist/builder/safe.js +20 -15
- package/dist/client.d.ts +7 -9
- package/dist/client.js +21 -21
- package/dist/config/index.js +4 -5
- package/dist/encode/proxy.d.ts +1 -1
- package/dist/encode/proxy.js +2 -2
- package/dist/encode/safe.d.ts +1 -1
- package/dist/encode/safe.js +8 -2
- package/dist/http-helpers/index.d.ts +1 -1
- package/dist/http-helpers/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/manual/index.d.ts +4 -4
- package/dist/manual/index.js +8 -6
- package/dist/response/index.d.ts +2 -2
- package/dist/response/index.js +2 -5
- package/dist/signer/index.d.ts +26 -0
- package/dist/signer/index.js +109 -0
- package/dist/types.js +0 -1
- package/dist/utils/index.js +4 -4
- package/package.json +17 -24
package/README.md
CHANGED
|
@@ -9,23 +9,21 @@ npm install @polymarket/relayer-client
|
|
|
9
9
|
### Usage
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
|
-
import { ethers } from "ethers";
|
|
13
12
|
import { createWalletClient, Hex, http } from "viem";
|
|
14
13
|
import { privateKeyToAccount } from "viem/accounts";
|
|
14
|
+
import { polygon } from "viem/chains";
|
|
15
15
|
import { RelayClient } from "@polymarket/relayer-client";
|
|
16
16
|
|
|
17
17
|
const relayerUrl = `${process.env.POLYMARKET_RELAYER_URL}`;
|
|
18
18
|
const chainId = parseInt(`${process.env.CHAIN_ID}`);
|
|
19
19
|
|
|
20
|
-
// Ethers
|
|
21
|
-
const provider = new ethers.providers.JsonRpcProvider(`${process.env.RPC_URL}`);
|
|
22
|
-
const pk = new ethers.Wallet(`${process.env.PK}`);
|
|
23
|
-
const wallet = pk.connect(provider);
|
|
24
|
-
|
|
25
|
-
// Viem
|
|
26
20
|
const pk = privateKeyToAccount(`${process.env.PK}` as Hex);
|
|
27
|
-
const wallet = createWalletClient({
|
|
21
|
+
const wallet = createWalletClient({
|
|
22
|
+
account: pk,
|
|
23
|
+
chain: polygon,
|
|
24
|
+
transport: http(`${process.env.RPC_URL}`),
|
|
25
|
+
});
|
|
28
26
|
|
|
29
27
|
// Initialize Relay Client
|
|
30
28
|
const client = new RelayClient(relayerUrl, chainId, wallet);
|
|
31
|
-
```
|
|
29
|
+
```
|
package/dist/abis/erc20Abi.js
CHANGED
|
@@ -1,222 +1,222 @@
|
|
|
1
1
|
export const erc20Abi = [
|
|
2
2
|
{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
constant: true,
|
|
4
|
+
inputs: [],
|
|
5
|
+
name: "name",
|
|
6
|
+
outputs: [
|
|
7
|
+
{
|
|
8
|
+
name: "",
|
|
9
|
+
type: "string",
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
payable: false,
|
|
13
|
+
stateMutability: "view",
|
|
14
|
+
type: "function",
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
constant: false,
|
|
18
|
+
inputs: [
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
name: "_spender",
|
|
21
|
+
type: "address",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
name: "_value",
|
|
25
|
+
type: "uint256",
|
|
26
|
+
},
|
|
27
27
|
],
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
name: "approve",
|
|
29
|
+
outputs: [
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
name: "",
|
|
32
|
+
type: "bool",
|
|
33
|
+
},
|
|
34
34
|
],
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
payable: false,
|
|
36
|
+
stateMutability: "nonpayable",
|
|
37
|
+
type: "function",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
constant: true,
|
|
41
|
+
inputs: [],
|
|
42
|
+
name: "totalSupply",
|
|
43
|
+
outputs: [
|
|
44
|
+
{
|
|
45
|
+
name: "",
|
|
46
|
+
type: "uint256",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
payable: false,
|
|
50
|
+
stateMutability: "view",
|
|
51
|
+
type: "function",
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
constant: false,
|
|
55
|
+
inputs: [
|
|
56
56
|
{
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
name: "_from",
|
|
58
|
+
type: "address",
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
name: "_to",
|
|
62
|
+
type: "address",
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
65
|
+
name: "_value",
|
|
66
|
+
type: "uint256",
|
|
67
|
+
},
|
|
68
68
|
],
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
name: "transferFrom",
|
|
70
|
+
outputs: [
|
|
71
71
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
72
|
+
name: "",
|
|
73
|
+
type: "bool",
|
|
74
|
+
},
|
|
75
75
|
],
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
payable: false,
|
|
77
|
+
stateMutability: "nonpayable",
|
|
78
|
+
type: "function",
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
81
|
+
constant: true,
|
|
82
|
+
inputs: [],
|
|
83
|
+
name: "decimals",
|
|
84
|
+
outputs: [
|
|
85
|
+
{
|
|
86
|
+
name: "",
|
|
87
|
+
type: "uint8",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
payable: false,
|
|
91
|
+
stateMutability: "view",
|
|
92
|
+
type: "function",
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
constant: true,
|
|
96
|
+
inputs: [
|
|
97
97
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
98
|
+
name: "_owner",
|
|
99
|
+
type: "address",
|
|
100
|
+
},
|
|
101
101
|
],
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
name: "balanceOf",
|
|
103
|
+
outputs: [
|
|
104
104
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
105
|
+
name: "balance",
|
|
106
|
+
type: "uint256",
|
|
107
|
+
},
|
|
108
108
|
],
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
payable: false,
|
|
110
|
+
stateMutability: "view",
|
|
111
|
+
type: "function",
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
constant: true,
|
|
115
|
+
inputs: [],
|
|
116
|
+
name: "symbol",
|
|
117
|
+
outputs: [
|
|
118
|
+
{
|
|
119
|
+
name: "",
|
|
120
|
+
type: "string",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
payable: false,
|
|
124
|
+
stateMutability: "view",
|
|
125
|
+
type: "function",
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
constant: false,
|
|
129
|
+
inputs: [
|
|
130
130
|
{
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
name: "_to",
|
|
132
|
+
type: "address",
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
135
|
+
name: "_value",
|
|
136
|
+
type: "uint256",
|
|
137
|
+
},
|
|
138
138
|
],
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
name: "transfer",
|
|
140
|
+
outputs: [
|
|
141
141
|
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
142
|
+
name: "",
|
|
143
|
+
type: "bool",
|
|
144
|
+
},
|
|
145
145
|
],
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
payable: false,
|
|
147
|
+
stateMutability: "nonpayable",
|
|
148
|
+
type: "function",
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
constant: true,
|
|
152
|
+
inputs: [
|
|
153
153
|
{
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
name: "_owner",
|
|
155
|
+
type: "address",
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
158
|
+
name: "_spender",
|
|
159
|
+
type: "address",
|
|
160
|
+
},
|
|
161
161
|
],
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
name: "allowance",
|
|
163
|
+
outputs: [
|
|
164
164
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
165
|
+
name: "",
|
|
166
|
+
type: "uint256",
|
|
167
|
+
},
|
|
168
168
|
],
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
payable: false,
|
|
170
|
+
stateMutability: "view",
|
|
171
|
+
type: "function",
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
payable: true,
|
|
175
|
+
stateMutability: "payable",
|
|
176
|
+
type: "fallback",
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
anonymous: false,
|
|
180
|
+
inputs: [
|
|
181
181
|
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
indexed: true,
|
|
183
|
+
name: "owner",
|
|
184
|
+
type: "address",
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
indexed: true,
|
|
188
|
+
name: "spender",
|
|
189
|
+
type: "address",
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
192
|
+
indexed: false,
|
|
193
|
+
name: "value",
|
|
194
|
+
type: "uint256",
|
|
195
|
+
},
|
|
196
196
|
],
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
name: "Approval",
|
|
198
|
+
type: "event",
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
anonymous: false,
|
|
202
|
+
inputs: [
|
|
203
203
|
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
indexed: true,
|
|
205
|
+
name: "from",
|
|
206
|
+
type: "address",
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
indexed: true,
|
|
210
|
+
name: "to",
|
|
211
|
+
type: "address",
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
214
|
+
indexed: false,
|
|
215
|
+
name: "value",
|
|
216
|
+
type: "uint256",
|
|
217
|
+
},
|
|
218
218
|
],
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
219
|
+
name: "Transfer",
|
|
220
|
+
type: "event",
|
|
221
|
+
},
|
|
222
222
|
];
|
package/dist/abis/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./safeFactory.ts";
|
|
2
|
-
export * from "./proxyFactory.ts";
|
|
3
1
|
export * from "./erc20Abi.ts";
|
|
4
|
-
export * from "./safe.ts";
|
|
5
2
|
export * from "./multisend.ts";
|
|
3
|
+
export * from "./proxyFactory.ts";
|
|
4
|
+
export * from "./safe.ts";
|
|
5
|
+
export * from "./safeFactory.ts";
|
package/dist/abis/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./safeFactory.js";
|
|
2
|
-
export * from "./proxyFactory.js";
|
|
3
1
|
export * from "./erc20Abi.js";
|
|
4
|
-
export * from "./safe.js";
|
|
5
2
|
export * from "./multisend.js";
|
|
3
|
+
export * from "./proxyFactory.js";
|
|
4
|
+
export * from "./safe.js";
|
|
5
|
+
export * from "./safeFactory.js";
|
package/dist/abis/multisend.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export const multisendAbi = [
|
|
2
2
|
{
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
constant: false,
|
|
4
|
+
inputs: [
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
6
|
+
internalType: "bytes",
|
|
7
|
+
name: "transactions",
|
|
8
|
+
type: "bytes",
|
|
9
|
+
},
|
|
10
10
|
],
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
11
|
+
name: "multiSend",
|
|
12
|
+
outputs: [],
|
|
13
|
+
payable: false,
|
|
14
|
+
stateMutability: "nonpayable",
|
|
15
|
+
type: "function",
|
|
16
|
+
},
|
|
17
17
|
];
|