@huma-finance/widgets 0.0.74 → 0.0.75-beta.975

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 CHANGED
@@ -178129,16 +178129,16 @@ function SolanaTxSendModal({
178129
178129
  };
178130
178130
  useEffect(() => {
178131
178131
  async function Qr() {
178132
- var qr, Hr, Jr;
178132
+ var qr, Hr;
178133
178133
  if (!(!hr || !or || !lr || !dr))
178134
178134
  try {
178135
- const zr = new Transaction$3();
178136
- zr.instructions = [...or.instructions];
178137
- const Vr = await hr.getLatestBlockhash("confirmed");
178138
- zr.recentBlockhash = Vr.blockhash, zr.lastValidBlockHeight = Vr.lastValidBlockHeight, zr.feePayer = lr;
178139
- const Yr = extractWritableAccounts(zr), Dr = await buildOptimalTransactionFromConnection(
178140
- zr,
178141
- Yr,
178135
+ const Jr = new Transaction$3();
178136
+ Jr.instructions = [...or.instructions];
178137
+ const zr = await hr.getLatestBlockhash("confirmed");
178138
+ Jr.recentBlockhash = zr.blockhash, Jr.lastValidBlockHeight = zr.lastValidBlockHeight, Jr.feePayer = lr;
178139
+ const Vr = extractWritableAccounts(Jr), Yr = await buildOptimalTransactionFromConnection(
178140
+ Jr,
178141
+ Vr,
178142
178142
  hr,
178143
178143
  ar,
178144
178144
  lr,
@@ -178146,29 +178146,29 @@ function SolanaTxSendModal({
178146
178146
  process$1.env.REACT_APP_HELIUS_API_KEY
178147
178147
  );
178148
178148
  Cr.logAction("SigningTransaction", {
178149
- priceData: Dr.instructions[0].data,
178150
- unitsData: Dr.instructions[1].data,
178151
- recentBlockhash: Dr.recentBlockhash,
178152
- lastValidBlockHeight: Dr.lastValidBlockHeight
178149
+ priceData: Yr.instructions[0].data,
178150
+ unitsData: Yr.instructions[1].data,
178151
+ recentBlockhash: Yr.recentBlockhash,
178152
+ lastValidBlockHeight: Yr.lastValidBlockHeight
178153
178153
  });
178154
- const br = await dr(Dr);
178154
+ const Dr = await dr(Yr);
178155
178155
  Cr.logAction("SendingTransaction", {});
178156
- const wr = await hr.sendRawTransaction(
178157
- br.serialize(),
178156
+ const br = await hr.sendRawTransaction(
178157
+ Dr.serialize(),
178158
178158
  {
178159
178159
  preflightCommitment: "confirmed",
178160
178160
  skipPreflight: !0,
178161
178161
  maxRetries: 0
178162
178162
  }
178163
178163
  );
178164
- for (gr(wr), fr(setSolanaSignature(wr)); ; ) {
178165
- const Er = await hr.getSignatureStatus(wr, {
178164
+ for (gr(br), fr(setSolanaSignature(br)); ; ) {
178165
+ const wr = await hr.getSignatureStatus(br, {
178166
178166
  searchTransactionHistory: !0
178167
178167
  });
178168
- if (((qr = Er == null ? void 0 : Er.value) == null ? void 0 : qr.confirmationStatus) === "finalized" || ((Hr = Er == null ? void 0 : Er.value) == null ? void 0 : Hr.confirmationStatus) === "confirmed") {
178169
- if ((Jr = Er == null ? void 0 : Er.value) != null && Jr.err) {
178168
+ if (((qr = wr == null ? void 0 : wr.value) == null ? void 0 : qr.confirmationStatus) === "finalized") {
178169
+ if ((Hr = wr == null ? void 0 : wr.value) != null && Hr.err) {
178170
178170
  Cr.logAction("TransactionError", {
178171
- signature: wr
178171
+ signature: br
178172
178172
  }), fr(
178173
178173
  setError({
178174
178174
  errorMessage: "Your transaction was confirmed but had errors. Please check the transaction details on the explorer for more information."
@@ -178177,24 +178177,24 @@ function SolanaTxSendModal({
178177
178177
  return;
178178
178178
  }
178179
178179
  Cr.logAction("TransactionSuccess", {
178180
- signature: wr
178181
- }), ur({ signature: wr });
178180
+ signature: br
178181
+ }), ur({ signature: br });
178182
178182
  return;
178183
178183
  }
178184
178184
  if ((await hr.getLatestBlockhash(
178185
178185
  "confirmed"
178186
- )).lastValidBlockHeight - Dr.lastValidBlockHeight > 100) {
178186
+ )).lastValidBlockHeight - Yr.lastValidBlockHeight > 100) {
178187
178187
  Cr.logAction("ShowRetryScreenDueToExpiration", {
178188
- signature: wr
178188
+ signature: br
178189
178189
  }), Sr(!0);
178190
178190
  return;
178191
178191
  }
178192
178192
  await sleep$4(1e3);
178193
178193
  }
178194
- } catch (zr) {
178195
- console.log(zr);
178196
- const Vr = zr;
178197
- Cr.logAction("UnknownError", { error: Vr == null ? void 0 : Vr.message }), Cr.logError(Vr), fr(setError({ errorMessage: (Vr == null ? void 0 : Vr.message) || "" }));
178194
+ } catch (Jr) {
178195
+ console.log(Jr);
178196
+ const zr = Jr;
178197
+ Cr.logAction("UnknownError", { error: zr == null ? void 0 : zr.message }), Cr.logError(zr), fr(setError({ errorMessage: (zr == null ? void 0 : zr.message) || "" }));
178198
178198
  }
178199
178199
  }
178200
178200
  Qr();
@@ -178213,7 +178213,7 @@ function SolanaTxSendModal({
178213
178213
  ]);
178214
178214
  const Ur = useCallback(
178215
178215
  (Qr) => {
178216
- console.log("handleRetry"), xr(Qr), Sr(!1), Pr();
178216
+ xr(Qr), Sr(!1), Pr();
178217
178217
  },
178218
178218
  [Pr]
178219
178219
  );
@@ -182620,8 +182620,8 @@ function SolanaLendSupply({
182620
182620
  seniorLenderApproved: pr,
182621
182621
  juniorLenderApproved: hr,
182622
182622
  loading: Ar
182623
- } = useLenderAccounts(ar.chainId, ar.poolName), [gr, yr] = useTokenAccount(ar), { step: Sr, errorMessage: Ir } = useAppSelector(selectWidgetState), xr = useAppSelector(selectWidgetLoggingContext), [Cr, Br] = useState(), Pr = () => {
182624
- xr.logAction("ExitFlow", {}), cr();
182623
+ } = useLenderAccounts(ar.chainId, ar.poolName), [gr, yr] = useTokenAccount(ar), { step: Sr, errorMessage: Ir } = useAppSelector(selectWidgetState), xr = useAppSelector(selectWidgetLoggingContext), [Cr, Br] = useState(), Pr = (Mr) => {
182624
+ xr.logAction("ExitFlow", {}), cr(Mr);
182625
182625
  };
182626
182626
  return useEffect(() => {
182627
182627
  if (!Sr && !Ar && !yr) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huma-finance/widgets",
3
- "version": "0.0.74",
3
+ "version": "0.0.75-beta.975+e06a575",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,9 +22,9 @@
22
22
  "@ethersproject/contracts": "^5.7.0",
23
23
  "@ethersproject/experimental": "^5.7.0",
24
24
  "@ethersproject/units": "^5.6.0",
25
- "@huma-finance/sdk": "^0.0.74",
26
- "@huma-finance/shared": "^0.0.74",
27
- "@huma-finance/web-shared": "^0.0.74",
25
+ "@huma-finance/sdk": "^0.0.75-beta.975+e06a575",
26
+ "@huma-finance/shared": "^0.0.75-beta.975+e06a575",
27
+ "@huma-finance/web-shared": "^0.0.75-beta.975+e06a575",
28
28
  "@mui/x-date-pickers": "^5.0.7",
29
29
  "@notifi-network/notifi-frontend-client": "^1.1.2",
30
30
  "@notifi-network/notifi-react": "^1.1.2",
@@ -190,5 +190,5 @@
190
190
  "optionalDependencies": {
191
191
  "encoding": "^0.1.13"
192
192
  },
193
- "gitHead": "b43a4954cc849265b3c7fe36291c682f0168e8cc"
193
+ "gitHead": "e06a57522f4497bc24cf70c9aafe0b3f88ac6b7b"
194
194
  }
@@ -73,9 +73,9 @@ export function SolanaLendSupply({
73
73
  const loggingHelper = useAppSelector(selectWidgetLoggingContext)
74
74
  const [selectedTranche, setSelectedTranche] = useState<TrancheType>()
75
75
 
76
- const handleCloseFlow = () => {
76
+ const handleCloseFlow = (options?: CloseModalOptions) => {
77
77
  loggingHelper.logAction('ExitFlow', {})
78
- handleClose()
78
+ handleClose(options)
79
79
  }
80
80
 
81
81
  useEffect(() => {
@@ -127,10 +127,7 @@ export function SolanaTxSendModal({
127
127
  const result = await connection.getSignatureStatus(signatureResult, {
128
128
  searchTransactionHistory: true,
129
129
  })
130
- if (
131
- result?.value?.confirmationStatus === 'finalized' ||
132
- result?.value?.confirmationStatus === 'confirmed'
133
- ) {
130
+ if (result?.value?.confirmationStatus === 'finalized') {
134
131
  if (result?.value?.err) {
135
132
  loggingHelper.logAction('TransactionError', {
136
133
  signature: signatureResult,
@@ -196,7 +193,6 @@ export function SolanaTxSendModal({
196
193
 
197
194
  const handleRetry = useCallback(
198
195
  (highPriority: boolean) => {
199
- console.log('handleRetry')
200
196
  setUseHighPriority(highPriority)
201
197
  setShowRetryScreen(false)
202
198
  refresh()