Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
aeca912
Build ML transactions from the wallet UTXO set
owlsua Aug 28, 2026
5a6785d
Record spent outpoints for unconfirmed transactions
owlsua Aug 28, 2026
1341273
Allow withdrawing the full delegation balance
owlsua Aug 28, 2026
1d10a02
Stop clipping the round skeleton loader
owlsua Aug 28, 2026
1f782ba
Give both onboarding buttons the same 52px height
owlsua Aug 28, 2026
0f7cc73
Keep the wallet unlocked when the rates API is down
owlsua Aug 28, 2026
bed6d8d
Convert BTC public keys to hex without Buffer
owlsua Aug 28, 2026
535e5e6
Ship Montserrat with the extension
owlsua Aug 28, 2026
935fe1f
Bump @mintlayer/sdk to 1.0.38
owlsua Aug 28, 2026
e231573
Re-enable the external dApp API
owlsua Aug 28, 2026
ac9deb3
Show the requesting site on the signing screens
owlsua Aug 28, 2026
5282cc4
Rebuild the connection page
owlsua Aug 28, 2026
1e166ba
Add a connections section to settings
owlsua Aug 28, 2026
d1617ff
Use the loop icon for the swap button
owlsua Aug 28, 2026
7a2cd8b
Answer the site when a connection request is rejected
owlsua Aug 29, 2026
4f1f7cd
Search every order when no amount is given
owlsua Aug 30, 2026
b9ea434
Show the whole transaction on the signing screens
owlsua Aug 30, 2026
9091fc1
Restyle the signing preview as one list
owlsua Aug 30, 2026
c105967
Apply the send button class through the CSS module
owlsua Aug 30, 2026
066674b
Let ML amounts be typed to eleven decimals
owlsua Aug 30, 2026
b83ac08
Keep the 24h stat labels on one line
owlsua Aug 30, 2026
c208dfa
Apply the send button class through the CSS module in the BTC form
owlsua Aug 30, 2026
cbe3914
Let the signing screens grow with their content
owlsua Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@bitcoinerlab/secp256k1": "^1.2.0",
"@mintlayer/sdk": "1.0.37",
"@mintlayer/sdk": "1.0.38",
"@noble/secp256k1": "^3.0.0",
"bip32": "^5.0.0",
"bip39": "^3.1.0",
Expand Down
262 changes: 142 additions & 120 deletions public/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,129 +42,125 @@
sendResponse({
result: { isConnected: !!connectedSites[origin] },
})
// External dApp API disabled — uncomment blocks below to re-enable
} else if (message.method === 'connect') {
sendResponse({ error: 'External connections are disabled' })
// if (connectWindowId === false) {
// pendingResponses.set(message.requestId, sendResponse)
// api.windows.create(
// {
// url: api.runtime.getURL('popup.html'),
// type: 'popup',
// width: 800,
// height: 600,
// focused: true,
// },
// (win) => {
// connectWindowId = win.id
// api.storage.local.set(
// {
// pendingRequest: {
// origin,
// requestId: message.requestId,
// // networkType: message.params.networkType,
// // permission: message.params.permission,
// action: 'connect',
// },
// },
// () => {
// if (api.runtime.lastError) {
// console.error(
// '[Mintlayer] Storage set error:',
// api.runtime.lastError,
// )
// }
// },
// )
// },
// )
// return true // Keep channel open
// } else if (typeof connectWindowId === 'number') {
// api.windows.update(connectWindowId, { focused: true })
// sendResponse({ error: 'Connection window already open' })
// }
if (connectWindowId === false) {
pendingResponses.set(message.requestId, sendResponse)
api.windows.create(
{
url: api.runtime.getURL('popup.html'),
type: 'popup',
width: 800,
height: 600,
focused: true,
},
(win) => {
connectWindowId = win.id
api.storage.local.set(
{
pendingRequest: {
origin,
requestId: message.requestId,
// networkType: message.params.networkType,
// permission: message.params.permission,
action: 'connect',
},
},
() => {
if (api.runtime.lastError) {
console.error(
'[Mintlayer] Storage set error:',
api.runtime.lastError,
)
}
},
)
},
)
return true // Keep channel open
} else if (typeof connectWindowId === 'number') {
api.windows.update(connectWindowId, { focused: true })
sendResponse({ error: 'Connection window already open' })
}
} else if (message.method === 'signTransaction') {
sendResponse({ error: 'External signing is disabled' })
// if (!connectedSites[origin]) {
// sendResponse({ error: 'Not connected. Call connect first.' })
// } else if (popupWindowId === false) {
// pendingResponses.set(message.requestId, sendResponse)
// api.windows.create(
// {
// url: api.runtime.getURL('popup.html'),
// type: 'popup',
// width: 800,
// height: 600,
// focused: true,
// },
// (win) => {
// popupWindowId = win.id
// api.storage.local.set(
// {
// pendingRequest: {
// origin,
// requestId: message.requestId,
// action: 'signTransaction',
// data: message.params || {},
// },
// },
// () => {
// if (api.runtime.lastError) {
// console.error(
// '[Mintlayer] Storage set error:',
// api.runtime.lastError,
// )
// }
// },
// )
// },
// )
// return true
// } else if (typeof popupWindowId === 'number') {
// api.windows.update(popupWindowId, { focused: true })
// sendResponse({ error: 'Transaction signing window already open' })
// }
if (!connectedSites[origin]) {
sendResponse({ error: 'Not connected. Call connect first.' })
} else if (popupWindowId === false) {
pendingResponses.set(message.requestId, sendResponse)
api.windows.create(
{
url: api.runtime.getURL('popup.html'),
type: 'popup',
width: 800,
height: 600,
focused: true,
},
(win) => {
popupWindowId = win.id
api.storage.local.set(
{
pendingRequest: {
origin,
requestId: message.requestId,
action: 'signTransaction',
data: message.params || {},
},
},
() => {
if (api.runtime.lastError) {
console.error(
'[Mintlayer] Storage set error:',
api.runtime.lastError,
)
}
},
)
},
)
return true
} else if (typeof popupWindowId === 'number') {
api.windows.update(popupWindowId, { focused: true })
sendResponse({ error: 'Transaction signing window already open' })
}
} else if (message.method === 'signChallenge') {
sendResponse({ error: 'External signing is disabled' })
// if (!connectedSites[origin]) {
// sendResponse({ error: 'Not connected. Call connect first.' })
// } else if (popupWindowId === false) {
// pendingResponses.set(message.requestId, sendResponse)
// api.windows.create(
// {
// url: api.runtime.getURL('popup.html'),
// type: 'popup',
// width: 800,
// height: 600,
// focused: true,
// },
// (win) => {
// popupWindowId = win.id
// api.storage.local.set(
// {
// pendingRequest: {
// origin,
// requestId: message.requestId,
// action: 'signChallenge',
// data: message.params || {},
// },
// },
// () => {
// if (api.runtime.lastError) {
// console.error(
// '[Mintlayer] Storage set error:',
// api.runtime.lastError,
// )
// }
// },
// )
// },
// )
// return true
// } else if (typeof popupWindowId === 'number') {
// api.windows.update(popupWindowId, { focused: true })
// sendResponse({ error: 'Transaction signing window already open' })
// }
if (!connectedSites[origin]) {
sendResponse({ error: 'Not connected. Call connect first.' })
} else if (popupWindowId === false) {
pendingResponses.set(message.requestId, sendResponse)
api.windows.create(
{
url: api.runtime.getURL('popup.html'),
type: 'popup',
width: 800,
height: 600,
focused: true,
},
(win) => {
popupWindowId = win.id
api.storage.local.set(
{
pendingRequest: {
origin,
requestId: message.requestId,
action: 'signChallenge',
data: message.params || {},
},
},
() => {
if (api.runtime.lastError) {
console.error(
'[Mintlayer] Storage set error:',
api.runtime.lastError,
)
}
},
)
},
)
return true
} else if (typeof popupWindowId === 'number') {
api.windows.update(popupWindowId, { focused: true })
sendResponse({ error: 'Transaction signing window already open' })
}
} else if (message.method === 'version') {
sendResponse({ result: api.runtime.getManifest().version })
} else if (message.method === 'getSession') {
Expand All @@ -187,6 +183,27 @@
}
}

