@trustware/sdk-staging 1.1.9-staging.6 → 1.1.10-staging.0
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/LICENSE +5 -4
- package/README.md +32 -1
- package/THIRD_PARTY_NOTICES.md +118 -0
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{core-BTPkApRH.d.cts → core-B7Ez-5-r.d.cts} +3 -2
- package/dist/{core-2oZuxC1J.d.ts → core-BPLiD1UG.d.ts} +3 -2
- package/dist/core.cjs +246 -48
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.mjs +247 -48
- package/dist/core.mjs.map +1 -1
- package/dist/index.cjs +300 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +325 -103
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-BMO1O-cW.d.ts → manager-B6NNV-E_.d.ts} +129 -18
- package/dist/{manager-BZwbtOyf.d.cts → manager-BwjyFjjz.d.cts} +129 -18
- package/dist/{detect-B8xXLwHK.d.ts → metadata-BiTMMvlY.d.ts} +5 -2
- package/dist/{detect-C8xpZRrL.d.cts → metadata-HCflXcsF.d.cts} +5 -2
- package/dist/smart-account.cjs +117 -39
- package/dist/smart-account.cjs.map +1 -1
- package/dist/smart-account.d.cts +235 -222
- package/dist/smart-account.d.ts +235 -222
- package/dist/smart-account.mjs +117 -39
- package/dist/smart-account.mjs.map +1 -1
- package/dist/wallet.cjs +113 -36
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +4 -7
- package/dist/wallet.d.ts +4 -7
- package/dist/wallet.mjs +113 -36
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +239 -54
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.mjs +267 -81
- package/dist/widget.mjs.map +1 -1
- package/package.json +3 -2
package/LICENSE
CHANGED
|
@@ -182,11 +182,12 @@
|
|
|
182
182
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
183
|
replaced with your own identifying information. (Don't include
|
|
184
184
|
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format.
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
188
189
|
|
|
189
|
-
Copyright 2026
|
|
190
|
+
Copyright 2026 trustware.io (contact@trustware.io)
|
|
190
191
|
|
|
191
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
193
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -93,11 +93,13 @@ export function App() {
|
|
|
93
93
|
|
|
94
94
|
## Config Reference
|
|
95
95
|
|
|
96
|
-
`TrustwareConfigOptions` is the single source of truth. The
|
|
96
|
+
`TrustwareConfigOptions` is the single source of truth. The shape is a discriminated union
|
|
97
|
+
keyed on `mode` — `routes` is only required in the default `"deposit"` mode:
|
|
97
98
|
|
|
98
99
|
```ts
|
|
99
100
|
type TrustwareConfigOptions = {
|
|
100
101
|
apiKey: string;
|
|
102
|
+
mode?: "deposit"; // default, omit this field entirely for a normal deposit/top-up widget
|
|
101
103
|
routes: {
|
|
102
104
|
toChain: string;
|
|
103
105
|
toToken: string;
|
|
@@ -117,12 +119,40 @@ type TrustwareConfigOptions = {
|
|
|
117
119
|
messages?: Partial<TrustwareWidgetMessages>;
|
|
118
120
|
retry?: RetryConfig;
|
|
119
121
|
walletConnect?: WalletConnectConfig;
|
|
122
|
+
features?: FeatureFlags;
|
|
120
123
|
onError?: (error: TrustwareError) => void;
|
|
121
124
|
onSuccess?: (transaction: Transaction) => void;
|
|
122
125
|
onEvent?: (event: TrustwareEvent) => void;
|
|
126
|
+
} | {
|
|
127
|
+
apiKey: string;
|
|
128
|
+
mode: "swap"; // swap widget — from/to chain+token are chosen entirely in-widget
|
|
129
|
+
routes?: Partial<TrustwareConfigOptions["routes"]>; // optional, not required
|
|
130
|
+
// ...same common fields as above
|
|
123
131
|
};
|
|
124
132
|
```
|
|
125
133
|
|
|
134
|
+
### Modes
|
|
135
|
+
|
|
136
|
+
- **`"deposit"`** (default — `mode` can be omitted): the standard bridge/top-up widget.
|
|
137
|
+
`routes.toChain` and `routes.toToken` are required.
|
|
138
|
+
- **`"swap"`**: an in-widget token swap UI where the user picks both sides themselves.
|
|
139
|
+
`routes` is not required at all:
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
const trustwareConfig = {
|
|
143
|
+
apiKey: process.env.NEXT_PUBLIC_TRUSTWARE_API_KEY!,
|
|
144
|
+
mode: "swap",
|
|
145
|
+
} satisfies TrustwareConfigOptions;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Use `features.swapDefaultDestToken` / `features.swapLockDestToken` /
|
|
149
|
+
`features.swapAllowedDestTokens` to steer the destination token selection (see
|
|
150
|
+
`FeatureFlags` in `src/types/config.ts`).
|
|
151
|
+
|
|
152
|
+
> The older `features: { swapMode: true }` flag (combined with a `routes` object) still
|
|
153
|
+
> works and is treated as equivalent to `mode: "swap"`, but is deprecated in favor of the
|
|
154
|
+
> `mode` field above.
|
|
155
|
+
|
|
126
156
|
### Route Fields
|
|
127
157
|
|
|
128
158
|
- `routes.toChain`: destination chain key or chain id string.
|
|
@@ -146,6 +176,7 @@ type TrustwareConfigOptions = {
|
|
|
146
176
|
- `messages`: top-level copy overrides.
|
|
147
177
|
- `retry`: API retry and rate-limit behavior.
|
|
148
178
|
- `walletConnect`: WalletConnect overrides.
|
|
179
|
+
- `features`: feature rollout controls, including swap-mode token selection constraints.
|
|
149
180
|
- `onError`, `onSuccess`, `onEvent`: lifecycle callbacks.
|
|
150
181
|
|
|
151
182
|
## Widget Usage Patterns
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
The Trustware SDK (`@trustware/sdk`) is licensed under the Apache License,
|
|
4
|
+
Version 2.0 (see `LICENSE`). The published bundle incorporates code from the
|
|
5
|
+
third-party open source packages listed below. Their license terms and
|
|
6
|
+
copyright notices are reproduced here as required by their respective
|
|
7
|
+
licenses.
|
|
8
|
+
|
|
9
|
+
This file covers code compiled **into** the SDK bundle. Packages installed
|
|
10
|
+
alongside the SDK as npm dependencies (`@reown/appkit`, `@reown/appkit-common`,
|
|
11
|
+
`@reown/appkit-universal-connector`, `@solana/web3.js`) and peer dependencies
|
|
12
|
+
(`react`, `react-dom`, `viem`) are distributed separately by their respective
|
|
13
|
+
owners under their own licenses and carry their own license files. Note that
|
|
14
|
+
the `@reown/appkit*` packages are licensed under the Reown Community License
|
|
15
|
+
Agreement, which is **not** an open source license; see the `LICENSE.md` file
|
|
16
|
+
in those packages for its terms.
|
|
17
|
+
|
|
18
|
+
## Bundled packages
|
|
19
|
+
|
|
20
|
+
| Package | License | Copyright |
|
|
21
|
+
|---------|---------|-----------|
|
|
22
|
+
| `@aa-sdk/core` | MIT | © 2023 Alchemy Insights, Inc. |
|
|
23
|
+
| `@account-kit/infra` | MIT | © 2023 Alchemy Insights, Inc. |
|
|
24
|
+
| `@account-kit/logging` | MIT | © 2023 Alchemy Insights, Inc. |
|
|
25
|
+
| `@account-kit/smart-contracts` | MIT | © 2023 Alchemy Insights, Inc. |
|
|
26
|
+
| `@solana/addresses` | MIT | © 2023 Solana Labs, Inc |
|
|
27
|
+
| `@solana/codecs-core` | MIT | © 2023 Solana Labs, Inc |
|
|
28
|
+
| `@solana/codecs-strings` | MIT | © 2023 Solana Labs, Inc |
|
|
29
|
+
| `@solana/errors` | MIT | © 2023 Solana Labs, Inc |
|
|
30
|
+
| `@solana/text-encoding-impl` | MIT | © 2023 Solana Labs, Inc |
|
|
31
|
+
| `zod` | MIT | © 2025 Colin McDonnell |
|
|
32
|
+
|
|
33
|
+
## License texts
|
|
34
|
+
|
|
35
|
+
### MIT License — Alchemy packages
|
|
36
|
+
|
|
37
|
+
Applies to: `@aa-sdk/core`, `@account-kit/infra`, `@account-kit/logging`,
|
|
38
|
+
`@account-kit/smart-contracts`
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
MIT License
|
|
42
|
+
|
|
43
|
+
Copyright (c) 2023 Alchemy Insights, Inc.
|
|
44
|
+
|
|
45
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
46
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
47
|
+
in the Software without restriction, including without limitation the rights
|
|
48
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
50
|
+
furnished to do so, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
The above copyright notice and this permission notice shall be included in all
|
|
53
|
+
copies or substantial portions of the Software.
|
|
54
|
+
|
|
55
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
56
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
57
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
58
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
59
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
60
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
61
|
+
SOFTWARE.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### MIT License — Solana packages
|
|
65
|
+
|
|
66
|
+
Applies to: `@solana/addresses`, `@solana/codecs-core`,
|
|
67
|
+
`@solana/codecs-strings`, `@solana/errors`, `@solana/text-encoding-impl`
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Copyright (c) 2023 Solana Labs, Inc
|
|
71
|
+
|
|
72
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
73
|
+
a copy of this software and associated documentation files (the
|
|
74
|
+
"Software"), to deal in the Software without restriction, including
|
|
75
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
76
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
77
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
78
|
+
the following conditions:
|
|
79
|
+
|
|
80
|
+
The above copyright notice and this permission notice shall be
|
|
81
|
+
included in all copies or substantial portions of the Software.
|
|
82
|
+
|
|
83
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
84
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
85
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
86
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
87
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
88
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
89
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### MIT License — zod
|
|
93
|
+
|
|
94
|
+
Applies to: `zod`
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
MIT License
|
|
98
|
+
|
|
99
|
+
Copyright (c) 2025 Colin McDonnell
|
|
100
|
+
|
|
101
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
102
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
103
|
+
in the Software without restriction, including without limitation the rights
|
|
104
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
105
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
106
|
+
furnished to do so, subject to the following conditions:
|
|
107
|
+
|
|
108
|
+
The above copyright notice and this permission notice shall be included in all
|
|
109
|
+
copies or substantial portions of the Software.
|
|
110
|
+
|
|
111
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
112
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
113
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
114
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
115
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
116
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
117
|
+
SOFTWARE.
|
|
118
|
+
```
|
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.10-staging.0";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as BuildRouteResult, k as Transaction, T as TrustwareConfigOptions, i as WalletInterFaceAPI, z as ResolvedTrustwareConfig, V as TrustwareTheme, a1 as WalletIdentity, w as walletManager, Y as WalletAddressResolution, a8 as buildRoute, a9 as buildDepositAddress, aa as submitReceipt, ab as getStatus, ac as pollStatus } from './manager-BwjyFjjz.cjs';
|
|
2
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
3
|
import { T as Token } from './types-DX3HtFcn.cjs';
|
|
4
4
|
|
|
@@ -8,6 +8,7 @@ type AddressValidationResult = {
|
|
|
8
8
|
};
|
|
9
9
|
declare function validateEvmAddress(address: string): AddressValidationResult;
|
|
10
10
|
declare function validateSeiAddress(address: string): AddressValidationResult;
|
|
11
|
+
declare function validateCosmosAddress(address: string, chain?: ChainDef | ChainType | string | null): AddressValidationResult;
|
|
11
12
|
declare function validateSolanaAddress(address: string): AddressValidationResult;
|
|
12
13
|
declare function validateBtcAddress(address: string): AddressValidationResult;
|
|
13
14
|
declare function validateAddressForChain(address: string, chain?: ChainDef | ChainType | string | null): AddressValidationResult;
|
|
@@ -140,4 +141,4 @@ declare const Trustware: {
|
|
|
140
141
|
};
|
|
141
142
|
type TrustwareCore = typeof Trustware;
|
|
142
143
|
|
|
143
|
-
export { Trustware as T, type TrustwareCore as a, validateBtcAddress as b,
|
|
144
|
+
export { Trustware as T, type TrustwareCore as a, validateBtcAddress as b, validateCosmosAddress as c, validateEvmAddress as d, validateRouteAddresses as e, validateSeiAddress as f, validateSolanaAddress as g, validateAddressForChain as v };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as BuildRouteResult, k as Transaction, T as TrustwareConfigOptions, i as WalletInterFaceAPI, z as ResolvedTrustwareConfig, V as TrustwareTheme, a1 as WalletIdentity, w as walletManager, Y as WalletAddressResolution, a8 as buildRoute, a9 as buildDepositAddress, aa as submitReceipt, ab as getStatus, ac as pollStatus } from './manager-B6NNV-E_.js';
|
|
2
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
3
|
import { T as Token } from './types-BJY9r-mz.js';
|
|
4
4
|
|
|
@@ -8,6 +8,7 @@ type AddressValidationResult = {
|
|
|
8
8
|
};
|
|
9
9
|
declare function validateEvmAddress(address: string): AddressValidationResult;
|
|
10
10
|
declare function validateSeiAddress(address: string): AddressValidationResult;
|
|
11
|
+
declare function validateCosmosAddress(address: string, chain?: ChainDef | ChainType | string | null): AddressValidationResult;
|
|
11
12
|
declare function validateSolanaAddress(address: string): AddressValidationResult;
|
|
12
13
|
declare function validateBtcAddress(address: string): AddressValidationResult;
|
|
13
14
|
declare function validateAddressForChain(address: string, chain?: ChainDef | ChainType | string | null): AddressValidationResult;
|
|
@@ -140,4 +141,4 @@ declare const Trustware: {
|
|
|
140
141
|
};
|
|
141
142
|
type TrustwareCore = typeof Trustware;
|
|
142
143
|
|
|
143
|
-
export { Trustware as T, type TrustwareCore as a, validateBtcAddress as b,
|
|
144
|
+
export { Trustware as T, type TrustwareCore as a, validateBtcAddress as b, validateCosmosAddress as c, validateEvmAddress as d, validateRouteAddresses as e, validateSeiAddress as f, validateSolanaAddress as g, validateAddressForChain as v };
|