@fogo/sessions-sdk 0.0.22 → 0.0.23

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/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BaseWalletAdapter, MessageSignerWalletAdapterProps } from "@solana/wallet-adapter-base";
1
+ import type { BaseSignerWalletAdapter, MessageSignerWalletAdapterProps } from "@solana/wallet-adapter-base";
2
2
  import type { TransactionError } from "@solana/web3.js";
3
3
  import { Connection, PublicKey } from "@solana/web3.js";
4
4
  import type { Chain } from "@wormhole-foundation/sdk";
@@ -1359,7 +1359,7 @@ export declare const bridgeOut: (options: SendBridgeOutOptions) => Promise<Trans
1359
1359
  type SendBridgeInOptions = {
1360
1360
  context: SessionContext;
1361
1361
  walletPublicKey: PublicKey;
1362
- solanaWallet: BaseWalletAdapter;
1362
+ solanaWallet: BaseSignerWalletAdapter;
1363
1363
  amount: bigint;
1364
1364
  fromToken: WormholeToken & {
1365
1365
  chain: "Solana";
package/cjs/index.js CHANGED
@@ -602,7 +602,7 @@ const buildTransferIntentInstruction = async (program, options, symbol, feeToken
602
602
  const BRIDGE_OUT_MESSAGE_HEADER = `Fogo Bridge Transfer:
603
603
  Signing this intent will bridge out the tokens as described below.
604
604
  `;
605
- const BRIDGE_OUT_CUS = 220_000;
605
+ const BRIDGE_OUT_CUS = 240_000;
606
606
  const bridgeOut = async (options) => {
607
607
  const { wh, route, transferRequest, transferParams, decimals } = await buildWormholeTransfer(options, options.context.connection);
608
608
  // @ts-expect-error the wormhole client types are incorrect and do not
@@ -730,12 +730,17 @@ const bridgeIn = async (options) => {
730
730
  return await sdk_1.routes.checkAndCompleteTransfer(route, await route.initiate(transferRequest, {
731
731
  address: () => options.walletPublicKey.toBase58(),
732
732
  chain: () => "Solana",
733
- signAndSend: (transactions) => Promise.all(transactions.map(({ transaction }) => options.solanaWallet.sendTransaction(
734
- // Hooray for Wormhole's incomplete typing eh?
735
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
736
- transaction.transaction, solanaConnection,
737
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
738
- { signers: transaction.signers }))),
733
+ sign: (transactions) => Promise.all(transactions.map(async ({ transaction }) => {
734
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
735
+ const signedTx = await options.solanaWallet.signTransaction(
736
+ // Hooray for Wormhole's incomplete typing eh?
737
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
738
+ transaction.transaction);
739
+ // Hooray for Wormhole's incomplete typing eh?
740
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
741
+ signedTx.sign(transaction.signers);
742
+ return signedTx.serialize();
743
+ })),
739
744
  }, quote, sdk_1.Wormhole.chainAddress("Fogo", options.walletPublicKey.toBase58())));
740
745
  }
741
746
  else {
package/esm/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BaseWalletAdapter, MessageSignerWalletAdapterProps } from "@solana/wallet-adapter-base";
1
+ import type { BaseSignerWalletAdapter, MessageSignerWalletAdapterProps } from "@solana/wallet-adapter-base";
2
2
  import type { TransactionError } from "@solana/web3.js";
3
3
  import { Connection, PublicKey } from "@solana/web3.js";
4
4
  import type { Chain } from "@wormhole-foundation/sdk";
@@ -1359,7 +1359,7 @@ export declare const bridgeOut: (options: SendBridgeOutOptions) => Promise<Trans
1359
1359
  type SendBridgeInOptions = {
1360
1360
  context: SessionContext;
1361
1361
  walletPublicKey: PublicKey;
1362
- solanaWallet: BaseWalletAdapter;
1362
+ solanaWallet: BaseSignerWalletAdapter;
1363
1363
  amount: bigint;
1364
1364
  fromToken: WormholeToken & {
1365
1365
  chain: "Solana";
package/esm/index.js CHANGED
@@ -583,7 +583,7 @@ const buildTransferIntentInstruction = async (program, options, symbol, feeToken
583
583
  const BRIDGE_OUT_MESSAGE_HEADER = `Fogo Bridge Transfer:
584
584
  Signing this intent will bridge out the tokens as described below.
585
585
  `;
586
- const BRIDGE_OUT_CUS = 220_000;
586
+ const BRIDGE_OUT_CUS = 240_000;
587
587
  export const bridgeOut = async (options) => {
588
588
  const { wh, route, transferRequest, transferParams, decimals } = await buildWormholeTransfer(options, options.context.connection);
589
589
  // @ts-expect-error the wormhole client types are incorrect and do not
@@ -710,12 +710,17 @@ export const bridgeIn = async (options) => {
710
710
  return await routes.checkAndCompleteTransfer(route, await route.initiate(transferRequest, {
711
711
  address: () => options.walletPublicKey.toBase58(),
712
712
  chain: () => "Solana",
713
- signAndSend: (transactions) => Promise.all(transactions.map(({ transaction }) => options.solanaWallet.sendTransaction(
714
- // Hooray for Wormhole's incomplete typing eh?
715
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
716
- transaction.transaction, solanaConnection,
717
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
718
- { signers: transaction.signers }))),
713
+ sign: (transactions) => Promise.all(transactions.map(async ({ transaction }) => {
714
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
715
+ const signedTx = await options.solanaWallet.signTransaction(
716
+ // Hooray for Wormhole's incomplete typing eh?
717
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
718
+ transaction.transaction);
719
+ // Hooray for Wormhole's incomplete typing eh?
720
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
721
+ signedTx.sign(transaction.signers);
722
+ return signedTx.serialize();
723
+ })),
719
724
  }, quote, Wormhole.chainAddress("Fogo", options.walletPublicKey.toBase58())));
720
725
  }
721
726
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fogo/sessions-sdk",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "A set of utilities for integrating with Fogo sessions",
5
5
  "keywords": [
6
6
  "fogo",