// Handle disconnect requests from the wallet UI
if (message.action === 'disconnectSite') {
const targetOrigin = message.origin

if (!targetOrigin || !connectedSites[targetOrigin]) {
sendResponse({ result: null })
return
}

delete connectedSites[targetOrigin]
api.storage.local.set({ connectedSites }, () => {
if (api.runtime.lastError) {
console.error('[Mintlayer] Storage set error:', api.runtime.lastError)
sendResponse({ error: api.runtime.lastError.message })
return
}
sendResponse({ result: { origin: targetOrigin } })
})
return true
}

if (!message.method && message.action !== 'popupResponse') return

// Handle popup responses
Expand All @@ -211,6 +228,11 @@
pendingResponses.delete(requestId)
}
})
} else if (!result && message.method === 'connect') {
if (storedSendResponse) {
storedSendResponse({ error: error || 'User rejected the request' })
pendingResponses.delete(requestId)
}
} else if (result && message.method === 'signTransaction_approve') {
storedSendResponse({ result, error })
pendingResponses.delete(requestId)
Expand Down
18 changes: 0 additions & 18 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@
rel="icon"
href="favicon.ico"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin
/>
<link
rel="preload"
as="style"
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,600;0,700;1,400&display=swap"
/>
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,600;0,700;1,400&display=swap"
rel="stylesheet"
/>
<meta
name="description"
content="Mojito - A Mintlayer Wallet"
Expand Down
2 changes: 1 addition & 1 deletion public/manifestDefault.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"512": "logo512.png"
},
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; img-src 'self' data:; style-src 'self' https://fonts.cdnfonts.com https://fonts.googleapis.com https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com https://fonts.cdnfonts.com; style-src-elem 'self' https://fonts.googleapis.com"
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; img-src 'self' data:; style-src 'self'; font-src 'self'; style-src-elem 'self'"
},
"action": {
"default_icon": "logo192.png",
Expand Down
2 changes: 1 addition & 1 deletion public/manifestFirefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"default_panel": "index.html"
},
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; img-src 'self' data:; style-src 'self' https://fonts.cdnfonts.com https://fonts.googleapis.com https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com https://fonts.cdnfonts.com; style-src-elem 'self' https://fonts.googleapis.com"
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; img-src 'self' data:; style-src 'self'; font-src 'self'; style-src-elem 'self'"
},
"commands": {
"_execute_action": {
Expand Down
Loading
Loading