@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 CHANGED
@@ -937,6 +937,23 @@ var gateways_default = [
937
937
  rpcUrl: "http://localhost:3030/api/v0/dapp"
938
938
  }
939
939
  ];
940
+
941
+ // src/wallets.json
942
+ var wallets_default = [
943
+ {
944
+ name: "Send Connect",
945
+ type: "browser",
946
+ providerId: "browser:ext:ldmohiccoioolenadmogclhoklmanpgi",
947
+ description: "Connect via a browser extension wallet",
948
+ icon: "https://info.send.it/img/favicon.svg",
949
+ installUrls: [
950
+ {
951
+ platform: "chrome",
952
+ url: "https://chromewebstore.google.com/detail/send-connect/ldmohiccoioolenadmogclhoklmanpgi"
953
+ }
954
+ ]
955
+ }
956
+ ];
940
957
  async function requestAnnouncedProviders(options) {
941
958
  if (typeof window === "undefined") return [];
942
959
  const timeoutMs = 300;
@@ -966,10 +983,14 @@ async function requestAnnouncedProviders(options) {
966
983
  }
967
984
 
968
985
  // src/sdk.ts
986
+ function defaultTrue(b) {
987
+ return b === void 0 ? true : b;
988
+ }
969
989
  function normalizeConnectOptions(options) {
970
990
  return {
971
991
  defaultAdapters: options.defaultAdapters === void 0 ? createDefaultAdapters(gateways_default) : options.defaultAdapters,
972
- additionalAdapters: options.additionalAdapters
992
+ additionalAdapters: options.additionalAdapters,
993
+ enableSuggestedWallets: defaultTrue(options.enableSuggestedWallets)
973
994
  };
974
995
  }
975
996
  var DappSDK = class {
@@ -1147,6 +1168,17 @@ var DappSDK = class {
1147
1168
  if (options) {
1148
1169
  this.configuredAdapters = normalizeConnectOptions(options);
1149
1170
  }
1171
+ const enableSuggestedWallets = defaultTrue(
1172
+ this.configuredAdapters?.enableSuggestedWallets
1173
+ );
1174
+ if (enableSuggestedWallets) {
1175
+ localStorage.setItem(
1176
+ "splice_wallet_picker_suggested_entries",
1177
+ JSON.stringify(wallets_default)
1178
+ );
1179
+ } else {
1180
+ localStorage.removeItem("splice_wallet_picker_suggested_entries");
1181
+ }
1150
1182
  this.initPromise = this.initPromise ? this.initPromise.then(
1151
1183
  () => this.ensureDiscovery(this.configuredAdapters)
1152
1184
  ) : this.ensureDiscovery(this.configuredAdapters);