@canton-network/dapp-sdk 1.2.0 → 1.3.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/dist/index.cjs +33 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/package.json +22 -18
package/dist/index.js
CHANGED
|
@@ -914,6 +914,23 @@ var gateways_default = [
|
|
|
914
914
|
rpcUrl: "http://localhost:3030/api/v0/dapp"
|
|
915
915
|
}
|
|
916
916
|
];
|
|
917
|
+
|
|
918
|
+
// src/wallets.json
|
|
919
|
+
var wallets_default = [
|
|
920
|
+
{
|
|
921
|
+
name: "Send Connect",
|
|
922
|
+
type: "browser",
|
|
923
|
+
providerId: "browser:ext:ldmohiccoioolenadmogclhoklmanpgi",
|
|
924
|
+
description: "Connect via a browser extension wallet",
|
|
925
|
+
icon: "https://info.send.it/img/favicon.svg",
|
|
926
|
+
installUrls: [
|
|
927
|
+
{
|
|
928
|
+
platform: "chrome",
|
|
929
|
+
url: "https://chromewebstore.google.com/detail/send-connect/ldmohiccoioolenadmogclhoklmanpgi"
|
|
930
|
+
}
|
|
931
|
+
]
|
|
932
|
+
}
|
|
933
|
+
];
|
|
917
934
|
async function requestAnnouncedProviders(options) {
|
|
918
935
|
if (typeof window === "undefined") return [];
|
|
919
936
|
const timeoutMs = 300;
|
|
@@ -943,10 +960,14 @@ async function requestAnnouncedProviders(options) {
|
|
|
943
960
|
}
|
|
944
961
|
|
|
945
962
|
// src/sdk.ts
|
|
963
|
+
function defaultTrue(b) {
|
|
964
|
+
return b === void 0 ? true : b;
|
|
965
|
+
}
|
|
946
966
|
function normalizeConnectOptions(options) {
|
|
947
967
|
return {
|
|
948
968
|
defaultAdapters: options.defaultAdapters === void 0 ? createDefaultAdapters(gateways_default) : options.defaultAdapters,
|
|
949
|
-
additionalAdapters: options.additionalAdapters
|
|
969
|
+
additionalAdapters: options.additionalAdapters,
|
|
970
|
+
enableSuggestedWallets: defaultTrue(options.enableSuggestedWallets)
|
|
950
971
|
};
|
|
951
972
|
}
|
|
952
973
|
var DappSDK = class {
|
|
@@ -1124,6 +1145,17 @@ var DappSDK = class {
|
|
|
1124
1145
|
if (options) {
|
|
1125
1146
|
this.configuredAdapters = normalizeConnectOptions(options);
|
|
1126
1147
|
}
|
|
1148
|
+
const enableSuggestedWallets = defaultTrue(
|
|
1149
|
+
this.configuredAdapters?.enableSuggestedWallets
|
|
1150
|
+
);
|
|
1151
|
+
if (enableSuggestedWallets) {
|
|
1152
|
+
localStorage.setItem(
|
|
1153
|
+
"splice_wallet_picker_suggested_entries",
|
|
1154
|
+
JSON.stringify(wallets_default)
|
|
1155
|
+
);
|
|
1156
|
+
} else {
|
|
1157
|
+
localStorage.removeItem("splice_wallet_picker_suggested_entries");
|
|
1158
|
+
}
|
|
1127
1159
|
this.initPromise = this.initPromise ? this.initPromise.then(
|
|
1128
1160
|
() => this.ensureDiscovery(this.configuredAdapters)
|
|
1129
1161
|
) : this.ensureDiscovery(this.configuredAdapters);
|