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