@pooflabs/core 0.0.15 → 0.0.17
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/client/config.d.ts +4 -1
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -7
- package/dist/index.mjs.map +1 -1
- package/dist/utils/api.d.ts +0 -1
- package/package.json +1 -1
package/dist/client/config.d.ts
CHANGED
|
@@ -19,9 +19,12 @@ export interface ClientConfig {
|
|
|
19
19
|
};
|
|
20
20
|
phantomConfig?: {
|
|
21
21
|
appId?: string;
|
|
22
|
-
providers?: Array<'injected' | 'google' | 'apple' | '
|
|
22
|
+
providers?: Array<'injected' | 'google' | 'apple' | 'phantom'>;
|
|
23
23
|
redirectUrl?: string;
|
|
24
24
|
autoConnect?: boolean;
|
|
25
|
+
theme?: 'light' | 'dark';
|
|
26
|
+
appName?: string;
|
|
27
|
+
appIcon?: string;
|
|
25
28
|
};
|
|
26
29
|
mockAuth?: boolean;
|
|
27
30
|
}
|
package/dist/index.js
CHANGED
|
@@ -3167,11 +3167,6 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
3167
3167
|
if (_overrides === null || _overrides === void 0 ? void 0 : _overrides.headers) {
|
|
3168
3168
|
Object.assign(headers, _overrides.headers);
|
|
3169
3169
|
}
|
|
3170
|
-
// Signal to backend that client supports offchain transaction signing
|
|
3171
|
-
if (typeof window !== "undefined" &&
|
|
3172
|
-
window.TAROBASE_SUPPORTS_OFFCHAIN_SIGNING) {
|
|
3173
|
-
headers["X-Supports-Offchain-Signing"] = "true";
|
|
3174
|
-
}
|
|
3175
3170
|
const requestConfig = {
|
|
3176
3171
|
method,
|
|
3177
3172
|
url: `${config.apiUrl}${urlPath.startsWith("/") ? urlPath : `/${urlPath}`}`,
|
|
@@ -3554,6 +3549,7 @@ async function setMany(many, options) {
|
|
|
3554
3549
|
return transactionResult;
|
|
3555
3550
|
}
|
|
3556
3551
|
async function handleOffchainTransaction(tx, authProvider, options) {
|
|
3552
|
+
var _a, _b, _c, _d, _e;
|
|
3557
3553
|
const config = await getConfig();
|
|
3558
3554
|
// 1. Sign the transaction message using the auth provider
|
|
3559
3555
|
const signature = await authProvider.signMessage(tx.message);
|
|
@@ -3570,10 +3566,19 @@ async function setMany(many, options) {
|
|
|
3570
3566
|
};
|
|
3571
3567
|
}
|
|
3572
3568
|
// 4. Submit to RPC endpoint
|
|
3573
|
-
|
|
3569
|
+
// Use appId from headers if provided, otherwise fallback to config.appId
|
|
3570
|
+
const appId = ((_b = (_a = options === null || options === void 0 ? void 0 : options._overrides) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']) || ((_d = (_c = options === null || options === void 0 ? void 0 : options._overrides) === null || _c === void 0 ? void 0 : _c.headers) === null || _d === void 0 ? void 0 : _d['X-App-Id']) || config.appId;
|
|
3571
|
+
const rpcUrl = `${config.apiUrl}/app/${appId}/rpc`;
|
|
3572
|
+
// Build headers, applying overrides if provided
|
|
3573
|
+
const headers = {
|
|
3574
|
+
'Content-Type': 'application/json',
|
|
3575
|
+
};
|
|
3576
|
+
if ((_e = options === null || options === void 0 ? void 0 : options._overrides) === null || _e === void 0 ? void 0 : _e.headers) {
|
|
3577
|
+
Object.assign(headers, options._overrides.headers);
|
|
3578
|
+
}
|
|
3574
3579
|
const rpcResponse = await fetch(rpcUrl, {
|
|
3575
3580
|
method: 'POST',
|
|
3576
|
-
headers
|
|
3581
|
+
headers,
|
|
3577
3582
|
body: JSON.stringify({
|
|
3578
3583
|
jsonrpc: '2.0',
|
|
3579
3584
|
id: 1,
|