@trustware/sdk-staging 1.1.8-staging.7 → 1.1.9-staging.1
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/README.md +0 -2
- package/dist/{blockchain-BONedEsU.d.cts → blockchain-BxAFzp0s.d.cts} +5 -1
- package/dist/{blockchain-BONedEsU.d.ts → blockchain-BxAFzp0s.d.ts} +5 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{core-DnrIv4h8.d.ts → core-D_jx805U.d.cts} +33 -5
- package/dist/{core-BUe031hU.d.cts → core-p_5BLdbE.d.ts} +33 -5
- package/dist/core.cjs +549 -80
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +4 -4
- package/dist/core.d.ts +4 -4
- package/dist/core.mjs +550 -81
- package/dist/core.mjs.map +1 -1
- package/dist/{detect-DlbgTrkm.d.cts → detect--pmNlAHv.d.cts} +1 -1
- package/dist/{detect-MWKHLhn9.d.ts → detect-qAX6I4JI.d.ts} +1 -1
- package/dist/index.cjs +2380 -1674
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.mjs +2090 -1383
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-aOd3vkF9.d.ts → manager-DFQkemW0.d.ts} +1 -3
- package/dist/{manager-DKVW7zeh.d.cts → manager-aMi4_Ss6.d.cts} +1 -3
- package/dist/smart-account.cjs +1 -2
- package/dist/smart-account.cjs.map +1 -1
- package/dist/smart-account.d.cts +24 -24
- package/dist/smart-account.d.ts +24 -24
- package/dist/smart-account.mjs +1 -2
- package/dist/smart-account.mjs.map +1 -1
- package/dist/{types-MtdjJgwT.d.ts → types-BJY9r-mz.d.ts} +1 -1
- package/dist/{types-B3nKHW6H.d.cts → types-DX3HtFcn.d.cts} +1 -1
- package/dist/wallet.cjs +22 -7
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +4 -4
- package/dist/wallet.d.ts +4 -4
- package/dist/wallet.mjs +22 -7
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +2340 -1634
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.d.cts +2 -2
- package/dist/widget.d.ts +2 -2
- package/dist/widget.mjs +2050 -1343
- package/dist/widget.mjs.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -105,7 +105,6 @@ type TrustwareConfigOptions = {
|
|
|
105
105
|
fromAddress?: string;
|
|
106
106
|
toAddress?: string;
|
|
107
107
|
defaultSlippage?: number;
|
|
108
|
-
routeType?: string;
|
|
109
108
|
options?: {
|
|
110
109
|
routeRefreshMs?: number;
|
|
111
110
|
fixedFromAmount?: string | number;
|
|
@@ -132,7 +131,6 @@ type TrustwareConfigOptions = {
|
|
|
132
131
|
- `routes.fromAddress`: optional source wallet override.
|
|
133
132
|
- `routes.toAddress`: optional destination address override.
|
|
134
133
|
- `routes.defaultSlippage`: optional slippage percentage. Defaults to `1`.
|
|
135
|
-
- `routes.routeType`: optional route flavor. Defaults to `"swap"`.
|
|
136
134
|
|
|
137
135
|
### Route Options
|
|
138
136
|
|
|
@@ -52,6 +52,10 @@ type BalanceStreamOptions = {
|
|
|
52
52
|
signal?: AbortSignal;
|
|
53
53
|
strict?: boolean;
|
|
54
54
|
};
|
|
55
|
+
type GetBalancesOptions = {
|
|
56
|
+
/** Bypass the in-memory balance cache and re-fetch fresh data from the network. */
|
|
57
|
+
forceRefresh?: boolean;
|
|
58
|
+
};
|
|
55
59
|
type ChainType = "evm" | "cosmos" | "solana" | "btc" | string;
|
|
56
60
|
interface NativeCurrency {
|
|
57
61
|
symbol: string;
|
|
@@ -107,4 +111,4 @@ type TokenWithBalance = TokenDef & {
|
|
|
107
111
|
balance?: bigint;
|
|
108
112
|
};
|
|
109
113
|
|
|
110
|
-
export type { BalanceRow as B, ChainDef as C, NativeCurrency as N, TokenDef as T, WalletAddressBalanceWrapper as W, BalanceStreamOptions as a, ChainMeta as b, ChainType as c, TokenMeta as d, TokenPageInfo as e, TokenPageOptions as f, TokenPageResult as g, TokenType as h, TokenWithBalance as i };
|
|
114
|
+
export type { BalanceRow as B, ChainDef as C, GetBalancesOptions as G, NativeCurrency as N, TokenDef as T, WalletAddressBalanceWrapper as W, BalanceStreamOptions as a, ChainMeta as b, ChainType as c, TokenMeta as d, TokenPageInfo as e, TokenPageOptions as f, TokenPageResult as g, TokenType as h, TokenWithBalance as i };
|
|
@@ -52,6 +52,10 @@ type BalanceStreamOptions = {
|
|
|
52
52
|
signal?: AbortSignal;
|
|
53
53
|
strict?: boolean;
|
|
54
54
|
};
|
|
55
|
+
type GetBalancesOptions = {
|
|
56
|
+
/** Bypass the in-memory balance cache and re-fetch fresh data from the network. */
|
|
57
|
+
forceRefresh?: boolean;
|
|
58
|
+
};
|
|
55
59
|
type ChainType = "evm" | "cosmos" | "solana" | "btc" | string;
|
|
56
60
|
interface NativeCurrency {
|
|
57
61
|
symbol: string;
|
|
@@ -107,4 +111,4 @@ type TokenWithBalance = TokenDef & {
|
|
|
107
111
|
balance?: bigint;
|
|
108
112
|
};
|
|
109
113
|
|
|
110
|
-
export type { BalanceRow as B, ChainDef as C, NativeCurrency as N, TokenDef as T, WalletAddressBalanceWrapper as W, BalanceStreamOptions as a, ChainMeta as b, ChainType as c, TokenMeta as d, TokenPageInfo as e, TokenPageOptions as f, TokenPageResult as g, TokenType as h, TokenWithBalance as i };
|
|
114
|
+
export type { BalanceRow as B, ChainDef as C, GetBalancesOptions as G, NativeCurrency as N, TokenDef as T, WalletAddressBalanceWrapper as W, BalanceStreamOptions as a, ChainMeta as b, ChainType as c, TokenMeta as d, TokenPageInfo as e, TokenPageOptions as f, TokenPageResult as g, TokenType as h, TokenWithBalance as i };
|
package/dist/constants.cjs
CHANGED
|
@@ -30,7 +30,7 @@ __export(constants_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(constants_exports);
|
|
32
32
|
var SDK_NAME = "@trustware/sdk";
|
|
33
|
-
var SDK_VERSION = "1.1.
|
|
33
|
+
var SDK_VERSION = "1.1.9-staging.1";
|
|
34
34
|
var API_ROOT = "https://bv-staging-api.trustware.io";
|
|
35
35
|
var GTM_ID = "GTM-TZDGNCXB";
|
|
36
36
|
var API_PREFIX = "/api";
|
package/dist/constants.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BuildRouteResult, T as Transaction, v as TrustwareConfigOptions, P as WalletInterFaceAPI, j as ResolvedTrustwareConfig, M as WalletIdentity, a7 as walletManager, C as WalletAddressResolution, X as buildRoute, V as buildDepositAddress, a1 as submitReceipt, _ as getStatus, $ as pollStatus } from './manager-
|
|
2
|
-
import { C as ChainDef, c as ChainType, B as BalanceRow, a as BalanceStreamOptions, W as WalletAddressBalanceWrapper } from './blockchain-
|
|
3
|
-
import { T as Token } from './types-
|
|
1
|
+
import { B as BuildRouteResult, T as Transaction, v as TrustwareConfigOptions, P as WalletInterFaceAPI, j as ResolvedTrustwareConfig, y as TrustwareTheme, M as WalletIdentity, a7 as walletManager, C as WalletAddressResolution, X as buildRoute, V as buildDepositAddress, a1 as submitReceipt, _ as getStatus, $ as pollStatus } from './manager-aMi4_Ss6.cjs';
|
|
2
|
+
import { C as ChainDef, c as ChainType, G as GetBalancesOptions, B as BalanceRow, a as BalanceStreamOptions, W as WalletAddressBalanceWrapper } from './blockchain-BxAFzp0s.cjs';
|
|
3
|
+
import { T as Token } from './types-DX3HtFcn.cjs';
|
|
4
4
|
|
|
5
5
|
type AddressValidationResult = {
|
|
6
6
|
isValid: boolean;
|
|
@@ -21,7 +21,7 @@ declare function validateRouteAddresses(params: {
|
|
|
21
21
|
}): AddressValidationResult;
|
|
22
22
|
|
|
23
23
|
/** Map chain reference -> backend chain_key and return enriched balances */
|
|
24
|
-
declare function getBalances(chainRef: string | number, address: string): Promise<BalanceRow[]>;
|
|
24
|
+
declare function getBalances(chainRef: string | number, address: string, opts?: GetBalancesOptions): Promise<BalanceRow[]>;
|
|
25
25
|
declare function getBalancesByAddress(address: string, opts?: BalanceStreamOptions): Promise<WalletAddressBalanceWrapper[]>;
|
|
26
26
|
declare function getBalancesByAddressStream(address: string, opts?: BalanceStreamOptions): AsyncGenerator<WalletAddressBalanceWrapper[], void, void>;
|
|
27
27
|
|
|
@@ -38,7 +38,7 @@ declare function runTopUp(params: {
|
|
|
38
38
|
interface UseChainsResult {
|
|
39
39
|
/** All available chains */
|
|
40
40
|
chains: ChainDef[];
|
|
41
|
-
/** Popular/featured chains
|
|
41
|
+
/** Popular/featured chains ranked by TVL */
|
|
42
42
|
popularChains: ChainDef[];
|
|
43
43
|
/** Other chains (not in popular list) */
|
|
44
44
|
otherChains: ChainDef[];
|
|
@@ -85,6 +85,34 @@ declare const Trustware: {
|
|
|
85
85
|
autoDetect(_timeoutMs?: number): Promise<boolean>;
|
|
86
86
|
/** Read resolved config */
|
|
87
87
|
getConfig(): ResolvedTrustwareConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Read the SDK's currently configured theme mode.
|
|
90
|
+
*
|
|
91
|
+
* Returns the raw setting — `"light" | "dark" | "system"` — i.e. whatever
|
|
92
|
+
* was last passed to `init()` or `setTheme()`. When the mode is `"system"`,
|
|
93
|
+
* the widget resolves the actual light/dark appearance itself (from the OS
|
|
94
|
+
* `prefers-color-scheme`, or a saved preference if the user has used the
|
|
95
|
+
* widget's built-in theme toggle), so this getter still reports `"system"`
|
|
96
|
+
* rather than the resolved value.
|
|
97
|
+
*/
|
|
98
|
+
getTheme(): TrustwareTheme;
|
|
99
|
+
/**
|
|
100
|
+
* Set the widget's theme at runtime.
|
|
101
|
+
*
|
|
102
|
+
* Call this from your own app's theme toggle to keep an embedded
|
|
103
|
+
* `TrustwareWidget` in sync with your UI — no remount required, any
|
|
104
|
+
* mounted widget picks up the change immediately.
|
|
105
|
+
*
|
|
106
|
+
* Passing `"light"` or `"dark"` pins the widget to that mode. Passing
|
|
107
|
+
* `"system"` makes it follow the OS preference again — unless the user
|
|
108
|
+
* previously used the widget's own in-widget theme toggle, in which case
|
|
109
|
+
* their saved choice takes precedence until they toggle it again.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // In your app's own dark-mode toggle handler:
|
|
113
|
+
* Trustware.setTheme(isDark ? "dark" : "light");
|
|
114
|
+
*/
|
|
115
|
+
setTheme(theme: TrustwareTheme): /*elided*/ any;
|
|
88
116
|
setDestinationAddress(address?: string | null): /*elided*/ any;
|
|
89
117
|
setDestinationChain(chain: string): /*elided*/ any;
|
|
90
118
|
setDestinationToken(token: string): /*elided*/ any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BuildRouteResult, T as Transaction, v as TrustwareConfigOptions, P as WalletInterFaceAPI, j as ResolvedTrustwareConfig, M as WalletIdentity, a7 as walletManager, C as WalletAddressResolution, X as buildRoute, V as buildDepositAddress, a1 as submitReceipt, _ as getStatus, $ as pollStatus } from './manager-
|
|
2
|
-
import { C as ChainDef, c as ChainType, B as BalanceRow, a as BalanceStreamOptions, W as WalletAddressBalanceWrapper } from './blockchain-
|
|
3
|
-
import { T as Token } from './types-
|
|
1
|
+
import { B as BuildRouteResult, T as Transaction, v as TrustwareConfigOptions, P as WalletInterFaceAPI, j as ResolvedTrustwareConfig, y as TrustwareTheme, M as WalletIdentity, a7 as walletManager, C as WalletAddressResolution, X as buildRoute, V as buildDepositAddress, a1 as submitReceipt, _ as getStatus, $ as pollStatus } from './manager-DFQkemW0.js';
|
|
2
|
+
import { C as ChainDef, c as ChainType, G as GetBalancesOptions, B as BalanceRow, a as BalanceStreamOptions, W as WalletAddressBalanceWrapper } from './blockchain-BxAFzp0s.js';
|
|
3
|
+
import { T as Token } from './types-BJY9r-mz.js';
|
|
4
4
|
|
|
5
5
|
type AddressValidationResult = {
|
|
6
6
|
isValid: boolean;
|
|
@@ -21,7 +21,7 @@ declare function validateRouteAddresses(params: {
|
|
|
21
21
|
}): AddressValidationResult;
|
|
22
22
|
|
|
23
23
|
/** Map chain reference -> backend chain_key and return enriched balances */
|
|
24
|
-
declare function getBalances(chainRef: string | number, address: string): Promise<BalanceRow[]>;
|
|
24
|
+
declare function getBalances(chainRef: string | number, address: string, opts?: GetBalancesOptions): Promise<BalanceRow[]>;
|
|
25
25
|
declare function getBalancesByAddress(address: string, opts?: BalanceStreamOptions): Promise<WalletAddressBalanceWrapper[]>;
|
|
26
26
|
declare function getBalancesByAddressStream(address: string, opts?: BalanceStreamOptions): AsyncGenerator<WalletAddressBalanceWrapper[], void, void>;
|
|
27
27
|
|
|
@@ -38,7 +38,7 @@ declare function runTopUp(params: {
|
|
|
38
38
|
interface UseChainsResult {
|
|
39
39
|
/** All available chains */
|
|
40
40
|
chains: ChainDef[];
|
|
41
|
-
/** Popular/featured chains
|
|
41
|
+
/** Popular/featured chains ranked by TVL */
|
|
42
42
|
popularChains: ChainDef[];
|
|
43
43
|
/** Other chains (not in popular list) */
|
|
44
44
|
otherChains: ChainDef[];
|
|
@@ -85,6 +85,34 @@ declare const Trustware: {
|
|
|
85
85
|
autoDetect(_timeoutMs?: number): Promise<boolean>;
|
|
86
86
|
/** Read resolved config */
|
|
87
87
|
getConfig(): ResolvedTrustwareConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Read the SDK's currently configured theme mode.
|
|
90
|
+
*
|
|
91
|
+
* Returns the raw setting — `"light" | "dark" | "system"` — i.e. whatever
|
|
92
|
+
* was last passed to `init()` or `setTheme()`. When the mode is `"system"`,
|
|
93
|
+
* the widget resolves the actual light/dark appearance itself (from the OS
|
|
94
|
+
* `prefers-color-scheme`, or a saved preference if the user has used the
|
|
95
|
+
* widget's built-in theme toggle), so this getter still reports `"system"`
|
|
96
|
+
* rather than the resolved value.
|
|
97
|
+
*/
|
|
98
|
+
getTheme(): TrustwareTheme;
|
|
99
|
+
/**
|
|
100
|
+
* Set the widget's theme at runtime.
|
|
101
|
+
*
|
|
102
|
+
* Call this from your own app's theme toggle to keep an embedded
|
|
103
|
+
* `TrustwareWidget` in sync with your UI — no remount required, any
|
|
104
|
+
* mounted widget picks up the change immediately.
|
|
105
|
+
*
|
|
106
|
+
* Passing `"light"` or `"dark"` pins the widget to that mode. Passing
|
|
107
|
+
* `"system"` makes it follow the OS preference again — unless the user
|
|
108
|
+
* previously used the widget's own in-widget theme toggle, in which case
|
|
109
|
+
* their saved choice takes precedence until they toggle it again.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // In your app's own dark-mode toggle handler:
|
|
113
|
+
* Trustware.setTheme(isDark ? "dark" : "light");
|
|
114
|
+
*/
|
|
115
|
+
setTheme(theme: TrustwareTheme): /*elided*/ any;
|
|
88
116
|
setDestinationAddress(address?: string | null): /*elided*/ any;
|
|
89
117
|
setDestinationChain(chain: string): /*elided*/ any;
|
|
90
118
|
setDestinationToken(token: string): /*elided*/ any;
|