@fogo/sessions-sdk 0.0.14 → 0.0.16

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/adapter.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Transaction, IInstruction } from "@solana/kit";
1
+ import type { Transaction, Instruction, TransactionWithLifetime } from "@solana/kit";
2
2
  import type { Connection, TransactionError } from "@solana/web3.js";
3
3
  import { PublicKey, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
4
4
  export type SessionAdapter = {
@@ -6,7 +6,7 @@ export type SessionAdapter = {
6
6
  connection: Connection;
7
7
  payer: PublicKey;
8
8
  domain: string;
9
- sendTransaction: (sessionKey: CryptoKeyPair | undefined, instructions: (TransactionInstruction | IInstruction)[] | VersionedTransaction | Transaction) => Promise<TransactionResult>;
9
+ sendTransaction: (sessionKey: CryptoKeyPair | undefined, instructions: (TransactionInstruction | Instruction)[] | VersionedTransaction | (Transaction & TransactionWithLifetime)) => Promise<TransactionResult>;
10
10
  };
11
11
  export declare enum TransactionResultType {
12
12
  Success = 0,
package/cjs/adapter.js CHANGED
@@ -60,7 +60,7 @@ const buildTransaction = async (latestBlockhash, sessionKey, sponsor, instructio
60
60
  }
61
61
  else {
62
62
  const tx = instructions instanceof web3_js_1.VersionedTransaction
63
- ? (0, compat_1.fromVersionedTransaction)(instructions)
63
+ ? (0, compat_1.fromVersionedTransaction)(instructions) // VersionedTransaction has a lifetime so it's fine to cast it so we can call partiallySignTransaction
64
64
  : instructions;
65
65
  return sessionKey === undefined
66
66
  ? tx
package/cjs/index.js CHANGED
@@ -358,7 +358,7 @@ const buildIntentInstruction = async (options, sessionKey, tokens) => {
358
358
  tokens,
359
359
  extra: options.extra,
360
360
  });
361
- const intentSignature = await options.signMessage(message);
361
+ const intentSignature = (0, kit_1.signatureBytes)(await options.signMessage(message));
362
362
  return web3_js_1.Ed25519Program.createInstructionWithPublicKey({
363
363
  publicKey: options.walletPublicKey.toBytes(),
364
364
  signature: intentSignature,
@@ -519,7 +519,7 @@ const buildTransferIntentInstruction = async (program, options, symbol) => {
519
519
  nonce: nonce === null ? "1" : nonce.nonce.add(new bn_js_1.default(1)).toString(),
520
520
  }),
521
521
  ].join("\n"));
522
- const intentSignature = await options.signMessage(message);
522
+ const intentSignature = (0, kit_1.signatureBytes)(await options.signMessage(message));
523
523
  return web3_js_1.Ed25519Program.createInstructionWithPublicKey({
524
524
  publicKey: options.walletPublicKey.toBytes(),
525
525
  signature: intentSignature,
package/esm/adapter.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Transaction, IInstruction } from "@solana/kit";
1
+ import type { Transaction, Instruction, TransactionWithLifetime } from "@solana/kit";
2
2
  import type { Connection, TransactionError } from "@solana/web3.js";
3
3
  import { PublicKey, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
4
4
  export type SessionAdapter = {
@@ -6,7 +6,7 @@ export type SessionAdapter = {
6
6
  connection: Connection;
7
7
  payer: PublicKey;
8
8
  domain: string;
9
- sendTransaction: (sessionKey: CryptoKeyPair | undefined, instructions: (TransactionInstruction | IInstruction)[] | VersionedTransaction | Transaction) => Promise<TransactionResult>;
9
+ sendTransaction: (sessionKey: CryptoKeyPair | undefined, instructions: (TransactionInstruction | Instruction)[] | VersionedTransaction | (Transaction & TransactionWithLifetime)) => Promise<TransactionResult>;
10
10
  };
11
11
  export declare enum TransactionResultType {
12
12
  Success = 0,
package/esm/adapter.js CHANGED
@@ -56,7 +56,7 @@ const buildTransaction = async (latestBlockhash, sessionKey, sponsor, instructio
56
56
  }
57
57
  else {
58
58
  const tx = instructions instanceof VersionedTransaction
59
- ? fromVersionedTransaction(instructions)
59
+ ? fromVersionedTransaction(instructions) // VersionedTransaction has a lifetime so it's fine to cast it so we can call partiallySignTransaction
60
60
  : instructions;
61
61
  return sessionKey === undefined
62
62
  ? tx
package/esm/index.js CHANGED
@@ -5,7 +5,7 @@ import { publicKey as metaplexPublicKey } from "@metaplex-foundation/umi";
5
5
  import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
6
6
  import { sha256 } from "@noble/hashes/sha2";
7
7
  import { fromLegacyPublicKey } from "@solana/compat";
8
- import { generateKeyPair, getAddressFromPublicKey, getProgramDerivedAddress, verifySignature, } from "@solana/kit";
8
+ import { generateKeyPair, getAddressFromPublicKey, getProgramDerivedAddress, signatureBytes, verifySignature, } from "@solana/kit";
9
9
  import { createAssociatedTokenAccountIdempotentInstruction, getAssociatedTokenAddressSync, getMint, } from "@solana/spl-token";
10
10
  import { Ed25519Program, PublicKey } from "@solana/web3.js";
11
11
  import BN from "bn.js";
@@ -345,7 +345,7 @@ const buildIntentInstruction = async (options, sessionKey, tokens) => {
345
345
  tokens,
346
346
  extra: options.extra,
347
347
  });
348
- const intentSignature = await options.signMessage(message);
348
+ const intentSignature = signatureBytes(await options.signMessage(message));
349
349
  return Ed25519Program.createInstructionWithPublicKey({
350
350
  publicKey: options.walletPublicKey.toBytes(),
351
351
  signature: intentSignature,
@@ -504,7 +504,7 @@ const buildTransferIntentInstruction = async (program, options, symbol) => {
504
504
  nonce: nonce === null ? "1" : nonce.nonce.add(new BN(1)).toString(),
505
505
  }),
506
506
  ].join("\n"));
507
- const intentSignature = await options.signMessage(message);
507
+ const intentSignature = signatureBytes(await options.signMessage(message));
508
508
  return Ed25519Program.createInstructionWithPublicKey({
509
509
  publicKey: options.walletPublicKey.toBytes(),
510
510
  signature: intentSignature,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fogo/sessions-sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "A set of utilities for integrating with Fogo sessions",
5
5
  "keywords": [
6
6
  "fogo",
@@ -32,13 +32,13 @@
32
32
  "@metaplex-foundation/umi": "^1.2.0",
33
33
  "@metaplex-foundation/umi-bundle-defaults": "^1.2.0",
34
34
  "@noble/hashes": "^1.8.0",
35
- "@solana/compat": "^2.1.1",
36
- "@solana/kit": "^2.1.1",
35
+ "@solana/compat": "^4.0.0",
36
+ "@solana/kit": "^4.0.0",
37
37
  "@solana/spl-token": "^0.4.13",
38
38
  "@solana/web3.js": "^1.92.3",
39
39
  "bn.js": "^5.1.2",
40
40
  "bs58": "^6.0.0",
41
41
  "zod": "^3.25.62",
42
- "@fogo/sessions-idls": "^0.0.5"
42
+ "@fogo/sessions-idls": "^0.0.6"
43
43
  }
44
44
  }