@haven-fi/solauto-sdk 1.0.195 → 1.0.197

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"solautoMarginfiClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoMarginfiClient.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,MAAM,EACN,kBAAkB,EAMnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EACL,kBAAkB,EAElB,aAAa,EAEb,iBAAiB,EACjB,wBAAwB,EACxB,gCAAgC,EAKjC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,eAAe,EAUhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AASnE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IACrC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAED,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,OAAO,CAAC,WAAW,CAAkB;IAE9B,eAAe,EAAG,SAAS,CAAC;IAE5B,sBAAsB,EAAE,MAAM,CAAa;IAC3C,eAAe,EAAG,SAAS,GAAG,MAAM,CAAC;IACrC,iBAAiB,EAAG,SAAS,CAAC;IAC9B,aAAa,EAAG,SAAS,CAAC;IAE1B,sBAAsB,EAAG,qBAAqB,CAAC;IAC/C,oBAAoB,EAAG,qBAAqB,CAAC;IAE7C,iBAAiB,EAAG,SAAS,CAAC;IAC9B,eAAe,EAAG,SAAS,CAAC;IAG5B,iCAAiC,CAAC,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C,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAyBvE,yBAAyB,IAAI,kBAAkB;IAS/C,YAAY,CACV,aAAa,CAAC,EAAE,gCAAgC,EAChD,GAAG,CAAC,EAAE,kBAAkB,GACvB,kBAAkB;IAMrB,OAAO,CAAC,sBAAsB;IA8C9B,OAAO,IAAI,kBAAkB;IAc7B,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB;IAUhE,OAAO,CAAC,6BAA6B;IAmErC,OAAO,CAAC,oCAAoC;IA0D5C,SAAS,CACP,aAAa,EAAE,GAAG,GAAG,GAAG,EACxB,QAAQ,EAAE,aAAa,EACvB,aAAa,EAAE,wBAAwB,EACvC,SAAS,CAAC,EAAE,gBAAgB,EAC5B,2BAA2B,CAAC,EAAE,MAAM,GACnC,kBAAkB;IAgErB,WAAW,CACT,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,SAAS,GACjC,kBAAkB;IA2BrB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,kBAAkB;IAoFlE,iCAAiC,IAAI,kBAAkB;IASjD,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CA4ClE"}
@@ -140,7 +140,6 @@ class SolautoMarginfiClient extends solautoClient_1.SolautoClient {
140
140
  signer: this.signer,
141
141
  marginfiProgram: (0, umi_1.publicKey)(marginfi_sdk_1.MARGINFI_PROGRAM_ID),
142
142
  solautoFeesWallet: (0, umi_1.publicKey)(this.solautoFeesWallet),
143
- solautoFeesSupplyTa: (0, umi_1.publicKey)(this.solautoFeesSupplyTa),
144
143
  signerReferralState: (0, umi_1.publicKey)(this.referralStateManager.referralState),
145
144
  referredByState: this.referredByState
146
145
  ? (0, umi_1.publicKey)(this.referredByState)
@@ -1,5 +1,6 @@
1
1
  import { MarginfiAssetAccounts } from "../types/accounts";
2
2
  export declare const DEFAULT_MARGINFI_GROUP = "4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8";
3
+ export declare const DEFAULT_PUBKEY: string;
3
4
  export declare const MARGINFI_ACCOUNTS: {
4
5
  [key: string]: MarginfiAssetAccounts;
5
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"marginfiAccounts.d.ts","sourceRoot":"","sources":["../../src/constants/marginfiAccounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,sBAAsB,iDAAiD,CAAC;AAGrF,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAA;CA+BrE,CAAC;AAEF,eAAO,MAAM,8BAA8B,iDAAiD,CAAC"}
1
+ {"version":3,"file":"marginfiAccounts.d.ts","sourceRoot":"","sources":["../../src/constants/marginfiAccounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,sBAAsB,iDAAiD,CAAC;AAErF,eAAO,MAAM,cAAc,QAA+B,CAAC;AAC3D,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAA;CA+BrE,CAAC;AAEF,eAAO,MAAM,8BAA8B,iDAAiD,CAAC"}
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MARGINFI_ACCOUNTS_LOOKUP_TABLE = exports.MARGINFI_ACCOUNTS = exports.DEFAULT_MARGINFI_GROUP = void 0;
3
+ exports.MARGINFI_ACCOUNTS_LOOKUP_TABLE = exports.MARGINFI_ACCOUNTS = exports.DEFAULT_PUBKEY = exports.DEFAULT_MARGINFI_GROUP = void 0;
4
4
  const spl_token_1 = require("@solana/spl-token");
5
5
  const tokenConstants_1 = require("./tokenConstants");
6
6
  const web3_js_1 = require("@solana/web3.js");
7
7
  exports.DEFAULT_MARGINFI_GROUP = "4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8";
8
- const DEFAULT_PUBKEY = web3_js_1.PublicKey.default.toString();
8
+ exports.DEFAULT_PUBKEY = web3_js_1.PublicKey.default.toString();
9
9
  exports.MARGINFI_ACCOUNTS = {
10
- [DEFAULT_PUBKEY]: {
11
- bank: DEFAULT_PUBKEY,
12
- liquidityVault: DEFAULT_PUBKEY,
13
- vaultAuthority: DEFAULT_PUBKEY,
14
- priceOracle: DEFAULT_PUBKEY,
10
+ [exports.DEFAULT_PUBKEY]: {
11
+ bank: exports.DEFAULT_PUBKEY,
12
+ liquidityVault: exports.DEFAULT_PUBKEY,
13
+ vaultAuthority: exports.DEFAULT_PUBKEY,
14
+ priceOracle: exports.DEFAULT_PUBKEY,
15
15
  },
16
16
  [spl_token_1.NATIVE_MINT.toString()]: {
17
17
  bank: "CCKtUs6Cgwo4aaQUmBPmyoApH2gUDErxNZCAntD6LYGh",
@@ -16,7 +16,6 @@ export type MarginfiOpenPositionInstructionAccounts = {
16
16
  ataProgram?: PublicKey | Pda;
17
17
  rent?: PublicKey | Pda;
18
18
  solautoFeesWallet: PublicKey | Pda;
19
- solautoFeesSupplyTa: PublicKey | Pda;
20
19
  signerReferralState: PublicKey | Pda;
21
20
  referredByState?: PublicKey | Pda;
22
21
  referredBySupplyTa?: PublicKey | Pda;
@@ -1 +1 @@
1
- {"version":3,"file":"marginfiOpenPosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/marginfiOpenPosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAMX,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EAGvB,MAAM,UAAU,CAA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AAE,gBAAgB,CAAC;IAC/B,YAAY,EAAE,sBAAsB,CAAC;IACrC,sBAAsB,EAAE,gBAAgB,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAC3D,CAAC;AAEF,wBAAgB,gDAAgD,IAAI,UAAU,CAC5E,uCAAuC,EACvC,mCAAmC,CACpC,CAoBA;AAGD,MAAM,MAAM,mCAAmC,GAC7C,uCAAuC,CAAC;AAG1C,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,uCAAuC,GAC5C,mCAAmC,GACpC,kBAAkB,CAsKpB"}
1
+ {"version":3,"file":"marginfiOpenPosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/marginfiOpenPosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAGnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAMX,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EAGvB,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,uCAAuC,GAAG;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IACvB,iBAAiB,EAAE,SAAS,GAAG,GAAG,CAAC;IACnC,mBAAmB,EAAE,SAAS,GAAG,GAAG,CAAC;IACrC,eAAe,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,kBAAkB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61
- solautoFeesSupplyTa: {
62
- index: 7,
63
- isWritable: true,
64
- value: input.solautoFeesSupplyTa ?? null,
65
- },
66
61
  signerReferralState: {
67
- index: 8,
62
+ index: 7,
68
63
  isWritable: false,
69
64
  value: input.signerReferralState ?? null,
70
65
  },
71
66
  referredByState: {
72
- index: 9,
67
+ index: 8,
73
68
  isWritable: false,
74
69
  value: input.referredByState ?? null,
75
70
  },
76
71
  referredBySupplyTa: {
77
- index: 10,
72
+ index: 9,
78
73
  isWritable: true,
79
74
  value: input.referredBySupplyTa ?? null,
80
75
  },
81
76
  solautoPosition: {
82
- index: 11,
77
+ index: 10,
83
78
  isWritable: true,
84
79
  value: input.solautoPosition ?? null,
85
80
  },
86
81
  marginfiGroup: {
87
- index: 12,
82
+ index: 11,
88
83
  isWritable: false,
89
84
  value: input.marginfiGroup ?? null,
90
85
  },
91
86
  marginfiAccount: {
92
- index: 13,
87
+ index: 12,
93
88
  isWritable: true,
94
89
  value: input.marginfiAccount ?? null,
95
90
  },
96
91
  supplyMint: {
97
- index: 14,
92
+ index: 13,
98
93
  isWritable: false,
99
94
  value: input.supplyMint ?? null,
100
95
  },
101
96
  supplyBank: {
102
- index: 15,
97
+ index: 14,
103
98
  isWritable: false,
104
99
  value: input.supplyBank ?? null,
105
100
  },
106
101
  positionSupplyTa: {
107
- index: 16,
102
+ index: 15,
108
103
  isWritable: true,
109
104
  value: input.positionSupplyTa ?? null,
110
105
  },
111
106
  debtMint: {
112
- index: 17,
107
+ index: 16,
113
108
  isWritable: false,
114
109
  value: input.debtMint ?? null,
115
110
  },
116
111
  debtBank: {
117
- index: 18,
112
+ index: 17,
118
113
  isWritable: false,
119
114
  value: input.debtBank ?? null,
120
115
  },
121
116
  positionDebtTa: {
122
- index: 19,
117
+ index: 18,
123
118
  isWritable: true,
124
119
  value: input.positionDebtTa ?? null,
125
120
  },
126
121
  signerDebtTa: {
127
- index: 20,
122
+ index: 19,
128
123
  isWritable: true,
129
124
  value: input.signerDebtTa ?? null,
130
125
  },
@@ -89,7 +89,7 @@ function getSolautoFeesBps(isReferred, targetLiqUtilizationRateBps, positionNetW
89
89
  }
90
90
  let referrer = 0;
91
91
  if (isReferred) {
92
- referrer = Math.floor(feeBps / 4);
92
+ referrer = Math.floor(feeBps / 5);
93
93
  }
94
94
  return {
95
95
  solauto: feeBps - referrer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.195",
3
+ "version": "1.0.197",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -270,7 +270,6 @@ export class SolautoMarginfiClient extends SolautoClient {
270
270
  signer: this.signer,
271
271
  marginfiProgram: publicKey(MARGINFI_PROGRAM_ID),
272
272
  solautoFeesWallet: publicKey(this.solautoFeesWallet),
273
- solautoFeesSupplyTa: publicKey(this.solautoFeesSupplyTa),
274
273
  signerReferralState: publicKey(this.referralStateManager.referralState),
275
274
  referredByState: this.referredByState
276
275
  ? publicKey(this.referredByState)
@@ -5,7 +5,7 @@ import { PublicKey } from "@solana/web3.js";
5
5
 
6
6
  export const DEFAULT_MARGINFI_GROUP = "4qp6Fx6tnZkY5Wropq9wUYgtFxXKwE6viZxFHg3rdAG8";
7
7
 
8
- const DEFAULT_PUBKEY = PublicKey.default.toString();
8
+ export const DEFAULT_PUBKEY = PublicKey.default.toString();
9
9
  export const MARGINFI_ACCOUNTS: { [key: string]: MarginfiAssetAccounts } = {
10
10
  [DEFAULT_PUBKEY]: {
11
11
  bank: DEFAULT_PUBKEY,
@@ -48,7 +48,6 @@ export type MarginfiOpenPositionInstructionAccounts = {
48
48
  ataProgram?: PublicKey | Pda;
49
49
  rent?: PublicKey | Pda;
50
50
  solautoFeesWallet: PublicKey | Pda;
51
- solautoFeesSupplyTa: PublicKey | Pda;
52
51
  signerReferralState: PublicKey | Pda;
53
52
  referredByState?: PublicKey | Pda;
54
53
  referredBySupplyTa?: PublicKey | Pda;
@@ -152,73 +151,68 @@ export function marginfiOpenPosition(
152
151
  isWritable: false as boolean,
153
152
  value: input.solautoFeesWallet ?? null,
154
153
  },
155
- solautoFeesSupplyTa: {
156
- index: 7,
157
- isWritable: true as boolean,
158
- value: input.solautoFeesSupplyTa ?? null,
159
- },
160
154
  signerReferralState: {
161
- index: 8,
155
+ index: 7,
162
156
  isWritable: false as boolean,
163
157
  value: input.signerReferralState ?? null,
164
158
  },
165
159
  referredByState: {
166
- index: 9,
160
+ index: 8,
167
161
  isWritable: false as boolean,
168
162
  value: input.referredByState ?? null,
169
163
  },
170
164
  referredBySupplyTa: {
171
- index: 10,
165
+ index: 9,
172
166
  isWritable: true as boolean,
173
167
  value: input.referredBySupplyTa ?? null,
174
168
  },
175
169
  solautoPosition: {
176
- index: 11,
170
+ index: 10,
177
171
  isWritable: true as boolean,
178
172
  value: input.solautoPosition ?? null,
179
173
  },
180
174
  marginfiGroup: {
181
- index: 12,
175
+ index: 11,
182
176
  isWritable: false as boolean,
183
177
  value: input.marginfiGroup ?? null,
184
178
  },
185
179
  marginfiAccount: {
186
- index: 13,
180
+ index: 12,
187
181
  isWritable: true as boolean,
188
182
  value: input.marginfiAccount ?? null,
189
183
  },
190
184
  supplyMint: {
191
- index: 14,
185
+ index: 13,
192
186
  isWritable: false as boolean,
193
187
  value: input.supplyMint ?? null,
194
188
  },
195
189
  supplyBank: {
196
- index: 15,
190
+ index: 14,
197
191
  isWritable: false as boolean,
198
192
  value: input.supplyBank ?? null,
199
193
  },
200
194
  positionSupplyTa: {
201
- index: 16,
195
+ index: 15,
202
196
  isWritable: true as boolean,
203
197
  value: input.positionSupplyTa ?? null,
204
198
  },
205
199
  debtMint: {
206
- index: 17,
200
+ index: 16,
207
201
  isWritable: false as boolean,
208
202
  value: input.debtMint ?? null,
209
203
  },
210
204
  debtBank: {
211
- index: 18,
205
+ index: 17,
212
206
  isWritable: false as boolean,
213
207
  value: input.debtBank ?? null,
214
208
  },
215
209
  positionDebtTa: {
216
- index: 19,
210
+ index: 18,
217
211
  isWritable: true as boolean,
218
212
  value: input.positionDebtTa ?? null,
219
213
  },
220
214
  signerDebtTa: {
221
- index: 20,
215
+ index: 19,
222
216
  isWritable: true as boolean,
223
217
  value: input.signerDebtTa ?? null,
224
218
  },
@@ -118,7 +118,7 @@ export function getSolautoFeesBps(
118
118
 
119
119
  let referrer = 0;
120
120
  if (isReferred) {
121
- referrer = Math.floor(feeBps / 4);
121
+ referrer = Math.floor(feeBps / 5);
122
122
  }
123
123
 
124
124
  return {
File without changes
@@ -1,6 +1,7 @@
1
1
  import { describe, it } from 'mocha';
2
2
  import { clusterApiUrl, Connection, PublicKey } from "@solana/web3.js";
3
3
  import {
4
+ DEFAULT_PUBKEY,
4
5
  MARGINFI_ACCOUNTS,
5
6
  MARGINFI_ACCOUNTS_LOOKUP_TABLE,
6
7
  } from "../../src/constants/marginfiAccounts";
@@ -20,16 +21,20 @@ describe("Assert lookup tables up-to-date", async () => {
20
21
  lookupTable.value?.state.addresses.map((x) => x.toString()) ?? [];
21
22
 
22
23
  for (const key in MARGINFI_ACCOUNTS) {
24
+ if (key === DEFAULT_PUBKEY) {
25
+ continue;
26
+ }
27
+
23
28
  const tokenAccounts = MARGINFI_ACCOUNTS[key];
24
29
  const addresses = [
25
- tokenAccounts.mint,
30
+ new PublicKey(key),
26
31
  tokenAccounts.bank,
27
32
  tokenAccounts.liquidityVault,
28
33
  tokenAccounts.vaultAuthority,
29
34
  tokenAccounts.priceOracle,
30
35
  ];
31
36
 
32
- if (addresses.find((x) => !existingAccounts.includes(x))) {
37
+ if (addresses.find((x) => !existingAccounts.includes(x.toString()))) {
33
38
  throw new Error("Marginfi accounts lookup table missing an account");
34
39
  }
35
40
  }