@fogo/sessions-sdk 0.1.1 → 0.1.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/cjs/context.d.ts +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +1 -0
- package/cjs/instructions.d.ts +2 -1
- package/esm/connection.js +1 -1
- package/esm/context.d.ts +1 -1
- package/esm/context.js +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +3 -2
- package/esm/instructions.d.ts +2 -1
- package/esm/instructions.js +1 -1
- package/package.json +2 -2
package/cjs/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PublicKey, Connection as Web3Connection } from "@solana/web3.js";
|
|
2
2
|
import type { Connection, SendTransactionOptions as SendTransactionBaseOptions, TransactionOrInstructions } from "./connection.js";
|
|
3
3
|
export declare const SESSIONS_INTERNAL_PAYMASTER_DOMAIN = "sessions";
|
|
4
4
|
export declare const createSessionContext: (options: {
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TransactionError, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
|
|
2
|
-
import {
|
|
1
|
+
import type { Connection, TransactionError, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
|
|
2
|
+
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
import type { Chain } from "@wormhole-foundation/sdk";
|
|
4
4
|
import BN from "bn.js";
|
|
5
5
|
import { z } from "zod";
|
package/cjs/index.js
CHANGED
|
@@ -606,6 +606,7 @@ const sendNativeTransfer = async (options) => {
|
|
|
606
606
|
feeMetadata: options.feeConfig.metadata,
|
|
607
607
|
feeMint: options.feeConfig.mint,
|
|
608
608
|
feeSource: (0, spl_token_1.getAssociatedTokenAddressSync)(options.feeConfig.mint, options.walletPublicKey),
|
|
609
|
+
feeDestination: sessions_idls_1.IntentTransferIdl.address,
|
|
609
610
|
source: options.walletPublicKey,
|
|
610
611
|
destination: options.recipient,
|
|
611
612
|
sponsor: options.context.internalPayer,
|
package/cjs/instructions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PublicKey } from "@solana/web3.js";
|
|
2
|
+
import { TransactionInstruction } from "@solana/web3.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates the system program instruction `SessionWrap`, only available on Fogo, which allows a session key to transfer native token from its user's wallet to its user's wrapped token associated token account.
|
|
4
5
|
* This instruction may be combined with the `CreateAssociatedTokenAccountIdempotent` and `SyncNative` instructions for a session to wrap tokens on behalf of its user.
|
package/esm/connection.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnchorProvider, BN
|
|
1
|
+
import { AnchorProvider, BN } from "@coral-xyz/anchor";
|
|
2
2
|
import { TollboothIdl, TollboothProgram } from "@fogo/sessions-idls";
|
|
3
3
|
import { sha256 } from "@noble/hashes/sha2";
|
|
4
4
|
import { fromLegacyKeypair, fromLegacyPublicKey, fromLegacyTransactionInstruction, fromVersionedTransaction, } from "@solana/compat";
|
package/esm/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PublicKey, Connection as Web3Connection } from "@solana/web3.js";
|
|
2
2
|
import type { Connection, SendTransactionOptions as SendTransactionBaseOptions, TransactionOrInstructions } from "./connection.js";
|
|
3
3
|
export declare const SESSIONS_INTERNAL_PAYMASTER_DOMAIN = "sessions";
|
|
4
4
|
export declare const createSessionContext: (options: {
|
package/esm/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnchorProvider } from "@coral-xyz/anchor";
|
|
2
2
|
import { ChainIdProgram } from "@fogo/sessions-idls";
|
|
3
|
-
import { Keypair
|
|
3
|
+
import { Keypair } from "@solana/web3.js";
|
|
4
4
|
// eslint-disable-next-line unicorn/no-typeof-undefined
|
|
5
5
|
const IS_BROWSER = typeof globalThis.window !== "undefined";
|
|
6
6
|
export const SESSIONS_INTERNAL_PAYMASTER_DOMAIN = "sessions";
|
package/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TransactionError, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
|
|
2
|
-
import {
|
|
1
|
+
import type { Connection, TransactionError, TransactionInstruction, VersionedTransaction } from "@solana/web3.js";
|
|
2
|
+
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
import type { Chain } from "@wormhole-foundation/sdk";
|
|
4
4
|
import BN from "bn.js";
|
|
5
5
|
import { z } from "zod";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnchorProvider, BorshAccountsCoder } from "@coral-xyz/anchor";
|
|
2
|
-
import { DomainRegistryIdl, IntentTransferProgram, SessionManagerIdl, SessionManagerProgram, } from "@fogo/sessions-idls";
|
|
2
|
+
import { DomainRegistryIdl, IntentTransferIdl, IntentTransferProgram, SessionManagerIdl, SessionManagerProgram, } from "@fogo/sessions-idls";
|
|
3
3
|
import { findMetadataPda, safeFetchMetadata, } from "@metaplex-foundation/mpl-token-metadata";
|
|
4
4
|
import { publicKey as metaplexPublicKey } from "@metaplex-foundation/umi";
|
|
5
5
|
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
|
|
@@ -7,7 +7,7 @@ import { sha256 } from "@noble/hashes/sha2";
|
|
|
7
7
|
import { fromLegacyPublicKey } from "@solana/compat";
|
|
8
8
|
import { generateKeyPair, getAddressFromPublicKey, getProgramDerivedAddress, } from "@solana/kit";
|
|
9
9
|
import { getAssociatedTokenAddressSync, getMint } from "@solana/spl-token";
|
|
10
|
-
import { ComputeBudgetProgram,
|
|
10
|
+
import { ComputeBudgetProgram, Ed25519Program, Keypair, PublicKey, } from "@solana/web3.js";
|
|
11
11
|
import { routes, Wormhole, wormhole } from "@wormhole-foundation/sdk";
|
|
12
12
|
import solanaSdk from "@wormhole-foundation/sdk/solana";
|
|
13
13
|
import { contracts } from "@wormhole-foundation/sdk-base";
|
|
@@ -584,6 +584,7 @@ export const sendNativeTransfer = async (options) => {
|
|
|
584
584
|
feeMetadata: options.feeConfig.metadata,
|
|
585
585
|
feeMint: options.feeConfig.mint,
|
|
586
586
|
feeSource: getAssociatedTokenAddressSync(options.feeConfig.mint, options.walletPublicKey),
|
|
587
|
+
feeDestination: IntentTransferIdl.address,
|
|
587
588
|
source: options.walletPublicKey,
|
|
588
589
|
destination: options.recipient,
|
|
589
590
|
sponsor: options.context.internalPayer,
|
package/esm/instructions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PublicKey } from "@solana/web3.js";
|
|
2
|
+
import { TransactionInstruction } from "@solana/web3.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates the system program instruction `SessionWrap`, only available on Fogo, which allows a session key to transfer native token from its user's wallet to its user's wrapped token associated token account.
|
|
4
5
|
* This instruction may be combined with the `CreateAssociatedTokenAccountIdempotent` and `SyncNative` instructions for a session to wrap tokens on behalf of its user.
|
package/esm/instructions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAssociatedTokenAccountIdempotentInstruction, createCloseAccountInstruction, createSyncNativeInstruction, getAssociatedTokenAddressSync, NATIVE_MINT, } from "@solana/spl-token";
|
|
2
|
-
import { SystemProgram, TransactionInstruction
|
|
2
|
+
import { SystemProgram, TransactionInstruction } from "@solana/web3.js";
|
|
3
3
|
const SESSION_WRAP_DISCRIMINATOR = 4_000_000;
|
|
4
4
|
function getNativeMintAssociatedTokenAddressSync(walletPublicKey) {
|
|
5
5
|
return getAssociatedTokenAddressSync(NATIVE_MINT, walletPublicKey);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fogo/sessions-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A set of utilities for integrating with Fogo sessions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"bn.js": "^5.1.2",
|
|
50
50
|
"bs58": "^6.0.0",
|
|
51
51
|
"zod": "3.25.67",
|
|
52
|
-
"@fogo/sessions-idls": "^0.1.
|
|
52
|
+
"@fogo/sessions-idls": "^0.1.2"
|
|
53
53
|
}
|
|
54
54
|
}
|