@trustware/sdk-staging 1.1.8-staging.3 → 1.1.8-staging.4
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 +27 -0
- package/dist/blockchain-BONedEsU.d.cts +110 -0
- package/dist/blockchain-BONedEsU.d.ts +110 -0
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{core-u95iahDO.d.cts → core-B9PJ0mUX.d.cts} +3 -2
- package/dist/{core-CVbN3gJy.d.ts → core-DrWK6PT3.d.ts} +3 -2
- package/dist/core.cjs +2290 -2247
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +4 -3
- package/dist/core.d.ts +4 -3
- package/dist/core.mjs +2277 -2244
- package/dist/core.mjs.map +1 -1
- package/dist/{detect-6MRR4B7g.d.ts → detect-BLE9aPwJ.d.ts} +2 -2
- package/dist/{detect-DVIWcXpl.d.cts → detect-Dn7A-Svt.d.cts} +2 -2
- package/dist/index.cjs +22356 -3553
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -10
- package/dist/index.d.ts +28 -10
- package/dist/index.mjs +28302 -9499
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-CXSw1h5e.d.cts → manager-C85ARoxD.d.cts} +65 -121
- package/dist/{manager-CXSw1h5e.d.ts → manager-PBjHXKjh.d.ts} +65 -121
- package/dist/smart-account.cjs +14707 -0
- package/dist/smart-account.cjs.map +1 -0
- package/dist/smart-account.d.cts +3962 -0
- package/dist/smart-account.d.ts +3962 -0
- package/dist/smart-account.mjs +14686 -0
- package/dist/smart-account.mjs.map +1 -0
- package/dist/types-B3nKHW6H.d.cts +32 -0
- package/dist/types-MtdjJgwT.d.ts +32 -0
- package/dist/wallet.cjs +29 -9
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +4 -3
- package/dist/wallet.d.ts +4 -3
- package/dist/wallet.mjs +16 -6
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +33042 -14248
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.d.cts +5 -4
- package/dist/widget.d.ts +5 -4
- package/dist/widget.mjs +32978 -14180
- package/dist/widget.mjs.map +1 -1
- package/package.json +17 -4
- package/dist/types-BrVfNxND.d.cts +0 -14
- package/dist/types-BrVfNxND.d.ts +0 -14
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { C as ChainDef } from './blockchain-BONedEsU.cjs';
|
|
2
|
+
|
|
3
|
+
interface YourTokenData {
|
|
4
|
+
chainIconURI: string;
|
|
5
|
+
chainData: ChainDef | undefined;
|
|
6
|
+
symbol: string;
|
|
7
|
+
decimals: number;
|
|
8
|
+
name: string;
|
|
9
|
+
iconUrl: string;
|
|
10
|
+
logoURI?: string;
|
|
11
|
+
chainId: number | string;
|
|
12
|
+
usdPrice: number | undefined;
|
|
13
|
+
address: string;
|
|
14
|
+
chain_key: string;
|
|
15
|
+
category: "native" | "erc20" | "spl" | "btc";
|
|
16
|
+
contract?: string;
|
|
17
|
+
balance: string;
|
|
18
|
+
}
|
|
19
|
+
type NavigationStep = "home" | "select-token" | "crypto-pay" | "processing" | "success" | "error";
|
|
20
|
+
interface Token {
|
|
21
|
+
address: string;
|
|
22
|
+
symbol: string;
|
|
23
|
+
name: string;
|
|
24
|
+
decimals: number;
|
|
25
|
+
iconUrl?: string;
|
|
26
|
+
logoURI?: string;
|
|
27
|
+
balance?: string;
|
|
28
|
+
chainId: string | number;
|
|
29
|
+
usdPrice: number | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type { NavigationStep as N, Token as T, YourTokenData as Y };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { C as ChainDef } from './blockchain-BONedEsU.js';
|
|
2
|
+
|
|
3
|
+
interface YourTokenData {
|
|
4
|
+
chainIconURI: string;
|
|
5
|
+
chainData: ChainDef | undefined;
|
|
6
|
+
symbol: string;
|
|
7
|
+
decimals: number;
|
|
8
|
+
name: string;
|
|
9
|
+
iconUrl: string;
|
|
10
|
+
logoURI?: string;
|
|
11
|
+
chainId: number | string;
|
|
12
|
+
usdPrice: number | undefined;
|
|
13
|
+
address: string;
|
|
14
|
+
chain_key: string;
|
|
15
|
+
category: "native" | "erc20" | "spl" | "btc";
|
|
16
|
+
contract?: string;
|
|
17
|
+
balance: string;
|
|
18
|
+
}
|
|
19
|
+
type NavigationStep = "home" | "select-token" | "crypto-pay" | "processing" | "success" | "error";
|
|
20
|
+
interface Token {
|
|
21
|
+
address: string;
|
|
22
|
+
symbol: string;
|
|
23
|
+
name: string;
|
|
24
|
+
decimals: number;
|
|
25
|
+
iconUrl?: string;
|
|
26
|
+
logoURI?: string;
|
|
27
|
+
balance?: string;
|
|
28
|
+
chainId: string | number;
|
|
29
|
+
usdPrice: number | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type { NavigationStep as N, Token as T, YourTokenData as Y };
|
package/dist/wallet.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
9
|
var __esm = (fn, res) => function __init() {
|
|
@@ -19,6 +21,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
21
|
}
|
|
20
22
|
return to;
|
|
21
23
|
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
22
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
33
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
34
|
|
|
@@ -240,7 +250,7 @@ var init_constants = __esm({
|
|
|
240
250
|
"src/constants.ts"() {
|
|
241
251
|
"use strict";
|
|
242
252
|
SDK_NAME = "@trustware/sdk";
|
|
243
|
-
SDK_VERSION = "1.1.8-staging.
|
|
253
|
+
SDK_VERSION = "1.1.8-staging.4";
|
|
244
254
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
245
255
|
API_PREFIX = "/api";
|
|
246
256
|
WALLETCONNECT_PROJECT_ID = "72ea74c400f5111d43aea638d7d83a24";
|
|
@@ -284,7 +294,11 @@ var init_config = __esm({
|
|
|
284
294
|
DEFAULT_FEATURE_FLAGS = {
|
|
285
295
|
tokensPagination: true,
|
|
286
296
|
balanceStreaming: false,
|
|
287
|
-
shouldAllowGA4: true
|
|
297
|
+
shouldAllowGA4: true,
|
|
298
|
+
swapMode: false,
|
|
299
|
+
swapDefaultDestToken: null,
|
|
300
|
+
swapLockDestToken: false,
|
|
301
|
+
swapAllowedDestTokens: null
|
|
288
302
|
};
|
|
289
303
|
}
|
|
290
304
|
});
|
|
@@ -3453,7 +3467,11 @@ function resolveConfig(input) {
|
|
|
3453
3467
|
const features = {
|
|
3454
3468
|
tokensPagination: input.features?.tokensPagination ?? DEFAULT_FEATURE_FLAGS.tokensPagination,
|
|
3455
3469
|
balanceStreaming: input.features?.balanceStreaming ?? DEFAULT_FEATURE_FLAGS.balanceStreaming,
|
|
3456
|
-
shouldAllowGA4: input.features?.shouldAllowGA4 ?? DEFAULT_FEATURE_FLAGS.shouldAllowGA4
|
|
3470
|
+
shouldAllowGA4: input.features?.shouldAllowGA4 ?? DEFAULT_FEATURE_FLAGS.shouldAllowGA4,
|
|
3471
|
+
swapMode: input.features?.swapMode ?? DEFAULT_FEATURE_FLAGS.swapMode,
|
|
3472
|
+
swapDefaultDestToken: input.features?.swapDefaultDestToken ?? DEFAULT_FEATURE_FLAGS.swapDefaultDestToken,
|
|
3473
|
+
swapLockDestToken: input.features?.swapLockDestToken ?? DEFAULT_FEATURE_FLAGS.swapLockDestToken,
|
|
3474
|
+
swapAllowedDestTokens: input.features?.swapAllowedDestTokens ?? DEFAULT_FEATURE_FLAGS.swapAllowedDestTokens
|
|
3457
3475
|
};
|
|
3458
3476
|
return {
|
|
3459
3477
|
apiKey: input.apiKey,
|
|
@@ -3669,12 +3687,13 @@ function decodeBase64(serializedTransaction) {
|
|
|
3669
3687
|
const binary = globalThis.atob(trimmed);
|
|
3670
3688
|
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
3671
3689
|
}
|
|
3672
|
-
function decodeBase64Transaction(serializedTransaction) {
|
|
3690
|
+
async function decodeBase64Transaction(serializedTransaction) {
|
|
3673
3691
|
const bytes = decodeBase64(serializedTransaction);
|
|
3692
|
+
const { Transaction, VersionedTransaction } = await import("@solana/web3.js");
|
|
3674
3693
|
try {
|
|
3675
|
-
return
|
|
3694
|
+
return VersionedTransaction.deserialize(bytes);
|
|
3676
3695
|
} catch {
|
|
3677
|
-
return
|
|
3696
|
+
return Transaction.from(bytes);
|
|
3678
3697
|
}
|
|
3679
3698
|
}
|
|
3680
3699
|
function encodeBase64(bytes) {
|
|
@@ -3760,7 +3779,9 @@ function toSolanaWalletInterface(provider) {
|
|
|
3760
3779
|
return "solana-mainnet-beta";
|
|
3761
3780
|
},
|
|
3762
3781
|
async sendSerializedTransaction(serializedTransactionBase64, chainId) {
|
|
3763
|
-
const transaction = decodeBase64Transaction(
|
|
3782
|
+
const transaction = await decodeBase64Transaction(
|
|
3783
|
+
serializedTransactionBase64
|
|
3784
|
+
);
|
|
3764
3785
|
if (provider.signAndSendTransaction) {
|
|
3765
3786
|
const result = await provider.signAndSendTransaction(transaction, {
|
|
3766
3787
|
preflightCommitment: "confirmed"
|
|
@@ -3783,11 +3804,10 @@ function toSolanaWalletInterface(provider) {
|
|
|
3783
3804
|
}
|
|
3784
3805
|
};
|
|
3785
3806
|
}
|
|
3786
|
-
var
|
|
3807
|
+
var SOLANA_WALLET_IDS;
|
|
3787
3808
|
var init_solana = __esm({
|
|
3788
3809
|
"src/wallets/solana.ts"() {
|
|
3789
3810
|
"use strict";
|
|
3790
|
-
import_web3 = require("@solana/web3.js");
|
|
3791
3811
|
init_sdkRpc();
|
|
3792
3812
|
SOLANA_WALLET_IDS = [
|
|
3793
3813
|
"phantom-solana",
|