@ab-org/predicate-market-sdk 2.2.0-beta.6 → 2.2.0-beta.8
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/{autoReconnect-STOYP7SX.js → autoReconnect-GHZLB233.js} +2 -2
- package/dist/{dist-Q2PDXT2F.js → chunk-26R46ZBM.js} +15 -15
- package/dist/{chunk-UMSH3Z43.js → chunk-4XO4Z5TC.js} +5 -3
- package/dist/{chunk-NTFBZNCV.js → chunk-6AZQBNMY.js} +1 -1
- package/dist/{chunk-IVPLOLGZ.js → chunk-BLUBNFON.js} +10 -12
- package/dist/{chunk-BWKDIOBB.js → chunk-E3UPFA4K.js} +26 -50
- package/dist/{chunk-HNL3SLGU.js → chunk-E65LLR2W.js} +1 -1
- package/dist/{chunk-63AEVWHE.js → chunk-GIPWCNYS.js} +1 -1
- package/dist/{chunk-CGP7TSLF.js → chunk-R2D3SM4S.js} +2 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.js +4 -4
- package/dist/dist-C3ENWBQI.js +2 -0
- package/dist/index.js +8 -7
- package/dist/merchant.d.ts +1 -0
- package/dist/merchant.js +4 -4
- package/dist/react.d.ts +2 -1
- package/dist/react.js +4 -3
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getSDKConfig } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
import { getSDKConfig } from './chunk-E3UPFA4K.js';
|
|
2
|
+
import './chunk-R2D3SM4S.js';
|
|
3
3
|
import './chunk-UPMVYXZ6.js';
|
|
4
4
|
import { sessionStore, createDefaultInjectedWalletRegistry, WalletConnector } from '@ab-org/sdk-core';
|
|
5
5
|
import { CubistSocialProvider } from '@ab-org/sdk-core/social/provider';
|
|
@@ -10,10 +10,10 @@ var v = getEnv("RELAY_ORIGIN");
|
|
|
10
10
|
function L(e) {
|
|
11
11
|
return getEnv(e) || "";
|
|
12
12
|
}
|
|
13
|
-
var f = ({ url: e, name:
|
|
13
|
+
var f = ({ url: e, name: l, width: r, height: t }) => {
|
|
14
14
|
let i = (window.innerHeight - (t || 400)) / 2 + window.screenY, a = (window.innerWidth - (r || 400)) / 2 + window.screenX;
|
|
15
15
|
try {
|
|
16
|
-
let s = window.open(e,
|
|
16
|
+
let s = window.open(e, l, `dialog=yes,top=${i}px,left=${a},width=${r !== void 0 ? r : 400}px,height=${t !== void 0 ? t : 600}px`);
|
|
17
17
|
return s || null;
|
|
18
18
|
} catch (s) {
|
|
19
19
|
return console.error("Failed to open window:", s), null;
|
|
@@ -25,8 +25,8 @@ function $(e) {
|
|
|
25
25
|
if (/^https?:\/\//.test(e)) return e.replace(/\/$/, "");
|
|
26
26
|
throw new Error(`Unsupported CubeSigner env: ${e}`);
|
|
27
27
|
}
|
|
28
|
-
var O = async (e,
|
|
29
|
-
let t = await fetch(`${$(
|
|
28
|
+
var O = async (e, l, r) => {
|
|
29
|
+
let t = await fetch(`${$(l)}/v0/org/${encodeURIComponent(r)}/oidc/email-otp`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email: e }) });
|
|
30
30
|
if (!t.ok) {
|
|
31
31
|
let a = await t.text().catch(() => "");
|
|
32
32
|
throw new Error(a ? `Email login failed (${t.status}): ${a}` : `Email login failed (${t.status})`);
|
|
@@ -35,25 +35,25 @@ var O = async (e, g, r) => {
|
|
|
35
35
|
if (!i.partial_token) throw new Error("Email login response missing partial_token");
|
|
36
36
|
return i.partial_token;
|
|
37
37
|
};
|
|
38
|
-
var Y = ({ stage: e, xClientId:
|
|
39
|
-
let t = v;
|
|
40
|
-
if (
|
|
38
|
+
var Y = ({ stage: e, xClientId: l, googleClientId: r }) => {
|
|
39
|
+
let t = window.location.origin || v;
|
|
40
|
+
if (!t) throw new Error("Invalid stage");
|
|
41
41
|
let i = `${t}/relay/x`, a = `${t}/relay/google`, s = S[e], E = C;
|
|
42
42
|
if (!E) throw new Error("Invalid cube stage");
|
|
43
|
-
let y = (o,
|
|
43
|
+
let y = (o, g = 12e4) => new Promise((c, n) => {
|
|
44
44
|
if (!o) {
|
|
45
45
|
n(new Error("Failed to open popup"));
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
let m = setTimeout(() => {
|
|
49
49
|
o.close(), n(new Error("Login timeout"));
|
|
50
|
-
},
|
|
50
|
+
}, g), d = async (p) => {
|
|
51
51
|
if (p.origin !== t || p.data.action !== "login") return;
|
|
52
52
|
let { data: I } = p.data;
|
|
53
53
|
try {
|
|
54
|
-
let { oidcToken: u = "", error:
|
|
55
|
-
if (
|
|
56
|
-
clearTimeout(m), window.removeEventListener("message", d), o.close(), n(new Error(String(
|
|
54
|
+
let { oidcToken: u = "", error: b } = I || {};
|
|
55
|
+
if (b) {
|
|
56
|
+
clearTimeout(m), window.removeEventListener("message", d), o.close(), n(new Error(String(b)));
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
u && (clearTimeout(m), window.removeEventListener("message", d), o.close(), c(u));
|
|
@@ -67,10 +67,10 @@ var Y = ({ stage: e, xClientId: g, googleClientId: r }) => {
|
|
|
67
67
|
}, 400);
|
|
68
68
|
});
|
|
69
69
|
return { loginByGoogle: async () => {
|
|
70
|
-
let
|
|
70
|
+
let g = { target: window.location.origin, stage: e, eventId: Date.now().toString(), action: "login", clientId: r }, c = `${a}?${new URLSearchParams(g).toString()}`, n = f({ url: c, name: "Google login" });
|
|
71
71
|
return await y(n);
|
|
72
72
|
}, loginByX: async () => {
|
|
73
|
-
let
|
|
73
|
+
let g = { target: window.location.origin, stage: e, eventId: Date.now().toString(), action: "login", clientId: l }, c = `${i}?${new URLSearchParams(g).toString()}`, n = f({ url: c, name: "X login" });
|
|
74
74
|
return await y(n);
|
|
75
75
|
}, loginByEmail: async (o) => {
|
|
76
76
|
if (!R(o)) throw new Error("Invalid email");
|
|
@@ -78,4 +78,4 @@ var Y = ({ stage: e, xClientId: g, googleClientId: r }) => {
|
|
|
78
78
|
} };
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
export {
|
|
81
|
+
export { C, L, O, S, Y, _, v, w, x };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getChainInfo, getFundingTokenAddress, DEFAULT_FUNDING_CHAIN_ID } from './chunk-
|
|
2
|
-
import { getChains, createOrder } from './chunk-
|
|
3
|
-
import { getEnv } from './chunk-
|
|
1
|
+
import { getChainInfo, getFundingTokenAddress, DEFAULT_FUNDING_CHAIN_ID } from './chunk-6AZQBNMY.js';
|
|
2
|
+
import { getChains, createOrder } from './chunk-E65LLR2W.js';
|
|
3
|
+
import { getEnv } from './chunk-R2D3SM4S.js';
|
|
4
4
|
import { sessionStore, createSessionCapabilityPolicy } from '@ab-org/sdk-core';
|
|
5
5
|
import { formatUnits } from 'viem';
|
|
6
6
|
|
|
@@ -246,9 +246,11 @@ async function fetchFundingTokenBalance(walletAddress, options) {
|
|
|
246
246
|
const FUNDING_TOKEN_SYMBOL = getEnv("FUNDING_TOKEN_SYMBOL");
|
|
247
247
|
const displaySymbol = options?.displaySymbol ?? (FUNDING_TOKEN_SYMBOL || "Funding");
|
|
248
248
|
const raw = await fetchErc20Balance(rpcUrl, tokenAddress, walletAddress);
|
|
249
|
+
const fullPrecision = formatUnits2(raw, decimals);
|
|
249
250
|
return {
|
|
250
251
|
raw,
|
|
251
252
|
formatted: formatBalanceDisplay(raw, decimals),
|
|
253
|
+
fullPrecision,
|
|
252
254
|
symbol: displaySymbol
|
|
253
255
|
};
|
|
254
256
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getExplorerUrl } from './chunk-XB2DFS2W.js';
|
|
2
|
-
import { getChains, registerPlatform, quote, getWithdrawOrder } from './chunk-
|
|
3
|
-
import { getEnv } from './chunk-
|
|
2
|
+
import { getChains, registerPlatform, quote, getWithdrawOrder } from './chunk-E65LLR2W.js';
|
|
3
|
+
import { getEnv } from './chunk-R2D3SM4S.js';
|
|
4
4
|
import { clientIds, stage } from './chunk-SV3NR2LW.js';
|
|
5
5
|
import { getSDKConfig } from './chunk-UPMVYXZ6.js';
|
|
6
|
+
import { Y } from './chunk-26R46ZBM.js';
|
|
6
7
|
import { cache_exports } from './chunk-YX56ZGDB.js';
|
|
7
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
import { useEffect, useState, useRef, useMemo, useCallback } from 'react';
|
|
@@ -225,7 +226,7 @@ async function loadWalletAccount() {
|
|
|
225
226
|
return import('./account-6PGNCFOX.js');
|
|
226
227
|
}
|
|
227
228
|
async function loadOidcAuth() {
|
|
228
|
-
return import('./dist-
|
|
229
|
+
return import('./dist-C3ENWBQI.js');
|
|
229
230
|
}
|
|
230
231
|
var SignInModalFrame = ({ id, title, onClose, footer, children }) => {
|
|
231
232
|
const isMobile = useIsMobileViewport();
|
|
@@ -303,14 +304,10 @@ var useSignInModalController = ({ wallets, initialVisibleCount, onGoogleLogin: _
|
|
|
303
304
|
const showExpandToggle = resolvedWallets.length > initialVisibleCount;
|
|
304
305
|
const visibleWallets = expanded ? resolvedWallets : resolvedWallets.slice(0, initialVisibleCount);
|
|
305
306
|
const isBusy = !!loadingProvider || !!loadingWalletId;
|
|
306
|
-
async function loadOidcAuth2() {
|
|
307
|
-
return import('./dist-Q2PDXT2F.js');
|
|
308
|
-
}
|
|
309
307
|
const handleSocialClick = async (providerId) => {
|
|
310
308
|
setLoadingProvider(providerId);
|
|
311
309
|
const cfg = getSDKConfig();
|
|
312
|
-
const {
|
|
313
|
-
const { loginByX, loginByGoogle } = OidcAuth({
|
|
310
|
+
const { loginByX, loginByGoogle } = Y({
|
|
314
311
|
stage,
|
|
315
312
|
xClientId: cfg.twitterClientId ?? clientIds.x ?? "",
|
|
316
313
|
googleClientId: cfg.googleClientId ?? clientIds.google ?? ""
|
|
@@ -1635,9 +1632,6 @@ var DepositModal = ({
|
|
|
1635
1632
|
onShowToast("Transfer confirmed");
|
|
1636
1633
|
}
|
|
1637
1634
|
}, [txHash, chain, onShowToast]);
|
|
1638
|
-
if (!session) {
|
|
1639
|
-
return /* @__PURE__ */ jsx(LoginRequiredOverlay, { title: "Deposit", onSignIn, onClose });
|
|
1640
|
-
}
|
|
1641
1635
|
const goToEntry = () => {
|
|
1642
1636
|
setView("entry");
|
|
1643
1637
|
onBack?.();
|
|
@@ -1652,6 +1646,9 @@ var DepositModal = ({
|
|
|
1652
1646
|
const t = setTimeout(() => setCopySuccessMessage(null), 2e3);
|
|
1653
1647
|
return () => clearTimeout(t);
|
|
1654
1648
|
}, [copySuccessMessage]);
|
|
1649
|
+
if (!session) {
|
|
1650
|
+
return /* @__PURE__ */ jsx(LoginRequiredOverlay, { title: "Deposit", onSignIn, onClose });
|
|
1651
|
+
}
|
|
1655
1652
|
return /* @__PURE__ */ jsxs(
|
|
1656
1653
|
ModalFrame2,
|
|
1657
1654
|
{
|
|
@@ -2328,6 +2325,7 @@ var WithdrawModal = ({
|
|
|
2328
2325
|
chain,
|
|
2329
2326
|
amount = "",
|
|
2330
2327
|
balance,
|
|
2328
|
+
balanceMax,
|
|
2331
2329
|
status = "idle",
|
|
2332
2330
|
receiveAmount: receiveAmountProp,
|
|
2333
2331
|
txHash,
|
|
@@ -2598,7 +2596,7 @@ var WithdrawModal = ({
|
|
|
2598
2596
|
const handleAmountChange = useCallback(
|
|
2599
2597
|
(e) => {
|
|
2600
2598
|
const raw = e.target.value;
|
|
2601
|
-
const maxNum =
|
|
2599
|
+
const maxNum = parseBalanceNumber(balanceMax ?? balance ?? "");
|
|
2602
2600
|
if (maxNum != null && raw !== "" && raw !== ".") {
|
|
2603
2601
|
const num = Number(raw);
|
|
2604
2602
|
if (!Number.isNaN(num) && num > maxNum) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { getOptionalEnv, setMerchantBaseUrl } from './chunk-
|
|
1
|
+
import { getOptionalEnv, setMerchantBaseUrl } from './chunk-R2D3SM4S.js';
|
|
2
2
|
import { getSDKConfig, initSDK } from './chunk-UPMVYXZ6.js';
|
|
3
|
-
import { sessionStore } from '@ab-org/sdk-core';
|
|
4
|
-
import { refreshCubeSignerSessionData } from '@ab-org/sdk-core/social/auth';
|
|
5
3
|
import axios from 'axios';
|
|
4
|
+
import { sessionStore } from '@ab-org/sdk-core';
|
|
6
5
|
|
|
7
6
|
// src/auth/bundledConfig.ts
|
|
8
7
|
function getBundledAuthConfig() {
|
|
@@ -10,6 +9,7 @@ function getBundledAuthConfig() {
|
|
|
10
9
|
const cubeEnv = getOptionalEnv("CUBE_SIGNER_ENV");
|
|
11
10
|
const cubeOrgId = getOptionalEnv("CUBE_SIGNER_ORG_ID");
|
|
12
11
|
const cubeLifetimes = getOptionalEnv("CUBE_SIGNER_LIFETIMES");
|
|
12
|
+
const lifetime = cubeLifetimes ? parseInt(cubeLifetimes) : 604800;
|
|
13
13
|
return {
|
|
14
14
|
googleClientId: getOptionalEnv("GOOGLE_CLIENT_ID"),
|
|
15
15
|
twitterClientId: getOptionalEnv("X_CLIENT_ID"),
|
|
@@ -18,9 +18,10 @@ function getBundledAuthConfig() {
|
|
|
18
18
|
env: cubeEnv,
|
|
19
19
|
orgId: cubeOrgId,
|
|
20
20
|
lifetimes: cubeLifetimes == void 0 ? void 0 : {
|
|
21
|
-
session:
|
|
22
|
-
auth:
|
|
23
|
-
refresh:
|
|
21
|
+
session: lifetime,
|
|
22
|
+
auth: Math.min(86400, lifetime),
|
|
23
|
+
refresh: lifetime,
|
|
24
|
+
grace: 30
|
|
24
25
|
}
|
|
25
26
|
} : void 0
|
|
26
27
|
};
|
|
@@ -89,62 +90,35 @@ async function defaultRegisterUser(oidcToken) {
|
|
|
89
90
|
throw new Error(`User register failed: ${body?.message || body?.error || body.code}`);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
-
// src/auth/config.ts
|
|
94
93
|
function getFixedAuthConfig() {
|
|
95
94
|
const bundled = getBundledAuthConfig();
|
|
96
95
|
return bundled;
|
|
97
96
|
}
|
|
98
|
-
var CUBE_KEEPALIVE_INTERVAL_MS = 5 * 60 * 1e3;
|
|
99
|
-
function getCubistKeepAliveIntervalMs() {
|
|
100
|
-
const rawValue = getOptionalEnv("CUBE_KEEPALIVE_INTERVAL_MS");
|
|
101
|
-
if (!rawValue) return CUBE_KEEPALIVE_INTERVAL_MS;
|
|
102
|
-
const parsed = Number.parseInt(rawValue, 10);
|
|
103
|
-
return Number.isFinite(parsed) && parsed > 0 ? parsed : CUBE_KEEPALIVE_INTERVAL_MS;
|
|
104
|
-
}
|
|
105
|
-
var cubistKeepAliveTimer = null;
|
|
106
|
-
var cubistKeepAlivePending = null;
|
|
107
97
|
function isCubistSession(session) {
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
return Boolean(
|
|
99
|
+
session && session.sessionData && (session.walletType === "social" || session.authSource === "google" || session.authSource === "twitter")
|
|
100
|
+
);
|
|
110
101
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
102
|
+
function notifyCubistSessionExpired(session) {
|
|
103
|
+
cubistSessionExpiredCallback?.(session);
|
|
113
104
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
...latestSession,
|
|
123
|
-
sessionData: refreshedSessionData
|
|
124
|
-
});
|
|
125
|
-
} catch (error) {
|
|
126
|
-
if (isAuthorizationError(error)) {
|
|
127
|
-
sessionStore.clearSession();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
105
|
+
var cubistSessionExpiredListenerCleanup = null;
|
|
106
|
+
var cubistSessionExpiredCallback;
|
|
107
|
+
function ensureCubistSessionExpiredListener() {
|
|
108
|
+
if (cubistSessionExpiredListenerCleanup) return;
|
|
109
|
+
cubistSessionExpiredListenerCleanup = sessionStore.on("session:expired", (session) => {
|
|
110
|
+
if (!isCubistSession(session)) return;
|
|
111
|
+
notifyCubistSessionExpired(session);
|
|
112
|
+
});
|
|
130
113
|
}
|
|
131
114
|
function scheduleAutoReconnect() {
|
|
132
115
|
if (typeof window === "undefined") return;
|
|
133
|
-
void import('./autoReconnect-
|
|
116
|
+
void import('./autoReconnect-GHZLB233.js').then(({ tryAutoReconnect }) => tryAutoReconnect()).catch(() => {
|
|
134
117
|
});
|
|
135
118
|
}
|
|
136
|
-
function scheduleCubistKeepAlive() {
|
|
137
|
-
if (typeof window === "undefined") return;
|
|
138
|
-
if (cubistKeepAliveTimer !== null) return;
|
|
139
|
-
const keepAliveIntervalMs = getCubistKeepAliveIntervalMs();
|
|
140
|
-
cubistKeepAliveTimer = window.setInterval(() => {
|
|
141
|
-
cubistKeepAlivePending ?? (cubistKeepAlivePending = refreshActiveCubistSession().finally(() => {
|
|
142
|
-
cubistKeepAlivePending = null;
|
|
143
|
-
}));
|
|
144
|
-
}, keepAliveIntervalMs);
|
|
145
|
-
}
|
|
146
119
|
function initSDK2(config = {}) {
|
|
147
|
-
const { merchantBaseUrl, registerUser, ...rest } = config;
|
|
120
|
+
const { merchantBaseUrl, registerUser, onSessionExpired, ...rest } = config;
|
|
121
|
+
cubistSessionExpiredCallback = onSessionExpired;
|
|
148
122
|
const fixed = getFixedAuthConfig();
|
|
149
123
|
const prev = getSDKConfig();
|
|
150
124
|
const merged = {
|
|
@@ -179,8 +153,10 @@ function initSDK2(config = {}) {
|
|
|
179
153
|
setMerchantBaseUrl(merchantBaseUrl);
|
|
180
154
|
}
|
|
181
155
|
initSDK(merged);
|
|
156
|
+
ensureCubistSessionExpiredListener();
|
|
157
|
+
sessionStore.flushPendingExpiry();
|
|
158
|
+
sessionStore.startExpiryTimer();
|
|
182
159
|
scheduleAutoReconnect();
|
|
183
|
-
scheduleCubistKeepAlive();
|
|
184
160
|
}
|
|
185
161
|
function getSDKConfig2() {
|
|
186
162
|
return getSDKConfig();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/core.ts
|
|
2
2
|
function tryAutoReconnect() {
|
|
3
|
-
return import('./autoReconnect-
|
|
3
|
+
return import('./autoReconnect-GHZLB233.js').then(({ tryAutoReconnect: reconnect }) => reconnect());
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export { tryAutoReconnect };
|
|
@@ -34,6 +34,8 @@ function readProcessEnvStatic(key) {
|
|
|
34
34
|
process.env.NEXT_PUBLIC_CUBE_KEEPALIVE_INTERVAL_MS,
|
|
35
35
|
process.env.CUBE_KEEPALIVE_INTERVAL_MS
|
|
36
36
|
);
|
|
37
|
+
case "FUNDING_CHAIN_ID":
|
|
38
|
+
return pick(process.env.NEXT_PUBLIC_FUNDING_CHAIN_ID, process.env.FUNDING_CHAIN_ID) || "3131";
|
|
37
39
|
case "FUNDING_TOKEN_SYMBOL":
|
|
38
40
|
return pick(process.env.NEXT_PUBLIC_FUNDING_TOKEN_SYMBOL, process.env.FUNDING_TOKEN_SYMBOL) || "USDT";
|
|
39
41
|
default:
|
package/dist/core.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare function getFixedAuthConfig(): Partial<SDKConfig>;
|
|
|
26
26
|
interface PredicateSDKConfig extends Partial<SDKConfig> {
|
|
27
27
|
merchantBaseUrl?: string;
|
|
28
28
|
registerUser?: (oidcToken: string) => Promise<void>;
|
|
29
|
+
onSessionExpired?: (session: WalletSession) => void;
|
|
29
30
|
}
|
|
30
31
|
declare function initSDK(config?: PredicateSDKConfig): void;
|
|
31
32
|
declare function getSDKConfig(): Readonly<SDKConfig>;
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { tryAutoReconnect } from './chunk-
|
|
2
|
-
export { ClientIds, DEFAULT_FUNDING_CHAIN_ID, DEFAULT_FUNDING_TOKEN_ADDRESS, getChainInfo, getFundingTokenAddress } from './chunk-
|
|
1
|
+
export { tryAutoReconnect } from './chunk-GIPWCNYS.js';
|
|
2
|
+
export { ClientIds, DEFAULT_FUNDING_CHAIN_ID, DEFAULT_FUNDING_TOKEN_ADDRESS, getChainInfo, getFundingTokenAddress } from './chunk-6AZQBNMY.js';
|
|
3
3
|
export { getExplorerUrl } from './chunk-XB2DFS2W.js';
|
|
4
|
-
export { getFixedAuthConfig, getSDKConfig, initSDK } from './chunk-
|
|
5
|
-
export { getEnv } from './chunk-
|
|
4
|
+
export { getFixedAuthConfig, getSDKConfig, initSDK } from './chunk-E3UPFA4K.js';
|
|
5
|
+
export { getEnv } from './chunk-R2D3SM4S.js';
|
|
6
6
|
import './chunk-UPMVYXZ6.js';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { notifyTwitterCallback } from './chunk-ZS6FNG2D.js';
|
|
2
|
-
export { tryAutoReconnect } from './chunk-
|
|
3
|
-
export { createDepositController, createFundingWithdrawExecutor, createMarketDataProvider, createPredicateMarketPolicyAdapter, createWithdrawController, fetchErc20Balance, fetchFundingTokenBalance, findTokenDataFromChains, isUsdtWithdrawDirect, parseUnits } from './chunk-
|
|
4
|
-
export { ClientIds, DEFAULT_FUNDING_CHAIN_ID, DEFAULT_FUNDING_TOKEN_ADDRESS, getChainInfo, getFundingTokenAddress } from './chunk-
|
|
5
|
-
export { DepositDetailsPanel, DepositModal, DropdownField, SignInModal, Toast, WalletAccount, WalletSelectionModal, WithdrawModal, clearSocialAccountInstance } from './chunk-
|
|
2
|
+
export { tryAutoReconnect } from './chunk-GIPWCNYS.js';
|
|
3
|
+
export { createDepositController, createFundingWithdrawExecutor, createMarketDataProvider, createPredicateMarketPolicyAdapter, createWithdrawController, fetchErc20Balance, fetchFundingTokenBalance, findTokenDataFromChains, isUsdtWithdrawDirect, parseUnits } from './chunk-4XO4Z5TC.js';
|
|
4
|
+
export { ClientIds, DEFAULT_FUNDING_CHAIN_ID, DEFAULT_FUNDING_TOKEN_ADDRESS, getChainInfo, getFundingTokenAddress } from './chunk-6AZQBNMY.js';
|
|
5
|
+
export { DepositDetailsPanel, DepositModal, DropdownField, SignInModal, Toast, WalletAccount, WalletSelectionModal, WithdrawModal, clearSocialAccountInstance } from './chunk-BLUBNFON.js';
|
|
6
6
|
export { getExplorerUrl } from './chunk-XB2DFS2W.js';
|
|
7
|
-
export { configureMerchantApi, createOrder, getChains, getDepositOrder, getMerchantApiClient, getWithdrawOrder, quote, registerPlatform } from './chunk-
|
|
8
|
-
export { getFixedAuthConfig, getSDKConfig, initSDK } from './chunk-
|
|
9
|
-
export { getEnv } from './chunk-
|
|
7
|
+
export { configureMerchantApi, createOrder, getChains, getDepositOrder, getMerchantApiClient, getWithdrawOrder, quote, registerPlatform } from './chunk-E65LLR2W.js';
|
|
8
|
+
export { getFixedAuthConfig, getSDKConfig, initSDK } from './chunk-E3UPFA4K.js';
|
|
9
|
+
export { getEnv } from './chunk-R2D3SM4S.js';
|
|
10
10
|
import './chunk-SV3NR2LW.js';
|
|
11
11
|
import './chunk-UPMVYXZ6.js';
|
|
12
|
+
import './chunk-26R46ZBM.js';
|
|
12
13
|
import './chunk-YX56ZGDB.js';
|
package/dist/merchant.d.ts
CHANGED
package/dist/merchant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createDepositController, createFundingWithdrawExecutor, createMarketDataProvider, createPredicateMarketPolicyAdapter, createWithdrawController, fetchErc20Balance, fetchFundingTokenBalance, findTokenDataFromChains, isUsdtWithdrawDirect, parseUnits } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
export { configureMerchantApi, createOrder, getChains, getDepositOrder, getMerchantApiClient, getWithdrawOrder, quote, registerPlatform } from './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { createDepositController, createFundingWithdrawExecutor, createMarketDataProvider, createPredicateMarketPolicyAdapter, createWithdrawController, fetchErc20Balance, fetchFundingTokenBalance, findTokenDataFromChains, isUsdtWithdrawDirect, parseUnits } from './chunk-4XO4Z5TC.js';
|
|
2
|
+
import './chunk-6AZQBNMY.js';
|
|
3
|
+
export { configureMerchantApi, createOrder, getChains, getDepositOrder, getMerchantApiClient, getWithdrawOrder, quote, registerPlatform } from './chunk-E65LLR2W.js';
|
|
4
|
+
import './chunk-R2D3SM4S.js';
|
package/dist/react.d.ts
CHANGED
|
@@ -137,6 +137,7 @@ interface WithdrawModalProps {
|
|
|
137
137
|
chain?: string;
|
|
138
138
|
amount?: string;
|
|
139
139
|
balance?: string;
|
|
140
|
+
balanceMax?: string;
|
|
140
141
|
status?: WithdrawUiStatus;
|
|
141
142
|
receiveAmount?: string;
|
|
142
143
|
txHash?: string;
|
|
@@ -182,7 +183,7 @@ interface WithdrawModalProps {
|
|
|
182
183
|
onSignIn?: () => void;
|
|
183
184
|
onClose?: () => void;
|
|
184
185
|
}
|
|
185
|
-
declare const WithdrawModal: ({ address, token, tokenSymbol, chain, amount, balance, status, receiveAmount: receiveAmountProp, txHash, tokenOptions: tokenOptionsProp, chainOptions: chainOptionsProp, useMerchantApi, orderId, withdrawMode, withdrawDirectResult, feeDisplay, fundingChainId, onShowToast, onAddressChange, onTokenSelect, onChainSelect, onAmountChange, onMaxClick, onSubmit, onWithdrawCompleted, onStartAnotherWithdrawal, onSignIn, onClose, }: WithdrawModalProps) => react_jsx_runtime.JSX.Element;
|
|
186
|
+
declare const WithdrawModal: ({ address, token, tokenSymbol, chain, amount, balance, balanceMax, status, receiveAmount: receiveAmountProp, txHash, tokenOptions: tokenOptionsProp, chainOptions: chainOptionsProp, useMerchantApi, orderId, withdrawMode, withdrawDirectResult, feeDisplay, fundingChainId, onShowToast, onAddressChange, onTokenSelect, onChainSelect, onAmountChange, onMaxClick, onSubmit, onWithdrawCompleted, onStartAnotherWithdrawal, onSignIn, onClose, }: WithdrawModalProps) => react_jsx_runtime.JSX.Element;
|
|
186
187
|
|
|
187
188
|
interface DepositDetailsPanelProps {
|
|
188
189
|
address: string;
|
package/dist/react.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { DepositDetailsPanel, DepositModal, DropdownField, SignInModal, Toast, WalletAccount, WalletSelectionModal, WithdrawModal, clearSocialAccountInstance } from './chunk-
|
|
1
|
+
export { DepositDetailsPanel, DepositModal, DropdownField, SignInModal, Toast, WalletAccount, WalletSelectionModal, WithdrawModal, clearSocialAccountInstance } from './chunk-BLUBNFON.js';
|
|
2
2
|
import './chunk-XB2DFS2W.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-E65LLR2W.js';
|
|
4
|
+
import './chunk-R2D3SM4S.js';
|
|
5
5
|
import './chunk-SV3NR2LW.js';
|
|
6
6
|
import './chunk-UPMVYXZ6.js';
|
|
7
|
+
import './chunk-26R46ZBM.js';
|
|
7
8
|
import './chunk-YX56ZGDB.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ab-org/predicate-market-sdk",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"axios": "^1.13.6",
|
|
40
40
|
"qrcode-generator": "^2.0.4",
|
|
41
41
|
"viem": "2.21.54",
|
|
42
|
-
"@ab-org/sdk-core": "0.3.0-beta.
|
|
42
|
+
"@ab-org/sdk-core": "0.3.0-beta.6"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=18"
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@types/react": "^18.2.66",
|
|
49
49
|
"typescript": "^5.5.4",
|
|
50
50
|
"tsup": "^8.5.1",
|
|
51
|
-
"@ab-org/chains-service": "0.0.8",
|
|
52
51
|
"@ab-org/oidc-auth": "0.0.16",
|
|
52
|
+
"@ab-org/chains-service": "0.0.8",
|
|
53
53
|
"@ab-org/sign-in-sdk": "0.1.0",
|
|
54
|
-
"@ab-org/wallet-utils": "0.0.
|
|
54
|
+
"@ab-org/wallet-utils": "0.1.0-beta.1"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "pnpm exec tsup",
|