btc-wallet 0.5.75-beta → 0.5.76-beta
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/core/setupModal.d.ts +7 -0
- package/dist/index.js +17 -10
- package/dist/index.js.map +2 -2
- package/esm/index.js +17 -10
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/esm/index.js
CHANGED
@@ -5129,7 +5129,8 @@ function setupWalletSelectorModal(selector, options) {
|
|
5129
5129
|
draggable = true,
|
5130
5130
|
initialPosition = { right: "20px", bottom: "20px" },
|
5131
5131
|
buttonSize = "60px",
|
5132
|
-
mobileButtonSize = "40px"
|
5132
|
+
mobileButtonSize = "40px",
|
5133
|
+
customGroups = []
|
5133
5134
|
} = options;
|
5134
5135
|
subscription == null ? void 0 : subscription.unsubscribe();
|
5135
5136
|
const state = selector.store.getState();
|
@@ -5172,7 +5173,7 @@ function setupWalletSelectorModal(selector, options) {
|
|
5172
5173
|
const modal = _setupModal(selector, options);
|
5173
5174
|
const originalShow = modal.show.bind(modal);
|
5174
5175
|
modal.show = () => __async(this, null, function* () {
|
5175
|
-
const chain = group.length > 1 && showChainGroups ? yield openChainModal(group) : group[0];
|
5176
|
+
const chain = group.length > 1 && showChainGroups ? yield openChainModal(group, customGroups) : group[0];
|
5176
5177
|
if (["btc", "eth"].includes(chain)) {
|
5177
5178
|
const moduleId = chain === "btc" ? "btc-wallet" : "ethereum-wallets";
|
5178
5179
|
const module = state.modules.find((module2) => module2.id === moduleId);
|
@@ -5182,6 +5183,11 @@ function setupWalletSelectorModal(selector, options) {
|
|
5182
5183
|
}
|
5183
5184
|
} else if (chain === "near") {
|
5184
5185
|
originalShow();
|
5186
|
+
} else {
|
5187
|
+
const customGroup = customGroups.find((g) => g.id === chain);
|
5188
|
+
if (customGroup == null ? void 0 : customGroup.onClick) {
|
5189
|
+
yield customGroup.onClick(customGroup);
|
5190
|
+
}
|
5185
5191
|
}
|
5186
5192
|
});
|
5187
5193
|
return modal;
|
@@ -5191,17 +5197,18 @@ var CHAINS = [
|
|
5191
5197
|
{ id: "eth", name: "Ethereum", description: "EVM address as Near Account" },
|
5192
5198
|
{ id: "btc", name: "Bitcoin", description: "MPC Mapping" }
|
5193
5199
|
];
|
5194
|
-
function openChainModal(
|
5195
|
-
return __async(this,
|
5200
|
+
function openChainModal(_0) {
|
5201
|
+
return __async(this, arguments, function* (group, customGroups = []) {
|
5196
5202
|
const chains5 = CHAINS.filter((chain) => group.includes(chain.id));
|
5203
|
+
const allGroups = [...chains5, ...customGroups];
|
5197
5204
|
const content = (resolve, close) => {
|
5198
5205
|
const buttons = `
|
5199
|
-
<div class="option-list">${
|
5200
|
-
(
|
5201
|
-
<img src="https://assets.deltatrade.ai/assets/chain/${
|
5206
|
+
<div class="option-list">${allGroups.map(
|
5207
|
+
(item) => `<button class="chain-button option-item" data-chain="${item.id}">
|
5208
|
+
<img src="https://assets.deltatrade.ai/assets/chain/${item.id}.svg" alt="${item.id}" style="width:32px; height: 32px;" />
|
5202
5209
|
<div style="display: flex; flex-direction: column; text-align: left;">
|
5203
|
-
<div style="font-size: 16px; font-weight: bold;">${
|
5204
|
-
<div style="font-size: 12px; opacity:0.5;">${
|
5210
|
+
<div style="font-size: 16px; font-weight: bold;">${item.name}</div>
|
5211
|
+
<div style="font-size: 12px; opacity:0.5;">${item.description}</div>
|
5205
5212
|
</div>
|
5206
5213
|
</button>`
|
5207
5214
|
).join("")}
|
@@ -5243,7 +5250,7 @@ function getGroup(state) {
|
|
5243
5250
|
|
5244
5251
|
// src/index.ts
|
5245
5252
|
var getVersion = () => {
|
5246
|
-
return "0.5.
|
5253
|
+
return "0.5.76-beta";
|
5247
5254
|
};
|
5248
5255
|
if (typeof window !== "undefined") {
|
5249
5256
|
window.__BTC_WALLET_VERSION = getVersion();
|