@bounded-sh/client 0.0.64 → 0.0.65
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/auth/providers/injected-wallet-provider.d.ts +1 -1
- package/dist/auth/providers/privy-expo-provider.d.ts +1 -1
- package/dist/auth/turnkey-signing-capability.d.ts +20 -0
- package/dist/{email-auth-provider-v9xvY0Ky.mjs → email-auth-provider-BLHNLu5l.mjs} +2 -2
- package/dist/{email-auth-provider-v9xvY0Ky.mjs.map → email-auth-provider-BLHNLu5l.mjs.map} +1 -1
- package/dist/{email-auth-provider-97CluDlZ.js → email-auth-provider-CJVJsWXv.js} +2 -2
- package/dist/{email-auth-provider-97CluDlZ.js.map → email-auth-provider-CJVJsWXv.js.map} +1 -1
- package/dist/{email-auth-provider-CKM4O5Z1.js → email-auth-provider-DYtoSrdm.js} +2 -2
- package/dist/{email-auth-provider-CKM4O5Z1.js.map → email-auth-provider-DYtoSrdm.js.map} +1 -1
- package/dist/{email-auth-provider-h0fPnU76.mjs → email-auth-provider-wqNimboO.mjs} +2 -2
- package/dist/{email-auth-provider-h0fPnU76.mjs.map → email-auth-provider-wqNimboO.mjs.map} +1 -1
- package/dist/{guest-auth-provider-Dmup2WIL.mjs → guest-auth-provider-C3EGlSSp.mjs} +2 -2
- package/dist/{guest-auth-provider-BLRbjAv2.mjs.map → guest-auth-provider-C3EGlSSp.mjs.map} +1 -1
- package/dist/{guest-auth-provider-BLRbjAv2.mjs → guest-auth-provider-CKkNZ-1p.mjs} +2 -2
- package/dist/{guest-auth-provider-Dmup2WIL.mjs.map → guest-auth-provider-CKkNZ-1p.mjs.map} +1 -1
- package/dist/{guest-auth-provider-CLnFuodt.js → guest-auth-provider-CoI0r92a.js} +2 -2
- package/dist/{guest-auth-provider-CLnFuodt.js.map → guest-auth-provider-CoI0r92a.js.map} +1 -1
- package/dist/{guest-auth-provider-BvIf5W5c.js → guest-auth-provider-UMP8Z_bK.js} +2 -2
- package/dist/{guest-auth-provider-BvIf5W5c.js.map → guest-auth-provider-UMP8Z_bK.js.map} +1 -1
- package/dist/{index-7yz-Olrm.mjs → index-Cgbr0abz.mjs} +111 -108
- package/dist/index-Cgbr0abz.mjs.map +1 -0
- package/dist/{index-Bk0nEjB6.js → index-FkEGh6dx.js} +109 -107
- package/dist/index-FkEGh6dx.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-Do-VhPUG.js → index.native-CAHw3k3_.js} +108 -106
- package/dist/index.native-CAHw3k3_.js.map +1 -0
- package/dist/{index.native-CWcQMPZd.mjs → index.native-wyaknPBR.mjs} +110 -107
- package/dist/index.native-wyaknPBR.mjs.map +1 -0
- package/dist/index.native.d.ts +0 -1
- package/dist/index.native.js +1 -2
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-xvZq9Zli.mjs → injected-evm-wallet-provider-B8x7dNuL.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-xvZq9Zli.mjs.map → injected-evm-wallet-provider-B8x7dNuL.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BMiT8I-4.js → injected-evm-wallet-provider-BAToKWZo.js} +2 -2
- package/dist/{injected-evm-wallet-provider-BMiT8I-4.js.map → injected-evm-wallet-provider-BAToKWZo.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-B5MA0w8I.js → injected-evm-wallet-provider-D-7Eg6TS.js} +2 -2
- package/dist/{injected-evm-wallet-provider-B5MA0w8I.js.map → injected-evm-wallet-provider-D-7Eg6TS.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-DlPsOmik.mjs → injected-evm-wallet-provider-pVKJtDHL.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-DlPsOmik.mjs.map → injected-evm-wallet-provider-pVKJtDHL.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-CSj0lY9H.js → injected-wallet-provider-28GE3rH9.js} +8 -75
- package/dist/injected-wallet-provider-28GE3rH9.js.map +1 -0
- package/dist/{injected-wallet-provider-Dd7ij6bc.mjs → injected-wallet-provider-5NeXEzui.mjs} +9 -76
- package/dist/injected-wallet-provider-5NeXEzui.mjs.map +1 -0
- package/dist/{injected-wallet-provider-YHhhFzsj.mjs → injected-wallet-provider-BojBmTAQ.mjs} +9 -76
- package/dist/injected-wallet-provider-BojBmTAQ.mjs.map +1 -0
- package/dist/{injected-wallet-provider-CoE5XQQn.js → injected-wallet-provider-DvwlPJea.js} +8 -75
- package/dist/injected-wallet-provider-DvwlPJea.js.map +1 -0
- package/dist/onramp.d.ts +4 -1
- package/package.json +2 -2
- package/dist/auth/providers/phantom-wallet-provider.d.ts +0 -111
- package/dist/auth/providers/privy-wallet-provider.d.ts +0 -83
- package/dist/auth/providers/sol/sol-utils.d.ts +0 -2
- package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +0 -151
- package/dist/index-7yz-Olrm.mjs.map +0 -1
- package/dist/index-Bk0nEjB6.js.map +0 -1
- package/dist/index.native-CWcQMPZd.mjs.map +0 -1
- package/dist/index.native-Do-VhPUG.js.map +0 -1
- package/dist/injected-wallet-provider-CSj0lY9H.js.map +0 -1
- package/dist/injected-wallet-provider-CoE5XQQn.js.map +0 -1
- package/dist/injected-wallet-provider-Dd7ij6bc.mjs.map +0 -1
- package/dist/injected-wallet-provider-YHhhFzsj.mjs.map +0 -1
|
@@ -3817,6 +3817,63 @@ async function runWidget(url, signerOrigin, ex, popupFallback) {
|
|
|
3817
3817
|
return run;
|
|
3818
3818
|
}
|
|
3819
3819
|
|
|
3820
|
+
// turnkey-signing-capability.ts - the pure AS-02 (DS2-0112) signing-capability logic,
|
|
3821
|
+
// kept import-free (no DOM, no session, no @bounded-sh/core) so it is unit-testable.
|
|
3822
|
+
//
|
|
3823
|
+
// The hosted Turnkey signer refuses to sign unless the request carries an issuer-signed
|
|
3824
|
+
// SIGNING CAPABILITY bound to the app id, the requesting origin, and the EXACT payload
|
|
3825
|
+
// hash. `requestTurnkeySigningCapability` mints one for the given bytes and
|
|
3826
|
+
// `buildTurnkeySignRequest` assembles the signer request that carries it. The bridge
|
|
3827
|
+
// (turnkey-signer-bridge.ts) supplies the base url + id token and routes through both,
|
|
3828
|
+
// so a regression here (a dropped capability, a wrong route, a swallowed error) is
|
|
3829
|
+
// caught without a browser.
|
|
3830
|
+
// POST the Bounded id token + payload hash to the issuer's capability mint route and
|
|
3831
|
+
// return the issuer-signed capability for exactly these bytes. Credential-free: identity
|
|
3832
|
+
// is proven with the id token in the body (not an ambient cookie the cross-origin fetch
|
|
3833
|
+
// would not carry). Throws with the same stable messages the bridge relied on inline.
|
|
3834
|
+
async function requestTurnkeySigningCapability(opts) {
|
|
3835
|
+
const base = opts.baseUrl.replace(/\/$/, '');
|
|
3836
|
+
let res;
|
|
3837
|
+
try {
|
|
3838
|
+
res = await opts.fetchImpl(`${base}/wallet/turnkey/capability`, {
|
|
3839
|
+
method: 'POST',
|
|
3840
|
+
headers: { 'content-type': 'application/json' },
|
|
3841
|
+
body: JSON.stringify({ idToken: opts.idToken, messageHex: opts.messageHex }),
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
catch (_a) {
|
|
3845
|
+
throw new Error('Could not reach the Bounded signer to authorize this signature.');
|
|
3846
|
+
}
|
|
3847
|
+
if (!res.ok) {
|
|
3848
|
+
let error = 'signing_capability_denied';
|
|
3849
|
+
try {
|
|
3850
|
+
const d = (await res.json());
|
|
3851
|
+
if (d && typeof d.error === 'string')
|
|
3852
|
+
error = d.error;
|
|
3853
|
+
}
|
|
3854
|
+
catch (_b) {
|
|
3855
|
+
/* keep the default marker */
|
|
3856
|
+
}
|
|
3857
|
+
throw new Error(`Turnkey signing was not authorized (${error}).`);
|
|
3858
|
+
}
|
|
3859
|
+
const d = (await res.json());
|
|
3860
|
+
if (!d || typeof d.capability !== 'string' || !d.capability) {
|
|
3861
|
+
throw new Error('Turnkey signing capability was malformed.');
|
|
3862
|
+
}
|
|
3863
|
+
return d.capability;
|
|
3864
|
+
}
|
|
3865
|
+
// Assemble the `bounded:turnkey:sign` postMessage request, carrying the issuer-signed
|
|
3866
|
+
// capability for the same bytes. Without the capability the hosted signer refuses
|
|
3867
|
+
// (capability_required), so it is a required field of every sign request.
|
|
3868
|
+
function buildTurnkeySignRequest(opts) {
|
|
3869
|
+
return {
|
|
3870
|
+
type: 'bounded:turnkey:sign',
|
|
3871
|
+
requestId: opts.requestId,
|
|
3872
|
+
messageHex: opts.messageHex,
|
|
3873
|
+
capability: opts.capability,
|
|
3874
|
+
};
|
|
3875
|
+
}
|
|
3876
|
+
|
|
3820
3877
|
// turnkey-signer-bridge.ts - routes NON-CUSTODIAL Turnkey embedded-wallet signing
|
|
3821
3878
|
// through the Bounded-owned signer page (auth.bounded.sh/wallet/turnkey/signer).
|
|
3822
3879
|
//
|
|
@@ -3981,6 +4038,33 @@ async function runPopup(url, signerOrigin, ex) {
|
|
|
3981
4038
|
} }, 5 * 60 * 1000);
|
|
3982
4039
|
});
|
|
3983
4040
|
}
|
|
4041
|
+
// AS-02: the hosted signer refuses to sign unless the request carries an issuer-signed
|
|
4042
|
+
// SIGNING CAPABILITY bound to the app id, this origin, and the EXACT bytes (a bare postMessage
|
|
4043
|
+
// from any peer can no longer consent-phish a signature). Fetch one from the human-auth issuer
|
|
4044
|
+
// for exactly these bytes before posting the sign request. Credential-free: the caller proves
|
|
4045
|
+
// identity with the Bounded id token WE minted (a body secret, RS256-verified server-side), not
|
|
4046
|
+
// an ambient cookie - the issuer's session cookie is SameSite-scoped to its own origin and is
|
|
4047
|
+
// not sent on this cross-origin fetch, so the token is what carries the session's wallet.
|
|
4048
|
+
async function fetchSigningCapability(messageHex) {
|
|
4049
|
+
const cfg = await core.getConfig();
|
|
4050
|
+
const base = (cfg.humanAuthApiUrl || 'https://auth.bounded.sh').replace(/\/$/, '');
|
|
4051
|
+
let idToken = null;
|
|
4052
|
+
try {
|
|
4053
|
+
idToken = core.getActiveSessionManager().getIdToken();
|
|
4054
|
+
}
|
|
4055
|
+
catch (_a) {
|
|
4056
|
+
idToken = null;
|
|
4057
|
+
}
|
|
4058
|
+
if (!idToken) {
|
|
4059
|
+
throw new Error('This session has no Turnkey wallet. Sign in again to provision one.');
|
|
4060
|
+
}
|
|
4061
|
+
return requestTurnkeySigningCapability({
|
|
4062
|
+
baseUrl: base,
|
|
4063
|
+
idToken,
|
|
4064
|
+
messageHex,
|
|
4065
|
+
fetchImpl: (url, init) => fetch(url, init),
|
|
4066
|
+
});
|
|
4067
|
+
}
|
|
3984
4068
|
function hasTurnkeyWallet() {
|
|
3985
4069
|
return activeTurnkeyAddress() !== null;
|
|
3986
4070
|
}
|
|
@@ -4023,8 +4107,11 @@ async function signSolanaMessageViaTurnkey(message) {
|
|
|
4023
4107
|
const { url, origin } = await turnkeySignerPage();
|
|
4024
4108
|
const requestId = `tksign_${Date.now()}_${++requestSeq}`;
|
|
4025
4109
|
const messageHex = toHex(message);
|
|
4110
|
+
// AS-02: obtain the issuer-signed capability for THESE exact bytes first; the signer will
|
|
4111
|
+
// refuse (capability_required) without it. Fetched per signature (each is single-payload).
|
|
4112
|
+
const capability = await fetchSigningCapability(messageHex);
|
|
4026
4113
|
return await deliver(url, origin, {
|
|
4027
|
-
request: {
|
|
4114
|
+
request: buildTurnkeySignRequest({ requestId, messageHex, capability }),
|
|
4028
4115
|
onResult: (d) => {
|
|
4029
4116
|
if (d.ok && typeof d.signatureHex === 'string' && typeof d.address === 'string') {
|
|
4030
4117
|
return { done: true, value: { signature: fromHex(d.signatureHex), address: d.address, subOrgId: String(d.subOrgId || '') } };
|
|
@@ -4961,7 +5048,7 @@ async function getAuthProvider(config) {
|
|
|
4961
5048
|
// manager as legacy email sessions. Human login should be started
|
|
4962
5049
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
4963
5050
|
// logout surface for those sessions.
|
|
4964
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
5051
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-CJVJsWXv.js'); })).EmailAuthProvider();
|
|
4965
5052
|
break;
|
|
4966
5053
|
case "wallet":
|
|
4967
5054
|
case "phantom": {
|
|
@@ -4980,7 +5067,7 @@ async function getAuthProvider(config) {
|
|
|
4980
5067
|
if (!isWalletLoginEnabled(config)) {
|
|
4981
5068
|
throw walletLoginNotEnabledError(authMethod);
|
|
4982
5069
|
}
|
|
4983
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
5070
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-28GE3rH9.js'); });
|
|
4984
5071
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
4985
5072
|
break;
|
|
4986
5073
|
}
|
|
@@ -4993,7 +5080,7 @@ async function getAuthProvider(config) {
|
|
|
4993
5080
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
4994
5081
|
// to point at a specific wallet or set chainId/domain.
|
|
4995
5082
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
4996
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
5083
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-D-7Eg6TS.js'); });
|
|
4997
5084
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
4998
5085
|
break;
|
|
4999
5086
|
}
|
|
@@ -5021,7 +5108,7 @@ async function getAuthProvider(config) {
|
|
|
5021
5108
|
break;
|
|
5022
5109
|
case "guest":
|
|
5023
5110
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
5024
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
5111
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-UMP8Z_bK.js'); })).GuestAuthProvider();
|
|
5025
5112
|
break;
|
|
5026
5113
|
}
|
|
5027
5114
|
if (!currentAuthProvider) {
|
|
@@ -5077,7 +5164,7 @@ async function signInAnonymously() {
|
|
|
5077
5164
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
5078
5165
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
5079
5166
|
// so bundle-splitting can see it.
|
|
5080
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
5167
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-UMP8Z_bK.js'); })).GuestAuthProvider();
|
|
5081
5168
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
5082
5169
|
const commit = (user) => {
|
|
5083
5170
|
// No await/interleaving inside this block: provider/method/config/marker
|
|
@@ -5228,7 +5315,7 @@ async function loginWithWallet(options) {
|
|
|
5228
5315
|
? Object.assign(Object.assign({}, base), { getProvider: options.getProvider }) : base;
|
|
5229
5316
|
const rpcUrl = normalizeSolanaRpcUrl(cfg.rpcUrl);
|
|
5230
5317
|
const network = getConfiguredSolanaNetwork(cfg);
|
|
5231
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
5318
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-28GE3rH9.js'); });
|
|
5232
5319
|
let provider = new InjectedWalletProvider(injectedConfig, rpcUrl, network);
|
|
5233
5320
|
if (coreConfig.chain === 'offchain')
|
|
5234
5321
|
provider = new OffchainAuthProvider(provider);
|
|
@@ -7257,18 +7344,6 @@ async function list() {
|
|
|
7257
7344
|
*/
|
|
7258
7345
|
const apps = { create, list, buildCreateRedirectUrl };
|
|
7259
7346
|
|
|
7260
|
-
async function deserializeTransaction(tx) {
|
|
7261
|
-
// Literal specifier so bundlers can code-split the lazy chunk.
|
|
7262
|
-
const { Transaction, VersionedTransaction } = await import('@solana/web3.js');
|
|
7263
|
-
const buf = Buffer.isBuffer(tx) ? tx : Buffer.from(tx, 'base64');
|
|
7264
|
-
if ((buf[0] & 0x80) !== 0) {
|
|
7265
|
-
return VersionedTransaction.deserialize(buf);
|
|
7266
|
-
}
|
|
7267
|
-
else {
|
|
7268
|
-
return Transaction.from(buf);
|
|
7269
|
-
}
|
|
7270
|
-
}
|
|
7271
|
-
|
|
7272
7347
|
// bounded.onramp() - fund the signed-in user's wallet with Coinbase Onramp.
|
|
7273
7348
|
//
|
|
7274
7349
|
// Web-only. Opens Coinbase's hosted checkout (pay.coinbase.com) in a popup
|
|
@@ -7310,16 +7385,16 @@ async function readError(res) {
|
|
|
7310
7385
|
}
|
|
7311
7386
|
}
|
|
7312
7387
|
function sessionBody(options, extra) {
|
|
7313
|
-
return JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
7388
|
+
return JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.asset ? { asset: options.asset } : {})), (options.amountUsd !== undefined ? { amountUsd: options.amountUsd } : {})), (options.minAmountOut !== undefined ? { minAmountOut: options.minAmountOut } : {})), (options.slippagePad !== undefined ? { slippagePad: options.slippagePad } : {})), extra));
|
|
7314
7389
|
}
|
|
7315
|
-
function resolveAddress(
|
|
7316
|
-
var _a
|
|
7390
|
+
function resolveAddress() {
|
|
7391
|
+
var _a;
|
|
7317
7392
|
const user = getCurrentUser();
|
|
7318
|
-
const address = (
|
|
7393
|
+
const address = (_a = user === null || user === void 0 ? void 0 : user.address) !== null && _a !== void 0 ? _a : undefined;
|
|
7319
7394
|
if (!address) {
|
|
7320
7395
|
throw new Error(user
|
|
7321
|
-
? 'onramp: the signed-in account has no wallet address
|
|
7322
|
-
: 'onramp: no signed-in user - call login() first
|
|
7396
|
+
? 'onramp: the signed-in account has no wallet address (create one via the embedded wallet flow)'
|
|
7397
|
+
: 'onramp: no signed-in user - call login() first');
|
|
7323
7398
|
}
|
|
7324
7399
|
return address;
|
|
7325
7400
|
}
|
|
@@ -7330,7 +7405,7 @@ function resolveAddress(options) {
|
|
|
7330
7405
|
async function onrampQuote(options = {}) {
|
|
7331
7406
|
if (!hasDOM())
|
|
7332
7407
|
throw new Error('onrampQuote is web-only');
|
|
7333
|
-
resolveAddress(
|
|
7408
|
+
resolveAddress();
|
|
7334
7409
|
const res = await authedFetch('/__bounded/onramp/session', {
|
|
7335
7410
|
method: 'POST',
|
|
7336
7411
|
headers: { 'content-type': 'application/json' },
|
|
@@ -7388,7 +7463,7 @@ async function onramp(options = {}) {
|
|
|
7388
7463
|
var _a;
|
|
7389
7464
|
if (!hasDOM())
|
|
7390
7465
|
throw new Error('onramp() is web-only');
|
|
7391
|
-
resolveAddress(
|
|
7466
|
+
resolveAddress();
|
|
7392
7467
|
// Open the window synchronously so the click's user-activation window is not
|
|
7393
7468
|
// consumed by the fetch below (same hard-won pattern as loginWithPopup).
|
|
7394
7469
|
let popup = null;
|
|
@@ -7611,84 +7686,12 @@ class PrivyExpoProvider {
|
|
|
7611
7686
|
setCurrentUser(user);
|
|
7612
7687
|
return user;
|
|
7613
7688
|
}
|
|
7614
|
-
async runTransaction(_evmTransactionData,
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
]);
|
|
7621
|
-
if (!solTransactionData) {
|
|
7622
|
-
throw new Error('Solana transaction data is required');
|
|
7623
|
-
}
|
|
7624
|
-
const wallet = await this.getWalletOrThrow();
|
|
7625
|
-
const rpcUrl = this.getRpcUrl(solTransactionData.network);
|
|
7626
|
-
const connection = new Connection(rpcUrl, 'confirmed');
|
|
7627
|
-
const remainingAccounts = core.convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
|
|
7628
|
-
const app_id = solTransactionData.appId;
|
|
7629
|
-
if (!app_id) {
|
|
7630
|
-
throw new Error('App ID is required');
|
|
7631
|
-
}
|
|
7632
|
-
// Create a mock wallet adapter for Anchor (only publicKey needed for building TX)
|
|
7633
|
-
const walletPublicKey = new PublicKey(wallet.address);
|
|
7634
|
-
const walletAdapter = {
|
|
7635
|
-
publicKey: walletPublicKey,
|
|
7636
|
-
signTransaction: async (tx) => tx,
|
|
7637
|
-
signAllTransactions: async (txs) => txs,
|
|
7638
|
-
};
|
|
7639
|
-
const ProviderClass = programSdk[['Anch', 'orProvider'].join('')];
|
|
7640
|
-
const programProvider = new ProviderClass(connection, walletAdapter, ProviderClass.defaultOptions());
|
|
7641
|
-
const finalDeduped = [];
|
|
7642
|
-
for (const acc of remainingAccounts) {
|
|
7643
|
-
const existing = finalDeduped.find((d) => d.pubkey.equals(acc.pubkey));
|
|
7644
|
-
if (existing) {
|
|
7645
|
-
existing.isSigner = existing.isSigner || acc.isSigner;
|
|
7646
|
-
existing.isWritable = existing.isWritable || acc.isWritable;
|
|
7647
|
-
}
|
|
7648
|
-
else {
|
|
7649
|
-
finalDeduped.push(acc);
|
|
7650
|
-
}
|
|
7651
|
-
}
|
|
7652
|
-
const { tx, blockhash, lastValidBlockHeight } = await core.buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, programProvider, walletPublicKey, {
|
|
7653
|
-
app_id,
|
|
7654
|
-
documents: solTransactionData.txArgs[0].setDocumentData,
|
|
7655
|
-
delete_paths: solTransactionData.txArgs[0].deletePaths,
|
|
7656
|
-
txData: solTransactionData.txArgs[0].txData,
|
|
7657
|
-
}, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false, solTransactionData.additionalLutAddresses);
|
|
7658
|
-
// Set blockhash
|
|
7659
|
-
const isLegacyTx = 'recentBlockhash' in tx &&
|
|
7660
|
-
!('message' in tx && 'staticAccountKeys' in tx.message);
|
|
7661
|
-
if (isLegacyTx) {
|
|
7662
|
-
tx.recentBlockhash = blockhash;
|
|
7663
|
-
tx.lastValidBlockHeight = lastValidBlockHeight;
|
|
7664
|
-
}
|
|
7665
|
-
else {
|
|
7666
|
-
tx.message.recentBlockhash = blockhash;
|
|
7667
|
-
}
|
|
7668
|
-
try {
|
|
7669
|
-
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
7670
|
-
// Sign only — don't submit
|
|
7671
|
-
const signed = await wallet.signTransaction(tx);
|
|
7672
|
-
return {
|
|
7673
|
-
signedTransaction: signed.signedTransaction,
|
|
7674
|
-
blockNumber: 0,
|
|
7675
|
-
gasUsed: '0',
|
|
7676
|
-
data: '',
|
|
7677
|
-
};
|
|
7678
|
-
}
|
|
7679
|
-
// Sign and submit
|
|
7680
|
-
const { signature, txInfo } = await this.signAndSubmitInternal(tx, wallet, connection);
|
|
7681
|
-
return {
|
|
7682
|
-
transactionSignature: signature,
|
|
7683
|
-
blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,
|
|
7684
|
-
gasUsed: ((_a = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _a === void 0 ? void 0 : _a.fee.toString()) || '0',
|
|
7685
|
-
data: txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta,
|
|
7686
|
-
};
|
|
7687
|
-
}
|
|
7688
|
-
catch (err) {
|
|
7689
|
-
console.error(err);
|
|
7690
|
-
throw err;
|
|
7691
|
-
}
|
|
7689
|
+
async runTransaction(_evmTransactionData, _solTransactionData, _options) {
|
|
7690
|
+
// Client-side Solana transaction building is retired: the realtime
|
|
7691
|
+
// worker returns a fully-built (and, when sponsored, partially-signed)
|
|
7692
|
+
// transaction on its 202, which the SDK validates and signs via
|
|
7693
|
+
// signTransaction. This provider serves no EVM payload either.
|
|
7694
|
+
throw new Error('runTransaction is not supported by this provider; Bounded returns pre-built Solana transactions that are signed with signTransaction.');
|
|
7692
7695
|
}
|
|
7693
7696
|
async signMessage(message) {
|
|
7694
7697
|
await this.ensureReady();
|
|
@@ -7950,7 +7953,6 @@ exports.completeLoginInPopup = completeLoginInPopup;
|
|
|
7950
7953
|
exports.confirmAndCheckTransaction = confirmAndCheckTransaction;
|
|
7951
7954
|
exports.defaultInjectedEvmProvider = defaultInjectedEvmProvider;
|
|
7952
7955
|
exports.defaultInjectedProvider = defaultInjectedProvider;
|
|
7953
|
-
exports.deserializeTransaction = deserializeTransaction;
|
|
7954
7956
|
exports.getAuthLoading = getAuthLoading;
|
|
7955
7957
|
exports.getAuthProvider = getAuthProvider;
|
|
7956
7958
|
exports.getCurrentUser = getCurrentUser;
|
|
@@ -7986,4 +7988,4 @@ exports.startTurnkeyEmailLogin = startTurnkeyEmailLogin;
|
|
|
7986
7988
|
exports.useAuth = useAuth;
|
|
7987
7989
|
exports.useBuildRun = useBuildRun;
|
|
7988
7990
|
exports.useQuery = useQuery;
|
|
7989
|
-
//# sourceMappingURL=index-
|
|
7991
|
+
//# sourceMappingURL=index-FkEGh6dx.js.map
|