@lavarage/sdk 6.0.2 → 6.0.3

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.mjs CHANGED
@@ -1,4 +1,22 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2
20
  var __export = (target, all) => {
3
21
  for (var name in all)
4
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -2990,6 +3008,20 @@ var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken
2990
3008
  const tx = new VersionedTransaction(messageV0);
2991
3009
  return tx;
2992
3010
  });
3011
+ var getDelegateAccounts = (lavarageProgram, userPubKey) => __async(void 0, null, function* () {
3012
+ const delegateAccounts = yield lavarageProgram.account.delegate.all(userPubKey ? [{
3013
+ memcmp: {
3014
+ offset: 104,
3015
+ bytes: userPubKey.toBase58()
3016
+ }
3017
+ }] : void 0);
3018
+ return delegateAccounts.map((d) => __spreadProps(__spreadValues({}, d), {
3019
+ parsed: {
3020
+ tpPrice: new BN(d.account.field1),
3021
+ tpThreshold: new BN(d.account.field2)
3022
+ }
3023
+ }));
3024
+ });
2993
3025
  export {
2994
3026
  IDL,
2995
3027
  lavaragev2_exports as IDLV2,
@@ -2998,6 +3030,7 @@ export {
2998
3030
  createTpDelegate,
2999
3031
  getAllPositions,
3000
3032
  getClosedPositions,
3033
+ getDelegateAccounts,
3001
3034
  getLiquidatedPositions,
3002
3035
  getOffers,
3003
3036
  getOpenPositions,