@fogo/sessions-sdk 0.0.18 → 0.0.19
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/connection.d.ts +10 -20
- package/cjs/connection.js +67 -41
- package/cjs/context.d.ts +4 -2
- package/cjs/context.js +7 -2
- package/cjs/index.d.ts +39 -2
- package/cjs/index.js +225 -8
- package/esm/connection.d.ts +10 -20
- package/esm/connection.js +65 -39
- package/esm/context.d.ts +4 -2
- package/esm/context.js +7 -2
- package/esm/index.d.ts +39 -2
- package/esm/index.js +224 -9
- package/package.json +7 -2
package/cjs/connection.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import type { Transaction, Instruction, TransactionWithLifetime } from "@solana/kit";
|
|
2
|
-
import type {
|
|
3
|
-
import { Connection as Web3Connection, TransactionInstruction, VersionedTransaction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
import type { TransactionError } from "@solana/web3.js";
|
|
3
|
+
import { Keypair, Connection as Web3Connection, TransactionInstruction, VersionedTransaction, PublicKey } from "@solana/web3.js";
|
|
4
4
|
export declare enum Network {
|
|
5
5
|
Testnet = 0,
|
|
6
6
|
Mainnet = 1
|
|
7
7
|
}
|
|
8
|
-
export declare const DEFAULT_RPC: {
|
|
9
|
-
0: string;
|
|
10
|
-
1: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const DEFAULT_PAYMASTER: {
|
|
13
|
-
0: string;
|
|
14
|
-
1: string;
|
|
15
|
-
};
|
|
16
8
|
export declare enum TransactionResultType {
|
|
17
9
|
Success = 0,
|
|
18
10
|
Failed = 1
|
|
@@ -32,26 +24,24 @@ export type TransactionResult = ReturnType<(typeof TransactionResult)[keyof type
|
|
|
32
24
|
export declare const createSessionConnection: (options: {
|
|
33
25
|
network: Network;
|
|
34
26
|
rpc?: string | URL | undefined;
|
|
35
|
-
paymaster?: undefined;
|
|
36
|
-
sendToPaymaster?: undefined;
|
|
37
|
-
sponsor?: undefined;
|
|
38
|
-
} | ({
|
|
39
|
-
network?: Network | undefined;
|
|
40
|
-
rpc: string | URL;
|
|
41
27
|
} & ({
|
|
42
|
-
paymaster
|
|
28
|
+
paymaster?: string | URL | undefined;
|
|
43
29
|
sendToPaymaster?: undefined;
|
|
44
30
|
sponsor?: undefined;
|
|
45
31
|
} | {
|
|
46
32
|
paymaster?: undefined;
|
|
47
33
|
sendToPaymaster: (transaction: Transaction) => Promise<TransactionResult>;
|
|
48
34
|
sponsor: PublicKey;
|
|
49
|
-
}))
|
|
35
|
+
})) => {
|
|
50
36
|
rpc: import("@solana/kit").Rpc<import("@solana/kit").RequestAirdropApi & import("@solana/kit").GetAccountInfoApi & import("@solana/kit").GetBalanceApi & import("@solana/kit").GetBlockApi & import("@solana/kit").GetBlockCommitmentApi & import("@solana/kit").GetBlockHeightApi & import("@solana/kit").GetBlockProductionApi & import("@solana/kit").GetBlocksApi & import("@solana/kit").GetBlocksWithLimitApi & import("@solana/kit").GetBlockTimeApi & import("@solana/kit").GetClusterNodesApi & import("@solana/kit").GetEpochInfoApi & import("@solana/kit").GetEpochScheduleApi & import("@solana/kit").GetFeeForMessageApi & import("@solana/kit").GetFirstAvailableBlockApi & import("@solana/kit").GetGenesisHashApi & import("@solana/kit").GetHealthApi & import("@solana/kit").GetHighestSnapshotSlotApi & import("@solana/kit").GetIdentityApi & import("@solana/kit").GetInflationGovernorApi & import("@solana/kit").GetInflationRateApi & import("@solana/kit").GetInflationRewardApi & import("@solana/kit").GetLargestAccountsApi & import("@solana/kit").GetLatestBlockhashApi & import("@solana/kit").GetLeaderScheduleApi & import("@solana/kit").GetMaxRetransmitSlotApi & import("@solana/kit").GetMaxShredInsertSlotApi & import("@solana/kit").GetMinimumBalanceForRentExemptionApi & import("@solana/kit").GetMultipleAccountsApi & import("@solana/kit").GetProgramAccountsApi & import("@solana/kit").GetRecentPerformanceSamplesApi & import("@solana/kit").GetRecentPrioritizationFeesApi & import("@solana/kit").GetSignaturesForAddressApi & import("@solana/kit").GetSignatureStatusesApi & import("@solana/kit").GetSlotApi & import("@solana/kit").GetSlotLeaderApi & import("@solana/kit").GetSlotLeadersApi & import("@solana/kit").GetStakeMinimumDelegationApi & import("@solana/kit").GetSupplyApi & import("@solana/kit").GetTokenAccountBalanceApi & import("@solana/kit").GetTokenAccountsByDelegateApi & import("@solana/kit").GetTokenAccountsByOwnerApi & import("@solana/kit").GetTokenLargestAccountsApi & import("@solana/kit").GetTokenSupplyApi & import("@solana/kit").GetTransactionApi & import("@solana/kit").GetTransactionCountApi & import("@solana/kit").GetVersionApi & import("@solana/kit").GetVoteAccountsApi & import("@solana/kit").IsBlockhashValidApi & import("@solana/kit").MinimumLedgerSlotApi & import("@solana/kit").SendTransactionApi & import("@solana/kit").SimulateTransactionApi>;
|
|
51
37
|
connection: Web3Connection;
|
|
52
|
-
|
|
38
|
+
network: Network;
|
|
39
|
+
getSolanaConnection: () => Promise<Web3Connection>;
|
|
40
|
+
sendToPaymaster: (domain: string, sponsor: PublicKey, sessionKey: CryptoKeyPair | undefined, instructions: (TransactionInstruction | Instruction)[] | VersionedTransaction | (Transaction & TransactionWithLifetime), extraConfig?: {
|
|
41
|
+
addressLookupTable?: string | undefined;
|
|
42
|
+
extraSigners?: (CryptoKeyPair | Keypair)[] | undefined;
|
|
43
|
+
}) => Promise<TransactionResult>;
|
|
53
44
|
getSponsor: (domain: string) => Promise<PublicKey>;
|
|
54
|
-
getAddressLookupTables: (addressLookupTableAddress?: string) => Promise<AddressLookupTableAccount[] | undefined>;
|
|
55
45
|
};
|
|
56
46
|
export type Connection = ReturnType<typeof createSessionConnection>;
|
|
57
47
|
export {};
|
package/cjs/connection.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSessionConnection = exports.TransactionResultType = exports.
|
|
3
|
+
exports.createSessionConnection = exports.TransactionResultType = exports.Network = void 0;
|
|
4
4
|
const compat_1 = require("@solana/compat");
|
|
5
5
|
const kit_1 = require("@solana/kit");
|
|
6
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
@@ -10,18 +10,14 @@ var Network;
|
|
|
10
10
|
Network[Network["Testnet"] = 0] = "Testnet";
|
|
11
11
|
Network[Network["Mainnet"] = 1] = "Mainnet";
|
|
12
12
|
})(Network || (exports.Network = Network = {}));
|
|
13
|
-
|
|
13
|
+
const DEFAULT_RPC = {
|
|
14
14
|
[Network.Testnet]: "https://testnet.fogo.io",
|
|
15
15
|
[Network.Mainnet]: "https://mainnet.fogo.io",
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
const DEFAULT_PAYMASTER = {
|
|
18
18
|
[Network.Testnet]: "https://paymaster.fogo.io",
|
|
19
19
|
[Network.Mainnet]: "https://paymaster.dourolabs.app",
|
|
20
20
|
};
|
|
21
|
-
const DEFAULT_ADDRESS_LOOKUP_TABLE_ADDRESS = {
|
|
22
|
-
[Network.Testnet]: "B8cUjJMqaWWTNNSTXBmeptjWswwCH1gTSCRYv4nu7kJW",
|
|
23
|
-
[Network.Mainnet]: undefined,
|
|
24
|
-
};
|
|
25
21
|
var TransactionResultType;
|
|
26
22
|
(function (TransactionResultType) {
|
|
27
23
|
TransactionResultType[TransactionResultType["Success"] = 0] = "Success";
|
|
@@ -39,30 +35,49 @@ const TransactionResult = {
|
|
|
39
35
|
}),
|
|
40
36
|
};
|
|
41
37
|
const createSessionConnection = (options) => {
|
|
42
|
-
|
|
43
|
-
// obvious that `rpc` can only be `undefined` if `network` is defined. I
|
|
44
|
-
// don't like the non-null assertion, but here we can guarantee it's safe (and
|
|
45
|
-
// typescript really should be able to narrow this...)
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
47
|
-
const rpcUrl = (options.rpc ?? exports.DEFAULT_RPC[options.network]).toString();
|
|
38
|
+
const rpcUrl = (options.rpc ?? DEFAULT_RPC[options.network]).toString();
|
|
48
39
|
const rpc = (0, kit_1.createSolanaRpc)(rpcUrl);
|
|
49
40
|
const connection = new web3_js_1.Connection(rpcUrl, "confirmed");
|
|
41
|
+
const addressLookupTableCache = new Map();
|
|
50
42
|
return {
|
|
51
43
|
rpc,
|
|
52
44
|
connection,
|
|
53
|
-
|
|
45
|
+
network: options.network,
|
|
46
|
+
getSolanaConnection: createSolanaConnectionGetter(options.network),
|
|
47
|
+
sendToPaymaster: async (domain, sponsor, sessionKey, instructions, extraConfig) => {
|
|
54
48
|
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
55
|
-
const transaction = await buildTransaction(latestBlockhash, sessionKey, sponsor, instructions,
|
|
49
|
+
const transaction = await buildTransaction(connection, latestBlockhash, sessionKey, sponsor, instructions, addressLookupTableCache, extraConfig);
|
|
56
50
|
return sendToPaymaster(options, domain, transaction);
|
|
57
51
|
},
|
|
58
52
|
getSponsor: (domain) => getSponsor(options, domain),
|
|
59
|
-
getAddressLookupTables: (addressLookupTableAddress) => getAddressLookupTables(options, connection, addressLookupTableAddress),
|
|
60
53
|
};
|
|
61
54
|
};
|
|
62
55
|
exports.createSessionConnection = createSessionConnection;
|
|
56
|
+
const createSolanaConnectionGetter = (network) => {
|
|
57
|
+
let connection;
|
|
58
|
+
return async () => {
|
|
59
|
+
if (connection === undefined) {
|
|
60
|
+
const url = new URL("https://api.fogo.io/api/solana-rpc");
|
|
61
|
+
url.searchParams.set("network", NETWORK_TO_QUERY_PARAM[network]);
|
|
62
|
+
const rpcUrlRes = await fetch(url);
|
|
63
|
+
if (rpcUrlRes.status === 200) {
|
|
64
|
+
const rpcUrl = await rpcUrlRes.text();
|
|
65
|
+
connection = new web3_js_1.Connection(rpcUrl);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw new Error("Failed to resolve Solana RPC url");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return connection;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const NETWORK_TO_QUERY_PARAM = {
|
|
75
|
+
[Network.Mainnet]: "mainnet",
|
|
76
|
+
[Network.Testnet]: "testnet",
|
|
77
|
+
};
|
|
63
78
|
const sendToPaymaster = async (options, domain, transaction) => {
|
|
64
79
|
if (options.sendToPaymaster === undefined) {
|
|
65
|
-
const url = new URL("/api/sponsor_and_send", options.paymaster ??
|
|
80
|
+
const url = new URL("/api/sponsor_and_send", options.paymaster ?? DEFAULT_PAYMASTER[options.network]);
|
|
66
81
|
url.searchParams.set("domain", domain);
|
|
67
82
|
const response = await fetch(url, {
|
|
68
83
|
method: "POST",
|
|
@@ -84,29 +99,39 @@ const sendToPaymaster = async (options, domain, transaction) => {
|
|
|
84
99
|
return options.sendToPaymaster(transaction);
|
|
85
100
|
}
|
|
86
101
|
};
|
|
87
|
-
const buildTransaction = async (latestBlockhash, sessionKey, sponsor, instructions,
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
102
|
+
const buildTransaction = async (connection, latestBlockhash, sessionKey, sponsor, instructions, addressLookupTableCache, extraConfig) => {
|
|
103
|
+
const [signerKeys, addressLookupTable] = await Promise.all([
|
|
104
|
+
getSignerKeys(sessionKey, extraConfig?.extraSigners),
|
|
105
|
+
extraConfig?.addressLookupTable === undefined
|
|
106
|
+
? Promise.resolve(undefined)
|
|
107
|
+
: getAddressLookupTable(connection, addressLookupTableCache, extraConfig.addressLookupTable),
|
|
108
|
+
]);
|
|
91
109
|
if (Array.isArray(instructions)) {
|
|
110
|
+
const signers = await Promise.all(signerKeys.map((signer) => (0, kit_1.createSignerFromKeyPair)(signer)));
|
|
92
111
|
return (0, kit_1.partiallySignTransactionMessageWithSigners)((0, kit_1.pipe)((0, kit_1.createTransactionMessage)({ version: 0 }), (tx) => (0, kit_1.setTransactionMessageFeePayer)((0, compat_1.fromLegacyPublicKey)(sponsor), tx), (tx) => (0, kit_1.setTransactionMessageLifetimeUsingBlockhash)(latestBlockhash, tx), (tx) => (0, kit_1.appendTransactionMessageInstructions)(instructions.map((instruction) => instruction instanceof web3_js_1.TransactionInstruction
|
|
93
112
|
? (0, compat_1.fromLegacyTransactionInstruction)(instruction)
|
|
94
|
-
: instruction), tx), (tx) =>
|
|
95
|
-
(0, compat_1.fromLegacyPublicKey)(table.key),
|
|
96
|
-
table.state.addresses.map((address) => (0, compat_1.fromLegacyPublicKey)(address)),
|
|
97
|
-
]) ?? [])), (tx) => sessionKeySigner === undefined
|
|
113
|
+
: instruction), tx), (tx) => addressLookupTable === undefined
|
|
98
114
|
? tx
|
|
99
|
-
: (0, kit_1.
|
|
115
|
+
: (0, kit_1.compressTransactionMessageUsingAddressLookupTables)(tx, {
|
|
116
|
+
[(0, compat_1.fromLegacyPublicKey)(addressLookupTable.key)]: addressLookupTable.state.addresses.map((address) => (0, compat_1.fromLegacyPublicKey)(address)),
|
|
117
|
+
}), (tx) => (0, kit_1.addSignersToTransactionMessage)(signers, tx)));
|
|
100
118
|
}
|
|
101
119
|
else {
|
|
102
120
|
const tx = instructions instanceof web3_js_1.VersionedTransaction
|
|
103
121
|
? (0, compat_1.fromVersionedTransaction)(instructions) // VersionedTransaction has a lifetime so it's fine to cast it so we can call partiallySignTransaction
|
|
104
122
|
: instructions;
|
|
105
|
-
return
|
|
106
|
-
? tx
|
|
107
|
-
: (0, kit_1.partiallySignTransaction)([sessionKey], tx);
|
|
123
|
+
return (0, kit_1.partiallySignTransaction)(signerKeys, tx);
|
|
108
124
|
}
|
|
109
125
|
};
|
|
126
|
+
const getSignerKeys = async (sessionKey, extraSigners) => {
|
|
127
|
+
const extraSignerKeys = extraSigners === undefined
|
|
128
|
+
? []
|
|
129
|
+
: await Promise.all(extraSigners.map((signer) => signer instanceof web3_js_1.Keypair ? (0, compat_1.fromLegacyKeypair)(signer) : signer));
|
|
130
|
+
return [
|
|
131
|
+
...extraSignerKeys,
|
|
132
|
+
...(sessionKey === undefined ? [] : [sessionKey]),
|
|
133
|
+
];
|
|
134
|
+
};
|
|
110
135
|
const sponsorAndSendResponseSchema = zod_1.z
|
|
111
136
|
.discriminatedUnion("type", [
|
|
112
137
|
zod_1.z.object({
|
|
@@ -128,7 +153,7 @@ const sponsorAndSendResponseSchema = zod_1.z
|
|
|
128
153
|
});
|
|
129
154
|
const getSponsor = async (options, domain) => {
|
|
130
155
|
if (options.sponsor === undefined) {
|
|
131
|
-
const url = new URL("/api/sponsor_pubkey", options.paymaster ??
|
|
156
|
+
const url = new URL("/api/sponsor_pubkey", options.paymaster ?? DEFAULT_PAYMASTER[options.network]);
|
|
132
157
|
url.searchParams.set("domain", domain);
|
|
133
158
|
const response = await fetch(url);
|
|
134
159
|
if (response.status === 200) {
|
|
@@ -142,19 +167,20 @@ const getSponsor = async (options, domain) => {
|
|
|
142
167
|
return options.sponsor;
|
|
143
168
|
}
|
|
144
169
|
};
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
const getAddressLookupTable = async (connection, addressLookupTableCache, addressLookupTableAddress) => {
|
|
171
|
+
const value = addressLookupTableCache.get(addressLookupTableAddress);
|
|
172
|
+
if (value === undefined) {
|
|
173
|
+
const result = await connection.getAddressLookupTable(new web3_js_1.PublicKey(addressLookupTableAddress));
|
|
174
|
+
if (result.value === null) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
addressLookupTableCache.set(addressLookupTableAddress, result.value);
|
|
179
|
+
return result.value;
|
|
180
|
+
}
|
|
155
181
|
}
|
|
156
182
|
else {
|
|
157
|
-
return;
|
|
183
|
+
return value;
|
|
158
184
|
}
|
|
159
185
|
};
|
|
160
186
|
class PaymasterResponseError extends Error {
|
package/cjs/context.d.ts
CHANGED
|
@@ -2,14 +2,16 @@ import { Connection as Web3Connection } from "@solana/web3.js";
|
|
|
2
2
|
import type { Connection } from "./connection.js";
|
|
3
3
|
export declare const createSessionContext: (options: {
|
|
4
4
|
connection: Connection;
|
|
5
|
-
|
|
5
|
+
defaultAddressLookupTableAddress?: string | undefined;
|
|
6
6
|
domain?: string | undefined;
|
|
7
7
|
}) => Promise<{
|
|
8
8
|
chainId: string;
|
|
9
9
|
domain: string;
|
|
10
10
|
payer: import("@solana/web3.js").PublicKey;
|
|
11
|
+
getSolanaConnection: () => Promise<Web3Connection>;
|
|
11
12
|
connection: Web3Connection;
|
|
12
13
|
rpc: import("@solana/kit").Rpc<import("@solana/kit").RequestAirdropApi & import("@solana/kit").GetAccountInfoApi & import("@solana/kit").GetBalanceApi & import("@solana/kit").GetBlockApi & import("@solana/kit").GetBlockCommitmentApi & import("@solana/kit").GetBlockHeightApi & import("@solana/kit").GetBlockProductionApi & import("@solana/kit").GetBlocksApi & import("@solana/kit").GetBlocksWithLimitApi & import("@solana/kit").GetBlockTimeApi & import("@solana/kit").GetClusterNodesApi & import("@solana/kit").GetEpochInfoApi & import("@solana/kit").GetEpochScheduleApi & import("@solana/kit").GetFeeForMessageApi & import("@solana/kit").GetFirstAvailableBlockApi & import("@solana/kit").GetGenesisHashApi & import("@solana/kit").GetHealthApi & import("@solana/kit").GetHighestSnapshotSlotApi & import("@solana/kit").GetIdentityApi & import("@solana/kit").GetInflationGovernorApi & import("@solana/kit").GetInflationRateApi & import("@solana/kit").GetInflationRewardApi & import("@solana/kit").GetLargestAccountsApi & import("@solana/kit").GetLatestBlockhashApi & import("@solana/kit").GetLeaderScheduleApi & import("@solana/kit").GetMaxRetransmitSlotApi & import("@solana/kit").GetMaxShredInsertSlotApi & import("@solana/kit").GetMinimumBalanceForRentExemptionApi & import("@solana/kit").GetMultipleAccountsApi & import("@solana/kit").GetProgramAccountsApi & import("@solana/kit").GetRecentPerformanceSamplesApi & import("@solana/kit").GetRecentPrioritizationFeesApi & import("@solana/kit").GetSignaturesForAddressApi & import("@solana/kit").GetSignatureStatusesApi & import("@solana/kit").GetSlotApi & import("@solana/kit").GetSlotLeaderApi & import("@solana/kit").GetSlotLeadersApi & import("@solana/kit").GetStakeMinimumDelegationApi & import("@solana/kit").GetSupplyApi & import("@solana/kit").GetTokenAccountBalanceApi & import("@solana/kit").GetTokenAccountsByDelegateApi & import("@solana/kit").GetTokenAccountsByOwnerApi & import("@solana/kit").GetTokenLargestAccountsApi & import("@solana/kit").GetTokenSupplyApi & import("@solana/kit").GetTransactionApi & import("@solana/kit").GetTransactionCountApi & import("@solana/kit").GetVersionApi & import("@solana/kit").GetVoteAccountsApi & import("@solana/kit").IsBlockhashValidApi & import("@solana/kit").MinimumLedgerSlotApi & import("@solana/kit").SendTransactionApi & import("@solana/kit").SimulateTransactionApi>;
|
|
13
|
-
|
|
14
|
+
network: import("./connection.js").Network;
|
|
15
|
+
sendTransaction: (sessionKey: CryptoKeyPair | undefined, instructions: Parameters<typeof options.connection.sendToPaymaster>[3], extraConfig?: Parameters<typeof options.connection.sendToPaymaster>[4]) => Promise<import("./connection.js").TransactionResult>;
|
|
14
16
|
}>;
|
|
15
17
|
export type SessionContext = Awaited<ReturnType<typeof createSessionContext>>;
|
package/cjs/context.js
CHANGED
|
@@ -7,16 +7,21 @@ const web3_js_1 = require("@solana/web3.js");
|
|
|
7
7
|
// eslint-disable-next-line unicorn/no-typeof-undefined
|
|
8
8
|
const IS_BROWSER = typeof globalThis.window !== "undefined";
|
|
9
9
|
const createSessionContext = async (options) => {
|
|
10
|
-
const addressLookupTables = await options.connection.getAddressLookupTables(options.addressLookupTableAddress);
|
|
11
10
|
const domain = getDomain(options.domain);
|
|
12
11
|
const sponsor = await options.connection.getSponsor(domain);
|
|
13
12
|
return {
|
|
14
13
|
chainId: await fetchChainId(options.connection.connection),
|
|
15
14
|
domain: getDomain(options.domain),
|
|
16
15
|
payer: sponsor,
|
|
16
|
+
getSolanaConnection: options.connection.getSolanaConnection,
|
|
17
17
|
connection: options.connection.connection,
|
|
18
18
|
rpc: options.connection.rpc,
|
|
19
|
-
|
|
19
|
+
network: options.connection.network,
|
|
20
|
+
sendTransaction: (sessionKey, instructions, extraConfig) => options.connection.sendToPaymaster(domain, sponsor, sessionKey, instructions, {
|
|
21
|
+
addressLookupTable: extraConfig?.addressLookupTable ??
|
|
22
|
+
options.defaultAddressLookupTableAddress,
|
|
23
|
+
extraSigners: extraConfig?.extraSigners,
|
|
24
|
+
}),
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
27
|
exports.createSessionContext = createSessionContext;
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { BaseWalletAdapter, MessageSignerWalletAdapterProps } from "@solana/wallet-adapter-base";
|
|
2
|
+
import type { TransactionError } from "@solana/web3.js";
|
|
3
|
+
import { Connection, PublicKey } from "@solana/web3.js";
|
|
4
|
+
import type { Chain } from "@wormhole-foundation/sdk";
|
|
3
5
|
import BN from "bn.js";
|
|
4
6
|
import { z } from "zod";
|
|
5
7
|
import type { TransactionResult } from "./connection.js";
|
|
@@ -13,6 +15,7 @@ type EstablishSessionOptions = {
|
|
|
13
15
|
expires: Date;
|
|
14
16
|
extra?: Record<string, string> | undefined;
|
|
15
17
|
createUnsafeExtractableSessionKey?: boolean | undefined;
|
|
18
|
+
sessionEstablishmentLookupTable?: string | undefined;
|
|
16
19
|
} & ({
|
|
17
20
|
limits?: Map<PublicKey, bigint>;
|
|
18
21
|
unlimited?: false;
|
|
@@ -1316,6 +1319,40 @@ type SendTransferOptions = {
|
|
|
1316
1319
|
recipient: PublicKey;
|
|
1317
1320
|
};
|
|
1318
1321
|
export declare const sendTransfer: (options: SendTransferOptions) => Promise<TransactionResult>;
|
|
1322
|
+
type SendBridgeOutOptions = {
|
|
1323
|
+
context: SessionContext;
|
|
1324
|
+
sessionKey: CryptoKeyPair;
|
|
1325
|
+
sessionPublicKey: PublicKey;
|
|
1326
|
+
walletPublicKey: PublicKey;
|
|
1327
|
+
solanaWallet: MessageSignerWalletAdapterProps;
|
|
1328
|
+
amount: bigint;
|
|
1329
|
+
fromToken: WormholeToken & {
|
|
1330
|
+
chain: "Fogo";
|
|
1331
|
+
};
|
|
1332
|
+
toToken: WormholeToken & {
|
|
1333
|
+
chain: "Solana";
|
|
1334
|
+
};
|
|
1335
|
+
};
|
|
1336
|
+
type WormholeToken = {
|
|
1337
|
+
chain: Chain;
|
|
1338
|
+
mint: PublicKey;
|
|
1339
|
+
manager: PublicKey;
|
|
1340
|
+
transceiver: PublicKey;
|
|
1341
|
+
};
|
|
1342
|
+
export declare const bridgeOut: (options: SendBridgeOutOptions) => Promise<TransactionResult>;
|
|
1343
|
+
type SendBridgeInOptions = {
|
|
1344
|
+
context: SessionContext;
|
|
1345
|
+
walletPublicKey: PublicKey;
|
|
1346
|
+
solanaWallet: BaseWalletAdapter;
|
|
1347
|
+
amount: bigint;
|
|
1348
|
+
fromToken: WormholeToken & {
|
|
1349
|
+
chain: "Solana";
|
|
1350
|
+
};
|
|
1351
|
+
toToken: WormholeToken & {
|
|
1352
|
+
chain: "Fogo";
|
|
1353
|
+
};
|
|
1354
|
+
};
|
|
1355
|
+
export declare const bridgeIn: (options: SendBridgeInOptions) => Promise<import("@wormhole-foundation/sdk/dist/cjs").CreatedTransferReceipt<"Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").SourceInitiatedTransferReceipt<"Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").FailedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").SourceFinalizedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").InReviewTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").AttestedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").RefundedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").RedeemedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").DestinationQueuedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore"> | import("@wormhole-foundation/sdk/dist/cjs").CompletedTransferReceipt<import("@wormhole-foundation/sdk/dist/cjs").AttestationReceipt<keyof import("@wormhole-foundation/sdk-definitions").WormholeRegistry.ProtocolToInterfaceMapping<"Mainnet" | "Testnet" | "Devnet", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>, "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore", "Fogo" | "Solana" | "Ethereum" | "Bsc" | "Polygon" | "Avalanche" | "Algorand" | "Fantom" | "Klaytn" | "Celo" | "Near" | "Moonbeam" | "Injective" | "Osmosis" | "Sui" | "Aptos" | "Arbitrum" | "Optimism" | "Pythnet" | "Btc" | "Base" | "Sei" | "Scroll" | "Mantle" | "Xlayer" | "Linea" | "Berachain" | "Seievm" | "Unichain" | "Worldchain" | "Ink" | "HyperEVM" | "Monad" | "Mezo" | "Sonic" | "Converge" | "Plume" | "XRPLEVM" | "Plasma" | "CreditCoin" | "Stacks" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Neutron" | "Celestia" | "Stargaze" | "Seda" | "Dymension" | "Provenance" | "Noble" | "Sepolia" | "ArbitrumSepolia" | "BaseSepolia" | "OptimismSepolia" | "Holesky" | "PolygonSepolia" | "HyperCore">>;
|
|
1319
1356
|
/**
|
|
1320
1357
|
* Create a login token signed with the session key
|
|
1321
1358
|
* @param session - The session to create a login token for
|