btc-wallet 0.5.59-beta → 0.5.61-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/index.js +37 -13
- package/dist/index.js.map +2 -2
- package/esm/index.js +37 -13
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1171,7 +1171,7 @@ var MagicEdenConnector = class extends BaseConnector {
|
|
1171
1171
|
};
|
1172
1172
|
sendBtcTransaction(sendBtcOptions).catch((e) => reject(e));
|
1173
1173
|
});
|
1174
|
-
return result;
|
1174
|
+
return (result == null ? void 0 : result.txid) || result;
|
1175
1175
|
});
|
1176
1176
|
}
|
1177
1177
|
disconnect() {
|
@@ -4472,9 +4472,12 @@ function setupWalletButton({
|
|
4472
4472
|
}, 0);
|
4473
4473
|
}
|
4474
4474
|
});
|
4475
|
+
const isNearWallet = !btcWallet;
|
4476
|
+
const openImageUrl = `https://assets.deltatrade.ai/wallet-assets/wallet${isNearWallet ? "-near" : ""}-btn.png`;
|
4477
|
+
const closeImageUrl = `https://assets.deltatrade.ai/wallet-assets/wallet${isNearWallet ? "-near" : ""}-btn-active.png`;
|
4475
4478
|
const button = createFloatingButtonWithIframe({
|
4476
|
-
openImageUrl
|
4477
|
-
closeImageUrl
|
4479
|
+
openImageUrl,
|
4480
|
+
closeImageUrl,
|
4478
4481
|
iframe
|
4479
4482
|
});
|
4480
4483
|
setupButtonClickHandler(button, iframe, nearWallet, btcWallet);
|
@@ -5146,12 +5149,20 @@ function setupWalletSelectorModal(selector, options) {
|
|
5146
5149
|
}
|
5147
5150
|
`;
|
5148
5151
|
}
|
5152
|
+
if (group.includes("eth")) {
|
5153
|
+
document.head.appendChild(document.createElement("style")).textContent = `
|
5154
|
+
#near-wallet-selector-modal .options-list .ethereum-wallets {
|
5155
|
+
display: none;
|
5156
|
+
}
|
5157
|
+
`;
|
5158
|
+
}
|
5149
5159
|
const modal = (0, import_ref_modal_ui.setupModal)(selector, options);
|
5150
5160
|
const originalShow = modal.show.bind(modal);
|
5151
5161
|
modal.show = () => __async(this, null, function* () {
|
5152
|
-
const chain = group.length > 1 && showChainGroups ? yield openChainModal() : group[0];
|
5153
|
-
if (
|
5154
|
-
const
|
5162
|
+
const chain = group.length > 1 && showChainGroups ? yield openChainModal(group) : group[0];
|
5163
|
+
if (["btc", "eth"].includes(chain)) {
|
5164
|
+
const moduleId = chain === "btc" ? "btc-wallet" : "ethereum-wallets";
|
5165
|
+
const module2 = state.modules.find((module3) => module3.id === moduleId);
|
5155
5166
|
if (module2) {
|
5156
5167
|
const wallet = yield module2.wallet();
|
5157
5168
|
yield wallet.signIn(options);
|
@@ -5162,15 +5173,23 @@ function setupWalletSelectorModal(selector, options) {
|
|
5162
5173
|
});
|
5163
5174
|
return modal;
|
5164
5175
|
}
|
5165
|
-
|
5176
|
+
var CHAINS = [
|
5177
|
+
{ id: "btc", name: "Bitcoin", description: "MPC Mapping" },
|
5178
|
+
{ id: "eth", name: "Ethereum", description: "EVM address as Near Account" },
|
5179
|
+
{ id: "near", name: "Near", description: "Near Account" }
|
5180
|
+
];
|
5181
|
+
function openChainModal(group) {
|
5166
5182
|
return __async(this, null, function* () {
|
5167
|
-
const chains5 =
|
5183
|
+
const chains5 = CHAINS.filter((chain) => group.includes(chain.id));
|
5168
5184
|
const content = (resolve, close) => {
|
5169
5185
|
const buttons = `
|
5170
5186
|
<div class="option-list">${chains5.map(
|
5171
|
-
(chain) => `<button class="chain-button option-item" data-chain="${chain}">
|
5172
|
-
|
5173
|
-
|
5187
|
+
(chain) => `<button class="chain-button option-item" data-chain="${chain.id}">
|
5188
|
+
<img src="https://assets.deltatrade.ai/assets/chain/${chain.id}.svg" alt="${chain.id}" style="width:32px; height: 32px;" />
|
5189
|
+
<div style="display: flex; flex-direction: column; text-align: left;">
|
5190
|
+
<div style="font-size: 16px; font-weight: bold;">${chain.name}</div>
|
5191
|
+
<div style="font-size: 12px; opacity:0.5;">${chain.description}</div>
|
5192
|
+
</div>
|
5174
5193
|
</button>`
|
5175
5194
|
).join("")}
|
5176
5195
|
</div>
|
@@ -5195,10 +5214,15 @@ function openChainModal() {
|
|
5195
5214
|
}
|
5196
5215
|
function getGroup(state) {
|
5197
5216
|
const hasBtcWallet = state.modules.some((module2) => module2.id === "btc-wallet");
|
5198
|
-
const
|
5217
|
+
const hasEvmWallet = state.modules.some((module2) => module2.id === "ethereum-wallets");
|
5218
|
+
const hasNearWallet = state.modules.some(
|
5219
|
+
(module2) => module2.id !== "btc-wallet" && module2.id !== "ethereum-wallets"
|
5220
|
+
);
|
5199
5221
|
const group = [];
|
5200
5222
|
if (hasBtcWallet)
|
5201
5223
|
group.push("btc");
|
5224
|
+
if (hasEvmWallet)
|
5225
|
+
group.push("eth");
|
5202
5226
|
if (hasNearWallet)
|
5203
5227
|
group.push("near");
|
5204
5228
|
return group;
|
@@ -5206,7 +5230,7 @@ function getGroup(state) {
|
|
5206
5230
|
|
5207
5231
|
// src/index.ts
|
5208
5232
|
var getVersion = () => {
|
5209
|
-
return "0.5.
|
5233
|
+
return "0.5.61-beta";
|
5210
5234
|
};
|
5211
5235
|
if (typeof window !== "undefined") {
|
5212
5236
|
window.__BTC_WALLET_VERSION = getVersion();
|