@render-foundation/utils 0.0.20 → 0.0.21
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/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/squads.js +162 -0
- package/lib/cjs/squads.js.map +1 -0
- package/lib/esm/src/index.js +1 -1
- package/lib/esm/src/index.js.map +1 -1
- package/lib/esm/src/squads.js +122 -0
- package/lib/esm/src/squads.js.map +1 -0
- package/lib/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/src/index.d.ts +1 -1
- package/lib/types/src/index.d.ts.map +1 -1
- package/lib/types/src/squads.d.ts +12 -0
- package/lib/types/src/squads.d.ts.map +1 -0
- package/package.json +2 -1
- package/CHANGELOG.md +0 -310
- package/lib/cjs/squadsV3.js +0 -63
- package/lib/cjs/squadsV3.js.map +0 -1
- package/lib/esm/src/squadsV3.js +0 -47
- package/lib/esm/src/squadsV3.js.map +0 -1
- package/lib/types/src/squadsV3.d.ts +0 -8
- package/lib/types/src/squadsV3.d.ts.map +0 -1
package/lib/types/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Squads from "@sqds/sdk";
|
|
2
|
+
import { Connection, PublicKey, Signer, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
+
import { RenderLogger } from "./logger";
|
|
4
|
+
export declare const executeSqV4Transaction: (connection: Connection, multisigPda: PublicKey, approvers: Signer[], instrs: TransactionInstruction[], log?: RenderLogger) => Promise<{
|
|
5
|
+
txSig: string;
|
|
6
|
+
txPDA: PublicKey;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const executeSqV3Transaction: (connection: Connection, squadsMsKey: PublicKey, clients: Squads[], instrs: TransactionInstruction[], log?: RenderLogger) => Promise<{
|
|
9
|
+
txSig: string;
|
|
10
|
+
txPDA: PublicKey;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=squads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squads.d.ts","sourceRoot":"","sources":["../../../src/squads.ts"],"names":[],"mappings":"AAAA,OAAO,MAAgE,MAAM,WAAW,CAAC;AAGzF,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,MAAM,EAAe,sBAAsB,EAAqB,MAAM,iBAAiB,CAAC;AAEvH,OAAO,EAAgB,YAAY,EAAC,MAAM,UAAU,CAAC;AAMrD,eAAO,MAAM,sBAAsB,eACrB,UAAU,eACT,SAAS,aACX,MAAM,EAAE,UACX,sBAAsB,EAAE,QAC3B,YAAY;WACA,MAAM;WAAS,SAAS;EA+F1C,CAAA;AAED,eAAO,MAAM,sBAAsB,eACrB,UAAU,eACT,SAAS,WACb,MAAM,EAAE,UACT,sBAAsB,EAAE,QAC3B,YAAY;WACA,MAAM;WAAS,SAAS;EAqD1C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@render-foundation/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Utils shared across Render libs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@coral-xyz/anchor": "0.26.0",
|
|
36
36
|
"@pagerduty/pdjs": "^2.2.4",
|
|
37
37
|
"@render-foundation/spl-utils": "0.5.9",
|
|
38
|
+
"@render-foundation/multisig": "0.0.1",
|
|
38
39
|
"@slack/web-api": "^7.0.1",
|
|
39
40
|
"@solana/web3.js": "^1.43.4",
|
|
40
41
|
"@sqds/sdk": "^2.0.4",
|
package/CHANGELOG.md
DELETED
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [3.10.2](https://github.com/StrataFoundation/strata/compare/v3.10.1...v3.10.2) (2022-08-10)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# [3.10.0](https://github.com/StrataFoundation/strata/compare/v3.9.12...v3.10.0) (2022-08-04)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [3.9.5](https://github.com/StrataFoundation/strata/compare/v3.9.4...v3.9.5) (2022-07-26)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## [3.9.3](https://github.com/StrataFoundation/strata/compare/v3.9.2...v3.9.3) (2022-07-25)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# [3.9.0](https://github.com/StrataFoundation/strata/compare/v3.8.2...v3.9.0) (2022-07-11)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## [3.8.2](https://github.com/StrataFoundation/strata/compare/v3.8.1...v3.8.2) (2022-06-19)
|
|
47
|
-
|
|
48
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## [3.8.1](https://github.com/StrataFoundation/strata/compare/v3.8.0...v3.8.1) (2022-06-18)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# [3.7.0](https://github.com/StrataFoundation/strata/compare/v3.5.5...v3.7.0) (2022-06-02)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
### Bug Fixes
|
|
66
|
-
|
|
67
|
-
* **transactions:** remove subscription if available ([#230](https://github.com/StrataFoundation/strata/issues/230)) ([e99f05c](https://github.com/StrataFoundation/strata/commit/e99f05c02dd1f0176c8303608ea4859c68774cf4))
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## [3.6.1](https://github.com/StrataFoundation/strata/compare/v3.6.0...v3.6.1) (2022-05-21)
|
|
74
|
-
|
|
75
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## [3.5.7](https://github.com/StrataFoundation/strata/compare/v3.5.5...v3.5.7) (2022-05-07)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
### Bug Fixes
|
|
85
|
-
|
|
86
|
-
* **transactions:** remove subscription if available ([#230](https://github.com/StrataFoundation/strata/issues/230)) ([e99f05c](https://github.com/StrataFoundation/strata/commit/e99f05c02dd1f0176c8303608ea4859c68774cf4))
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## [3.5.5](https://github.com/StrataFoundation/strata/compare/v3.5.4...v3.5.5) (2022-04-19)
|
|
93
|
-
|
|
94
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
## [3.5.4](https://github.com/StrataFoundation/strata/compare/v3.5.2...v3.5.4) (2022-04-18)
|
|
101
|
-
|
|
102
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
## [3.5.3](https://github.com/StrataFoundation/strata/compare/v3.5.2...v3.5.3) (2022-04-18)
|
|
109
|
-
|
|
110
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## [3.4.5](https://github.com/StrataFoundation/strata/compare/v3.4.1...v3.4.5) (2022-03-29)
|
|
117
|
-
|
|
118
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## [3.4.3](https://github.com/StrataFoundation/strata/compare/v3.4.1...v3.4.3) (2022-03-26)
|
|
125
|
-
|
|
126
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
## [3.4.2](https://github.com/StrataFoundation/strata/compare/v3.4.1...v3.4.2) (2022-03-26)
|
|
133
|
-
|
|
134
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
## [3.4.1](https://github.com/StrataFoundation/strata/compare/v3.4.0...v3.4.1) (2022-03-25)
|
|
141
|
-
|
|
142
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
# [3.4.0](https://github.com/StrataFoundation/strata/compare/v3.3.6...v3.4.0) (2022-03-25)
|
|
149
|
-
|
|
150
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
## [3.3.6](https://github.com/StrataFoundation/strata/compare/v3.3.4...v3.3.6) (2022-03-16)
|
|
157
|
-
|
|
158
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
## [3.3.5](https://github.com/StrataFoundation/strata/compare/v3.3.4...v3.3.5) (2022-03-16)
|
|
165
|
-
|
|
166
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
## [3.3.4](https://github.com/StrataFoundation/strata/compare/v3.3.2...v3.3.4) (2022-03-16)
|
|
173
|
-
|
|
174
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
## [3.3.3](https://github.com/StrataFoundation/strata/compare/v3.3.2...v3.3.3) (2022-03-16)
|
|
181
|
-
|
|
182
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
# [3.3.0](https://github.com/StrataFoundation/strata/compare/v3.2.6...v3.3.0) (2022-03-04)
|
|
189
|
-
|
|
190
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
## [3.2.6](https://github.com/StrataFoundation/strata/compare/v3.0.0...v3.2.6) (2022-03-03)
|
|
197
|
-
|
|
198
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
## [3.2.4](https://github.com/StrataFoundation/strata/compare/v3.2.4-alpha.5...v3.2.4) (2022-02-12)
|
|
205
|
-
|
|
206
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
## [3.2.3](https://github.com/StrataFoundation/strata/compare/v3.2.2...v3.2.3) (2022-02-09)
|
|
213
|
-
|
|
214
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
## [3.2.2](https://github.com/StrataFoundation/strata/compare/v3.2.1...v3.2.2) (2022-02-08)
|
|
221
|
-
|
|
222
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
## [3.2.1](https://github.com/StrataFoundation/strata/compare/v3.2.0...v3.2.1) (2022-02-08)
|
|
229
|
-
|
|
230
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
# [3.2.0](https://github.com/StrataFoundation/strata/compare/v3.1.0...v3.2.0) (2022-02-03)
|
|
237
|
-
|
|
238
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
# [3.1.0](https://github.com/StrataFoundation/strata/compare/v3.0.0...v3.1.0) (2022-01-29)
|
|
245
|
-
|
|
246
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
# [3.0.0](https://github.com/StrataFoundation/strata/compare/v2.2.0...v3.0.0) (2022-01-26)
|
|
253
|
-
|
|
254
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
# [2.2.0](https://github.com/StrataFoundation/strata/compare/v2.1.11...v2.2.0) (2022-01-25)
|
|
261
|
-
|
|
262
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
## [2.1.7](https://github.com/StrataFoundation/strata/compare/v2.1.6...v2.1.7) (2022-01-20)
|
|
269
|
-
|
|
270
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
## [2.1.2](https://github.com/StrataFoundation/strata/compare/v2.1.1...v2.1.2) (2022-01-17)
|
|
277
|
-
|
|
278
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
## [2.1.1](https://github.com/StrataFoundation/strata/compare/v2.1.0...v2.1.1) (2022-01-12)
|
|
285
|
-
|
|
286
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
# [2.1.0](https://github.com/StrataFoundation/strata/compare/v2.0.6...v2.1.0) (2022-01-11)
|
|
293
|
-
|
|
294
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
# [2.0.0](https://github.com/StrataFoundation/strata/compare/v1.3.2...v2.0.0) (2021-12-24)
|
|
301
|
-
|
|
302
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
## [1.3.2](https://github.com/StrataFoundation/strata/compare/v0.7.0...v1.3.2) (2021-12-15)
|
|
309
|
-
|
|
310
|
-
**Note:** Version bump only for package @strata-foundation/spl-utils
|
package/lib/cjs/squadsV3.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.executeSqV3Transaction = void 0;
|
|
16
|
-
const sdk_1 = require("@sqds/sdk");
|
|
17
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
18
|
-
const web3_js_1 = require("@solana/web3.js");
|
|
19
|
-
const spl_utils_1 = require("@render-foundation/spl-utils");
|
|
20
|
-
const logger_1 = require("./logger");
|
|
21
|
-
const executeSqV3Transaction = (connection, squadsMsKey, clients, instrs, log = logger_1.consoleLogger) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
const msAuthorityK = (0, sdk_1.getAuthorityPDA)(squadsMsKey, new bn_js_1.default(1), sdk_1.DEFAULT_MULTISIG_PROGRAM_ID)[0];
|
|
23
|
-
let txPDA;
|
|
24
|
-
const primClient = clients[0];
|
|
25
|
-
const txIdx = yield primClient.getNextTransactionIndex(squadsMsKey);
|
|
26
|
-
txPDA = (0, sdk_1.getTxPDA)(squadsMsKey, new bn_js_1.default(txIdx), sdk_1.DEFAULT_MULTISIG_PROGRAM_ID)[0];
|
|
27
|
-
let createTx = new web3_js_1.Transaction()
|
|
28
|
-
.add(yield primClient.buildCreateTransaction(squadsMsKey, 1, txIdx));
|
|
29
|
-
let instrIdx = 1;
|
|
30
|
-
for (const i of instrs) {
|
|
31
|
-
createTx.add(yield primClient.buildAddInstruction(squadsMsKey, txPDA, i, instrIdx));
|
|
32
|
-
instrIdx += 1;
|
|
33
|
-
}
|
|
34
|
-
createTx.add(yield primClient.buildActivateTransaction(squadsMsKey, txPDA));
|
|
35
|
-
for (const c of clients) {
|
|
36
|
-
createTx.add(yield c.buildApproveTransaction(squadsMsKey, txPDA));
|
|
37
|
-
}
|
|
38
|
-
createTx.recentBlockhash = (yield connection.getLatestBlockhash()).blockhash;
|
|
39
|
-
createTx.feePayer = primClient.wallet.publicKey;
|
|
40
|
-
for (const c of clients) {
|
|
41
|
-
createTx = yield c.wallet.signTransaction(createTx);
|
|
42
|
-
}
|
|
43
|
-
//createTx.sign(sharedMsKp, authorityKp)
|
|
44
|
-
yield (0, spl_utils_1.sendAndConfirmWithRetry)(connection, createTx.serialize(), {
|
|
45
|
-
skipPreflight: true,
|
|
46
|
-
maxRetries: 10,
|
|
47
|
-
}, 'finalized');
|
|
48
|
-
log.info(`created tx ${txPDA}`);
|
|
49
|
-
log.info(`executing tx ${txPDA}`);
|
|
50
|
-
let execTx = new web3_js_1.Transaction().add(yield primClient.buildExecuteTransaction(txPDA, primClient.wallet.publicKey));
|
|
51
|
-
execTx.recentBlockhash = (yield connection.getLatestBlockhash()).blockhash;
|
|
52
|
-
execTx.feePayer = primClient.wallet.publicKey;
|
|
53
|
-
execTx = yield primClient.wallet.signTransaction(execTx);
|
|
54
|
-
//execTx.sign(args.solFeePayerKp)
|
|
55
|
-
const { txid } = yield (0, spl_utils_1.sendAndConfirmWithRetry)(connection, execTx.serialize(), {
|
|
56
|
-
skipPreflight: true,
|
|
57
|
-
maxRetries: 10,
|
|
58
|
-
}, 'confirmed');
|
|
59
|
-
log.info(`executed ${txid}`);
|
|
60
|
-
return { txSig: txid, txPDA };
|
|
61
|
-
});
|
|
62
|
-
exports.executeSqV3Transaction = executeSqV3Transaction;
|
|
63
|
-
//# sourceMappingURL=squadsV3.js.map
|
package/lib/cjs/squadsV3.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"squadsV3.js","sourceRoot":"","sources":["../../src/squadsV3.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAyF;AACzF,kDAAuB;AAEvB,6CAAmG;AACnG,4DAAqE;AACrE,qCAAqD;AAE9C,MAAM,sBAAsB,GAAG,CACpC,UAAsB,EACtB,WAAsB,EACtB,OAAiB,EACjB,MAAgC,EAChC,MAAoB,sBAAa,EACW,EAAE;IAC9C,MAAM,YAAY,GAAG,IAAA,qBAAe,EAAC,WAAW,EAAE,IAAI,eAAE,CAAC,CAAC,CAAC,EAAE,iCAA2B,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5F,IAAI,KAAgB,CAAC;IACrB,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7B,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAA;IACnE,KAAK,GAAG,IAAA,cAAQ,EAAC,WAAW,EAAE,IAAI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AAC,IAAI,CAAC,gBAAgB,KAAK,EAAE,CAAC,CAAA;IACjC,IAAI,MAAM,GAAG,IAAI,qBAAW,EAAE,CAAC,GAAG,CAAC,MAAM,UAAU,CAAC,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IAChH,MAAM,CAAC,eAAe,GAAG,CAAC,MAAM,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAC,SAAS,CAAA;IAC1E,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAA;IAC7C,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;IACxD,iCAAiC;IACjC,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAA,mCAAuB,EAC1C,UAAU,EACV,MAAM,CAAC,SAAS,EAAE,EAClB;QACE,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,EAAE;KACf,EACD,WAAW,CACZ,CAAA;IACD,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAA;IAC5B,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAC,CAAA;AAC7B,CAAC,CAAA,CAAA;AA3DY,QAAA,sBAAsB,0BA2DlC"}
|
package/lib/esm/src/squadsV3.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_MULTISIG_PROGRAM_ID, getAuthorityPDA, getTxPDA } from "@sqds/sdk";
|
|
2
|
-
import BN from "bn.js";
|
|
3
|
-
import { Transaction } from "@solana/web3.js";
|
|
4
|
-
import { sendAndConfirmWithRetry } from "@render-foundation/spl-utils";
|
|
5
|
-
import { consoleLogger } from "./logger";
|
|
6
|
-
export const executeSqV3Transaction = async (connection, squadsMsKey, clients, instrs, log = consoleLogger) => {
|
|
7
|
-
const msAuthorityK = getAuthorityPDA(squadsMsKey, new BN(1), DEFAULT_MULTISIG_PROGRAM_ID)[0];
|
|
8
|
-
let txPDA;
|
|
9
|
-
const primClient = clients[0];
|
|
10
|
-
const txIdx = await primClient.getNextTransactionIndex(squadsMsKey);
|
|
11
|
-
txPDA = getTxPDA(squadsMsKey, new BN(txIdx), DEFAULT_MULTISIG_PROGRAM_ID)[0];
|
|
12
|
-
let createTx = new Transaction()
|
|
13
|
-
.add(await primClient.buildCreateTransaction(squadsMsKey, 1, txIdx));
|
|
14
|
-
let instrIdx = 1;
|
|
15
|
-
for (const i of instrs) {
|
|
16
|
-
createTx.add(await primClient.buildAddInstruction(squadsMsKey, txPDA, i, instrIdx));
|
|
17
|
-
instrIdx += 1;
|
|
18
|
-
}
|
|
19
|
-
createTx.add(await primClient.buildActivateTransaction(squadsMsKey, txPDA));
|
|
20
|
-
for (const c of clients) {
|
|
21
|
-
createTx.add(await c.buildApproveTransaction(squadsMsKey, txPDA));
|
|
22
|
-
}
|
|
23
|
-
createTx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
|
|
24
|
-
createTx.feePayer = primClient.wallet.publicKey;
|
|
25
|
-
for (const c of clients) {
|
|
26
|
-
createTx = await c.wallet.signTransaction(createTx);
|
|
27
|
-
}
|
|
28
|
-
//createTx.sign(sharedMsKp, authorityKp)
|
|
29
|
-
await sendAndConfirmWithRetry(connection, createTx.serialize(), {
|
|
30
|
-
skipPreflight: true,
|
|
31
|
-
maxRetries: 10,
|
|
32
|
-
}, 'finalized');
|
|
33
|
-
log.info(`created tx ${txPDA}`);
|
|
34
|
-
log.info(`executing tx ${txPDA}`);
|
|
35
|
-
let execTx = new Transaction().add(await primClient.buildExecuteTransaction(txPDA, primClient.wallet.publicKey));
|
|
36
|
-
execTx.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
|
|
37
|
-
execTx.feePayer = primClient.wallet.publicKey;
|
|
38
|
-
execTx = await primClient.wallet.signTransaction(execTx);
|
|
39
|
-
//execTx.sign(args.solFeePayerKp)
|
|
40
|
-
const { txid } = await sendAndConfirmWithRetry(connection, execTx.serialize(), {
|
|
41
|
-
skipPreflight: true,
|
|
42
|
-
maxRetries: 10,
|
|
43
|
-
}, 'confirmed');
|
|
44
|
-
log.info(`executed ${txid}`);
|
|
45
|
-
return { txSig: txid, txPDA };
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=squadsV3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"squadsV3.js","sourceRoot":"","sources":["../../../src/squadsV3.ts"],"names":[],"mappings":"AAAA,OAAe,EAAC,2BAA2B,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAC;AACzF,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvB,OAAO,EAAgC,WAAW,EAAyB,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAC,aAAa,EAAe,MAAM,UAAU,CAAC;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,UAAsB,EACtB,WAAsB,EACtB,OAAiB,EACjB,MAAgC,EAChC,MAAoB,aAAa,EACW,EAAE;IAC9C,MAAM,YAAY,GAAG,eAAe,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5F,IAAI,KAAgB,CAAC;IACrB,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7B,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAA;IACnE,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5E,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE;SAC7B,GAAG,CAAC,MAAM,UAAU,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAC,EAAE,KAAK,CAA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,MAAM,CAAC,eAAe,GAAG,CAAC,MAAM,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAC,SAAS,CAAA;IAC1E,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAA;IAC7C,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;IACxD,iCAAiC;IACjC,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,uBAAuB,CAC1C,UAAU,EACV,MAAM,CAAC,SAAS,EAAE,EAClB;QACE,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,EAAE;KACf,EACD,WAAW,CACZ,CAAA;IACD,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAA;IAC5B,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAC,CAAA;AAC7B,CAAC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import Squads from "@sqds/sdk";
|
|
2
|
-
import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
3
|
-
import { RenderLogger } from "./logger";
|
|
4
|
-
export declare const executeSqV3Transaction: (connection: Connection, squadsMsKey: PublicKey, clients: Squads[], instrs: TransactionInstruction[], log?: RenderLogger) => Promise<{
|
|
5
|
-
txSig: string;
|
|
6
|
-
txPDA: PublicKey;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=squadsV3.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"squadsV3.d.ts","sourceRoot":"","sources":["../../../src/squadsV3.ts"],"names":[],"mappings":"AAAA,OAAO,MAAgE,MAAM,WAAW,CAAC;AAGzF,OAAO,EAAC,UAAU,EAAE,SAAS,EAAuB,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAgB,YAAY,EAAC,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,sBAAsB,eACrB,UAAU,eACT,SAAS,WACb,MAAM,EAAE,UACT,sBAAsB,EAAE,QAC3B,YAAY;WACA,MAAM;WAAS,SAAS;EAqD1C,CAAA"}
|