@phantom/browser-injected-sdk 1.0.0-beta.1 → 1.0.0-beta.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/dist/auto-confirm/index.d.ts +1 -1
- package/dist/ethereum/index.d.ts +1 -1
- package/dist/{index-ecfd5526.d.ts → index-04827df9.d.ts} +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/solana/index.d.ts +35 -1
- package/dist/solana/index.js +56 -89
- package/dist/solana/index.mjs +56 -89
- package/package.json +2 -2
package/dist/ethereum/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as Ethereum, e as EthereumEventType, d as EthereumSignInData, b as EthereumTransaction, a as PhantomEthereumProvider, c as createEthereumPlugin } from '../index-
|
|
1
|
+
export { E as Ethereum, e as EthereumEventType, d as EthereumSignInData, b as EthereumTransaction, a as PhantomEthereumProvider, c as createEthereumPlugin } from '../index-04827df9.js';
|
|
@@ -128,8 +128,7 @@ declare function getChainId(): Promise<string>;
|
|
|
128
128
|
declare function switchChain(chainId: string): Promise<void>;
|
|
129
129
|
|
|
130
130
|
declare enum ProviderStrategy {
|
|
131
|
-
INJECTED = "injected"
|
|
132
|
-
DEEPLINK = "deeplink"
|
|
131
|
+
INJECTED = "injected"
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
interface EthereumStrategy {
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CreatePhantomConfig, i as Extension, f as Phantom, P as Plugin, c as createEthereumPlugin, h as createExtensionPlugin, g as createPhantom, j as isPhantomExtensionInstalled } from './index-
|
|
1
|
+
export { C as CreatePhantomConfig, i as Extension, f as Phantom, P as Plugin, c as createEthereumPlugin, h as createExtensionPlugin, g as createPhantom, j as isPhantomExtensionInstalled } from './index-04827df9.js';
|
package/dist/solana/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Plugin } from '../index-
|
|
1
|
+
import { P as Plugin } from '../index-04827df9.js';
|
|
2
2
|
import { VersionedTransaction, Transaction } from '@solana/web3.js';
|
|
3
3
|
|
|
4
4
|
declare function connect(): Promise<string | undefined>;
|
|
@@ -54,6 +54,10 @@ interface PhantomSolanaProvider {
|
|
|
54
54
|
signature: string;
|
|
55
55
|
publicKey?: string;
|
|
56
56
|
}>;
|
|
57
|
+
signAndSendAllTransactions: (transactions: any[], options?: SendOptions) => Promise<{
|
|
58
|
+
signatures: string[];
|
|
59
|
+
publicKey?: string;
|
|
60
|
+
}>;
|
|
57
61
|
signAllTransactions: (transactions: any[]) => Promise<any[]>;
|
|
58
62
|
signTransaction: (transaction: any) => Promise<any>;
|
|
59
63
|
on: (event: "connect" | "disconnect" | "accountChanged", handler: (publicKey?: PublicKey) => void) => void;
|
|
@@ -78,6 +82,33 @@ declare function signAndSendTransaction(transaction: VersionedTransaction | Tran
|
|
|
78
82
|
address?: string;
|
|
79
83
|
}>;
|
|
80
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Signs and sends all transactions using the Phantom provider.
|
|
87
|
+
* @param transactions An array of transactions to sign and send (Web3.js format).
|
|
88
|
+
* @returns A promise that resolves with an array of transaction signatures and optionally the public key.
|
|
89
|
+
* @throws Error if Phantom provider is not found or if the operation fails.
|
|
90
|
+
*/
|
|
91
|
+
declare function signAndSendAllTransactions(transactions: (VersionedTransaction | Transaction)[]): Promise<{
|
|
92
|
+
signatures: string[];
|
|
93
|
+
address?: string;
|
|
94
|
+
}>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Signs a transaction using the Phantom provider without sending it.
|
|
98
|
+
* @param transaction The transaction to sign (Web3.js format).
|
|
99
|
+
* @returns A promise that resolves with the signed transaction.
|
|
100
|
+
* @throws Error if Phantom provider is not found or if the operation fails.
|
|
101
|
+
*/
|
|
102
|
+
declare function signTransaction(transaction: VersionedTransaction | Transaction): Promise<VersionedTransaction | Transaction>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Signs all transactions using the Phantom provider.
|
|
106
|
+
* @param transactions An array of transactions to sign (Web3.js format).
|
|
107
|
+
* @returns A promise that resolves with an array of signed transactions.
|
|
108
|
+
* @throws Error if Phantom provider is not found or if the operation fails.
|
|
109
|
+
*/
|
|
110
|
+
declare function signAllTransactions(transactions: (VersionedTransaction | Transaction)[]): Promise<(VersionedTransaction | Transaction)[]>;
|
|
111
|
+
|
|
81
112
|
/**
|
|
82
113
|
* Signs in with Solana using the Phantom provider.
|
|
83
114
|
* @param signInData The sign-in data.
|
|
@@ -108,7 +139,10 @@ type Solana = {
|
|
|
108
139
|
getAccount: typeof getAccount;
|
|
109
140
|
signMessage: typeof signMessage;
|
|
110
141
|
signIn: typeof signIn;
|
|
142
|
+
signTransaction: typeof signTransaction;
|
|
143
|
+
signAllTransactions: typeof signAllTransactions;
|
|
111
144
|
signAndSendTransaction: typeof signAndSendTransaction;
|
|
145
|
+
signAndSendAllTransactions: typeof signAndSendAllTransactions;
|
|
112
146
|
addEventListener: (event: PhantomEventType, callback: PhantomEventCallback) => () => void;
|
|
113
147
|
removeEventListener: (event: PhantomEventType, callback: PhantomEventCallback) => void;
|
|
114
148
|
};
|
package/dist/solana/index.js
CHANGED
|
@@ -140,6 +140,23 @@ var InjectedSolanaStrategy = class {
|
|
|
140
140
|
address: result.publicKey
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
+
async signAndSendAllTransactions(transactions) {
|
|
144
|
+
const provider = __privateMethod(this, _getProvider, getProvider_fn).call(this);
|
|
145
|
+
if (!provider) {
|
|
146
|
+
throw new Error("Provider not found.");
|
|
147
|
+
}
|
|
148
|
+
if (!provider.isConnected) {
|
|
149
|
+
throw new Error("Provider is not connected.");
|
|
150
|
+
}
|
|
151
|
+
if (!provider.signAndSendAllTransactions) {
|
|
152
|
+
throw new Error("Provider does not support signAndSendAllTransactions.");
|
|
153
|
+
}
|
|
154
|
+
const results = await provider.signAndSendAllTransactions(transactions);
|
|
155
|
+
return {
|
|
156
|
+
signatures: results.signatures,
|
|
157
|
+
address: results.publicKey
|
|
158
|
+
};
|
|
159
|
+
}
|
|
143
160
|
async signTransaction(transaction) {
|
|
144
161
|
const provider = __privateMethod(this, _getProvider, getProvider_fn).call(this);
|
|
145
162
|
if (!provider) {
|
|
@@ -168,93 +185,6 @@ getProvider_fn = function() {
|
|
|
168
185
|
return window?.phantom?.solana;
|
|
169
186
|
};
|
|
170
187
|
|
|
171
|
-
// src/solana/strategies/deeplinks.ts
|
|
172
|
-
var DeepLinkSolanaStrategy = class {
|
|
173
|
-
constructor() {
|
|
174
|
-
this.type = "deeplink" /* DEEPLINK */;
|
|
175
|
-
}
|
|
176
|
-
load() {
|
|
177
|
-
return Promise.resolve(this);
|
|
178
|
-
}
|
|
179
|
-
get isConnected() {
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
async connect({ onlyIfTrusted }) {
|
|
183
|
-
const deeplink = `phantom://connect?onlyIfTrusted=${onlyIfTrusted}`;
|
|
184
|
-
window.location.href = deeplink;
|
|
185
|
-
return Promise.resolve(void 0);
|
|
186
|
-
}
|
|
187
|
-
async disconnect() {
|
|
188
|
-
const deeplink = `phantom://disconnect`;
|
|
189
|
-
window.location.href = deeplink;
|
|
190
|
-
return Promise.resolve();
|
|
191
|
-
}
|
|
192
|
-
async getAccount() {
|
|
193
|
-
const deeplink = `phantom://account`;
|
|
194
|
-
window.location.href = deeplink;
|
|
195
|
-
return Promise.resolve(void 0);
|
|
196
|
-
}
|
|
197
|
-
async signMessage(message, display) {
|
|
198
|
-
const messageEncoded = Buffer.from(message).toString("base64");
|
|
199
|
-
const deeplink = `phantom://sign-message?message=${messageEncoded}&display=${display}`;
|
|
200
|
-
window.location.href = deeplink;
|
|
201
|
-
return Promise.resolve({
|
|
202
|
-
signature: new Uint8Array(),
|
|
203
|
-
address: ""
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
async signIn(signInData) {
|
|
207
|
-
const deeplink = `phantom://sign-in?signInData=${encodeURIComponent(JSON.stringify(signInData))}`;
|
|
208
|
-
window.location.href = deeplink;
|
|
209
|
-
return Promise.resolve({
|
|
210
|
-
address: "",
|
|
211
|
-
signature: new Uint8Array(),
|
|
212
|
-
signedMessage: new Uint8Array()
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
async signAndSendTransaction(transaction) {
|
|
216
|
-
let serialized;
|
|
217
|
-
if ("serialize" in transaction && typeof transaction.serialize === "function") {
|
|
218
|
-
serialized = transaction.serialize();
|
|
219
|
-
} else {
|
|
220
|
-
serialized = transaction.serializeMessage?.() || new Uint8Array();
|
|
221
|
-
}
|
|
222
|
-
const encoded = Buffer.from(serialized).toString("base64");
|
|
223
|
-
const deeplink = `phantom://sign-and-send-transaction?transaction=${encoded}`;
|
|
224
|
-
window.location.href = deeplink;
|
|
225
|
-
return Promise.resolve({
|
|
226
|
-
signature: "",
|
|
227
|
-
address: ""
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
async signTransaction(transaction) {
|
|
231
|
-
let serialized;
|
|
232
|
-
if ("serialize" in transaction && typeof transaction.serialize === "function") {
|
|
233
|
-
serialized = transaction.serialize();
|
|
234
|
-
} else {
|
|
235
|
-
serialized = transaction.serializeMessage?.() || new Uint8Array();
|
|
236
|
-
}
|
|
237
|
-
const encoded = Buffer.from(serialized).toString("base64");
|
|
238
|
-
const deeplink = `phantom://sign-transaction?transaction=${encoded}`;
|
|
239
|
-
window.location.href = deeplink;
|
|
240
|
-
return Promise.resolve(transaction);
|
|
241
|
-
}
|
|
242
|
-
async signAllTransactions(transactions) {
|
|
243
|
-
const serializedTxs = transactions.map((tx) => {
|
|
244
|
-
let serialized;
|
|
245
|
-
if ("serialize" in tx && typeof tx.serialize === "function") {
|
|
246
|
-
serialized = tx.serialize();
|
|
247
|
-
} else {
|
|
248
|
-
serialized = tx.serializeMessage?.() || new Uint8Array();
|
|
249
|
-
}
|
|
250
|
-
return Buffer.from(serialized).toString("base64");
|
|
251
|
-
});
|
|
252
|
-
const deeplink = `phantom://sign-all-transactions?transactions=${JSON.stringify(serializedTxs)}`;
|
|
253
|
-
window.location.href = deeplink;
|
|
254
|
-
return Promise.resolve(transactions);
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
|
|
258
188
|
// src/solana/getProvider.ts
|
|
259
189
|
async function getProvider(strategy = "injected" /* INJECTED */) {
|
|
260
190
|
if (strategy === "injected") {
|
|
@@ -265,8 +195,6 @@ async function getProvider(strategy = "injected" /* INJECTED */) {
|
|
|
265
195
|
} catch (error) {
|
|
266
196
|
throw new Error("Provider not found.");
|
|
267
197
|
}
|
|
268
|
-
} else if (strategy === "deeplink") {
|
|
269
|
-
return new DeepLinkSolanaStrategy();
|
|
270
198
|
} else {
|
|
271
199
|
throw new Error("Invalid provider type.");
|
|
272
200
|
}
|
|
@@ -361,6 +289,42 @@ async function signAndSendTransaction(transaction) {
|
|
|
361
289
|
return provider.signAndSendTransaction(transaction);
|
|
362
290
|
}
|
|
363
291
|
|
|
292
|
+
// src/solana/signAndSendAllTransactions.ts
|
|
293
|
+
async function signAndSendAllTransactions(transactions) {
|
|
294
|
+
const provider = await getProvider();
|
|
295
|
+
if (!provider) {
|
|
296
|
+
throw new Error("Provider not found.");
|
|
297
|
+
}
|
|
298
|
+
if (!provider.isConnected) {
|
|
299
|
+
await provider.connect({ onlyIfTrusted: false });
|
|
300
|
+
}
|
|
301
|
+
return provider.signAndSendAllTransactions(transactions);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// src/solana/signTransaction.ts
|
|
305
|
+
async function signTransaction(transaction) {
|
|
306
|
+
const provider = await getProvider();
|
|
307
|
+
if (!provider) {
|
|
308
|
+
throw new Error("Provider not found.");
|
|
309
|
+
}
|
|
310
|
+
if (!provider.isConnected) {
|
|
311
|
+
await provider.connect({ onlyIfTrusted: false });
|
|
312
|
+
}
|
|
313
|
+
return provider.signTransaction(transaction);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// src/solana/signAllTransactions.ts
|
|
317
|
+
async function signAllTransactions(transactions) {
|
|
318
|
+
const provider = await getProvider();
|
|
319
|
+
if (!provider) {
|
|
320
|
+
throw new Error("Provider not found.");
|
|
321
|
+
}
|
|
322
|
+
if (!provider.isConnected) {
|
|
323
|
+
await provider.connect({ onlyIfTrusted: false });
|
|
324
|
+
}
|
|
325
|
+
return provider.signAllTransactions(transactions);
|
|
326
|
+
}
|
|
327
|
+
|
|
364
328
|
// src/solana/signIn.ts
|
|
365
329
|
async function signIn(signInData) {
|
|
366
330
|
const provider = await getProvider();
|
|
@@ -393,7 +357,10 @@ var solana = {
|
|
|
393
357
|
getAccount,
|
|
394
358
|
signMessage,
|
|
395
359
|
signIn,
|
|
360
|
+
signTransaction,
|
|
361
|
+
signAllTransactions,
|
|
396
362
|
signAndSendTransaction,
|
|
363
|
+
signAndSendAllTransactions,
|
|
397
364
|
addEventListener,
|
|
398
365
|
removeEventListener
|
|
399
366
|
};
|
package/dist/solana/index.mjs
CHANGED
|
@@ -107,6 +107,23 @@ var InjectedSolanaStrategy = class {
|
|
|
107
107
|
address: result.publicKey
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
+
async signAndSendAllTransactions(transactions) {
|
|
111
|
+
const provider = __privateMethod(this, _getProvider, getProvider_fn).call(this);
|
|
112
|
+
if (!provider) {
|
|
113
|
+
throw new Error("Provider not found.");
|
|
114
|
+
}
|
|
115
|
+
if (!provider.isConnected) {
|
|
116
|
+
throw new Error("Provider is not connected.");
|
|
117
|
+
}
|
|
118
|
+
if (!provider.signAndSendAllTransactions) {
|
|
119
|
+
throw new Error("Provider does not support signAndSendAllTransactions.");
|
|
120
|
+
}
|
|
121
|
+
const results = await provider.signAndSendAllTransactions(transactions);
|
|
122
|
+
return {
|
|
123
|
+
signatures: results.signatures,
|
|
124
|
+
address: results.publicKey
|
|
125
|
+
};
|
|
126
|
+
}
|
|
110
127
|
async signTransaction(transaction) {
|
|
111
128
|
const provider = __privateMethod(this, _getProvider, getProvider_fn).call(this);
|
|
112
129
|
if (!provider) {
|
|
@@ -135,93 +152,6 @@ getProvider_fn = function() {
|
|
|
135
152
|
return window?.phantom?.solana;
|
|
136
153
|
};
|
|
137
154
|
|
|
138
|
-
// src/solana/strategies/deeplinks.ts
|
|
139
|
-
var DeepLinkSolanaStrategy = class {
|
|
140
|
-
constructor() {
|
|
141
|
-
this.type = "deeplink" /* DEEPLINK */;
|
|
142
|
-
}
|
|
143
|
-
load() {
|
|
144
|
-
return Promise.resolve(this);
|
|
145
|
-
}
|
|
146
|
-
get isConnected() {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
async connect({ onlyIfTrusted }) {
|
|
150
|
-
const deeplink = `phantom://connect?onlyIfTrusted=${onlyIfTrusted}`;
|
|
151
|
-
window.location.href = deeplink;
|
|
152
|
-
return Promise.resolve(void 0);
|
|
153
|
-
}
|
|
154
|
-
async disconnect() {
|
|
155
|
-
const deeplink = `phantom://disconnect`;
|
|
156
|
-
window.location.href = deeplink;
|
|
157
|
-
return Promise.resolve();
|
|
158
|
-
}
|
|
159
|
-
async getAccount() {
|
|
160
|
-
const deeplink = `phantom://account`;
|
|
161
|
-
window.location.href = deeplink;
|
|
162
|
-
return Promise.resolve(void 0);
|
|
163
|
-
}
|
|
164
|
-
async signMessage(message, display) {
|
|
165
|
-
const messageEncoded = Buffer.from(message).toString("base64");
|
|
166
|
-
const deeplink = `phantom://sign-message?message=${messageEncoded}&display=${display}`;
|
|
167
|
-
window.location.href = deeplink;
|
|
168
|
-
return Promise.resolve({
|
|
169
|
-
signature: new Uint8Array(),
|
|
170
|
-
address: ""
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
async signIn(signInData) {
|
|
174
|
-
const deeplink = `phantom://sign-in?signInData=${encodeURIComponent(JSON.stringify(signInData))}`;
|
|
175
|
-
window.location.href = deeplink;
|
|
176
|
-
return Promise.resolve({
|
|
177
|
-
address: "",
|
|
178
|
-
signature: new Uint8Array(),
|
|
179
|
-
signedMessage: new Uint8Array()
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
async signAndSendTransaction(transaction) {
|
|
183
|
-
let serialized;
|
|
184
|
-
if ("serialize" in transaction && typeof transaction.serialize === "function") {
|
|
185
|
-
serialized = transaction.serialize();
|
|
186
|
-
} else {
|
|
187
|
-
serialized = transaction.serializeMessage?.() || new Uint8Array();
|
|
188
|
-
}
|
|
189
|
-
const encoded = Buffer.from(serialized).toString("base64");
|
|
190
|
-
const deeplink = `phantom://sign-and-send-transaction?transaction=${encoded}`;
|
|
191
|
-
window.location.href = deeplink;
|
|
192
|
-
return Promise.resolve({
|
|
193
|
-
signature: "",
|
|
194
|
-
address: ""
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
async signTransaction(transaction) {
|
|
198
|
-
let serialized;
|
|
199
|
-
if ("serialize" in transaction && typeof transaction.serialize === "function") {
|
|
200
|
-
serialized = transaction.serialize();
|
|
201
|
-
} else {
|
|
202
|
-
serialized = transaction.serializeMessage?.() || new Uint8Array();
|
|
203
|
-
}
|
|
204
|
-
const encoded = Buffer.from(serialized).toString("base64");
|
|
205
|
-
const deeplink = `phantom://sign-transaction?transaction=${encoded}`;
|
|
206
|
-
window.location.href = deeplink;
|
|
207
|
-
return Promise.resolve(transaction);
|
|
208
|
-
}
|
|
209
|
-
async signAllTransactions(transactions) {
|
|
210
|
-
const serializedTxs = transactions.map((tx) => {
|
|
211
|
-
let serialized;
|
|
212
|
-
if ("serialize" in tx && typeof tx.serialize === "function") {
|
|
213
|
-
serialized = tx.serialize();
|
|
214
|
-
} else {
|
|
215
|
-
serialized = tx.serializeMessage?.() || new Uint8Array();
|
|
216
|
-
}
|
|
217
|
-
return Buffer.from(serialized).toString("base64");
|
|
218
|
-
});
|
|
219
|
-
const deeplink = `phantom://sign-all-transactions?transactions=${JSON.stringify(serializedTxs)}`;
|
|
220
|
-
window.location.href = deeplink;
|
|
221
|
-
return Promise.resolve(transactions);
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
|
|
225
155
|
// src/solana/getProvider.ts
|
|
226
156
|
async function getProvider(strategy = "injected" /* INJECTED */) {
|
|
227
157
|
if (strategy === "injected") {
|
|
@@ -232,8 +162,6 @@ async function getProvider(strategy = "injected" /* INJECTED */) {
|
|
|
232
162
|
} catch (error) {
|
|
233
163
|
throw new Error("Provider not found.");
|
|
234
164
|
}
|
|
235
|
-
} else if (strategy === "deeplink") {
|
|
236
|
-
return new DeepLinkSolanaStrategy();
|
|
237
165
|
} else {
|
|
238
166
|
throw new Error("Invalid provider type.");
|
|
239
167
|
}
|
|
@@ -328,6 +256,42 @@ async function signAndSendTransaction(transaction) {
|
|
|
328
256
|
return provider.signAndSendTransaction(transaction);
|
|
329
257
|
}
|
|
330
258
|
|
|
259
|
+
// src/solana/signAndSendAllTransactions.ts
|
|
260
|
+
async function signAndSendAllTransactions(transactions) {
|
|
261
|
+
const provider = await getProvider();
|
|
262
|
+
if (!provider) {
|
|
263
|
+
throw new Error("Provider not found.");
|
|
264
|
+
}
|
|
265
|
+
if (!provider.isConnected) {
|
|
266
|
+
await provider.connect({ onlyIfTrusted: false });
|
|
267
|
+
}
|
|
268
|
+
return provider.signAndSendAllTransactions(transactions);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// src/solana/signTransaction.ts
|
|
272
|
+
async function signTransaction(transaction) {
|
|
273
|
+
const provider = await getProvider();
|
|
274
|
+
if (!provider) {
|
|
275
|
+
throw new Error("Provider not found.");
|
|
276
|
+
}
|
|
277
|
+
if (!provider.isConnected) {
|
|
278
|
+
await provider.connect({ onlyIfTrusted: false });
|
|
279
|
+
}
|
|
280
|
+
return provider.signTransaction(transaction);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// src/solana/signAllTransactions.ts
|
|
284
|
+
async function signAllTransactions(transactions) {
|
|
285
|
+
const provider = await getProvider();
|
|
286
|
+
if (!provider) {
|
|
287
|
+
throw new Error("Provider not found.");
|
|
288
|
+
}
|
|
289
|
+
if (!provider.isConnected) {
|
|
290
|
+
await provider.connect({ onlyIfTrusted: false });
|
|
291
|
+
}
|
|
292
|
+
return provider.signAllTransactions(transactions);
|
|
293
|
+
}
|
|
294
|
+
|
|
331
295
|
// src/solana/signIn.ts
|
|
332
296
|
async function signIn(signInData) {
|
|
333
297
|
const provider = await getProvider();
|
|
@@ -360,7 +324,10 @@ var solana = {
|
|
|
360
324
|
getAccount,
|
|
361
325
|
signMessage,
|
|
362
326
|
signIn,
|
|
327
|
+
signTransaction,
|
|
328
|
+
signAllTransactions,
|
|
363
329
|
signAndSendTransaction,
|
|
330
|
+
signAndSendAllTransactions,
|
|
364
331
|
addEventListener,
|
|
365
332
|
removeEventListener
|
|
366
333
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phantom/browser-injected-sdk",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"prettier": "prettier --write \"src/**/*.{ts,tsx}\""
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@phantom/constants": "^1.0.0-beta.
|
|
45
|
+
"@phantom/constants": "^1.0.0-beta.3",
|
|
46
46
|
"@solana/web3.js": "^1.98.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|