@carrot-protocol/boost-http-client 0.2.13-inputs-dev-88a7a7e → 0.2.13-inputs-dev-72e7d04
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/index.js +15 -16
- package/dist/types.d.ts +2 -1
- package/package.json +1 -1
- package/src/index.ts +15 -16
- package/src/types.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -170,29 +170,28 @@ class Client {
|
|
|
170
170
|
clendAccount: new anchor_1.web3.PublicKey(s.clendAccount),
|
|
171
171
|
clendAccountAuthority: new anchor_1.web3.PublicKey(s.clendAccountAuthority),
|
|
172
172
|
clendGroup: new anchor_1.web3.PublicKey(s.clendGroup),
|
|
173
|
-
|
|
173
|
+
action: s.action,
|
|
174
|
+
input: undefined,
|
|
174
175
|
events: [],
|
|
175
176
|
};
|
|
176
177
|
// parse inputs if they exist
|
|
177
|
-
if (s.
|
|
178
|
-
const
|
|
179
|
-
apiPath: s.
|
|
180
|
-
selectedTokenMint: s.
|
|
181
|
-
? new anchor_1.web3.PublicKey(s.
|
|
178
|
+
if (s.input) {
|
|
179
|
+
const input = {
|
|
180
|
+
apiPath: s.input.apiPath,
|
|
181
|
+
selectedTokenMint: s.input.selectedTokenMint
|
|
182
|
+
? new anchor_1.web3.PublicKey(s.input.selectedTokenMint)
|
|
182
183
|
: null,
|
|
183
|
-
amountUi: s.
|
|
184
|
-
leverage: s.
|
|
185
|
-
slippageBps: s.
|
|
186
|
-
|
|
184
|
+
amountUi: s.input.amountUi ? Number(s.input.amountUi) : null,
|
|
185
|
+
leverage: s.input.leverage ? Number(s.input.leverage) : null,
|
|
186
|
+
slippageBps: s.input.slippageBps ? Number(s.input.slippageBps) : null,
|
|
187
|
+
openPosition: s.input.openPosition
|
|
188
|
+
? Boolean(s.input.openPosition)
|
|
187
189
|
: null,
|
|
188
|
-
|
|
189
|
-
? Boolean(s.
|
|
190
|
-
: null,
|
|
191
|
-
closePosition: s.inputs.closePosition
|
|
192
|
-
? Boolean(s.inputs.closePosition)
|
|
190
|
+
closePosition: s.input.closePosition
|
|
191
|
+
? Boolean(s.input.closePosition)
|
|
193
192
|
: null,
|
|
194
193
|
};
|
|
195
|
-
txSummary.
|
|
194
|
+
txSummary.input = input;
|
|
196
195
|
}
|
|
197
196
|
// get events for each summary
|
|
198
197
|
for (const event of s.events) {
|
package/dist/types.d.ts
CHANGED
|
@@ -133,8 +133,9 @@ export interface ClendAccountTxSummary {
|
|
|
133
133
|
clendAccount: web3.PublicKey;
|
|
134
134
|
clendAccountAuthority: web3.PublicKey;
|
|
135
135
|
clendGroup: web3.PublicKey;
|
|
136
|
-
|
|
136
|
+
action: string;
|
|
137
137
|
events: ClendAccountEvent[];
|
|
138
|
+
input?: UserRequest;
|
|
138
139
|
}
|
|
139
140
|
export interface ClendAccountEvent {
|
|
140
141
|
eventIndex: number;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -190,30 +190,29 @@ export class Client {
|
|
|
190
190
|
clendAccount: new web3.PublicKey(s.clendAccount),
|
|
191
191
|
clendAccountAuthority: new web3.PublicKey(s.clendAccountAuthority),
|
|
192
192
|
clendGroup: new web3.PublicKey(s.clendGroup),
|
|
193
|
-
|
|
193
|
+
action: s.action,
|
|
194
|
+
input: undefined,
|
|
194
195
|
events: [],
|
|
195
196
|
};
|
|
196
197
|
|
|
197
198
|
// parse inputs if they exist
|
|
198
|
-
if (s.
|
|
199
|
-
const
|
|
200
|
-
apiPath: s.
|
|
201
|
-
selectedTokenMint: s.
|
|
202
|
-
? new web3.PublicKey(s.
|
|
199
|
+
if (s.input) {
|
|
200
|
+
const input: UserRequest = {
|
|
201
|
+
apiPath: s.input.apiPath,
|
|
202
|
+
selectedTokenMint: s.input.selectedTokenMint
|
|
203
|
+
? new web3.PublicKey(s.input.selectedTokenMint)
|
|
203
204
|
: null,
|
|
204
|
-
amountUi: s.
|
|
205
|
-
leverage: s.
|
|
206
|
-
slippageBps: s.
|
|
207
|
-
|
|
205
|
+
amountUi: s.input.amountUi ? Number(s.input.amountUi) : null,
|
|
206
|
+
leverage: s.input.leverage ? Number(s.input.leverage) : null,
|
|
207
|
+
slippageBps: s.input.slippageBps ? Number(s.input.slippageBps) : null,
|
|
208
|
+
openPosition: s.input.openPosition
|
|
209
|
+
? Boolean(s.input.openPosition)
|
|
208
210
|
: null,
|
|
209
|
-
|
|
210
|
-
? Boolean(s.
|
|
211
|
-
: null,
|
|
212
|
-
closePosition: s.inputs.closePosition
|
|
213
|
-
? Boolean(s.inputs.closePosition)
|
|
211
|
+
closePosition: s.input.closePosition
|
|
212
|
+
? Boolean(s.input.closePosition)
|
|
214
213
|
: null,
|
|
215
214
|
};
|
|
216
|
-
txSummary.
|
|
215
|
+
txSummary.input = input;
|
|
217
216
|
}
|
|
218
217
|
|
|
219
218
|
// get events for each summary
|
package/src/types.ts
CHANGED
|
@@ -150,8 +150,9 @@ export interface ClendAccountTxSummary {
|
|
|
150
150
|
clendAccount: web3.PublicKey;
|
|
151
151
|
clendAccountAuthority: web3.PublicKey;
|
|
152
152
|
clendGroup: web3.PublicKey;
|
|
153
|
-
|
|
153
|
+
action: string;
|
|
154
154
|
events: ClendAccountEvent[];
|
|
155
|
+
input?: UserRequest;
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
export interface ClendAccountEvent {
|